From 10979dea03d4b56390607648d365a3ad41985356 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Tue, 7 Sep 2021 16:07:07 -0700 Subject: [PATCH 01/85] updating proxy to use latest version (#20579) Co-authored-by: seankane-msft --- eng/common/testproxy/docker-start-proxy.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/common/testproxy/docker-start-proxy.ps1 b/eng/common/testproxy/docker-start-proxy.ps1 index 4e5da37278a2..6e0d0edd2b64 100644 --- a/eng/common/testproxy/docker-start-proxy.ps1 +++ b/eng/common/testproxy/docker-start-proxy.ps1 @@ -25,7 +25,7 @@ catch { Write-Error "Please check your docker invocation and try running the script again." } -$SELECTED_IMAGE_TAG = "1037115" +$SELECTED_IMAGE_TAG = "1084681" $CONTAINER_NAME = "ambitious_azsdk_test_proxy" $LINUX_IMAGE_SOURCE = "azsdkengsys.azurecr.io/engsys/testproxy-lin:${SELECTED_IMAGE_TAG}" $WINDOWS_IMAGE_SOURCE = "azsdkengsys.azurecr.io/engsys/testproxy-win:${SELECTED_IMAGE_TAG}" @@ -42,7 +42,7 @@ $SelectedImage = $LINUX_IMAGE_SOURCE $Initial = "" # most of the time, running this script on a windows machine will work just fine, as docker defaults to linux containers -# however, in CI, windows images default to _windows_ containers. We cannot swap them. We can tell if we're in a CI build by +# however, in CI, windows images default to _windows_ containers. We cannot swap them. We can tell if we're in a CI build by # checking for the environment variable TF_BUILD. if ($IsWindows -and $env:TF_BUILD){ $SelectedImage = $WINDOWS_IMAGE_SOURCE From 63d21c5ac469db996bfdcb53f384c5e1e1c18df6 Mon Sep 17 00:00:00 2001 From: Yalin Li Date: Tue, 7 Sep 2021 18:09:20 -0700 Subject: [PATCH 02/85] Run mypy in azure-keyvault-certificates CI (#20525) --- eng/tox/mypy_hard_failure_packages.py | 1 + .../azure/keyvault/certificates/_client.py | 12 +- .../azure/keyvault/certificates/_models.py | 233 +++++++++--------- .../azure/keyvault/certificates/_polling.py | 10 + .../keyvault/certificates/_shared/_polling.py | 4 +- .../keyvault/certificates/aio/_client.py | 10 +- .../azure-keyvault-certificates/mypy.ini | 7 + 7 files changed, 154 insertions(+), 123 deletions(-) create mode 100644 sdk/keyvault/azure-keyvault-certificates/mypy.ini diff --git a/eng/tox/mypy_hard_failure_packages.py b/eng/tox/mypy_hard_failure_packages.py index b85c70560081..7619732b13b4 100644 --- a/eng/tox/mypy_hard_failure_packages.py +++ b/eng/tox/mypy_hard_failure_packages.py @@ -10,6 +10,7 @@ "azure-eventhub", "azure-identity", "azure-keyvault-administration", + "azure-keyvault-certificates", "azure-servicebus", "azure-ai-textanalytics", "azure-ai-formrecognizer", diff --git a/sdk/keyvault/azure-keyvault-certificates/azure/keyvault/certificates/_client.py b/sdk/keyvault/azure-keyvault-certificates/azure/keyvault/certificates/_client.py index 0ba57e214bbb..bc741d035501 100644 --- a/sdk/keyvault/azure-keyvault-certificates/azure/keyvault/certificates/_client.py +++ b/sdk/keyvault/azure-keyvault-certificates/azure/keyvault/certificates/_client.py @@ -134,7 +134,7 @@ def begin_create_certificate(self, certificate_name, policy, **kwargs): create_certificate_polling = CreateCertificatePoller( get_certificate_command=get_certificate_command, interval=polling_interval ) - return LROPoller(command, create_certificate_operation, None, create_certificate_polling) + return LROPoller(command, create_certificate_operation, lambda *_: None, create_certificate_polling) @distributed_trace def get_certificate(self, certificate_name, **kwargs): @@ -668,13 +668,15 @@ def set_contacts(self, contacts, **kwargs): :caption: Create contacts :dedent: 8 """ - contacts = self._client.set_certificate_contacts( + new_contacts = self._client.set_certificate_contacts( vault_base_url=self.vault_url, contacts=self._models.Contacts(contact_list=[c._to_certificate_contacts_item() for c in contacts]), error_map=_error_map, **kwargs ) - return [CertificateContact._from_certificate_contacts_item(contact_item=item) for item in contacts.contact_list] + return [ + CertificateContact._from_certificate_contacts_item(contact_item=item) for item in new_contacts.contact_list + ] @distributed_trace def get_contacts(self, **kwargs): @@ -885,7 +887,7 @@ def create_issuer(self, issuer_name, provider, **kwargs): phone=contact.phone, ) for contact in admin_contacts - ] + ] # type: Optional[List[Any]] else: admin_details = None if organization_id or admin_details: @@ -946,7 +948,7 @@ def update_issuer(self, issuer_name, **kwargs): phone=contact.phone, ) for contact in admin_contacts - ] + ] # type: Optional[List[Any]] else: admin_details = None if organization_id or admin_details: diff --git a/sdk/keyvault/azure-keyvault-certificates/azure/keyvault/certificates/_models.py b/sdk/keyvault/azure-keyvault-certificates/azure/keyvault/certificates/_models.py index 3747fe89be14..2f5df7b122ce 100644 --- a/sdk/keyvault/azure-keyvault-certificates/azure/keyvault/certificates/_models.py +++ b/sdk/keyvault/azure-keyvault-certificates/azure/keyvault/certificates/_models.py @@ -60,26 +60,26 @@ def _from_admin_detail(cls, admin_detail): @property def email(self): - # type: () -> str - """:rtype: str""" + # type: () -> Optional[str] + """:rtype: str or None""" return self._email @property def first_name(self): - # type: () -> str - """:rtype: str""" + # type: () -> Optional[str] + """:rtype: str or None""" return self._first_name @property def last_name(self): - # type: () -> str - """:rtype: str""" + # type: () -> Optional[str] + """:rtype: str or None""" return self._last_name @property def phone(self): - # type: () -> str - """:rtype: str""" + # type: () -> Optional[str] + """:rtype: str or None""" return self._phone @@ -157,7 +157,7 @@ def __repr__(self): @classmethod def _from_certificate_item(cls, certificate_item): - # type: (models.CertificateItem) -> CertificateProperties + # type: (Union[models.CertificateItem, models.CertificateBundle]) -> CertificateProperties """Construct a CertificateProperties from an autorest-generated CertificateItem""" return cls( attributes=certificate_item.attributes, @@ -279,10 +279,10 @@ def tags(self): @property def version(self): - # type: () -> str + # type: () -> Optional[str] """The version of the certificate - :rtype: str + :rtype: str or None """ return self._vault_id.version @@ -336,28 +336,28 @@ def _from_certificate_bundle(cls, certificate_bundle): @property def id(self): - # type: () -> str + # type: () -> Optional[str] """Certificate identifier. - :rtype: str + :rtype: str or None """ - return self._properties.id + return self._properties.id if self._properties else None @property def name(self): - # type: () -> str + # type: () -> Optional[str] """The name of the certificate. - :rtype: str + :rtype: str or None """ - return self._properties.name + return self._properties.name if self._properties else None @property def properties(self): - # type: () -> CertificateProperties + # type: () -> Optional[CertificateProperties] """The certificate's properties - :rtype: ~azure.keyvault.certificates.CertificateProperties + :rtype: ~azure.keyvault.certificates.CertificateProperties or None """ return self._properties @@ -369,25 +369,25 @@ def key_id(self): @property def secret_id(self): - # type: () -> str - """:rtype: str""" + # type: () -> Optional[str] + """:rtype: Any or None""" return self._secret_id @property def policy(self): - # type: () -> CertificatePolicy + # type: () -> Optional[CertificatePolicy] """The management policy of the certificate. - :rtype: ~azure.keyvault.certificates.CertificatePolicy + :rtype: ~azure.keyvault.certificates.CertificatePolicy or None """ return self._policy @property def cer(self): - # type: () -> bytes + # type: () -> Optional[bytes] """The CER contents of the certificate. - :rtype: bytes + :rtype: bytes or None """ return self._cer @@ -469,7 +469,7 @@ def __init__( ): # type: (...) -> None self._id = cert_operation_id - self._vault_id = parse_key_vault_id(cert_operation_id) + self._vault_id = parse_key_vault_id(cert_operation_id) if cert_operation_id else None self._issuer_name = issuer_name self._certificate_type = certificate_type self._certificate_transparency = certificate_transparency @@ -493,7 +493,7 @@ def _from_certificate_operation_bundle(cls, certificate_operation_bundle): issuer_parameters = certificate_operation_bundle.issuer_parameters return cls( cert_operation_id=certificate_operation_bundle.id, - issuer_name=issuer_parameters.name, + issuer_name=issuer_parameters.name if issuer_parameters else None, certificate_type=( certificate_operation_bundle.issuer_parameters.certificate_type if certificate_operation_bundle.issuer_parameters @@ -513,104 +513,104 @@ def _from_certificate_operation_bundle(cls, certificate_operation_bundle): @property def id(self): - # type: () -> str - """:rtype: str""" + # type: () -> Optional[str] + """:rtype: str or None""" return self._id @property def name(self): - # type: () -> str - """:rtype: str""" - return self._vault_id.name + # type: () -> Optional[str] + """:rtype: str or None""" + return self._vault_id.name if self._vault_id else None @property def vault_url(self): - # type: () -> str + # type: () -> Optional[str] """URL of the vault containing the CertificateOperation - :rtype: str + :rtype: str or None """ - return self._vault_id.vault_url + return self._vault_id.vault_url if self._vault_id else None @property def issuer_name(self): - # type: () -> str + # type: () -> Union[str, WellKnownIssuerNames, None] """The name of the issuer of the certificate. - :rtype: str + :rtype: str or ~azure.keyvault.certificates.WellKnownIssuerNames or None """ return self._issuer_name @property def certificate_type(self): - # type: () -> str + # type: () -> Optional[str] """Type of certificate to be requested from the issuer provider. - :rtype: str + :rtype: str or None """ return self._certificate_type @property def certificate_transparency(self): - # type: () -> bool + # type: () -> Optional[bool] """Whether certificates generated under this policy should be published to certificate transparency logs. - :rtype: bool + :rtype: bool or None """ return self._certificate_transparency @property def csr(self): - # type: () -> bytes + # type: () -> Optional[bytes] """The certificate signing request that is being used in this certificate operation. - :rtype: bytes + :rtype: bytes or None """ return self._csr @property def cancellation_requested(self): - # type: () -> bool + # type: () -> Optional[bool] """Whether cancellation was requested on the certificate operation. - :rtype: bool + :rtype: bool or None """ return self._cancellation_requested @property def status(self): - # type: () -> str - """:rtype: str""" + # type: () -> Optional[str] + """:rtype: str or None""" return self._status @property def status_details(self): - # type: () -> str - """:rtype: str""" + # type: () -> Optional[str] + """:rtype: str or None""" return self._status_details @property def error(self): - # type: () -> CertificateOperationError - """:rtype: ~azure.keyvault.certificates.CertificateOperationError""" + # type: () -> Optional[CertificateOperationError] + """:rtype: ~azure.keyvault.certificates.CertificateOperationError or None""" return self._error @property def target(self): - # type: () -> str + # type: () -> Optional[str] """Location which contains the result of the certificate operation. - :rtype: str + :rtype: str or None """ return self._target @property def request_id(self): - # type: () -> str + # type: () -> Optional[str] """Identifier for the certificate operation. - :rtype: str + :rtype: str or None """ return self._request_id @@ -701,7 +701,7 @@ def _to_certificate_policy_bundle(self): name=self.issuer_name, certificate_type=self.certificate_type, certificate_transparency=self.certificate_transparency, # 2016-10-01 model will ignore this - ) + ) # type: Optional[models.IssuerParameters] else: issuer_parameters = None @@ -732,7 +732,7 @@ def _to_certificate_policy_bundle(self): ) ) else: - lifetime_actions = None + lifetime_actions = None # type: ignore # pylint:disable=too-many-boolean-expressions if ( @@ -745,7 +745,9 @@ def _to_certificate_policy_bundle(self): or self.validity_in_months ): if self.key_usage: - key_usage = [k.value if not isinstance(k, str) else k for k in self.key_usage] + key_usage = [ + k.value if not isinstance(k, str) else k for k in self.key_usage + ] # type: Optional[List[Union[str, KeyUsageType]]] else: key_usage = None @@ -757,7 +759,7 @@ def _to_certificate_policy_bundle(self): ), key_usage=key_usage, validity_in_months=self.validity_in_months, - ) + ) # type: Optional[models.X509CertificateProperties] else: x509_certificate_properties = None @@ -768,12 +770,14 @@ def _to_certificate_policy_bundle(self): key_size=self.key_size, reuse_key=self.reuse_key, curve=self.key_curve_name, - ) + ) # type: Optional[models.KeyProperties] else: key_properties = None if self.content_type: - secret_properties = models.SecretProperties(content_type=self.content_type) + secret_properties = models.SecretProperties( + content_type=self.content_type + ) # type: Optional[models.SecretProperties] else: secret_properties = None @@ -789,22 +793,27 @@ def _to_certificate_policy_bundle(self): @classmethod def _from_certificate_policy_bundle(cls, certificate_policy_bundle): - # type: (models.CertificatePolicy) -> CertificatePolicy + # type: (Optional[models.CertificatePolicy]) -> CertificatePolicy """Construct a CertificatePolicy from an autorest-generated CertificatePolicy""" + if certificate_policy_bundle is None: + return cls() + if certificate_policy_bundle.lifetime_actions: lifetime_actions = [ LifetimeAction( - action=(CertificatePolicyAction(item.action.action_type) if item.action.action_type else None), - lifetime_percentage=item.trigger.lifetime_percentage, - days_before_expiry=item.trigger.days_before_expiry, + action=CertificatePolicyAction(item.action.action_type) if item.action else None, + lifetime_percentage=item.trigger.lifetime_percentage if item.trigger else None, + days_before_expiry=item.trigger.days_before_expiry if item.trigger else None, ) for item in certificate_policy_bundle.lifetime_actions - ] + ] # type: Optional[List[LifetimeAction]] else: lifetime_actions = None x509_certificate_properties = certificate_policy_bundle.x509_certificate_properties if x509_certificate_properties and x509_certificate_properties.key_usage: - key_usage = [KeyUsageType(k) for k in x509_certificate_properties.key_usage] + key_usage = [ + KeyUsageType(k) for k in x509_certificate_properties.key_usage + ] # type: Optional[List[KeyUsageType]] else: key_usage = None key_properties = certificate_policy_bundle.key_properties @@ -814,9 +823,9 @@ def _from_certificate_policy_bundle(cls, certificate_policy_bundle): issuer_parameters = certificate_policy_bundle.issuer_parameters return cls( - issuer_name=issuer_parameters.name, + issuer_name=issuer_parameters.name if issuer_parameters else None, subject=(x509_certificate_properties.subject if x509_certificate_properties else None), - certificate_type=issuer_parameters.certificate_type, + certificate_type=issuer_parameters.certificate_type if issuer_parameters else None, # 2016-10-01 IssuerParameters doesn't have certificate_transparency certificate_transparency=getattr(issuer_parameters, "certificate_transparency", None), lifetime_actions=lifetime_actions, @@ -937,28 +946,28 @@ def subject(self): @property def san_emails(self): - # type: () -> List[str] + # type: () -> Optional[Any] """The subject alternative email addresses. - :rtype: list[str] + :rtype: Any or None """ return self._san_emails @property def san_dns_names(self): - # type: () -> List[str] + # type: () -> Optional[Any] """The subject alternative domain names. - :rtype: list[str] + :rtype: Any or None """ return self._san_dns_names @property def san_user_principal_names(self): - # type: () -> List[str] + # type: () -> Optional[Any] """The subject alternative user principal names. - :rtype: list[str] + :rtype: Any or None """ return self._san_user_principal_names @@ -1068,20 +1077,20 @@ def _from_certificate_contacts_item(cls, contact_item): @property def email(self): - # type: () -> str - """:rtype: str""" + # type: () -> Optional[str] + """:rtype: str or None""" return self._email @property def name(self): - # type: () -> str - """:rtype: str""" + # type: () -> Optional[str] + """:rtype: str or None""" return self._name @property def phone(self): - # type: () -> str - """:rtype: str""" + # type: () -> Optional[str] + """:rtype: str or None""" return self._phone @@ -1103,7 +1112,7 @@ def __repr__(self): @classmethod def _from_issuer_item(cls, issuer_item): - # type: (models.CertificateIssuerItem) -> IssuerProperties + # type: (Union[models.CertificateIssuerItem, models.IssuerBundle]) -> IssuerProperties """Construct a IssuerProperties from an autorest-generated CertificateIssuerItem""" return cls(issuer_id=issuer_item.id, provider=issuer_item.provider) @@ -1115,15 +1124,15 @@ def id(self): @property def name(self): - # type: () -> str + # type: () -> Optional[str] # Issuer name is listed under version under vault_id - """:rtype: str""" + """:rtype: str or None""" return self._vault_id.version @property def provider(self): - # type: () -> str - """:rtype: str""" + # type: () -> Optional[str] + """:rtype: str or None""" return self._provider @@ -1140,7 +1149,7 @@ class CertificateIssuer(object): def __init__( self, - provider, # type: str + provider, # type: Optional[str] attributes=None, # type: Optional[models.IssuerAttributes] account_id=None, # type: Optional[str] password=None, # type: Optional[str] @@ -1192,80 +1201,80 @@ def id(self): @property def name(self): - # type: () -> str + # type: () -> Optional[str] # Issuer name is listed under version under vault_id. # This is because the id we pass to parse_key_vault_id has an extra segment, so where most cases the version of # the general pattern is certificates/name/version, but here we have certificates/issuers/name/version. # Issuers are not versioned. - """:rtype: str""" + """:rtype: str or None""" return self._vault_id.version @property def provider(self): - # type: () -> str + # type: () -> Optional[str] """The issuer provider. - :rtype: str + :rtype: str or None """ return self._provider @property def enabled(self): - # type: () -> bool + # type: () -> Optional[bool] """Whether the certificate is enabled or not. - :rtype: bool + :rtype: bool or None """ return self._attributes.enabled if self._attributes else None @property def created_on(self): - # type: () -> datetime + # type: () -> Optional[datetime] """The datetime when the certificate is created. - :rtype: ~datetime.datetime + :rtype: ~datetime.datetime or None """ return self._attributes.created if self._attributes else None @property def updated_on(self): - # type: () -> datetime + # type: () -> Optional[datetime] """The datetime when the certificate was last updated. - :rtype: ~datetime.datetime + :rtype: ~datetime.datetime or None """ return self._attributes.updated if self._attributes else None @property def account_id(self): - # type: () -> str + # type: () -> Optional[str] """The username/ account name/ account id. - :rtype: str + :rtype: str or None """ return self._account_id @property def password(self): - # type: () -> str + # type: () -> Optional[str] """The password / secret / account key. - :rtype: str + :rtype: str or None """ return self._password @property def organization_id(self): - # type: () -> str - """:rtype: str""" + # type: () -> Optional[str] + """:rtype: str or None""" return self._organization_id @property def admin_contacts(self): - # type: () -> List[AdministratorContact] + # type: () -> Optional[List[AdministratorContact]] """Contact details of the organization administrator of this issuer. - :rtype: list[~azure.keyvault.certificates.AdministratorContact] + :rtype: list[~azure.keyvault.certificates.AdministratorContact] or None """ return self._admin_contacts @@ -1284,7 +1293,7 @@ class LifetimeAction(object): """ def __init__(self, action, lifetime_percentage=None, days_before_expiry=None): - # type: (CertificatePolicyAction, Optional[int], Optional[int]) -> None + # type: (Optional[CertificatePolicyAction], Optional[int], Optional[int]) -> None self._lifetime_percentage = lifetime_percentage self._days_before_expiry = days_before_expiry self._action = action @@ -1297,29 +1306,29 @@ def __repr__(self): @property def lifetime_percentage(self): - # type: () -> int + # type: () -> Optional[int] """Percentage of lifetime at which to trigger. - :rtype: int + :rtype: int or None """ return self._lifetime_percentage @property def days_before_expiry(self): - # type: () -> int + # type: () -> Optional[int] """Days before expiry to attempt renewal. - :rtype: int + :rtype: int or None """ return self._days_before_expiry @property def action(self): - # type: () -> CertificatePolicyAction + # type: () -> Optional[CertificatePolicyAction] """The type of the action that will be executed. Valid values are "EmailContacts" and "AutoRenew" - :rtype: ~azure.keyvault.certificates.CertificatePolicyAction + :rtype: ~azure.keyvault.certificates.CertificatePolicyAction or None """ return self._action diff --git a/sdk/keyvault/azure-keyvault-certificates/azure/keyvault/certificates/_polling.py b/sdk/keyvault/azure-keyvault-certificates/azure/keyvault/certificates/_polling.py index a846c356cac0..1a0946d20a54 100644 --- a/sdk/keyvault/azure-keyvault-certificates/azure/keyvault/certificates/_polling.py +++ b/sdk/keyvault/azure-keyvault-certificates/azure/keyvault/certificates/_polling.py @@ -7,6 +7,16 @@ from azure.core.polling import PollingMethod +try: + from typing import TYPE_CHECKING +except ImportError: + TYPE_CHECKING = False + +if TYPE_CHECKING: + # pylint: disable=ungrouped-imports + from typing import Any, Callable, Union + from azure.keyvault.certificates import KeyVaultCertificate, CertificateOperation + logger = logging.getLogger(__name__) diff --git a/sdk/keyvault/azure-keyvault-certificates/azure/keyvault/certificates/_shared/_polling.py b/sdk/keyvault/azure-keyvault-certificates/azure/keyvault/certificates/_shared/_polling.py index df63ad0a70ec..ec1898453d81 100644 --- a/sdk/keyvault/azure-keyvault-certificates/azure/keyvault/certificates/_shared/_polling.py +++ b/sdk/keyvault/azure-keyvault-certificates/azure/keyvault/certificates/_shared/_polling.py @@ -33,11 +33,11 @@ class KeyVaultOperationPoller(LROPoller): # pylint: disable=arguments-differ def __init__(self, polling_method): # type: (PollingMethod) -> None - super(KeyVaultOperationPoller, self).__init__(None, None, None, NoPolling()) + super(KeyVaultOperationPoller, self).__init__(None, None, lambda *_: None, NoPolling()) self._polling_method = polling_method # pylint: disable=arguments-differ - def result(self): + def result(self): # type: ignore # type: () -> Any """Returns a representation of the final resource without waiting for the operation to complete. diff --git a/sdk/keyvault/azure-keyvault-certificates/azure/keyvault/certificates/aio/_client.py b/sdk/keyvault/azure-keyvault-certificates/azure/keyvault/certificates/aio/_client.py index ebe294092d39..1fe6569bfe0f 100644 --- a/sdk/keyvault/azure-keyvault-certificates/azure/keyvault/certificates/aio/_client.py +++ b/sdk/keyvault/azure-keyvault-certificates/azure/keyvault/certificates/aio/_client.py @@ -638,13 +638,15 @@ async def set_contacts(self, contacts: Iterable[CertificateContact], **kwargs: " :caption: Create contacts :dedent: 8 """ - contacts = await self._client.set_certificate_contacts( + new_contacts = await self._client.set_certificate_contacts( vault_base_url=self.vault_url, contacts=self._models.Contacts(contact_list=[c._to_certificate_contacts_item() for c in contacts]), error_map=_error_map, **kwargs ) - return [CertificateContact._from_certificate_contacts_item(contact_item=item) for item in contacts.contact_list] + return [ + CertificateContact._from_certificate_contacts_item(contact_item=item) for item in new_contacts.contact_list + ] @distributed_trace_async async def get_contacts(self, **kwargs: "Any") -> List[CertificateContact]: @@ -861,7 +863,7 @@ async def create_issuer(self, issuer_name: str, provider: str, **kwargs: "Any") phone=contact.phone, ) for contact in admin_contacts - ] + ] # type: Optional[List[Any]] else: admin_details = None if organization_id or admin_details: @@ -922,7 +924,7 @@ async def update_issuer(self, issuer_name: str, **kwargs: "Any") -> CertificateI phone=contact.phone, ) for contact in admin_contacts - ) + ) # type: Optional[List[Any]] else: admin_details = None if organization_id or admin_details: diff --git a/sdk/keyvault/azure-keyvault-certificates/mypy.ini b/sdk/keyvault/azure-keyvault-certificates/mypy.ini new file mode 100644 index 000000000000..18b37b44c426 --- /dev/null +++ b/sdk/keyvault/azure-keyvault-certificates/mypy.ini @@ -0,0 +1,7 @@ +[mypy] +python_version = 3.6 +warn_unused_configs = True +ignore_missing_imports = True + +[mypy-azure.keyvault.*._generated.*] +ignore_errors = True From 60b4e77764b5b76c4c584c3949f0aec5c6421b07 Mon Sep 17 00:00:00 2001 From: Jiefeng Chen <51037443+BigCat20196@users.noreply.github.com> Date: Wed, 8 Sep 2021 09:53:06 +0800 Subject: [PATCH 03/85] Update auto-release (#20582) * version auto-calculation rule * single api version rule * Update main.py * additional rule for track1 * when changelog is null * Update PythonSdkLiveTest.yml for Azure Pipelines Add `ISSUE_LINK` * Update PythonSdkLiveTest.yml for Azure Pipelines * Update PythonSdkLiveTest.yml for Azure Pipelines * Update PythonSdkLiveTest.yml for Azure Pipelines * Update PythonSdkLiveTest.yml for Azure Pipelines * Update PythonSdkLiveTest.yml for Azure Pipelines * Update PythonSdkLiveTest.yml for Azure Pipelines * Update PythonSdkLiveTest.yml for Azure Pipelines * Update PythonSdkLiveTest.yml for Azure Pipelines * Update PythonSdkLiveTest.yml for Azure Pipelines * Update PythonSdkLiveTest.yml for Azure Pipelines * Update PythonSdkLiveTest.yml for Azure Pipelines * Update PythonSdkLiveTest.yml for Azure Pipelines * Update PythonSdkLiveTest.yml for Azure Pipelines * Update PythonSdkLiveTest.yml for Azure Pipelines * Update PythonSdkLiveTest.yml for Azure Pipelines * Update PythonSdkLiveTest.yml for Azure Pipelines * Update PythonSdkLiveTest.yml for Azure Pipelines * Update PythonSdkLiveTest.yml for Azure Pipelines * Update PythonSdkLiveTest.yml for Azure Pipelines * Update PythonSdkLiveTest.yml for Azure Pipelines * Update PythonSdkLiveTest.yml for Azure Pipelines * Update PythonSdkLiveTest.yml for Azure Pipelines * Update PythonSdkLiveTest.yml for Azure Pipelines * Update livetest_package.txt * Create create_pr.py * Update PythonSdkLiveTest.yml for Azure Pipelines use python script tu create pr * Update PythonSdkLiveTest.yml for Azure Pipelines * create py * Update PythonSdkLiveTest.yml for Azure Pipelines * Update token * Update token * test create_pr * Update PythonSdkLiveTest.yml for Azure Pipelines * Update create_pr.py * Update PythonSdkLiveTest.yml for Azure Pipelines * Update PythonSdkLiveTest.yml for Azure Pipelines * Update PythonSdkLiveTest.yml for Azure Pipelines * add_comment * update by jf * Update PythonSdkLiveTest.yml * Update create_auto_release_pr * Update create_auto_release_pr.py * Update create_auto_release_pr.py * Update yaml and py * Update create_auto_release_pr.py * Update create_auto_release_pr.py * Update create_auto_release_pr.py * Update PythonSdkLiveTest.yml * Update create_auto_release_pr.py * Update PythonSdkLiveTest.yml * Update PythonSdkLiveTest.yml for Azure Pipelines * Update create_auto_release_pr.py Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com> --- scripts/auto_release/PythonSdkLiveTest.yml | 1 + scripts/auto_release/create_auto_release_pr.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/auto_release/PythonSdkLiveTest.yml b/scripts/auto_release/PythonSdkLiveTest.yml index 0930961468d3..433ecaa81a4d 100644 --- a/scripts/auto_release/PythonSdkLiveTest.yml +++ b/scripts/auto_release/PythonSdkLiveTest.yml @@ -75,6 +75,7 @@ jobs: export NEW_BRANCH=`sed -n '1p' $output_path/output.txt` export TARGET_BRANCH=`sed -n '2p' $output_path/output.txt` export ISSUE_LINK=$(ISSUE_LINK) + export PIPELINE_LINK=$(PIPELINE_LINK) export USR_NAME=$(USR_NAME) export USR_TOKEN=$(USR_TOKEN) export TEST_RESULT=$test_result diff --git a/scripts/auto_release/create_auto_release_pr.py b/scripts/auto_release/create_auto_release_pr.py index 99391623fe25..9dafa7213691 100644 --- a/scripts/auto_release/create_auto_release_pr.py +++ b/scripts/auto_release/create_auto_release_pr.py @@ -8,7 +8,7 @@ def main(): pr_title = "[AutoRelease] {}(Do not merge)".format(os.getenv('NEW_BRANCH')) pr_head = "{}:{}".format(os.getenv('USR_NAME'), os.getenv('NEW_BRANCH')) pr_base = os.getenv('TARGET_BRANCH') - pr_body = "{} \n{}".format(os.getenv('ISSUE_LINK'), os.getenv('TEST_RESULT')) + pr_body = "{} \n{} \n{}".format(os.getenv('ISSUE_LINK'), os.getenv('TEST_RESULT'), os.getenv('PIPELINE_LINK')) res_create = api.pulls.create(pr_title, pr_head, pr_base, pr_body) pr_number = res_create.number From 84bd0e9722887c7cdb945012a2813ce495243bb8 Mon Sep 17 00:00:00 2001 From: Azure CLI Bot Date: Wed, 8 Sep 2021 13:55:53 +0800 Subject: [PATCH 04/85] [AutoRelease] t2-web-2021-09-08-84447 (#20583) * CodeGen from PR 15283 in Azure/azure-rest-api-specs Fix WebApps.json for App Service Auth (#15283) * changes * revert some changes * fix 1-01 * done * Update readme.md * update 02-01 * version,CHANGELOG Co-authored-by: SDKAuto Co-authored-by: PythonSdkPipelines --- sdk/appservice/azure-mgmt-web/CHANGELOG.md | 152 + sdk/appservice/azure-mgmt-web/_meta.json | 2 +- .../azure/mgmt/web/_operations_mixin.py | 82 +- .../azure-mgmt-web/azure/mgmt/web/_version.py | 2 +- .../mgmt/web/_web_site_management_client.py | 60 +- .../azure/mgmt/web/aio/_operations_mixin.py | 82 +- .../web/aio/_web_site_management_client.py | 60 +- .../azure-mgmt-web/azure/mgmt/web/models.py | 2 +- .../azure/mgmt/web/v2015_04_01/_version.py | 2 +- .../azure/mgmt/web/v2015_08_01/_version.py | 2 +- .../azure/mgmt/web/v2016_03_01/_version.py | 2 +- .../azure/mgmt/web/v2016_08_01/_version.py | 2 +- .../azure/mgmt/web/v2016_09_01/_version.py | 2 +- .../azure/mgmt/web/v2018_02_01/_version.py | 2 +- .../azure/mgmt/web/v2018_11_01/_version.py | 2 +- .../azure/mgmt/web/v2019_08_01/_version.py | 2 +- .../azure/mgmt/web/v2020_06_01/_version.py | 2 +- .../azure/mgmt/web/v2020_09_01/_version.py | 2 +- .../azure/mgmt/web/v2020_12_01/_version.py | 2 +- .../mgmt/web/v2020_12_01/models/_models.py | 1073 +- .../web/v2020_12_01/models/_models_py3.py | 1192 +- .../azure/mgmt/web/v2021_01_01/_version.py | 2 +- .../mgmt/web/v2021_01_01/models/_models.py | 1073 +- .../web/v2021_01_01/models/_models_py3.py | 1192 +- .../azure/mgmt/web/v2021_01_15/_version.py | 2 +- .../mgmt/web/v2021_01_15/models/_models.py | 1073 +- .../web/v2021_01_15/models/_models_py3.py | 1192 +- .../azure/mgmt/web/v2021_02_01/__init__.py | 19 + .../mgmt/web/v2021_02_01/_configuration.py | 71 + .../azure/mgmt/web/v2021_02_01/_metadata.json | 330 + .../azure/mgmt/web/v2021_02_01/_version.py | 9 + .../_web_site_management_client.py | 175 + .../mgmt/web/v2021_02_01/aio/__init__.py | 10 + .../web/v2021_02_01/aio/_configuration.py | 67 + .../aio/_web_site_management_client.py | 168 + .../v2021_02_01/aio/operations/__init__.py | 49 + ...p_service_certificate_orders_operations.py | 1490 + .../_app_service_environments_operations.py | 3848 ++ .../_app_service_plans_operations.py | 1997 + ...rtificate_orders_diagnostics_operations.py | 201 + ...ficate_registration_provider_operations.py | 108 + .../operations/_certificates_operations.py | 447 + .../_deleted_web_apps_operations.py | 245 + .../aio/operations/_diagnostics_operations.py | 1774 + ...domain_registration_provider_operations.py | 108 + .../aio/operations/_domains_operations.py | 1119 + .../operations/_global_model_operations.py | 213 + .../_kube_environments_operations.py | 562 + .../aio/operations/_provider_operations.py | 546 + .../operations/_recommendations_operations.py | 1109 + .../_resource_health_metadata_operations.py | 471 + .../operations/_static_sites_operations.py | 4156 +++ .../_top_level_domains_operations.py | 252 + .../aio/operations/_web_apps_operations.py | 29762 +++++++++++++++ .../_web_site_management_client_operations.py | 1121 + .../mgmt/web/v2021_02_01/models/__init__.py | 1403 + .../mgmt/web/v2021_02_01/models/_models.py | 18903 ++++++++++ .../web/v2021_02_01/models/_models_py3.py | 20944 +++++++++++ .../_web_site_management_client_enums.py | 890 + .../web/v2021_02_01/operations/__init__.py | 49 + ...p_service_certificate_orders_operations.py | 1516 + .../_app_service_environments_operations.py | 3904 ++ .../_app_service_plans_operations.py | 2029 ++ ...rtificate_orders_diagnostics_operations.py | 207 + ...ficate_registration_provider_operations.py | 113 + .../operations/_certificates_operations.py | 457 + .../_deleted_web_apps_operations.py | 252 + .../operations/_diagnostics_operations.py | 1800 + ...domain_registration_provider_operations.py | 113 + .../operations/_domains_operations.py | 1139 + .../operations/_global_model_operations.py | 220 + .../_kube_environments_operations.py | 574 + .../operations/_provider_operations.py | 557 + .../operations/_recommendations_operations.py | 1128 + .../_resource_health_metadata_operations.py | 481 + .../operations/_static_sites_operations.py | 4221 +++ .../_top_level_domains_operations.py | 259 + .../operations/_web_apps_operations.py | 30191 ++++++++++++++++ .../_web_site_management_client_operations.py | 1142 + .../azure/mgmt/web/v2021_02_01/py.typed | 1 + 80 files changed, 144492 insertions(+), 5691 deletions(-) create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/__init__.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/_configuration.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/_metadata.json create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/_version.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/_web_site_management_client.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/__init__.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/_configuration.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/_web_site_management_client.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/__init__.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_app_service_certificate_orders_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_app_service_environments_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_app_service_plans_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_certificate_orders_diagnostics_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_certificate_registration_provider_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_certificates_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_deleted_web_apps_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_diagnostics_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_domain_registration_provider_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_domains_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_global_model_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_kube_environments_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_provider_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_recommendations_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_resource_health_metadata_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_static_sites_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_top_level_domains_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_web_apps_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_web_site_management_client_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/models/__init__.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/models/_models.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/models/_models_py3.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/models/_web_site_management_client_enums.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/__init__.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_app_service_certificate_orders_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_app_service_environments_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_app_service_plans_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_certificate_orders_diagnostics_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_certificate_registration_provider_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_certificates_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_deleted_web_apps_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_diagnostics_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_domain_registration_provider_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_domains_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_global_model_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_kube_environments_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_provider_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_recommendations_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_resource_health_metadata_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_static_sites_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_top_level_domains_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_web_apps_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_web_site_management_client_operations.py create mode 100644 sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/py.typed diff --git a/sdk/appservice/azure-mgmt-web/CHANGELOG.md b/sdk/appservice/azure-mgmt-web/CHANGELOG.md index fd89d9fa32b8..9b2944f376b9 100644 --- a/sdk/appservice/azure-mgmt-web/CHANGELOG.md +++ b/sdk/appservice/azure-mgmt-web/CHANGELOG.md @@ -1,5 +1,157 @@ # Release History +## 5.0.0 (2021-09-08) + +**Features** + + - Model AppServicePlan has a new parameter zone_redundant + - Model AppServicePlanPatchResource has a new parameter zone_redundant + - Model AppServiceEnvironmentPatchResource has a new parameter zone_redundant + - Model AppServiceEnvironmentResource has a new parameter zone_redundant + - Model AzureActiveDirectoryRegistration has a new parameter client_secret_certificate_issuer + - Model AzureActiveDirectoryRegistration has a new parameter client_secret_certificate_subject_alternative_name + - Model AseV3NetworkingConfiguration has a new parameter external_inbound_ip_addresses + - Model AseV3NetworkingConfiguration has a new parameter internal_inbound_ip_addresses + - Model AppServiceEnvironment has a new parameter zone_redundant + - Model ErrorEntity has a new parameter target + - Model ErrorEntity has a new parameter details + +**Breaking changes** + + - Model TokenStore no longer has parameter kind + - Model TokenStore no longer has parameter id + - Model TokenStore no longer has parameter name + - Model TokenStore no longer has parameter type + - Model IdentityProviders no longer has parameter kind + - Model IdentityProviders no longer has parameter id + - Model IdentityProviders no longer has parameter name + - Model IdentityProviders no longer has parameter type + - Model Google no longer has parameter kind + - Model Google no longer has parameter id + - Model Google no longer has parameter name + - Model Google no longer has parameter type + - Model Nonce no longer has parameter kind + - Model Nonce no longer has parameter id + - Model Nonce no longer has parameter name + - Model Nonce no longer has parameter type + - Model AppleRegistration no longer has parameter kind + - Model AppleRegistration no longer has parameter id + - Model AppleRegistration no longer has parameter name + - Model AppleRegistration no longer has parameter type + - Model ForwardProxy no longer has parameter kind + - Model ForwardProxy no longer has parameter id + - Model ForwardProxy no longer has parameter name + - Model ForwardProxy no longer has parameter type + - Model OpenIdConnectLogin no longer has parameter kind + - Model OpenIdConnectLogin no longer has parameter id + - Model OpenIdConnectLogin no longer has parameter name + - Model OpenIdConnectLogin no longer has parameter type + - Model AzureActiveDirectoryRegistration no longer has parameter kind + - Model AzureActiveDirectoryRegistration no longer has parameter id + - Model AzureActiveDirectoryRegistration no longer has parameter name + - Model AzureActiveDirectoryRegistration no longer has parameter type + - Model AzureActiveDirectoryLogin no longer has parameter kind + - Model AzureActiveDirectoryLogin no longer has parameter id + - Model AzureActiveDirectoryLogin no longer has parameter name + - Model AzureActiveDirectoryLogin no longer has parameter type + - Model TriggeredJobRun no longer has parameter kind + - Model TriggeredJobRun no longer has parameter id + - Model TriggeredJobRun no longer has parameter name + - Model TriggeredJobRun no longer has parameter type + - Model AppRegistration no longer has parameter kind + - Model AppRegistration no longer has parameter id + - Model AppRegistration no longer has parameter name + - Model AppRegistration no longer has parameter type + - Model VnetInfo no longer has parameter kind + - Model VnetInfo no longer has parameter id + - Model VnetInfo no longer has parameter name + - Model VnetInfo no longer has parameter type + - Model CustomOpenIdConnectProvider no longer has parameter kind + - Model CustomOpenIdConnectProvider no longer has parameter id + - Model CustomOpenIdConnectProvider no longer has parameter name + - Model CustomOpenIdConnectProvider no longer has parameter type + - Model TwitterRegistration no longer has parameter kind + - Model TwitterRegistration no longer has parameter id + - Model TwitterRegistration no longer has parameter name + - Model TwitterRegistration no longer has parameter type + - Model OpenIdConnectConfig no longer has parameter kind + - Model OpenIdConnectConfig no longer has parameter id + - Model OpenIdConnectConfig no longer has parameter name + - Model OpenIdConnectConfig no longer has parameter type + - Model AzureStaticWebApps no longer has parameter kind + - Model AzureStaticWebApps no longer has parameter id + - Model AzureStaticWebApps no longer has parameter name + - Model AzureStaticWebApps no longer has parameter type + - Model LegacyMicrosoftAccount no longer has parameter kind + - Model LegacyMicrosoftAccount no longer has parameter id + - Model LegacyMicrosoftAccount no longer has parameter name + - Model LegacyMicrosoftAccount no longer has parameter type + - Model AzureActiveDirectory no longer has parameter kind + - Model AzureActiveDirectory no longer has parameter id + - Model AzureActiveDirectory no longer has parameter name + - Model AzureActiveDirectory no longer has parameter type + - Model GitHub no longer has parameter kind + - Model GitHub no longer has parameter id + - Model GitHub no longer has parameter name + - Model GitHub no longer has parameter type + - Model HttpSettings no longer has parameter kind + - Model HttpSettings no longer has parameter id + - Model HttpSettings no longer has parameter name + - Model HttpSettings no longer has parameter type + - Model DetectorDefinition no longer has parameter kind + - Model DetectorDefinition no longer has parameter id + - Model DetectorDefinition no longer has parameter name + - Model DetectorDefinition no longer has parameter type + - Model Twitter no longer has parameter kind + - Model Twitter no longer has parameter id + - Model Twitter no longer has parameter name + - Model Twitter no longer has parameter type + - Model JwtClaimChecks no longer has parameter kind + - Model JwtClaimChecks no longer has parameter id + - Model JwtClaimChecks no longer has parameter name + - Model JwtClaimChecks no longer has parameter type + - Model CookieExpiration no longer has parameter kind + - Model CookieExpiration no longer has parameter id + - Model CookieExpiration no longer has parameter name + - Model CookieExpiration no longer has parameter type + - Model Apple no longer has parameter kind + - Model Apple no longer has parameter id + - Model Apple no longer has parameter name + - Model Apple no longer has parameter type + - Model OpenIdConnectRegistration no longer has parameter kind + - Model OpenIdConnectRegistration no longer has parameter id + - Model OpenIdConnectRegistration no longer has parameter name + - Model OpenIdConnectRegistration no longer has parameter type + - Model Login no longer has parameter kind + - Model Login no longer has parameter id + - Model Login no longer has parameter name + - Model Login no longer has parameter type + - Model Facebook no longer has parameter kind + - Model Facebook no longer has parameter id + - Model Facebook no longer has parameter name + - Model Facebook no longer has parameter type + - Model ClientRegistration no longer has parameter kind + - Model ClientRegistration no longer has parameter id + - Model ClientRegistration no longer has parameter name + - Model ClientRegistration no longer has parameter type + - Model GlobalValidation no longer has parameter kind + - Model GlobalValidation no longer has parameter id + - Model GlobalValidation no longer has parameter name + - Model GlobalValidation no longer has parameter type + - Model AuthPlatform no longer has parameter kind + - Model AuthPlatform no longer has parameter id + - Model AuthPlatform no longer has parameter name + - Model AuthPlatform no longer has parameter type + - Model FileSystemTokenStore has a new signature + - Model AzureActiveDirectoryValidation has a new signature + - Model LoginRoutes has a new signature + - Model BlobStorageTokenStore has a new signature + - Model OpenIdConnectClientCredential has a new signature + - Model HttpSettingsRoutes has a new signature + - Model LoginScopes has a new signature + - Model AllowedAudiencesValidation has a new signature + - Model AzureStaticWebAppsRegistration has a new signature + ## 4.0.0 (2021-08-03) **Features** diff --git a/sdk/appservice/azure-mgmt-web/_meta.json b/sdk/appservice/azure-mgmt-web/_meta.json index 4b6cd04c9305..131a07d30897 100644 --- a/sdk/appservice/azure-mgmt-web/_meta.json +++ b/sdk/appservice/azure-mgmt-web/_meta.json @@ -4,7 +4,7 @@ "@autorest/python@5.8.4", "@autorest/modelerfour@4.19.2" ], - "commit": "bc4218cfb4178d8af43046080c0c86402d182c3f", + "commit": "ec2b6d1985ce89c8646276e0806a738338e98bd2", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest_command": "autorest specification/web/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.4 --use=@autorest/modelerfour@4.19.2 --version=3.4.5", "readme": "specification/web/resource-manager/readme.md" diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/_operations_mixin.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/_operations_mixin.py index 8bd8f32daadc..5256912cfa26 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/_operations_mixin.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/_operations_mixin.py @@ -39,12 +39,12 @@ def check_name_availability( :param name: Resource name to verify. :type name: str :param type: Resource type used for verification. - :type type: str or ~azure.mgmt.web.v2021_01_15.models.CheckNameResourceTypes + :type type: str or ~azure.mgmt.web.v2021_02_01.models.CheckNameResourceTypes :param is_fqdn: Is fully qualified domain name. :type is_fqdn: bool :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceNameAvailability, or the result of cls(response) - :rtype: ~azure.mgmt.web.v2021_01_15.models.ResourceNameAvailability + :rtype: ~azure.mgmt.web.v2021_02_01.models.ResourceNameAvailability :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('check_name_availability') @@ -64,6 +64,8 @@ def check_name_availability( from .v2021_01_01.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2021-01-15': from .v2021_01_15.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2021-02-01': + from .v2021_02_01.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'check_name_availability'".format(api_version)) mixin_instance = OperationClass() @@ -90,7 +92,7 @@ def generate_github_access_token_for_appservice_cli_async( :type state: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AppserviceGithubToken, or the result of cls(response) - :rtype: ~azure.mgmt.web.v2021_01_15.models.AppserviceGithubToken + :rtype: ~azure.mgmt.web.v2021_02_01.models.AppserviceGithubToken :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('generate_github_access_token_for_appservice_cli_async') @@ -102,6 +104,8 @@ def generate_github_access_token_for_appservice_cli_async( from .v2021_01_01.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2021-01-15': from .v2021_01_15.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2021-02-01': + from .v2021_02_01.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'generate_github_access_token_for_appservice_cli_async'".format(api_version)) mixin_instance = OperationClass() @@ -122,7 +126,7 @@ def get_publishing_user( :keyword callable cls: A custom type or function that will be passed the direct response :return: User, or the result of cls(response) - :rtype: ~azure.mgmt.web.v2021_01_15.models.User + :rtype: ~azure.mgmt.web.v2021_02_01.models.User :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('get_publishing_user') @@ -142,6 +146,8 @@ def get_publishing_user( from .v2021_01_01.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2021-01-15': from .v2021_01_15.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2021-02-01': + from .v2021_02_01.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'get_publishing_user'".format(api_version)) mixin_instance = OperationClass() @@ -165,7 +171,7 @@ def get_source_control( :type source_control_type: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SourceControl, or the result of cls(response) - :rtype: ~azure.mgmt.web.v2021_01_15.models.SourceControl + :rtype: ~azure.mgmt.web.v2021_02_01.models.SourceControl :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('get_source_control') @@ -185,6 +191,8 @@ def get_source_control( from .v2021_01_01.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2021-01-15': from .v2021_01_15.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2021-02-01': + from .v2021_02_01.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'get_source_control'".format(api_version)) mixin_instance = OperationClass() @@ -205,7 +213,7 @@ def get_subscription_deployment_locations( :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentLocations, or the result of cls(response) - :rtype: ~azure.mgmt.web.v2021_01_15.models.DeploymentLocations + :rtype: ~azure.mgmt.web.v2021_02_01.models.DeploymentLocations :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('get_subscription_deployment_locations') @@ -225,6 +233,8 @@ def get_subscription_deployment_locations( from .v2021_01_01.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2021-01-15': from .v2021_01_15.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2021-02-01': + from .v2021_02_01.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'get_subscription_deployment_locations'".format(api_version)) mixin_instance = OperationClass() @@ -251,7 +261,7 @@ def list_billing_meters( :type os_type: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BillingMeterCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_01_15.models.BillingMeterCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.BillingMeterCollection] :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('list_billing_meters') @@ -269,6 +279,8 @@ def list_billing_meters( from .v2021_01_01.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2021-01-15': from .v2021_01_15.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2021-02-01': + from .v2021_02_01.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'list_billing_meters'".format(api_version)) mixin_instance = OperationClass() @@ -292,7 +304,7 @@ def list_geo_regions( Description for Get a list of available geographical regions. :param sku: Name of SKU used to filter the regions. - :type sku: str or ~azure.mgmt.web.v2021_01_15.models.SkuName + :type sku: str or ~azure.mgmt.web.v2021_02_01.models.SkuName :param linux_workers_enabled: Specify :code:`true` if you want to filter to only regions that support Linux workers. :type linux_workers_enabled: bool @@ -304,7 +316,7 @@ def list_geo_regions( :type linux_dynamic_workers_enabled: bool :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GeoRegionCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_01_15.models.GeoRegionCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.GeoRegionCollection] :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('list_geo_regions') @@ -324,6 +336,8 @@ def list_geo_regions( from .v2021_01_01.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2021-01-15': from .v2021_01_15.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2021-02-01': + from .v2021_02_01.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'list_geo_regions'".format(api_version)) mixin_instance = OperationClass() @@ -344,7 +358,7 @@ def list_premier_add_on_offers( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either PremierAddOnOfferCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_01_15.models.PremierAddOnOfferCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.PremierAddOnOfferCollection] :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('list_premier_add_on_offers') @@ -364,6 +378,8 @@ def list_premier_add_on_offers( from .v2021_01_01.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2021-01-15': from .v2021_01_15.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2021-02-01': + from .v2021_02_01.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'list_premier_add_on_offers'".format(api_version)) mixin_instance = OperationClass() @@ -384,10 +400,10 @@ def list_site_identifiers_assigned_to_host_name( Description for List all apps that are assigned to a hostname. :param name_identifier: Hostname information. - :type name_identifier: ~azure.mgmt.web.v2021_01_15.models.NameIdentifier + :type name_identifier: ~azure.mgmt.web.v2021_02_01.models.NameIdentifier :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either IdentifierCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_01_15.models.IdentifierCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.IdentifierCollection] :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('list_site_identifiers_assigned_to_host_name') @@ -407,6 +423,8 @@ def list_site_identifiers_assigned_to_host_name( from .v2021_01_01.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2021-01-15': from .v2021_01_15.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2021-02-01': + from .v2021_02_01.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'list_site_identifiers_assigned_to_host_name'".format(api_version)) mixin_instance = OperationClass() @@ -427,7 +445,7 @@ def list_skus( :keyword callable cls: A custom type or function that will be passed the direct response :return: SkuInfos, or the result of cls(response) - :rtype: ~azure.mgmt.web.v2021_01_15.models.SkuInfos + :rtype: ~azure.mgmt.web.v2021_02_01.models.SkuInfos :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('list_skus') @@ -447,6 +465,8 @@ def list_skus( from .v2021_01_01.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2021-01-15': from .v2021_01_15.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2021-02-01': + from .v2021_02_01.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'list_skus'".format(api_version)) mixin_instance = OperationClass() @@ -467,7 +487,7 @@ def list_source_controls( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either SourceControlCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_01_15.models.SourceControlCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.SourceControlCollection] :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('list_source_controls') @@ -487,6 +507,8 @@ def list_source_controls( from .v2021_01_01.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2021-01-15': from .v2021_01_15.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2021-02-01': + from .v2021_02_01.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'list_source_controls'".format(api_version)) mixin_instance = OperationClass() @@ -510,7 +532,7 @@ def move( :param resource_group_name: Name of the resource group to which the resource belongs. :type resource_group_name: str :param move_resource_envelope: Object that represents the resource to move. - :type move_resource_envelope: ~azure.mgmt.web.v2021_01_15.models.CsmMoveResourceEnvelope + :type move_resource_envelope: ~azure.mgmt.web.v2021_02_01.models.CsmMoveResourceEnvelope :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -533,6 +555,8 @@ def move( from .v2021_01_01.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2021-01-15': from .v2021_01_15.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2021-02-01': + from .v2021_02_01.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'move'".format(api_version)) mixin_instance = OperationClass() @@ -553,10 +577,10 @@ def update_publishing_user( Description for Updates publishing user. :param user_details: Details of publishing user. - :type user_details: ~azure.mgmt.web.v2021_01_15.models.User + :type user_details: ~azure.mgmt.web.v2021_02_01.models.User :keyword callable cls: A custom type or function that will be passed the direct response :return: User, or the result of cls(response) - :rtype: ~azure.mgmt.web.v2021_01_15.models.User + :rtype: ~azure.mgmt.web.v2021_02_01.models.User :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('update_publishing_user') @@ -576,6 +600,8 @@ def update_publishing_user( from .v2021_01_01.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2021-01-15': from .v2021_01_15.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2021-02-01': + from .v2021_02_01.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'update_publishing_user'".format(api_version)) mixin_instance = OperationClass() @@ -599,10 +625,10 @@ def update_source_control( :param source_control_type: Type of source control. :type source_control_type: str :param request_message: Source control token information. - :type request_message: ~azure.mgmt.web.v2021_01_15.models.SourceControl + :type request_message: ~azure.mgmt.web.v2021_02_01.models.SourceControl :keyword callable cls: A custom type or function that will be passed the direct response :return: SourceControl, or the result of cls(response) - :rtype: ~azure.mgmt.web.v2021_01_15.models.SourceControl + :rtype: ~azure.mgmt.web.v2021_02_01.models.SourceControl :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('update_source_control') @@ -622,6 +648,8 @@ def update_source_control( from .v2021_01_01.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2021-01-15': from .v2021_01_15.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2021-02-01': + from .v2021_02_01.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'update_source_control'".format(api_version)) mixin_instance = OperationClass() @@ -645,10 +673,10 @@ def validate( :param resource_group_name: Name of the resource group to which the resource belongs. :type resource_group_name: str :param validate_request: Request with the resources to validate. - :type validate_request: ~azure.mgmt.web.v2021_01_15.models.ValidateRequest + :type validate_request: ~azure.mgmt.web.v2021_02_01.models.ValidateRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: ValidateResponse, or the result of cls(response) - :rtype: ~azure.mgmt.web.v2021_01_15.models.ValidateResponse + :rtype: ~azure.mgmt.web.v2021_02_01.models.ValidateResponse :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('validate') @@ -668,6 +696,8 @@ def validate( from .v2021_01_01.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2021-01-15': from .v2021_01_15.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2021-02-01': + from .v2021_02_01.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'validate'".format(api_version)) mixin_instance = OperationClass() @@ -723,7 +753,7 @@ def validate_move( :param resource_group_name: Name of the resource group to which the resource belongs. :type resource_group_name: str :param move_resource_envelope: Object that represents the resource to move. - :type move_resource_envelope: ~azure.mgmt.web.v2021_01_15.models.CsmMoveResourceEnvelope + :type move_resource_envelope: ~azure.mgmt.web.v2021_02_01.models.CsmMoveResourceEnvelope :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -746,6 +776,8 @@ def validate_move( from .v2021_01_01.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2021-01-15': from .v2021_01_15.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2021-02-01': + from .v2021_02_01.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'validate_move'".format(api_version)) mixin_instance = OperationClass() @@ -767,10 +799,10 @@ def verify_hosting_environment_vnet( analyzing the Network Security Group rules. :param parameters: VNET information. - :type parameters: ~azure.mgmt.web.v2021_01_15.models.VnetParameters + :type parameters: ~azure.mgmt.web.v2021_02_01.models.VnetParameters :keyword callable cls: A custom type or function that will be passed the direct response :return: VnetValidationFailureDetails, or the result of cls(response) - :rtype: ~azure.mgmt.web.v2021_01_15.models.VnetValidationFailureDetails + :rtype: ~azure.mgmt.web.v2021_02_01.models.VnetValidationFailureDetails :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('verify_hosting_environment_vnet') @@ -790,6 +822,8 @@ def verify_hosting_environment_vnet( from .v2021_01_01.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2021-01-15': from .v2021_01_15.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2021-02-01': + from .v2021_02_01.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'verify_hosting_environment_vnet'".format(api_version)) mixin_instance = OperationClass() diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/_version.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/_version.py index 77f53a3589c6..34ea7990c4b4 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/_version.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "4.0.0" +VERSION = "5.0.0" diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/_web_site_management_client.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/_web_site_management_client.py index bca25adf2b53..b3d3976ad811 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/_web_site_management_client.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/_web_site_management_client.py @@ -57,7 +57,7 @@ class WebSiteManagementClient(WebSiteManagementClientOperationsMixin, MultiApiCl :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ - DEFAULT_API_VERSION = '2021-01-15' + DEFAULT_API_VERSION = '2021-02-01' _PROFILE_TAG = "azure.mgmt.web.WebSiteManagementClient" LATEST_PROFILE = ProfileDefinition({ _PROFILE_TAG: { @@ -107,6 +107,7 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2020-12-01: :mod:`v2020_12_01.models` * 2021-01-01: :mod:`v2021_01_01.models` * 2021-01-15: :mod:`v2021_01_15.models` + * 2021-02-01: :mod:`v2021_02_01.models` """ if api_version == '2015-04-01': from .v2015_04_01 import models @@ -147,6 +148,9 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2021-01-15': from .v2021_01_15 import models return models + elif api_version == '2021-02-01': + from .v2021_02_01 import models + return models raise ValueError("API version {} is not available".format(api_version)) @property @@ -161,6 +165,7 @@ def app_service_certificate_orders(self): * 2020-12-01: :class:`AppServiceCertificateOrdersOperations` * 2021-01-01: :class:`AppServiceCertificateOrdersOperations` * 2021-01-15: :class:`AppServiceCertificateOrdersOperations` + * 2021-02-01: :class:`AppServiceCertificateOrdersOperations` """ api_version = self._get_api_version('app_service_certificate_orders') if api_version == '2015-08-01': @@ -179,6 +184,8 @@ def app_service_certificate_orders(self): from .v2021_01_01.operations import AppServiceCertificateOrdersOperations as OperationClass elif api_version == '2021-01-15': from .v2021_01_15.operations import AppServiceCertificateOrdersOperations as OperationClass + elif api_version == '2021-02-01': + from .v2021_02_01.operations import AppServiceCertificateOrdersOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'app_service_certificate_orders'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -195,6 +202,7 @@ def app_service_environments(self): * 2020-12-01: :class:`AppServiceEnvironmentsOperations` * 2021-01-01: :class:`AppServiceEnvironmentsOperations` * 2021-01-15: :class:`AppServiceEnvironmentsOperations` + * 2021-02-01: :class:`AppServiceEnvironmentsOperations` """ api_version = self._get_api_version('app_service_environments') if api_version == '2016-09-01': @@ -213,6 +221,8 @@ def app_service_environments(self): from .v2021_01_01.operations import AppServiceEnvironmentsOperations as OperationClass elif api_version == '2021-01-15': from .v2021_01_15.operations import AppServiceEnvironmentsOperations as OperationClass + elif api_version == '2021-02-01': + from .v2021_02_01.operations import AppServiceEnvironmentsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'app_service_environments'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -229,6 +239,7 @@ def app_service_plans(self): * 2020-12-01: :class:`AppServicePlansOperations` * 2021-01-01: :class:`AppServicePlansOperations` * 2021-01-15: :class:`AppServicePlansOperations` + * 2021-02-01: :class:`AppServicePlansOperations` """ api_version = self._get_api_version('app_service_plans') if api_version == '2016-09-01': @@ -247,6 +258,8 @@ def app_service_plans(self): from .v2021_01_01.operations import AppServicePlansOperations as OperationClass elif api_version == '2021-01-15': from .v2021_01_15.operations import AppServicePlansOperations as OperationClass + elif api_version == '2021-02-01': + from .v2021_02_01.operations import AppServicePlansOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'app_service_plans'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -271,6 +284,7 @@ def certificate_orders_diagnostics(self): * 2020-12-01: :class:`CertificateOrdersDiagnosticsOperations` * 2021-01-01: :class:`CertificateOrdersDiagnosticsOperations` * 2021-01-15: :class:`CertificateOrdersDiagnosticsOperations` + * 2021-02-01: :class:`CertificateOrdersDiagnosticsOperations` """ api_version = self._get_api_version('certificate_orders_diagnostics') if api_version == '2020-12-01': @@ -279,6 +293,8 @@ def certificate_orders_diagnostics(self): from .v2021_01_01.operations import CertificateOrdersDiagnosticsOperations as OperationClass elif api_version == '2021-01-15': from .v2021_01_15.operations import CertificateOrdersDiagnosticsOperations as OperationClass + elif api_version == '2021-02-01': + from .v2021_02_01.operations import CertificateOrdersDiagnosticsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'certificate_orders_diagnostics'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -295,6 +311,7 @@ def certificate_registration_provider(self): * 2020-12-01: :class:`CertificateRegistrationProviderOperations` * 2021-01-01: :class:`CertificateRegistrationProviderOperations` * 2021-01-15: :class:`CertificateRegistrationProviderOperations` + * 2021-02-01: :class:`CertificateRegistrationProviderOperations` """ api_version = self._get_api_version('certificate_registration_provider') if api_version == '2015-08-01': @@ -313,6 +330,8 @@ def certificate_registration_provider(self): from .v2021_01_01.operations import CertificateRegistrationProviderOperations as OperationClass elif api_version == '2021-01-15': from .v2021_01_15.operations import CertificateRegistrationProviderOperations as OperationClass + elif api_version == '2021-02-01': + from .v2021_02_01.operations import CertificateRegistrationProviderOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'certificate_registration_provider'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -330,6 +349,7 @@ def certificates(self): * 2020-12-01: :class:`CertificatesOperations` * 2021-01-01: :class:`CertificatesOperations` * 2021-01-15: :class:`CertificatesOperations` + * 2021-02-01: :class:`CertificatesOperations` """ api_version = self._get_api_version('certificates') if api_version == '2016-03-01': @@ -350,6 +370,8 @@ def certificates(self): from .v2021_01_01.operations import CertificatesOperations as OperationClass elif api_version == '2021-01-15': from .v2021_01_15.operations import CertificatesOperations as OperationClass + elif api_version == '2021-02-01': + from .v2021_02_01.operations import CertificatesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'certificates'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -366,6 +388,7 @@ def deleted_web_apps(self): * 2020-12-01: :class:`DeletedWebAppsOperations` * 2021-01-01: :class:`DeletedWebAppsOperations` * 2021-01-15: :class:`DeletedWebAppsOperations` + * 2021-02-01: :class:`DeletedWebAppsOperations` """ api_version = self._get_api_version('deleted_web_apps') if api_version == '2016-03-01': @@ -384,6 +407,8 @@ def deleted_web_apps(self): from .v2021_01_01.operations import DeletedWebAppsOperations as OperationClass elif api_version == '2021-01-15': from .v2021_01_15.operations import DeletedWebAppsOperations as OperationClass + elif api_version == '2021-02-01': + from .v2021_02_01.operations import DeletedWebAppsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'deleted_web_apps'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -400,6 +425,7 @@ def diagnostics(self): * 2020-12-01: :class:`DiagnosticsOperations` * 2021-01-01: :class:`DiagnosticsOperations` * 2021-01-15: :class:`DiagnosticsOperations` + * 2021-02-01: :class:`DiagnosticsOperations` """ api_version = self._get_api_version('diagnostics') if api_version == '2016-03-01': @@ -418,6 +444,8 @@ def diagnostics(self): from .v2021_01_01.operations import DiagnosticsOperations as OperationClass elif api_version == '2021-01-15': from .v2021_01_15.operations import DiagnosticsOperations as OperationClass + elif api_version == '2021-02-01': + from .v2021_02_01.operations import DiagnosticsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'diagnostics'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -434,6 +462,7 @@ def domain_registration_provider(self): * 2020-12-01: :class:`DomainRegistrationProviderOperations` * 2021-01-01: :class:`DomainRegistrationProviderOperations` * 2021-01-15: :class:`DomainRegistrationProviderOperations` + * 2021-02-01: :class:`DomainRegistrationProviderOperations` """ api_version = self._get_api_version('domain_registration_provider') if api_version == '2015-04-01': @@ -452,6 +481,8 @@ def domain_registration_provider(self): from .v2021_01_01.operations import DomainRegistrationProviderOperations as OperationClass elif api_version == '2021-01-15': from .v2021_01_15.operations import DomainRegistrationProviderOperations as OperationClass + elif api_version == '2021-02-01': + from .v2021_02_01.operations import DomainRegistrationProviderOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'domain_registration_provider'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -468,6 +499,7 @@ def domains(self): * 2020-12-01: :class:`DomainsOperations` * 2021-01-01: :class:`DomainsOperations` * 2021-01-15: :class:`DomainsOperations` + * 2021-02-01: :class:`DomainsOperations` """ api_version = self._get_api_version('domains') if api_version == '2015-04-01': @@ -486,6 +518,8 @@ def domains(self): from .v2021_01_01.operations import DomainsOperations as OperationClass elif api_version == '2021-01-15': from .v2021_01_15.operations import DomainsOperations as OperationClass + elif api_version == '2021-02-01': + from .v2021_02_01.operations import DomainsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'domains'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -497,6 +531,7 @@ def global_model(self): * 2020-12-01: :class:`GlobalOperations` * 2021-01-01: :class:`GlobalOperations` * 2021-01-15: :class:`GlobalOperations` + * 2021-02-01: :class:`GlobalOperations` """ api_version = self._get_api_version('global_model') if api_version == '2020-12-01': @@ -505,6 +540,8 @@ def global_model(self): from .v2021_01_01.operations import GlobalOperations as OperationClass elif api_version == '2021-01-15': from .v2021_01_15.operations import GlobalOperations as OperationClass + elif api_version == '2021-02-01': + from .v2021_02_01.operations import GlobalOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'global_model'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -515,12 +552,15 @@ def kube_environments(self): * 2021-01-01: :class:`KubeEnvironmentsOperations` * 2021-01-15: :class:`KubeEnvironmentsOperations` + * 2021-02-01: :class:`KubeEnvironmentsOperations` """ api_version = self._get_api_version('kube_environments') if api_version == '2021-01-01': from .v2021_01_01.operations import KubeEnvironmentsOperations as OperationClass elif api_version == '2021-01-15': from .v2021_01_15.operations import KubeEnvironmentsOperations as OperationClass + elif api_version == '2021-02-01': + from .v2021_02_01.operations import KubeEnvironmentsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'kube_environments'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -537,6 +577,7 @@ def provider(self): * 2020-12-01: :class:`ProviderOperations` * 2021-01-01: :class:`ProviderOperations` * 2021-01-15: :class:`ProviderOperations` + * 2021-02-01: :class:`ProviderOperations` """ api_version = self._get_api_version('provider') if api_version == '2016-03-01': @@ -555,6 +596,8 @@ def provider(self): from .v2021_01_01.operations import ProviderOperations as OperationClass elif api_version == '2021-01-15': from .v2021_01_15.operations import ProviderOperations as OperationClass + elif api_version == '2021-02-01': + from .v2021_02_01.operations import ProviderOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'provider'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -571,6 +614,7 @@ def recommendations(self): * 2020-12-01: :class:`RecommendationsOperations` * 2021-01-01: :class:`RecommendationsOperations` * 2021-01-15: :class:`RecommendationsOperations` + * 2021-02-01: :class:`RecommendationsOperations` """ api_version = self._get_api_version('recommendations') if api_version == '2016-03-01': @@ -589,6 +633,8 @@ def recommendations(self): from .v2021_01_01.operations import RecommendationsOperations as OperationClass elif api_version == '2021-01-15': from .v2021_01_15.operations import RecommendationsOperations as OperationClass + elif api_version == '2021-02-01': + from .v2021_02_01.operations import RecommendationsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'recommendations'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -605,6 +651,7 @@ def resource_health_metadata(self): * 2020-12-01: :class:`ResourceHealthMetadataOperations` * 2021-01-01: :class:`ResourceHealthMetadataOperations` * 2021-01-15: :class:`ResourceHealthMetadataOperations` + * 2021-02-01: :class:`ResourceHealthMetadataOperations` """ api_version = self._get_api_version('resource_health_metadata') if api_version == '2016-03-01': @@ -623,6 +670,8 @@ def resource_health_metadata(self): from .v2021_01_01.operations import ResourceHealthMetadataOperations as OperationClass elif api_version == '2021-01-15': from .v2021_01_15.operations import ResourceHealthMetadataOperations as OperationClass + elif api_version == '2021-02-01': + from .v2021_02_01.operations import ResourceHealthMetadataOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'resource_health_metadata'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -637,6 +686,7 @@ def static_sites(self): * 2020-12-01: :class:`StaticSitesOperations` * 2021-01-01: :class:`StaticSitesOperations` * 2021-01-15: :class:`StaticSitesOperations` + * 2021-02-01: :class:`StaticSitesOperations` """ api_version = self._get_api_version('static_sites') if api_version == '2019-08-01': @@ -651,6 +701,8 @@ def static_sites(self): from .v2021_01_01.operations import StaticSitesOperations as OperationClass elif api_version == '2021-01-15': from .v2021_01_15.operations import StaticSitesOperations as OperationClass + elif api_version == '2021-02-01': + from .v2021_02_01.operations import StaticSitesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'static_sites'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -667,6 +719,7 @@ def top_level_domains(self): * 2020-12-01: :class:`TopLevelDomainsOperations` * 2021-01-01: :class:`TopLevelDomainsOperations` * 2021-01-15: :class:`TopLevelDomainsOperations` + * 2021-02-01: :class:`TopLevelDomainsOperations` """ api_version = self._get_api_version('top_level_domains') if api_version == '2015-04-01': @@ -685,6 +738,8 @@ def top_level_domains(self): from .v2021_01_01.operations import TopLevelDomainsOperations as OperationClass elif api_version == '2021-01-15': from .v2021_01_15.operations import TopLevelDomainsOperations as OperationClass + elif api_version == '2021-02-01': + from .v2021_02_01.operations import TopLevelDomainsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'top_level_domains'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -701,6 +756,7 @@ def web_apps(self): * 2020-12-01: :class:`WebAppsOperations` * 2021-01-01: :class:`WebAppsOperations` * 2021-01-15: :class:`WebAppsOperations` + * 2021-02-01: :class:`WebAppsOperations` """ api_version = self._get_api_version('web_apps') if api_version == '2016-08-01': @@ -719,6 +775,8 @@ def web_apps(self): from .v2021_01_01.operations import WebAppsOperations as OperationClass elif api_version == '2021-01-15': from .v2021_01_15.operations import WebAppsOperations as OperationClass + elif api_version == '2021-02-01': + from .v2021_02_01.operations import WebAppsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'web_apps'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/aio/_operations_mixin.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/aio/_operations_mixin.py index b6881759265a..01d3c8c2a447 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/aio/_operations_mixin.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/aio/_operations_mixin.py @@ -35,12 +35,12 @@ async def check_name_availability( :param name: Resource name to verify. :type name: str :param type: Resource type used for verification. - :type type: str or ~azure.mgmt.web.v2021_01_15.models.CheckNameResourceTypes + :type type: str or ~azure.mgmt.web.v2021_02_01.models.CheckNameResourceTypes :param is_fqdn: Is fully qualified domain name. :type is_fqdn: bool :keyword callable cls: A custom type or function that will be passed the direct response :return: ResourceNameAvailability, or the result of cls(response) - :rtype: ~azure.mgmt.web.v2021_01_15.models.ResourceNameAvailability + :rtype: ~azure.mgmt.web.v2021_02_01.models.ResourceNameAvailability :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('check_name_availability') @@ -60,6 +60,8 @@ async def check_name_availability( from ..v2021_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2021-01-15': from ..v2021_01_15.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2021-02-01': + from ..v2021_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'check_name_availability'".format(api_version)) mixin_instance = OperationClass() @@ -86,7 +88,7 @@ async def generate_github_access_token_for_appservice_cli_async( :type state: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AppserviceGithubToken, or the result of cls(response) - :rtype: ~azure.mgmt.web.v2021_01_15.models.AppserviceGithubToken + :rtype: ~azure.mgmt.web.v2021_02_01.models.AppserviceGithubToken :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('generate_github_access_token_for_appservice_cli_async') @@ -98,6 +100,8 @@ async def generate_github_access_token_for_appservice_cli_async( from ..v2021_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2021-01-15': from ..v2021_01_15.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2021-02-01': + from ..v2021_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'generate_github_access_token_for_appservice_cli_async'".format(api_version)) mixin_instance = OperationClass() @@ -118,7 +122,7 @@ async def get_publishing_user( :keyword callable cls: A custom type or function that will be passed the direct response :return: User, or the result of cls(response) - :rtype: ~azure.mgmt.web.v2021_01_15.models.User + :rtype: ~azure.mgmt.web.v2021_02_01.models.User :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('get_publishing_user') @@ -138,6 +142,8 @@ async def get_publishing_user( from ..v2021_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2021-01-15': from ..v2021_01_15.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2021-02-01': + from ..v2021_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'get_publishing_user'".format(api_version)) mixin_instance = OperationClass() @@ -161,7 +167,7 @@ async def get_source_control( :type source_control_type: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SourceControl, or the result of cls(response) - :rtype: ~azure.mgmt.web.v2021_01_15.models.SourceControl + :rtype: ~azure.mgmt.web.v2021_02_01.models.SourceControl :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('get_source_control') @@ -181,6 +187,8 @@ async def get_source_control( from ..v2021_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2021-01-15': from ..v2021_01_15.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2021-02-01': + from ..v2021_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'get_source_control'".format(api_version)) mixin_instance = OperationClass() @@ -201,7 +209,7 @@ async def get_subscription_deployment_locations( :keyword callable cls: A custom type or function that will be passed the direct response :return: DeploymentLocations, or the result of cls(response) - :rtype: ~azure.mgmt.web.v2021_01_15.models.DeploymentLocations + :rtype: ~azure.mgmt.web.v2021_02_01.models.DeploymentLocations :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('get_subscription_deployment_locations') @@ -221,6 +229,8 @@ async def get_subscription_deployment_locations( from ..v2021_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2021-01-15': from ..v2021_01_15.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2021-02-01': + from ..v2021_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'get_subscription_deployment_locations'".format(api_version)) mixin_instance = OperationClass() @@ -247,7 +257,7 @@ def list_billing_meters( :type os_type: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BillingMeterCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_01_15.models.BillingMeterCollection] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.BillingMeterCollection] :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('list_billing_meters') @@ -265,6 +275,8 @@ def list_billing_meters( from ..v2021_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2021-01-15': from ..v2021_01_15.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2021-02-01': + from ..v2021_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'list_billing_meters'".format(api_version)) mixin_instance = OperationClass() @@ -288,7 +300,7 @@ def list_geo_regions( Description for Get a list of available geographical regions. :param sku: Name of SKU used to filter the regions. - :type sku: str or ~azure.mgmt.web.v2021_01_15.models.SkuName + :type sku: str or ~azure.mgmt.web.v2021_02_01.models.SkuName :param linux_workers_enabled: Specify :code:`true` if you want to filter to only regions that support Linux workers. :type linux_workers_enabled: bool @@ -300,7 +312,7 @@ def list_geo_regions( :type linux_dynamic_workers_enabled: bool :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GeoRegionCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_01_15.models.GeoRegionCollection] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.GeoRegionCollection] :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('list_geo_regions') @@ -320,6 +332,8 @@ def list_geo_regions( from ..v2021_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2021-01-15': from ..v2021_01_15.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2021-02-01': + from ..v2021_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'list_geo_regions'".format(api_version)) mixin_instance = OperationClass() @@ -340,7 +354,7 @@ def list_premier_add_on_offers( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either PremierAddOnOfferCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_01_15.models.PremierAddOnOfferCollection] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.PremierAddOnOfferCollection] :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('list_premier_add_on_offers') @@ -360,6 +374,8 @@ def list_premier_add_on_offers( from ..v2021_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2021-01-15': from ..v2021_01_15.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2021-02-01': + from ..v2021_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'list_premier_add_on_offers'".format(api_version)) mixin_instance = OperationClass() @@ -380,10 +396,10 @@ def list_site_identifiers_assigned_to_host_name( Description for List all apps that are assigned to a hostname. :param name_identifier: Hostname information. - :type name_identifier: ~azure.mgmt.web.v2021_01_15.models.NameIdentifier + :type name_identifier: ~azure.mgmt.web.v2021_02_01.models.NameIdentifier :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either IdentifierCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_01_15.models.IdentifierCollection] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.IdentifierCollection] :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('list_site_identifiers_assigned_to_host_name') @@ -403,6 +419,8 @@ def list_site_identifiers_assigned_to_host_name( from ..v2021_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2021-01-15': from ..v2021_01_15.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2021-02-01': + from ..v2021_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'list_site_identifiers_assigned_to_host_name'".format(api_version)) mixin_instance = OperationClass() @@ -423,7 +441,7 @@ async def list_skus( :keyword callable cls: A custom type or function that will be passed the direct response :return: SkuInfos, or the result of cls(response) - :rtype: ~azure.mgmt.web.v2021_01_15.models.SkuInfos + :rtype: ~azure.mgmt.web.v2021_02_01.models.SkuInfos :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('list_skus') @@ -443,6 +461,8 @@ async def list_skus( from ..v2021_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2021-01-15': from ..v2021_01_15.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2021-02-01': + from ..v2021_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'list_skus'".format(api_version)) mixin_instance = OperationClass() @@ -463,7 +483,7 @@ def list_source_controls( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either SourceControlCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_01_15.models.SourceControlCollection] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.SourceControlCollection] :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('list_source_controls') @@ -483,6 +503,8 @@ def list_source_controls( from ..v2021_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2021-01-15': from ..v2021_01_15.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2021-02-01': + from ..v2021_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'list_source_controls'".format(api_version)) mixin_instance = OperationClass() @@ -506,7 +528,7 @@ async def move( :param resource_group_name: Name of the resource group to which the resource belongs. :type resource_group_name: str :param move_resource_envelope: Object that represents the resource to move. - :type move_resource_envelope: ~azure.mgmt.web.v2021_01_15.models.CsmMoveResourceEnvelope + :type move_resource_envelope: ~azure.mgmt.web.v2021_02_01.models.CsmMoveResourceEnvelope :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -529,6 +551,8 @@ async def move( from ..v2021_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2021-01-15': from ..v2021_01_15.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2021-02-01': + from ..v2021_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'move'".format(api_version)) mixin_instance = OperationClass() @@ -549,10 +573,10 @@ async def update_publishing_user( Description for Updates publishing user. :param user_details: Details of publishing user. - :type user_details: ~azure.mgmt.web.v2021_01_15.models.User + :type user_details: ~azure.mgmt.web.v2021_02_01.models.User :keyword callable cls: A custom type or function that will be passed the direct response :return: User, or the result of cls(response) - :rtype: ~azure.mgmt.web.v2021_01_15.models.User + :rtype: ~azure.mgmt.web.v2021_02_01.models.User :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('update_publishing_user') @@ -572,6 +596,8 @@ async def update_publishing_user( from ..v2021_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2021-01-15': from ..v2021_01_15.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2021-02-01': + from ..v2021_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'update_publishing_user'".format(api_version)) mixin_instance = OperationClass() @@ -595,10 +621,10 @@ async def update_source_control( :param source_control_type: Type of source control. :type source_control_type: str :param request_message: Source control token information. - :type request_message: ~azure.mgmt.web.v2021_01_15.models.SourceControl + :type request_message: ~azure.mgmt.web.v2021_02_01.models.SourceControl :keyword callable cls: A custom type or function that will be passed the direct response :return: SourceControl, or the result of cls(response) - :rtype: ~azure.mgmt.web.v2021_01_15.models.SourceControl + :rtype: ~azure.mgmt.web.v2021_02_01.models.SourceControl :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('update_source_control') @@ -618,6 +644,8 @@ async def update_source_control( from ..v2021_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2021-01-15': from ..v2021_01_15.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2021-02-01': + from ..v2021_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'update_source_control'".format(api_version)) mixin_instance = OperationClass() @@ -641,10 +669,10 @@ async def validate( :param resource_group_name: Name of the resource group to which the resource belongs. :type resource_group_name: str :param validate_request: Request with the resources to validate. - :type validate_request: ~azure.mgmt.web.v2021_01_15.models.ValidateRequest + :type validate_request: ~azure.mgmt.web.v2021_02_01.models.ValidateRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: ValidateResponse, or the result of cls(response) - :rtype: ~azure.mgmt.web.v2021_01_15.models.ValidateResponse + :rtype: ~azure.mgmt.web.v2021_02_01.models.ValidateResponse :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('validate') @@ -664,6 +692,8 @@ async def validate( from ..v2021_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2021-01-15': from ..v2021_01_15.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2021-02-01': + from ..v2021_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'validate'".format(api_version)) mixin_instance = OperationClass() @@ -719,7 +749,7 @@ async def validate_move( :param resource_group_name: Name of the resource group to which the resource belongs. :type resource_group_name: str :param move_resource_envelope: Object that represents the resource to move. - :type move_resource_envelope: ~azure.mgmt.web.v2021_01_15.models.CsmMoveResourceEnvelope + :type move_resource_envelope: ~azure.mgmt.web.v2021_02_01.models.CsmMoveResourceEnvelope :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -742,6 +772,8 @@ async def validate_move( from ..v2021_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2021-01-15': from ..v2021_01_15.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2021-02-01': + from ..v2021_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'validate_move'".format(api_version)) mixin_instance = OperationClass() @@ -763,10 +795,10 @@ async def verify_hosting_environment_vnet( analyzing the Network Security Group rules. :param parameters: VNET information. - :type parameters: ~azure.mgmt.web.v2021_01_15.models.VnetParameters + :type parameters: ~azure.mgmt.web.v2021_02_01.models.VnetParameters :keyword callable cls: A custom type or function that will be passed the direct response :return: VnetValidationFailureDetails, or the result of cls(response) - :rtype: ~azure.mgmt.web.v2021_01_15.models.VnetValidationFailureDetails + :rtype: ~azure.mgmt.web.v2021_02_01.models.VnetValidationFailureDetails :raises: ~azure.core.exceptions.HttpResponseError """ api_version = self._get_api_version('verify_hosting_environment_vnet') @@ -786,6 +818,8 @@ async def verify_hosting_environment_vnet( from ..v2021_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass elif api_version == '2021-01-15': from ..v2021_01_15.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass + elif api_version == '2021-02-01': + from ..v2021_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass else: raise ValueError("API version {} does not have operation 'verify_hosting_environment_vnet'".format(api_version)) mixin_instance = OperationClass() diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/aio/_web_site_management_client.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/aio/_web_site_management_client.py index f220cc70f4cb..f309a947ac0c 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/aio/_web_site_management_client.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/aio/_web_site_management_client.py @@ -55,7 +55,7 @@ class WebSiteManagementClient(WebSiteManagementClientOperationsMixin, MultiApiCl :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ - DEFAULT_API_VERSION = '2021-01-15' + DEFAULT_API_VERSION = '2021-02-01' _PROFILE_TAG = "azure.mgmt.web.WebSiteManagementClient" LATEST_PROFILE = ProfileDefinition({ _PROFILE_TAG: { @@ -105,6 +105,7 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2020-12-01: :mod:`v2020_12_01.models` * 2021-01-01: :mod:`v2021_01_01.models` * 2021-01-15: :mod:`v2021_01_15.models` + * 2021-02-01: :mod:`v2021_02_01.models` """ if api_version == '2015-04-01': from ..v2015_04_01 import models @@ -145,6 +146,9 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2021-01-15': from ..v2021_01_15 import models return models + elif api_version == '2021-02-01': + from ..v2021_02_01 import models + return models raise ValueError("API version {} is not available".format(api_version)) @property @@ -159,6 +163,7 @@ def app_service_certificate_orders(self): * 2020-12-01: :class:`AppServiceCertificateOrdersOperations` * 2021-01-01: :class:`AppServiceCertificateOrdersOperations` * 2021-01-15: :class:`AppServiceCertificateOrdersOperations` + * 2021-02-01: :class:`AppServiceCertificateOrdersOperations` """ api_version = self._get_api_version('app_service_certificate_orders') if api_version == '2015-08-01': @@ -177,6 +182,8 @@ def app_service_certificate_orders(self): from ..v2021_01_01.aio.operations import AppServiceCertificateOrdersOperations as OperationClass elif api_version == '2021-01-15': from ..v2021_01_15.aio.operations import AppServiceCertificateOrdersOperations as OperationClass + elif api_version == '2021-02-01': + from ..v2021_02_01.aio.operations import AppServiceCertificateOrdersOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'app_service_certificate_orders'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -193,6 +200,7 @@ def app_service_environments(self): * 2020-12-01: :class:`AppServiceEnvironmentsOperations` * 2021-01-01: :class:`AppServiceEnvironmentsOperations` * 2021-01-15: :class:`AppServiceEnvironmentsOperations` + * 2021-02-01: :class:`AppServiceEnvironmentsOperations` """ api_version = self._get_api_version('app_service_environments') if api_version == '2016-09-01': @@ -211,6 +219,8 @@ def app_service_environments(self): from ..v2021_01_01.aio.operations import AppServiceEnvironmentsOperations as OperationClass elif api_version == '2021-01-15': from ..v2021_01_15.aio.operations import AppServiceEnvironmentsOperations as OperationClass + elif api_version == '2021-02-01': + from ..v2021_02_01.aio.operations import AppServiceEnvironmentsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'app_service_environments'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -227,6 +237,7 @@ def app_service_plans(self): * 2020-12-01: :class:`AppServicePlansOperations` * 2021-01-01: :class:`AppServicePlansOperations` * 2021-01-15: :class:`AppServicePlansOperations` + * 2021-02-01: :class:`AppServicePlansOperations` """ api_version = self._get_api_version('app_service_plans') if api_version == '2016-09-01': @@ -245,6 +256,8 @@ def app_service_plans(self): from ..v2021_01_01.aio.operations import AppServicePlansOperations as OperationClass elif api_version == '2021-01-15': from ..v2021_01_15.aio.operations import AppServicePlansOperations as OperationClass + elif api_version == '2021-02-01': + from ..v2021_02_01.aio.operations import AppServicePlansOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'app_service_plans'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -269,6 +282,7 @@ def certificate_orders_diagnostics(self): * 2020-12-01: :class:`CertificateOrdersDiagnosticsOperations` * 2021-01-01: :class:`CertificateOrdersDiagnosticsOperations` * 2021-01-15: :class:`CertificateOrdersDiagnosticsOperations` + * 2021-02-01: :class:`CertificateOrdersDiagnosticsOperations` """ api_version = self._get_api_version('certificate_orders_diagnostics') if api_version == '2020-12-01': @@ -277,6 +291,8 @@ def certificate_orders_diagnostics(self): from ..v2021_01_01.aio.operations import CertificateOrdersDiagnosticsOperations as OperationClass elif api_version == '2021-01-15': from ..v2021_01_15.aio.operations import CertificateOrdersDiagnosticsOperations as OperationClass + elif api_version == '2021-02-01': + from ..v2021_02_01.aio.operations import CertificateOrdersDiagnosticsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'certificate_orders_diagnostics'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -293,6 +309,7 @@ def certificate_registration_provider(self): * 2020-12-01: :class:`CertificateRegistrationProviderOperations` * 2021-01-01: :class:`CertificateRegistrationProviderOperations` * 2021-01-15: :class:`CertificateRegistrationProviderOperations` + * 2021-02-01: :class:`CertificateRegistrationProviderOperations` """ api_version = self._get_api_version('certificate_registration_provider') if api_version == '2015-08-01': @@ -311,6 +328,8 @@ def certificate_registration_provider(self): from ..v2021_01_01.aio.operations import CertificateRegistrationProviderOperations as OperationClass elif api_version == '2021-01-15': from ..v2021_01_15.aio.operations import CertificateRegistrationProviderOperations as OperationClass + elif api_version == '2021-02-01': + from ..v2021_02_01.aio.operations import CertificateRegistrationProviderOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'certificate_registration_provider'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -328,6 +347,7 @@ def certificates(self): * 2020-12-01: :class:`CertificatesOperations` * 2021-01-01: :class:`CertificatesOperations` * 2021-01-15: :class:`CertificatesOperations` + * 2021-02-01: :class:`CertificatesOperations` """ api_version = self._get_api_version('certificates') if api_version == '2016-03-01': @@ -348,6 +368,8 @@ def certificates(self): from ..v2021_01_01.aio.operations import CertificatesOperations as OperationClass elif api_version == '2021-01-15': from ..v2021_01_15.aio.operations import CertificatesOperations as OperationClass + elif api_version == '2021-02-01': + from ..v2021_02_01.aio.operations import CertificatesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'certificates'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -364,6 +386,7 @@ def deleted_web_apps(self): * 2020-12-01: :class:`DeletedWebAppsOperations` * 2021-01-01: :class:`DeletedWebAppsOperations` * 2021-01-15: :class:`DeletedWebAppsOperations` + * 2021-02-01: :class:`DeletedWebAppsOperations` """ api_version = self._get_api_version('deleted_web_apps') if api_version == '2016-03-01': @@ -382,6 +405,8 @@ def deleted_web_apps(self): from ..v2021_01_01.aio.operations import DeletedWebAppsOperations as OperationClass elif api_version == '2021-01-15': from ..v2021_01_15.aio.operations import DeletedWebAppsOperations as OperationClass + elif api_version == '2021-02-01': + from ..v2021_02_01.aio.operations import DeletedWebAppsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'deleted_web_apps'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -398,6 +423,7 @@ def diagnostics(self): * 2020-12-01: :class:`DiagnosticsOperations` * 2021-01-01: :class:`DiagnosticsOperations` * 2021-01-15: :class:`DiagnosticsOperations` + * 2021-02-01: :class:`DiagnosticsOperations` """ api_version = self._get_api_version('diagnostics') if api_version == '2016-03-01': @@ -416,6 +442,8 @@ def diagnostics(self): from ..v2021_01_01.aio.operations import DiagnosticsOperations as OperationClass elif api_version == '2021-01-15': from ..v2021_01_15.aio.operations import DiagnosticsOperations as OperationClass + elif api_version == '2021-02-01': + from ..v2021_02_01.aio.operations import DiagnosticsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'diagnostics'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -432,6 +460,7 @@ def domain_registration_provider(self): * 2020-12-01: :class:`DomainRegistrationProviderOperations` * 2021-01-01: :class:`DomainRegistrationProviderOperations` * 2021-01-15: :class:`DomainRegistrationProviderOperations` + * 2021-02-01: :class:`DomainRegistrationProviderOperations` """ api_version = self._get_api_version('domain_registration_provider') if api_version == '2015-04-01': @@ -450,6 +479,8 @@ def domain_registration_provider(self): from ..v2021_01_01.aio.operations import DomainRegistrationProviderOperations as OperationClass elif api_version == '2021-01-15': from ..v2021_01_15.aio.operations import DomainRegistrationProviderOperations as OperationClass + elif api_version == '2021-02-01': + from ..v2021_02_01.aio.operations import DomainRegistrationProviderOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'domain_registration_provider'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -466,6 +497,7 @@ def domains(self): * 2020-12-01: :class:`DomainsOperations` * 2021-01-01: :class:`DomainsOperations` * 2021-01-15: :class:`DomainsOperations` + * 2021-02-01: :class:`DomainsOperations` """ api_version = self._get_api_version('domains') if api_version == '2015-04-01': @@ -484,6 +516,8 @@ def domains(self): from ..v2021_01_01.aio.operations import DomainsOperations as OperationClass elif api_version == '2021-01-15': from ..v2021_01_15.aio.operations import DomainsOperations as OperationClass + elif api_version == '2021-02-01': + from ..v2021_02_01.aio.operations import DomainsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'domains'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -495,6 +529,7 @@ def global_model(self): * 2020-12-01: :class:`GlobalOperations` * 2021-01-01: :class:`GlobalOperations` * 2021-01-15: :class:`GlobalOperations` + * 2021-02-01: :class:`GlobalOperations` """ api_version = self._get_api_version('global_model') if api_version == '2020-12-01': @@ -503,6 +538,8 @@ def global_model(self): from ..v2021_01_01.aio.operations import GlobalOperations as OperationClass elif api_version == '2021-01-15': from ..v2021_01_15.aio.operations import GlobalOperations as OperationClass + elif api_version == '2021-02-01': + from ..v2021_02_01.aio.operations import GlobalOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'global_model'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -513,12 +550,15 @@ def kube_environments(self): * 2021-01-01: :class:`KubeEnvironmentsOperations` * 2021-01-15: :class:`KubeEnvironmentsOperations` + * 2021-02-01: :class:`KubeEnvironmentsOperations` """ api_version = self._get_api_version('kube_environments') if api_version == '2021-01-01': from ..v2021_01_01.aio.operations import KubeEnvironmentsOperations as OperationClass elif api_version == '2021-01-15': from ..v2021_01_15.aio.operations import KubeEnvironmentsOperations as OperationClass + elif api_version == '2021-02-01': + from ..v2021_02_01.aio.operations import KubeEnvironmentsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'kube_environments'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -535,6 +575,7 @@ def provider(self): * 2020-12-01: :class:`ProviderOperations` * 2021-01-01: :class:`ProviderOperations` * 2021-01-15: :class:`ProviderOperations` + * 2021-02-01: :class:`ProviderOperations` """ api_version = self._get_api_version('provider') if api_version == '2016-03-01': @@ -553,6 +594,8 @@ def provider(self): from ..v2021_01_01.aio.operations import ProviderOperations as OperationClass elif api_version == '2021-01-15': from ..v2021_01_15.aio.operations import ProviderOperations as OperationClass + elif api_version == '2021-02-01': + from ..v2021_02_01.aio.operations import ProviderOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'provider'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -569,6 +612,7 @@ def recommendations(self): * 2020-12-01: :class:`RecommendationsOperations` * 2021-01-01: :class:`RecommendationsOperations` * 2021-01-15: :class:`RecommendationsOperations` + * 2021-02-01: :class:`RecommendationsOperations` """ api_version = self._get_api_version('recommendations') if api_version == '2016-03-01': @@ -587,6 +631,8 @@ def recommendations(self): from ..v2021_01_01.aio.operations import RecommendationsOperations as OperationClass elif api_version == '2021-01-15': from ..v2021_01_15.aio.operations import RecommendationsOperations as OperationClass + elif api_version == '2021-02-01': + from ..v2021_02_01.aio.operations import RecommendationsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'recommendations'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -603,6 +649,7 @@ def resource_health_metadata(self): * 2020-12-01: :class:`ResourceHealthMetadataOperations` * 2021-01-01: :class:`ResourceHealthMetadataOperations` * 2021-01-15: :class:`ResourceHealthMetadataOperations` + * 2021-02-01: :class:`ResourceHealthMetadataOperations` """ api_version = self._get_api_version('resource_health_metadata') if api_version == '2016-03-01': @@ -621,6 +668,8 @@ def resource_health_metadata(self): from ..v2021_01_01.aio.operations import ResourceHealthMetadataOperations as OperationClass elif api_version == '2021-01-15': from ..v2021_01_15.aio.operations import ResourceHealthMetadataOperations as OperationClass + elif api_version == '2021-02-01': + from ..v2021_02_01.aio.operations import ResourceHealthMetadataOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'resource_health_metadata'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -635,6 +684,7 @@ def static_sites(self): * 2020-12-01: :class:`StaticSitesOperations` * 2021-01-01: :class:`StaticSitesOperations` * 2021-01-15: :class:`StaticSitesOperations` + * 2021-02-01: :class:`StaticSitesOperations` """ api_version = self._get_api_version('static_sites') if api_version == '2019-08-01': @@ -649,6 +699,8 @@ def static_sites(self): from ..v2021_01_01.aio.operations import StaticSitesOperations as OperationClass elif api_version == '2021-01-15': from ..v2021_01_15.aio.operations import StaticSitesOperations as OperationClass + elif api_version == '2021-02-01': + from ..v2021_02_01.aio.operations import StaticSitesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'static_sites'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -665,6 +717,7 @@ def top_level_domains(self): * 2020-12-01: :class:`TopLevelDomainsOperations` * 2021-01-01: :class:`TopLevelDomainsOperations` * 2021-01-15: :class:`TopLevelDomainsOperations` + * 2021-02-01: :class:`TopLevelDomainsOperations` """ api_version = self._get_api_version('top_level_domains') if api_version == '2015-04-01': @@ -683,6 +736,8 @@ def top_level_domains(self): from ..v2021_01_01.aio.operations import TopLevelDomainsOperations as OperationClass elif api_version == '2021-01-15': from ..v2021_01_15.aio.operations import TopLevelDomainsOperations as OperationClass + elif api_version == '2021-02-01': + from ..v2021_02_01.aio.operations import TopLevelDomainsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'top_level_domains'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -699,6 +754,7 @@ def web_apps(self): * 2020-12-01: :class:`WebAppsOperations` * 2021-01-01: :class:`WebAppsOperations` * 2021-01-15: :class:`WebAppsOperations` + * 2021-02-01: :class:`WebAppsOperations` """ api_version = self._get_api_version('web_apps') if api_version == '2016-08-01': @@ -717,6 +773,8 @@ def web_apps(self): from ..v2021_01_01.aio.operations import WebAppsOperations as OperationClass elif api_version == '2021-01-15': from ..v2021_01_15.aio.operations import WebAppsOperations as OperationClass + elif api_version == '2021-02-01': + from ..v2021_02_01.aio.operations import WebAppsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'web_apps'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/models.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/models.py index bca11c7b6d90..57f964015906 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/models.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/models.py @@ -6,4 +6,4 @@ # -------------------------------------------------------------------------- from .v2016_03_01.models import * from .v2018_02_01.models import * -from .v2021_01_15.models import * +from .v2021_02_01.models import * diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2015_04_01/_version.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2015_04_01/_version.py index 77f53a3589c6..34ea7990c4b4 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2015_04_01/_version.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2015_04_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "4.0.0" +VERSION = "5.0.0" diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2015_08_01/_version.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2015_08_01/_version.py index 77f53a3589c6..34ea7990c4b4 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2015_08_01/_version.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2015_08_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "4.0.0" +VERSION = "5.0.0" diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_03_01/_version.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_03_01/_version.py index 77f53a3589c6..34ea7990c4b4 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_03_01/_version.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_03_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "4.0.0" +VERSION = "5.0.0" diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_08_01/_version.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_08_01/_version.py index 77f53a3589c6..34ea7990c4b4 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_08_01/_version.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_08_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "4.0.0" +VERSION = "5.0.0" diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_09_01/_version.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_09_01/_version.py index 77f53a3589c6..34ea7990c4b4 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_09_01/_version.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_09_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "4.0.0" +VERSION = "5.0.0" diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2018_02_01/_version.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2018_02_01/_version.py index 77f53a3589c6..34ea7990c4b4 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2018_02_01/_version.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2018_02_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "4.0.0" +VERSION = "5.0.0" diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2018_11_01/_version.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2018_11_01/_version.py index 77f53a3589c6..34ea7990c4b4 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2018_11_01/_version.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2018_11_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "4.0.0" +VERSION = "5.0.0" diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2019_08_01/_version.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2019_08_01/_version.py index 77f53a3589c6..34ea7990c4b4 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2019_08_01/_version.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2019_08_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "4.0.0" +VERSION = "5.0.0" diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/_version.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/_version.py index 77f53a3589c6..34ea7990c4b4 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/_version.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_06_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "4.0.0" +VERSION = "5.0.0" diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/_version.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/_version.py index 77f53a3589c6..34ea7990c4b4 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/_version.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "4.0.0" +VERSION = "5.0.0" diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_12_01/_version.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_12_01/_version.py index 77f53a3589c6..34ea7990c4b4 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_12_01/_version.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_12_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "4.0.0" +VERSION = "5.0.0" diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_12_01/models/_models.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_12_01/models/_models.py index d4c1e71f5add..c83c8f54a194 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_12_01/models/_models.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_12_01/models/_models.py @@ -181,35 +181,16 @@ def __init__( self.vip_mappings = kwargs.get('vip_mappings', None) -class AllowedAudiencesValidation(ProxyOnlyResource): - """AllowedAudiencesValidation. +class AllowedAudiencesValidation(msrest.serialization.Model): + """The configuration settings of the Allowed Audiences validation flow. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str - :param allowed_audiences: + :param allowed_audiences: The configuration settings of the allowed list of audiences from + which to validate the JWT token. :type allowed_audiences: list[str] """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'allowed_audiences': {'key': 'properties.allowedAudiences', 'type': '[str]'}, + 'allowed_audiences': {'key': 'allowedAudiences', 'type': '[str]'}, } def __init__( @@ -471,19 +452,9 @@ def __init__( self.is_default_off = None -class Apple(ProxyOnlyResource): +class Apple(msrest.serialization.Model): """The configuration settings of the Apple provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`false` if the Apple provider should not be enabled despite the set registration; otherwise, :code:`true`. :type enabled: bool @@ -493,20 +464,10 @@ class Apple(ProxyOnlyResource): :type login: ~azure.mgmt.web.v2020_12_01.models.LoginScopes """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'registration': {'key': 'properties.registration', 'type': 'AppleRegistration'}, - 'login': {'key': 'properties.login', 'type': 'LoginScopes'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'AppleRegistration'}, + 'login': {'key': 'login', 'type': 'LoginScopes'}, } def __init__( @@ -519,38 +480,18 @@ def __init__( self.login = kwargs.get('login', None) -class AppleRegistration(ProxyOnlyResource): +class AppleRegistration(msrest.serialization.Model): """The configuration settings of the registration for the Apple provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param client_id: The Client ID of the app used for login. :type client_id: str :param client_secret_setting_name: The app setting name that contains the client secret. :type client_secret_setting_name: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'client_id': {'key': 'properties.clientId', 'type': 'str'}, - 'client_secret_setting_name': {'key': 'properties.clientSecretSettingName', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'client_secret_setting_name': {'key': 'clientSecretSettingName', 'type': 'str'}, } def __init__( @@ -723,38 +664,18 @@ def __init__( self.is_deprecated = kwargs.get('is_deprecated', None) -class AppRegistration(ProxyOnlyResource): +class AppRegistration(msrest.serialization.Model): """The configuration settings of the app registration for providers that have app ids and app secrets. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param app_id: The App ID of the app used for login. :type app_id: str :param app_secret_setting_name: The app setting name that contains the app secret. :type app_secret_setting_name: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'app_id': {'key': 'properties.appId', 'type': 'str'}, - 'app_secret_setting_name': {'key': 'properties.appSecretSettingName', 'type': 'str'}, + 'app_id': {'key': 'appId', 'type': 'str'}, + 'app_secret_setting_name': {'key': 'appSecretSettingName', 'type': 'str'}, } def __init__( @@ -2161,19 +2082,9 @@ def __init__( self.allow_new_private_endpoint_connections = kwargs.get('allow_new_private_endpoint_connections', None) -class AuthPlatform(ProxyOnlyResource): +class AuthPlatform(msrest.serialization.Model): """The configuration settings of the platform of App Service Authentication/Authorization. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`true` if the Authentication / Authorization feature is enabled for the current app; otherwise, :code:`false`. :type enabled: bool @@ -2188,20 +2099,10 @@ class AuthPlatform(ProxyOnlyResource): :type config_file_path: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'runtime_version': {'key': 'properties.runtimeVersion', 'type': 'str'}, - 'config_file_path': {'key': 'properties.configFilePath', 'type': 'str'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, + 'config_file_path': {'key': 'configFilePath', 'type': 'str'}, } def __init__( @@ -2330,19 +2231,9 @@ def __init__( self.status_codes_range = kwargs.get('status_codes_range', None) -class AzureActiveDirectory(ProxyOnlyResource): +class AzureActiveDirectory(msrest.serialization.Model): """The configuration settings of the Azure Active directory provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`false` if the Azure Active Directory provider should not be enabled despite the set registration; otherwise, :code:`true`. :type enabled: bool @@ -2361,22 +2252,12 @@ class AzureActiveDirectory(ProxyOnlyResource): :type is_auto_provisioned: bool """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'registration': {'key': 'properties.registration', 'type': 'AzureActiveDirectoryRegistration'}, - 'login': {'key': 'properties.login', 'type': 'AzureActiveDirectoryLogin'}, - 'validation': {'key': 'properties.validation', 'type': 'AzureActiveDirectoryValidation'}, - 'is_auto_provisioned': {'key': 'properties.isAutoProvisioned', 'type': 'bool'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'AzureActiveDirectoryRegistration'}, + 'login': {'key': 'login', 'type': 'AzureActiveDirectoryLogin'}, + 'validation': {'key': 'validation', 'type': 'AzureActiveDirectoryValidation'}, + 'is_auto_provisioned': {'key': 'isAutoProvisioned', 'type': 'bool'}, } def __init__( @@ -2391,40 +2272,21 @@ def __init__( self.is_auto_provisioned = kwargs.get('is_auto_provisioned', None) -class AzureActiveDirectoryLogin(ProxyOnlyResource): +class AzureActiveDirectoryLogin(msrest.serialization.Model): """The configuration settings of the Azure Active Directory login flow. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str - :param disable_www_authenticate: - :type disable_www_authenticate: bool :param login_parameters: Login parameters to send to the OpenID Connect authorization endpoint when a user logs in. Each parameter must be in the form "key=value". :type login_parameters: list[str] + :param disable_www_authenticate: :code:`true` if the www-authenticate provider + should be omitted from the request; otherwise, :code:`false`. + :type disable_www_authenticate: bool """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'disable_www_authenticate': {'key': 'properties.disableWWWAuthenticate', 'type': 'bool'}, - 'login_parameters': {'key': 'properties.loginParameters', 'type': '[str]'}, + 'login_parameters': {'key': 'loginParameters', 'type': '[str]'}, + 'disable_www_authenticate': {'key': 'disableWWWAuthenticate', 'type': 'bool'}, } def __init__( @@ -2432,23 +2294,13 @@ def __init__( **kwargs ): super(AzureActiveDirectoryLogin, self).__init__(**kwargs) - self.disable_www_authenticate = kwargs.get('disable_www_authenticate', None) self.login_parameters = kwargs.get('login_parameters', None) + self.disable_www_authenticate = kwargs.get('disable_www_authenticate', None) -class AzureActiveDirectoryRegistration(ProxyOnlyResource): +class AzureActiveDirectoryRegistration(msrest.serialization.Model): """The configuration settings of the Azure Active Directory app registration. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param open_id_issuer: The OpenID Connect Issuer URI that represents the entity which issues access tokens for this application. When using Azure Active Directory, this value is the URI of the directory tenant, e.g. @@ -2470,23 +2322,24 @@ class AzureActiveDirectoryRegistration(ProxyOnlyResource): thumbprint of a certificate used for signing purposes. This property acts as a replacement for the Client Secret. It is also optional. :type client_secret_certificate_thumbprint: str + :param client_secret_certificate_subject_alternative_name: An alternative to the client secret + thumbprint, that is the subject alternative name of a certificate used for signing purposes. + This property acts as + a replacement for the Client Secret Certificate Thumbprint. It is also optional. + :type client_secret_certificate_subject_alternative_name: str + :param client_secret_certificate_issuer: An alternative to the client secret thumbprint, that + is the issuer of a certificate used for signing purposes. This property acts as + a replacement for the Client Secret Certificate Thumbprint. It is also optional. + :type client_secret_certificate_issuer: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'open_id_issuer': {'key': 'properties.openIdIssuer', 'type': 'str'}, - 'client_id': {'key': 'properties.clientId', 'type': 'str'}, - 'client_secret_setting_name': {'key': 'properties.clientSecretSettingName', 'type': 'str'}, - 'client_secret_certificate_thumbprint': {'key': 'properties.clientSecretCertificateThumbprint', 'type': 'str'}, + 'open_id_issuer': {'key': 'openIdIssuer', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'client_secret_setting_name': {'key': 'clientSecretSettingName', 'type': 'str'}, + 'client_secret_certificate_thumbprint': {'key': 'clientSecretCertificateThumbprint', 'type': 'str'}, + 'client_secret_certificate_subject_alternative_name': {'key': 'clientSecretCertificateSubjectAlternativeName', 'type': 'str'}, + 'client_secret_certificate_issuer': {'key': 'clientSecretCertificateIssuer', 'type': 'str'}, } def __init__( @@ -2498,21 +2351,13 @@ def __init__( self.client_id = kwargs.get('client_id', None) self.client_secret_setting_name = kwargs.get('client_secret_setting_name', None) self.client_secret_certificate_thumbprint = kwargs.get('client_secret_certificate_thumbprint', None) + self.client_secret_certificate_subject_alternative_name = kwargs.get('client_secret_certificate_subject_alternative_name', None) + self.client_secret_certificate_issuer = kwargs.get('client_secret_certificate_issuer', None) -class AzureActiveDirectoryValidation(ProxyOnlyResource): +class AzureActiveDirectoryValidation(msrest.serialization.Model): """The configuration settings of the Azure Active Directory token validation flow. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param jwt_claim_checks: The configuration settings of the checks that should be made while validating the JWT Claims. :type jwt_claim_checks: ~azure.mgmt.web.v2020_12_01.models.JwtClaimChecks @@ -2521,19 +2366,9 @@ class AzureActiveDirectoryValidation(ProxyOnlyResource): :type allowed_audiences: list[str] """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'jwt_claim_checks': {'key': 'properties.jwtClaimChecks', 'type': 'JwtClaimChecks'}, - 'allowed_audiences': {'key': 'properties.allowedAudiences', 'type': '[str]'}, + 'jwt_claim_checks': {'key': 'jwtClaimChecks', 'type': 'JwtClaimChecks'}, + 'allowed_audiences': {'key': 'allowedAudiences', 'type': '[str]'}, } def __init__( @@ -2605,19 +2440,9 @@ def __init__( self.enabled = kwargs.get('enabled', None) -class AzureStaticWebApps(ProxyOnlyResource): +class AzureStaticWebApps(msrest.serialization.Model): """The configuration settings of the Azure Static Web Apps provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`false` if the Azure Static Web Apps provider should not be enabled despite the set registration; otherwise, :code:`true`. :type enabled: bool @@ -2625,19 +2450,9 @@ class AzureStaticWebApps(ProxyOnlyResource): :type registration: ~azure.mgmt.web.v2020_12_01.models.AzureStaticWebAppsRegistration """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'registration': {'key': 'properties.registration', 'type': 'AzureStaticWebAppsRegistration'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'AzureStaticWebAppsRegistration'}, } def __init__( @@ -2649,35 +2464,15 @@ def __init__( self.registration = kwargs.get('registration', None) -class AzureStaticWebAppsRegistration(ProxyOnlyResource): +class AzureStaticWebAppsRegistration(msrest.serialization.Model): """The configuration settings of the registration for the Azure Static Web Apps provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param client_id: The Client ID of the app used for login. :type client_id: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'client_id': {'key': 'properties.clientId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, } def __init__( @@ -3150,36 +2945,16 @@ def __init__( self.next_link = None -class BlobStorageTokenStore(ProxyOnlyResource): +class BlobStorageTokenStore(msrest.serialization.Model): """The configuration settings of the storage of the tokens if blob storage is used. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param sas_url_setting_name: The name of the app setting containing the SAS URL of the blob storage containing the tokens. :type sas_url_setting_name: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'sas_url_setting_name': {'key': 'properties.sasUrlSettingName', 'type': 'str'}, + 'sas_url_setting_name': {'key': 'sasUrlSettingName', 'type': 'str'}, } def __init__( @@ -3726,38 +3501,18 @@ def __init__( self.domain_validation_method = kwargs.get('domain_validation_method', None) -class ClientRegistration(ProxyOnlyResource): +class ClientRegistration(msrest.serialization.Model): """The configuration settings of the app registration for providers that have client ids and client secrets. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param client_id: The Client ID of the app used for login. :type client_id: str :param client_secret_setting_name: The app setting name that contains the client secret. :type client_secret_setting_name: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'client_id': {'key': 'properties.clientId', 'type': 'str'}, - 'client_secret_setting_name': {'key': 'properties.clientSecretSettingName', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'client_secret_setting_name': {'key': 'clientSecretSettingName', 'type': 'str'}, } def __init__( @@ -4359,40 +4114,20 @@ def __init__( self.next_link = None -class CookieExpiration(ProxyOnlyResource): +class CookieExpiration(msrest.serialization.Model): """The configuration settings of the session cookie's expiration. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param convention: The convention used when determining the session cookie's expiration. Possible values include: "FixedTime", "IdentityProviderDerived". :type convention: str or ~azure.mgmt.web.v2020_12_01.models.CookieExpirationConvention :param time_to_expiration: The time after the request is made when the session cookie should expire. - :type time_to_expiration: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } + :type time_to_expiration: str + """ _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'convention': {'key': 'properties.convention', 'type': 'str'}, - 'time_to_expiration': {'key': 'properties.timeToExpiration', 'type': 'str'}, + 'convention': {'key': 'convention', 'type': 'str'}, + 'time_to_expiration': {'key': 'timeToExpiration', 'type': 'str'}, } def __init__( @@ -4873,19 +4608,9 @@ def __init__( self.alternate_txt_records = kwargs.get('alternate_txt_records', None) -class CustomOpenIdConnectProvider(ProxyOnlyResource): +class CustomOpenIdConnectProvider(msrest.serialization.Model): """The configuration settings of the custom Open ID Connect provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`false` if the custom Open ID provider provider should not be enabled; otherwise, :code:`true`. :type enabled: bool @@ -4897,20 +4622,10 @@ class CustomOpenIdConnectProvider(ProxyOnlyResource): :type login: ~azure.mgmt.web.v2020_12_01.models.OpenIdConnectLogin """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'registration': {'key': 'properties.registration', 'type': 'OpenIdConnectRegistration'}, - 'login': {'key': 'properties.login', 'type': 'OpenIdConnectLogin'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'OpenIdConnectRegistration'}, + 'login': {'key': 'login', 'type': 'OpenIdConnectLogin'}, } def __init__( @@ -6764,19 +6479,9 @@ def __init__( self.ramp_up_rules = kwargs.get('ramp_up_rules', None) -class Facebook(ProxyOnlyResource): +class Facebook(msrest.serialization.Model): """The configuration settings of the Facebook provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`false` if the Facebook provider should not be enabled despite the set registration; otherwise, :code:`true`. :type enabled: bool @@ -6789,21 +6494,11 @@ class Facebook(ProxyOnlyResource): :type login: ~azure.mgmt.web.v2020_12_01.models.LoginScopes """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'registration': {'key': 'properties.registration', 'type': 'AppRegistration'}, - 'graph_api_version': {'key': 'properties.graphApiVersion', 'type': 'str'}, - 'login': {'key': 'properties.login', 'type': 'LoginScopes'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'AppRegistration'}, + 'graph_api_version': {'key': 'graphApiVersion', 'type': 'str'}, + 'login': {'key': 'login', 'type': 'LoginScopes'}, } def __init__( @@ -6873,35 +6568,15 @@ def __init__( self.enabled = kwargs.get('enabled', None) -class FileSystemTokenStore(ProxyOnlyResource): +class FileSystemTokenStore(msrest.serialization.Model): """The configuration settings of the storage of the tokens if a file system is used. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param directory: The directory in which the tokens will be stored. :type directory: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'directory': {'key': 'properties.directory', 'type': 'str'}, + 'directory': {'key': 'directory', 'type': 'str'}, } def __init__( @@ -6912,19 +6587,9 @@ def __init__( self.directory = kwargs.get('directory', None) -class ForwardProxy(ProxyOnlyResource): +class ForwardProxy(msrest.serialization.Model): """The configuration settings of a forward proxy used to make the requests. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param convention: The convention used to determine the url of the request made. Possible values include: "NoProxy", "Standard", "Custom". :type convention: str or ~azure.mgmt.web.v2020_12_01.models.ForwardProxyConvention @@ -6934,20 +6599,10 @@ class ForwardProxy(ProxyOnlyResource): :type custom_proto_header_name: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'convention': {'key': 'properties.convention', 'type': 'str'}, - 'custom_host_header_name': {'key': 'properties.customHostHeaderName', 'type': 'str'}, - 'custom_proto_header_name': {'key': 'properties.customProtoHeaderName', 'type': 'str'}, + 'convention': {'key': 'convention', 'type': 'str'}, + 'custom_host_header_name': {'key': 'customHostHeaderName', 'type': 'str'}, + 'custom_proto_header_name': {'key': 'customProtoHeaderName', 'type': 'str'}, } def __init__( @@ -7479,19 +7134,9 @@ def __init__( self.next_link = None -class GitHub(ProxyOnlyResource): +class GitHub(msrest.serialization.Model): """The configuration settings of the GitHub provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`false` if the GitHub provider should not be enabled despite the set registration; otherwise, :code:`true`. :type enabled: bool @@ -7502,20 +7147,10 @@ class GitHub(ProxyOnlyResource): :type login: ~azure.mgmt.web.v2020_12_01.models.LoginScopes """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'registration': {'key': 'properties.registration', 'type': 'ClientRegistration'}, - 'login': {'key': 'properties.login', 'type': 'LoginScopes'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'ClientRegistration'}, + 'login': {'key': 'login', 'type': 'LoginScopes'}, } def __init__( @@ -7691,19 +7326,9 @@ def __init__( self.capabilities = kwargs.get('capabilities', None) -class GlobalValidation(ProxyOnlyResource): +class GlobalValidation(msrest.serialization.Model): """The configuration settings that determines the validation flow of users using App Service Authentication/Authorization. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param require_authentication: :code:`true` if the authentication flow is required any request is made; otherwise, :code:`false`. :type require_authentication: bool @@ -7723,21 +7348,11 @@ class GlobalValidation(ProxyOnlyResource): :type excluded_paths: list[str] """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'require_authentication': {'key': 'properties.requireAuthentication', 'type': 'bool'}, - 'unauthenticated_client_action': {'key': 'properties.unauthenticatedClientAction', 'type': 'str'}, - 'redirect_to_provider': {'key': 'properties.redirectToProvider', 'type': 'str'}, - 'excluded_paths': {'key': 'properties.excludedPaths', 'type': '[str]'}, + 'require_authentication': {'key': 'requireAuthentication', 'type': 'bool'}, + 'unauthenticated_client_action': {'key': 'unauthenticatedClientAction', 'type': 'str'}, + 'redirect_to_provider': {'key': 'redirectToProvider', 'type': 'str'}, + 'excluded_paths': {'key': 'excludedPaths', 'type': '[str]'}, } def __init__( @@ -7751,19 +7366,9 @@ def __init__( self.excluded_paths = kwargs.get('excluded_paths', None) -class Google(ProxyOnlyResource): +class Google(msrest.serialization.Model): """The configuration settings of the Google provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`false` if the Google provider should not be enabled despite the set registration; otherwise, :code:`true`. :type enabled: bool @@ -7777,21 +7382,11 @@ class Google(ProxyOnlyResource): :type validation: ~azure.mgmt.web.v2020_12_01.models.AllowedAudiencesValidation """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'registration': {'key': 'properties.registration', 'type': 'ClientRegistration'}, - 'login': {'key': 'properties.login', 'type': 'LoginScopes'}, - 'validation': {'key': 'properties.validation', 'type': 'AllowedAudiencesValidation'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'ClientRegistration'}, + 'login': {'key': 'login', 'type': 'LoginScopes'}, + 'validation': {'key': 'validation', 'type': 'AllowedAudiencesValidation'}, } def __init__( @@ -8158,19 +7753,9 @@ def __init__( self.azure_blob_storage = kwargs.get('azure_blob_storage', None) -class HttpSettings(ProxyOnlyResource): +class HttpSettings(msrest.serialization.Model): """The configuration settings of the HTTP requests for authentication and authorization requests made against App Service Authentication/Authorization. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param require_https: :code:`false` if the authentication/authorization responses not having the HTTPS scheme are permissible; otherwise, :code:`true`. :type require_https: bool @@ -8180,20 +7765,10 @@ class HttpSettings(ProxyOnlyResource): :type forward_proxy: ~azure.mgmt.web.v2020_12_01.models.ForwardProxy """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'require_https': {'key': 'properties.requireHttps', 'type': 'bool'}, - 'routes': {'key': 'properties.routes', 'type': 'HttpSettingsRoutes'}, - 'forward_proxy': {'key': 'properties.forwardProxy', 'type': 'ForwardProxy'}, + 'require_https': {'key': 'requireHttps', 'type': 'bool'}, + 'routes': {'key': 'routes', 'type': 'HttpSettingsRoutes'}, + 'forward_proxy': {'key': 'forwardProxy', 'type': 'ForwardProxy'}, } def __init__( @@ -8206,35 +7781,15 @@ def __init__( self.forward_proxy = kwargs.get('forward_proxy', None) -class HttpSettingsRoutes(ProxyOnlyResource): +class HttpSettingsRoutes(msrest.serialization.Model): """The configuration settings of the paths HTTP requests. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param api_prefix: The prefix that should precede all the authentication/authorization paths. :type api_prefix: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'api_prefix': {'key': 'properties.apiPrefix', 'type': 'str'}, + 'api_prefix': {'key': 'apiPrefix', 'type': 'str'}, } def __init__( @@ -8509,19 +8064,9 @@ def __init__( self.next_link = None -class IdentityProviders(ProxyOnlyResource): +class IdentityProviders(msrest.serialization.Model): """The configuration settings of each of the identity providers used to configure App Service Authentication/Authorization. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param azure_active_directory: The configuration settings of the Azure Active directory provider. :type azure_active_directory: ~azure.mgmt.web.v2020_12_01.models.AzureActiveDirectory @@ -8531,42 +8076,32 @@ class IdentityProviders(ProxyOnlyResource): :type git_hub: ~azure.mgmt.web.v2020_12_01.models.GitHub :param google: The configuration settings of the Google provider. :type google: ~azure.mgmt.web.v2020_12_01.models.Google - :param twitter: The configuration settings of the Twitter provider. - :type twitter: ~azure.mgmt.web.v2020_12_01.models.Twitter - :param custom_open_id_connect_providers: The map of the name of the alias of each custom Open - ID Connect provider to the - configuration settings of the custom Open ID Connect provider. - :type custom_open_id_connect_providers: dict[str, - ~azure.mgmt.web.v2020_12_01.models.CustomOpenIdConnectProvider] :param legacy_microsoft_account: The configuration settings of the legacy Microsoft Account provider. :type legacy_microsoft_account: ~azure.mgmt.web.v2020_12_01.models.LegacyMicrosoftAccount + :param twitter: The configuration settings of the Twitter provider. + :type twitter: ~azure.mgmt.web.v2020_12_01.models.Twitter :param apple: The configuration settings of the Apple provider. :type apple: ~azure.mgmt.web.v2020_12_01.models.Apple :param azure_static_web_apps: The configuration settings of the Azure Static Web Apps provider. :type azure_static_web_apps: ~azure.mgmt.web.v2020_12_01.models.AzureStaticWebApps + :param custom_open_id_connect_providers: The map of the name of the alias of each custom Open + ID Connect provider to the + configuration settings of the custom Open ID Connect provider. + :type custom_open_id_connect_providers: dict[str, + ~azure.mgmt.web.v2020_12_01.models.CustomOpenIdConnectProvider] """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'azure_active_directory': {'key': 'properties.azureActiveDirectory', 'type': 'AzureActiveDirectory'}, - 'facebook': {'key': 'properties.facebook', 'type': 'Facebook'}, - 'git_hub': {'key': 'properties.gitHub', 'type': 'GitHub'}, - 'google': {'key': 'properties.google', 'type': 'Google'}, - 'twitter': {'key': 'properties.twitter', 'type': 'Twitter'}, - 'custom_open_id_connect_providers': {'key': 'properties.customOpenIdConnectProviders', 'type': '{CustomOpenIdConnectProvider}'}, - 'legacy_microsoft_account': {'key': 'properties.legacyMicrosoftAccount', 'type': 'LegacyMicrosoftAccount'}, - 'apple': {'key': 'properties.apple', 'type': 'Apple'}, - 'azure_static_web_apps': {'key': 'properties.azureStaticWebApps', 'type': 'AzureStaticWebApps'}, + 'azure_active_directory': {'key': 'azureActiveDirectory', 'type': 'AzureActiveDirectory'}, + 'facebook': {'key': 'facebook', 'type': 'Facebook'}, + 'git_hub': {'key': 'gitHub', 'type': 'GitHub'}, + 'google': {'key': 'google', 'type': 'Google'}, + 'legacy_microsoft_account': {'key': 'legacyMicrosoftAccount', 'type': 'LegacyMicrosoftAccount'}, + 'twitter': {'key': 'twitter', 'type': 'Twitter'}, + 'apple': {'key': 'apple', 'type': 'Apple'}, + 'azure_static_web_apps': {'key': 'azureStaticWebApps', 'type': 'AzureStaticWebApps'}, + 'custom_open_id_connect_providers': {'key': 'customOpenIdConnectProviders', 'type': '{CustomOpenIdConnectProvider}'}, } def __init__( @@ -8578,11 +8113,11 @@ def __init__( self.facebook = kwargs.get('facebook', None) self.git_hub = kwargs.get('git_hub', None) self.google = kwargs.get('google', None) - self.twitter = kwargs.get('twitter', None) - self.custom_open_id_connect_providers = kwargs.get('custom_open_id_connect_providers', None) self.legacy_microsoft_account = kwargs.get('legacy_microsoft_account', None) + self.twitter = kwargs.get('twitter', None) self.apple = kwargs.get('apple', None) self.azure_static_web_apps = kwargs.get('azure_static_web_apps', None) + self.custom_open_id_connect_providers = kwargs.get('custom_open_id_connect_providers', None) class InboundEnvironmentEndpoint(msrest.serialization.Model): @@ -8731,38 +8266,18 @@ def __init__( self.headers = kwargs.get('headers', None) -class JwtClaimChecks(ProxyOnlyResource): +class JwtClaimChecks(msrest.serialization.Model): """The configuration settings of the checks that should be made while validating the JWT Claims. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param allowed_groups: The list of the allowed groups. :type allowed_groups: list[str] :param allowed_client_applications: The list of the allowed client applications. :type allowed_client_applications: list[str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'allowed_groups': {'key': 'properties.allowedGroups', 'type': '[str]'}, - 'allowed_client_applications': {'key': 'properties.allowedClientApplications', 'type': '[str]'}, + """ + + _attribute_map = { + 'allowed_groups': {'key': 'allowedGroups', 'type': '[str]'}, + 'allowed_client_applications': {'key': 'allowedClientApplications', 'type': '[str]'}, } def __init__( @@ -8861,19 +8376,9 @@ def __init__( self.type = None -class LegacyMicrosoftAccount(ProxyOnlyResource): +class LegacyMicrosoftAccount(msrest.serialization.Model): """The configuration settings of the legacy Microsoft Account provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`false` if the legacy Microsoft Account provider should not be enabled despite the set registration; otherwise, :code:`true`. :type enabled: bool @@ -8887,21 +8392,11 @@ class LegacyMicrosoftAccount(ProxyOnlyResource): :type validation: ~azure.mgmt.web.v2020_12_01.models.AllowedAudiencesValidation """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'registration': {'key': 'properties.registration', 'type': 'ClientRegistration'}, - 'login': {'key': 'properties.login', 'type': 'LoginScopes'}, - 'validation': {'key': 'properties.validation', 'type': 'AllowedAudiencesValidation'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'ClientRegistration'}, + 'login': {'key': 'login', 'type': 'LoginScopes'}, + 'validation': {'key': 'validation', 'type': 'AllowedAudiencesValidation'}, } def __init__( @@ -9003,19 +8498,9 @@ def __init__( self.localized_value = kwargs.get('localized_value', None) -class Login(ProxyOnlyResource): +class Login(msrest.serialization.Model): """The configuration settings of the login flow of users using App Service Authentication/Authorization. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param routes: The routes that specify the endpoints used for login and logout requests. :type routes: ~azure.mgmt.web.v2020_12_01.models.LoginRoutes :param token_store: The configuration settings of the token store. @@ -9034,23 +8519,13 @@ class Login(ProxyOnlyResource): :type nonce: ~azure.mgmt.web.v2020_12_01.models.Nonce """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'routes': {'key': 'properties.routes', 'type': 'LoginRoutes'}, - 'token_store': {'key': 'properties.tokenStore', 'type': 'TokenStore'}, - 'preserve_url_fragments_for_logins': {'key': 'properties.preserveUrlFragmentsForLogins', 'type': 'bool'}, - 'allowed_external_redirect_urls': {'key': 'properties.allowedExternalRedirectUrls', 'type': '[str]'}, - 'cookie_expiration': {'key': 'properties.cookieExpiration', 'type': 'CookieExpiration'}, - 'nonce': {'key': 'properties.nonce', 'type': 'Nonce'}, + 'routes': {'key': 'routes', 'type': 'LoginRoutes'}, + 'token_store': {'key': 'tokenStore', 'type': 'TokenStore'}, + 'preserve_url_fragments_for_logins': {'key': 'preserveUrlFragmentsForLogins', 'type': 'bool'}, + 'allowed_external_redirect_urls': {'key': 'allowedExternalRedirectUrls', 'type': '[str]'}, + 'cookie_expiration': {'key': 'cookieExpiration', 'type': 'CookieExpiration'}, + 'nonce': {'key': 'nonce', 'type': 'Nonce'}, } def __init__( @@ -9066,35 +8541,15 @@ def __init__( self.nonce = kwargs.get('nonce', None) -class LoginRoutes(ProxyOnlyResource): +class LoginRoutes(msrest.serialization.Model): """The routes that specify the endpoints used for login and logout requests. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param logout_endpoint: The endpoint at which a logout request should be made. :type logout_endpoint: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'logout_endpoint': {'key': 'properties.logoutEndpoint', 'type': 'str'}, + 'logout_endpoint': {'key': 'logoutEndpoint', 'type': 'str'}, } def __init__( @@ -9105,35 +8560,15 @@ def __init__( self.logout_endpoint = kwargs.get('logout_endpoint', None) -class LoginScopes(ProxyOnlyResource): +class LoginScopes(msrest.serialization.Model): """The configuration settings of the login flow, including the scopes that should be requested. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param scopes: A list of the scopes that should be requested while authenticating. :type scopes: list[str] """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'scopes': {'key': 'properties.scopes', 'type': '[str]'}, + 'scopes': {'key': 'scopes', 'type': '[str]'}, } def __init__( @@ -9782,19 +9217,9 @@ def __init__( self.message = kwargs.get('message', None) -class Nonce(ProxyOnlyResource): +class Nonce(msrest.serialization.Model): """The configuration settings of the nonce used in the login flow. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param validate_nonce: :code:`false` if the nonce should not be validated while completing the login flow; otherwise, :code:`true`. :type validate_nonce: bool @@ -9803,19 +9228,9 @@ class Nonce(ProxyOnlyResource): :type nonce_expiration_interval: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'validate_nonce': {'key': 'properties.validateNonce', 'type': 'bool'}, - 'nonce_expiration_interval': {'key': 'properties.nonceExpirationInterval', 'type': 'str'}, + 'validate_nonce': {'key': 'validateNonce', 'type': 'bool'}, + 'nonce_expiration_interval': {'key': 'nonceExpirationInterval', 'type': 'str'}, } def __init__( @@ -9827,19 +9242,9 @@ def __init__( self.nonce_expiration_interval = kwargs.get('nonce_expiration_interval', None) -class OpenIdConnectClientCredential(ProxyOnlyResource): +class OpenIdConnectClientCredential(msrest.serialization.Model): """The authentication client credentials of the custom Open ID Connect provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param method: The method that should be used to authenticate the user. The only acceptable values to pass in are None and "ClientSecretPost". The default value is None. :type method: str @@ -9848,19 +9253,9 @@ class OpenIdConnectClientCredential(ProxyOnlyResource): :type client_secret_setting_name: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'method': {'key': 'properties.method', 'type': 'str'}, - 'client_secret_setting_name': {'key': 'properties.clientSecretSettingName', 'type': 'str'}, + 'method': {'key': 'method', 'type': 'str'}, + 'client_secret_setting_name': {'key': 'clientSecretSettingName', 'type': 'str'}, } def __init__( @@ -9872,19 +9267,9 @@ def __init__( self.client_secret_setting_name = kwargs.get('client_secret_setting_name', None) -class OpenIdConnectConfig(ProxyOnlyResource): +class OpenIdConnectConfig(msrest.serialization.Model): """The configuration settings of the endpoints used for the custom Open ID Connect provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param authorization_endpoint: The endpoint to be used to make an authorization request. :type authorization_endpoint: str :param token_endpoint: The endpoint to be used to request a token. @@ -9898,22 +9283,12 @@ class OpenIdConnectConfig(ProxyOnlyResource): :type well_known_open_id_configuration: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'authorization_endpoint': {'key': 'properties.authorizationEndpoint', 'type': 'str'}, - 'token_endpoint': {'key': 'properties.tokenEndpoint', 'type': 'str'}, - 'issuer': {'key': 'properties.issuer', 'type': 'str'}, - 'certification_uri': {'key': 'properties.certificationUri', 'type': 'str'}, - 'well_known_open_id_configuration': {'key': 'properties.wellKnownOpenIdConfiguration', 'type': 'str'}, + 'authorization_endpoint': {'key': 'authorizationEndpoint', 'type': 'str'}, + 'token_endpoint': {'key': 'tokenEndpoint', 'type': 'str'}, + 'issuer': {'key': 'issuer', 'type': 'str'}, + 'certification_uri': {'key': 'certificationUri', 'type': 'str'}, + 'well_known_open_id_configuration': {'key': 'wellKnownOpenIdConfiguration', 'type': 'str'}, } def __init__( @@ -9928,38 +9303,18 @@ def __init__( self.well_known_open_id_configuration = kwargs.get('well_known_open_id_configuration', None) -class OpenIdConnectLogin(ProxyOnlyResource): +class OpenIdConnectLogin(msrest.serialization.Model): """The configuration settings of the login flow of the custom Open ID Connect provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param name_claim_type: The name of the claim that contains the users name. :type name_claim_type: str :param scopes: A list of the scopes that should be requested while authenticating. :type scopes: list[str] """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'name_claim_type': {'key': 'properties.nameClaimType', 'type': 'str'}, - 'scopes': {'key': 'properties.scopes', 'type': '[str]'}, + 'name_claim_type': {'key': 'nameClaimType', 'type': 'str'}, + 'scopes': {'key': 'scopes', 'type': '[str]'}, } def __init__( @@ -9971,19 +9326,9 @@ def __init__( self.scopes = kwargs.get('scopes', None) -class OpenIdConnectRegistration(ProxyOnlyResource): +class OpenIdConnectRegistration(msrest.serialization.Model): """The configuration settings of the app registration for the custom Open ID Connect provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param client_id: The client id of the custom Open ID Connect provider. :type client_id: str :param client_credential: The authentication credentials of the custom Open ID Connect @@ -9994,20 +9339,10 @@ class OpenIdConnectRegistration(ProxyOnlyResource): :type open_id_connect_configuration: ~azure.mgmt.web.v2020_12_01.models.OpenIdConnectConfig """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'client_id': {'key': 'properties.clientId', 'type': 'str'}, - 'client_credential': {'key': 'properties.clientCredential', 'type': 'OpenIdConnectClientCredential'}, - 'open_id_connect_configuration': {'key': 'properties.openIdConnectConfiguration', 'type': 'OpenIdConnectConfig'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'client_credential': {'key': 'clientCredential', 'type': 'OpenIdConnectClientCredential'}, + 'open_id_connect_configuration': {'key': 'openIdConnectConfiguration', 'type': 'OpenIdConnectConfig'}, } def __init__( @@ -17196,19 +16531,9 @@ def __init__( self.next_link = None -class TokenStore(ProxyOnlyResource): +class TokenStore(msrest.serialization.Model): """The configuration settings of the token store. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`true` to durably store platform-specific security tokens that are obtained during login flows; otherwise, :code:`false`. The default is :code:`false`. @@ -17225,21 +16550,11 @@ class TokenStore(ProxyOnlyResource): :type azure_blob_storage: ~azure.mgmt.web.v2020_12_01.models.BlobStorageTokenStore """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'token_refresh_extension_hours': {'key': 'properties.tokenRefreshExtensionHours', 'type': 'float'}, - 'file_system': {'key': 'properties.fileSystem', 'type': 'FileSystemTokenStore'}, - 'azure_blob_storage': {'key': 'properties.azureBlobStorage', 'type': 'BlobStorageTokenStore'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'token_refresh_extension_hours': {'key': 'tokenRefreshExtensionHours', 'type': 'float'}, + 'file_system': {'key': 'fileSystem', 'type': 'FileSystemTokenStore'}, + 'azure_blob_storage': {'key': 'azureBlobStorage', 'type': 'BlobStorageTokenStore'}, } def __init__( @@ -17607,19 +16922,9 @@ def __init__( self.next_link = None -class Twitter(ProxyOnlyResource): +class Twitter(msrest.serialization.Model): """The configuration settings of the Twitter provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`false` if the Twitter provider should not be enabled despite the set registration; otherwise, :code:`true`. :type enabled: bool @@ -17628,19 +16933,9 @@ class Twitter(ProxyOnlyResource): :type registration: ~azure.mgmt.web.v2020_12_01.models.TwitterRegistration """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'registration': {'key': 'properties.registration', 'type': 'TwitterRegistration'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'TwitterRegistration'}, } def __init__( @@ -17652,19 +16947,9 @@ def __init__( self.registration = kwargs.get('registration', None) -class TwitterRegistration(ProxyOnlyResource): +class TwitterRegistration(msrest.serialization.Model): """The configuration settings of the app registration for the Twitter provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param consumer_key: The OAuth 1.0a consumer key of the Twitter application used for sign-in. This setting is required for enabling Twitter Sign-In. Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in. @@ -17675,19 +16960,9 @@ class TwitterRegistration(ProxyOnlyResource): :type consumer_secret_setting_name: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'consumer_key': {'key': 'properties.consumerKey', 'type': 'str'}, - 'consumer_secret_setting_name': {'key': 'properties.consumerSecretSettingName', 'type': 'str'}, + 'consumer_key': {'key': 'consumerKey', 'type': 'str'}, + 'consumer_secret_setting_name': {'key': 'consumerSecretSettingName', 'type': 'str'}, } def __init__( diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_12_01/models/_models_py3.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_12_01/models/_models_py3.py index b817ad585630..9a3bfffdc1d0 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_12_01/models/_models_py3.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_12_01/models/_models_py3.py @@ -206,45 +206,25 @@ def __init__( self.vip_mappings = vip_mappings -class AllowedAudiencesValidation(ProxyOnlyResource): - """AllowedAudiencesValidation. +class AllowedAudiencesValidation(msrest.serialization.Model): + """The configuration settings of the Allowed Audiences validation flow. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str - :param allowed_audiences: + :param allowed_audiences: The configuration settings of the allowed list of audiences from + which to validate the JWT token. :type allowed_audiences: list[str] """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'allowed_audiences': {'key': 'properties.allowedAudiences', 'type': '[str]'}, + 'allowed_audiences': {'key': 'allowedAudiences', 'type': '[str]'}, } def __init__( self, *, - kind: Optional[str] = None, allowed_audiences: Optional[List[str]] = None, **kwargs ): - super(AllowedAudiencesValidation, self).__init__(kind=kind, **kwargs) + super(AllowedAudiencesValidation, self).__init__(**kwargs) self.allowed_audiences = allowed_audiences @@ -524,19 +504,9 @@ def __init__( self.is_default_off = None -class Apple(ProxyOnlyResource): +class Apple(msrest.serialization.Model): """The configuration settings of the Apple provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`false` if the Apple provider should not be enabled despite the set registration; otherwise, :code:`true`. :type enabled: bool @@ -546,80 +516,48 @@ class Apple(ProxyOnlyResource): :type login: ~azure.mgmt.web.v2020_12_01.models.LoginScopes """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'registration': {'key': 'properties.registration', 'type': 'AppleRegistration'}, - 'login': {'key': 'properties.login', 'type': 'LoginScopes'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'AppleRegistration'}, + 'login': {'key': 'login', 'type': 'LoginScopes'}, } def __init__( self, *, - kind: Optional[str] = None, enabled: Optional[bool] = None, registration: Optional["AppleRegistration"] = None, login: Optional["LoginScopes"] = None, **kwargs ): - super(Apple, self).__init__(kind=kind, **kwargs) + super(Apple, self).__init__(**kwargs) self.enabled = enabled self.registration = registration self.login = login -class AppleRegistration(ProxyOnlyResource): +class AppleRegistration(msrest.serialization.Model): """The configuration settings of the registration for the Apple provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param client_id: The Client ID of the app used for login. :type client_id: str :param client_secret_setting_name: The app setting name that contains the client secret. :type client_secret_setting_name: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'client_id': {'key': 'properties.clientId', 'type': 'str'}, - 'client_secret_setting_name': {'key': 'properties.clientSecretSettingName', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'client_secret_setting_name': {'key': 'clientSecretSettingName', 'type': 'str'}, } def __init__( self, *, - kind: Optional[str] = None, client_id: Optional[str] = None, client_secret_setting_name: Optional[str] = None, **kwargs ): - super(AppleRegistration, self).__init__(kind=kind, **kwargs) + super(AppleRegistration, self).__init__(**kwargs) self.client_id = client_id self.client_secret_setting_name = client_secret_setting_name @@ -806,49 +744,28 @@ def __init__( self.is_deprecated = is_deprecated -class AppRegistration(ProxyOnlyResource): +class AppRegistration(msrest.serialization.Model): """The configuration settings of the app registration for providers that have app ids and app secrets. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param app_id: The App ID of the app used for login. :type app_id: str :param app_secret_setting_name: The app setting name that contains the app secret. :type app_secret_setting_name: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'app_id': {'key': 'properties.appId', 'type': 'str'}, - 'app_secret_setting_name': {'key': 'properties.appSecretSettingName', 'type': 'str'}, + 'app_id': {'key': 'appId', 'type': 'str'}, + 'app_secret_setting_name': {'key': 'appSecretSettingName', 'type': 'str'}, } def __init__( self, *, - kind: Optional[str] = None, app_id: Optional[str] = None, app_secret_setting_name: Optional[str] = None, **kwargs ): - super(AppRegistration, self).__init__(kind=kind, **kwargs) + super(AppRegistration, self).__init__(**kwargs) self.app_id = app_id self.app_secret_setting_name = app_secret_setting_name @@ -2375,19 +2292,9 @@ def __init__( self.allow_new_private_endpoint_connections = allow_new_private_endpoint_connections -class AuthPlatform(ProxyOnlyResource): +class AuthPlatform(msrest.serialization.Model): """The configuration settings of the platform of App Service Authentication/Authorization. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`true` if the Authentication / Authorization feature is enabled for the current app; otherwise, :code:`false`. :type enabled: bool @@ -2402,32 +2309,21 @@ class AuthPlatform(ProxyOnlyResource): :type config_file_path: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'runtime_version': {'key': 'properties.runtimeVersion', 'type': 'str'}, - 'config_file_path': {'key': 'properties.configFilePath', 'type': 'str'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, + 'config_file_path': {'key': 'configFilePath', 'type': 'str'}, } def __init__( self, *, - kind: Optional[str] = None, enabled: Optional[bool] = None, runtime_version: Optional[str] = None, config_file_path: Optional[str] = None, **kwargs ): - super(AuthPlatform, self).__init__(kind=kind, **kwargs) + super(AuthPlatform, self).__init__(**kwargs) self.enabled = enabled self.runtime_version = runtime_version self.config_file_path = config_file_path @@ -2566,19 +2462,9 @@ def __init__( self.status_codes_range = status_codes_range -class AzureActiveDirectory(ProxyOnlyResource): +class AzureActiveDirectory(msrest.serialization.Model): """The configuration settings of the Azure Active directory provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`false` if the Azure Active Directory provider should not be enabled despite the set registration; otherwise, :code:`true`. :type enabled: bool @@ -2597,28 +2483,17 @@ class AzureActiveDirectory(ProxyOnlyResource): :type is_auto_provisioned: bool """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'registration': {'key': 'properties.registration', 'type': 'AzureActiveDirectoryRegistration'}, - 'login': {'key': 'properties.login', 'type': 'AzureActiveDirectoryLogin'}, - 'validation': {'key': 'properties.validation', 'type': 'AzureActiveDirectoryValidation'}, - 'is_auto_provisioned': {'key': 'properties.isAutoProvisioned', 'type': 'bool'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'AzureActiveDirectoryRegistration'}, + 'login': {'key': 'login', 'type': 'AzureActiveDirectoryLogin'}, + 'validation': {'key': 'validation', 'type': 'AzureActiveDirectoryValidation'}, + 'is_auto_provisioned': {'key': 'isAutoProvisioned', 'type': 'bool'}, } def __init__( self, *, - kind: Optional[str] = None, enabled: Optional[bool] = None, registration: Optional["AzureActiveDirectoryRegistration"] = None, login: Optional["AzureActiveDirectoryLogin"] = None, @@ -2626,7 +2501,7 @@ def __init__( is_auto_provisioned: Optional[bool] = None, **kwargs ): - super(AzureActiveDirectory, self).__init__(kind=kind, **kwargs) + super(AzureActiveDirectory, self).__init__(**kwargs) self.enabled = enabled self.registration = registration self.login = login @@ -2634,68 +2509,38 @@ def __init__( self.is_auto_provisioned = is_auto_provisioned -class AzureActiveDirectoryLogin(ProxyOnlyResource): +class AzureActiveDirectoryLogin(msrest.serialization.Model): """The configuration settings of the Azure Active Directory login flow. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str - :param disable_www_authenticate: - :type disable_www_authenticate: bool :param login_parameters: Login parameters to send to the OpenID Connect authorization endpoint when a user logs in. Each parameter must be in the form "key=value". :type login_parameters: list[str] + :param disable_www_authenticate: :code:`true` if the www-authenticate provider + should be omitted from the request; otherwise, :code:`false`. + :type disable_www_authenticate: bool """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'disable_www_authenticate': {'key': 'properties.disableWWWAuthenticate', 'type': 'bool'}, - 'login_parameters': {'key': 'properties.loginParameters', 'type': '[str]'}, + 'login_parameters': {'key': 'loginParameters', 'type': '[str]'}, + 'disable_www_authenticate': {'key': 'disableWWWAuthenticate', 'type': 'bool'}, } def __init__( self, *, - kind: Optional[str] = None, - disable_www_authenticate: Optional[bool] = None, login_parameters: Optional[List[str]] = None, + disable_www_authenticate: Optional[bool] = None, **kwargs ): - super(AzureActiveDirectoryLogin, self).__init__(kind=kind, **kwargs) - self.disable_www_authenticate = disable_www_authenticate + super(AzureActiveDirectoryLogin, self).__init__(**kwargs) self.login_parameters = login_parameters + self.disable_www_authenticate = disable_www_authenticate -class AzureActiveDirectoryRegistration(ProxyOnlyResource): +class AzureActiveDirectoryRegistration(msrest.serialization.Model): """The configuration settings of the Azure Active Directory app registration. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param open_id_issuer: The OpenID Connect Issuer URI that represents the entity which issues access tokens for this application. When using Azure Active Directory, this value is the URI of the directory tenant, e.g. @@ -2717,55 +2562,49 @@ class AzureActiveDirectoryRegistration(ProxyOnlyResource): thumbprint of a certificate used for signing purposes. This property acts as a replacement for the Client Secret. It is also optional. :type client_secret_certificate_thumbprint: str + :param client_secret_certificate_subject_alternative_name: An alternative to the client secret + thumbprint, that is the subject alternative name of a certificate used for signing purposes. + This property acts as + a replacement for the Client Secret Certificate Thumbprint. It is also optional. + :type client_secret_certificate_subject_alternative_name: str + :param client_secret_certificate_issuer: An alternative to the client secret thumbprint, that + is the issuer of a certificate used for signing purposes. This property acts as + a replacement for the Client Secret Certificate Thumbprint. It is also optional. + :type client_secret_certificate_issuer: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'open_id_issuer': {'key': 'properties.openIdIssuer', 'type': 'str'}, - 'client_id': {'key': 'properties.clientId', 'type': 'str'}, - 'client_secret_setting_name': {'key': 'properties.clientSecretSettingName', 'type': 'str'}, - 'client_secret_certificate_thumbprint': {'key': 'properties.clientSecretCertificateThumbprint', 'type': 'str'}, + 'open_id_issuer': {'key': 'openIdIssuer', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'client_secret_setting_name': {'key': 'clientSecretSettingName', 'type': 'str'}, + 'client_secret_certificate_thumbprint': {'key': 'clientSecretCertificateThumbprint', 'type': 'str'}, + 'client_secret_certificate_subject_alternative_name': {'key': 'clientSecretCertificateSubjectAlternativeName', 'type': 'str'}, + 'client_secret_certificate_issuer': {'key': 'clientSecretCertificateIssuer', 'type': 'str'}, } def __init__( self, *, - kind: Optional[str] = None, open_id_issuer: Optional[str] = None, client_id: Optional[str] = None, client_secret_setting_name: Optional[str] = None, client_secret_certificate_thumbprint: Optional[str] = None, + client_secret_certificate_subject_alternative_name: Optional[str] = None, + client_secret_certificate_issuer: Optional[str] = None, **kwargs ): - super(AzureActiveDirectoryRegistration, self).__init__(kind=kind, **kwargs) + super(AzureActiveDirectoryRegistration, self).__init__(**kwargs) self.open_id_issuer = open_id_issuer self.client_id = client_id self.client_secret_setting_name = client_secret_setting_name self.client_secret_certificate_thumbprint = client_secret_certificate_thumbprint + self.client_secret_certificate_subject_alternative_name = client_secret_certificate_subject_alternative_name + self.client_secret_certificate_issuer = client_secret_certificate_issuer -class AzureActiveDirectoryValidation(ProxyOnlyResource): +class AzureActiveDirectoryValidation(msrest.serialization.Model): """The configuration settings of the Azure Active Directory token validation flow. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param jwt_claim_checks: The configuration settings of the checks that should be made while validating the JWT Claims. :type jwt_claim_checks: ~azure.mgmt.web.v2020_12_01.models.JwtClaimChecks @@ -2774,30 +2613,19 @@ class AzureActiveDirectoryValidation(ProxyOnlyResource): :type allowed_audiences: list[str] """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'jwt_claim_checks': {'key': 'properties.jwtClaimChecks', 'type': 'JwtClaimChecks'}, - 'allowed_audiences': {'key': 'properties.allowedAudiences', 'type': '[str]'}, + 'jwt_claim_checks': {'key': 'jwtClaimChecks', 'type': 'JwtClaimChecks'}, + 'allowed_audiences': {'key': 'allowedAudiences', 'type': '[str]'}, } def __init__( self, *, - kind: Optional[str] = None, jwt_claim_checks: Optional["JwtClaimChecks"] = None, allowed_audiences: Optional[List[str]] = None, **kwargs ): - super(AzureActiveDirectoryValidation, self).__init__(kind=kind, **kwargs) + super(AzureActiveDirectoryValidation, self).__init__(**kwargs) self.jwt_claim_checks = jwt_claim_checks self.allowed_audiences = allowed_audiences @@ -2870,19 +2698,9 @@ def __init__( self.enabled = enabled -class AzureStaticWebApps(ProxyOnlyResource): +class AzureStaticWebApps(msrest.serialization.Model): """The configuration settings of the Azure Static Web Apps provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`false` if the Azure Static Web Apps provider should not be enabled despite the set registration; otherwise, :code:`true`. :type enabled: bool @@ -2890,73 +2708,41 @@ class AzureStaticWebApps(ProxyOnlyResource): :type registration: ~azure.mgmt.web.v2020_12_01.models.AzureStaticWebAppsRegistration """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'registration': {'key': 'properties.registration', 'type': 'AzureStaticWebAppsRegistration'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'AzureStaticWebAppsRegistration'}, } def __init__( self, *, - kind: Optional[str] = None, enabled: Optional[bool] = None, registration: Optional["AzureStaticWebAppsRegistration"] = None, **kwargs ): - super(AzureStaticWebApps, self).__init__(kind=kind, **kwargs) + super(AzureStaticWebApps, self).__init__(**kwargs) self.enabled = enabled self.registration = registration -class AzureStaticWebAppsRegistration(ProxyOnlyResource): +class AzureStaticWebAppsRegistration(msrest.serialization.Model): """The configuration settings of the registration for the Azure Static Web Apps provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param client_id: The Client ID of the app used for login. :type client_id: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'client_id': {'key': 'properties.clientId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, } def __init__( self, *, - kind: Optional[str] = None, client_id: Optional[str] = None, **kwargs ): - super(AzureStaticWebAppsRegistration, self).__init__(kind=kind, **kwargs) + super(AzureStaticWebAppsRegistration, self).__init__(**kwargs) self.client_id = client_id @@ -3462,46 +3248,25 @@ def __init__( self.next_link = None -class BlobStorageTokenStore(ProxyOnlyResource): +class BlobStorageTokenStore(msrest.serialization.Model): """The configuration settings of the storage of the tokens if blob storage is used. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param sas_url_setting_name: The name of the app setting containing the SAS URL of the blob storage containing the tokens. :type sas_url_setting_name: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'sas_url_setting_name': {'key': 'properties.sasUrlSettingName', 'type': 'str'}, + 'sas_url_setting_name': {'key': 'sasUrlSettingName', 'type': 'str'}, } def __init__( self, *, - kind: Optional[str] = None, sas_url_setting_name: Optional[str] = None, **kwargs ): - super(BlobStorageTokenStore, self).__init__(kind=kind, **kwargs) + super(BlobStorageTokenStore, self).__init__(**kwargs) self.sas_url_setting_name = sas_url_setting_name @@ -4080,49 +3845,28 @@ def __init__( self.domain_validation_method = domain_validation_method -class ClientRegistration(ProxyOnlyResource): +class ClientRegistration(msrest.serialization.Model): """The configuration settings of the app registration for providers that have client ids and client secrets. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param client_id: The Client ID of the app used for login. :type client_id: str :param client_secret_setting_name: The app setting name that contains the client secret. :type client_secret_setting_name: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'client_id': {'key': 'properties.clientId', 'type': 'str'}, - 'client_secret_setting_name': {'key': 'properties.clientSecretSettingName', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'client_secret_setting_name': {'key': 'clientSecretSettingName', 'type': 'str'}, } def __init__( self, *, - kind: Optional[str] = None, client_id: Optional[str] = None, client_secret_setting_name: Optional[str] = None, **kwargs ): - super(ClientRegistration, self).__init__(kind=kind, **kwargs) + super(ClientRegistration, self).__init__(**kwargs) self.client_id = client_id self.client_secret_setting_name = client_secret_setting_name @@ -4799,19 +4543,9 @@ def __init__( self.next_link = None -class CookieExpiration(ProxyOnlyResource): +class CookieExpiration(msrest.serialization.Model): """The configuration settings of the session cookie's expiration. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param convention: The convention used when determining the session cookie's expiration. Possible values include: "FixedTime", "IdentityProviderDerived". :type convention: str or ~azure.mgmt.web.v2020_12_01.models.CookieExpirationConvention @@ -4820,30 +4554,19 @@ class CookieExpiration(ProxyOnlyResource): :type time_to_expiration: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'convention': {'key': 'properties.convention', 'type': 'str'}, - 'time_to_expiration': {'key': 'properties.timeToExpiration', 'type': 'str'}, + 'convention': {'key': 'convention', 'type': 'str'}, + 'time_to_expiration': {'key': 'timeToExpiration', 'type': 'str'}, } def __init__( self, *, - kind: Optional[str] = None, convention: Optional[Union[str, "CookieExpirationConvention"]] = None, time_to_expiration: Optional[str] = None, **kwargs ): - super(CookieExpiration, self).__init__(kind=kind, **kwargs) + super(CookieExpiration, self).__init__(**kwargs) self.convention = convention self.time_to_expiration = time_to_expiration @@ -5365,19 +5088,9 @@ def __init__( self.alternate_txt_records = alternate_txt_records -class CustomOpenIdConnectProvider(ProxyOnlyResource): +class CustomOpenIdConnectProvider(msrest.serialization.Model): """The configuration settings of the custom Open ID Connect provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`false` if the custom Open ID provider provider should not be enabled; otherwise, :code:`true`. :type enabled: bool @@ -5386,35 +5099,24 @@ class CustomOpenIdConnectProvider(ProxyOnlyResource): :type registration: ~azure.mgmt.web.v2020_12_01.models.OpenIdConnectRegistration :param login: The configuration settings of the login flow of the custom Open ID Connect provider. - :type login: ~azure.mgmt.web.v2020_12_01.models.OpenIdConnectLogin - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'registration': {'key': 'properties.registration', 'type': 'OpenIdConnectRegistration'}, - 'login': {'key': 'properties.login', 'type': 'OpenIdConnectLogin'}, + :type login: ~azure.mgmt.web.v2020_12_01.models.OpenIdConnectLogin + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'OpenIdConnectRegistration'}, + 'login': {'key': 'login', 'type': 'OpenIdConnectLogin'}, } def __init__( self, *, - kind: Optional[str] = None, enabled: Optional[bool] = None, registration: Optional["OpenIdConnectRegistration"] = None, login: Optional["OpenIdConnectLogin"] = None, **kwargs ): - super(CustomOpenIdConnectProvider, self).__init__(kind=kind, **kwargs) + super(CustomOpenIdConnectProvider, self).__init__(**kwargs) self.enabled = enabled self.registration = registration self.login = login @@ -7440,19 +7142,9 @@ def __init__( self.ramp_up_rules = ramp_up_rules -class Facebook(ProxyOnlyResource): +class Facebook(msrest.serialization.Model): """The configuration settings of the Facebook provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`false` if the Facebook provider should not be enabled despite the set registration; otherwise, :code:`true`. :type enabled: bool @@ -7465,34 +7157,23 @@ class Facebook(ProxyOnlyResource): :type login: ~azure.mgmt.web.v2020_12_01.models.LoginScopes """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'registration': {'key': 'properties.registration', 'type': 'AppRegistration'}, - 'graph_api_version': {'key': 'properties.graphApiVersion', 'type': 'str'}, - 'login': {'key': 'properties.login', 'type': 'LoginScopes'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'AppRegistration'}, + 'graph_api_version': {'key': 'graphApiVersion', 'type': 'str'}, + 'login': {'key': 'login', 'type': 'LoginScopes'}, } def __init__( self, *, - kind: Optional[str] = None, enabled: Optional[bool] = None, registration: Optional["AppRegistration"] = None, graph_api_version: Optional[str] = None, login: Optional["LoginScopes"] = None, **kwargs ): - super(Facebook, self).__init__(kind=kind, **kwargs) + super(Facebook, self).__init__(**kwargs) self.enabled = enabled self.registration = registration self.graph_api_version = graph_api_version @@ -7561,61 +7242,30 @@ def __init__( self.enabled = enabled -class FileSystemTokenStore(ProxyOnlyResource): +class FileSystemTokenStore(msrest.serialization.Model): """The configuration settings of the storage of the tokens if a file system is used. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param directory: The directory in which the tokens will be stored. :type directory: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'directory': {'key': 'properties.directory', 'type': 'str'}, + 'directory': {'key': 'directory', 'type': 'str'}, } def __init__( self, *, - kind: Optional[str] = None, directory: Optional[str] = None, **kwargs ): - super(FileSystemTokenStore, self).__init__(kind=kind, **kwargs) + super(FileSystemTokenStore, self).__init__(**kwargs) self.directory = directory -class ForwardProxy(ProxyOnlyResource): +class ForwardProxy(msrest.serialization.Model): """The configuration settings of a forward proxy used to make the requests. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param convention: The convention used to determine the url of the request made. Possible values include: "NoProxy", "Standard", "Custom". :type convention: str or ~azure.mgmt.web.v2020_12_01.models.ForwardProxyConvention @@ -7625,32 +7275,21 @@ class ForwardProxy(ProxyOnlyResource): :type custom_proto_header_name: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'convention': {'key': 'properties.convention', 'type': 'str'}, - 'custom_host_header_name': {'key': 'properties.customHostHeaderName', 'type': 'str'}, - 'custom_proto_header_name': {'key': 'properties.customProtoHeaderName', 'type': 'str'}, + 'convention': {'key': 'convention', 'type': 'str'}, + 'custom_host_header_name': {'key': 'customHostHeaderName', 'type': 'str'}, + 'custom_proto_header_name': {'key': 'customProtoHeaderName', 'type': 'str'}, } def __init__( self, *, - kind: Optional[str] = None, convention: Optional[Union[str, "ForwardProxyConvention"]] = None, custom_host_header_name: Optional[str] = None, custom_proto_header_name: Optional[str] = None, **kwargs ): - super(ForwardProxy, self).__init__(kind=kind, **kwargs) + super(ForwardProxy, self).__init__(**kwargs) self.convention = convention self.custom_host_header_name = custom_host_header_name self.custom_proto_header_name = custom_proto_header_name @@ -8203,19 +7842,9 @@ def __init__( self.next_link = None -class GitHub(ProxyOnlyResource): +class GitHub(msrest.serialization.Model): """The configuration settings of the GitHub provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`false` if the GitHub provider should not be enabled despite the set registration; otherwise, :code:`true`. :type enabled: bool @@ -8226,32 +7855,21 @@ class GitHub(ProxyOnlyResource): :type login: ~azure.mgmt.web.v2020_12_01.models.LoginScopes """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'registration': {'key': 'properties.registration', 'type': 'ClientRegistration'}, - 'login': {'key': 'properties.login', 'type': 'LoginScopes'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'ClientRegistration'}, + 'login': {'key': 'login', 'type': 'LoginScopes'}, } def __init__( self, *, - kind: Optional[str] = None, enabled: Optional[bool] = None, registration: Optional["ClientRegistration"] = None, login: Optional["LoginScopes"] = None, **kwargs ): - super(GitHub, self).__init__(kind=kind, **kwargs) + super(GitHub, self).__init__(**kwargs) self.enabled = enabled self.registration = registration self.login = login @@ -8441,19 +8059,9 @@ def __init__( self.capabilities = capabilities -class GlobalValidation(ProxyOnlyResource): +class GlobalValidation(msrest.serialization.Model): """The configuration settings that determines the validation flow of users using App Service Authentication/Authorization. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param require_authentication: :code:`true` if the authentication flow is required any request is made; otherwise, :code:`false`. :type require_authentication: bool @@ -8473,53 +8081,32 @@ class GlobalValidation(ProxyOnlyResource): :type excluded_paths: list[str] """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'require_authentication': {'key': 'properties.requireAuthentication', 'type': 'bool'}, - 'unauthenticated_client_action': {'key': 'properties.unauthenticatedClientAction', 'type': 'str'}, - 'redirect_to_provider': {'key': 'properties.redirectToProvider', 'type': 'str'}, - 'excluded_paths': {'key': 'properties.excludedPaths', 'type': '[str]'}, + 'require_authentication': {'key': 'requireAuthentication', 'type': 'bool'}, + 'unauthenticated_client_action': {'key': 'unauthenticatedClientAction', 'type': 'str'}, + 'redirect_to_provider': {'key': 'redirectToProvider', 'type': 'str'}, + 'excluded_paths': {'key': 'excludedPaths', 'type': '[str]'}, } def __init__( self, *, - kind: Optional[str] = None, require_authentication: Optional[bool] = None, unauthenticated_client_action: Optional[Union[str, "UnauthenticatedClientActionV2"]] = None, redirect_to_provider: Optional[str] = None, excluded_paths: Optional[List[str]] = None, **kwargs ): - super(GlobalValidation, self).__init__(kind=kind, **kwargs) + super(GlobalValidation, self).__init__(**kwargs) self.require_authentication = require_authentication self.unauthenticated_client_action = unauthenticated_client_action self.redirect_to_provider = redirect_to_provider self.excluded_paths = excluded_paths -class Google(ProxyOnlyResource): +class Google(msrest.serialization.Model): """The configuration settings of the Google provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`false` if the Google provider should not be enabled despite the set registration; otherwise, :code:`true`. :type enabled: bool @@ -8533,34 +8120,23 @@ class Google(ProxyOnlyResource): :type validation: ~azure.mgmt.web.v2020_12_01.models.AllowedAudiencesValidation """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'registration': {'key': 'properties.registration', 'type': 'ClientRegistration'}, - 'login': {'key': 'properties.login', 'type': 'LoginScopes'}, - 'validation': {'key': 'properties.validation', 'type': 'AllowedAudiencesValidation'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'ClientRegistration'}, + 'login': {'key': 'login', 'type': 'LoginScopes'}, + 'validation': {'key': 'validation', 'type': 'AllowedAudiencesValidation'}, } def __init__( self, *, - kind: Optional[str] = None, enabled: Optional[bool] = None, registration: Optional["ClientRegistration"] = None, login: Optional["LoginScopes"] = None, validation: Optional["AllowedAudiencesValidation"] = None, **kwargs ): - super(Google, self).__init__(kind=kind, **kwargs) + super(Google, self).__init__(**kwargs) self.enabled = enabled self.registration = registration self.login = login @@ -8965,19 +8541,9 @@ def __init__( self.azure_blob_storage = azure_blob_storage -class HttpSettings(ProxyOnlyResource): +class HttpSettings(msrest.serialization.Model): """The configuration settings of the HTTP requests for authentication and authorization requests made against App Service Authentication/Authorization. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param require_https: :code:`false` if the authentication/authorization responses not having the HTTPS scheme are permissible; otherwise, :code:`true`. :type require_https: bool @@ -8987,76 +8553,44 @@ class HttpSettings(ProxyOnlyResource): :type forward_proxy: ~azure.mgmt.web.v2020_12_01.models.ForwardProxy """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'require_https': {'key': 'properties.requireHttps', 'type': 'bool'}, - 'routes': {'key': 'properties.routes', 'type': 'HttpSettingsRoutes'}, - 'forward_proxy': {'key': 'properties.forwardProxy', 'type': 'ForwardProxy'}, + 'require_https': {'key': 'requireHttps', 'type': 'bool'}, + 'routes': {'key': 'routes', 'type': 'HttpSettingsRoutes'}, + 'forward_proxy': {'key': 'forwardProxy', 'type': 'ForwardProxy'}, } def __init__( self, *, - kind: Optional[str] = None, require_https: Optional[bool] = None, routes: Optional["HttpSettingsRoutes"] = None, forward_proxy: Optional["ForwardProxy"] = None, **kwargs ): - super(HttpSettings, self).__init__(kind=kind, **kwargs) + super(HttpSettings, self).__init__(**kwargs) self.require_https = require_https self.routes = routes self.forward_proxy = forward_proxy -class HttpSettingsRoutes(ProxyOnlyResource): +class HttpSettingsRoutes(msrest.serialization.Model): """The configuration settings of the paths HTTP requests. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param api_prefix: The prefix that should precede all the authentication/authorization paths. :type api_prefix: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'api_prefix': {'key': 'properties.apiPrefix', 'type': 'str'}, + 'api_prefix': {'key': 'apiPrefix', 'type': 'str'}, } def __init__( self, *, - kind: Optional[str] = None, api_prefix: Optional[str] = None, **kwargs ): - super(HttpSettingsRoutes, self).__init__(kind=kind, **kwargs) + super(HttpSettingsRoutes, self).__init__(**kwargs) self.api_prefix = api_prefix @@ -9345,19 +8879,9 @@ def __init__( self.next_link = None -class IdentityProviders(ProxyOnlyResource): +class IdentityProviders(msrest.serialization.Model): """The configuration settings of each of the identity providers used to configure App Service Authentication/Authorization. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param azure_active_directory: The configuration settings of the Azure Active directory provider. :type azure_active_directory: ~azure.mgmt.web.v2020_12_01.models.AzureActiveDirectory @@ -9367,69 +8891,58 @@ class IdentityProviders(ProxyOnlyResource): :type git_hub: ~azure.mgmt.web.v2020_12_01.models.GitHub :param google: The configuration settings of the Google provider. :type google: ~azure.mgmt.web.v2020_12_01.models.Google - :param twitter: The configuration settings of the Twitter provider. - :type twitter: ~azure.mgmt.web.v2020_12_01.models.Twitter - :param custom_open_id_connect_providers: The map of the name of the alias of each custom Open - ID Connect provider to the - configuration settings of the custom Open ID Connect provider. - :type custom_open_id_connect_providers: dict[str, - ~azure.mgmt.web.v2020_12_01.models.CustomOpenIdConnectProvider] :param legacy_microsoft_account: The configuration settings of the legacy Microsoft Account provider. :type legacy_microsoft_account: ~azure.mgmt.web.v2020_12_01.models.LegacyMicrosoftAccount + :param twitter: The configuration settings of the Twitter provider. + :type twitter: ~azure.mgmt.web.v2020_12_01.models.Twitter :param apple: The configuration settings of the Apple provider. :type apple: ~azure.mgmt.web.v2020_12_01.models.Apple :param azure_static_web_apps: The configuration settings of the Azure Static Web Apps provider. :type azure_static_web_apps: ~azure.mgmt.web.v2020_12_01.models.AzureStaticWebApps + :param custom_open_id_connect_providers: The map of the name of the alias of each custom Open + ID Connect provider to the + configuration settings of the custom Open ID Connect provider. + :type custom_open_id_connect_providers: dict[str, + ~azure.mgmt.web.v2020_12_01.models.CustomOpenIdConnectProvider] """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'azure_active_directory': {'key': 'properties.azureActiveDirectory', 'type': 'AzureActiveDirectory'}, - 'facebook': {'key': 'properties.facebook', 'type': 'Facebook'}, - 'git_hub': {'key': 'properties.gitHub', 'type': 'GitHub'}, - 'google': {'key': 'properties.google', 'type': 'Google'}, - 'twitter': {'key': 'properties.twitter', 'type': 'Twitter'}, - 'custom_open_id_connect_providers': {'key': 'properties.customOpenIdConnectProviders', 'type': '{CustomOpenIdConnectProvider}'}, - 'legacy_microsoft_account': {'key': 'properties.legacyMicrosoftAccount', 'type': 'LegacyMicrosoftAccount'}, - 'apple': {'key': 'properties.apple', 'type': 'Apple'}, - 'azure_static_web_apps': {'key': 'properties.azureStaticWebApps', 'type': 'AzureStaticWebApps'}, + 'azure_active_directory': {'key': 'azureActiveDirectory', 'type': 'AzureActiveDirectory'}, + 'facebook': {'key': 'facebook', 'type': 'Facebook'}, + 'git_hub': {'key': 'gitHub', 'type': 'GitHub'}, + 'google': {'key': 'google', 'type': 'Google'}, + 'legacy_microsoft_account': {'key': 'legacyMicrosoftAccount', 'type': 'LegacyMicrosoftAccount'}, + 'twitter': {'key': 'twitter', 'type': 'Twitter'}, + 'apple': {'key': 'apple', 'type': 'Apple'}, + 'azure_static_web_apps': {'key': 'azureStaticWebApps', 'type': 'AzureStaticWebApps'}, + 'custom_open_id_connect_providers': {'key': 'customOpenIdConnectProviders', 'type': '{CustomOpenIdConnectProvider}'}, } def __init__( self, *, - kind: Optional[str] = None, azure_active_directory: Optional["AzureActiveDirectory"] = None, facebook: Optional["Facebook"] = None, git_hub: Optional["GitHub"] = None, google: Optional["Google"] = None, - twitter: Optional["Twitter"] = None, - custom_open_id_connect_providers: Optional[Dict[str, "CustomOpenIdConnectProvider"]] = None, legacy_microsoft_account: Optional["LegacyMicrosoftAccount"] = None, + twitter: Optional["Twitter"] = None, apple: Optional["Apple"] = None, azure_static_web_apps: Optional["AzureStaticWebApps"] = None, + custom_open_id_connect_providers: Optional[Dict[str, "CustomOpenIdConnectProvider"]] = None, **kwargs ): - super(IdentityProviders, self).__init__(kind=kind, **kwargs) + super(IdentityProviders, self).__init__(**kwargs) self.azure_active_directory = azure_active_directory self.facebook = facebook self.git_hub = git_hub self.google = google - self.twitter = twitter - self.custom_open_id_connect_providers = custom_open_id_connect_providers self.legacy_microsoft_account = legacy_microsoft_account + self.twitter = twitter self.apple = apple self.azure_static_web_apps = azure_static_web_apps + self.custom_open_id_connect_providers = custom_open_id_connect_providers class InboundEnvironmentEndpoint(msrest.serialization.Model): @@ -9596,49 +9109,28 @@ def __init__( self.headers = headers -class JwtClaimChecks(ProxyOnlyResource): +class JwtClaimChecks(msrest.serialization.Model): """The configuration settings of the checks that should be made while validating the JWT Claims. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param allowed_groups: The list of the allowed groups. :type allowed_groups: list[str] :param allowed_client_applications: The list of the allowed client applications. :type allowed_client_applications: list[str] """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'allowed_groups': {'key': 'properties.allowedGroups', 'type': '[str]'}, - 'allowed_client_applications': {'key': 'properties.allowedClientApplications', 'type': '[str]'}, + 'allowed_groups': {'key': 'allowedGroups', 'type': '[str]'}, + 'allowed_client_applications': {'key': 'allowedClientApplications', 'type': '[str]'}, } def __init__( self, *, - kind: Optional[str] = None, allowed_groups: Optional[List[str]] = None, allowed_client_applications: Optional[List[str]] = None, **kwargs ): - super(JwtClaimChecks, self).__init__(kind=kind, **kwargs) + super(JwtClaimChecks, self).__init__(**kwargs) self.allowed_groups = allowed_groups self.allowed_client_applications = allowed_client_applications @@ -9735,19 +9227,9 @@ def __init__( self.type = None -class LegacyMicrosoftAccount(ProxyOnlyResource): +class LegacyMicrosoftAccount(msrest.serialization.Model): """The configuration settings of the legacy Microsoft Account provider. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str + :param enabled: :code:`false` if the legacy Microsoft Account provider should not be enabled despite the set registration; otherwise, :code:`true`. :type enabled: bool @@ -9761,34 +9243,23 @@ class LegacyMicrosoftAccount(ProxyOnlyResource): :type validation: ~azure.mgmt.web.v2020_12_01.models.AllowedAudiencesValidation """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'registration': {'key': 'properties.registration', 'type': 'ClientRegistration'}, - 'login': {'key': 'properties.login', 'type': 'LoginScopes'}, - 'validation': {'key': 'properties.validation', 'type': 'AllowedAudiencesValidation'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'ClientRegistration'}, + 'login': {'key': 'login', 'type': 'LoginScopes'}, + 'validation': {'key': 'validation', 'type': 'AllowedAudiencesValidation'}, } def __init__( self, *, - kind: Optional[str] = None, enabled: Optional[bool] = None, registration: Optional["ClientRegistration"] = None, login: Optional["LoginScopes"] = None, validation: Optional["AllowedAudiencesValidation"] = None, **kwargs ): - super(LegacyMicrosoftAccount, self).__init__(kind=kind, **kwargs) + super(LegacyMicrosoftAccount, self).__init__(**kwargs) self.enabled = enabled self.registration = registration self.login = login @@ -9886,19 +9357,9 @@ def __init__( self.localized_value = localized_value -class Login(ProxyOnlyResource): +class Login(msrest.serialization.Model): """The configuration settings of the login flow of users using App Service Authentication/Authorization. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param routes: The routes that specify the endpoints used for login and logout requests. :type routes: ~azure.mgmt.web.v2020_12_01.models.LoginRoutes :param token_store: The configuration settings of the token store. @@ -9917,29 +9378,18 @@ class Login(ProxyOnlyResource): :type nonce: ~azure.mgmt.web.v2020_12_01.models.Nonce """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'routes': {'key': 'properties.routes', 'type': 'LoginRoutes'}, - 'token_store': {'key': 'properties.tokenStore', 'type': 'TokenStore'}, - 'preserve_url_fragments_for_logins': {'key': 'properties.preserveUrlFragmentsForLogins', 'type': 'bool'}, - 'allowed_external_redirect_urls': {'key': 'properties.allowedExternalRedirectUrls', 'type': '[str]'}, - 'cookie_expiration': {'key': 'properties.cookieExpiration', 'type': 'CookieExpiration'}, - 'nonce': {'key': 'properties.nonce', 'type': 'Nonce'}, + 'routes': {'key': 'routes', 'type': 'LoginRoutes'}, + 'token_store': {'key': 'tokenStore', 'type': 'TokenStore'}, + 'preserve_url_fragments_for_logins': {'key': 'preserveUrlFragmentsForLogins', 'type': 'bool'}, + 'allowed_external_redirect_urls': {'key': 'allowedExternalRedirectUrls', 'type': '[str]'}, + 'cookie_expiration': {'key': 'cookieExpiration', 'type': 'CookieExpiration'}, + 'nonce': {'key': 'nonce', 'type': 'Nonce'}, } def __init__( self, *, - kind: Optional[str] = None, routes: Optional["LoginRoutes"] = None, token_store: Optional["TokenStore"] = None, preserve_url_fragments_for_logins: Optional[bool] = None, @@ -9948,7 +9398,7 @@ def __init__( nonce: Optional["Nonce"] = None, **kwargs ): - super(Login, self).__init__(kind=kind, **kwargs) + super(Login, self).__init__(**kwargs) self.routes = routes self.token_store = token_store self.preserve_url_fragments_for_logins = preserve_url_fragments_for_logins @@ -9957,87 +9407,45 @@ def __init__( self.nonce = nonce -class LoginRoutes(ProxyOnlyResource): +class LoginRoutes(msrest.serialization.Model): """The routes that specify the endpoints used for login and logout requests. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param logout_endpoint: The endpoint at which a logout request should be made. :type logout_endpoint: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'logout_endpoint': {'key': 'properties.logoutEndpoint', 'type': 'str'}, + 'logout_endpoint': {'key': 'logoutEndpoint', 'type': 'str'}, } def __init__( self, *, - kind: Optional[str] = None, logout_endpoint: Optional[str] = None, **kwargs ): - super(LoginRoutes, self).__init__(kind=kind, **kwargs) + super(LoginRoutes, self).__init__(**kwargs) self.logout_endpoint = logout_endpoint -class LoginScopes(ProxyOnlyResource): +class LoginScopes(msrest.serialization.Model): """The configuration settings of the login flow, including the scopes that should be requested. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param scopes: A list of the scopes that should be requested while authenticating. :type scopes: list[str] """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'scopes': {'key': 'properties.scopes', 'type': '[str]'}, + 'scopes': {'key': 'scopes', 'type': '[str]'}, } def __init__( self, *, - kind: Optional[str] = None, scopes: Optional[List[str]] = None, **kwargs ): - super(LoginScopes, self).__init__(kind=kind, **kwargs) + super(LoginScopes, self).__init__(**kwargs) self.scopes = scopes @@ -10740,19 +10148,9 @@ def __init__( self.message = message -class Nonce(ProxyOnlyResource): +class Nonce(msrest.serialization.Model): """The configuration settings of the nonce used in the login flow. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param validate_nonce: :code:`false` if the nonce should not be validated while completing the login flow; otherwise, :code:`true`. :type validate_nonce: bool @@ -10761,47 +10159,26 @@ class Nonce(ProxyOnlyResource): :type nonce_expiration_interval: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'validate_nonce': {'key': 'properties.validateNonce', 'type': 'bool'}, - 'nonce_expiration_interval': {'key': 'properties.nonceExpirationInterval', 'type': 'str'}, + 'validate_nonce': {'key': 'validateNonce', 'type': 'bool'}, + 'nonce_expiration_interval': {'key': 'nonceExpirationInterval', 'type': 'str'}, } def __init__( self, *, - kind: Optional[str] = None, validate_nonce: Optional[bool] = None, nonce_expiration_interval: Optional[str] = None, **kwargs ): - super(Nonce, self).__init__(kind=kind, **kwargs) + super(Nonce, self).__init__(**kwargs) self.validate_nonce = validate_nonce self.nonce_expiration_interval = nonce_expiration_interval -class OpenIdConnectClientCredential(ProxyOnlyResource): +class OpenIdConnectClientCredential(msrest.serialization.Model): """The authentication client credentials of the custom Open ID Connect provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param method: The method that should be used to authenticate the user. The only acceptable values to pass in are None and "ClientSecretPost". The default value is None. :type method: str @@ -10810,47 +10187,26 @@ class OpenIdConnectClientCredential(ProxyOnlyResource): :type client_secret_setting_name: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'method': {'key': 'properties.method', 'type': 'str'}, - 'client_secret_setting_name': {'key': 'properties.clientSecretSettingName', 'type': 'str'}, + 'method': {'key': 'method', 'type': 'str'}, + 'client_secret_setting_name': {'key': 'clientSecretSettingName', 'type': 'str'}, } def __init__( self, *, - kind: Optional[str] = None, method: Optional[str] = None, client_secret_setting_name: Optional[str] = None, **kwargs ): - super(OpenIdConnectClientCredential, self).__init__(kind=kind, **kwargs) + super(OpenIdConnectClientCredential, self).__init__(**kwargs) self.method = method self.client_secret_setting_name = client_secret_setting_name -class OpenIdConnectConfig(ProxyOnlyResource): +class OpenIdConnectConfig(msrest.serialization.Model): """The configuration settings of the endpoints used for the custom Open ID Connect provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param authorization_endpoint: The endpoint to be used to make an authorization request. :type authorization_endpoint: str :param token_endpoint: The endpoint to be used to request a token. @@ -10864,28 +10220,17 @@ class OpenIdConnectConfig(ProxyOnlyResource): :type well_known_open_id_configuration: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'authorization_endpoint': {'key': 'properties.authorizationEndpoint', 'type': 'str'}, - 'token_endpoint': {'key': 'properties.tokenEndpoint', 'type': 'str'}, - 'issuer': {'key': 'properties.issuer', 'type': 'str'}, - 'certification_uri': {'key': 'properties.certificationUri', 'type': 'str'}, - 'well_known_open_id_configuration': {'key': 'properties.wellKnownOpenIdConfiguration', 'type': 'str'}, + 'authorization_endpoint': {'key': 'authorizationEndpoint', 'type': 'str'}, + 'token_endpoint': {'key': 'tokenEndpoint', 'type': 'str'}, + 'issuer': {'key': 'issuer', 'type': 'str'}, + 'certification_uri': {'key': 'certificationUri', 'type': 'str'}, + 'well_known_open_id_configuration': {'key': 'wellKnownOpenIdConfiguration', 'type': 'str'}, } def __init__( self, *, - kind: Optional[str] = None, authorization_endpoint: Optional[str] = None, token_endpoint: Optional[str] = None, issuer: Optional[str] = None, @@ -10893,7 +10238,7 @@ def __init__( well_known_open_id_configuration: Optional[str] = None, **kwargs ): - super(OpenIdConnectConfig, self).__init__(kind=kind, **kwargs) + super(OpenIdConnectConfig, self).__init__(**kwargs) self.authorization_endpoint = authorization_endpoint self.token_endpoint = token_endpoint self.issuer = issuer @@ -10901,66 +10246,35 @@ def __init__( self.well_known_open_id_configuration = well_known_open_id_configuration -class OpenIdConnectLogin(ProxyOnlyResource): +class OpenIdConnectLogin(msrest.serialization.Model): """The configuration settings of the login flow of the custom Open ID Connect provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param name_claim_type: The name of the claim that contains the users name. :type name_claim_type: str :param scopes: A list of the scopes that should be requested while authenticating. :type scopes: list[str] """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'name_claim_type': {'key': 'properties.nameClaimType', 'type': 'str'}, - 'scopes': {'key': 'properties.scopes', 'type': '[str]'}, + 'name_claim_type': {'key': 'nameClaimType', 'type': 'str'}, + 'scopes': {'key': 'scopes', 'type': '[str]'}, } def __init__( self, *, - kind: Optional[str] = None, name_claim_type: Optional[str] = None, scopes: Optional[List[str]] = None, **kwargs ): - super(OpenIdConnectLogin, self).__init__(kind=kind, **kwargs) + super(OpenIdConnectLogin, self).__init__(**kwargs) self.name_claim_type = name_claim_type self.scopes = scopes -class OpenIdConnectRegistration(ProxyOnlyResource): +class OpenIdConnectRegistration(msrest.serialization.Model): """The configuration settings of the app registration for the custom Open ID Connect provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param client_id: The client id of the custom Open ID Connect provider. :type client_id: str :param client_credential: The authentication credentials of the custom Open ID Connect @@ -10971,32 +10285,21 @@ class OpenIdConnectRegistration(ProxyOnlyResource): :type open_id_connect_configuration: ~azure.mgmt.web.v2020_12_01.models.OpenIdConnectConfig """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'client_id': {'key': 'properties.clientId', 'type': 'str'}, - 'client_credential': {'key': 'properties.clientCredential', 'type': 'OpenIdConnectClientCredential'}, - 'open_id_connect_configuration': {'key': 'properties.openIdConnectConfiguration', 'type': 'OpenIdConnectConfig'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'client_credential': {'key': 'clientCredential', 'type': 'OpenIdConnectClientCredential'}, + 'open_id_connect_configuration': {'key': 'openIdConnectConfiguration', 'type': 'OpenIdConnectConfig'}, } def __init__( self, *, - kind: Optional[str] = None, client_id: Optional[str] = None, client_credential: Optional["OpenIdConnectClientCredential"] = None, open_id_connect_configuration: Optional["OpenIdConnectConfig"] = None, **kwargs ): - super(OpenIdConnectRegistration, self).__init__(kind=kind, **kwargs) + super(OpenIdConnectRegistration, self).__init__(**kwargs) self.client_id = client_id self.client_credential = client_credential self.open_id_connect_configuration = open_id_connect_configuration @@ -19038,19 +18341,9 @@ def __init__( self.next_link = None -class TokenStore(ProxyOnlyResource): +class TokenStore(msrest.serialization.Model): """The configuration settings of the token store. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`true` to durably store platform-specific security tokens that are obtained during login flows; otherwise, :code:`false`. The default is :code:`false`. @@ -19067,34 +18360,23 @@ class TokenStore(ProxyOnlyResource): :type azure_blob_storage: ~azure.mgmt.web.v2020_12_01.models.BlobStorageTokenStore """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'token_refresh_extension_hours': {'key': 'properties.tokenRefreshExtensionHours', 'type': 'float'}, - 'file_system': {'key': 'properties.fileSystem', 'type': 'FileSystemTokenStore'}, - 'azure_blob_storage': {'key': 'properties.azureBlobStorage', 'type': 'BlobStorageTokenStore'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'token_refresh_extension_hours': {'key': 'tokenRefreshExtensionHours', 'type': 'float'}, + 'file_system': {'key': 'fileSystem', 'type': 'FileSystemTokenStore'}, + 'azure_blob_storage': {'key': 'azureBlobStorage', 'type': 'BlobStorageTokenStore'}, } def __init__( self, *, - kind: Optional[str] = None, enabled: Optional[bool] = None, token_refresh_extension_hours: Optional[float] = None, file_system: Optional["FileSystemTokenStore"] = None, azure_blob_storage: Optional["BlobStorageTokenStore"] = None, **kwargs ): - super(TokenStore, self).__init__(kind=kind, **kwargs) + super(TokenStore, self).__init__(**kwargs) self.enabled = enabled self.token_refresh_extension_hours = token_refresh_extension_hours self.file_system = file_system @@ -19495,19 +18777,9 @@ def __init__( self.next_link = None -class Twitter(ProxyOnlyResource): +class Twitter(msrest.serialization.Model): """The configuration settings of the Twitter provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`false` if the Twitter provider should not be enabled despite the set registration; otherwise, :code:`true`. :type enabled: bool @@ -19516,47 +18788,26 @@ class Twitter(ProxyOnlyResource): :type registration: ~azure.mgmt.web.v2020_12_01.models.TwitterRegistration """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'registration': {'key': 'properties.registration', 'type': 'TwitterRegistration'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'TwitterRegistration'}, } def __init__( self, *, - kind: Optional[str] = None, enabled: Optional[bool] = None, registration: Optional["TwitterRegistration"] = None, **kwargs ): - super(Twitter, self).__init__(kind=kind, **kwargs) + super(Twitter, self).__init__(**kwargs) self.enabled = enabled self.registration = registration -class TwitterRegistration(ProxyOnlyResource): +class TwitterRegistration(msrest.serialization.Model): """The configuration settings of the app registration for the Twitter provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param consumer_key: The OAuth 1.0a consumer key of the Twitter application used for sign-in. This setting is required for enabling Twitter Sign-In. Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in. @@ -19567,30 +18818,19 @@ class TwitterRegistration(ProxyOnlyResource): :type consumer_secret_setting_name: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'consumer_key': {'key': 'properties.consumerKey', 'type': 'str'}, - 'consumer_secret_setting_name': {'key': 'properties.consumerSecretSettingName', 'type': 'str'}, + 'consumer_key': {'key': 'consumerKey', 'type': 'str'}, + 'consumer_secret_setting_name': {'key': 'consumerSecretSettingName', 'type': 'str'}, } def __init__( self, *, - kind: Optional[str] = None, consumer_key: Optional[str] = None, consumer_secret_setting_name: Optional[str] = None, **kwargs ): - super(TwitterRegistration, self).__init__(kind=kind, **kwargs) + super(TwitterRegistration, self).__init__(**kwargs) self.consumer_key = consumer_key self.consumer_secret_setting_name = consumer_secret_setting_name diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_01_01/_version.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_01_01/_version.py index 77f53a3589c6..34ea7990c4b4 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_01_01/_version.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_01_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "4.0.0" +VERSION = "5.0.0" diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_01_01/models/_models.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_01_01/models/_models.py index d4683631b0f3..c230377582fc 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_01_01/models/_models.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_01_01/models/_models.py @@ -181,35 +181,16 @@ def __init__( self.vip_mappings = kwargs.get('vip_mappings', None) -class AllowedAudiencesValidation(ProxyOnlyResource): - """AllowedAudiencesValidation. +class AllowedAudiencesValidation(msrest.serialization.Model): + """The configuration settings of the Allowed Audiences validation flow. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str - :param allowed_audiences: + :param allowed_audiences: The configuration settings of the allowed list of audiences from + which to validate the JWT token. :type allowed_audiences: list[str] """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'allowed_audiences': {'key': 'properties.allowedAudiences', 'type': '[str]'}, + 'allowed_audiences': {'key': 'allowedAudiences', 'type': '[str]'}, } def __init__( @@ -471,19 +452,9 @@ def __init__( self.is_default_off = None -class Apple(ProxyOnlyResource): +class Apple(msrest.serialization.Model): """The configuration settings of the Apple provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`false` if the Apple provider should not be enabled despite the set registration; otherwise, :code:`true`. :type enabled: bool @@ -493,20 +464,10 @@ class Apple(ProxyOnlyResource): :type login: ~azure.mgmt.web.v2021_01_01.models.LoginScopes """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'registration': {'key': 'properties.registration', 'type': 'AppleRegistration'}, - 'login': {'key': 'properties.login', 'type': 'LoginScopes'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'AppleRegistration'}, + 'login': {'key': 'login', 'type': 'LoginScopes'}, } def __init__( @@ -519,38 +480,18 @@ def __init__( self.login = kwargs.get('login', None) -class AppleRegistration(ProxyOnlyResource): +class AppleRegistration(msrest.serialization.Model): """The configuration settings of the registration for the Apple provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param client_id: The Client ID of the app used for login. :type client_id: str :param client_secret_setting_name: The app setting name that contains the client secret. :type client_secret_setting_name: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'client_id': {'key': 'properties.clientId', 'type': 'str'}, - 'client_secret_setting_name': {'key': 'properties.clientSecretSettingName', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'client_secret_setting_name': {'key': 'clientSecretSettingName', 'type': 'str'}, } def __init__( @@ -746,38 +687,18 @@ def __init__( self.log_analytics_configuration = kwargs.get('log_analytics_configuration', None) -class AppRegistration(ProxyOnlyResource): +class AppRegistration(msrest.serialization.Model): """The configuration settings of the app registration for providers that have app ids and app secrets. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param app_id: The App ID of the app used for login. :type app_id: str :param app_secret_setting_name: The app setting name that contains the app secret. :type app_secret_setting_name: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'app_id': {'key': 'properties.appId', 'type': 'str'}, - 'app_secret_setting_name': {'key': 'properties.appSecretSettingName', 'type': 'str'}, + 'app_id': {'key': 'appId', 'type': 'str'}, + 'app_secret_setting_name': {'key': 'appSecretSettingName', 'type': 'str'}, } def __init__( @@ -2236,19 +2157,9 @@ def __init__( self.allow_new_private_endpoint_connections = kwargs.get('allow_new_private_endpoint_connections', None) -class AuthPlatform(ProxyOnlyResource): +class AuthPlatform(msrest.serialization.Model): """The configuration settings of the platform of App Service Authentication/Authorization. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`true` if the Authentication / Authorization feature is enabled for the current app; otherwise, :code:`false`. :type enabled: bool @@ -2263,20 +2174,10 @@ class AuthPlatform(ProxyOnlyResource): :type config_file_path: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'runtime_version': {'key': 'properties.runtimeVersion', 'type': 'str'}, - 'config_file_path': {'key': 'properties.configFilePath', 'type': 'str'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, + 'config_file_path': {'key': 'configFilePath', 'type': 'str'}, } def __init__( @@ -2405,19 +2306,9 @@ def __init__( self.status_codes_range = kwargs.get('status_codes_range', None) -class AzureActiveDirectory(ProxyOnlyResource): +class AzureActiveDirectory(msrest.serialization.Model): """The configuration settings of the Azure Active directory provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`false` if the Azure Active Directory provider should not be enabled despite the set registration; otherwise, :code:`true`. :type enabled: bool @@ -2436,22 +2327,12 @@ class AzureActiveDirectory(ProxyOnlyResource): :type is_auto_provisioned: bool """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'registration': {'key': 'properties.registration', 'type': 'AzureActiveDirectoryRegistration'}, - 'login': {'key': 'properties.login', 'type': 'AzureActiveDirectoryLogin'}, - 'validation': {'key': 'properties.validation', 'type': 'AzureActiveDirectoryValidation'}, - 'is_auto_provisioned': {'key': 'properties.isAutoProvisioned', 'type': 'bool'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'AzureActiveDirectoryRegistration'}, + 'login': {'key': 'login', 'type': 'AzureActiveDirectoryLogin'}, + 'validation': {'key': 'validation', 'type': 'AzureActiveDirectoryValidation'}, + 'is_auto_provisioned': {'key': 'isAutoProvisioned', 'type': 'bool'}, } def __init__( @@ -2466,40 +2347,21 @@ def __init__( self.is_auto_provisioned = kwargs.get('is_auto_provisioned', None) -class AzureActiveDirectoryLogin(ProxyOnlyResource): +class AzureActiveDirectoryLogin(msrest.serialization.Model): """The configuration settings of the Azure Active Directory login flow. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str - :param disable_www_authenticate: - :type disable_www_authenticate: bool :param login_parameters: Login parameters to send to the OpenID Connect authorization endpoint when a user logs in. Each parameter must be in the form "key=value". :type login_parameters: list[str] + :param disable_www_authenticate: :code:`true` if the www-authenticate provider + should be omitted from the request; otherwise, :code:`false`. + :type disable_www_authenticate: bool """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'disable_www_authenticate': {'key': 'properties.disableWWWAuthenticate', 'type': 'bool'}, - 'login_parameters': {'key': 'properties.loginParameters', 'type': '[str]'}, + 'login_parameters': {'key': 'loginParameters', 'type': '[str]'}, + 'disable_www_authenticate': {'key': 'disableWWWAuthenticate', 'type': 'bool'}, } def __init__( @@ -2507,23 +2369,13 @@ def __init__( **kwargs ): super(AzureActiveDirectoryLogin, self).__init__(**kwargs) - self.disable_www_authenticate = kwargs.get('disable_www_authenticate', None) self.login_parameters = kwargs.get('login_parameters', None) + self.disable_www_authenticate = kwargs.get('disable_www_authenticate', None) -class AzureActiveDirectoryRegistration(ProxyOnlyResource): +class AzureActiveDirectoryRegistration(msrest.serialization.Model): """The configuration settings of the Azure Active Directory app registration. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param open_id_issuer: The OpenID Connect Issuer URI that represents the entity which issues access tokens for this application. When using Azure Active Directory, this value is the URI of the directory tenant, e.g. @@ -2545,23 +2397,24 @@ class AzureActiveDirectoryRegistration(ProxyOnlyResource): thumbprint of a certificate used for signing purposes. This property acts as a replacement for the Client Secret. It is also optional. :type client_secret_certificate_thumbprint: str + :param client_secret_certificate_subject_alternative_name: An alternative to the client secret + thumbprint, that is the subject alternative name of a certificate used for signing purposes. + This property acts as + a replacement for the Client Secret Certificate Thumbprint. It is also optional. + :type client_secret_certificate_subject_alternative_name: str + :param client_secret_certificate_issuer: An alternative to the client secret thumbprint, that + is the issuer of a certificate used for signing purposes. This property acts as + a replacement for the Client Secret Certificate Thumbprint. It is also optional. + :type client_secret_certificate_issuer: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'open_id_issuer': {'key': 'properties.openIdIssuer', 'type': 'str'}, - 'client_id': {'key': 'properties.clientId', 'type': 'str'}, - 'client_secret_setting_name': {'key': 'properties.clientSecretSettingName', 'type': 'str'}, - 'client_secret_certificate_thumbprint': {'key': 'properties.clientSecretCertificateThumbprint', 'type': 'str'}, + 'open_id_issuer': {'key': 'openIdIssuer', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'client_secret_setting_name': {'key': 'clientSecretSettingName', 'type': 'str'}, + 'client_secret_certificate_thumbprint': {'key': 'clientSecretCertificateThumbprint', 'type': 'str'}, + 'client_secret_certificate_subject_alternative_name': {'key': 'clientSecretCertificateSubjectAlternativeName', 'type': 'str'}, + 'client_secret_certificate_issuer': {'key': 'clientSecretCertificateIssuer', 'type': 'str'}, } def __init__( @@ -2573,21 +2426,13 @@ def __init__( self.client_id = kwargs.get('client_id', None) self.client_secret_setting_name = kwargs.get('client_secret_setting_name', None) self.client_secret_certificate_thumbprint = kwargs.get('client_secret_certificate_thumbprint', None) + self.client_secret_certificate_subject_alternative_name = kwargs.get('client_secret_certificate_subject_alternative_name', None) + self.client_secret_certificate_issuer = kwargs.get('client_secret_certificate_issuer', None) -class AzureActiveDirectoryValidation(ProxyOnlyResource): +class AzureActiveDirectoryValidation(msrest.serialization.Model): """The configuration settings of the Azure Active Directory token validation flow. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param jwt_claim_checks: The configuration settings of the checks that should be made while validating the JWT Claims. :type jwt_claim_checks: ~azure.mgmt.web.v2021_01_01.models.JwtClaimChecks @@ -2596,19 +2441,9 @@ class AzureActiveDirectoryValidation(ProxyOnlyResource): :type allowed_audiences: list[str] """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'jwt_claim_checks': {'key': 'properties.jwtClaimChecks', 'type': 'JwtClaimChecks'}, - 'allowed_audiences': {'key': 'properties.allowedAudiences', 'type': '[str]'}, + 'jwt_claim_checks': {'key': 'jwtClaimChecks', 'type': 'JwtClaimChecks'}, + 'allowed_audiences': {'key': 'allowedAudiences', 'type': '[str]'}, } def __init__( @@ -2680,19 +2515,9 @@ def __init__( self.enabled = kwargs.get('enabled', None) -class AzureStaticWebApps(ProxyOnlyResource): +class AzureStaticWebApps(msrest.serialization.Model): """The configuration settings of the Azure Static Web Apps provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`false` if the Azure Static Web Apps provider should not be enabled despite the set registration; otherwise, :code:`true`. :type enabled: bool @@ -2700,19 +2525,9 @@ class AzureStaticWebApps(ProxyOnlyResource): :type registration: ~azure.mgmt.web.v2021_01_01.models.AzureStaticWebAppsRegistration """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'registration': {'key': 'properties.registration', 'type': 'AzureStaticWebAppsRegistration'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'AzureStaticWebAppsRegistration'}, } def __init__( @@ -2724,35 +2539,15 @@ def __init__( self.registration = kwargs.get('registration', None) -class AzureStaticWebAppsRegistration(ProxyOnlyResource): +class AzureStaticWebAppsRegistration(msrest.serialization.Model): """The configuration settings of the registration for the Azure Static Web Apps provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param client_id: The Client ID of the app used for login. :type client_id: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'client_id': {'key': 'properties.clientId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, } def __init__( @@ -3225,36 +3020,16 @@ def __init__( self.next_link = None -class BlobStorageTokenStore(ProxyOnlyResource): +class BlobStorageTokenStore(msrest.serialization.Model): """The configuration settings of the storage of the tokens if blob storage is used. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param sas_url_setting_name: The name of the app setting containing the SAS URL of the blob storage containing the tokens. :type sas_url_setting_name: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'sas_url_setting_name': {'key': 'properties.sasUrlSettingName', 'type': 'str'}, + 'sas_url_setting_name': {'key': 'sasUrlSettingName', 'type': 'str'}, } def __init__( @@ -3801,38 +3576,18 @@ def __init__( self.domain_validation_method = kwargs.get('domain_validation_method', None) -class ClientRegistration(ProxyOnlyResource): +class ClientRegistration(msrest.serialization.Model): """The configuration settings of the app registration for providers that have client ids and client secrets. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param client_id: The Client ID of the app used for login. :type client_id: str :param client_secret_setting_name: The app setting name that contains the client secret. :type client_secret_setting_name: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'client_id': {'key': 'properties.clientId', 'type': 'str'}, - 'client_secret_setting_name': {'key': 'properties.clientSecretSettingName', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'client_secret_setting_name': {'key': 'clientSecretSettingName', 'type': 'str'}, } def __init__( @@ -4434,40 +4189,20 @@ def __init__( self.next_link = None -class CookieExpiration(ProxyOnlyResource): +class CookieExpiration(msrest.serialization.Model): """The configuration settings of the session cookie's expiration. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param convention: The convention used when determining the session cookie's expiration. Possible values include: "FixedTime", "IdentityProviderDerived". :type convention: str or ~azure.mgmt.web.v2021_01_01.models.CookieExpirationConvention :param time_to_expiration: The time after the request is made when the session cookie should expire. - :type time_to_expiration: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } + :type time_to_expiration: str + """ _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'convention': {'key': 'properties.convention', 'type': 'str'}, - 'time_to_expiration': {'key': 'properties.timeToExpiration', 'type': 'str'}, + 'convention': {'key': 'convention', 'type': 'str'}, + 'time_to_expiration': {'key': 'timeToExpiration', 'type': 'str'}, } def __init__( @@ -4952,19 +4687,9 @@ def __init__( self.alternate_txt_records = kwargs.get('alternate_txt_records', None) -class CustomOpenIdConnectProvider(ProxyOnlyResource): +class CustomOpenIdConnectProvider(msrest.serialization.Model): """The configuration settings of the custom Open ID Connect provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`false` if the custom Open ID provider provider should not be enabled; otherwise, :code:`true`. :type enabled: bool @@ -4976,20 +4701,10 @@ class CustomOpenIdConnectProvider(ProxyOnlyResource): :type login: ~azure.mgmt.web.v2021_01_01.models.OpenIdConnectLogin """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'registration': {'key': 'properties.registration', 'type': 'OpenIdConnectRegistration'}, - 'login': {'key': 'properties.login', 'type': 'OpenIdConnectLogin'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'OpenIdConnectRegistration'}, + 'login': {'key': 'login', 'type': 'OpenIdConnectLogin'}, } def __init__( @@ -6872,19 +6587,9 @@ def __init__( self.type = None -class Facebook(ProxyOnlyResource): +class Facebook(msrest.serialization.Model): """The configuration settings of the Facebook provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`false` if the Facebook provider should not be enabled despite the set registration; otherwise, :code:`true`. :type enabled: bool @@ -6897,21 +6602,11 @@ class Facebook(ProxyOnlyResource): :type login: ~azure.mgmt.web.v2021_01_01.models.LoginScopes """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'registration': {'key': 'properties.registration', 'type': 'AppRegistration'}, - 'graph_api_version': {'key': 'properties.graphApiVersion', 'type': 'str'}, - 'login': {'key': 'properties.login', 'type': 'LoginScopes'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'AppRegistration'}, + 'graph_api_version': {'key': 'graphApiVersion', 'type': 'str'}, + 'login': {'key': 'login', 'type': 'LoginScopes'}, } def __init__( @@ -6981,35 +6676,15 @@ def __init__( self.enabled = kwargs.get('enabled', None) -class FileSystemTokenStore(ProxyOnlyResource): +class FileSystemTokenStore(msrest.serialization.Model): """The configuration settings of the storage of the tokens if a file system is used. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param directory: The directory in which the tokens will be stored. :type directory: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'directory': {'key': 'properties.directory', 'type': 'str'}, + 'directory': {'key': 'directory', 'type': 'str'}, } def __init__( @@ -7020,19 +6695,9 @@ def __init__( self.directory = kwargs.get('directory', None) -class ForwardProxy(ProxyOnlyResource): +class ForwardProxy(msrest.serialization.Model): """The configuration settings of a forward proxy used to make the requests. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param convention: The convention used to determine the url of the request made. Possible values include: "NoProxy", "Standard", "Custom". :type convention: str or ~azure.mgmt.web.v2021_01_01.models.ForwardProxyConvention @@ -7042,20 +6707,10 @@ class ForwardProxy(ProxyOnlyResource): :type custom_proto_header_name: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'convention': {'key': 'properties.convention', 'type': 'str'}, - 'custom_host_header_name': {'key': 'properties.customHostHeaderName', 'type': 'str'}, - 'custom_proto_header_name': {'key': 'properties.customProtoHeaderName', 'type': 'str'}, + 'convention': {'key': 'convention', 'type': 'str'}, + 'custom_host_header_name': {'key': 'customHostHeaderName', 'type': 'str'}, + 'custom_proto_header_name': {'key': 'customProtoHeaderName', 'type': 'str'}, } def __init__( @@ -7606,19 +7261,9 @@ def __init__( self.next_link = None -class GitHub(ProxyOnlyResource): +class GitHub(msrest.serialization.Model): """The configuration settings of the GitHub provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`false` if the GitHub provider should not be enabled despite the set registration; otherwise, :code:`true`. :type enabled: bool @@ -7629,20 +7274,10 @@ class GitHub(ProxyOnlyResource): :type login: ~azure.mgmt.web.v2021_01_01.models.LoginScopes """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'registration': {'key': 'properties.registration', 'type': 'ClientRegistration'}, - 'login': {'key': 'properties.login', 'type': 'LoginScopes'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'ClientRegistration'}, + 'login': {'key': 'login', 'type': 'LoginScopes'}, } def __init__( @@ -7818,19 +7453,9 @@ def __init__( self.capabilities = kwargs.get('capabilities', None) -class GlobalValidation(ProxyOnlyResource): +class GlobalValidation(msrest.serialization.Model): """The configuration settings that determines the validation flow of users using App Service Authentication/Authorization. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param require_authentication: :code:`true` if the authentication flow is required any request is made; otherwise, :code:`false`. :type require_authentication: bool @@ -7850,21 +7475,11 @@ class GlobalValidation(ProxyOnlyResource): :type excluded_paths: list[str] """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'require_authentication': {'key': 'properties.requireAuthentication', 'type': 'bool'}, - 'unauthenticated_client_action': {'key': 'properties.unauthenticatedClientAction', 'type': 'str'}, - 'redirect_to_provider': {'key': 'properties.redirectToProvider', 'type': 'str'}, - 'excluded_paths': {'key': 'properties.excludedPaths', 'type': '[str]'}, + 'require_authentication': {'key': 'requireAuthentication', 'type': 'bool'}, + 'unauthenticated_client_action': {'key': 'unauthenticatedClientAction', 'type': 'str'}, + 'redirect_to_provider': {'key': 'redirectToProvider', 'type': 'str'}, + 'excluded_paths': {'key': 'excludedPaths', 'type': '[str]'}, } def __init__( @@ -7878,19 +7493,9 @@ def __init__( self.excluded_paths = kwargs.get('excluded_paths', None) -class Google(ProxyOnlyResource): +class Google(msrest.serialization.Model): """The configuration settings of the Google provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`false` if the Google provider should not be enabled despite the set registration; otherwise, :code:`true`. :type enabled: bool @@ -7904,21 +7509,11 @@ class Google(ProxyOnlyResource): :type validation: ~azure.mgmt.web.v2021_01_01.models.AllowedAudiencesValidation """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'registration': {'key': 'properties.registration', 'type': 'ClientRegistration'}, - 'login': {'key': 'properties.login', 'type': 'LoginScopes'}, - 'validation': {'key': 'properties.validation', 'type': 'AllowedAudiencesValidation'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'ClientRegistration'}, + 'login': {'key': 'login', 'type': 'LoginScopes'}, + 'validation': {'key': 'validation', 'type': 'AllowedAudiencesValidation'}, } def __init__( @@ -8285,19 +7880,9 @@ def __init__( self.azure_blob_storage = kwargs.get('azure_blob_storage', None) -class HttpSettings(ProxyOnlyResource): +class HttpSettings(msrest.serialization.Model): """The configuration settings of the HTTP requests for authentication and authorization requests made against App Service Authentication/Authorization. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param require_https: :code:`false` if the authentication/authorization responses not having the HTTPS scheme are permissible; otherwise, :code:`true`. :type require_https: bool @@ -8307,20 +7892,10 @@ class HttpSettings(ProxyOnlyResource): :type forward_proxy: ~azure.mgmt.web.v2021_01_01.models.ForwardProxy """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'require_https': {'key': 'properties.requireHttps', 'type': 'bool'}, - 'routes': {'key': 'properties.routes', 'type': 'HttpSettingsRoutes'}, - 'forward_proxy': {'key': 'properties.forwardProxy', 'type': 'ForwardProxy'}, + 'require_https': {'key': 'requireHttps', 'type': 'bool'}, + 'routes': {'key': 'routes', 'type': 'HttpSettingsRoutes'}, + 'forward_proxy': {'key': 'forwardProxy', 'type': 'ForwardProxy'}, } def __init__( @@ -8333,35 +7908,15 @@ def __init__( self.forward_proxy = kwargs.get('forward_proxy', None) -class HttpSettingsRoutes(ProxyOnlyResource): +class HttpSettingsRoutes(msrest.serialization.Model): """The configuration settings of the paths HTTP requests. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param api_prefix: The prefix that should precede all the authentication/authorization paths. :type api_prefix: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'api_prefix': {'key': 'properties.apiPrefix', 'type': 'str'}, + 'api_prefix': {'key': 'apiPrefix', 'type': 'str'}, } def __init__( @@ -8636,19 +8191,9 @@ def __init__( self.next_link = None -class IdentityProviders(ProxyOnlyResource): +class IdentityProviders(msrest.serialization.Model): """The configuration settings of each of the identity providers used to configure App Service Authentication/Authorization. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param azure_active_directory: The configuration settings of the Azure Active directory provider. :type azure_active_directory: ~azure.mgmt.web.v2021_01_01.models.AzureActiveDirectory @@ -8658,42 +8203,32 @@ class IdentityProviders(ProxyOnlyResource): :type git_hub: ~azure.mgmt.web.v2021_01_01.models.GitHub :param google: The configuration settings of the Google provider. :type google: ~azure.mgmt.web.v2021_01_01.models.Google - :param twitter: The configuration settings of the Twitter provider. - :type twitter: ~azure.mgmt.web.v2021_01_01.models.Twitter - :param custom_open_id_connect_providers: The map of the name of the alias of each custom Open - ID Connect provider to the - configuration settings of the custom Open ID Connect provider. - :type custom_open_id_connect_providers: dict[str, - ~azure.mgmt.web.v2021_01_01.models.CustomOpenIdConnectProvider] :param legacy_microsoft_account: The configuration settings of the legacy Microsoft Account provider. :type legacy_microsoft_account: ~azure.mgmt.web.v2021_01_01.models.LegacyMicrosoftAccount + :param twitter: The configuration settings of the Twitter provider. + :type twitter: ~azure.mgmt.web.v2021_01_01.models.Twitter :param apple: The configuration settings of the Apple provider. :type apple: ~azure.mgmt.web.v2021_01_01.models.Apple :param azure_static_web_apps: The configuration settings of the Azure Static Web Apps provider. :type azure_static_web_apps: ~azure.mgmt.web.v2021_01_01.models.AzureStaticWebApps + :param custom_open_id_connect_providers: The map of the name of the alias of each custom Open + ID Connect provider to the + configuration settings of the custom Open ID Connect provider. + :type custom_open_id_connect_providers: dict[str, + ~azure.mgmt.web.v2021_01_01.models.CustomOpenIdConnectProvider] """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'azure_active_directory': {'key': 'properties.azureActiveDirectory', 'type': 'AzureActiveDirectory'}, - 'facebook': {'key': 'properties.facebook', 'type': 'Facebook'}, - 'git_hub': {'key': 'properties.gitHub', 'type': 'GitHub'}, - 'google': {'key': 'properties.google', 'type': 'Google'}, - 'twitter': {'key': 'properties.twitter', 'type': 'Twitter'}, - 'custom_open_id_connect_providers': {'key': 'properties.customOpenIdConnectProviders', 'type': '{CustomOpenIdConnectProvider}'}, - 'legacy_microsoft_account': {'key': 'properties.legacyMicrosoftAccount', 'type': 'LegacyMicrosoftAccount'}, - 'apple': {'key': 'properties.apple', 'type': 'Apple'}, - 'azure_static_web_apps': {'key': 'properties.azureStaticWebApps', 'type': 'AzureStaticWebApps'}, + 'azure_active_directory': {'key': 'azureActiveDirectory', 'type': 'AzureActiveDirectory'}, + 'facebook': {'key': 'facebook', 'type': 'Facebook'}, + 'git_hub': {'key': 'gitHub', 'type': 'GitHub'}, + 'google': {'key': 'google', 'type': 'Google'}, + 'legacy_microsoft_account': {'key': 'legacyMicrosoftAccount', 'type': 'LegacyMicrosoftAccount'}, + 'twitter': {'key': 'twitter', 'type': 'Twitter'}, + 'apple': {'key': 'apple', 'type': 'Apple'}, + 'azure_static_web_apps': {'key': 'azureStaticWebApps', 'type': 'AzureStaticWebApps'}, + 'custom_open_id_connect_providers': {'key': 'customOpenIdConnectProviders', 'type': '{CustomOpenIdConnectProvider}'}, } def __init__( @@ -8705,11 +8240,11 @@ def __init__( self.facebook = kwargs.get('facebook', None) self.git_hub = kwargs.get('git_hub', None) self.google = kwargs.get('google', None) - self.twitter = kwargs.get('twitter', None) - self.custom_open_id_connect_providers = kwargs.get('custom_open_id_connect_providers', None) self.legacy_microsoft_account = kwargs.get('legacy_microsoft_account', None) + self.twitter = kwargs.get('twitter', None) self.apple = kwargs.get('apple', None) self.azure_static_web_apps = kwargs.get('azure_static_web_apps', None) + self.custom_open_id_connect_providers = kwargs.get('custom_open_id_connect_providers', None) class InboundEnvironmentEndpoint(msrest.serialization.Model): @@ -8858,38 +8393,18 @@ def __init__( self.headers = kwargs.get('headers', None) -class JwtClaimChecks(ProxyOnlyResource): +class JwtClaimChecks(msrest.serialization.Model): """The configuration settings of the checks that should be made while validating the JWT Claims. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param allowed_groups: The list of the allowed groups. :type allowed_groups: list[str] :param allowed_client_applications: The list of the allowed client applications. :type allowed_client_applications: list[str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'allowed_groups': {'key': 'properties.allowedGroups', 'type': '[str]'}, - 'allowed_client_applications': {'key': 'properties.allowedClientApplications', 'type': '[str]'}, + """ + + _attribute_map = { + 'allowed_groups': {'key': 'allowedGroups', 'type': '[str]'}, + 'allowed_client_applications': {'key': 'allowedClientApplications', 'type': '[str]'}, } def __init__( @@ -9189,19 +8704,9 @@ def __init__( self.type = None -class LegacyMicrosoftAccount(ProxyOnlyResource): +class LegacyMicrosoftAccount(msrest.serialization.Model): """The configuration settings of the legacy Microsoft Account provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`false` if the legacy Microsoft Account provider should not be enabled despite the set registration; otherwise, :code:`true`. :type enabled: bool @@ -9215,21 +8720,11 @@ class LegacyMicrosoftAccount(ProxyOnlyResource): :type validation: ~azure.mgmt.web.v2021_01_01.models.AllowedAudiencesValidation """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'registration': {'key': 'properties.registration', 'type': 'ClientRegistration'}, - 'login': {'key': 'properties.login', 'type': 'LoginScopes'}, - 'validation': {'key': 'properties.validation', 'type': 'AllowedAudiencesValidation'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'ClientRegistration'}, + 'login': {'key': 'login', 'type': 'LoginScopes'}, + 'validation': {'key': 'validation', 'type': 'AllowedAudiencesValidation'}, } def __init__( @@ -9354,19 +8849,9 @@ def __init__( self.shared_key = kwargs.get('shared_key', None) -class Login(ProxyOnlyResource): +class Login(msrest.serialization.Model): """The configuration settings of the login flow of users using App Service Authentication/Authorization. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param routes: The routes that specify the endpoints used for login and logout requests. :type routes: ~azure.mgmt.web.v2021_01_01.models.LoginRoutes :param token_store: The configuration settings of the token store. @@ -9385,23 +8870,13 @@ class Login(ProxyOnlyResource): :type nonce: ~azure.mgmt.web.v2021_01_01.models.Nonce """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'routes': {'key': 'properties.routes', 'type': 'LoginRoutes'}, - 'token_store': {'key': 'properties.tokenStore', 'type': 'TokenStore'}, - 'preserve_url_fragments_for_logins': {'key': 'properties.preserveUrlFragmentsForLogins', 'type': 'bool'}, - 'allowed_external_redirect_urls': {'key': 'properties.allowedExternalRedirectUrls', 'type': '[str]'}, - 'cookie_expiration': {'key': 'properties.cookieExpiration', 'type': 'CookieExpiration'}, - 'nonce': {'key': 'properties.nonce', 'type': 'Nonce'}, + 'routes': {'key': 'routes', 'type': 'LoginRoutes'}, + 'token_store': {'key': 'tokenStore', 'type': 'TokenStore'}, + 'preserve_url_fragments_for_logins': {'key': 'preserveUrlFragmentsForLogins', 'type': 'bool'}, + 'allowed_external_redirect_urls': {'key': 'allowedExternalRedirectUrls', 'type': '[str]'}, + 'cookie_expiration': {'key': 'cookieExpiration', 'type': 'CookieExpiration'}, + 'nonce': {'key': 'nonce', 'type': 'Nonce'}, } def __init__( @@ -9417,35 +8892,15 @@ def __init__( self.nonce = kwargs.get('nonce', None) -class LoginRoutes(ProxyOnlyResource): +class LoginRoutes(msrest.serialization.Model): """The routes that specify the endpoints used for login and logout requests. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param logout_endpoint: The endpoint at which a logout request should be made. :type logout_endpoint: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'logout_endpoint': {'key': 'properties.logoutEndpoint', 'type': 'str'}, + 'logout_endpoint': {'key': 'logoutEndpoint', 'type': 'str'}, } def __init__( @@ -9456,35 +8911,15 @@ def __init__( self.logout_endpoint = kwargs.get('logout_endpoint', None) -class LoginScopes(ProxyOnlyResource): +class LoginScopes(msrest.serialization.Model): """The configuration settings of the login flow, including the scopes that should be requested. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param scopes: A list of the scopes that should be requested while authenticating. :type scopes: list[str] """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'scopes': {'key': 'properties.scopes', 'type': '[str]'}, + 'scopes': {'key': 'scopes', 'type': '[str]'}, } def __init__( @@ -10133,19 +9568,9 @@ def __init__( self.message = kwargs.get('message', None) -class Nonce(ProxyOnlyResource): +class Nonce(msrest.serialization.Model): """The configuration settings of the nonce used in the login flow. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param validate_nonce: :code:`false` if the nonce should not be validated while completing the login flow; otherwise, :code:`true`. :type validate_nonce: bool @@ -10154,19 +9579,9 @@ class Nonce(ProxyOnlyResource): :type nonce_expiration_interval: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'validate_nonce': {'key': 'properties.validateNonce', 'type': 'bool'}, - 'nonce_expiration_interval': {'key': 'properties.nonceExpirationInterval', 'type': 'str'}, + 'validate_nonce': {'key': 'validateNonce', 'type': 'bool'}, + 'nonce_expiration_interval': {'key': 'nonceExpirationInterval', 'type': 'str'}, } def __init__( @@ -10178,19 +9593,9 @@ def __init__( self.nonce_expiration_interval = kwargs.get('nonce_expiration_interval', None) -class OpenIdConnectClientCredential(ProxyOnlyResource): +class OpenIdConnectClientCredential(msrest.serialization.Model): """The authentication client credentials of the custom Open ID Connect provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param method: The method that should be used to authenticate the user. The only acceptable values to pass in are None and "ClientSecretPost". The default value is None. :type method: str @@ -10199,19 +9604,9 @@ class OpenIdConnectClientCredential(ProxyOnlyResource): :type client_secret_setting_name: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'method': {'key': 'properties.method', 'type': 'str'}, - 'client_secret_setting_name': {'key': 'properties.clientSecretSettingName', 'type': 'str'}, + 'method': {'key': 'method', 'type': 'str'}, + 'client_secret_setting_name': {'key': 'clientSecretSettingName', 'type': 'str'}, } def __init__( @@ -10223,19 +9618,9 @@ def __init__( self.client_secret_setting_name = kwargs.get('client_secret_setting_name', None) -class OpenIdConnectConfig(ProxyOnlyResource): +class OpenIdConnectConfig(msrest.serialization.Model): """The configuration settings of the endpoints used for the custom Open ID Connect provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param authorization_endpoint: The endpoint to be used to make an authorization request. :type authorization_endpoint: str :param token_endpoint: The endpoint to be used to request a token. @@ -10249,22 +9634,12 @@ class OpenIdConnectConfig(ProxyOnlyResource): :type well_known_open_id_configuration: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'authorization_endpoint': {'key': 'properties.authorizationEndpoint', 'type': 'str'}, - 'token_endpoint': {'key': 'properties.tokenEndpoint', 'type': 'str'}, - 'issuer': {'key': 'properties.issuer', 'type': 'str'}, - 'certification_uri': {'key': 'properties.certificationUri', 'type': 'str'}, - 'well_known_open_id_configuration': {'key': 'properties.wellKnownOpenIdConfiguration', 'type': 'str'}, + 'authorization_endpoint': {'key': 'authorizationEndpoint', 'type': 'str'}, + 'token_endpoint': {'key': 'tokenEndpoint', 'type': 'str'}, + 'issuer': {'key': 'issuer', 'type': 'str'}, + 'certification_uri': {'key': 'certificationUri', 'type': 'str'}, + 'well_known_open_id_configuration': {'key': 'wellKnownOpenIdConfiguration', 'type': 'str'}, } def __init__( @@ -10279,38 +9654,18 @@ def __init__( self.well_known_open_id_configuration = kwargs.get('well_known_open_id_configuration', None) -class OpenIdConnectLogin(ProxyOnlyResource): +class OpenIdConnectLogin(msrest.serialization.Model): """The configuration settings of the login flow of the custom Open ID Connect provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param name_claim_type: The name of the claim that contains the users name. :type name_claim_type: str :param scopes: A list of the scopes that should be requested while authenticating. :type scopes: list[str] """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'name_claim_type': {'key': 'properties.nameClaimType', 'type': 'str'}, - 'scopes': {'key': 'properties.scopes', 'type': '[str]'}, + 'name_claim_type': {'key': 'nameClaimType', 'type': 'str'}, + 'scopes': {'key': 'scopes', 'type': '[str]'}, } def __init__( @@ -10322,19 +9677,9 @@ def __init__( self.scopes = kwargs.get('scopes', None) -class OpenIdConnectRegistration(ProxyOnlyResource): +class OpenIdConnectRegistration(msrest.serialization.Model): """The configuration settings of the app registration for the custom Open ID Connect provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param client_id: The client id of the custom Open ID Connect provider. :type client_id: str :param client_credential: The authentication credentials of the custom Open ID Connect @@ -10345,20 +9690,10 @@ class OpenIdConnectRegistration(ProxyOnlyResource): :type open_id_connect_configuration: ~azure.mgmt.web.v2021_01_01.models.OpenIdConnectConfig """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'client_id': {'key': 'properties.clientId', 'type': 'str'}, - 'client_credential': {'key': 'properties.clientCredential', 'type': 'OpenIdConnectClientCredential'}, - 'open_id_connect_configuration': {'key': 'properties.openIdConnectConfiguration', 'type': 'OpenIdConnectConfig'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'client_credential': {'key': 'clientCredential', 'type': 'OpenIdConnectClientCredential'}, + 'open_id_connect_configuration': {'key': 'openIdConnectConfiguration', 'type': 'OpenIdConnectConfig'}, } def __init__( @@ -17551,19 +16886,9 @@ def __init__( self.next_link = None -class TokenStore(ProxyOnlyResource): +class TokenStore(msrest.serialization.Model): """The configuration settings of the token store. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`true` to durably store platform-specific security tokens that are obtained during login flows; otherwise, :code:`false`. The default is :code:`false`. @@ -17580,21 +16905,11 @@ class TokenStore(ProxyOnlyResource): :type azure_blob_storage: ~azure.mgmt.web.v2021_01_01.models.BlobStorageTokenStore """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'token_refresh_extension_hours': {'key': 'properties.tokenRefreshExtensionHours', 'type': 'float'}, - 'file_system': {'key': 'properties.fileSystem', 'type': 'FileSystemTokenStore'}, - 'azure_blob_storage': {'key': 'properties.azureBlobStorage', 'type': 'BlobStorageTokenStore'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'token_refresh_extension_hours': {'key': 'tokenRefreshExtensionHours', 'type': 'float'}, + 'file_system': {'key': 'fileSystem', 'type': 'FileSystemTokenStore'}, + 'azure_blob_storage': {'key': 'azureBlobStorage', 'type': 'BlobStorageTokenStore'}, } def __init__( @@ -17962,19 +17277,9 @@ def __init__( self.next_link = None -class Twitter(ProxyOnlyResource): +class Twitter(msrest.serialization.Model): """The configuration settings of the Twitter provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`false` if the Twitter provider should not be enabled despite the set registration; otherwise, :code:`true`. :type enabled: bool @@ -17983,19 +17288,9 @@ class Twitter(ProxyOnlyResource): :type registration: ~azure.mgmt.web.v2021_01_01.models.TwitterRegistration """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'registration': {'key': 'properties.registration', 'type': 'TwitterRegistration'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'TwitterRegistration'}, } def __init__( @@ -18007,19 +17302,9 @@ def __init__( self.registration = kwargs.get('registration', None) -class TwitterRegistration(ProxyOnlyResource): +class TwitterRegistration(msrest.serialization.Model): """The configuration settings of the app registration for the Twitter provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param consumer_key: The OAuth 1.0a consumer key of the Twitter application used for sign-in. This setting is required for enabling Twitter Sign-In. Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in. @@ -18030,19 +17315,9 @@ class TwitterRegistration(ProxyOnlyResource): :type consumer_secret_setting_name: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'consumer_key': {'key': 'properties.consumerKey', 'type': 'str'}, - 'consumer_secret_setting_name': {'key': 'properties.consumerSecretSettingName', 'type': 'str'}, + 'consumer_key': {'key': 'consumerKey', 'type': 'str'}, + 'consumer_secret_setting_name': {'key': 'consumerSecretSettingName', 'type': 'str'}, } def __init__( diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_01_01/models/_models_py3.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_01_01/models/_models_py3.py index 67bda0739556..81c4209fb214 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_01_01/models/_models_py3.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_01_01/models/_models_py3.py @@ -206,45 +206,25 @@ def __init__( self.vip_mappings = vip_mappings -class AllowedAudiencesValidation(ProxyOnlyResource): - """AllowedAudiencesValidation. +class AllowedAudiencesValidation(msrest.serialization.Model): + """The configuration settings of the Allowed Audiences validation flow. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str - :param allowed_audiences: + :param allowed_audiences: The configuration settings of the allowed list of audiences from + which to validate the JWT token. :type allowed_audiences: list[str] """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'allowed_audiences': {'key': 'properties.allowedAudiences', 'type': '[str]'}, + 'allowed_audiences': {'key': 'allowedAudiences', 'type': '[str]'}, } def __init__( self, *, - kind: Optional[str] = None, allowed_audiences: Optional[List[str]] = None, **kwargs ): - super(AllowedAudiencesValidation, self).__init__(kind=kind, **kwargs) + super(AllowedAudiencesValidation, self).__init__(**kwargs) self.allowed_audiences = allowed_audiences @@ -524,19 +504,9 @@ def __init__( self.is_default_off = None -class Apple(ProxyOnlyResource): +class Apple(msrest.serialization.Model): """The configuration settings of the Apple provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`false` if the Apple provider should not be enabled despite the set registration; otherwise, :code:`true`. :type enabled: bool @@ -546,80 +516,48 @@ class Apple(ProxyOnlyResource): :type login: ~azure.mgmt.web.v2021_01_01.models.LoginScopes """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'registration': {'key': 'properties.registration', 'type': 'AppleRegistration'}, - 'login': {'key': 'properties.login', 'type': 'LoginScopes'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'AppleRegistration'}, + 'login': {'key': 'login', 'type': 'LoginScopes'}, } def __init__( self, *, - kind: Optional[str] = None, enabled: Optional[bool] = None, registration: Optional["AppleRegistration"] = None, login: Optional["LoginScopes"] = None, **kwargs ): - super(Apple, self).__init__(kind=kind, **kwargs) + super(Apple, self).__init__(**kwargs) self.enabled = enabled self.registration = registration self.login = login -class AppleRegistration(ProxyOnlyResource): +class AppleRegistration(msrest.serialization.Model): """The configuration settings of the registration for the Apple provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param client_id: The Client ID of the app used for login. :type client_id: str :param client_secret_setting_name: The app setting name that contains the client secret. :type client_secret_setting_name: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'client_id': {'key': 'properties.clientId', 'type': 'str'}, - 'client_secret_setting_name': {'key': 'properties.clientSecretSettingName', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'client_secret_setting_name': {'key': 'clientSecretSettingName', 'type': 'str'}, } def __init__( self, *, - kind: Optional[str] = None, client_id: Optional[str] = None, client_secret_setting_name: Optional[str] = None, **kwargs ): - super(AppleRegistration, self).__init__(kind=kind, **kwargs) + super(AppleRegistration, self).__init__(**kwargs) self.client_id = client_id self.client_secret_setting_name = client_secret_setting_name @@ -832,49 +770,28 @@ def __init__( self.log_analytics_configuration = log_analytics_configuration -class AppRegistration(ProxyOnlyResource): +class AppRegistration(msrest.serialization.Model): """The configuration settings of the app registration for providers that have app ids and app secrets. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param app_id: The App ID of the app used for login. :type app_id: str :param app_secret_setting_name: The app setting name that contains the app secret. :type app_secret_setting_name: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'app_id': {'key': 'properties.appId', 'type': 'str'}, - 'app_secret_setting_name': {'key': 'properties.appSecretSettingName', 'type': 'str'}, + 'app_id': {'key': 'appId', 'type': 'str'}, + 'app_secret_setting_name': {'key': 'appSecretSettingName', 'type': 'str'}, } def __init__( self, *, - kind: Optional[str] = None, app_id: Optional[str] = None, app_secret_setting_name: Optional[str] = None, **kwargs ): - super(AppRegistration, self).__init__(kind=kind, **kwargs) + super(AppRegistration, self).__init__(**kwargs) self.app_id = app_id self.app_secret_setting_name = app_secret_setting_name @@ -2463,19 +2380,9 @@ def __init__( self.allow_new_private_endpoint_connections = allow_new_private_endpoint_connections -class AuthPlatform(ProxyOnlyResource): +class AuthPlatform(msrest.serialization.Model): """The configuration settings of the platform of App Service Authentication/Authorization. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`true` if the Authentication / Authorization feature is enabled for the current app; otherwise, :code:`false`. :type enabled: bool @@ -2490,32 +2397,21 @@ class AuthPlatform(ProxyOnlyResource): :type config_file_path: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'runtime_version': {'key': 'properties.runtimeVersion', 'type': 'str'}, - 'config_file_path': {'key': 'properties.configFilePath', 'type': 'str'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, + 'config_file_path': {'key': 'configFilePath', 'type': 'str'}, } def __init__( self, *, - kind: Optional[str] = None, enabled: Optional[bool] = None, runtime_version: Optional[str] = None, config_file_path: Optional[str] = None, **kwargs ): - super(AuthPlatform, self).__init__(kind=kind, **kwargs) + super(AuthPlatform, self).__init__(**kwargs) self.enabled = enabled self.runtime_version = runtime_version self.config_file_path = config_file_path @@ -2654,19 +2550,9 @@ def __init__( self.status_codes_range = status_codes_range -class AzureActiveDirectory(ProxyOnlyResource): +class AzureActiveDirectory(msrest.serialization.Model): """The configuration settings of the Azure Active directory provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`false` if the Azure Active Directory provider should not be enabled despite the set registration; otherwise, :code:`true`. :type enabled: bool @@ -2685,28 +2571,17 @@ class AzureActiveDirectory(ProxyOnlyResource): :type is_auto_provisioned: bool """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'registration': {'key': 'properties.registration', 'type': 'AzureActiveDirectoryRegistration'}, - 'login': {'key': 'properties.login', 'type': 'AzureActiveDirectoryLogin'}, - 'validation': {'key': 'properties.validation', 'type': 'AzureActiveDirectoryValidation'}, - 'is_auto_provisioned': {'key': 'properties.isAutoProvisioned', 'type': 'bool'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'AzureActiveDirectoryRegistration'}, + 'login': {'key': 'login', 'type': 'AzureActiveDirectoryLogin'}, + 'validation': {'key': 'validation', 'type': 'AzureActiveDirectoryValidation'}, + 'is_auto_provisioned': {'key': 'isAutoProvisioned', 'type': 'bool'}, } def __init__( self, *, - kind: Optional[str] = None, enabled: Optional[bool] = None, registration: Optional["AzureActiveDirectoryRegistration"] = None, login: Optional["AzureActiveDirectoryLogin"] = None, @@ -2714,7 +2589,7 @@ def __init__( is_auto_provisioned: Optional[bool] = None, **kwargs ): - super(AzureActiveDirectory, self).__init__(kind=kind, **kwargs) + super(AzureActiveDirectory, self).__init__(**kwargs) self.enabled = enabled self.registration = registration self.login = login @@ -2722,68 +2597,38 @@ def __init__( self.is_auto_provisioned = is_auto_provisioned -class AzureActiveDirectoryLogin(ProxyOnlyResource): +class AzureActiveDirectoryLogin(msrest.serialization.Model): """The configuration settings of the Azure Active Directory login flow. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str - :param disable_www_authenticate: - :type disable_www_authenticate: bool :param login_parameters: Login parameters to send to the OpenID Connect authorization endpoint when a user logs in. Each parameter must be in the form "key=value". :type login_parameters: list[str] + :param disable_www_authenticate: :code:`true` if the www-authenticate provider + should be omitted from the request; otherwise, :code:`false`. + :type disable_www_authenticate: bool """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'disable_www_authenticate': {'key': 'properties.disableWWWAuthenticate', 'type': 'bool'}, - 'login_parameters': {'key': 'properties.loginParameters', 'type': '[str]'}, + 'login_parameters': {'key': 'loginParameters', 'type': '[str]'}, + 'disable_www_authenticate': {'key': 'disableWWWAuthenticate', 'type': 'bool'}, } def __init__( self, *, - kind: Optional[str] = None, - disable_www_authenticate: Optional[bool] = None, login_parameters: Optional[List[str]] = None, + disable_www_authenticate: Optional[bool] = None, **kwargs ): - super(AzureActiveDirectoryLogin, self).__init__(kind=kind, **kwargs) - self.disable_www_authenticate = disable_www_authenticate + super(AzureActiveDirectoryLogin, self).__init__(**kwargs) self.login_parameters = login_parameters + self.disable_www_authenticate = disable_www_authenticate -class AzureActiveDirectoryRegistration(ProxyOnlyResource): +class AzureActiveDirectoryRegistration(msrest.serialization.Model): """The configuration settings of the Azure Active Directory app registration. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param open_id_issuer: The OpenID Connect Issuer URI that represents the entity which issues access tokens for this application. When using Azure Active Directory, this value is the URI of the directory tenant, e.g. @@ -2805,55 +2650,49 @@ class AzureActiveDirectoryRegistration(ProxyOnlyResource): thumbprint of a certificate used for signing purposes. This property acts as a replacement for the Client Secret. It is also optional. :type client_secret_certificate_thumbprint: str + :param client_secret_certificate_subject_alternative_name: An alternative to the client secret + thumbprint, that is the subject alternative name of a certificate used for signing purposes. + This property acts as + a replacement for the Client Secret Certificate Thumbprint. It is also optional. + :type client_secret_certificate_subject_alternative_name: str + :param client_secret_certificate_issuer: An alternative to the client secret thumbprint, that + is the issuer of a certificate used for signing purposes. This property acts as + a replacement for the Client Secret Certificate Thumbprint. It is also optional. + :type client_secret_certificate_issuer: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'open_id_issuer': {'key': 'properties.openIdIssuer', 'type': 'str'}, - 'client_id': {'key': 'properties.clientId', 'type': 'str'}, - 'client_secret_setting_name': {'key': 'properties.clientSecretSettingName', 'type': 'str'}, - 'client_secret_certificate_thumbprint': {'key': 'properties.clientSecretCertificateThumbprint', 'type': 'str'}, + 'open_id_issuer': {'key': 'openIdIssuer', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'client_secret_setting_name': {'key': 'clientSecretSettingName', 'type': 'str'}, + 'client_secret_certificate_thumbprint': {'key': 'clientSecretCertificateThumbprint', 'type': 'str'}, + 'client_secret_certificate_subject_alternative_name': {'key': 'clientSecretCertificateSubjectAlternativeName', 'type': 'str'}, + 'client_secret_certificate_issuer': {'key': 'clientSecretCertificateIssuer', 'type': 'str'}, } def __init__( self, *, - kind: Optional[str] = None, open_id_issuer: Optional[str] = None, client_id: Optional[str] = None, client_secret_setting_name: Optional[str] = None, client_secret_certificate_thumbprint: Optional[str] = None, + client_secret_certificate_subject_alternative_name: Optional[str] = None, + client_secret_certificate_issuer: Optional[str] = None, **kwargs ): - super(AzureActiveDirectoryRegistration, self).__init__(kind=kind, **kwargs) + super(AzureActiveDirectoryRegistration, self).__init__(**kwargs) self.open_id_issuer = open_id_issuer self.client_id = client_id self.client_secret_setting_name = client_secret_setting_name self.client_secret_certificate_thumbprint = client_secret_certificate_thumbprint + self.client_secret_certificate_subject_alternative_name = client_secret_certificate_subject_alternative_name + self.client_secret_certificate_issuer = client_secret_certificate_issuer -class AzureActiveDirectoryValidation(ProxyOnlyResource): +class AzureActiveDirectoryValidation(msrest.serialization.Model): """The configuration settings of the Azure Active Directory token validation flow. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param jwt_claim_checks: The configuration settings of the checks that should be made while validating the JWT Claims. :type jwt_claim_checks: ~azure.mgmt.web.v2021_01_01.models.JwtClaimChecks @@ -2862,30 +2701,19 @@ class AzureActiveDirectoryValidation(ProxyOnlyResource): :type allowed_audiences: list[str] """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'jwt_claim_checks': {'key': 'properties.jwtClaimChecks', 'type': 'JwtClaimChecks'}, - 'allowed_audiences': {'key': 'properties.allowedAudiences', 'type': '[str]'}, + 'jwt_claim_checks': {'key': 'jwtClaimChecks', 'type': 'JwtClaimChecks'}, + 'allowed_audiences': {'key': 'allowedAudiences', 'type': '[str]'}, } def __init__( self, *, - kind: Optional[str] = None, jwt_claim_checks: Optional["JwtClaimChecks"] = None, allowed_audiences: Optional[List[str]] = None, **kwargs ): - super(AzureActiveDirectoryValidation, self).__init__(kind=kind, **kwargs) + super(AzureActiveDirectoryValidation, self).__init__(**kwargs) self.jwt_claim_checks = jwt_claim_checks self.allowed_audiences = allowed_audiences @@ -2958,19 +2786,9 @@ def __init__( self.enabled = enabled -class AzureStaticWebApps(ProxyOnlyResource): +class AzureStaticWebApps(msrest.serialization.Model): """The configuration settings of the Azure Static Web Apps provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`false` if the Azure Static Web Apps provider should not be enabled despite the set registration; otherwise, :code:`true`. :type enabled: bool @@ -2978,73 +2796,41 @@ class AzureStaticWebApps(ProxyOnlyResource): :type registration: ~azure.mgmt.web.v2021_01_01.models.AzureStaticWebAppsRegistration """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'registration': {'key': 'properties.registration', 'type': 'AzureStaticWebAppsRegistration'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'AzureStaticWebAppsRegistration'}, } def __init__( self, *, - kind: Optional[str] = None, enabled: Optional[bool] = None, registration: Optional["AzureStaticWebAppsRegistration"] = None, **kwargs ): - super(AzureStaticWebApps, self).__init__(kind=kind, **kwargs) + super(AzureStaticWebApps, self).__init__(**kwargs) self.enabled = enabled self.registration = registration -class AzureStaticWebAppsRegistration(ProxyOnlyResource): +class AzureStaticWebAppsRegistration(msrest.serialization.Model): """The configuration settings of the registration for the Azure Static Web Apps provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param client_id: The Client ID of the app used for login. :type client_id: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'client_id': {'key': 'properties.clientId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, } def __init__( self, *, - kind: Optional[str] = None, client_id: Optional[str] = None, **kwargs ): - super(AzureStaticWebAppsRegistration, self).__init__(kind=kind, **kwargs) + super(AzureStaticWebAppsRegistration, self).__init__(**kwargs) self.client_id = client_id @@ -3550,46 +3336,25 @@ def __init__( self.next_link = None -class BlobStorageTokenStore(ProxyOnlyResource): +class BlobStorageTokenStore(msrest.serialization.Model): """The configuration settings of the storage of the tokens if blob storage is used. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param sas_url_setting_name: The name of the app setting containing the SAS URL of the blob storage containing the tokens. :type sas_url_setting_name: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'sas_url_setting_name': {'key': 'properties.sasUrlSettingName', 'type': 'str'}, + 'sas_url_setting_name': {'key': 'sasUrlSettingName', 'type': 'str'}, } def __init__( self, *, - kind: Optional[str] = None, sas_url_setting_name: Optional[str] = None, **kwargs ): - super(BlobStorageTokenStore, self).__init__(kind=kind, **kwargs) + super(BlobStorageTokenStore, self).__init__(**kwargs) self.sas_url_setting_name = sas_url_setting_name @@ -4168,49 +3933,28 @@ def __init__( self.domain_validation_method = domain_validation_method -class ClientRegistration(ProxyOnlyResource): +class ClientRegistration(msrest.serialization.Model): """The configuration settings of the app registration for providers that have client ids and client secrets. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param client_id: The Client ID of the app used for login. :type client_id: str :param client_secret_setting_name: The app setting name that contains the client secret. :type client_secret_setting_name: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'client_id': {'key': 'properties.clientId', 'type': 'str'}, - 'client_secret_setting_name': {'key': 'properties.clientSecretSettingName', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'client_secret_setting_name': {'key': 'clientSecretSettingName', 'type': 'str'}, } def __init__( self, *, - kind: Optional[str] = None, client_id: Optional[str] = None, client_secret_setting_name: Optional[str] = None, **kwargs ): - super(ClientRegistration, self).__init__(kind=kind, **kwargs) + super(ClientRegistration, self).__init__(**kwargs) self.client_id = client_id self.client_secret_setting_name = client_secret_setting_name @@ -4887,19 +4631,9 @@ def __init__( self.next_link = None -class CookieExpiration(ProxyOnlyResource): +class CookieExpiration(msrest.serialization.Model): """The configuration settings of the session cookie's expiration. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param convention: The convention used when determining the session cookie's expiration. Possible values include: "FixedTime", "IdentityProviderDerived". :type convention: str or ~azure.mgmt.web.v2021_01_01.models.CookieExpirationConvention @@ -4908,30 +4642,19 @@ class CookieExpiration(ProxyOnlyResource): :type time_to_expiration: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'convention': {'key': 'properties.convention', 'type': 'str'}, - 'time_to_expiration': {'key': 'properties.timeToExpiration', 'type': 'str'}, + 'convention': {'key': 'convention', 'type': 'str'}, + 'time_to_expiration': {'key': 'timeToExpiration', 'type': 'str'}, } def __init__( self, *, - kind: Optional[str] = None, convention: Optional[Union[str, "CookieExpirationConvention"]] = None, time_to_expiration: Optional[str] = None, **kwargs ): - super(CookieExpiration, self).__init__(kind=kind, **kwargs) + super(CookieExpiration, self).__init__(**kwargs) self.convention = convention self.time_to_expiration = time_to_expiration @@ -5458,19 +5181,9 @@ def __init__( self.alternate_txt_records = alternate_txt_records -class CustomOpenIdConnectProvider(ProxyOnlyResource): +class CustomOpenIdConnectProvider(msrest.serialization.Model): """The configuration settings of the custom Open ID Connect provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`false` if the custom Open ID provider provider should not be enabled; otherwise, :code:`true`. :type enabled: bool @@ -5479,35 +5192,24 @@ class CustomOpenIdConnectProvider(ProxyOnlyResource): :type registration: ~azure.mgmt.web.v2021_01_01.models.OpenIdConnectRegistration :param login: The configuration settings of the login flow of the custom Open ID Connect provider. - :type login: ~azure.mgmt.web.v2021_01_01.models.OpenIdConnectLogin - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'registration': {'key': 'properties.registration', 'type': 'OpenIdConnectRegistration'}, - 'login': {'key': 'properties.login', 'type': 'OpenIdConnectLogin'}, + :type login: ~azure.mgmt.web.v2021_01_01.models.OpenIdConnectLogin + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'OpenIdConnectRegistration'}, + 'login': {'key': 'login', 'type': 'OpenIdConnectLogin'}, } def __init__( self, *, - kind: Optional[str] = None, enabled: Optional[bool] = None, registration: Optional["OpenIdConnectRegistration"] = None, login: Optional["OpenIdConnectLogin"] = None, **kwargs ): - super(CustomOpenIdConnectProvider, self).__init__(kind=kind, **kwargs) + super(CustomOpenIdConnectProvider, self).__init__(**kwargs) self.enabled = enabled self.registration = registration self.login = login @@ -7564,19 +7266,9 @@ def __init__( self.type = None -class Facebook(ProxyOnlyResource): +class Facebook(msrest.serialization.Model): """The configuration settings of the Facebook provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`false` if the Facebook provider should not be enabled despite the set registration; otherwise, :code:`true`. :type enabled: bool @@ -7589,34 +7281,23 @@ class Facebook(ProxyOnlyResource): :type login: ~azure.mgmt.web.v2021_01_01.models.LoginScopes """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'registration': {'key': 'properties.registration', 'type': 'AppRegistration'}, - 'graph_api_version': {'key': 'properties.graphApiVersion', 'type': 'str'}, - 'login': {'key': 'properties.login', 'type': 'LoginScopes'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'AppRegistration'}, + 'graph_api_version': {'key': 'graphApiVersion', 'type': 'str'}, + 'login': {'key': 'login', 'type': 'LoginScopes'}, } def __init__( self, *, - kind: Optional[str] = None, enabled: Optional[bool] = None, registration: Optional["AppRegistration"] = None, graph_api_version: Optional[str] = None, login: Optional["LoginScopes"] = None, **kwargs ): - super(Facebook, self).__init__(kind=kind, **kwargs) + super(Facebook, self).__init__(**kwargs) self.enabled = enabled self.registration = registration self.graph_api_version = graph_api_version @@ -7685,61 +7366,30 @@ def __init__( self.enabled = enabled -class FileSystemTokenStore(ProxyOnlyResource): +class FileSystemTokenStore(msrest.serialization.Model): """The configuration settings of the storage of the tokens if a file system is used. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param directory: The directory in which the tokens will be stored. :type directory: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'directory': {'key': 'properties.directory', 'type': 'str'}, + 'directory': {'key': 'directory', 'type': 'str'}, } def __init__( self, *, - kind: Optional[str] = None, directory: Optional[str] = None, **kwargs ): - super(FileSystemTokenStore, self).__init__(kind=kind, **kwargs) + super(FileSystemTokenStore, self).__init__(**kwargs) self.directory = directory -class ForwardProxy(ProxyOnlyResource): +class ForwardProxy(msrest.serialization.Model): """The configuration settings of a forward proxy used to make the requests. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param convention: The convention used to determine the url of the request made. Possible values include: "NoProxy", "Standard", "Custom". :type convention: str or ~azure.mgmt.web.v2021_01_01.models.ForwardProxyConvention @@ -7749,32 +7399,21 @@ class ForwardProxy(ProxyOnlyResource): :type custom_proto_header_name: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'convention': {'key': 'properties.convention', 'type': 'str'}, - 'custom_host_header_name': {'key': 'properties.customHostHeaderName', 'type': 'str'}, - 'custom_proto_header_name': {'key': 'properties.customProtoHeaderName', 'type': 'str'}, + 'convention': {'key': 'convention', 'type': 'str'}, + 'custom_host_header_name': {'key': 'customHostHeaderName', 'type': 'str'}, + 'custom_proto_header_name': {'key': 'customProtoHeaderName', 'type': 'str'}, } def __init__( self, *, - kind: Optional[str] = None, convention: Optional[Union[str, "ForwardProxyConvention"]] = None, custom_host_header_name: Optional[str] = None, custom_proto_header_name: Optional[str] = None, **kwargs ): - super(ForwardProxy, self).__init__(kind=kind, **kwargs) + super(ForwardProxy, self).__init__(**kwargs) self.convention = convention self.custom_host_header_name = custom_host_header_name self.custom_proto_header_name = custom_proto_header_name @@ -8348,19 +7987,9 @@ def __init__( self.next_link = None -class GitHub(ProxyOnlyResource): +class GitHub(msrest.serialization.Model): """The configuration settings of the GitHub provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`false` if the GitHub provider should not be enabled despite the set registration; otherwise, :code:`true`. :type enabled: bool @@ -8371,32 +8000,21 @@ class GitHub(ProxyOnlyResource): :type login: ~azure.mgmt.web.v2021_01_01.models.LoginScopes """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'registration': {'key': 'properties.registration', 'type': 'ClientRegistration'}, - 'login': {'key': 'properties.login', 'type': 'LoginScopes'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'ClientRegistration'}, + 'login': {'key': 'login', 'type': 'LoginScopes'}, } def __init__( self, *, - kind: Optional[str] = None, enabled: Optional[bool] = None, registration: Optional["ClientRegistration"] = None, login: Optional["LoginScopes"] = None, **kwargs ): - super(GitHub, self).__init__(kind=kind, **kwargs) + super(GitHub, self).__init__(**kwargs) self.enabled = enabled self.registration = registration self.login = login @@ -8586,19 +8204,9 @@ def __init__( self.capabilities = capabilities -class GlobalValidation(ProxyOnlyResource): +class GlobalValidation(msrest.serialization.Model): """The configuration settings that determines the validation flow of users using App Service Authentication/Authorization. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param require_authentication: :code:`true` if the authentication flow is required any request is made; otherwise, :code:`false`. :type require_authentication: bool @@ -8618,53 +8226,32 @@ class GlobalValidation(ProxyOnlyResource): :type excluded_paths: list[str] """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'require_authentication': {'key': 'properties.requireAuthentication', 'type': 'bool'}, - 'unauthenticated_client_action': {'key': 'properties.unauthenticatedClientAction', 'type': 'str'}, - 'redirect_to_provider': {'key': 'properties.redirectToProvider', 'type': 'str'}, - 'excluded_paths': {'key': 'properties.excludedPaths', 'type': '[str]'}, + 'require_authentication': {'key': 'requireAuthentication', 'type': 'bool'}, + 'unauthenticated_client_action': {'key': 'unauthenticatedClientAction', 'type': 'str'}, + 'redirect_to_provider': {'key': 'redirectToProvider', 'type': 'str'}, + 'excluded_paths': {'key': 'excludedPaths', 'type': '[str]'}, } def __init__( self, *, - kind: Optional[str] = None, require_authentication: Optional[bool] = None, unauthenticated_client_action: Optional[Union[str, "UnauthenticatedClientActionV2"]] = None, redirect_to_provider: Optional[str] = None, excluded_paths: Optional[List[str]] = None, **kwargs ): - super(GlobalValidation, self).__init__(kind=kind, **kwargs) + super(GlobalValidation, self).__init__(**kwargs) self.require_authentication = require_authentication self.unauthenticated_client_action = unauthenticated_client_action self.redirect_to_provider = redirect_to_provider self.excluded_paths = excluded_paths -class Google(ProxyOnlyResource): +class Google(msrest.serialization.Model): """The configuration settings of the Google provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`false` if the Google provider should not be enabled despite the set registration; otherwise, :code:`true`. :type enabled: bool @@ -8678,34 +8265,23 @@ class Google(ProxyOnlyResource): :type validation: ~azure.mgmt.web.v2021_01_01.models.AllowedAudiencesValidation """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'registration': {'key': 'properties.registration', 'type': 'ClientRegistration'}, - 'login': {'key': 'properties.login', 'type': 'LoginScopes'}, - 'validation': {'key': 'properties.validation', 'type': 'AllowedAudiencesValidation'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'ClientRegistration'}, + 'login': {'key': 'login', 'type': 'LoginScopes'}, + 'validation': {'key': 'validation', 'type': 'AllowedAudiencesValidation'}, } def __init__( self, *, - kind: Optional[str] = None, enabled: Optional[bool] = None, registration: Optional["ClientRegistration"] = None, login: Optional["LoginScopes"] = None, validation: Optional["AllowedAudiencesValidation"] = None, **kwargs ): - super(Google, self).__init__(kind=kind, **kwargs) + super(Google, self).__init__(**kwargs) self.enabled = enabled self.registration = registration self.login = login @@ -9110,19 +8686,9 @@ def __init__( self.azure_blob_storage = azure_blob_storage -class HttpSettings(ProxyOnlyResource): +class HttpSettings(msrest.serialization.Model): """The configuration settings of the HTTP requests for authentication and authorization requests made against App Service Authentication/Authorization. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param require_https: :code:`false` if the authentication/authorization responses not having the HTTPS scheme are permissible; otherwise, :code:`true`. :type require_https: bool @@ -9132,76 +8698,44 @@ class HttpSettings(ProxyOnlyResource): :type forward_proxy: ~azure.mgmt.web.v2021_01_01.models.ForwardProxy """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'require_https': {'key': 'properties.requireHttps', 'type': 'bool'}, - 'routes': {'key': 'properties.routes', 'type': 'HttpSettingsRoutes'}, - 'forward_proxy': {'key': 'properties.forwardProxy', 'type': 'ForwardProxy'}, + 'require_https': {'key': 'requireHttps', 'type': 'bool'}, + 'routes': {'key': 'routes', 'type': 'HttpSettingsRoutes'}, + 'forward_proxy': {'key': 'forwardProxy', 'type': 'ForwardProxy'}, } def __init__( self, *, - kind: Optional[str] = None, require_https: Optional[bool] = None, routes: Optional["HttpSettingsRoutes"] = None, forward_proxy: Optional["ForwardProxy"] = None, **kwargs ): - super(HttpSettings, self).__init__(kind=kind, **kwargs) + super(HttpSettings, self).__init__(**kwargs) self.require_https = require_https self.routes = routes self.forward_proxy = forward_proxy -class HttpSettingsRoutes(ProxyOnlyResource): +class HttpSettingsRoutes(msrest.serialization.Model): """The configuration settings of the paths HTTP requests. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param api_prefix: The prefix that should precede all the authentication/authorization paths. :type api_prefix: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'api_prefix': {'key': 'properties.apiPrefix', 'type': 'str'}, + 'api_prefix': {'key': 'apiPrefix', 'type': 'str'}, } def __init__( self, *, - kind: Optional[str] = None, api_prefix: Optional[str] = None, **kwargs ): - super(HttpSettingsRoutes, self).__init__(kind=kind, **kwargs) + super(HttpSettingsRoutes, self).__init__(**kwargs) self.api_prefix = api_prefix @@ -9490,19 +9024,9 @@ def __init__( self.next_link = None -class IdentityProviders(ProxyOnlyResource): +class IdentityProviders(msrest.serialization.Model): """The configuration settings of each of the identity providers used to configure App Service Authentication/Authorization. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param azure_active_directory: The configuration settings of the Azure Active directory provider. :type azure_active_directory: ~azure.mgmt.web.v2021_01_01.models.AzureActiveDirectory @@ -9512,69 +9036,58 @@ class IdentityProviders(ProxyOnlyResource): :type git_hub: ~azure.mgmt.web.v2021_01_01.models.GitHub :param google: The configuration settings of the Google provider. :type google: ~azure.mgmt.web.v2021_01_01.models.Google - :param twitter: The configuration settings of the Twitter provider. - :type twitter: ~azure.mgmt.web.v2021_01_01.models.Twitter - :param custom_open_id_connect_providers: The map of the name of the alias of each custom Open - ID Connect provider to the - configuration settings of the custom Open ID Connect provider. - :type custom_open_id_connect_providers: dict[str, - ~azure.mgmt.web.v2021_01_01.models.CustomOpenIdConnectProvider] :param legacy_microsoft_account: The configuration settings of the legacy Microsoft Account provider. :type legacy_microsoft_account: ~azure.mgmt.web.v2021_01_01.models.LegacyMicrosoftAccount + :param twitter: The configuration settings of the Twitter provider. + :type twitter: ~azure.mgmt.web.v2021_01_01.models.Twitter :param apple: The configuration settings of the Apple provider. :type apple: ~azure.mgmt.web.v2021_01_01.models.Apple :param azure_static_web_apps: The configuration settings of the Azure Static Web Apps provider. :type azure_static_web_apps: ~azure.mgmt.web.v2021_01_01.models.AzureStaticWebApps + :param custom_open_id_connect_providers: The map of the name of the alias of each custom Open + ID Connect provider to the + configuration settings of the custom Open ID Connect provider. + :type custom_open_id_connect_providers: dict[str, + ~azure.mgmt.web.v2021_01_01.models.CustomOpenIdConnectProvider] """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'azure_active_directory': {'key': 'properties.azureActiveDirectory', 'type': 'AzureActiveDirectory'}, - 'facebook': {'key': 'properties.facebook', 'type': 'Facebook'}, - 'git_hub': {'key': 'properties.gitHub', 'type': 'GitHub'}, - 'google': {'key': 'properties.google', 'type': 'Google'}, - 'twitter': {'key': 'properties.twitter', 'type': 'Twitter'}, - 'custom_open_id_connect_providers': {'key': 'properties.customOpenIdConnectProviders', 'type': '{CustomOpenIdConnectProvider}'}, - 'legacy_microsoft_account': {'key': 'properties.legacyMicrosoftAccount', 'type': 'LegacyMicrosoftAccount'}, - 'apple': {'key': 'properties.apple', 'type': 'Apple'}, - 'azure_static_web_apps': {'key': 'properties.azureStaticWebApps', 'type': 'AzureStaticWebApps'}, + 'azure_active_directory': {'key': 'azureActiveDirectory', 'type': 'AzureActiveDirectory'}, + 'facebook': {'key': 'facebook', 'type': 'Facebook'}, + 'git_hub': {'key': 'gitHub', 'type': 'GitHub'}, + 'google': {'key': 'google', 'type': 'Google'}, + 'legacy_microsoft_account': {'key': 'legacyMicrosoftAccount', 'type': 'LegacyMicrosoftAccount'}, + 'twitter': {'key': 'twitter', 'type': 'Twitter'}, + 'apple': {'key': 'apple', 'type': 'Apple'}, + 'azure_static_web_apps': {'key': 'azureStaticWebApps', 'type': 'AzureStaticWebApps'}, + 'custom_open_id_connect_providers': {'key': 'customOpenIdConnectProviders', 'type': '{CustomOpenIdConnectProvider}'}, } def __init__( self, *, - kind: Optional[str] = None, azure_active_directory: Optional["AzureActiveDirectory"] = None, facebook: Optional["Facebook"] = None, git_hub: Optional["GitHub"] = None, google: Optional["Google"] = None, - twitter: Optional["Twitter"] = None, - custom_open_id_connect_providers: Optional[Dict[str, "CustomOpenIdConnectProvider"]] = None, legacy_microsoft_account: Optional["LegacyMicrosoftAccount"] = None, + twitter: Optional["Twitter"] = None, apple: Optional["Apple"] = None, azure_static_web_apps: Optional["AzureStaticWebApps"] = None, + custom_open_id_connect_providers: Optional[Dict[str, "CustomOpenIdConnectProvider"]] = None, **kwargs ): - super(IdentityProviders, self).__init__(kind=kind, **kwargs) + super(IdentityProviders, self).__init__(**kwargs) self.azure_active_directory = azure_active_directory self.facebook = facebook self.git_hub = git_hub self.google = google - self.twitter = twitter - self.custom_open_id_connect_providers = custom_open_id_connect_providers self.legacy_microsoft_account = legacy_microsoft_account + self.twitter = twitter self.apple = apple self.azure_static_web_apps = azure_static_web_apps + self.custom_open_id_connect_providers = custom_open_id_connect_providers class InboundEnvironmentEndpoint(msrest.serialization.Model): @@ -9741,49 +9254,28 @@ def __init__( self.headers = headers -class JwtClaimChecks(ProxyOnlyResource): +class JwtClaimChecks(msrest.serialization.Model): """The configuration settings of the checks that should be made while validating the JWT Claims. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param allowed_groups: The list of the allowed groups. :type allowed_groups: list[str] :param allowed_client_applications: The list of the allowed client applications. :type allowed_client_applications: list[str] """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'allowed_groups': {'key': 'properties.allowedGroups', 'type': '[str]'}, - 'allowed_client_applications': {'key': 'properties.allowedClientApplications', 'type': '[str]'}, + 'allowed_groups': {'key': 'allowedGroups', 'type': '[str]'}, + 'allowed_client_applications': {'key': 'allowedClientApplications', 'type': '[str]'}, } def __init__( self, *, - kind: Optional[str] = None, allowed_groups: Optional[List[str]] = None, allowed_client_applications: Optional[List[str]] = None, **kwargs ): - super(JwtClaimChecks, self).__init__(kind=kind, **kwargs) + super(JwtClaimChecks, self).__init__(**kwargs) self.allowed_groups = allowed_groups self.allowed_client_applications = allowed_client_applications @@ -10100,19 +9592,9 @@ def __init__( self.type = None -class LegacyMicrosoftAccount(ProxyOnlyResource): +class LegacyMicrosoftAccount(msrest.serialization.Model): """The configuration settings of the legacy Microsoft Account provider. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str + :param enabled: :code:`false` if the legacy Microsoft Account provider should not be enabled despite the set registration; otherwise, :code:`true`. :type enabled: bool @@ -10126,34 +9608,23 @@ class LegacyMicrosoftAccount(ProxyOnlyResource): :type validation: ~azure.mgmt.web.v2021_01_01.models.AllowedAudiencesValidation """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'registration': {'key': 'properties.registration', 'type': 'ClientRegistration'}, - 'login': {'key': 'properties.login', 'type': 'LoginScopes'}, - 'validation': {'key': 'properties.validation', 'type': 'AllowedAudiencesValidation'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'ClientRegistration'}, + 'login': {'key': 'login', 'type': 'LoginScopes'}, + 'validation': {'key': 'validation', 'type': 'AllowedAudiencesValidation'}, } def __init__( self, *, - kind: Optional[str] = None, enabled: Optional[bool] = None, registration: Optional["ClientRegistration"] = None, login: Optional["LoginScopes"] = None, validation: Optional["AllowedAudiencesValidation"] = None, **kwargs ): - super(LegacyMicrosoftAccount, self).__init__(kind=kind, **kwargs) + super(LegacyMicrosoftAccount, self).__init__(**kwargs) self.enabled = enabled self.registration = registration self.login = login @@ -10277,19 +9748,9 @@ def __init__( self.shared_key = shared_key -class Login(ProxyOnlyResource): +class Login(msrest.serialization.Model): """The configuration settings of the login flow of users using App Service Authentication/Authorization. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param routes: The routes that specify the endpoints used for login and logout requests. :type routes: ~azure.mgmt.web.v2021_01_01.models.LoginRoutes :param token_store: The configuration settings of the token store. @@ -10308,29 +9769,18 @@ class Login(ProxyOnlyResource): :type nonce: ~azure.mgmt.web.v2021_01_01.models.Nonce """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'routes': {'key': 'properties.routes', 'type': 'LoginRoutes'}, - 'token_store': {'key': 'properties.tokenStore', 'type': 'TokenStore'}, - 'preserve_url_fragments_for_logins': {'key': 'properties.preserveUrlFragmentsForLogins', 'type': 'bool'}, - 'allowed_external_redirect_urls': {'key': 'properties.allowedExternalRedirectUrls', 'type': '[str]'}, - 'cookie_expiration': {'key': 'properties.cookieExpiration', 'type': 'CookieExpiration'}, - 'nonce': {'key': 'properties.nonce', 'type': 'Nonce'}, + 'routes': {'key': 'routes', 'type': 'LoginRoutes'}, + 'token_store': {'key': 'tokenStore', 'type': 'TokenStore'}, + 'preserve_url_fragments_for_logins': {'key': 'preserveUrlFragmentsForLogins', 'type': 'bool'}, + 'allowed_external_redirect_urls': {'key': 'allowedExternalRedirectUrls', 'type': '[str]'}, + 'cookie_expiration': {'key': 'cookieExpiration', 'type': 'CookieExpiration'}, + 'nonce': {'key': 'nonce', 'type': 'Nonce'}, } def __init__( self, *, - kind: Optional[str] = None, routes: Optional["LoginRoutes"] = None, token_store: Optional["TokenStore"] = None, preserve_url_fragments_for_logins: Optional[bool] = None, @@ -10339,7 +9789,7 @@ def __init__( nonce: Optional["Nonce"] = None, **kwargs ): - super(Login, self).__init__(kind=kind, **kwargs) + super(Login, self).__init__(**kwargs) self.routes = routes self.token_store = token_store self.preserve_url_fragments_for_logins = preserve_url_fragments_for_logins @@ -10348,87 +9798,45 @@ def __init__( self.nonce = nonce -class LoginRoutes(ProxyOnlyResource): +class LoginRoutes(msrest.serialization.Model): """The routes that specify the endpoints used for login and logout requests. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param logout_endpoint: The endpoint at which a logout request should be made. :type logout_endpoint: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'logout_endpoint': {'key': 'properties.logoutEndpoint', 'type': 'str'}, + 'logout_endpoint': {'key': 'logoutEndpoint', 'type': 'str'}, } def __init__( self, *, - kind: Optional[str] = None, logout_endpoint: Optional[str] = None, **kwargs ): - super(LoginRoutes, self).__init__(kind=kind, **kwargs) + super(LoginRoutes, self).__init__(**kwargs) self.logout_endpoint = logout_endpoint -class LoginScopes(ProxyOnlyResource): +class LoginScopes(msrest.serialization.Model): """The configuration settings of the login flow, including the scopes that should be requested. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param scopes: A list of the scopes that should be requested while authenticating. :type scopes: list[str] """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'scopes': {'key': 'properties.scopes', 'type': '[str]'}, + 'scopes': {'key': 'scopes', 'type': '[str]'}, } def __init__( self, *, - kind: Optional[str] = None, scopes: Optional[List[str]] = None, **kwargs ): - super(LoginScopes, self).__init__(kind=kind, **kwargs) + super(LoginScopes, self).__init__(**kwargs) self.scopes = scopes @@ -11131,19 +10539,9 @@ def __init__( self.message = message -class Nonce(ProxyOnlyResource): +class Nonce(msrest.serialization.Model): """The configuration settings of the nonce used in the login flow. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param validate_nonce: :code:`false` if the nonce should not be validated while completing the login flow; otherwise, :code:`true`. :type validate_nonce: bool @@ -11152,47 +10550,26 @@ class Nonce(ProxyOnlyResource): :type nonce_expiration_interval: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'validate_nonce': {'key': 'properties.validateNonce', 'type': 'bool'}, - 'nonce_expiration_interval': {'key': 'properties.nonceExpirationInterval', 'type': 'str'}, + 'validate_nonce': {'key': 'validateNonce', 'type': 'bool'}, + 'nonce_expiration_interval': {'key': 'nonceExpirationInterval', 'type': 'str'}, } def __init__( self, *, - kind: Optional[str] = None, validate_nonce: Optional[bool] = None, nonce_expiration_interval: Optional[str] = None, **kwargs ): - super(Nonce, self).__init__(kind=kind, **kwargs) + super(Nonce, self).__init__(**kwargs) self.validate_nonce = validate_nonce self.nonce_expiration_interval = nonce_expiration_interval -class OpenIdConnectClientCredential(ProxyOnlyResource): +class OpenIdConnectClientCredential(msrest.serialization.Model): """The authentication client credentials of the custom Open ID Connect provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param method: The method that should be used to authenticate the user. The only acceptable values to pass in are None and "ClientSecretPost". The default value is None. :type method: str @@ -11201,47 +10578,26 @@ class OpenIdConnectClientCredential(ProxyOnlyResource): :type client_secret_setting_name: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'method': {'key': 'properties.method', 'type': 'str'}, - 'client_secret_setting_name': {'key': 'properties.clientSecretSettingName', 'type': 'str'}, + 'method': {'key': 'method', 'type': 'str'}, + 'client_secret_setting_name': {'key': 'clientSecretSettingName', 'type': 'str'}, } def __init__( self, *, - kind: Optional[str] = None, method: Optional[str] = None, client_secret_setting_name: Optional[str] = None, **kwargs ): - super(OpenIdConnectClientCredential, self).__init__(kind=kind, **kwargs) + super(OpenIdConnectClientCredential, self).__init__(**kwargs) self.method = method self.client_secret_setting_name = client_secret_setting_name -class OpenIdConnectConfig(ProxyOnlyResource): +class OpenIdConnectConfig(msrest.serialization.Model): """The configuration settings of the endpoints used for the custom Open ID Connect provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param authorization_endpoint: The endpoint to be used to make an authorization request. :type authorization_endpoint: str :param token_endpoint: The endpoint to be used to request a token. @@ -11255,28 +10611,17 @@ class OpenIdConnectConfig(ProxyOnlyResource): :type well_known_open_id_configuration: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'authorization_endpoint': {'key': 'properties.authorizationEndpoint', 'type': 'str'}, - 'token_endpoint': {'key': 'properties.tokenEndpoint', 'type': 'str'}, - 'issuer': {'key': 'properties.issuer', 'type': 'str'}, - 'certification_uri': {'key': 'properties.certificationUri', 'type': 'str'}, - 'well_known_open_id_configuration': {'key': 'properties.wellKnownOpenIdConfiguration', 'type': 'str'}, + 'authorization_endpoint': {'key': 'authorizationEndpoint', 'type': 'str'}, + 'token_endpoint': {'key': 'tokenEndpoint', 'type': 'str'}, + 'issuer': {'key': 'issuer', 'type': 'str'}, + 'certification_uri': {'key': 'certificationUri', 'type': 'str'}, + 'well_known_open_id_configuration': {'key': 'wellKnownOpenIdConfiguration', 'type': 'str'}, } def __init__( self, *, - kind: Optional[str] = None, authorization_endpoint: Optional[str] = None, token_endpoint: Optional[str] = None, issuer: Optional[str] = None, @@ -11284,7 +10629,7 @@ def __init__( well_known_open_id_configuration: Optional[str] = None, **kwargs ): - super(OpenIdConnectConfig, self).__init__(kind=kind, **kwargs) + super(OpenIdConnectConfig, self).__init__(**kwargs) self.authorization_endpoint = authorization_endpoint self.token_endpoint = token_endpoint self.issuer = issuer @@ -11292,66 +10637,35 @@ def __init__( self.well_known_open_id_configuration = well_known_open_id_configuration -class OpenIdConnectLogin(ProxyOnlyResource): +class OpenIdConnectLogin(msrest.serialization.Model): """The configuration settings of the login flow of the custom Open ID Connect provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param name_claim_type: The name of the claim that contains the users name. :type name_claim_type: str :param scopes: A list of the scopes that should be requested while authenticating. :type scopes: list[str] """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'name_claim_type': {'key': 'properties.nameClaimType', 'type': 'str'}, - 'scopes': {'key': 'properties.scopes', 'type': '[str]'}, + 'name_claim_type': {'key': 'nameClaimType', 'type': 'str'}, + 'scopes': {'key': 'scopes', 'type': '[str]'}, } def __init__( self, *, - kind: Optional[str] = None, name_claim_type: Optional[str] = None, scopes: Optional[List[str]] = None, **kwargs ): - super(OpenIdConnectLogin, self).__init__(kind=kind, **kwargs) + super(OpenIdConnectLogin, self).__init__(**kwargs) self.name_claim_type = name_claim_type self.scopes = scopes -class OpenIdConnectRegistration(ProxyOnlyResource): +class OpenIdConnectRegistration(msrest.serialization.Model): """The configuration settings of the app registration for the custom Open ID Connect provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param client_id: The client id of the custom Open ID Connect provider. :type client_id: str :param client_credential: The authentication credentials of the custom Open ID Connect @@ -11362,32 +10676,21 @@ class OpenIdConnectRegistration(ProxyOnlyResource): :type open_id_connect_configuration: ~azure.mgmt.web.v2021_01_01.models.OpenIdConnectConfig """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'client_id': {'key': 'properties.clientId', 'type': 'str'}, - 'client_credential': {'key': 'properties.clientCredential', 'type': 'OpenIdConnectClientCredential'}, - 'open_id_connect_configuration': {'key': 'properties.openIdConnectConfiguration', 'type': 'OpenIdConnectConfig'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'client_credential': {'key': 'clientCredential', 'type': 'OpenIdConnectClientCredential'}, + 'open_id_connect_configuration': {'key': 'openIdConnectConfiguration', 'type': 'OpenIdConnectConfig'}, } def __init__( self, *, - kind: Optional[str] = None, client_id: Optional[str] = None, client_credential: Optional["OpenIdConnectClientCredential"] = None, open_id_connect_configuration: Optional["OpenIdConnectConfig"] = None, **kwargs ): - super(OpenIdConnectRegistration, self).__init__(kind=kind, **kwargs) + super(OpenIdConnectRegistration, self).__init__(**kwargs) self.client_id = client_id self.client_credential = client_credential self.open_id_connect_configuration = open_id_connect_configuration @@ -19434,19 +18737,9 @@ def __init__( self.next_link = None -class TokenStore(ProxyOnlyResource): +class TokenStore(msrest.serialization.Model): """The configuration settings of the token store. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`true` to durably store platform-specific security tokens that are obtained during login flows; otherwise, :code:`false`. The default is :code:`false`. @@ -19463,34 +18756,23 @@ class TokenStore(ProxyOnlyResource): :type azure_blob_storage: ~azure.mgmt.web.v2021_01_01.models.BlobStorageTokenStore """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'token_refresh_extension_hours': {'key': 'properties.tokenRefreshExtensionHours', 'type': 'float'}, - 'file_system': {'key': 'properties.fileSystem', 'type': 'FileSystemTokenStore'}, - 'azure_blob_storage': {'key': 'properties.azureBlobStorage', 'type': 'BlobStorageTokenStore'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'token_refresh_extension_hours': {'key': 'tokenRefreshExtensionHours', 'type': 'float'}, + 'file_system': {'key': 'fileSystem', 'type': 'FileSystemTokenStore'}, + 'azure_blob_storage': {'key': 'azureBlobStorage', 'type': 'BlobStorageTokenStore'}, } def __init__( self, *, - kind: Optional[str] = None, enabled: Optional[bool] = None, token_refresh_extension_hours: Optional[float] = None, file_system: Optional["FileSystemTokenStore"] = None, azure_blob_storage: Optional["BlobStorageTokenStore"] = None, **kwargs ): - super(TokenStore, self).__init__(kind=kind, **kwargs) + super(TokenStore, self).__init__(**kwargs) self.enabled = enabled self.token_refresh_extension_hours = token_refresh_extension_hours self.file_system = file_system @@ -19891,19 +19173,9 @@ def __init__( self.next_link = None -class Twitter(ProxyOnlyResource): +class Twitter(msrest.serialization.Model): """The configuration settings of the Twitter provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`false` if the Twitter provider should not be enabled despite the set registration; otherwise, :code:`true`. :type enabled: bool @@ -19912,47 +19184,26 @@ class Twitter(ProxyOnlyResource): :type registration: ~azure.mgmt.web.v2021_01_01.models.TwitterRegistration """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'registration': {'key': 'properties.registration', 'type': 'TwitterRegistration'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'TwitterRegistration'}, } def __init__( self, *, - kind: Optional[str] = None, enabled: Optional[bool] = None, registration: Optional["TwitterRegistration"] = None, **kwargs ): - super(Twitter, self).__init__(kind=kind, **kwargs) + super(Twitter, self).__init__(**kwargs) self.enabled = enabled self.registration = registration -class TwitterRegistration(ProxyOnlyResource): +class TwitterRegistration(msrest.serialization.Model): """The configuration settings of the app registration for the Twitter provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param consumer_key: The OAuth 1.0a consumer key of the Twitter application used for sign-in. This setting is required for enabling Twitter Sign-In. Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in. @@ -19963,30 +19214,19 @@ class TwitterRegistration(ProxyOnlyResource): :type consumer_secret_setting_name: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'consumer_key': {'key': 'properties.consumerKey', 'type': 'str'}, - 'consumer_secret_setting_name': {'key': 'properties.consumerSecretSettingName', 'type': 'str'}, + 'consumer_key': {'key': 'consumerKey', 'type': 'str'}, + 'consumer_secret_setting_name': {'key': 'consumerSecretSettingName', 'type': 'str'}, } def __init__( self, *, - kind: Optional[str] = None, consumer_key: Optional[str] = None, consumer_secret_setting_name: Optional[str] = None, **kwargs ): - super(TwitterRegistration, self).__init__(kind=kind, **kwargs) + super(TwitterRegistration, self).__init__(**kwargs) self.consumer_key = consumer_key self.consumer_secret_setting_name = consumer_secret_setting_name diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_01_15/_version.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_01_15/_version.py index 77f53a3589c6..34ea7990c4b4 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_01_15/_version.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_01_15/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "4.0.0" +VERSION = "5.0.0" diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_01_15/models/_models.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_01_15/models/_models.py index 91557d23b2c8..c92ab53f952b 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_01_15/models/_models.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_01_15/models/_models.py @@ -181,35 +181,16 @@ def __init__( self.vip_mappings = kwargs.get('vip_mappings', None) -class AllowedAudiencesValidation(ProxyOnlyResource): - """AllowedAudiencesValidation. +class AllowedAudiencesValidation(msrest.serialization.Model): + """The configuration settings of the Allowed Audiences validation flow. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str - :param allowed_audiences: + :param allowed_audiences: The configuration settings of the allowed list of audiences from + which to validate the JWT token. :type allowed_audiences: list[str] """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'allowed_audiences': {'key': 'properties.allowedAudiences', 'type': '[str]'}, + 'allowed_audiences': {'key': 'allowedAudiences', 'type': '[str]'}, } def __init__( @@ -471,19 +452,9 @@ def __init__( self.is_default_off = None -class Apple(ProxyOnlyResource): +class Apple(msrest.serialization.Model): """The configuration settings of the Apple provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`false` if the Apple provider should not be enabled despite the set registration; otherwise, :code:`true`. :type enabled: bool @@ -493,20 +464,10 @@ class Apple(ProxyOnlyResource): :type login: ~azure.mgmt.web.v2021_01_15.models.LoginScopes """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'registration': {'key': 'properties.registration', 'type': 'AppleRegistration'}, - 'login': {'key': 'properties.login', 'type': 'LoginScopes'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'AppleRegistration'}, + 'login': {'key': 'login', 'type': 'LoginScopes'}, } def __init__( @@ -519,38 +480,18 @@ def __init__( self.login = kwargs.get('login', None) -class AppleRegistration(ProxyOnlyResource): +class AppleRegistration(msrest.serialization.Model): """The configuration settings of the registration for the Apple provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param client_id: The Client ID of the app used for login. :type client_id: str :param client_secret_setting_name: The app setting name that contains the client secret. :type client_secret_setting_name: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'client_id': {'key': 'properties.clientId', 'type': 'str'}, - 'client_secret_setting_name': {'key': 'properties.clientSecretSettingName', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'client_secret_setting_name': {'key': 'clientSecretSettingName', 'type': 'str'}, } def __init__( @@ -746,38 +687,18 @@ def __init__( self.log_analytics_configuration = kwargs.get('log_analytics_configuration', None) -class AppRegistration(ProxyOnlyResource): +class AppRegistration(msrest.serialization.Model): """The configuration settings of the app registration for providers that have app ids and app secrets. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param app_id: The App ID of the app used for login. :type app_id: str :param app_secret_setting_name: The app setting name that contains the app secret. :type app_secret_setting_name: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'app_id': {'key': 'properties.appId', 'type': 'str'}, - 'app_secret_setting_name': {'key': 'properties.appSecretSettingName', 'type': 'str'}, + 'app_id': {'key': 'appId', 'type': 'str'}, + 'app_secret_setting_name': {'key': 'appSecretSettingName', 'type': 'str'}, } def __init__( @@ -2241,19 +2162,9 @@ def __init__( self.allow_new_private_endpoint_connections = kwargs.get('allow_new_private_endpoint_connections', None) -class AuthPlatform(ProxyOnlyResource): +class AuthPlatform(msrest.serialization.Model): """The configuration settings of the platform of App Service Authentication/Authorization. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`true` if the Authentication / Authorization feature is enabled for the current app; otherwise, :code:`false`. :type enabled: bool @@ -2268,20 +2179,10 @@ class AuthPlatform(ProxyOnlyResource): :type config_file_path: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'runtime_version': {'key': 'properties.runtimeVersion', 'type': 'str'}, - 'config_file_path': {'key': 'properties.configFilePath', 'type': 'str'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, + 'config_file_path': {'key': 'configFilePath', 'type': 'str'}, } def __init__( @@ -2410,19 +2311,9 @@ def __init__( self.status_codes_range = kwargs.get('status_codes_range', None) -class AzureActiveDirectory(ProxyOnlyResource): +class AzureActiveDirectory(msrest.serialization.Model): """The configuration settings of the Azure Active directory provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`false` if the Azure Active Directory provider should not be enabled despite the set registration; otherwise, :code:`true`. :type enabled: bool @@ -2441,22 +2332,12 @@ class AzureActiveDirectory(ProxyOnlyResource): :type is_auto_provisioned: bool """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'registration': {'key': 'properties.registration', 'type': 'AzureActiveDirectoryRegistration'}, - 'login': {'key': 'properties.login', 'type': 'AzureActiveDirectoryLogin'}, - 'validation': {'key': 'properties.validation', 'type': 'AzureActiveDirectoryValidation'}, - 'is_auto_provisioned': {'key': 'properties.isAutoProvisioned', 'type': 'bool'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'AzureActiveDirectoryRegistration'}, + 'login': {'key': 'login', 'type': 'AzureActiveDirectoryLogin'}, + 'validation': {'key': 'validation', 'type': 'AzureActiveDirectoryValidation'}, + 'is_auto_provisioned': {'key': 'isAutoProvisioned', 'type': 'bool'}, } def __init__( @@ -2471,40 +2352,21 @@ def __init__( self.is_auto_provisioned = kwargs.get('is_auto_provisioned', None) -class AzureActiveDirectoryLogin(ProxyOnlyResource): +class AzureActiveDirectoryLogin(msrest.serialization.Model): """The configuration settings of the Azure Active Directory login flow. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str - :param disable_www_authenticate: - :type disable_www_authenticate: bool :param login_parameters: Login parameters to send to the OpenID Connect authorization endpoint when a user logs in. Each parameter must be in the form "key=value". :type login_parameters: list[str] + :param disable_www_authenticate: :code:`true` if the www-authenticate provider + should be omitted from the request; otherwise, :code:`false`. + :type disable_www_authenticate: bool """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'disable_www_authenticate': {'key': 'properties.disableWWWAuthenticate', 'type': 'bool'}, - 'login_parameters': {'key': 'properties.loginParameters', 'type': '[str]'}, + 'login_parameters': {'key': 'loginParameters', 'type': '[str]'}, + 'disable_www_authenticate': {'key': 'disableWWWAuthenticate', 'type': 'bool'}, } def __init__( @@ -2512,23 +2374,13 @@ def __init__( **kwargs ): super(AzureActiveDirectoryLogin, self).__init__(**kwargs) - self.disable_www_authenticate = kwargs.get('disable_www_authenticate', None) self.login_parameters = kwargs.get('login_parameters', None) + self.disable_www_authenticate = kwargs.get('disable_www_authenticate', None) -class AzureActiveDirectoryRegistration(ProxyOnlyResource): +class AzureActiveDirectoryRegistration(msrest.serialization.Model): """The configuration settings of the Azure Active Directory app registration. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param open_id_issuer: The OpenID Connect Issuer URI that represents the entity which issues access tokens for this application. When using Azure Active Directory, this value is the URI of the directory tenant, e.g. @@ -2550,23 +2402,24 @@ class AzureActiveDirectoryRegistration(ProxyOnlyResource): thumbprint of a certificate used for signing purposes. This property acts as a replacement for the Client Secret. It is also optional. :type client_secret_certificate_thumbprint: str + :param client_secret_certificate_subject_alternative_name: An alternative to the client secret + thumbprint, that is the subject alternative name of a certificate used for signing purposes. + This property acts as + a replacement for the Client Secret Certificate Thumbprint. It is also optional. + :type client_secret_certificate_subject_alternative_name: str + :param client_secret_certificate_issuer: An alternative to the client secret thumbprint, that + is the issuer of a certificate used for signing purposes. This property acts as + a replacement for the Client Secret Certificate Thumbprint. It is also optional. + :type client_secret_certificate_issuer: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'open_id_issuer': {'key': 'properties.openIdIssuer', 'type': 'str'}, - 'client_id': {'key': 'properties.clientId', 'type': 'str'}, - 'client_secret_setting_name': {'key': 'properties.clientSecretSettingName', 'type': 'str'}, - 'client_secret_certificate_thumbprint': {'key': 'properties.clientSecretCertificateThumbprint', 'type': 'str'}, + 'open_id_issuer': {'key': 'openIdIssuer', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'client_secret_setting_name': {'key': 'clientSecretSettingName', 'type': 'str'}, + 'client_secret_certificate_thumbprint': {'key': 'clientSecretCertificateThumbprint', 'type': 'str'}, + 'client_secret_certificate_subject_alternative_name': {'key': 'clientSecretCertificateSubjectAlternativeName', 'type': 'str'}, + 'client_secret_certificate_issuer': {'key': 'clientSecretCertificateIssuer', 'type': 'str'}, } def __init__( @@ -2578,21 +2431,13 @@ def __init__( self.client_id = kwargs.get('client_id', None) self.client_secret_setting_name = kwargs.get('client_secret_setting_name', None) self.client_secret_certificate_thumbprint = kwargs.get('client_secret_certificate_thumbprint', None) + self.client_secret_certificate_subject_alternative_name = kwargs.get('client_secret_certificate_subject_alternative_name', None) + self.client_secret_certificate_issuer = kwargs.get('client_secret_certificate_issuer', None) -class AzureActiveDirectoryValidation(ProxyOnlyResource): +class AzureActiveDirectoryValidation(msrest.serialization.Model): """The configuration settings of the Azure Active Directory token validation flow. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param jwt_claim_checks: The configuration settings of the checks that should be made while validating the JWT Claims. :type jwt_claim_checks: ~azure.mgmt.web.v2021_01_15.models.JwtClaimChecks @@ -2601,19 +2446,9 @@ class AzureActiveDirectoryValidation(ProxyOnlyResource): :type allowed_audiences: list[str] """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'jwt_claim_checks': {'key': 'properties.jwtClaimChecks', 'type': 'JwtClaimChecks'}, - 'allowed_audiences': {'key': 'properties.allowedAudiences', 'type': '[str]'}, + 'jwt_claim_checks': {'key': 'jwtClaimChecks', 'type': 'JwtClaimChecks'}, + 'allowed_audiences': {'key': 'allowedAudiences', 'type': '[str]'}, } def __init__( @@ -2685,19 +2520,9 @@ def __init__( self.enabled = kwargs.get('enabled', None) -class AzureStaticWebApps(ProxyOnlyResource): +class AzureStaticWebApps(msrest.serialization.Model): """The configuration settings of the Azure Static Web Apps provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`false` if the Azure Static Web Apps provider should not be enabled despite the set registration; otherwise, :code:`true`. :type enabled: bool @@ -2705,19 +2530,9 @@ class AzureStaticWebApps(ProxyOnlyResource): :type registration: ~azure.mgmt.web.v2021_01_15.models.AzureStaticWebAppsRegistration """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'registration': {'key': 'properties.registration', 'type': 'AzureStaticWebAppsRegistration'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'AzureStaticWebAppsRegistration'}, } def __init__( @@ -2729,35 +2544,15 @@ def __init__( self.registration = kwargs.get('registration', None) -class AzureStaticWebAppsRegistration(ProxyOnlyResource): +class AzureStaticWebAppsRegistration(msrest.serialization.Model): """The configuration settings of the registration for the Azure Static Web Apps provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param client_id: The Client ID of the app used for login. :type client_id: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'client_id': {'key': 'properties.clientId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, } def __init__( @@ -3230,36 +3025,16 @@ def __init__( self.next_link = None -class BlobStorageTokenStore(ProxyOnlyResource): +class BlobStorageTokenStore(msrest.serialization.Model): """The configuration settings of the storage of the tokens if blob storage is used. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param sas_url_setting_name: The name of the app setting containing the SAS URL of the blob storage containing the tokens. :type sas_url_setting_name: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'sas_url_setting_name': {'key': 'properties.sasUrlSettingName', 'type': 'str'}, + 'sas_url_setting_name': {'key': 'sasUrlSettingName', 'type': 'str'}, } def __init__( @@ -3806,38 +3581,18 @@ def __init__( self.domain_validation_method = kwargs.get('domain_validation_method', None) -class ClientRegistration(ProxyOnlyResource): +class ClientRegistration(msrest.serialization.Model): """The configuration settings of the app registration for providers that have client ids and client secrets. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param client_id: The Client ID of the app used for login. :type client_id: str :param client_secret_setting_name: The app setting name that contains the client secret. :type client_secret_setting_name: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'client_id': {'key': 'properties.clientId', 'type': 'str'}, - 'client_secret_setting_name': {'key': 'properties.clientSecretSettingName', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'client_secret_setting_name': {'key': 'clientSecretSettingName', 'type': 'str'}, } def __init__( @@ -4409,40 +4164,20 @@ def __init__( self.next_link = None -class CookieExpiration(ProxyOnlyResource): +class CookieExpiration(msrest.serialization.Model): """The configuration settings of the session cookie's expiration. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param convention: The convention used when determining the session cookie's expiration. Possible values include: "FixedTime", "IdentityProviderDerived". :type convention: str or ~azure.mgmt.web.v2021_01_15.models.CookieExpirationConvention :param time_to_expiration: The time after the request is made when the session cookie should expire. - :type time_to_expiration: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } + :type time_to_expiration: str + """ _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'convention': {'key': 'properties.convention', 'type': 'str'}, - 'time_to_expiration': {'key': 'properties.timeToExpiration', 'type': 'str'}, + 'convention': {'key': 'convention', 'type': 'str'}, + 'time_to_expiration': {'key': 'timeToExpiration', 'type': 'str'}, } def __init__( @@ -4884,19 +4619,9 @@ def __init__( self.alternate_txt_records = kwargs.get('alternate_txt_records', None) -class CustomOpenIdConnectProvider(ProxyOnlyResource): +class CustomOpenIdConnectProvider(msrest.serialization.Model): """The configuration settings of the custom Open ID Connect provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`false` if the custom Open ID provider provider should not be enabled; otherwise, :code:`true`. :type enabled: bool @@ -4908,20 +4633,10 @@ class CustomOpenIdConnectProvider(ProxyOnlyResource): :type login: ~azure.mgmt.web.v2021_01_15.models.OpenIdConnectLogin """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'registration': {'key': 'properties.registration', 'type': 'OpenIdConnectRegistration'}, - 'login': {'key': 'properties.login', 'type': 'OpenIdConnectLogin'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'OpenIdConnectRegistration'}, + 'login': {'key': 'login', 'type': 'OpenIdConnectLogin'}, } def __init__( @@ -6804,19 +6519,9 @@ def __init__( self.type = None -class Facebook(ProxyOnlyResource): +class Facebook(msrest.serialization.Model): """The configuration settings of the Facebook provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`false` if the Facebook provider should not be enabled despite the set registration; otherwise, :code:`true`. :type enabled: bool @@ -6829,21 +6534,11 @@ class Facebook(ProxyOnlyResource): :type login: ~azure.mgmt.web.v2021_01_15.models.LoginScopes """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'registration': {'key': 'properties.registration', 'type': 'AppRegistration'}, - 'graph_api_version': {'key': 'properties.graphApiVersion', 'type': 'str'}, - 'login': {'key': 'properties.login', 'type': 'LoginScopes'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'AppRegistration'}, + 'graph_api_version': {'key': 'graphApiVersion', 'type': 'str'}, + 'login': {'key': 'login', 'type': 'LoginScopes'}, } def __init__( @@ -6913,35 +6608,15 @@ def __init__( self.enabled = kwargs.get('enabled', None) -class FileSystemTokenStore(ProxyOnlyResource): +class FileSystemTokenStore(msrest.serialization.Model): """The configuration settings of the storage of the tokens if a file system is used. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param directory: The directory in which the tokens will be stored. :type directory: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'directory': {'key': 'properties.directory', 'type': 'str'}, + 'directory': {'key': 'directory', 'type': 'str'}, } def __init__( @@ -6952,19 +6627,9 @@ def __init__( self.directory = kwargs.get('directory', None) -class ForwardProxy(ProxyOnlyResource): +class ForwardProxy(msrest.serialization.Model): """The configuration settings of a forward proxy used to make the requests. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param convention: The convention used to determine the url of the request made. Possible values include: "NoProxy", "Standard", "Custom". :type convention: str or ~azure.mgmt.web.v2021_01_15.models.ForwardProxyConvention @@ -6974,20 +6639,10 @@ class ForwardProxy(ProxyOnlyResource): :type custom_proto_header_name: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'convention': {'key': 'properties.convention', 'type': 'str'}, - 'custom_host_header_name': {'key': 'properties.customHostHeaderName', 'type': 'str'}, - 'custom_proto_header_name': {'key': 'properties.customProtoHeaderName', 'type': 'str'}, + 'convention': {'key': 'convention', 'type': 'str'}, + 'custom_host_header_name': {'key': 'customHostHeaderName', 'type': 'str'}, + 'custom_proto_header_name': {'key': 'customProtoHeaderName', 'type': 'str'}, } def __init__( @@ -7538,19 +7193,9 @@ def __init__( self.next_link = None -class GitHub(ProxyOnlyResource): +class GitHub(msrest.serialization.Model): """The configuration settings of the GitHub provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`false` if the GitHub provider should not be enabled despite the set registration; otherwise, :code:`true`. :type enabled: bool @@ -7561,20 +7206,10 @@ class GitHub(ProxyOnlyResource): :type login: ~azure.mgmt.web.v2021_01_15.models.LoginScopes """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'registration': {'key': 'properties.registration', 'type': 'ClientRegistration'}, - 'login': {'key': 'properties.login', 'type': 'LoginScopes'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'ClientRegistration'}, + 'login': {'key': 'login', 'type': 'LoginScopes'}, } def __init__( @@ -7750,19 +7385,9 @@ def __init__( self.capabilities = kwargs.get('capabilities', None) -class GlobalValidation(ProxyOnlyResource): +class GlobalValidation(msrest.serialization.Model): """The configuration settings that determines the validation flow of users using App Service Authentication/Authorization. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param require_authentication: :code:`true` if the authentication flow is required any request is made; otherwise, :code:`false`. :type require_authentication: bool @@ -7782,21 +7407,11 @@ class GlobalValidation(ProxyOnlyResource): :type excluded_paths: list[str] """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'require_authentication': {'key': 'properties.requireAuthentication', 'type': 'bool'}, - 'unauthenticated_client_action': {'key': 'properties.unauthenticatedClientAction', 'type': 'str'}, - 'redirect_to_provider': {'key': 'properties.redirectToProvider', 'type': 'str'}, - 'excluded_paths': {'key': 'properties.excludedPaths', 'type': '[str]'}, + 'require_authentication': {'key': 'requireAuthentication', 'type': 'bool'}, + 'unauthenticated_client_action': {'key': 'unauthenticatedClientAction', 'type': 'str'}, + 'redirect_to_provider': {'key': 'redirectToProvider', 'type': 'str'}, + 'excluded_paths': {'key': 'excludedPaths', 'type': '[str]'}, } def __init__( @@ -7810,19 +7425,9 @@ def __init__( self.excluded_paths = kwargs.get('excluded_paths', None) -class Google(ProxyOnlyResource): +class Google(msrest.serialization.Model): """The configuration settings of the Google provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`false` if the Google provider should not be enabled despite the set registration; otherwise, :code:`true`. :type enabled: bool @@ -7836,21 +7441,11 @@ class Google(ProxyOnlyResource): :type validation: ~azure.mgmt.web.v2021_01_15.models.AllowedAudiencesValidation """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'registration': {'key': 'properties.registration', 'type': 'ClientRegistration'}, - 'login': {'key': 'properties.login', 'type': 'LoginScopes'}, - 'validation': {'key': 'properties.validation', 'type': 'AllowedAudiencesValidation'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'ClientRegistration'}, + 'login': {'key': 'login', 'type': 'LoginScopes'}, + 'validation': {'key': 'validation', 'type': 'AllowedAudiencesValidation'}, } def __init__( @@ -8217,19 +7812,9 @@ def __init__( self.azure_blob_storage = kwargs.get('azure_blob_storage', None) -class HttpSettings(ProxyOnlyResource): +class HttpSettings(msrest.serialization.Model): """The configuration settings of the HTTP requests for authentication and authorization requests made against App Service Authentication/Authorization. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param require_https: :code:`false` if the authentication/authorization responses not having the HTTPS scheme are permissible; otherwise, :code:`true`. :type require_https: bool @@ -8239,20 +7824,10 @@ class HttpSettings(ProxyOnlyResource): :type forward_proxy: ~azure.mgmt.web.v2021_01_15.models.ForwardProxy """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'require_https': {'key': 'properties.requireHttps', 'type': 'bool'}, - 'routes': {'key': 'properties.routes', 'type': 'HttpSettingsRoutes'}, - 'forward_proxy': {'key': 'properties.forwardProxy', 'type': 'ForwardProxy'}, + 'require_https': {'key': 'requireHttps', 'type': 'bool'}, + 'routes': {'key': 'routes', 'type': 'HttpSettingsRoutes'}, + 'forward_proxy': {'key': 'forwardProxy', 'type': 'ForwardProxy'}, } def __init__( @@ -8265,35 +7840,15 @@ def __init__( self.forward_proxy = kwargs.get('forward_proxy', None) -class HttpSettingsRoutes(ProxyOnlyResource): +class HttpSettingsRoutes(msrest.serialization.Model): """The configuration settings of the paths HTTP requests. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param api_prefix: The prefix that should precede all the authentication/authorization paths. :type api_prefix: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'api_prefix': {'key': 'properties.apiPrefix', 'type': 'str'}, + 'api_prefix': {'key': 'apiPrefix', 'type': 'str'}, } def __init__( @@ -8568,19 +8123,9 @@ def __init__( self.next_link = None -class IdentityProviders(ProxyOnlyResource): +class IdentityProviders(msrest.serialization.Model): """The configuration settings of each of the identity providers used to configure App Service Authentication/Authorization. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param azure_active_directory: The configuration settings of the Azure Active directory provider. :type azure_active_directory: ~azure.mgmt.web.v2021_01_15.models.AzureActiveDirectory @@ -8590,42 +8135,32 @@ class IdentityProviders(ProxyOnlyResource): :type git_hub: ~azure.mgmt.web.v2021_01_15.models.GitHub :param google: The configuration settings of the Google provider. :type google: ~azure.mgmt.web.v2021_01_15.models.Google - :param twitter: The configuration settings of the Twitter provider. - :type twitter: ~azure.mgmt.web.v2021_01_15.models.Twitter - :param custom_open_id_connect_providers: The map of the name of the alias of each custom Open - ID Connect provider to the - configuration settings of the custom Open ID Connect provider. - :type custom_open_id_connect_providers: dict[str, - ~azure.mgmt.web.v2021_01_15.models.CustomOpenIdConnectProvider] :param legacy_microsoft_account: The configuration settings of the legacy Microsoft Account provider. :type legacy_microsoft_account: ~azure.mgmt.web.v2021_01_15.models.LegacyMicrosoftAccount + :param twitter: The configuration settings of the Twitter provider. + :type twitter: ~azure.mgmt.web.v2021_01_15.models.Twitter :param apple: The configuration settings of the Apple provider. :type apple: ~azure.mgmt.web.v2021_01_15.models.Apple :param azure_static_web_apps: The configuration settings of the Azure Static Web Apps provider. :type azure_static_web_apps: ~azure.mgmt.web.v2021_01_15.models.AzureStaticWebApps + :param custom_open_id_connect_providers: The map of the name of the alias of each custom Open + ID Connect provider to the + configuration settings of the custom Open ID Connect provider. + :type custom_open_id_connect_providers: dict[str, + ~azure.mgmt.web.v2021_01_15.models.CustomOpenIdConnectProvider] """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'azure_active_directory': {'key': 'properties.azureActiveDirectory', 'type': 'AzureActiveDirectory'}, - 'facebook': {'key': 'properties.facebook', 'type': 'Facebook'}, - 'git_hub': {'key': 'properties.gitHub', 'type': 'GitHub'}, - 'google': {'key': 'properties.google', 'type': 'Google'}, - 'twitter': {'key': 'properties.twitter', 'type': 'Twitter'}, - 'custom_open_id_connect_providers': {'key': 'properties.customOpenIdConnectProviders', 'type': '{CustomOpenIdConnectProvider}'}, - 'legacy_microsoft_account': {'key': 'properties.legacyMicrosoftAccount', 'type': 'LegacyMicrosoftAccount'}, - 'apple': {'key': 'properties.apple', 'type': 'Apple'}, - 'azure_static_web_apps': {'key': 'properties.azureStaticWebApps', 'type': 'AzureStaticWebApps'}, + 'azure_active_directory': {'key': 'azureActiveDirectory', 'type': 'AzureActiveDirectory'}, + 'facebook': {'key': 'facebook', 'type': 'Facebook'}, + 'git_hub': {'key': 'gitHub', 'type': 'GitHub'}, + 'google': {'key': 'google', 'type': 'Google'}, + 'legacy_microsoft_account': {'key': 'legacyMicrosoftAccount', 'type': 'LegacyMicrosoftAccount'}, + 'twitter': {'key': 'twitter', 'type': 'Twitter'}, + 'apple': {'key': 'apple', 'type': 'Apple'}, + 'azure_static_web_apps': {'key': 'azureStaticWebApps', 'type': 'AzureStaticWebApps'}, + 'custom_open_id_connect_providers': {'key': 'customOpenIdConnectProviders', 'type': '{CustomOpenIdConnectProvider}'}, } def __init__( @@ -8637,11 +8172,11 @@ def __init__( self.facebook = kwargs.get('facebook', None) self.git_hub = kwargs.get('git_hub', None) self.google = kwargs.get('google', None) - self.twitter = kwargs.get('twitter', None) - self.custom_open_id_connect_providers = kwargs.get('custom_open_id_connect_providers', None) self.legacy_microsoft_account = kwargs.get('legacy_microsoft_account', None) + self.twitter = kwargs.get('twitter', None) self.apple = kwargs.get('apple', None) self.azure_static_web_apps = kwargs.get('azure_static_web_apps', None) + self.custom_open_id_connect_providers = kwargs.get('custom_open_id_connect_providers', None) class InboundEnvironmentEndpoint(msrest.serialization.Model): @@ -8790,38 +8325,18 @@ def __init__( self.headers = kwargs.get('headers', None) -class JwtClaimChecks(ProxyOnlyResource): +class JwtClaimChecks(msrest.serialization.Model): """The configuration settings of the checks that should be made while validating the JWT Claims. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param allowed_groups: The list of the allowed groups. :type allowed_groups: list[str] :param allowed_client_applications: The list of the allowed client applications. :type allowed_client_applications: list[str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'allowed_groups': {'key': 'properties.allowedGroups', 'type': '[str]'}, - 'allowed_client_applications': {'key': 'properties.allowedClientApplications', 'type': '[str]'}, + """ + + _attribute_map = { + 'allowed_groups': {'key': 'allowedGroups', 'type': '[str]'}, + 'allowed_client_applications': {'key': 'allowedClientApplications', 'type': '[str]'}, } def __init__( @@ -9121,19 +8636,9 @@ def __init__( self.type = None -class LegacyMicrosoftAccount(ProxyOnlyResource): +class LegacyMicrosoftAccount(msrest.serialization.Model): """The configuration settings of the legacy Microsoft Account provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`false` if the legacy Microsoft Account provider should not be enabled despite the set registration; otherwise, :code:`true`. :type enabled: bool @@ -9147,21 +8652,11 @@ class LegacyMicrosoftAccount(ProxyOnlyResource): :type validation: ~azure.mgmt.web.v2021_01_15.models.AllowedAudiencesValidation """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'registration': {'key': 'properties.registration', 'type': 'ClientRegistration'}, - 'login': {'key': 'properties.login', 'type': 'LoginScopes'}, - 'validation': {'key': 'properties.validation', 'type': 'AllowedAudiencesValidation'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'ClientRegistration'}, + 'login': {'key': 'login', 'type': 'LoginScopes'}, + 'validation': {'key': 'validation', 'type': 'AllowedAudiencesValidation'}, } def __init__( @@ -9286,19 +8781,9 @@ def __init__( self.shared_key = kwargs.get('shared_key', None) -class Login(ProxyOnlyResource): +class Login(msrest.serialization.Model): """The configuration settings of the login flow of users using App Service Authentication/Authorization. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param routes: The routes that specify the endpoints used for login and logout requests. :type routes: ~azure.mgmt.web.v2021_01_15.models.LoginRoutes :param token_store: The configuration settings of the token store. @@ -9317,23 +8802,13 @@ class Login(ProxyOnlyResource): :type nonce: ~azure.mgmt.web.v2021_01_15.models.Nonce """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'routes': {'key': 'properties.routes', 'type': 'LoginRoutes'}, - 'token_store': {'key': 'properties.tokenStore', 'type': 'TokenStore'}, - 'preserve_url_fragments_for_logins': {'key': 'properties.preserveUrlFragmentsForLogins', 'type': 'bool'}, - 'allowed_external_redirect_urls': {'key': 'properties.allowedExternalRedirectUrls', 'type': '[str]'}, - 'cookie_expiration': {'key': 'properties.cookieExpiration', 'type': 'CookieExpiration'}, - 'nonce': {'key': 'properties.nonce', 'type': 'Nonce'}, + 'routes': {'key': 'routes', 'type': 'LoginRoutes'}, + 'token_store': {'key': 'tokenStore', 'type': 'TokenStore'}, + 'preserve_url_fragments_for_logins': {'key': 'preserveUrlFragmentsForLogins', 'type': 'bool'}, + 'allowed_external_redirect_urls': {'key': 'allowedExternalRedirectUrls', 'type': '[str]'}, + 'cookie_expiration': {'key': 'cookieExpiration', 'type': 'CookieExpiration'}, + 'nonce': {'key': 'nonce', 'type': 'Nonce'}, } def __init__( @@ -9349,35 +8824,15 @@ def __init__( self.nonce = kwargs.get('nonce', None) -class LoginRoutes(ProxyOnlyResource): +class LoginRoutes(msrest.serialization.Model): """The routes that specify the endpoints used for login and logout requests. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param logout_endpoint: The endpoint at which a logout request should be made. :type logout_endpoint: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'logout_endpoint': {'key': 'properties.logoutEndpoint', 'type': 'str'}, + 'logout_endpoint': {'key': 'logoutEndpoint', 'type': 'str'}, } def __init__( @@ -9388,35 +8843,15 @@ def __init__( self.logout_endpoint = kwargs.get('logout_endpoint', None) -class LoginScopes(ProxyOnlyResource): +class LoginScopes(msrest.serialization.Model): """The configuration settings of the login flow, including the scopes that should be requested. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param scopes: A list of the scopes that should be requested while authenticating. :type scopes: list[str] """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'scopes': {'key': 'properties.scopes', 'type': '[str]'}, + 'scopes': {'key': 'scopes', 'type': '[str]'}, } def __init__( @@ -10065,19 +9500,9 @@ def __init__( self.message = kwargs.get('message', None) -class Nonce(ProxyOnlyResource): +class Nonce(msrest.serialization.Model): """The configuration settings of the nonce used in the login flow. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param validate_nonce: :code:`false` if the nonce should not be validated while completing the login flow; otherwise, :code:`true`. :type validate_nonce: bool @@ -10086,19 +9511,9 @@ class Nonce(ProxyOnlyResource): :type nonce_expiration_interval: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'validate_nonce': {'key': 'properties.validateNonce', 'type': 'bool'}, - 'nonce_expiration_interval': {'key': 'properties.nonceExpirationInterval', 'type': 'str'}, + 'validate_nonce': {'key': 'validateNonce', 'type': 'bool'}, + 'nonce_expiration_interval': {'key': 'nonceExpirationInterval', 'type': 'str'}, } def __init__( @@ -10110,19 +9525,9 @@ def __init__( self.nonce_expiration_interval = kwargs.get('nonce_expiration_interval', None) -class OpenIdConnectClientCredential(ProxyOnlyResource): +class OpenIdConnectClientCredential(msrest.serialization.Model): """The authentication client credentials of the custom Open ID Connect provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param method: The method that should be used to authenticate the user. The only acceptable values to pass in are None and "ClientSecretPost". The default value is None. :type method: str @@ -10131,19 +9536,9 @@ class OpenIdConnectClientCredential(ProxyOnlyResource): :type client_secret_setting_name: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'method': {'key': 'properties.method', 'type': 'str'}, - 'client_secret_setting_name': {'key': 'properties.clientSecretSettingName', 'type': 'str'}, + 'method': {'key': 'method', 'type': 'str'}, + 'client_secret_setting_name': {'key': 'clientSecretSettingName', 'type': 'str'}, } def __init__( @@ -10155,19 +9550,9 @@ def __init__( self.client_secret_setting_name = kwargs.get('client_secret_setting_name', None) -class OpenIdConnectConfig(ProxyOnlyResource): +class OpenIdConnectConfig(msrest.serialization.Model): """The configuration settings of the endpoints used for the custom Open ID Connect provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param authorization_endpoint: The endpoint to be used to make an authorization request. :type authorization_endpoint: str :param token_endpoint: The endpoint to be used to request a token. @@ -10181,22 +9566,12 @@ class OpenIdConnectConfig(ProxyOnlyResource): :type well_known_open_id_configuration: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'authorization_endpoint': {'key': 'properties.authorizationEndpoint', 'type': 'str'}, - 'token_endpoint': {'key': 'properties.tokenEndpoint', 'type': 'str'}, - 'issuer': {'key': 'properties.issuer', 'type': 'str'}, - 'certification_uri': {'key': 'properties.certificationUri', 'type': 'str'}, - 'well_known_open_id_configuration': {'key': 'properties.wellKnownOpenIdConfiguration', 'type': 'str'}, + 'authorization_endpoint': {'key': 'authorizationEndpoint', 'type': 'str'}, + 'token_endpoint': {'key': 'tokenEndpoint', 'type': 'str'}, + 'issuer': {'key': 'issuer', 'type': 'str'}, + 'certification_uri': {'key': 'certificationUri', 'type': 'str'}, + 'well_known_open_id_configuration': {'key': 'wellKnownOpenIdConfiguration', 'type': 'str'}, } def __init__( @@ -10211,38 +9586,18 @@ def __init__( self.well_known_open_id_configuration = kwargs.get('well_known_open_id_configuration', None) -class OpenIdConnectLogin(ProxyOnlyResource): +class OpenIdConnectLogin(msrest.serialization.Model): """The configuration settings of the login flow of the custom Open ID Connect provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param name_claim_type: The name of the claim that contains the users name. :type name_claim_type: str :param scopes: A list of the scopes that should be requested while authenticating. :type scopes: list[str] """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'name_claim_type': {'key': 'properties.nameClaimType', 'type': 'str'}, - 'scopes': {'key': 'properties.scopes', 'type': '[str]'}, + 'name_claim_type': {'key': 'nameClaimType', 'type': 'str'}, + 'scopes': {'key': 'scopes', 'type': '[str]'}, } def __init__( @@ -10254,19 +9609,9 @@ def __init__( self.scopes = kwargs.get('scopes', None) -class OpenIdConnectRegistration(ProxyOnlyResource): +class OpenIdConnectRegistration(msrest.serialization.Model): """The configuration settings of the app registration for the custom Open ID Connect provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param client_id: The client id of the custom Open ID Connect provider. :type client_id: str :param client_credential: The authentication credentials of the custom Open ID Connect @@ -10277,20 +9622,10 @@ class OpenIdConnectRegistration(ProxyOnlyResource): :type open_id_connect_configuration: ~azure.mgmt.web.v2021_01_15.models.OpenIdConnectConfig """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'client_id': {'key': 'properties.clientId', 'type': 'str'}, - 'client_credential': {'key': 'properties.clientCredential', 'type': 'OpenIdConnectClientCredential'}, - 'open_id_connect_configuration': {'key': 'properties.openIdConnectConfiguration', 'type': 'OpenIdConnectConfig'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'client_credential': {'key': 'clientCredential', 'type': 'OpenIdConnectClientCredential'}, + 'open_id_connect_configuration': {'key': 'openIdConnectConfiguration', 'type': 'OpenIdConnectConfig'}, } def __init__( @@ -17515,19 +16850,9 @@ def __init__( self.next_link = None -class TokenStore(ProxyOnlyResource): +class TokenStore(msrest.serialization.Model): """The configuration settings of the token store. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`true` to durably store platform-specific security tokens that are obtained during login flows; otherwise, :code:`false`. The default is :code:`false`. @@ -17544,21 +16869,11 @@ class TokenStore(ProxyOnlyResource): :type azure_blob_storage: ~azure.mgmt.web.v2021_01_15.models.BlobStorageTokenStore """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'token_refresh_extension_hours': {'key': 'properties.tokenRefreshExtensionHours', 'type': 'float'}, - 'file_system': {'key': 'properties.fileSystem', 'type': 'FileSystemTokenStore'}, - 'azure_blob_storage': {'key': 'properties.azureBlobStorage', 'type': 'BlobStorageTokenStore'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'token_refresh_extension_hours': {'key': 'tokenRefreshExtensionHours', 'type': 'float'}, + 'file_system': {'key': 'fileSystem', 'type': 'FileSystemTokenStore'}, + 'azure_blob_storage': {'key': 'azureBlobStorage', 'type': 'BlobStorageTokenStore'}, } def __init__( @@ -17926,19 +17241,9 @@ def __init__( self.next_link = None -class Twitter(ProxyOnlyResource): +class Twitter(msrest.serialization.Model): """The configuration settings of the Twitter provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`false` if the Twitter provider should not be enabled despite the set registration; otherwise, :code:`true`. :type enabled: bool @@ -17947,19 +17252,9 @@ class Twitter(ProxyOnlyResource): :type registration: ~azure.mgmt.web.v2021_01_15.models.TwitterRegistration """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'registration': {'key': 'properties.registration', 'type': 'TwitterRegistration'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'TwitterRegistration'}, } def __init__( @@ -17971,19 +17266,9 @@ def __init__( self.registration = kwargs.get('registration', None) -class TwitterRegistration(ProxyOnlyResource): +class TwitterRegistration(msrest.serialization.Model): """The configuration settings of the app registration for the Twitter provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param consumer_key: The OAuth 1.0a consumer key of the Twitter application used for sign-in. This setting is required for enabling Twitter Sign-In. Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in. @@ -17994,19 +17279,9 @@ class TwitterRegistration(ProxyOnlyResource): :type consumer_secret_setting_name: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'consumer_key': {'key': 'properties.consumerKey', 'type': 'str'}, - 'consumer_secret_setting_name': {'key': 'properties.consumerSecretSettingName', 'type': 'str'}, + 'consumer_key': {'key': 'consumerKey', 'type': 'str'}, + 'consumer_secret_setting_name': {'key': 'consumerSecretSettingName', 'type': 'str'}, } def __init__( diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_01_15/models/_models_py3.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_01_15/models/_models_py3.py index 468a4a15fb41..13e916cae940 100644 --- a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_01_15/models/_models_py3.py +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_01_15/models/_models_py3.py @@ -206,45 +206,25 @@ def __init__( self.vip_mappings = vip_mappings -class AllowedAudiencesValidation(ProxyOnlyResource): - """AllowedAudiencesValidation. +class AllowedAudiencesValidation(msrest.serialization.Model): + """The configuration settings of the Allowed Audiences validation flow. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str - :param allowed_audiences: + :param allowed_audiences: The configuration settings of the allowed list of audiences from + which to validate the JWT token. :type allowed_audiences: list[str] """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'allowed_audiences': {'key': 'properties.allowedAudiences', 'type': '[str]'}, + 'allowed_audiences': {'key': 'allowedAudiences', 'type': '[str]'}, } def __init__( self, *, - kind: Optional[str] = None, allowed_audiences: Optional[List[str]] = None, **kwargs ): - super(AllowedAudiencesValidation, self).__init__(kind=kind, **kwargs) + super(AllowedAudiencesValidation, self).__init__(**kwargs) self.allowed_audiences = allowed_audiences @@ -524,19 +504,9 @@ def __init__( self.is_default_off = None -class Apple(ProxyOnlyResource): +class Apple(msrest.serialization.Model): """The configuration settings of the Apple provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`false` if the Apple provider should not be enabled despite the set registration; otherwise, :code:`true`. :type enabled: bool @@ -546,80 +516,48 @@ class Apple(ProxyOnlyResource): :type login: ~azure.mgmt.web.v2021_01_15.models.LoginScopes """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'registration': {'key': 'properties.registration', 'type': 'AppleRegistration'}, - 'login': {'key': 'properties.login', 'type': 'LoginScopes'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'AppleRegistration'}, + 'login': {'key': 'login', 'type': 'LoginScopes'}, } def __init__( self, *, - kind: Optional[str] = None, enabled: Optional[bool] = None, registration: Optional["AppleRegistration"] = None, login: Optional["LoginScopes"] = None, **kwargs ): - super(Apple, self).__init__(kind=kind, **kwargs) + super(Apple, self).__init__(**kwargs) self.enabled = enabled self.registration = registration self.login = login -class AppleRegistration(ProxyOnlyResource): +class AppleRegistration(msrest.serialization.Model): """The configuration settings of the registration for the Apple provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param client_id: The Client ID of the app used for login. :type client_id: str :param client_secret_setting_name: The app setting name that contains the client secret. :type client_secret_setting_name: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'client_id': {'key': 'properties.clientId', 'type': 'str'}, - 'client_secret_setting_name': {'key': 'properties.clientSecretSettingName', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'client_secret_setting_name': {'key': 'clientSecretSettingName', 'type': 'str'}, } def __init__( self, *, - kind: Optional[str] = None, client_id: Optional[str] = None, client_secret_setting_name: Optional[str] = None, **kwargs ): - super(AppleRegistration, self).__init__(kind=kind, **kwargs) + super(AppleRegistration, self).__init__(**kwargs) self.client_id = client_id self.client_secret_setting_name = client_secret_setting_name @@ -832,49 +770,28 @@ def __init__( self.log_analytics_configuration = log_analytics_configuration -class AppRegistration(ProxyOnlyResource): +class AppRegistration(msrest.serialization.Model): """The configuration settings of the app registration for providers that have app ids and app secrets. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param app_id: The App ID of the app used for login. :type app_id: str :param app_secret_setting_name: The app setting name that contains the app secret. :type app_secret_setting_name: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'app_id': {'key': 'properties.appId', 'type': 'str'}, - 'app_secret_setting_name': {'key': 'properties.appSecretSettingName', 'type': 'str'}, + 'app_id': {'key': 'appId', 'type': 'str'}, + 'app_secret_setting_name': {'key': 'appSecretSettingName', 'type': 'str'}, } def __init__( self, *, - kind: Optional[str] = None, app_id: Optional[str] = None, app_secret_setting_name: Optional[str] = None, **kwargs ): - super(AppRegistration, self).__init__(kind=kind, **kwargs) + super(AppRegistration, self).__init__(**kwargs) self.app_id = app_id self.app_secret_setting_name = app_secret_setting_name @@ -2469,19 +2386,9 @@ def __init__( self.allow_new_private_endpoint_connections = allow_new_private_endpoint_connections -class AuthPlatform(ProxyOnlyResource): +class AuthPlatform(msrest.serialization.Model): """The configuration settings of the platform of App Service Authentication/Authorization. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`true` if the Authentication / Authorization feature is enabled for the current app; otherwise, :code:`false`. :type enabled: bool @@ -2496,32 +2403,21 @@ class AuthPlatform(ProxyOnlyResource): :type config_file_path: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'runtime_version': {'key': 'properties.runtimeVersion', 'type': 'str'}, - 'config_file_path': {'key': 'properties.configFilePath', 'type': 'str'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, + 'config_file_path': {'key': 'configFilePath', 'type': 'str'}, } def __init__( self, *, - kind: Optional[str] = None, enabled: Optional[bool] = None, runtime_version: Optional[str] = None, config_file_path: Optional[str] = None, **kwargs ): - super(AuthPlatform, self).__init__(kind=kind, **kwargs) + super(AuthPlatform, self).__init__(**kwargs) self.enabled = enabled self.runtime_version = runtime_version self.config_file_path = config_file_path @@ -2660,19 +2556,9 @@ def __init__( self.status_codes_range = status_codes_range -class AzureActiveDirectory(ProxyOnlyResource): +class AzureActiveDirectory(msrest.serialization.Model): """The configuration settings of the Azure Active directory provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`false` if the Azure Active Directory provider should not be enabled despite the set registration; otherwise, :code:`true`. :type enabled: bool @@ -2691,28 +2577,17 @@ class AzureActiveDirectory(ProxyOnlyResource): :type is_auto_provisioned: bool """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'registration': {'key': 'properties.registration', 'type': 'AzureActiveDirectoryRegistration'}, - 'login': {'key': 'properties.login', 'type': 'AzureActiveDirectoryLogin'}, - 'validation': {'key': 'properties.validation', 'type': 'AzureActiveDirectoryValidation'}, - 'is_auto_provisioned': {'key': 'properties.isAutoProvisioned', 'type': 'bool'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'AzureActiveDirectoryRegistration'}, + 'login': {'key': 'login', 'type': 'AzureActiveDirectoryLogin'}, + 'validation': {'key': 'validation', 'type': 'AzureActiveDirectoryValidation'}, + 'is_auto_provisioned': {'key': 'isAutoProvisioned', 'type': 'bool'}, } def __init__( self, *, - kind: Optional[str] = None, enabled: Optional[bool] = None, registration: Optional["AzureActiveDirectoryRegistration"] = None, login: Optional["AzureActiveDirectoryLogin"] = None, @@ -2720,7 +2595,7 @@ def __init__( is_auto_provisioned: Optional[bool] = None, **kwargs ): - super(AzureActiveDirectory, self).__init__(kind=kind, **kwargs) + super(AzureActiveDirectory, self).__init__(**kwargs) self.enabled = enabled self.registration = registration self.login = login @@ -2728,68 +2603,38 @@ def __init__( self.is_auto_provisioned = is_auto_provisioned -class AzureActiveDirectoryLogin(ProxyOnlyResource): +class AzureActiveDirectoryLogin(msrest.serialization.Model): """The configuration settings of the Azure Active Directory login flow. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str - :param disable_www_authenticate: - :type disable_www_authenticate: bool :param login_parameters: Login parameters to send to the OpenID Connect authorization endpoint when a user logs in. Each parameter must be in the form "key=value". :type login_parameters: list[str] + :param disable_www_authenticate: :code:`true` if the www-authenticate provider + should be omitted from the request; otherwise, :code:`false`. + :type disable_www_authenticate: bool """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'disable_www_authenticate': {'key': 'properties.disableWWWAuthenticate', 'type': 'bool'}, - 'login_parameters': {'key': 'properties.loginParameters', 'type': '[str]'}, + 'login_parameters': {'key': 'loginParameters', 'type': '[str]'}, + 'disable_www_authenticate': {'key': 'disableWWWAuthenticate', 'type': 'bool'}, } def __init__( self, *, - kind: Optional[str] = None, - disable_www_authenticate: Optional[bool] = None, login_parameters: Optional[List[str]] = None, + disable_www_authenticate: Optional[bool] = None, **kwargs ): - super(AzureActiveDirectoryLogin, self).__init__(kind=kind, **kwargs) - self.disable_www_authenticate = disable_www_authenticate + super(AzureActiveDirectoryLogin, self).__init__(**kwargs) self.login_parameters = login_parameters + self.disable_www_authenticate = disable_www_authenticate -class AzureActiveDirectoryRegistration(ProxyOnlyResource): +class AzureActiveDirectoryRegistration(msrest.serialization.Model): """The configuration settings of the Azure Active Directory app registration. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param open_id_issuer: The OpenID Connect Issuer URI that represents the entity which issues access tokens for this application. When using Azure Active Directory, this value is the URI of the directory tenant, e.g. @@ -2811,55 +2656,49 @@ class AzureActiveDirectoryRegistration(ProxyOnlyResource): thumbprint of a certificate used for signing purposes. This property acts as a replacement for the Client Secret. It is also optional. :type client_secret_certificate_thumbprint: str + :param client_secret_certificate_subject_alternative_name: An alternative to the client secret + thumbprint, that is the subject alternative name of a certificate used for signing purposes. + This property acts as + a replacement for the Client Secret Certificate Thumbprint. It is also optional. + :type client_secret_certificate_subject_alternative_name: str + :param client_secret_certificate_issuer: An alternative to the client secret thumbprint, that + is the issuer of a certificate used for signing purposes. This property acts as + a replacement for the Client Secret Certificate Thumbprint. It is also optional. + :type client_secret_certificate_issuer: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'open_id_issuer': {'key': 'properties.openIdIssuer', 'type': 'str'}, - 'client_id': {'key': 'properties.clientId', 'type': 'str'}, - 'client_secret_setting_name': {'key': 'properties.clientSecretSettingName', 'type': 'str'}, - 'client_secret_certificate_thumbprint': {'key': 'properties.clientSecretCertificateThumbprint', 'type': 'str'}, + 'open_id_issuer': {'key': 'openIdIssuer', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'client_secret_setting_name': {'key': 'clientSecretSettingName', 'type': 'str'}, + 'client_secret_certificate_thumbprint': {'key': 'clientSecretCertificateThumbprint', 'type': 'str'}, + 'client_secret_certificate_subject_alternative_name': {'key': 'clientSecretCertificateSubjectAlternativeName', 'type': 'str'}, + 'client_secret_certificate_issuer': {'key': 'clientSecretCertificateIssuer', 'type': 'str'}, } def __init__( self, *, - kind: Optional[str] = None, open_id_issuer: Optional[str] = None, client_id: Optional[str] = None, client_secret_setting_name: Optional[str] = None, client_secret_certificate_thumbprint: Optional[str] = None, + client_secret_certificate_subject_alternative_name: Optional[str] = None, + client_secret_certificate_issuer: Optional[str] = None, **kwargs ): - super(AzureActiveDirectoryRegistration, self).__init__(kind=kind, **kwargs) + super(AzureActiveDirectoryRegistration, self).__init__(**kwargs) self.open_id_issuer = open_id_issuer self.client_id = client_id self.client_secret_setting_name = client_secret_setting_name self.client_secret_certificate_thumbprint = client_secret_certificate_thumbprint + self.client_secret_certificate_subject_alternative_name = client_secret_certificate_subject_alternative_name + self.client_secret_certificate_issuer = client_secret_certificate_issuer -class AzureActiveDirectoryValidation(ProxyOnlyResource): +class AzureActiveDirectoryValidation(msrest.serialization.Model): """The configuration settings of the Azure Active Directory token validation flow. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param jwt_claim_checks: The configuration settings of the checks that should be made while validating the JWT Claims. :type jwt_claim_checks: ~azure.mgmt.web.v2021_01_15.models.JwtClaimChecks @@ -2868,30 +2707,19 @@ class AzureActiveDirectoryValidation(ProxyOnlyResource): :type allowed_audiences: list[str] """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'jwt_claim_checks': {'key': 'properties.jwtClaimChecks', 'type': 'JwtClaimChecks'}, - 'allowed_audiences': {'key': 'properties.allowedAudiences', 'type': '[str]'}, + 'jwt_claim_checks': {'key': 'jwtClaimChecks', 'type': 'JwtClaimChecks'}, + 'allowed_audiences': {'key': 'allowedAudiences', 'type': '[str]'}, } def __init__( self, *, - kind: Optional[str] = None, jwt_claim_checks: Optional["JwtClaimChecks"] = None, allowed_audiences: Optional[List[str]] = None, **kwargs ): - super(AzureActiveDirectoryValidation, self).__init__(kind=kind, **kwargs) + super(AzureActiveDirectoryValidation, self).__init__(**kwargs) self.jwt_claim_checks = jwt_claim_checks self.allowed_audiences = allowed_audiences @@ -2964,19 +2792,9 @@ def __init__( self.enabled = enabled -class AzureStaticWebApps(ProxyOnlyResource): +class AzureStaticWebApps(msrest.serialization.Model): """The configuration settings of the Azure Static Web Apps provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`false` if the Azure Static Web Apps provider should not be enabled despite the set registration; otherwise, :code:`true`. :type enabled: bool @@ -2984,73 +2802,41 @@ class AzureStaticWebApps(ProxyOnlyResource): :type registration: ~azure.mgmt.web.v2021_01_15.models.AzureStaticWebAppsRegistration """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'registration': {'key': 'properties.registration', 'type': 'AzureStaticWebAppsRegistration'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'AzureStaticWebAppsRegistration'}, } def __init__( self, *, - kind: Optional[str] = None, enabled: Optional[bool] = None, registration: Optional["AzureStaticWebAppsRegistration"] = None, **kwargs ): - super(AzureStaticWebApps, self).__init__(kind=kind, **kwargs) + super(AzureStaticWebApps, self).__init__(**kwargs) self.enabled = enabled self.registration = registration -class AzureStaticWebAppsRegistration(ProxyOnlyResource): +class AzureStaticWebAppsRegistration(msrest.serialization.Model): """The configuration settings of the registration for the Azure Static Web Apps provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param client_id: The Client ID of the app used for login. :type client_id: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'client_id': {'key': 'properties.clientId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, } def __init__( self, *, - kind: Optional[str] = None, client_id: Optional[str] = None, **kwargs ): - super(AzureStaticWebAppsRegistration, self).__init__(kind=kind, **kwargs) + super(AzureStaticWebAppsRegistration, self).__init__(**kwargs) self.client_id = client_id @@ -3556,46 +3342,25 @@ def __init__( self.next_link = None -class BlobStorageTokenStore(ProxyOnlyResource): +class BlobStorageTokenStore(msrest.serialization.Model): """The configuration settings of the storage of the tokens if blob storage is used. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param sas_url_setting_name: The name of the app setting containing the SAS URL of the blob storage containing the tokens. :type sas_url_setting_name: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'sas_url_setting_name': {'key': 'properties.sasUrlSettingName', 'type': 'str'}, + 'sas_url_setting_name': {'key': 'sasUrlSettingName', 'type': 'str'}, } def __init__( self, *, - kind: Optional[str] = None, sas_url_setting_name: Optional[str] = None, **kwargs ): - super(BlobStorageTokenStore, self).__init__(kind=kind, **kwargs) + super(BlobStorageTokenStore, self).__init__(**kwargs) self.sas_url_setting_name = sas_url_setting_name @@ -4174,49 +3939,28 @@ def __init__( self.domain_validation_method = domain_validation_method -class ClientRegistration(ProxyOnlyResource): +class ClientRegistration(msrest.serialization.Model): """The configuration settings of the app registration for providers that have client ids and client secrets. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param client_id: The Client ID of the app used for login. :type client_id: str :param client_secret_setting_name: The app setting name that contains the client secret. :type client_secret_setting_name: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'client_id': {'key': 'properties.clientId', 'type': 'str'}, - 'client_secret_setting_name': {'key': 'properties.clientSecretSettingName', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'client_secret_setting_name': {'key': 'clientSecretSettingName', 'type': 'str'}, } def __init__( self, *, - kind: Optional[str] = None, client_id: Optional[str] = None, client_secret_setting_name: Optional[str] = None, **kwargs ): - super(ClientRegistration, self).__init__(kind=kind, **kwargs) + super(ClientRegistration, self).__init__(**kwargs) self.client_id = client_id self.client_secret_setting_name = client_secret_setting_name @@ -4863,19 +4607,9 @@ def __init__( self.next_link = None -class CookieExpiration(ProxyOnlyResource): +class CookieExpiration(msrest.serialization.Model): """The configuration settings of the session cookie's expiration. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param convention: The convention used when determining the session cookie's expiration. Possible values include: "FixedTime", "IdentityProviderDerived". :type convention: str or ~azure.mgmt.web.v2021_01_15.models.CookieExpirationConvention @@ -4884,30 +4618,19 @@ class CookieExpiration(ProxyOnlyResource): :type time_to_expiration: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'convention': {'key': 'properties.convention', 'type': 'str'}, - 'time_to_expiration': {'key': 'properties.timeToExpiration', 'type': 'str'}, + 'convention': {'key': 'convention', 'type': 'str'}, + 'time_to_expiration': {'key': 'timeToExpiration', 'type': 'str'}, } def __init__( self, *, - kind: Optional[str] = None, convention: Optional[Union[str, "CookieExpirationConvention"]] = None, time_to_expiration: Optional[str] = None, **kwargs ): - super(CookieExpiration, self).__init__(kind=kind, **kwargs) + super(CookieExpiration, self).__init__(**kwargs) self.convention = convention self.time_to_expiration = time_to_expiration @@ -5387,19 +5110,9 @@ def __init__( self.alternate_txt_records = alternate_txt_records -class CustomOpenIdConnectProvider(ProxyOnlyResource): +class CustomOpenIdConnectProvider(msrest.serialization.Model): """The configuration settings of the custom Open ID Connect provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`false` if the custom Open ID provider provider should not be enabled; otherwise, :code:`true`. :type enabled: bool @@ -5408,35 +5121,24 @@ class CustomOpenIdConnectProvider(ProxyOnlyResource): :type registration: ~azure.mgmt.web.v2021_01_15.models.OpenIdConnectRegistration :param login: The configuration settings of the login flow of the custom Open ID Connect provider. - :type login: ~azure.mgmt.web.v2021_01_15.models.OpenIdConnectLogin - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'registration': {'key': 'properties.registration', 'type': 'OpenIdConnectRegistration'}, - 'login': {'key': 'properties.login', 'type': 'OpenIdConnectLogin'}, + :type login: ~azure.mgmt.web.v2021_01_15.models.OpenIdConnectLogin + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'OpenIdConnectRegistration'}, + 'login': {'key': 'login', 'type': 'OpenIdConnectLogin'}, } def __init__( self, *, - kind: Optional[str] = None, enabled: Optional[bool] = None, registration: Optional["OpenIdConnectRegistration"] = None, login: Optional["OpenIdConnectLogin"] = None, **kwargs ): - super(CustomOpenIdConnectProvider, self).__init__(kind=kind, **kwargs) + super(CustomOpenIdConnectProvider, self).__init__(**kwargs) self.enabled = enabled self.registration = registration self.login = login @@ -7493,19 +7195,9 @@ def __init__( self.type = None -class Facebook(ProxyOnlyResource): +class Facebook(msrest.serialization.Model): """The configuration settings of the Facebook provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`false` if the Facebook provider should not be enabled despite the set registration; otherwise, :code:`true`. :type enabled: bool @@ -7518,34 +7210,23 @@ class Facebook(ProxyOnlyResource): :type login: ~azure.mgmt.web.v2021_01_15.models.LoginScopes """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'registration': {'key': 'properties.registration', 'type': 'AppRegistration'}, - 'graph_api_version': {'key': 'properties.graphApiVersion', 'type': 'str'}, - 'login': {'key': 'properties.login', 'type': 'LoginScopes'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'AppRegistration'}, + 'graph_api_version': {'key': 'graphApiVersion', 'type': 'str'}, + 'login': {'key': 'login', 'type': 'LoginScopes'}, } def __init__( self, *, - kind: Optional[str] = None, enabled: Optional[bool] = None, registration: Optional["AppRegistration"] = None, graph_api_version: Optional[str] = None, login: Optional["LoginScopes"] = None, **kwargs ): - super(Facebook, self).__init__(kind=kind, **kwargs) + super(Facebook, self).__init__(**kwargs) self.enabled = enabled self.registration = registration self.graph_api_version = graph_api_version @@ -7614,61 +7295,30 @@ def __init__( self.enabled = enabled -class FileSystemTokenStore(ProxyOnlyResource): +class FileSystemTokenStore(msrest.serialization.Model): """The configuration settings of the storage of the tokens if a file system is used. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param directory: The directory in which the tokens will be stored. :type directory: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'directory': {'key': 'properties.directory', 'type': 'str'}, + 'directory': {'key': 'directory', 'type': 'str'}, } def __init__( self, *, - kind: Optional[str] = None, directory: Optional[str] = None, **kwargs ): - super(FileSystemTokenStore, self).__init__(kind=kind, **kwargs) + super(FileSystemTokenStore, self).__init__(**kwargs) self.directory = directory -class ForwardProxy(ProxyOnlyResource): +class ForwardProxy(msrest.serialization.Model): """The configuration settings of a forward proxy used to make the requests. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param convention: The convention used to determine the url of the request made. Possible values include: "NoProxy", "Standard", "Custom". :type convention: str or ~azure.mgmt.web.v2021_01_15.models.ForwardProxyConvention @@ -7678,32 +7328,21 @@ class ForwardProxy(ProxyOnlyResource): :type custom_proto_header_name: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'convention': {'key': 'properties.convention', 'type': 'str'}, - 'custom_host_header_name': {'key': 'properties.customHostHeaderName', 'type': 'str'}, - 'custom_proto_header_name': {'key': 'properties.customProtoHeaderName', 'type': 'str'}, + 'convention': {'key': 'convention', 'type': 'str'}, + 'custom_host_header_name': {'key': 'customHostHeaderName', 'type': 'str'}, + 'custom_proto_header_name': {'key': 'customProtoHeaderName', 'type': 'str'}, } def __init__( self, *, - kind: Optional[str] = None, convention: Optional[Union[str, "ForwardProxyConvention"]] = None, custom_host_header_name: Optional[str] = None, custom_proto_header_name: Optional[str] = None, **kwargs ): - super(ForwardProxy, self).__init__(kind=kind, **kwargs) + super(ForwardProxy, self).__init__(**kwargs) self.convention = convention self.custom_host_header_name = custom_host_header_name self.custom_proto_header_name = custom_proto_header_name @@ -8277,19 +7916,9 @@ def __init__( self.next_link = None -class GitHub(ProxyOnlyResource): +class GitHub(msrest.serialization.Model): """The configuration settings of the GitHub provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`false` if the GitHub provider should not be enabled despite the set registration; otherwise, :code:`true`. :type enabled: bool @@ -8300,32 +7929,21 @@ class GitHub(ProxyOnlyResource): :type login: ~azure.mgmt.web.v2021_01_15.models.LoginScopes """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'registration': {'key': 'properties.registration', 'type': 'ClientRegistration'}, - 'login': {'key': 'properties.login', 'type': 'LoginScopes'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'ClientRegistration'}, + 'login': {'key': 'login', 'type': 'LoginScopes'}, } def __init__( self, *, - kind: Optional[str] = None, enabled: Optional[bool] = None, registration: Optional["ClientRegistration"] = None, login: Optional["LoginScopes"] = None, **kwargs ): - super(GitHub, self).__init__(kind=kind, **kwargs) + super(GitHub, self).__init__(**kwargs) self.enabled = enabled self.registration = registration self.login = login @@ -8515,19 +8133,9 @@ def __init__( self.capabilities = capabilities -class GlobalValidation(ProxyOnlyResource): +class GlobalValidation(msrest.serialization.Model): """The configuration settings that determines the validation flow of users using App Service Authentication/Authorization. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param require_authentication: :code:`true` if the authentication flow is required any request is made; otherwise, :code:`false`. :type require_authentication: bool @@ -8547,53 +8155,32 @@ class GlobalValidation(ProxyOnlyResource): :type excluded_paths: list[str] """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'require_authentication': {'key': 'properties.requireAuthentication', 'type': 'bool'}, - 'unauthenticated_client_action': {'key': 'properties.unauthenticatedClientAction', 'type': 'str'}, - 'redirect_to_provider': {'key': 'properties.redirectToProvider', 'type': 'str'}, - 'excluded_paths': {'key': 'properties.excludedPaths', 'type': '[str]'}, + 'require_authentication': {'key': 'requireAuthentication', 'type': 'bool'}, + 'unauthenticated_client_action': {'key': 'unauthenticatedClientAction', 'type': 'str'}, + 'redirect_to_provider': {'key': 'redirectToProvider', 'type': 'str'}, + 'excluded_paths': {'key': 'excludedPaths', 'type': '[str]'}, } def __init__( self, *, - kind: Optional[str] = None, require_authentication: Optional[bool] = None, unauthenticated_client_action: Optional[Union[str, "UnauthenticatedClientActionV2"]] = None, redirect_to_provider: Optional[str] = None, excluded_paths: Optional[List[str]] = None, **kwargs ): - super(GlobalValidation, self).__init__(kind=kind, **kwargs) + super(GlobalValidation, self).__init__(**kwargs) self.require_authentication = require_authentication self.unauthenticated_client_action = unauthenticated_client_action self.redirect_to_provider = redirect_to_provider self.excluded_paths = excluded_paths -class Google(ProxyOnlyResource): +class Google(msrest.serialization.Model): """The configuration settings of the Google provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`false` if the Google provider should not be enabled despite the set registration; otherwise, :code:`true`. :type enabled: bool @@ -8607,34 +8194,23 @@ class Google(ProxyOnlyResource): :type validation: ~azure.mgmt.web.v2021_01_15.models.AllowedAudiencesValidation """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'registration': {'key': 'properties.registration', 'type': 'ClientRegistration'}, - 'login': {'key': 'properties.login', 'type': 'LoginScopes'}, - 'validation': {'key': 'properties.validation', 'type': 'AllowedAudiencesValidation'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'ClientRegistration'}, + 'login': {'key': 'login', 'type': 'LoginScopes'}, + 'validation': {'key': 'validation', 'type': 'AllowedAudiencesValidation'}, } def __init__( self, *, - kind: Optional[str] = None, enabled: Optional[bool] = None, registration: Optional["ClientRegistration"] = None, login: Optional["LoginScopes"] = None, validation: Optional["AllowedAudiencesValidation"] = None, **kwargs ): - super(Google, self).__init__(kind=kind, **kwargs) + super(Google, self).__init__(**kwargs) self.enabled = enabled self.registration = registration self.login = login @@ -9039,19 +8615,9 @@ def __init__( self.azure_blob_storage = azure_blob_storage -class HttpSettings(ProxyOnlyResource): +class HttpSettings(msrest.serialization.Model): """The configuration settings of the HTTP requests for authentication and authorization requests made against App Service Authentication/Authorization. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param require_https: :code:`false` if the authentication/authorization responses not having the HTTPS scheme are permissible; otherwise, :code:`true`. :type require_https: bool @@ -9061,76 +8627,44 @@ class HttpSettings(ProxyOnlyResource): :type forward_proxy: ~azure.mgmt.web.v2021_01_15.models.ForwardProxy """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'require_https': {'key': 'properties.requireHttps', 'type': 'bool'}, - 'routes': {'key': 'properties.routes', 'type': 'HttpSettingsRoutes'}, - 'forward_proxy': {'key': 'properties.forwardProxy', 'type': 'ForwardProxy'}, + 'require_https': {'key': 'requireHttps', 'type': 'bool'}, + 'routes': {'key': 'routes', 'type': 'HttpSettingsRoutes'}, + 'forward_proxy': {'key': 'forwardProxy', 'type': 'ForwardProxy'}, } def __init__( self, *, - kind: Optional[str] = None, require_https: Optional[bool] = None, routes: Optional["HttpSettingsRoutes"] = None, forward_proxy: Optional["ForwardProxy"] = None, **kwargs ): - super(HttpSettings, self).__init__(kind=kind, **kwargs) + super(HttpSettings, self).__init__(**kwargs) self.require_https = require_https self.routes = routes self.forward_proxy = forward_proxy -class HttpSettingsRoutes(ProxyOnlyResource): +class HttpSettingsRoutes(msrest.serialization.Model): """The configuration settings of the paths HTTP requests. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param api_prefix: The prefix that should precede all the authentication/authorization paths. :type api_prefix: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'api_prefix': {'key': 'properties.apiPrefix', 'type': 'str'}, + 'api_prefix': {'key': 'apiPrefix', 'type': 'str'}, } def __init__( self, *, - kind: Optional[str] = None, api_prefix: Optional[str] = None, **kwargs ): - super(HttpSettingsRoutes, self).__init__(kind=kind, **kwargs) + super(HttpSettingsRoutes, self).__init__(**kwargs) self.api_prefix = api_prefix @@ -9419,19 +8953,9 @@ def __init__( self.next_link = None -class IdentityProviders(ProxyOnlyResource): +class IdentityProviders(msrest.serialization.Model): """The configuration settings of each of the identity providers used to configure App Service Authentication/Authorization. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param azure_active_directory: The configuration settings of the Azure Active directory provider. :type azure_active_directory: ~azure.mgmt.web.v2021_01_15.models.AzureActiveDirectory @@ -9441,69 +8965,58 @@ class IdentityProviders(ProxyOnlyResource): :type git_hub: ~azure.mgmt.web.v2021_01_15.models.GitHub :param google: The configuration settings of the Google provider. :type google: ~azure.mgmt.web.v2021_01_15.models.Google - :param twitter: The configuration settings of the Twitter provider. - :type twitter: ~azure.mgmt.web.v2021_01_15.models.Twitter - :param custom_open_id_connect_providers: The map of the name of the alias of each custom Open - ID Connect provider to the - configuration settings of the custom Open ID Connect provider. - :type custom_open_id_connect_providers: dict[str, - ~azure.mgmt.web.v2021_01_15.models.CustomOpenIdConnectProvider] :param legacy_microsoft_account: The configuration settings of the legacy Microsoft Account provider. :type legacy_microsoft_account: ~azure.mgmt.web.v2021_01_15.models.LegacyMicrosoftAccount + :param twitter: The configuration settings of the Twitter provider. + :type twitter: ~azure.mgmt.web.v2021_01_15.models.Twitter :param apple: The configuration settings of the Apple provider. :type apple: ~azure.mgmt.web.v2021_01_15.models.Apple :param azure_static_web_apps: The configuration settings of the Azure Static Web Apps provider. :type azure_static_web_apps: ~azure.mgmt.web.v2021_01_15.models.AzureStaticWebApps + :param custom_open_id_connect_providers: The map of the name of the alias of each custom Open + ID Connect provider to the + configuration settings of the custom Open ID Connect provider. + :type custom_open_id_connect_providers: dict[str, + ~azure.mgmt.web.v2021_01_15.models.CustomOpenIdConnectProvider] """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'azure_active_directory': {'key': 'properties.azureActiveDirectory', 'type': 'AzureActiveDirectory'}, - 'facebook': {'key': 'properties.facebook', 'type': 'Facebook'}, - 'git_hub': {'key': 'properties.gitHub', 'type': 'GitHub'}, - 'google': {'key': 'properties.google', 'type': 'Google'}, - 'twitter': {'key': 'properties.twitter', 'type': 'Twitter'}, - 'custom_open_id_connect_providers': {'key': 'properties.customOpenIdConnectProviders', 'type': '{CustomOpenIdConnectProvider}'}, - 'legacy_microsoft_account': {'key': 'properties.legacyMicrosoftAccount', 'type': 'LegacyMicrosoftAccount'}, - 'apple': {'key': 'properties.apple', 'type': 'Apple'}, - 'azure_static_web_apps': {'key': 'properties.azureStaticWebApps', 'type': 'AzureStaticWebApps'}, + 'azure_active_directory': {'key': 'azureActiveDirectory', 'type': 'AzureActiveDirectory'}, + 'facebook': {'key': 'facebook', 'type': 'Facebook'}, + 'git_hub': {'key': 'gitHub', 'type': 'GitHub'}, + 'google': {'key': 'google', 'type': 'Google'}, + 'legacy_microsoft_account': {'key': 'legacyMicrosoftAccount', 'type': 'LegacyMicrosoftAccount'}, + 'twitter': {'key': 'twitter', 'type': 'Twitter'}, + 'apple': {'key': 'apple', 'type': 'Apple'}, + 'azure_static_web_apps': {'key': 'azureStaticWebApps', 'type': 'AzureStaticWebApps'}, + 'custom_open_id_connect_providers': {'key': 'customOpenIdConnectProviders', 'type': '{CustomOpenIdConnectProvider}'}, } def __init__( self, *, - kind: Optional[str] = None, azure_active_directory: Optional["AzureActiveDirectory"] = None, facebook: Optional["Facebook"] = None, git_hub: Optional["GitHub"] = None, google: Optional["Google"] = None, - twitter: Optional["Twitter"] = None, - custom_open_id_connect_providers: Optional[Dict[str, "CustomOpenIdConnectProvider"]] = None, legacy_microsoft_account: Optional["LegacyMicrosoftAccount"] = None, + twitter: Optional["Twitter"] = None, apple: Optional["Apple"] = None, azure_static_web_apps: Optional["AzureStaticWebApps"] = None, + custom_open_id_connect_providers: Optional[Dict[str, "CustomOpenIdConnectProvider"]] = None, **kwargs ): - super(IdentityProviders, self).__init__(kind=kind, **kwargs) + super(IdentityProviders, self).__init__(**kwargs) self.azure_active_directory = azure_active_directory self.facebook = facebook self.git_hub = git_hub self.google = google - self.twitter = twitter - self.custom_open_id_connect_providers = custom_open_id_connect_providers self.legacy_microsoft_account = legacy_microsoft_account + self.twitter = twitter self.apple = apple self.azure_static_web_apps = azure_static_web_apps + self.custom_open_id_connect_providers = custom_open_id_connect_providers class InboundEnvironmentEndpoint(msrest.serialization.Model): @@ -9670,49 +9183,28 @@ def __init__( self.headers = headers -class JwtClaimChecks(ProxyOnlyResource): +class JwtClaimChecks(msrest.serialization.Model): """The configuration settings of the checks that should be made while validating the JWT Claims. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param allowed_groups: The list of the allowed groups. :type allowed_groups: list[str] :param allowed_client_applications: The list of the allowed client applications. :type allowed_client_applications: list[str] """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'allowed_groups': {'key': 'properties.allowedGroups', 'type': '[str]'}, - 'allowed_client_applications': {'key': 'properties.allowedClientApplications', 'type': '[str]'}, + 'allowed_groups': {'key': 'allowedGroups', 'type': '[str]'}, + 'allowed_client_applications': {'key': 'allowedClientApplications', 'type': '[str]'}, } def __init__( self, *, - kind: Optional[str] = None, allowed_groups: Optional[List[str]] = None, allowed_client_applications: Optional[List[str]] = None, **kwargs ): - super(JwtClaimChecks, self).__init__(kind=kind, **kwargs) + super(JwtClaimChecks, self).__init__(**kwargs) self.allowed_groups = allowed_groups self.allowed_client_applications = allowed_client_applications @@ -10029,19 +9521,9 @@ def __init__( self.type = None -class LegacyMicrosoftAccount(ProxyOnlyResource): +class LegacyMicrosoftAccount(msrest.serialization.Model): """The configuration settings of the legacy Microsoft Account provider. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str + :param enabled: :code:`false` if the legacy Microsoft Account provider should not be enabled despite the set registration; otherwise, :code:`true`. :type enabled: bool @@ -10055,34 +9537,23 @@ class LegacyMicrosoftAccount(ProxyOnlyResource): :type validation: ~azure.mgmt.web.v2021_01_15.models.AllowedAudiencesValidation """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'registration': {'key': 'properties.registration', 'type': 'ClientRegistration'}, - 'login': {'key': 'properties.login', 'type': 'LoginScopes'}, - 'validation': {'key': 'properties.validation', 'type': 'AllowedAudiencesValidation'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'ClientRegistration'}, + 'login': {'key': 'login', 'type': 'LoginScopes'}, + 'validation': {'key': 'validation', 'type': 'AllowedAudiencesValidation'}, } def __init__( self, *, - kind: Optional[str] = None, enabled: Optional[bool] = None, registration: Optional["ClientRegistration"] = None, login: Optional["LoginScopes"] = None, validation: Optional["AllowedAudiencesValidation"] = None, **kwargs ): - super(LegacyMicrosoftAccount, self).__init__(kind=kind, **kwargs) + super(LegacyMicrosoftAccount, self).__init__(**kwargs) self.enabled = enabled self.registration = registration self.login = login @@ -10206,19 +9677,9 @@ def __init__( self.shared_key = shared_key -class Login(ProxyOnlyResource): +class Login(msrest.serialization.Model): """The configuration settings of the login flow of users using App Service Authentication/Authorization. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param routes: The routes that specify the endpoints used for login and logout requests. :type routes: ~azure.mgmt.web.v2021_01_15.models.LoginRoutes :param token_store: The configuration settings of the token store. @@ -10237,29 +9698,18 @@ class Login(ProxyOnlyResource): :type nonce: ~azure.mgmt.web.v2021_01_15.models.Nonce """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'routes': {'key': 'properties.routes', 'type': 'LoginRoutes'}, - 'token_store': {'key': 'properties.tokenStore', 'type': 'TokenStore'}, - 'preserve_url_fragments_for_logins': {'key': 'properties.preserveUrlFragmentsForLogins', 'type': 'bool'}, - 'allowed_external_redirect_urls': {'key': 'properties.allowedExternalRedirectUrls', 'type': '[str]'}, - 'cookie_expiration': {'key': 'properties.cookieExpiration', 'type': 'CookieExpiration'}, - 'nonce': {'key': 'properties.nonce', 'type': 'Nonce'}, + 'routes': {'key': 'routes', 'type': 'LoginRoutes'}, + 'token_store': {'key': 'tokenStore', 'type': 'TokenStore'}, + 'preserve_url_fragments_for_logins': {'key': 'preserveUrlFragmentsForLogins', 'type': 'bool'}, + 'allowed_external_redirect_urls': {'key': 'allowedExternalRedirectUrls', 'type': '[str]'}, + 'cookie_expiration': {'key': 'cookieExpiration', 'type': 'CookieExpiration'}, + 'nonce': {'key': 'nonce', 'type': 'Nonce'}, } def __init__( self, *, - kind: Optional[str] = None, routes: Optional["LoginRoutes"] = None, token_store: Optional["TokenStore"] = None, preserve_url_fragments_for_logins: Optional[bool] = None, @@ -10268,7 +9718,7 @@ def __init__( nonce: Optional["Nonce"] = None, **kwargs ): - super(Login, self).__init__(kind=kind, **kwargs) + super(Login, self).__init__(**kwargs) self.routes = routes self.token_store = token_store self.preserve_url_fragments_for_logins = preserve_url_fragments_for_logins @@ -10277,87 +9727,45 @@ def __init__( self.nonce = nonce -class LoginRoutes(ProxyOnlyResource): +class LoginRoutes(msrest.serialization.Model): """The routes that specify the endpoints used for login and logout requests. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param logout_endpoint: The endpoint at which a logout request should be made. :type logout_endpoint: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'logout_endpoint': {'key': 'properties.logoutEndpoint', 'type': 'str'}, + 'logout_endpoint': {'key': 'logoutEndpoint', 'type': 'str'}, } def __init__( self, *, - kind: Optional[str] = None, logout_endpoint: Optional[str] = None, **kwargs ): - super(LoginRoutes, self).__init__(kind=kind, **kwargs) + super(LoginRoutes, self).__init__(**kwargs) self.logout_endpoint = logout_endpoint -class LoginScopes(ProxyOnlyResource): +class LoginScopes(msrest.serialization.Model): """The configuration settings of the login flow, including the scopes that should be requested. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param scopes: A list of the scopes that should be requested while authenticating. :type scopes: list[str] """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'scopes': {'key': 'properties.scopes', 'type': '[str]'}, + 'scopes': {'key': 'scopes', 'type': '[str]'}, } def __init__( self, *, - kind: Optional[str] = None, scopes: Optional[List[str]] = None, **kwargs ): - super(LoginScopes, self).__init__(kind=kind, **kwargs) + super(LoginScopes, self).__init__(**kwargs) self.scopes = scopes @@ -11060,19 +10468,9 @@ def __init__( self.message = message -class Nonce(ProxyOnlyResource): +class Nonce(msrest.serialization.Model): """The configuration settings of the nonce used in the login flow. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param validate_nonce: :code:`false` if the nonce should not be validated while completing the login flow; otherwise, :code:`true`. :type validate_nonce: bool @@ -11081,47 +10479,26 @@ class Nonce(ProxyOnlyResource): :type nonce_expiration_interval: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'validate_nonce': {'key': 'properties.validateNonce', 'type': 'bool'}, - 'nonce_expiration_interval': {'key': 'properties.nonceExpirationInterval', 'type': 'str'}, + 'validate_nonce': {'key': 'validateNonce', 'type': 'bool'}, + 'nonce_expiration_interval': {'key': 'nonceExpirationInterval', 'type': 'str'}, } def __init__( self, *, - kind: Optional[str] = None, validate_nonce: Optional[bool] = None, nonce_expiration_interval: Optional[str] = None, **kwargs ): - super(Nonce, self).__init__(kind=kind, **kwargs) + super(Nonce, self).__init__(**kwargs) self.validate_nonce = validate_nonce self.nonce_expiration_interval = nonce_expiration_interval -class OpenIdConnectClientCredential(ProxyOnlyResource): +class OpenIdConnectClientCredential(msrest.serialization.Model): """The authentication client credentials of the custom Open ID Connect provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param method: The method that should be used to authenticate the user. The only acceptable values to pass in are None and "ClientSecretPost". The default value is None. :type method: str @@ -11130,47 +10507,26 @@ class OpenIdConnectClientCredential(ProxyOnlyResource): :type client_secret_setting_name: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'method': {'key': 'properties.method', 'type': 'str'}, - 'client_secret_setting_name': {'key': 'properties.clientSecretSettingName', 'type': 'str'}, + 'method': {'key': 'method', 'type': 'str'}, + 'client_secret_setting_name': {'key': 'clientSecretSettingName', 'type': 'str'}, } def __init__( self, *, - kind: Optional[str] = None, method: Optional[str] = None, client_secret_setting_name: Optional[str] = None, **kwargs ): - super(OpenIdConnectClientCredential, self).__init__(kind=kind, **kwargs) + super(OpenIdConnectClientCredential, self).__init__(**kwargs) self.method = method self.client_secret_setting_name = client_secret_setting_name -class OpenIdConnectConfig(ProxyOnlyResource): +class OpenIdConnectConfig(msrest.serialization.Model): """The configuration settings of the endpoints used for the custom Open ID Connect provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param authorization_endpoint: The endpoint to be used to make an authorization request. :type authorization_endpoint: str :param token_endpoint: The endpoint to be used to request a token. @@ -11184,28 +10540,17 @@ class OpenIdConnectConfig(ProxyOnlyResource): :type well_known_open_id_configuration: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'authorization_endpoint': {'key': 'properties.authorizationEndpoint', 'type': 'str'}, - 'token_endpoint': {'key': 'properties.tokenEndpoint', 'type': 'str'}, - 'issuer': {'key': 'properties.issuer', 'type': 'str'}, - 'certification_uri': {'key': 'properties.certificationUri', 'type': 'str'}, - 'well_known_open_id_configuration': {'key': 'properties.wellKnownOpenIdConfiguration', 'type': 'str'}, + 'authorization_endpoint': {'key': 'authorizationEndpoint', 'type': 'str'}, + 'token_endpoint': {'key': 'tokenEndpoint', 'type': 'str'}, + 'issuer': {'key': 'issuer', 'type': 'str'}, + 'certification_uri': {'key': 'certificationUri', 'type': 'str'}, + 'well_known_open_id_configuration': {'key': 'wellKnownOpenIdConfiguration', 'type': 'str'}, } def __init__( self, *, - kind: Optional[str] = None, authorization_endpoint: Optional[str] = None, token_endpoint: Optional[str] = None, issuer: Optional[str] = None, @@ -11213,7 +10558,7 @@ def __init__( well_known_open_id_configuration: Optional[str] = None, **kwargs ): - super(OpenIdConnectConfig, self).__init__(kind=kind, **kwargs) + super(OpenIdConnectConfig, self).__init__(**kwargs) self.authorization_endpoint = authorization_endpoint self.token_endpoint = token_endpoint self.issuer = issuer @@ -11221,66 +10566,35 @@ def __init__( self.well_known_open_id_configuration = well_known_open_id_configuration -class OpenIdConnectLogin(ProxyOnlyResource): +class OpenIdConnectLogin(msrest.serialization.Model): """The configuration settings of the login flow of the custom Open ID Connect provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param name_claim_type: The name of the claim that contains the users name. :type name_claim_type: str :param scopes: A list of the scopes that should be requested while authenticating. :type scopes: list[str] """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'name_claim_type': {'key': 'properties.nameClaimType', 'type': 'str'}, - 'scopes': {'key': 'properties.scopes', 'type': '[str]'}, + 'name_claim_type': {'key': 'nameClaimType', 'type': 'str'}, + 'scopes': {'key': 'scopes', 'type': '[str]'}, } def __init__( self, *, - kind: Optional[str] = None, name_claim_type: Optional[str] = None, scopes: Optional[List[str]] = None, **kwargs ): - super(OpenIdConnectLogin, self).__init__(kind=kind, **kwargs) + super(OpenIdConnectLogin, self).__init__(**kwargs) self.name_claim_type = name_claim_type self.scopes = scopes -class OpenIdConnectRegistration(ProxyOnlyResource): +class OpenIdConnectRegistration(msrest.serialization.Model): """The configuration settings of the app registration for the custom Open ID Connect provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param client_id: The client id of the custom Open ID Connect provider. :type client_id: str :param client_credential: The authentication credentials of the custom Open ID Connect @@ -11291,32 +10605,21 @@ class OpenIdConnectRegistration(ProxyOnlyResource): :type open_id_connect_configuration: ~azure.mgmt.web.v2021_01_15.models.OpenIdConnectConfig """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'client_id': {'key': 'properties.clientId', 'type': 'str'}, - 'client_credential': {'key': 'properties.clientCredential', 'type': 'OpenIdConnectClientCredential'}, - 'open_id_connect_configuration': {'key': 'properties.openIdConnectConfiguration', 'type': 'OpenIdConnectConfig'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'client_credential': {'key': 'clientCredential', 'type': 'OpenIdConnectClientCredential'}, + 'open_id_connect_configuration': {'key': 'openIdConnectConfiguration', 'type': 'OpenIdConnectConfig'}, } def __init__( self, *, - kind: Optional[str] = None, client_id: Optional[str] = None, client_credential: Optional["OpenIdConnectClientCredential"] = None, open_id_connect_configuration: Optional["OpenIdConnectConfig"] = None, **kwargs ): - super(OpenIdConnectRegistration, self).__init__(kind=kind, **kwargs) + super(OpenIdConnectRegistration, self).__init__(**kwargs) self.client_id = client_id self.client_credential = client_credential self.open_id_connect_configuration = open_id_connect_configuration @@ -19397,19 +18700,9 @@ def __init__( self.next_link = None -class TokenStore(ProxyOnlyResource): +class TokenStore(msrest.serialization.Model): """The configuration settings of the token store. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`true` to durably store platform-specific security tokens that are obtained during login flows; otherwise, :code:`false`. The default is :code:`false`. @@ -19426,34 +18719,23 @@ class TokenStore(ProxyOnlyResource): :type azure_blob_storage: ~azure.mgmt.web.v2021_01_15.models.BlobStorageTokenStore """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'token_refresh_extension_hours': {'key': 'properties.tokenRefreshExtensionHours', 'type': 'float'}, - 'file_system': {'key': 'properties.fileSystem', 'type': 'FileSystemTokenStore'}, - 'azure_blob_storage': {'key': 'properties.azureBlobStorage', 'type': 'BlobStorageTokenStore'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'token_refresh_extension_hours': {'key': 'tokenRefreshExtensionHours', 'type': 'float'}, + 'file_system': {'key': 'fileSystem', 'type': 'FileSystemTokenStore'}, + 'azure_blob_storage': {'key': 'azureBlobStorage', 'type': 'BlobStorageTokenStore'}, } def __init__( self, *, - kind: Optional[str] = None, enabled: Optional[bool] = None, token_refresh_extension_hours: Optional[float] = None, file_system: Optional["FileSystemTokenStore"] = None, azure_blob_storage: Optional["BlobStorageTokenStore"] = None, **kwargs ): - super(TokenStore, self).__init__(kind=kind, **kwargs) + super(TokenStore, self).__init__(**kwargs) self.enabled = enabled self.token_refresh_extension_hours = token_refresh_extension_hours self.file_system = file_system @@ -19854,19 +19136,9 @@ def __init__( self.next_link = None -class Twitter(ProxyOnlyResource): +class Twitter(msrest.serialization.Model): """The configuration settings of the Twitter provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param enabled: :code:`false` if the Twitter provider should not be enabled despite the set registration; otherwise, :code:`true`. :type enabled: bool @@ -19875,47 +19147,26 @@ class Twitter(ProxyOnlyResource): :type registration: ~azure.mgmt.web.v2021_01_15.models.TwitterRegistration """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'registration': {'key': 'properties.registration', 'type': 'TwitterRegistration'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'TwitterRegistration'}, } def __init__( self, *, - kind: Optional[str] = None, enabled: Optional[bool] = None, registration: Optional["TwitterRegistration"] = None, **kwargs ): - super(Twitter, self).__init__(kind=kind, **kwargs) + super(Twitter, self).__init__(**kwargs) self.enabled = enabled self.registration = registration -class TwitterRegistration(ProxyOnlyResource): +class TwitterRegistration(msrest.serialization.Model): """The configuration settings of the app registration for the Twitter provider. - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :param kind: Kind of resource. - :type kind: str - :ivar type: Resource type. - :vartype type: str :param consumer_key: The OAuth 1.0a consumer key of the Twitter application used for sign-in. This setting is required for enabling Twitter Sign-In. Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in. @@ -19926,30 +19177,19 @@ class TwitterRegistration(ProxyOnlyResource): :type consumer_secret_setting_name: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'consumer_key': {'key': 'properties.consumerKey', 'type': 'str'}, - 'consumer_secret_setting_name': {'key': 'properties.consumerSecretSettingName', 'type': 'str'}, + 'consumer_key': {'key': 'consumerKey', 'type': 'str'}, + 'consumer_secret_setting_name': {'key': 'consumerSecretSettingName', 'type': 'str'}, } def __init__( self, *, - kind: Optional[str] = None, consumer_key: Optional[str] = None, consumer_secret_setting_name: Optional[str] = None, **kwargs ): - super(TwitterRegistration, self).__init__(kind=kind, **kwargs) + super(TwitterRegistration, self).__init__(**kwargs) self.consumer_key = consumer_key self.consumer_secret_setting_name = consumer_secret_setting_name diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/__init__.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/__init__.py new file mode 100644 index 000000000000..45c59c58316a --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/__init__.py @@ -0,0 +1,19 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._web_site_management_client import WebSiteManagementClient +from ._version import VERSION + +__version__ = VERSION +__all__ = ['WebSiteManagementClient'] + +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/_configuration.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/_configuration.py new file mode 100644 index 000000000000..eb85feafd047 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/_configuration.py @@ -0,0 +1,71 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +from ._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + + +class WebSiteManagementClientConfiguration(Configuration): + """Configuration for WebSiteManagementClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + :type subscription_id: str + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(WebSiteManagementClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2021-02-01" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-web/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/_metadata.json b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/_metadata.json new file mode 100644 index 000000000000..0dcd781a714f --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/_metadata.json @@ -0,0 +1,330 @@ +{ + "chosen_version": "2021-02-01", + "total_api_version_list": ["2021-02-01"], + "client": { + "name": "WebSiteManagementClient", + "filename": "_web_site_management_client", + "description": "WebSite Management Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true, + "client_side_validation": false, + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"WebSiteManagementClientConfiguration\"], \"._operations_mixin\": [\"WebSiteManagementClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"WebSiteManagementClientConfiguration\"], \"._operations_mixin\": [\"WebSiteManagementClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + }, + "global_parameters": { + "sync": { + "credential": { + "signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).", + "docstring_type": "str", + "required": true + } + }, + "async": { + "credential": { + "signature": "credential: \"AsyncTokenCredential\",", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id: str,", + "description": "Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).", + "docstring_type": "str", + "required": true + } + }, + "constant": { + }, + "call": "credential, subscription_id", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url=None, # type: Optional[str]", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "async": { + "api_version": { + "signature": "api_version: Optional[str] = None,", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url: Optional[str] = None,", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } + }, + "config": { + "credential": true, + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null, + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" + }, + "operation_groups": { + "app_service_certificate_orders": "AppServiceCertificateOrdersOperations", + "certificate_orders_diagnostics": "CertificateOrdersDiagnosticsOperations", + "certificate_registration_provider": "CertificateRegistrationProviderOperations", + "domains": "DomainsOperations", + "top_level_domains": "TopLevelDomainsOperations", + "domain_registration_provider": "DomainRegistrationProviderOperations", + "app_service_environments": "AppServiceEnvironmentsOperations", + "app_service_plans": "AppServicePlansOperations", + "certificates": "CertificatesOperations", + "deleted_web_apps": "DeletedWebAppsOperations", + "diagnostics": "DiagnosticsOperations", + "global_model": "GlobalOperations", + "kube_environments": "KubeEnvironmentsOperations", + "provider": "ProviderOperations", + "recommendations": "RecommendationsOperations", + "resource_health_metadata": "ResourceHealthMetadataOperations", + "static_sites": "StaticSitesOperations", + "web_apps": "WebAppsOperations" + }, + "operation_mixins": { + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"ClientAuthenticationError\", \"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"], \"azure.core.paging\": [\"ItemPaged\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Iterable\", \"Optional\", \"TypeVar\", \"Union\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"ClientAuthenticationError\", \"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"], \"azure.core.async_paging\": [\"AsyncItemPaged\", \"AsyncList\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"AsyncIterable\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\", \"Union\"]}}}", + "operations": { + "generate_github_access_token_for_appservice_cli_async" : { + "sync": { + "signature": "def generate_github_access_token_for_appservice_cli_async(\n self,\n code, # type: str\n state, # type: str\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Exchange code for GitHub access token for AppService CLI.\n\nDescription for Exchange code for GitHub access token for AppService CLI.\n\n:param code: Code string to exchange for Github Access token.\n:type code: str\n:param state: State string used for verification.\n:type state: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AppserviceGithubToken, or the result of cls(response)\n:rtype: ~azure.mgmt.web.v2021_02_01.models.AppserviceGithubToken\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def generate_github_access_token_for_appservice_cli_async(\n self,\n code: str,\n state: str,\n **kwargs: Any\n) -\u003e \"_models.AppserviceGithubToken\":\n", + "doc": "\"\"\"Exchange code for GitHub access token for AppService CLI.\n\nDescription for Exchange code for GitHub access token for AppService CLI.\n\n:param code: Code string to exchange for Github Access token.\n:type code: str\n:param state: State string used for verification.\n:type state: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: AppserviceGithubToken, or the result of cls(response)\n:rtype: ~azure.mgmt.web.v2021_02_01.models.AppserviceGithubToken\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "code, state" + }, + "get_publishing_user" : { + "sync": { + "signature": "def get_publishing_user(\n self,\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Gets publishing user.\n\nDescription for Gets publishing user.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: User, or the result of cls(response)\n:rtype: ~azure.mgmt.web.v2021_02_01.models.User\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def get_publishing_user(\n self,\n **kwargs: Any\n) -\u003e \"_models.User\":\n", + "doc": "\"\"\"Gets publishing user.\n\nDescription for Gets publishing user.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: User, or the result of cls(response)\n:rtype: ~azure.mgmt.web.v2021_02_01.models.User\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "" + }, + "update_publishing_user" : { + "sync": { + "signature": "def update_publishing_user(\n self,\n user_details, # type: \"_models.User\"\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Updates publishing user.\n\nDescription for Updates publishing user.\n\n:param user_details: Details of publishing user.\n:type user_details: ~azure.mgmt.web.v2021_02_01.models.User\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: User, or the result of cls(response)\n:rtype: ~azure.mgmt.web.v2021_02_01.models.User\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def update_publishing_user(\n self,\n user_details: \"_models.User\",\n **kwargs: Any\n) -\u003e \"_models.User\":\n", + "doc": "\"\"\"Updates publishing user.\n\nDescription for Updates publishing user.\n\n:param user_details: Details of publishing user.\n:type user_details: ~azure.mgmt.web.v2021_02_01.models.User\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: User, or the result of cls(response)\n:rtype: ~azure.mgmt.web.v2021_02_01.models.User\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "user_details" + }, + "list_source_controls" : { + "sync": { + "signature": "def list_source_controls(\n self,\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Gets the source controls available for Azure websites.\n\nDescription for Gets the source controls available for Azure websites.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either SourceControlCollection or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.SourceControlCollection]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": false, + "signature": "def list_source_controls(\n self,\n **kwargs: Any\n) -\u003e AsyncItemPaged[\"_models.SourceControlCollection\"]:\n", + "doc": "\"\"\"Gets the source controls available for Azure websites.\n\nDescription for Gets the source controls available for Azure websites.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either SourceControlCollection or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.SourceControlCollection]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "" + }, + "get_source_control" : { + "sync": { + "signature": "def get_source_control(\n self,\n source_control_type, # type: str\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Gets source control token.\n\nDescription for Gets source control token.\n\n:param source_control_type: Type of source control.\n:type source_control_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SourceControl, or the result of cls(response)\n:rtype: ~azure.mgmt.web.v2021_02_01.models.SourceControl\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def get_source_control(\n self,\n source_control_type: str,\n **kwargs: Any\n) -\u003e \"_models.SourceControl\":\n", + "doc": "\"\"\"Gets source control token.\n\nDescription for Gets source control token.\n\n:param source_control_type: Type of source control.\n:type source_control_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SourceControl, or the result of cls(response)\n:rtype: ~azure.mgmt.web.v2021_02_01.models.SourceControl\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "source_control_type" + }, + "update_source_control" : { + "sync": { + "signature": "def update_source_control(\n self,\n source_control_type, # type: str\n request_message, # type: \"_models.SourceControl\"\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Updates source control token.\n\nDescription for Updates source control token.\n\n:param source_control_type: Type of source control.\n:type source_control_type: str\n:param request_message: Source control token information.\n:type request_message: ~azure.mgmt.web.v2021_02_01.models.SourceControl\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SourceControl, or the result of cls(response)\n:rtype: ~azure.mgmt.web.v2021_02_01.models.SourceControl\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def update_source_control(\n self,\n source_control_type: str,\n request_message: \"_models.SourceControl\",\n **kwargs: Any\n) -\u003e \"_models.SourceControl\":\n", + "doc": "\"\"\"Updates source control token.\n\nDescription for Updates source control token.\n\n:param source_control_type: Type of source control.\n:type source_control_type: str\n:param request_message: Source control token information.\n:type request_message: ~azure.mgmt.web.v2021_02_01.models.SourceControl\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SourceControl, or the result of cls(response)\n:rtype: ~azure.mgmt.web.v2021_02_01.models.SourceControl\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "source_control_type, request_message" + }, + "list_billing_meters" : { + "sync": { + "signature": "def list_billing_meters(\n self,\n billing_location=None, # type: Optional[str]\n os_type=None, # type: Optional[str]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Gets a list of meters for a given location.\n\nDescription for Gets a list of meters for a given location.\n\n:param billing_location: Azure Location of billable resource.\n:type billing_location: str\n:param os_type: App Service OS type meters used for.\n:type os_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either BillingMeterCollection or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.BillingMeterCollection]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": false, + "signature": "def list_billing_meters(\n self,\n billing_location: Optional[str] = None,\n os_type: Optional[str] = None,\n **kwargs: Any\n) -\u003e AsyncItemPaged[\"_models.BillingMeterCollection\"]:\n", + "doc": "\"\"\"Gets a list of meters for a given location.\n\nDescription for Gets a list of meters for a given location.\n\n:param billing_location: Azure Location of billable resource.\n:type billing_location: str\n:param os_type: App Service OS type meters used for.\n:type os_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either BillingMeterCollection or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.BillingMeterCollection]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "billing_location, os_type" + }, + "check_name_availability" : { + "sync": { + "signature": "def check_name_availability(\n self,\n name, # type: str\n type, # type: Union[str, \"_models.CheckNameResourceTypes\"]\n is_fqdn=None, # type: Optional[bool]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Check if a resource name is available.\n\nDescription for Check if a resource name is available.\n\n:param name: Resource name to verify.\n:type name: str\n:param type: Resource type used for verification.\n:type type: str or ~azure.mgmt.web.v2021_02_01.models.CheckNameResourceTypes\n:param is_fqdn: Is fully qualified domain name.\n:type is_fqdn: bool\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: ResourceNameAvailability, or the result of cls(response)\n:rtype: ~azure.mgmt.web.v2021_02_01.models.ResourceNameAvailability\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def check_name_availability(\n self,\n name: str,\n type: Union[str, \"_models.CheckNameResourceTypes\"],\n is_fqdn: Optional[bool] = None,\n **kwargs: Any\n) -\u003e \"_models.ResourceNameAvailability\":\n", + "doc": "\"\"\"Check if a resource name is available.\n\nDescription for Check if a resource name is available.\n\n:param name: Resource name to verify.\n:type name: str\n:param type: Resource type used for verification.\n:type type: str or ~azure.mgmt.web.v2021_02_01.models.CheckNameResourceTypes\n:param is_fqdn: Is fully qualified domain name.\n:type is_fqdn: bool\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: ResourceNameAvailability, or the result of cls(response)\n:rtype: ~azure.mgmt.web.v2021_02_01.models.ResourceNameAvailability\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "name, type, is_fqdn" + }, + "get_subscription_deployment_locations" : { + "sync": { + "signature": "def get_subscription_deployment_locations(\n self,\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Gets list of available geo regions plus ministamps.\n\nDescription for Gets list of available geo regions plus ministamps.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DeploymentLocations, or the result of cls(response)\n:rtype: ~azure.mgmt.web.v2021_02_01.models.DeploymentLocations\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def get_subscription_deployment_locations(\n self,\n **kwargs: Any\n) -\u003e \"_models.DeploymentLocations\":\n", + "doc": "\"\"\"Gets list of available geo regions plus ministamps.\n\nDescription for Gets list of available geo regions plus ministamps.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DeploymentLocations, or the result of cls(response)\n:rtype: ~azure.mgmt.web.v2021_02_01.models.DeploymentLocations\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "" + }, + "list_geo_regions" : { + "sync": { + "signature": "def list_geo_regions(\n self,\n sku=None, # type: Optional[Union[str, \"_models.SkuName\"]]\n linux_workers_enabled=None, # type: Optional[bool]\n xenon_workers_enabled=None, # type: Optional[bool]\n linux_dynamic_workers_enabled=None, # type: Optional[bool]\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Get a list of available geographical regions.\n\nDescription for Get a list of available geographical regions.\n\n:param sku: Name of SKU used to filter the regions.\n:type sku: str or ~azure.mgmt.web.v2021_02_01.models.SkuName\n:param linux_workers_enabled: Specify :code:`\u003ccode\u003etrue\u003c/code\u003e` if you want to filter to only\n regions that support Linux workers.\n:type linux_workers_enabled: bool\n:param xenon_workers_enabled: Specify :code:`\u003ccode\u003etrue\u003c/code\u003e` if you want to filter to only\n regions that support Xenon workers.\n:type xenon_workers_enabled: bool\n:param linux_dynamic_workers_enabled: Specify :code:`\u003ccode\u003etrue\u003c/code\u003e` if you want to filter\n to only regions that support Linux Consumption Workers.\n:type linux_dynamic_workers_enabled: bool\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either GeoRegionCollection or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.GeoRegionCollection]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": false, + "signature": "def list_geo_regions(\n self,\n sku: Optional[Union[str, \"_models.SkuName\"]] = None,\n linux_workers_enabled: Optional[bool] = None,\n xenon_workers_enabled: Optional[bool] = None,\n linux_dynamic_workers_enabled: Optional[bool] = None,\n **kwargs: Any\n) -\u003e AsyncItemPaged[\"_models.GeoRegionCollection\"]:\n", + "doc": "\"\"\"Get a list of available geographical regions.\n\nDescription for Get a list of available geographical regions.\n\n:param sku: Name of SKU used to filter the regions.\n:type sku: str or ~azure.mgmt.web.v2021_02_01.models.SkuName\n:param linux_workers_enabled: Specify :code:`\u003ccode\u003etrue\u003c/code\u003e` if you want to filter to only\n regions that support Linux workers.\n:type linux_workers_enabled: bool\n:param xenon_workers_enabled: Specify :code:`\u003ccode\u003etrue\u003c/code\u003e` if you want to filter to only\n regions that support Xenon workers.\n:type xenon_workers_enabled: bool\n:param linux_dynamic_workers_enabled: Specify :code:`\u003ccode\u003etrue\u003c/code\u003e` if you want to filter\n to only regions that support Linux Consumption Workers.\n:type linux_dynamic_workers_enabled: bool\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either GeoRegionCollection or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.GeoRegionCollection]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "sku, linux_workers_enabled, xenon_workers_enabled, linux_dynamic_workers_enabled" + }, + "list_site_identifiers_assigned_to_host_name" : { + "sync": { + "signature": "def list_site_identifiers_assigned_to_host_name(\n self,\n name_identifier, # type: \"_models.NameIdentifier\"\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"List all apps that are assigned to a hostname.\n\nDescription for List all apps that are assigned to a hostname.\n\n:param name_identifier: Hostname information.\n:type name_identifier: ~azure.mgmt.web.v2021_02_01.models.NameIdentifier\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either IdentifierCollection or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.IdentifierCollection]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": false, + "signature": "def list_site_identifiers_assigned_to_host_name(\n self,\n name_identifier: \"_models.NameIdentifier\",\n **kwargs: Any\n) -\u003e AsyncItemPaged[\"_models.IdentifierCollection\"]:\n", + "doc": "\"\"\"List all apps that are assigned to a hostname.\n\nDescription for List all apps that are assigned to a hostname.\n\n:param name_identifier: Hostname information.\n:type name_identifier: ~azure.mgmt.web.v2021_02_01.models.NameIdentifier\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either IdentifierCollection or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.IdentifierCollection]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "name_identifier" + }, + "list_premier_add_on_offers" : { + "sync": { + "signature": "def list_premier_add_on_offers(\n self,\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"List all premier add-on offers.\n\nDescription for List all premier add-on offers.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either PremierAddOnOfferCollection or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.PremierAddOnOfferCollection]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": false, + "signature": "def list_premier_add_on_offers(\n self,\n **kwargs: Any\n) -\u003e AsyncItemPaged[\"_models.PremierAddOnOfferCollection\"]:\n", + "doc": "\"\"\"List all premier add-on offers.\n\nDescription for List all premier add-on offers.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either PremierAddOnOfferCollection or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.PremierAddOnOfferCollection]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "" + }, + "list_skus" : { + "sync": { + "signature": "def list_skus(\n self,\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"List all SKUs.\n\nDescription for List all SKUs.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SkuInfos, or the result of cls(response)\n:rtype: ~azure.mgmt.web.v2021_02_01.models.SkuInfos\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def list_skus(\n self,\n **kwargs: Any\n) -\u003e \"_models.SkuInfos\":\n", + "doc": "\"\"\"List all SKUs.\n\nDescription for List all SKUs.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: SkuInfos, or the result of cls(response)\n:rtype: ~azure.mgmt.web.v2021_02_01.models.SkuInfos\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "" + }, + "verify_hosting_environment_vnet" : { + "sync": { + "signature": "def verify_hosting_environment_vnet(\n self,\n parameters, # type: \"_models.VnetParameters\"\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Verifies if this VNET is compatible with an App Service Environment by analyzing the Network Security Group rules.\n\nDescription for Verifies if this VNET is compatible with an App Service Environment by\nanalyzing the Network Security Group rules.\n\n:param parameters: VNET information.\n:type parameters: ~azure.mgmt.web.v2021_02_01.models.VnetParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: VnetValidationFailureDetails, or the result of cls(response)\n:rtype: ~azure.mgmt.web.v2021_02_01.models.VnetValidationFailureDetails\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def verify_hosting_environment_vnet(\n self,\n parameters: \"_models.VnetParameters\",\n **kwargs: Any\n) -\u003e \"_models.VnetValidationFailureDetails\":\n", + "doc": "\"\"\"Verifies if this VNET is compatible with an App Service Environment by analyzing the Network Security Group rules.\n\nDescription for Verifies if this VNET is compatible with an App Service Environment by\nanalyzing the Network Security Group rules.\n\n:param parameters: VNET information.\n:type parameters: ~azure.mgmt.web.v2021_02_01.models.VnetParameters\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: VnetValidationFailureDetails, or the result of cls(response)\n:rtype: ~azure.mgmt.web.v2021_02_01.models.VnetValidationFailureDetails\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "parameters" + }, + "move" : { + "sync": { + "signature": "def move(\n self,\n resource_group_name, # type: str\n move_resource_envelope, # type: \"_models.CsmMoveResourceEnvelope\"\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Move resources between resource groups.\n\nDescription for Move resources between resource groups.\n\n:param resource_group_name: Name of the resource group to which the resource belongs.\n:type resource_group_name: str\n:param move_resource_envelope: Object that represents the resource to move.\n:type move_resource_envelope: ~azure.mgmt.web.v2021_02_01.models.CsmMoveResourceEnvelope\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def move(\n self,\n resource_group_name: str,\n move_resource_envelope: \"_models.CsmMoveResourceEnvelope\",\n **kwargs: Any\n) -\u003e None:\n", + "doc": "\"\"\"Move resources between resource groups.\n\nDescription for Move resources between resource groups.\n\n:param resource_group_name: Name of the resource group to which the resource belongs.\n:type resource_group_name: str\n:param move_resource_envelope: Object that represents the resource to move.\n:type move_resource_envelope: ~azure.mgmt.web.v2021_02_01.models.CsmMoveResourceEnvelope\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "resource_group_name, move_resource_envelope" + }, + "validate" : { + "sync": { + "signature": "def validate(\n self,\n resource_group_name, # type: str\n validate_request, # type: \"_models.ValidateRequest\"\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Validate if a resource can be created.\n\nDescription for Validate if a resource can be created.\n\n:param resource_group_name: Name of the resource group to which the resource belongs.\n:type resource_group_name: str\n:param validate_request: Request with the resources to validate.\n:type validate_request: ~azure.mgmt.web.v2021_02_01.models.ValidateRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: ValidateResponse, or the result of cls(response)\n:rtype: ~azure.mgmt.web.v2021_02_01.models.ValidateResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def validate(\n self,\n resource_group_name: str,\n validate_request: \"_models.ValidateRequest\",\n **kwargs: Any\n) -\u003e \"_models.ValidateResponse\":\n", + "doc": "\"\"\"Validate if a resource can be created.\n\nDescription for Validate if a resource can be created.\n\n:param resource_group_name: Name of the resource group to which the resource belongs.\n:type resource_group_name: str\n:param validate_request: Request with the resources to validate.\n:type validate_request: ~azure.mgmt.web.v2021_02_01.models.ValidateRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: ValidateResponse, or the result of cls(response)\n:rtype: ~azure.mgmt.web.v2021_02_01.models.ValidateResponse\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "resource_group_name, validate_request" + }, + "validate_move" : { + "sync": { + "signature": "def validate_move(\n self,\n resource_group_name, # type: str\n move_resource_envelope, # type: \"_models.CsmMoveResourceEnvelope\"\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Validate whether a resource can be moved.\n\nDescription for Validate whether a resource can be moved.\n\n:param resource_group_name: Name of the resource group to which the resource belongs.\n:type resource_group_name: str\n:param move_resource_envelope: Object that represents the resource to move.\n:type move_resource_envelope: ~azure.mgmt.web.v2021_02_01.models.CsmMoveResourceEnvelope\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def validate_move(\n self,\n resource_group_name: str,\n move_resource_envelope: \"_models.CsmMoveResourceEnvelope\",\n **kwargs: Any\n) -\u003e None:\n", + "doc": "\"\"\"Validate whether a resource can be moved.\n\nDescription for Validate whether a resource can be moved.\n\n:param resource_group_name: Name of the resource group to which the resource belongs.\n:type resource_group_name: str\n:param move_resource_envelope: Object that represents the resource to move.\n:type move_resource_envelope: ~azure.mgmt.web.v2021_02_01.models.CsmMoveResourceEnvelope\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "resource_group_name, move_resource_envelope" + } + } + } +} \ No newline at end of file diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/_version.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/_version.py new file mode 100644 index 000000000000..34ea7990c4b4 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/_version.py @@ -0,0 +1,9 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +VERSION = "5.0.0" diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/_web_site_management_client.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/_web_site_management_client.py new file mode 100644 index 000000000000..6548486b8dd3 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/_web_site_management_client.py @@ -0,0 +1,175 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + from azure.core.credentials import TokenCredential + from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from ._configuration import WebSiteManagementClientConfiguration +from .operations import AppServiceCertificateOrdersOperations +from .operations import CertificateOrdersDiagnosticsOperations +from .operations import CertificateRegistrationProviderOperations +from .operations import DomainsOperations +from .operations import TopLevelDomainsOperations +from .operations import DomainRegistrationProviderOperations +from .operations import AppServiceEnvironmentsOperations +from .operations import AppServicePlansOperations +from .operations import CertificatesOperations +from .operations import DeletedWebAppsOperations +from .operations import DiagnosticsOperations +from .operations import GlobalOperations +from .operations import KubeEnvironmentsOperations +from .operations import ProviderOperations +from .operations import RecommendationsOperations +from .operations import ResourceHealthMetadataOperations +from .operations import WebSiteManagementClientOperationsMixin +from .operations import StaticSitesOperations +from .operations import WebAppsOperations +from . import models + + +class WebSiteManagementClient(WebSiteManagementClientOperationsMixin): + """WebSite Management Client. + + :ivar app_service_certificate_orders: AppServiceCertificateOrdersOperations operations + :vartype app_service_certificate_orders: azure.mgmt.web.v2021_02_01.operations.AppServiceCertificateOrdersOperations + :ivar certificate_orders_diagnostics: CertificateOrdersDiagnosticsOperations operations + :vartype certificate_orders_diagnostics: azure.mgmt.web.v2021_02_01.operations.CertificateOrdersDiagnosticsOperations + :ivar certificate_registration_provider: CertificateRegistrationProviderOperations operations + :vartype certificate_registration_provider: azure.mgmt.web.v2021_02_01.operations.CertificateRegistrationProviderOperations + :ivar domains: DomainsOperations operations + :vartype domains: azure.mgmt.web.v2021_02_01.operations.DomainsOperations + :ivar top_level_domains: TopLevelDomainsOperations operations + :vartype top_level_domains: azure.mgmt.web.v2021_02_01.operations.TopLevelDomainsOperations + :ivar domain_registration_provider: DomainRegistrationProviderOperations operations + :vartype domain_registration_provider: azure.mgmt.web.v2021_02_01.operations.DomainRegistrationProviderOperations + :ivar app_service_environments: AppServiceEnvironmentsOperations operations + :vartype app_service_environments: azure.mgmt.web.v2021_02_01.operations.AppServiceEnvironmentsOperations + :ivar app_service_plans: AppServicePlansOperations operations + :vartype app_service_plans: azure.mgmt.web.v2021_02_01.operations.AppServicePlansOperations + :ivar certificates: CertificatesOperations operations + :vartype certificates: azure.mgmt.web.v2021_02_01.operations.CertificatesOperations + :ivar deleted_web_apps: DeletedWebAppsOperations operations + :vartype deleted_web_apps: azure.mgmt.web.v2021_02_01.operations.DeletedWebAppsOperations + :ivar diagnostics: DiagnosticsOperations operations + :vartype diagnostics: azure.mgmt.web.v2021_02_01.operations.DiagnosticsOperations + :ivar global_model: GlobalOperations operations + :vartype global_model: azure.mgmt.web.v2021_02_01.operations.GlobalOperations + :ivar kube_environments: KubeEnvironmentsOperations operations + :vartype kube_environments: azure.mgmt.web.v2021_02_01.operations.KubeEnvironmentsOperations + :ivar provider: ProviderOperations operations + :vartype provider: azure.mgmt.web.v2021_02_01.operations.ProviderOperations + :ivar recommendations: RecommendationsOperations operations + :vartype recommendations: azure.mgmt.web.v2021_02_01.operations.RecommendationsOperations + :ivar resource_health_metadata: ResourceHealthMetadataOperations operations + :vartype resource_health_metadata: azure.mgmt.web.v2021_02_01.operations.ResourceHealthMetadataOperations + :ivar static_sites: StaticSitesOperations operations + :vartype static_sites: azure.mgmt.web.v2021_02_01.operations.StaticSitesOperations + :ivar web_apps: WebAppsOperations operations + :vartype web_apps: azure.mgmt.web.v2021_02_01.operations.WebAppsOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = WebSiteManagementClientConfiguration(credential, subscription_id, **kwargs) + self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + self.app_service_certificate_orders = AppServiceCertificateOrdersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.certificate_orders_diagnostics = CertificateOrdersDiagnosticsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.certificate_registration_provider = CertificateRegistrationProviderOperations( + self._client, self._config, self._serialize, self._deserialize) + self.domains = DomainsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.top_level_domains = TopLevelDomainsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.domain_registration_provider = DomainRegistrationProviderOperations( + self._client, self._config, self._serialize, self._deserialize) + self.app_service_environments = AppServiceEnvironmentsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.app_service_plans = AppServicePlansOperations( + self._client, self._config, self._serialize, self._deserialize) + self.certificates = CertificatesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.deleted_web_apps = DeletedWebAppsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.diagnostics = DiagnosticsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.global_model = GlobalOperations( + self._client, self._config, self._serialize, self._deserialize) + self.kube_environments = KubeEnvironmentsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.provider = ProviderOperations( + self._client, self._config, self._serialize, self._deserialize) + self.recommendations = RecommendationsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.resource_health_metadata = ResourceHealthMetadataOperations( + self._client, self._config, self._serialize, self._deserialize) + self.static_sites = StaticSitesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.web_apps = WebAppsOperations( + self._client, self._config, self._serialize, self._deserialize) + + def _send_request(self, http_request, **kwargs): + # type: (HttpRequest, Any) -> HttpResponse + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.HttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> WebSiteManagementClient + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/__init__.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/__init__.py new file mode 100644 index 000000000000..fc106a4f3d78 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/__init__.py @@ -0,0 +1,10 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._web_site_management_client import WebSiteManagementClient +__all__ = ['WebSiteManagementClient'] diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/_configuration.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/_configuration.py new file mode 100644 index 000000000000..9712d734446e --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/_configuration.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +from .._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + + +class WebSiteManagementClientConfiguration(Configuration): + """Configuration for WebSiteManagementClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + :type subscription_id: str + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(WebSiteManagementClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2021-02-01" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-web/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs: Any + ) -> None: + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/_web_site_management_client.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/_web_site_management_client.py new file mode 100644 index 000000000000..a2740b2b01fa --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/_web_site_management_client.py @@ -0,0 +1,168 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional, TYPE_CHECKING + +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +from ._configuration import WebSiteManagementClientConfiguration +from .operations import AppServiceCertificateOrdersOperations +from .operations import CertificateOrdersDiagnosticsOperations +from .operations import CertificateRegistrationProviderOperations +from .operations import DomainsOperations +from .operations import TopLevelDomainsOperations +from .operations import DomainRegistrationProviderOperations +from .operations import AppServiceEnvironmentsOperations +from .operations import AppServicePlansOperations +from .operations import CertificatesOperations +from .operations import DeletedWebAppsOperations +from .operations import DiagnosticsOperations +from .operations import GlobalOperations +from .operations import KubeEnvironmentsOperations +from .operations import ProviderOperations +from .operations import RecommendationsOperations +from .operations import ResourceHealthMetadataOperations +from .operations import WebSiteManagementClientOperationsMixin +from .operations import StaticSitesOperations +from .operations import WebAppsOperations +from .. import models + + +class WebSiteManagementClient(WebSiteManagementClientOperationsMixin): + """WebSite Management Client. + + :ivar app_service_certificate_orders: AppServiceCertificateOrdersOperations operations + :vartype app_service_certificate_orders: azure.mgmt.web.v2021_02_01.aio.operations.AppServiceCertificateOrdersOperations + :ivar certificate_orders_diagnostics: CertificateOrdersDiagnosticsOperations operations + :vartype certificate_orders_diagnostics: azure.mgmt.web.v2021_02_01.aio.operations.CertificateOrdersDiagnosticsOperations + :ivar certificate_registration_provider: CertificateRegistrationProviderOperations operations + :vartype certificate_registration_provider: azure.mgmt.web.v2021_02_01.aio.operations.CertificateRegistrationProviderOperations + :ivar domains: DomainsOperations operations + :vartype domains: azure.mgmt.web.v2021_02_01.aio.operations.DomainsOperations + :ivar top_level_domains: TopLevelDomainsOperations operations + :vartype top_level_domains: azure.mgmt.web.v2021_02_01.aio.operations.TopLevelDomainsOperations + :ivar domain_registration_provider: DomainRegistrationProviderOperations operations + :vartype domain_registration_provider: azure.mgmt.web.v2021_02_01.aio.operations.DomainRegistrationProviderOperations + :ivar app_service_environments: AppServiceEnvironmentsOperations operations + :vartype app_service_environments: azure.mgmt.web.v2021_02_01.aio.operations.AppServiceEnvironmentsOperations + :ivar app_service_plans: AppServicePlansOperations operations + :vartype app_service_plans: azure.mgmt.web.v2021_02_01.aio.operations.AppServicePlansOperations + :ivar certificates: CertificatesOperations operations + :vartype certificates: azure.mgmt.web.v2021_02_01.aio.operations.CertificatesOperations + :ivar deleted_web_apps: DeletedWebAppsOperations operations + :vartype deleted_web_apps: azure.mgmt.web.v2021_02_01.aio.operations.DeletedWebAppsOperations + :ivar diagnostics: DiagnosticsOperations operations + :vartype diagnostics: azure.mgmt.web.v2021_02_01.aio.operations.DiagnosticsOperations + :ivar global_model: GlobalOperations operations + :vartype global_model: azure.mgmt.web.v2021_02_01.aio.operations.GlobalOperations + :ivar kube_environments: KubeEnvironmentsOperations operations + :vartype kube_environments: azure.mgmt.web.v2021_02_01.aio.operations.KubeEnvironmentsOperations + :ivar provider: ProviderOperations operations + :vartype provider: azure.mgmt.web.v2021_02_01.aio.operations.ProviderOperations + :ivar recommendations: RecommendationsOperations operations + :vartype recommendations: azure.mgmt.web.v2021_02_01.aio.operations.RecommendationsOperations + :ivar resource_health_metadata: ResourceHealthMetadataOperations operations + :vartype resource_health_metadata: azure.mgmt.web.v2021_02_01.aio.operations.ResourceHealthMetadataOperations + :ivar static_sites: StaticSitesOperations operations + :vartype static_sites: azure.mgmt.web.v2021_02_01.aio.operations.StaticSitesOperations + :ivar web_apps: WebAppsOperations operations + :vartype web_apps: azure.mgmt.web.v2021_02_01.aio.operations.WebAppsOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = WebSiteManagementClientConfiguration(credential, subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + self.app_service_certificate_orders = AppServiceCertificateOrdersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.certificate_orders_diagnostics = CertificateOrdersDiagnosticsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.certificate_registration_provider = CertificateRegistrationProviderOperations( + self._client, self._config, self._serialize, self._deserialize) + self.domains = DomainsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.top_level_domains = TopLevelDomainsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.domain_registration_provider = DomainRegistrationProviderOperations( + self._client, self._config, self._serialize, self._deserialize) + self.app_service_environments = AppServiceEnvironmentsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.app_service_plans = AppServicePlansOperations( + self._client, self._config, self._serialize, self._deserialize) + self.certificates = CertificatesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.deleted_web_apps = DeletedWebAppsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.diagnostics = DiagnosticsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.global_model = GlobalOperations( + self._client, self._config, self._serialize, self._deserialize) + self.kube_environments = KubeEnvironmentsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.provider = ProviderOperations( + self._client, self._config, self._serialize, self._deserialize) + self.recommendations = RecommendationsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.resource_health_metadata = ResourceHealthMetadataOperations( + self._client, self._config, self._serialize, self._deserialize) + self.static_sites = StaticSitesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.web_apps = WebAppsOperations( + self._client, self._config, self._serialize, self._deserialize) + + async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "WebSiteManagementClient": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/__init__.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/__init__.py new file mode 100644 index 000000000000..5c7f8e46e95e --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/__init__.py @@ -0,0 +1,49 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._app_service_certificate_orders_operations import AppServiceCertificateOrdersOperations +from ._certificate_orders_diagnostics_operations import CertificateOrdersDiagnosticsOperations +from ._certificate_registration_provider_operations import CertificateRegistrationProviderOperations +from ._domains_operations import DomainsOperations +from ._top_level_domains_operations import TopLevelDomainsOperations +from ._domain_registration_provider_operations import DomainRegistrationProviderOperations +from ._app_service_environments_operations import AppServiceEnvironmentsOperations +from ._app_service_plans_operations import AppServicePlansOperations +from ._certificates_operations import CertificatesOperations +from ._deleted_web_apps_operations import DeletedWebAppsOperations +from ._diagnostics_operations import DiagnosticsOperations +from ._global_model_operations import GlobalOperations +from ._kube_environments_operations import KubeEnvironmentsOperations +from ._provider_operations import ProviderOperations +from ._recommendations_operations import RecommendationsOperations +from ._resource_health_metadata_operations import ResourceHealthMetadataOperations +from ._web_site_management_client_operations import WebSiteManagementClientOperationsMixin +from ._static_sites_operations import StaticSitesOperations +from ._web_apps_operations import WebAppsOperations + +__all__ = [ + 'AppServiceCertificateOrdersOperations', + 'CertificateOrdersDiagnosticsOperations', + 'CertificateRegistrationProviderOperations', + 'DomainsOperations', + 'TopLevelDomainsOperations', + 'DomainRegistrationProviderOperations', + 'AppServiceEnvironmentsOperations', + 'AppServicePlansOperations', + 'CertificatesOperations', + 'DeletedWebAppsOperations', + 'DiagnosticsOperations', + 'GlobalOperations', + 'KubeEnvironmentsOperations', + 'ProviderOperations', + 'RecommendationsOperations', + 'ResourceHealthMetadataOperations', + 'WebSiteManagementClientOperationsMixin', + 'StaticSitesOperations', + 'WebAppsOperations', +] diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_app_service_certificate_orders_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_app_service_certificate_orders_operations.py new file mode 100644 index 000000000000..27dd60c5b88c --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_app_service_certificate_orders_operations.py @@ -0,0 +1,1490 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, List, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class AppServiceCertificateOrdersOperations: + """AppServiceCertificateOrdersOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2021_02_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs: Any + ) -> AsyncIterable["_models.AppServiceCertificateOrderCollection"]: + """List all certificate orders in a subscription. + + Description for List all certificate orders in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AppServiceCertificateOrderCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.AppServiceCertificateOrderCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateOrderCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AppServiceCertificateOrderCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CertificateRegistration/certificateOrders'} # type: ignore + + async def validate_purchase_information( + self, + app_service_certificate_order: "_models.AppServiceCertificateOrder", + **kwargs: Any + ) -> None: + """Validate information for a certificate order. + + Description for Validate information for a certificate order. + + :param app_service_certificate_order: Information for a certificate order. + :type app_service_certificate_order: ~azure.mgmt.web.v2021_02_01.models.AppServiceCertificateOrder + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.validate_purchase_information.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(app_service_certificate_order, 'AppServiceCertificateOrder') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + validate_purchase_information.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CertificateRegistration/validateCertificateRegistrationInformation'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.AppServiceCertificateOrderCollection"]: + """Get certificate orders in a resource group. + + Description for Get certificate orders in a resource group. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AppServiceCertificateOrderCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.AppServiceCertificateOrderCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateOrderCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AppServiceCertificateOrderCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders'} # type: ignore + + async def get( + self, + resource_group_name: str, + certificate_order_name: str, + **kwargs: Any + ) -> "_models.AppServiceCertificateOrder": + """Get a certificate order. + + Description for Get a certificate order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order.. + :type certificate_order_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AppServiceCertificateOrder, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.AppServiceCertificateOrder + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateOrder"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AppServiceCertificateOrder', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + certificate_order_name: str, + certificate_distinguished_name: "_models.AppServiceCertificateOrder", + **kwargs: Any + ) -> "_models.AppServiceCertificateOrder": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateOrder"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(certificate_distinguished_name, 'AppServiceCertificateOrder') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AppServiceCertificateOrder', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('AppServiceCertificateOrder', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + certificate_order_name: str, + certificate_distinguished_name: "_models.AppServiceCertificateOrder", + **kwargs: Any + ) -> AsyncLROPoller["_models.AppServiceCertificateOrder"]: + """Create or update a certificate purchase order. + + Description for Create or update a certificate purchase order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :param certificate_distinguished_name: Distinguished name to use for the certificate order. + :type certificate_distinguished_name: ~azure.mgmt.web.v2021_02_01.models.AppServiceCertificateOrder + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either AppServiceCertificateOrder or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2021_02_01.models.AppServiceCertificateOrder] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateOrder"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + certificate_order_name=certificate_order_name, + certificate_distinguished_name=certificate_distinguished_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AppServiceCertificateOrder', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + certificate_order_name: str, + **kwargs: Any + ) -> None: + """Delete an existing certificate order. + + Description for Delete an existing certificate order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}'} # type: ignore + + async def update( + self, + resource_group_name: str, + certificate_order_name: str, + certificate_distinguished_name: "_models.AppServiceCertificateOrderPatchResource", + **kwargs: Any + ) -> "_models.AppServiceCertificateOrder": + """Create or update a certificate purchase order. + + Description for Create or update a certificate purchase order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :param certificate_distinguished_name: Distinguished name to use for the certificate order. + :type certificate_distinguished_name: ~azure.mgmt.web.v2021_02_01.models.AppServiceCertificateOrderPatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AppServiceCertificateOrder, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.AppServiceCertificateOrder + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateOrder"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(certificate_distinguished_name, 'AppServiceCertificateOrderPatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AppServiceCertificateOrder', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}'} # type: ignore + + def list_certificates( + self, + resource_group_name: str, + certificate_order_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.AppServiceCertificateCollection"]: + """List all certificates associated with a certificate order. + + Description for List all certificates associated with a certificate order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AppServiceCertificateCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.AppServiceCertificateCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_certificates.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AppServiceCertificateCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates'} # type: ignore + + async def get_certificate( + self, + resource_group_name: str, + certificate_order_name: str, + name: str, + **kwargs: Any + ) -> "_models.AppServiceCertificateResource": + """Get the certificate associated with a certificate order. + + Description for Get the certificate associated with a certificate order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :param name: Name of the certificate. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AppServiceCertificateResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.AppServiceCertificateResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_certificate.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AppServiceCertificateResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}'} # type: ignore + + async def _create_or_update_certificate_initial( + self, + resource_group_name: str, + certificate_order_name: str, + name: str, + key_vault_certificate: "_models.AppServiceCertificateResource", + **kwargs: Any + ) -> "_models.AppServiceCertificateResource": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_certificate_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(key_vault_certificate, 'AppServiceCertificateResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AppServiceCertificateResource', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('AppServiceCertificateResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_certificate_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}'} # type: ignore + + async def begin_create_or_update_certificate( + self, + resource_group_name: str, + certificate_order_name: str, + name: str, + key_vault_certificate: "_models.AppServiceCertificateResource", + **kwargs: Any + ) -> AsyncLROPoller["_models.AppServiceCertificateResource"]: + """Creates or updates a certificate and associates with key vault secret. + + Description for Creates or updates a certificate and associates with key vault secret. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :param name: Name of the certificate. + :type name: str + :param key_vault_certificate: Key vault certificate resource Id. + :type key_vault_certificate: ~azure.mgmt.web.v2021_02_01.models.AppServiceCertificateResource + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either AppServiceCertificateResource or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2021_02_01.models.AppServiceCertificateResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_certificate_initial( + resource_group_name=resource_group_name, + certificate_order_name=certificate_order_name, + name=name, + key_vault_certificate=key_vault_certificate, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AppServiceCertificateResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}'} # type: ignore + + async def delete_certificate( + self, + resource_group_name: str, + certificate_order_name: str, + name: str, + **kwargs: Any + ) -> None: + """Delete the certificate associated with a certificate order. + + Description for Delete the certificate associated with a certificate order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :param name: Name of the certificate. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_certificate.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}'} # type: ignore + + async def update_certificate( + self, + resource_group_name: str, + certificate_order_name: str, + name: str, + key_vault_certificate: "_models.AppServiceCertificatePatchResource", + **kwargs: Any + ) -> "_models.AppServiceCertificateResource": + """Creates or updates a certificate and associates with key vault secret. + + Description for Creates or updates a certificate and associates with key vault secret. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :param name: Name of the certificate. + :type name: str + :param key_vault_certificate: Key vault certificate resource Id. + :type key_vault_certificate: ~azure.mgmt.web.v2021_02_01.models.AppServiceCertificatePatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AppServiceCertificateResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.AppServiceCertificateResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_certificate.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(key_vault_certificate, 'AppServiceCertificatePatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AppServiceCertificateResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}'} # type: ignore + + async def reissue( + self, + resource_group_name: str, + certificate_order_name: str, + reissue_certificate_order_request: "_models.ReissueCertificateOrderRequest", + **kwargs: Any + ) -> None: + """Reissue an existing certificate order. + + Description for Reissue an existing certificate order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :param reissue_certificate_order_request: Parameters for the reissue. + :type reissue_certificate_order_request: ~azure.mgmt.web.v2021_02_01.models.ReissueCertificateOrderRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.reissue.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(reissue_certificate_order_request, 'ReissueCertificateOrderRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + reissue.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/reissue'} # type: ignore + + async def renew( + self, + resource_group_name: str, + certificate_order_name: str, + renew_certificate_order_request: "_models.RenewCertificateOrderRequest", + **kwargs: Any + ) -> None: + """Renew an existing certificate order. + + Description for Renew an existing certificate order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :param renew_certificate_order_request: Renew parameters. + :type renew_certificate_order_request: ~azure.mgmt.web.v2021_02_01.models.RenewCertificateOrderRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.renew.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(renew_certificate_order_request, 'RenewCertificateOrderRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + renew.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/renew'} # type: ignore + + async def resend_email( + self, + resource_group_name: str, + certificate_order_name: str, + **kwargs: Any + ) -> None: + """Resend certificate email. + + Description for Resend certificate email. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.resend_email.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + resend_email.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/resendEmail'} # type: ignore + + async def resend_request_emails( + self, + resource_group_name: str, + certificate_order_name: str, + name_identifier: "_models.NameIdentifier", + **kwargs: Any + ) -> None: + """Resend domain verification email to customer for this certificate order. + + Resend domain verification ownership email containing steps on how to verify a domain for a + given certificate order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :param name_identifier: Email address. + :type name_identifier: ~azure.mgmt.web.v2021_02_01.models.NameIdentifier + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.resend_request_emails.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(name_identifier, 'NameIdentifier') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + resend_request_emails.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/resendRequestEmails'} # type: ignore + + async def retrieve_site_seal( + self, + resource_group_name: str, + certificate_order_name: str, + site_seal_request: "_models.SiteSealRequest", + **kwargs: Any + ) -> "_models.SiteSeal": + """This method is used to obtain the site seal information for an issued certificate. + + This method is used to obtain the site seal information for an issued certificate. A site seal + is a graphic that the certificate purchaser can embed on their web site to show their visitors + information about their SSL certificate. If a web site visitor clicks on the site seal image, a + pop-up page is displayed that contains detailed information about the SSL certificate. The site + seal token is used to link the site seal graphic image to the appropriate certificate details + pop-up page display when a user clicks on the site seal. The site seal images are expected to + be static images and hosted by the reseller, to minimize delays for customer page load times. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :param site_seal_request: Site seal request. + :type site_seal_request: ~azure.mgmt.web.v2021_02_01.models.SiteSealRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteSeal, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SiteSeal + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteSeal"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.retrieve_site_seal.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_seal_request, 'SiteSealRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteSeal', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + retrieve_site_seal.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/retrieveSiteSeal'} # type: ignore + + async def verify_domain_ownership( + self, + resource_group_name: str, + certificate_order_name: str, + **kwargs: Any + ) -> None: + """Verify domain ownership for this certificate order. + + Description for Verify domain ownership for this certificate order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.verify_domain_ownership.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + verify_domain_ownership.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/verifyDomainOwnership'} # type: ignore + + async def retrieve_certificate_actions( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> List["_models.CertificateOrderAction"]: + """Retrieve the list of certificate actions. + + Description for Retrieve the list of certificate actions. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the certificate order. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of CertificateOrderAction, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2021_02_01.models.CertificateOrderAction] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.CertificateOrderAction"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.retrieve_certificate_actions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[CertificateOrderAction]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + retrieve_certificate_actions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{name}/retrieveCertificateActions'} # type: ignore + + async def retrieve_certificate_email_history( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> List["_models.CertificateEmail"]: + """Retrieve email history. + + Description for Retrieve email history. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the certificate order. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of CertificateEmail, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2021_02_01.models.CertificateEmail] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.CertificateEmail"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.retrieve_certificate_email_history.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[CertificateEmail]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + retrieve_certificate_email_history.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{name}/retrieveEmailHistory'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_app_service_environments_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_app_service_environments_operations.py new file mode 100644 index 000000000000..fc815bb6fc76 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_app_service_environments_operations.py @@ -0,0 +1,3848 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, List, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class AppServiceEnvironmentsOperations: + """AppServiceEnvironmentsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2021_02_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs: Any + ) -> AsyncIterable["_models.AppServiceEnvironmentCollection"]: + """Get all App Service Environments for a subscription. + + Description for Get all App Service Environments for a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AppServiceEnvironmentCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.AppServiceEnvironmentCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceEnvironmentCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AppServiceEnvironmentCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/hostingEnvironments'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.AppServiceEnvironmentCollection"]: + """Get all App Service Environments in a resource group. + + Description for Get all App Service Environments in a resource group. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AppServiceEnvironmentCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.AppServiceEnvironmentCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceEnvironmentCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AppServiceEnvironmentCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments'} # type: ignore + + async def get( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> "_models.AppServiceEnvironmentResource": + """Get the properties of an App Service Environment. + + Description for Get the properties of an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AppServiceEnvironmentResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.AppServiceEnvironmentResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceEnvironmentResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AppServiceEnvironmentResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + name: str, + hosting_environment_envelope: "_models.AppServiceEnvironmentResource", + **kwargs: Any + ) -> "_models.AppServiceEnvironmentResource": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceEnvironmentResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(hosting_environment_envelope, 'AppServiceEnvironmentResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AppServiceEnvironmentResource', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('AppServiceEnvironmentResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('AppServiceEnvironmentResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + name: str, + hosting_environment_envelope: "_models.AppServiceEnvironmentResource", + **kwargs: Any + ) -> AsyncLROPoller["_models.AppServiceEnvironmentResource"]: + """Create or update an App Service Environment. + + Description for Create or update an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param hosting_environment_envelope: Configuration details of the App Service Environment. + :type hosting_environment_envelope: ~azure.mgmt.web.v2021_02_01.models.AppServiceEnvironmentResource + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either AppServiceEnvironmentResource or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2021_02_01.models.AppServiceEnvironmentResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceEnvironmentResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + name=name, + hosting_environment_envelope=hosting_environment_envelope, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AppServiceEnvironmentResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + name: str, + force_delete: Optional[bool] = None, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if force_delete is not None: + query_parameters['forceDelete'] = self._serialize.query("force_delete", force_delete, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + name: str, + force_delete: Optional[bool] = None, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete an App Service Environment. + + Description for Delete an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param force_delete: Specify :code:`true` to force the deletion even if the App + Service Environment contains resources. The default is :code:`false`. + :type force_delete: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + name=name, + force_delete=force_delete, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}'} # type: ignore + + async def update( + self, + resource_group_name: str, + name: str, + hosting_environment_envelope: "_models.AppServiceEnvironmentPatchResource", + **kwargs: Any + ) -> "_models.AppServiceEnvironmentResource": + """Create or update an App Service Environment. + + Description for Create or update an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param hosting_environment_envelope: Configuration details of the App Service Environment. + :type hosting_environment_envelope: ~azure.mgmt.web.v2021_02_01.models.AppServiceEnvironmentPatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AppServiceEnvironmentResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.AppServiceEnvironmentResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceEnvironmentResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(hosting_environment_envelope, 'AppServiceEnvironmentPatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AppServiceEnvironmentResource', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('AppServiceEnvironmentResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('AppServiceEnvironmentResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}'} # type: ignore + + def list_capacities( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> AsyncIterable["_models.StampCapacityCollection"]: + """Get the used, available, and total worker capacity an App Service Environment. + + Description for Get the used, available, and total worker capacity an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StampCapacityCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.StampCapacityCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StampCapacityCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_capacities.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('StampCapacityCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_capacities.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/capacities/compute'} # type: ignore + + async def get_vip_info( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> "_models.AddressResponse": + """Get IP addresses assigned to an App Service Environment. + + Description for Get IP addresses assigned to an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AddressResponse, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.AddressResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AddressResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_vip_info.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AddressResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_vip_info.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/capacities/virtualip'} # type: ignore + + async def _change_vnet_initial( + self, + resource_group_name: str, + name: str, + vnet_info: "_models.VirtualNetworkProfile", + **kwargs: Any + ) -> "_models.WebAppCollection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._change_vnet_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(vnet_info, 'VirtualNetworkProfile') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('WebAppCollection', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('WebAppCollection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _change_vnet_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/changeVirtualNetwork'} # type: ignore + + async def begin_change_vnet( + self, + resource_group_name: str, + name: str, + vnet_info: "_models.VirtualNetworkProfile", + **kwargs: Any + ) -> AsyncLROPoller[AsyncItemPaged["_models.WebAppCollection"]]: + """Move an App Service Environment to a different VNET. + + Description for Move an App Service Environment to a different VNET. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param vnet_info: Details for the new virtual network. + :type vnet_info: ~azure.mgmt.web.v2021_02_01.models.VirtualNetworkProfile + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns an iterator like instance of either WebAppCollection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.WebAppCollection]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = "application/json" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.change_vnet.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(vnet_info, 'VirtualNetworkProfile') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(vnet_info, 'VirtualNetworkProfile') + body_content_kwargs['content'] = body_content + request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._change_vnet_initial( + resource_group_name=resource_group_name, + name=name, + vnet_info=vnet_info, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): + async def internal_get_next(next_link=None): + if next_link is None: + return pipeline_response + else: + return await get_next(next_link) + + return AsyncItemPaged( + internal_get_next, extract_data + ) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_change_vnet.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/changeVirtualNetwork'} # type: ignore + + async def get_ase_v3_networking_configuration( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> "_models.AseV3NetworkingConfiguration": + """Get networking configuration of an App Service Environment. + + Description for Get networking configuration of an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AseV3NetworkingConfiguration, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.AseV3NetworkingConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AseV3NetworkingConfiguration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_ase_v3_networking_configuration.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AseV3NetworkingConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_ase_v3_networking_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/configurations/networking'} # type: ignore + + async def update_ase_networking_configuration( + self, + resource_group_name: str, + name: str, + ase_networking_configuration: "_models.AseV3NetworkingConfiguration", + **kwargs: Any + ) -> "_models.AseV3NetworkingConfiguration": + """Update networking configuration of an App Service Environment. + + Description for Update networking configuration of an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param ase_networking_configuration: + :type ase_networking_configuration: ~azure.mgmt.web.v2021_02_01.models.AseV3NetworkingConfiguration + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AseV3NetworkingConfiguration, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.AseV3NetworkingConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AseV3NetworkingConfiguration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_ase_networking_configuration.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(ase_networking_configuration, 'AseV3NetworkingConfiguration') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AseV3NetworkingConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_ase_networking_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/configurations/networking'} # type: ignore + + async def list_diagnostics( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> List["_models.HostingEnvironmentDiagnostics"]: + """Get diagnostic information for an App Service Environment. + + Description for Get diagnostic information for an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of HostingEnvironmentDiagnostics, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2021_02_01.models.HostingEnvironmentDiagnostics] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.HostingEnvironmentDiagnostics"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_diagnostics.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[HostingEnvironmentDiagnostics]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_diagnostics.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/diagnostics'} # type: ignore + + async def get_diagnostics_item( + self, + resource_group_name: str, + name: str, + diagnostics_name: str, + **kwargs: Any + ) -> "_models.HostingEnvironmentDiagnostics": + """Get a diagnostics item for an App Service Environment. + + Description for Get a diagnostics item for an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param diagnostics_name: Name of the diagnostics item. + :type diagnostics_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HostingEnvironmentDiagnostics, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.HostingEnvironmentDiagnostics + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HostingEnvironmentDiagnostics"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_diagnostics_item.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'diagnosticsName': self._serialize.url("diagnostics_name", diagnostics_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HostingEnvironmentDiagnostics', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_diagnostics_item.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/diagnostics/{diagnosticsName}'} # type: ignore + + def get_inbound_network_dependencies_endpoints( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> AsyncIterable["_models.InboundEnvironmentEndpointCollection"]: + """Get the network endpoints of all inbound dependencies of an App Service Environment. + + Description for Get the network endpoints of all inbound dependencies of an App Service + Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either InboundEnvironmentEndpointCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.InboundEnvironmentEndpointCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundEnvironmentEndpointCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_inbound_network_dependencies_endpoints.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('InboundEnvironmentEndpointCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + get_inbound_network_dependencies_endpoints.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/inboundNetworkDependenciesEndpoints'} # type: ignore + + def list_multi_role_pools( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> AsyncIterable["_models.WorkerPoolCollection"]: + """Get all multi-role pools. + + Description for Get all multi-role pools. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WorkerPoolCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.WorkerPoolCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkerPoolCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_multi_role_pools.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WorkerPoolCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_multi_role_pools.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools'} # type: ignore + + async def get_multi_role_pool( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> "_models.WorkerPoolResource": + """Get properties of a multi-role pool. + + Description for Get properties of a multi-role pool. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkerPoolResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.WorkerPoolResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkerPoolResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_multi_role_pool.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_multi_role_pool.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default'} # type: ignore + + async def _create_or_update_multi_role_pool_initial( + self, + resource_group_name: str, + name: str, + multi_role_pool_envelope: "_models.WorkerPoolResource", + **kwargs: Any + ) -> "_models.WorkerPoolResource": + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkerPoolResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_multi_role_pool_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(multi_role_pool_envelope, 'WorkerPoolResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_multi_role_pool_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default'} # type: ignore + + async def begin_create_or_update_multi_role_pool( + self, + resource_group_name: str, + name: str, + multi_role_pool_envelope: "_models.WorkerPoolResource", + **kwargs: Any + ) -> AsyncLROPoller["_models.WorkerPoolResource"]: + """Create or update a multi-role pool. + + Description for Create or update a multi-role pool. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param multi_role_pool_envelope: Properties of the multi-role pool. + :type multi_role_pool_envelope: ~azure.mgmt.web.v2021_02_01.models.WorkerPoolResource + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either WorkerPoolResource or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2021_02_01.models.WorkerPoolResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkerPoolResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_multi_role_pool_initial( + resource_group_name=resource_group_name, + name=name, + multi_role_pool_envelope=multi_role_pool_envelope, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update_multi_role_pool.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default'} # type: ignore + + async def update_multi_role_pool( + self, + resource_group_name: str, + name: str, + multi_role_pool_envelope: "_models.WorkerPoolResource", + **kwargs: Any + ) -> "_models.WorkerPoolResource": + """Create or update a multi-role pool. + + Description for Create or update a multi-role pool. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param multi_role_pool_envelope: Properties of the multi-role pool. + :type multi_role_pool_envelope: ~azure.mgmt.web.v2021_02_01.models.WorkerPoolResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkerPoolResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.WorkerPoolResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkerPoolResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_multi_role_pool.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(multi_role_pool_envelope, 'WorkerPoolResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_multi_role_pool.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default'} # type: ignore + + def list_multi_role_pool_instance_metric_definitions( + self, + resource_group_name: str, + name: str, + instance: str, + **kwargs: Any + ) -> AsyncIterable["_models.ResourceMetricDefinitionCollection"]: + """Get metric definitions for a specific instance of a multi-role pool of an App Service Environment. + + Description for Get metric definitions for a specific instance of a multi-role pool of an App + Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param instance: Name of the instance in the multi-role pool. + :type instance: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceMetricDefinitionCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.ResourceMetricDefinitionCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceMetricDefinitionCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_multi_role_pool_instance_metric_definitions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'instance': self._serialize.url("instance", instance, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceMetricDefinitionCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_multi_role_pool_instance_metric_definitions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/instances/{instance}/metricdefinitions'} # type: ignore + + def list_multi_role_metric_definitions( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> AsyncIterable["_models.ResourceMetricDefinitionCollection"]: + """Get metric definitions for a multi-role pool of an App Service Environment. + + Description for Get metric definitions for a multi-role pool of an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceMetricDefinitionCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.ResourceMetricDefinitionCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceMetricDefinitionCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_multi_role_metric_definitions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceMetricDefinitionCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_multi_role_metric_definitions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/metricdefinitions'} # type: ignore + + def list_multi_role_pool_skus( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> AsyncIterable["_models.SkuInfoCollection"]: + """Get available SKUs for scaling a multi-role pool. + + Description for Get available SKUs for scaling a multi-role pool. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SkuInfoCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.SkuInfoCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_multi_role_pool_skus.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SkuInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_multi_role_pool_skus.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/skus'} # type: ignore + + def list_multi_role_usages( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> AsyncIterable["_models.UsageCollection"]: + """Get usage metrics for a multi-role pool of an App Service Environment. + + Description for Get usage metrics for a multi-role pool of an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either UsageCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.UsageCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsageCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_multi_role_usages.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('UsageCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_multi_role_usages.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/usages'} # type: ignore + + async def list_operations( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> List["_models.Operation"]: + """List all currently running operations on the App Service Environment. + + Description for List all currently running operations on the App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of Operation, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2021_02_01.models.Operation] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.Operation"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_operations.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[Operation]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_operations.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/operations'} # type: ignore + + def get_outbound_network_dependencies_endpoints( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> AsyncIterable["_models.OutboundEnvironmentEndpointCollection"]: + """Get the network endpoints of all outbound dependencies of an App Service Environment. + + Description for Get the network endpoints of all outbound dependencies of an App Service + Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OutboundEnvironmentEndpointCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.OutboundEnvironmentEndpointCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundEnvironmentEndpointCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_outbound_network_dependencies_endpoints.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('OutboundEnvironmentEndpointCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + get_outbound_network_dependencies_endpoints.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/outboundNetworkDependenciesEndpoints'} # type: ignore + + def get_private_endpoint_connection_list( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> AsyncIterable["_models.PrivateEndpointConnectionCollection"]: + """Gets the list of private endpoints associated with a hosting environment. + + Description for Gets the list of private endpoints associated with a hosting environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PrivateEndpointConnectionCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.PrivateEndpointConnectionCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_private_endpoint_connection_list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('PrivateEndpointConnectionCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + get_private_endpoint_connection_list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/privateEndpointConnections'} # type: ignore + + async def get_private_endpoint_connection( + self, + resource_group_name: str, + name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> "_models.RemotePrivateEndpointConnectionARMResource": + """Gets a private endpoint connection. + + Description for Gets a private endpoint connection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param private_endpoint_connection_name: Name of the private endpoint connection. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RemotePrivateEndpointConnectionARMResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.RemotePrivateEndpointConnectionARMResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RemotePrivateEndpointConnectionARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_private_endpoint_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RemotePrivateEndpointConnectionARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_private_endpoint_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def _approve_or_reject_private_endpoint_connection_initial( + self, + resource_group_name: str, + name: str, + private_endpoint_connection_name: str, + private_endpoint_wrapper: "_models.PrivateLinkConnectionApprovalRequestResource", + **kwargs: Any + ) -> "_models.RemotePrivateEndpointConnectionARMResource": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RemotePrivateEndpointConnectionARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._approve_or_reject_private_endpoint_connection_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(private_endpoint_wrapper, 'PrivateLinkConnectionApprovalRequestResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('RemotePrivateEndpointConnectionARMResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('RemotePrivateEndpointConnectionARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _approve_or_reject_private_endpoint_connection_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def begin_approve_or_reject_private_endpoint_connection( + self, + resource_group_name: str, + name: str, + private_endpoint_connection_name: str, + private_endpoint_wrapper: "_models.PrivateLinkConnectionApprovalRequestResource", + **kwargs: Any + ) -> AsyncLROPoller["_models.RemotePrivateEndpointConnectionARMResource"]: + """Approves or rejects a private endpoint connection. + + Description for Approves or rejects a private endpoint connection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param private_endpoint_connection_name: + :type private_endpoint_connection_name: str + :param private_endpoint_wrapper: + :type private_endpoint_wrapper: ~azure.mgmt.web.v2021_02_01.models.PrivateLinkConnectionApprovalRequestResource + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either RemotePrivateEndpointConnectionARMResource or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2021_02_01.models.RemotePrivateEndpointConnectionARMResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RemotePrivateEndpointConnectionARMResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._approve_or_reject_private_endpoint_connection_initial( + resource_group_name=resource_group_name, + name=name, + private_endpoint_connection_name=private_endpoint_connection_name, + private_endpoint_wrapper=private_endpoint_wrapper, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('RemotePrivateEndpointConnectionARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_approve_or_reject_private_endpoint_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def _delete_private_endpoint_connection_initial( + self, + resource_group_name: str, + name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> Any: + cls = kwargs.pop('cls', None) # type: ClsType[Any] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._delete_private_endpoint_connection_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('object', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('object', pipeline_response) + + if response.status_code == 204: + deserialized = self._deserialize('object', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _delete_private_endpoint_connection_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def begin_delete_private_endpoint_connection( + self, + resource_group_name: str, + name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> AsyncLROPoller[Any]: + """Deletes a private endpoint connection. + + Description for Deletes a private endpoint connection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param private_endpoint_connection_name: + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either any or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[any] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[Any] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_private_endpoint_connection_initial( + resource_group_name=resource_group_name, + name=name, + private_endpoint_connection_name=private_endpoint_connection_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('object', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete_private_endpoint_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def get_private_link_resources( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> "_models.PrivateLinkResourcesWrapper": + """Gets the private link resources. + + Description for Gets the private link resources. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkResourcesWrapper, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.PrivateLinkResourcesWrapper + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourcesWrapper"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_private_link_resources.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateLinkResourcesWrapper', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_private_link_resources.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/privateLinkResources'} # type: ignore + + async def reboot( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> None: + """Reboot all machines in an App Service Environment. + + Description for Reboot all machines in an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.reboot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + reboot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/reboot'} # type: ignore + + async def _resume_initial( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> "_models.WebAppCollection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._resume_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('WebAppCollection', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('WebAppCollection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _resume_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/resume'} # type: ignore + + async def begin_resume( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> AsyncLROPoller[AsyncItemPaged["_models.WebAppCollection"]]: + """Resume an App Service Environment. + + Description for Resume an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns an iterator like instance of either WebAppCollection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.WebAppCollection]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.resume.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._resume_initial( + resource_group_name=resource_group_name, + name=name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): + async def internal_get_next(next_link=None): + if next_link is None: + return pipeline_response + else: + return await get_next(next_link) + + return AsyncItemPaged( + internal_get_next, extract_data + ) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_resume.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/resume'} # type: ignore + + def list_app_service_plans( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> AsyncIterable["_models.AppServicePlanCollection"]: + """Get all App Service plans in an App Service Environment. + + Description for Get all App Service plans in an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AppServicePlanCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.AppServicePlanCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServicePlanCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_app_service_plans.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AppServicePlanCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_app_service_plans.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/serverfarms'} # type: ignore + + def list_web_apps( + self, + resource_group_name: str, + name: str, + properties_to_include: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.WebAppCollection"]: + """Get all apps in an App Service Environment. + + Description for Get all apps in an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param properties_to_include: Comma separated list of app properties to include. + :type properties_to_include: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebAppCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.WebAppCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_web_apps.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if properties_to_include is not None: + query_parameters['propertiesToInclude'] = self._serialize.query("properties_to_include", properties_to_include, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_web_apps.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/sites'} # type: ignore + + async def _suspend_initial( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> "_models.WebAppCollection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._suspend_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('WebAppCollection', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('WebAppCollection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _suspend_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/suspend'} # type: ignore + + async def begin_suspend( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> AsyncLROPoller[AsyncItemPaged["_models.WebAppCollection"]]: + """Suspend an App Service Environment. + + Description for Suspend an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns an iterator like instance of either WebAppCollection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.WebAppCollection]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.suspend.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._suspend_initial( + resource_group_name=resource_group_name, + name=name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): + async def internal_get_next(next_link=None): + if next_link is None: + return pipeline_response + else: + return await get_next(next_link) + + return AsyncItemPaged( + internal_get_next, extract_data + ) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_suspend.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/suspend'} # type: ignore + + def list_usages( + self, + resource_group_name: str, + name: str, + filter: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.CsmUsageQuotaCollection"]: + """Get global usage metrics of an App Service Environment. + + Description for Get global usage metrics of an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param filter: Return only usages/metrics specified in the filter. Filter conforms to odata + syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq + 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + duration'[Hour|Minute|Day]'. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CsmUsageQuotaCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.CsmUsageQuotaCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmUsageQuotaCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_usages.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('CsmUsageQuotaCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_usages.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/usages'} # type: ignore + + def list_worker_pools( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> AsyncIterable["_models.WorkerPoolCollection"]: + """Get all worker pools of an App Service Environment. + + Description for Get all worker pools of an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WorkerPoolCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.WorkerPoolCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkerPoolCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_worker_pools.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WorkerPoolCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_worker_pools.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools'} # type: ignore + + async def get_worker_pool( + self, + resource_group_name: str, + name: str, + worker_pool_name: str, + **kwargs: Any + ) -> "_models.WorkerPoolResource": + """Get properties of a worker pool. + + Description for Get properties of a worker pool. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param worker_pool_name: Name of the worker pool. + :type worker_pool_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkerPoolResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.WorkerPoolResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkerPoolResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_worker_pool.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'workerPoolName': self._serialize.url("worker_pool_name", worker_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_worker_pool.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}'} # type: ignore + + async def _create_or_update_worker_pool_initial( + self, + resource_group_name: str, + name: str, + worker_pool_name: str, + worker_pool_envelope: "_models.WorkerPoolResource", + **kwargs: Any + ) -> "_models.WorkerPoolResource": + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkerPoolResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_worker_pool_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'workerPoolName': self._serialize.url("worker_pool_name", worker_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(worker_pool_envelope, 'WorkerPoolResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_worker_pool_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}'} # type: ignore + + async def begin_create_or_update_worker_pool( + self, + resource_group_name: str, + name: str, + worker_pool_name: str, + worker_pool_envelope: "_models.WorkerPoolResource", + **kwargs: Any + ) -> AsyncLROPoller["_models.WorkerPoolResource"]: + """Create or update a worker pool. + + Description for Create or update a worker pool. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param worker_pool_name: Name of the worker pool. + :type worker_pool_name: str + :param worker_pool_envelope: Properties of the worker pool. + :type worker_pool_envelope: ~azure.mgmt.web.v2021_02_01.models.WorkerPoolResource + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either WorkerPoolResource or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2021_02_01.models.WorkerPoolResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkerPoolResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_worker_pool_initial( + resource_group_name=resource_group_name, + name=name, + worker_pool_name=worker_pool_name, + worker_pool_envelope=worker_pool_envelope, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'workerPoolName': self._serialize.url("worker_pool_name", worker_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update_worker_pool.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}'} # type: ignore + + async def update_worker_pool( + self, + resource_group_name: str, + name: str, + worker_pool_name: str, + worker_pool_envelope: "_models.WorkerPoolResource", + **kwargs: Any + ) -> "_models.WorkerPoolResource": + """Create or update a worker pool. + + Description for Create or update a worker pool. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param worker_pool_name: Name of the worker pool. + :type worker_pool_name: str + :param worker_pool_envelope: Properties of the worker pool. + :type worker_pool_envelope: ~azure.mgmt.web.v2021_02_01.models.WorkerPoolResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkerPoolResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.WorkerPoolResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkerPoolResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_worker_pool.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'workerPoolName': self._serialize.url("worker_pool_name", worker_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(worker_pool_envelope, 'WorkerPoolResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_worker_pool.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}'} # type: ignore + + def list_worker_pool_instance_metric_definitions( + self, + resource_group_name: str, + name: str, + worker_pool_name: str, + instance: str, + **kwargs: Any + ) -> AsyncIterable["_models.ResourceMetricDefinitionCollection"]: + """Get metric definitions for a specific instance of a worker pool of an App Service Environment. + + Description for Get metric definitions for a specific instance of a worker pool of an App + Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param worker_pool_name: Name of the worker pool. + :type worker_pool_name: str + :param instance: Name of the instance in the worker pool. + :type instance: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceMetricDefinitionCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.ResourceMetricDefinitionCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceMetricDefinitionCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_worker_pool_instance_metric_definitions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'workerPoolName': self._serialize.url("worker_pool_name", worker_pool_name, 'str'), + 'instance': self._serialize.url("instance", instance, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceMetricDefinitionCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_worker_pool_instance_metric_definitions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/instances/{instance}/metricdefinitions'} # type: ignore + + def list_web_worker_metric_definitions( + self, + resource_group_name: str, + name: str, + worker_pool_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.ResourceMetricDefinitionCollection"]: + """Get metric definitions for a worker pool of an App Service Environment. + + Description for Get metric definitions for a worker pool of an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param worker_pool_name: Name of the worker pool. + :type worker_pool_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceMetricDefinitionCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.ResourceMetricDefinitionCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceMetricDefinitionCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_web_worker_metric_definitions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'workerPoolName': self._serialize.url("worker_pool_name", worker_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceMetricDefinitionCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_web_worker_metric_definitions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/metricdefinitions'} # type: ignore + + def list_worker_pool_skus( + self, + resource_group_name: str, + name: str, + worker_pool_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.SkuInfoCollection"]: + """Get available SKUs for scaling a worker pool. + + Description for Get available SKUs for scaling a worker pool. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param worker_pool_name: Name of the worker pool. + :type worker_pool_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SkuInfoCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.SkuInfoCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_worker_pool_skus.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'workerPoolName': self._serialize.url("worker_pool_name", worker_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SkuInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_worker_pool_skus.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/skus'} # type: ignore + + def list_web_worker_usages( + self, + resource_group_name: str, + name: str, + worker_pool_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.UsageCollection"]: + """Get usage metrics for a worker pool of an App Service Environment. + + Description for Get usage metrics for a worker pool of an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param worker_pool_name: Name of the worker pool. + :type worker_pool_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either UsageCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.UsageCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsageCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_web_worker_usages.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'workerPoolName': self._serialize.url("worker_pool_name", worker_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('UsageCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_web_worker_usages.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/usages'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_app_service_plans_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_app_service_plans_operations.py new file mode 100644 index 000000000000..c573ca8338b8 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_app_service_plans_operations.py @@ -0,0 +1,1997 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, List, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class AppServicePlansOperations: + """AppServicePlansOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2021_02_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + detailed: Optional[bool] = None, + **kwargs: Any + ) -> AsyncIterable["_models.AppServicePlanCollection"]: + """Get all App Service plans for a subscription. + + Description for Get all App Service plans for a subscription. + + :param detailed: Specify :code:`true` to return all App Service plan properties. + The default is :code:`false`, which returns a subset of the properties. + Retrieval of all properties may increase the API latency. + :type detailed: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AppServicePlanCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.AppServicePlanCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServicePlanCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if detailed is not None: + query_parameters['detailed'] = self._serialize.query("detailed", detailed, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AppServicePlanCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/serverfarms'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.AppServicePlanCollection"]: + """Get all App Service plans in a resource group. + + Description for Get all App Service plans in a resource group. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AppServicePlanCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.AppServicePlanCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServicePlanCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AppServicePlanCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms'} # type: ignore + + async def get( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> "_models.AppServicePlan": + """Get an App Service plan. + + Description for Get an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AppServicePlan, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.AppServicePlan + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServicePlan"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AppServicePlan', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + name: str, + app_service_plan: "_models.AppServicePlan", + **kwargs: Any + ) -> "_models.AppServicePlan": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServicePlan"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(app_service_plan, 'AppServicePlan') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AppServicePlan', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('AppServicePlan', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + name: str, + app_service_plan: "_models.AppServicePlan", + **kwargs: Any + ) -> AsyncLROPoller["_models.AppServicePlan"]: + """Creates or updates an App Service Plan. + + Description for Creates or updates an App Service Plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param app_service_plan: Details of the App Service plan. + :type app_service_plan: ~azure.mgmt.web.v2021_02_01.models.AppServicePlan + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either AppServicePlan or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2021_02_01.models.AppServicePlan] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServicePlan"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + name=name, + app_service_plan=app_service_plan, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AppServicePlan', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> None: + """Delete an App Service plan. + + Description for Delete an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}'} # type: ignore + + async def update( + self, + resource_group_name: str, + name: str, + app_service_plan: "_models.AppServicePlanPatchResource", + **kwargs: Any + ) -> "_models.AppServicePlan": + """Creates or updates an App Service Plan. + + Description for Creates or updates an App Service Plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param app_service_plan: Details of the App Service plan. + :type app_service_plan: ~azure.mgmt.web.v2021_02_01.models.AppServicePlanPatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AppServicePlan, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.AppServicePlan + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServicePlan"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(app_service_plan, 'AppServicePlanPatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AppServicePlan', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('AppServicePlan', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}'} # type: ignore + + async def list_capabilities( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> List["_models.Capability"]: + """List all capabilities of an App Service plan. + + Description for List all capabilities of an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of Capability, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2021_02_01.models.Capability] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.Capability"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_capabilities.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[Capability]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_capabilities.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/capabilities'} # type: ignore + + async def get_hybrid_connection( + self, + resource_group_name: str, + name: str, + namespace_name: str, + relay_name: str, + **kwargs: Any + ) -> "_models.HybridConnection": + """Retrieve a Hybrid Connection in use in an App Service plan. + + Description for Retrieve a Hybrid Connection in use in an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param namespace_name: Name of the Service Bus namespace. + :type namespace_name: str + :param relay_name: Name of the Service Bus relay. + :type relay_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnection, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.HybridConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_hybrid_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_hybrid_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} # type: ignore + + async def delete_hybrid_connection( + self, + resource_group_name: str, + name: str, + namespace_name: str, + relay_name: str, + **kwargs: Any + ) -> None: + """Delete a Hybrid Connection in use in an App Service plan. + + Description for Delete a Hybrid Connection in use in an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param namespace_name: Name of the Service Bus namespace. + :type namespace_name: str + :param relay_name: Name of the Service Bus relay. + :type relay_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_hybrid_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_hybrid_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} # type: ignore + + async def list_hybrid_connection_keys( + self, + resource_group_name: str, + name: str, + namespace_name: str, + relay_name: str, + **kwargs: Any + ) -> "_models.HybridConnectionKey": + """Get the send key name and value of a Hybrid Connection. + + Description for Get the send key name and value of a Hybrid Connection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param namespace_name: The name of the Service Bus namespace. + :type namespace_name: str + :param relay_name: The name of the Service Bus relay. + :type relay_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnectionKey, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.HybridConnectionKey + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnectionKey"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_hybrid_connection_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnectionKey', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_hybrid_connection_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}/listKeys'} # type: ignore + + def list_web_apps_by_hybrid_connection( + self, + resource_group_name: str, + name: str, + namespace_name: str, + relay_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.ResourceCollection"]: + """Get all apps that use a Hybrid Connection in an App Service Plan. + + Description for Get all apps that use a Hybrid Connection in an App Service Plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param namespace_name: Name of the Hybrid Connection namespace. + :type namespace_name: str + :param relay_name: Name of the Hybrid Connection relay. + :type relay_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.ResourceCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_web_apps_by_hybrid_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_web_apps_by_hybrid_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}/sites'} # type: ignore + + async def get_hybrid_connection_plan_limit( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> "_models.HybridConnectionLimits": + """Get the maximum number of Hybrid Connections allowed in an App Service plan. + + Description for Get the maximum number of Hybrid Connections allowed in an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnectionLimits, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.HybridConnectionLimits + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnectionLimits"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_hybrid_connection_plan_limit.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnectionLimits', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_hybrid_connection_plan_limit.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionPlanLimits/limit'} # type: ignore + + def list_hybrid_connections( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> AsyncIterable["_models.HybridConnectionCollection"]: + """Retrieve all Hybrid Connections in use in an App Service plan. + + Description for Retrieve all Hybrid Connections in use in an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either HybridConnectionCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.HybridConnectionCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnectionCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_hybrid_connections.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('HybridConnectionCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_hybrid_connections.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionRelays'} # type: ignore + + async def restart_web_apps( + self, + resource_group_name: str, + name: str, + soft_restart: Optional[bool] = None, + **kwargs: Any + ) -> None: + """Restart all apps in an App Service plan. + + Description for Restart all apps in an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param soft_restart: Specify :code:`true` to perform a soft restart, applies the + configuration settings and restarts the apps if necessary. The default is + :code:`false`, which always restarts and reprovisions the apps. + :type soft_restart: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.restart_web_apps.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if soft_restart is not None: + query_parameters['softRestart'] = self._serialize.query("soft_restart", soft_restart, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + restart_web_apps.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/restartSites'} # type: ignore + + def list_web_apps( + self, + resource_group_name: str, + name: str, + skip_token: Optional[str] = None, + filter: Optional[str] = None, + top: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.WebAppCollection"]: + """Get all apps associated with an App Service plan. + + Description for Get all apps associated with an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param skip_token: Skip to a web app in the list of webapps associated with app service plan. + If specified, the resulting list will contain web apps starting from (including) the skipToken. + Otherwise, the resulting list contains web apps from the start of the list. + :type skip_token: str + :param filter: Supported filter: $filter=state eq running. Returns only web apps that are + currently running. + :type filter: str + :param top: List page size. If specified, results are paged. + :type top: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebAppCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.WebAppCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_web_apps.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_web_apps.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/sites'} # type: ignore + + async def get_server_farm_skus( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> Any: + """Gets all selectable SKUs for a given App Service Plan. + + Description for Gets all selectable SKUs for a given App Service Plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of App Service Plan. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: any, or the result of cls(response) + :rtype: any + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Any] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_server_farm_skus.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('object', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_server_farm_skus.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/skus'} # type: ignore + + def list_usages( + self, + resource_group_name: str, + name: str, + filter: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.CsmUsageQuotaCollection"]: + """Gets server farm usage information. + + Description for Gets server farm usage information. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of App Service Plan. + :type name: str + :param filter: Return only usages/metrics specified in the filter. Filter conforms to odata + syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2'). + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CsmUsageQuotaCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.CsmUsageQuotaCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmUsageQuotaCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_usages.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('CsmUsageQuotaCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_usages.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/usages'} # type: ignore + + async def list_vnets( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> List["_models.VnetInfoResource"]: + """Get all Virtual Networks associated with an App Service plan. + + Description for Get all Virtual Networks associated with an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of VnetInfoResource, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2021_02_01.models.VnetInfoResource] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VnetInfoResource"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_vnets.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[VnetInfoResource]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_vnets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections'} # type: ignore + + async def get_vnet_from_server_farm( + self, + resource_group_name: str, + name: str, + vnet_name: str, + **kwargs: Any + ) -> "_models.VnetInfoResource": + """Get a Virtual Network associated with an App Service plan. + + Description for Get a Virtual Network associated with an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetInfoResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.VnetInfoResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetInfoResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_vnet_from_server_farm.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetInfoResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_vnet_from_server_farm.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}'} # type: ignore + + async def get_vnet_gateway( + self, + resource_group_name: str, + name: str, + vnet_name: str, + gateway_name: str, + **kwargs: Any + ) -> "_models.VnetGateway": + """Get a Virtual Network gateway. + + Description for Get a Virtual Network gateway. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param gateway_name: Name of the gateway. Only the 'primary' gateway is supported. + :type gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetGateway, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.VnetGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_vnet_gateway.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_vnet_gateway.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'} # type: ignore + + async def update_vnet_gateway( + self, + resource_group_name: str, + name: str, + vnet_name: str, + gateway_name: str, + connection_envelope: "_models.VnetGateway", + **kwargs: Any + ) -> "_models.VnetGateway": + """Update a Virtual Network gateway. + + Description for Update a Virtual Network gateway. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param gateway_name: Name of the gateway. Only the 'primary' gateway is supported. + :type gateway_name: str + :param connection_envelope: Definition of the gateway. + :type connection_envelope: ~azure.mgmt.web.v2021_02_01.models.VnetGateway + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetGateway, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.VnetGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_vnet_gateway.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'VnetGateway') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_vnet_gateway.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'} # type: ignore + + async def list_routes_for_vnet( + self, + resource_group_name: str, + name: str, + vnet_name: str, + **kwargs: Any + ) -> List["_models.VnetRoute"]: + """Get all routes that are associated with a Virtual Network in an App Service plan. + + Description for Get all routes that are associated with a Virtual Network in an App Service + plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of VnetRoute, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2021_02_01.models.VnetRoute] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VnetRoute"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_routes_for_vnet.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[VnetRoute]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_routes_for_vnet.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes'} # type: ignore + + async def get_route_for_vnet( + self, + resource_group_name: str, + name: str, + vnet_name: str, + route_name: str, + **kwargs: Any + ) -> List["_models.VnetRoute"]: + """Get a Virtual Network route in an App Service plan. + + Description for Get a Virtual Network route in an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param route_name: Name of the Virtual Network route. + :type route_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of VnetRoute, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2021_02_01.models.VnetRoute] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VnetRoute"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_route_for_vnet.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[VnetRoute]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_route_for_vnet.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}'} # type: ignore + + async def create_or_update_vnet_route( + self, + resource_group_name: str, + name: str, + vnet_name: str, + route_name: str, + route: "_models.VnetRoute", + **kwargs: Any + ) -> "_models.VnetRoute": + """Create or update a Virtual Network route in an App Service plan. + + Description for Create or update a Virtual Network route in an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param route_name: Name of the Virtual Network route. + :type route_name: str + :param route: Definition of the Virtual Network route. + :type route: ~azure.mgmt.web.v2021_02_01.models.VnetRoute + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetRoute, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.VnetRoute + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetRoute"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_vnet_route.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(route, 'VnetRoute') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetRoute', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_vnet_route.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}'} # type: ignore + + async def delete_vnet_route( + self, + resource_group_name: str, + name: str, + vnet_name: str, + route_name: str, + **kwargs: Any + ) -> None: + """Delete a Virtual Network route in an App Service plan. + + Description for Delete a Virtual Network route in an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param route_name: Name of the Virtual Network route. + :type route_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_vnet_route.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_vnet_route.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}'} # type: ignore + + async def update_vnet_route( + self, + resource_group_name: str, + name: str, + vnet_name: str, + route_name: str, + route: "_models.VnetRoute", + **kwargs: Any + ) -> "_models.VnetRoute": + """Create or update a Virtual Network route in an App Service plan. + + Description for Create or update a Virtual Network route in an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param route_name: Name of the Virtual Network route. + :type route_name: str + :param route: Definition of the Virtual Network route. + :type route: ~azure.mgmt.web.v2021_02_01.models.VnetRoute + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetRoute, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.VnetRoute + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetRoute"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_vnet_route.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(route, 'VnetRoute') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetRoute', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_vnet_route.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}'} # type: ignore + + async def reboot_worker( + self, + resource_group_name: str, + name: str, + worker_name: str, + **kwargs: Any + ) -> None: + """Reboot a worker machine in an App Service plan. + + Description for Reboot a worker machine in an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param worker_name: Name of worker machine, which typically starts with RD. + :type worker_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.reboot_worker.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'workerName': self._serialize.url("worker_name", worker_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + reboot_worker.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/workers/{workerName}/reboot'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_certificate_orders_diagnostics_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_certificate_orders_diagnostics_operations.py new file mode 100644 index 000000000000..ce7644a08d91 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_certificate_orders_diagnostics_operations.py @@ -0,0 +1,201 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import datetime +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class CertificateOrdersDiagnosticsOperations: + """CertificateOrdersDiagnosticsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2021_02_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_app_service_certificate_order_detector_response( + self, + resource_group_name: str, + certificate_order_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.DetectorResponseCollection"]: + """Microsoft.CertificateRegistration to get the list of detectors for this RP. + + Description for Microsoft.CertificateRegistration to get the list of detectors for this RP. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: The certificate order name for which the response is needed. + :type certificate_order_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DetectorResponseCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.DetectorResponseCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DetectorResponseCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_app_service_certificate_order_detector_response.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DetectorResponseCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_app_service_certificate_order_detector_response.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/detectors'} # type: ignore + + async def get_app_service_certificate_order_detector_response( + self, + resource_group_name: str, + certificate_order_name: str, + detector_name: str, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + time_grain: Optional[str] = None, + **kwargs: Any + ) -> "_models.DetectorResponse": + """Microsoft.CertificateRegistration call to get a detector response from App Lens. + + Description for Microsoft.CertificateRegistration call to get a detector response from App + Lens. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: The certificate order name for which the response is needed. + :type certificate_order_name: str + :param detector_name: The detector name which needs to be run. + :type detector_name: str + :param start_time: The start time for detector response. + :type start_time: ~datetime.datetime + :param end_time: The end time for the detector response. + :type end_time: ~datetime.datetime + :param time_grain: The time grain for the detector response. + :type time_grain: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DetectorResponse, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.DetectorResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DetectorResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_app_service_certificate_order_detector_response.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'detectorName': self._serialize.url("detector_name", detector_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if start_time is not None: + query_parameters['startTime'] = self._serialize.query("start_time", start_time, 'iso-8601') + if end_time is not None: + query_parameters['endTime'] = self._serialize.query("end_time", end_time, 'iso-8601') + if time_grain is not None: + query_parameters['timeGrain'] = self._serialize.query("time_grain", time_grain, 'str', pattern=r'PT[1-9][0-9]+[SMH]') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DetectorResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_app_service_certificate_order_detector_response.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/detectors/{detectorName}'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_certificate_registration_provider_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_certificate_registration_provider_operations.py new file mode 100644 index 000000000000..a89f09c66f47 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_certificate_registration_provider_operations.py @@ -0,0 +1,108 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class CertificateRegistrationProviderOperations: + """CertificateRegistrationProviderOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2021_02_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_operations( + self, + **kwargs: Any + ) -> AsyncIterable["_models.CsmOperationCollection"]: + """Implements Csm operations Api to exposes the list of available Csm Apis under the resource provider. + + Description for Implements Csm operations Api to exposes the list of available Csm Apis under + the resource provider. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CsmOperationCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.CsmOperationCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmOperationCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_operations.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('CsmOperationCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_operations.metadata = {'url': '/providers/Microsoft.CertificateRegistration/operations'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_certificates_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_certificates_operations.py new file mode 100644 index 000000000000..e456a773aa25 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_certificates_operations.py @@ -0,0 +1,447 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class CertificatesOperations: + """CertificatesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2021_02_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + filter: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.CertificateCollection"]: + """Get all certificates for a subscription. + + Description for Get all certificates for a subscription. + + :param filter: Return only information specified in the filter (using OData syntax). For + example: $filter=KeyVaultId eq 'KeyVaultId'. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CertificateCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.CertificateCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CertificateCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('CertificateCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/certificates'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.CertificateCollection"]: + """Get all certificates in a resource group. + + Description for Get all certificates in a resource group. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CertificateCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.CertificateCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CertificateCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('CertificateCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates'} # type: ignore + + async def get( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> "_models.Certificate": + """Get a certificate. + + Description for Get a certificate. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the certificate. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Certificate, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.Certificate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Certificate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Certificate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}'} # type: ignore + + async def create_or_update( + self, + resource_group_name: str, + name: str, + certificate_envelope: "_models.Certificate", + **kwargs: Any + ) -> "_models.Certificate": + """Create or update a certificate. + + Description for Create or update a certificate. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the certificate. + :type name: str + :param certificate_envelope: Details of certificate, if it exists already. + :type certificate_envelope: ~azure.mgmt.web.v2021_02_01.models.Certificate + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Certificate, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.Certificate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Certificate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(certificate_envelope, 'Certificate') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Certificate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> None: + """Delete a certificate. + + Description for Delete a certificate. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the certificate. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}'} # type: ignore + + async def update( + self, + resource_group_name: str, + name: str, + certificate_envelope: "_models.CertificatePatchResource", + **kwargs: Any + ) -> "_models.Certificate": + """Create or update a certificate. + + Description for Create or update a certificate. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the certificate. + :type name: str + :param certificate_envelope: Details of certificate, if it exists already. + :type certificate_envelope: ~azure.mgmt.web.v2021_02_01.models.CertificatePatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Certificate, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.Certificate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Certificate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(certificate_envelope, 'CertificatePatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Certificate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_deleted_web_apps_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_deleted_web_apps_operations.py new file mode 100644 index 000000000000..c399931f6162 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_deleted_web_apps_operations.py @@ -0,0 +1,245 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class DeletedWebAppsOperations: + """DeletedWebAppsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2021_02_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs: Any + ) -> AsyncIterable["_models.DeletedWebAppCollection"]: + """Get all deleted apps for a subscription. + + Description for Get all deleted apps for a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DeletedWebAppCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.DeletedWebAppCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DeletedWebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DeletedWebAppCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/deletedSites'} # type: ignore + + def list_by_location( + self, + location: str, + **kwargs: Any + ) -> AsyncIterable["_models.DeletedWebAppCollection"]: + """Get all deleted apps for a subscription at location. + + Description for Get all deleted apps for a subscription at location. + + :param location: + :type location: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DeletedWebAppCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.DeletedWebAppCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DeletedWebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_location.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DeletedWebAppCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_location.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/locations/{location}/deletedSites'} # type: ignore + + async def get_deleted_web_app_by_location( + self, + location: str, + deleted_site_id: str, + **kwargs: Any + ) -> "_models.DeletedSite": + """Get deleted app for a subscription at location. + + Description for Get deleted app for a subscription at location. + + :param location: + :type location: str + :param deleted_site_id: The numeric ID of the deleted app, e.g. 12345. + :type deleted_site_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DeletedSite, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.DeletedSite + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DeletedSite"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_deleted_web_app_by_location.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'deletedSiteId': self._serialize.url("deleted_site_id", deleted_site_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DeletedSite', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_deleted_web_app_by_location.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/locations/{location}/deletedSites/{deletedSiteId}'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_diagnostics_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_diagnostics_operations.py new file mode 100644 index 000000000000..01cd5c262070 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_diagnostics_operations.py @@ -0,0 +1,1774 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import datetime +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class DiagnosticsOperations: + """DiagnosticsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2021_02_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_hosting_environment_detector_responses( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> AsyncIterable["_models.DetectorResponseCollection"]: + """List Hosting Environment Detector Responses. + + Description for List Hosting Environment Detector Responses. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site Name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DetectorResponseCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.DetectorResponseCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DetectorResponseCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_hosting_environment_detector_responses.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DetectorResponseCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_hosting_environment_detector_responses.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/detectors'} # type: ignore + + async def get_hosting_environment_detector_response( + self, + resource_group_name: str, + name: str, + detector_name: str, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + time_grain: Optional[str] = None, + **kwargs: Any + ) -> "_models.DetectorResponse": + """Get Hosting Environment Detector Response. + + Description for Get Hosting Environment Detector Response. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: App Service Environment Name. + :type name: str + :param detector_name: Detector Resource Name. + :type detector_name: str + :param start_time: Start Time. + :type start_time: ~datetime.datetime + :param end_time: End Time. + :type end_time: ~datetime.datetime + :param time_grain: Time Grain. + :type time_grain: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DetectorResponse, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.DetectorResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DetectorResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_hosting_environment_detector_response.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'detectorName': self._serialize.url("detector_name", detector_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if start_time is not None: + query_parameters['startTime'] = self._serialize.query("start_time", start_time, 'iso-8601') + if end_time is not None: + query_parameters['endTime'] = self._serialize.query("end_time", end_time, 'iso-8601') + if time_grain is not None: + query_parameters['timeGrain'] = self._serialize.query("time_grain", time_grain, 'str', pattern=r'PT[1-9][0-9]+[SMH]') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DetectorResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_hosting_environment_detector_response.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/detectors/{detectorName}'} # type: ignore + + def list_site_detector_responses( + self, + resource_group_name: str, + site_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.DetectorResponseCollection"]: + """List Site Detector Responses. + + Description for List Site Detector Responses. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DetectorResponseCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.DetectorResponseCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DetectorResponseCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_detector_responses.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DetectorResponseCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_site_detector_responses.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/detectors'} # type: ignore + + async def get_site_detector_response( + self, + resource_group_name: str, + site_name: str, + detector_name: str, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + time_grain: Optional[str] = None, + **kwargs: Any + ) -> "_models.DetectorResponse": + """Get site detector response. + + Description for Get site detector response. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param detector_name: Detector Resource Name. + :type detector_name: str + :param start_time: Start Time. + :type start_time: ~datetime.datetime + :param end_time: End Time. + :type end_time: ~datetime.datetime + :param time_grain: Time Grain. + :type time_grain: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DetectorResponse, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.DetectorResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DetectorResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_site_detector_response.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'detectorName': self._serialize.url("detector_name", detector_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if start_time is not None: + query_parameters['startTime'] = self._serialize.query("start_time", start_time, 'iso-8601') + if end_time is not None: + query_parameters['endTime'] = self._serialize.query("end_time", end_time, 'iso-8601') + if time_grain is not None: + query_parameters['timeGrain'] = self._serialize.query("time_grain", time_grain, 'str', pattern=r'PT[1-9][0-9]+[SMH]') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DetectorResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_detector_response.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/detectors/{detectorName}'} # type: ignore + + def list_site_diagnostic_categories( + self, + resource_group_name: str, + site_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.DiagnosticCategoryCollection"]: + """Get Diagnostics Categories. + + Description for Get Diagnostics Categories. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DiagnosticCategoryCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.DiagnosticCategoryCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticCategoryCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_diagnostic_categories.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DiagnosticCategoryCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_site_diagnostic_categories.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics'} # type: ignore + + async def get_site_diagnostic_category( + self, + resource_group_name: str, + site_name: str, + diagnostic_category: str, + **kwargs: Any + ) -> "_models.DiagnosticCategory": + """Get Diagnostics Category. + + Description for Get Diagnostics Category. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Diagnostic Category. + :type diagnostic_category: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DiagnosticCategory, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.DiagnosticCategory + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticCategory"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_site_diagnostic_category.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DiagnosticCategory', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_diagnostic_category.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}'} # type: ignore + + def list_site_analyses( + self, + resource_group_name: str, + site_name: str, + diagnostic_category: str, + **kwargs: Any + ) -> AsyncIterable["_models.DiagnosticAnalysisCollection"]: + """Get Site Analyses. + + Description for Get Site Analyses. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Diagnostic Category. + :type diagnostic_category: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DiagnosticAnalysisCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.DiagnosticAnalysisCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticAnalysisCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_analyses.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DiagnosticAnalysisCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_site_analyses.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/analyses'} # type: ignore + + async def get_site_analysis( + self, + resource_group_name: str, + site_name: str, + diagnostic_category: str, + analysis_name: str, + **kwargs: Any + ) -> "_models.AnalysisDefinition": + """Get Site Analysis. + + Description for Get Site Analysis. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Diagnostic Category. + :type diagnostic_category: str + :param analysis_name: Analysis Name. + :type analysis_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AnalysisDefinition, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.AnalysisDefinition + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AnalysisDefinition"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_site_analysis.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'analysisName': self._serialize.url("analysis_name", analysis_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AnalysisDefinition', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_analysis.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/analyses/{analysisName}'} # type: ignore + + async def execute_site_analysis( + self, + resource_group_name: str, + site_name: str, + diagnostic_category: str, + analysis_name: str, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + time_grain: Optional[str] = None, + **kwargs: Any + ) -> "_models.DiagnosticAnalysis": + """Execute Analysis. + + Description for Execute Analysis. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Category Name. + :type diagnostic_category: str + :param analysis_name: Analysis Resource Name. + :type analysis_name: str + :param start_time: Start Time. + :type start_time: ~datetime.datetime + :param end_time: End Time. + :type end_time: ~datetime.datetime + :param time_grain: Time Grain. + :type time_grain: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DiagnosticAnalysis, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.DiagnosticAnalysis + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticAnalysis"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.execute_site_analysis.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'analysisName': self._serialize.url("analysis_name", analysis_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if start_time is not None: + query_parameters['startTime'] = self._serialize.query("start_time", start_time, 'iso-8601') + if end_time is not None: + query_parameters['endTime'] = self._serialize.query("end_time", end_time, 'iso-8601') + if time_grain is not None: + query_parameters['timeGrain'] = self._serialize.query("time_grain", time_grain, 'str', pattern=r'PT[1-9][0-9]+[SMH]') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DiagnosticAnalysis', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + execute_site_analysis.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/analyses/{analysisName}/execute'} # type: ignore + + def list_site_detectors( + self, + resource_group_name: str, + site_name: str, + diagnostic_category: str, + **kwargs: Any + ) -> AsyncIterable["_models.DiagnosticDetectorCollection"]: + """Get Detectors. + + Description for Get Detectors. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Diagnostic Category. + :type diagnostic_category: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DiagnosticDetectorCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.DiagnosticDetectorCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticDetectorCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_detectors.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DiagnosticDetectorCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_site_detectors.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/detectors'} # type: ignore + + async def get_site_detector( + self, + resource_group_name: str, + site_name: str, + diagnostic_category: str, + detector_name: str, + **kwargs: Any + ) -> "_models.DetectorDefinitionResource": + """Get Detector. + + Description for Get Detector. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Diagnostic Category. + :type diagnostic_category: str + :param detector_name: Detector Name. + :type detector_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DetectorDefinitionResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.DetectorDefinitionResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DetectorDefinitionResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_site_detector.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'detectorName': self._serialize.url("detector_name", detector_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DetectorDefinitionResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_detector.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/detectors/{detectorName}'} # type: ignore + + async def execute_site_detector( + self, + resource_group_name: str, + site_name: str, + detector_name: str, + diagnostic_category: str, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + time_grain: Optional[str] = None, + **kwargs: Any + ) -> "_models.DiagnosticDetectorResponse": + """Execute Detector. + + Description for Execute Detector. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param detector_name: Detector Resource Name. + :type detector_name: str + :param diagnostic_category: Category Name. + :type diagnostic_category: str + :param start_time: Start Time. + :type start_time: ~datetime.datetime + :param end_time: End Time. + :type end_time: ~datetime.datetime + :param time_grain: Time Grain. + :type time_grain: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DiagnosticDetectorResponse, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.DiagnosticDetectorResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticDetectorResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.execute_site_detector.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'detectorName': self._serialize.url("detector_name", detector_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if start_time is not None: + query_parameters['startTime'] = self._serialize.query("start_time", start_time, 'iso-8601') + if end_time is not None: + query_parameters['endTime'] = self._serialize.query("end_time", end_time, 'iso-8601') + if time_grain is not None: + query_parameters['timeGrain'] = self._serialize.query("time_grain", time_grain, 'str', pattern=r'PT[1-9][0-9]+[SMH]') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DiagnosticDetectorResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + execute_site_detector.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/detectors/{detectorName}/execute'} # type: ignore + + def list_site_detector_responses_slot( + self, + resource_group_name: str, + site_name: str, + slot: str, + **kwargs: Any + ) -> AsyncIterable["_models.DetectorResponseCollection"]: + """List Site Detector Responses. + + Description for List Site Detector Responses. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param slot: Slot Name. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DetectorResponseCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.DetectorResponseCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DetectorResponseCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_detector_responses_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DetectorResponseCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_site_detector_responses_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/detectors'} # type: ignore + + async def get_site_detector_response_slot( + self, + resource_group_name: str, + site_name: str, + detector_name: str, + slot: str, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + time_grain: Optional[str] = None, + **kwargs: Any + ) -> "_models.DetectorResponse": + """Get site detector response. + + Description for Get site detector response. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param detector_name: Detector Resource Name. + :type detector_name: str + :param slot: Slot Name. + :type slot: str + :param start_time: Start Time. + :type start_time: ~datetime.datetime + :param end_time: End Time. + :type end_time: ~datetime.datetime + :param time_grain: Time Grain. + :type time_grain: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DetectorResponse, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.DetectorResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DetectorResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_site_detector_response_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'detectorName': self._serialize.url("detector_name", detector_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if start_time is not None: + query_parameters['startTime'] = self._serialize.query("start_time", start_time, 'iso-8601') + if end_time is not None: + query_parameters['endTime'] = self._serialize.query("end_time", end_time, 'iso-8601') + if time_grain is not None: + query_parameters['timeGrain'] = self._serialize.query("time_grain", time_grain, 'str', pattern=r'PT[1-9][0-9]+[SMH]') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DetectorResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_detector_response_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/detectors/{detectorName}'} # type: ignore + + def list_site_diagnostic_categories_slot( + self, + resource_group_name: str, + site_name: str, + slot: str, + **kwargs: Any + ) -> AsyncIterable["_models.DiagnosticCategoryCollection"]: + """Get Diagnostics Categories. + + Description for Get Diagnostics Categories. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param slot: Slot Name. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DiagnosticCategoryCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.DiagnosticCategoryCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticCategoryCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_diagnostic_categories_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DiagnosticCategoryCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_site_diagnostic_categories_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics'} # type: ignore + + async def get_site_diagnostic_category_slot( + self, + resource_group_name: str, + site_name: str, + diagnostic_category: str, + slot: str, + **kwargs: Any + ) -> "_models.DiagnosticCategory": + """Get Diagnostics Category. + + Description for Get Diagnostics Category. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Diagnostic Category. + :type diagnostic_category: str + :param slot: Slot Name. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DiagnosticCategory, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.DiagnosticCategory + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticCategory"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_site_diagnostic_category_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DiagnosticCategory', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_diagnostic_category_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}'} # type: ignore + + def list_site_analyses_slot( + self, + resource_group_name: str, + site_name: str, + diagnostic_category: str, + slot: str, + **kwargs: Any + ) -> AsyncIterable["_models.DiagnosticAnalysisCollection"]: + """Get Site Analyses. + + Description for Get Site Analyses. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Diagnostic Category. + :type diagnostic_category: str + :param slot: Slot Name. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DiagnosticAnalysisCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.DiagnosticAnalysisCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticAnalysisCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_analyses_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DiagnosticAnalysisCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_site_analyses_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/analyses'} # type: ignore + + async def get_site_analysis_slot( + self, + resource_group_name: str, + site_name: str, + diagnostic_category: str, + analysis_name: str, + slot: str, + **kwargs: Any + ) -> "_models.AnalysisDefinition": + """Get Site Analysis. + + Description for Get Site Analysis. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Diagnostic Category. + :type diagnostic_category: str + :param analysis_name: Analysis Name. + :type analysis_name: str + :param slot: Slot - optional. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AnalysisDefinition, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.AnalysisDefinition + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AnalysisDefinition"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_site_analysis_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'analysisName': self._serialize.url("analysis_name", analysis_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AnalysisDefinition', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_analysis_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/analyses/{analysisName}'} # type: ignore + + async def execute_site_analysis_slot( + self, + resource_group_name: str, + site_name: str, + diagnostic_category: str, + analysis_name: str, + slot: str, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + time_grain: Optional[str] = None, + **kwargs: Any + ) -> "_models.DiagnosticAnalysis": + """Execute Analysis. + + Description for Execute Analysis. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Category Name. + :type diagnostic_category: str + :param analysis_name: Analysis Resource Name. + :type analysis_name: str + :param slot: Slot Name. + :type slot: str + :param start_time: Start Time. + :type start_time: ~datetime.datetime + :param end_time: End Time. + :type end_time: ~datetime.datetime + :param time_grain: Time Grain. + :type time_grain: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DiagnosticAnalysis, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.DiagnosticAnalysis + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticAnalysis"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.execute_site_analysis_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'analysisName': self._serialize.url("analysis_name", analysis_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if start_time is not None: + query_parameters['startTime'] = self._serialize.query("start_time", start_time, 'iso-8601') + if end_time is not None: + query_parameters['endTime'] = self._serialize.query("end_time", end_time, 'iso-8601') + if time_grain is not None: + query_parameters['timeGrain'] = self._serialize.query("time_grain", time_grain, 'str', pattern=r'PT[1-9][0-9]+[SMH]') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DiagnosticAnalysis', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + execute_site_analysis_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/analyses/{analysisName}/execute'} # type: ignore + + def list_site_detectors_slot( + self, + resource_group_name: str, + site_name: str, + diagnostic_category: str, + slot: str, + **kwargs: Any + ) -> AsyncIterable["_models.DiagnosticDetectorCollection"]: + """Get Detectors. + + Description for Get Detectors. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Diagnostic Category. + :type diagnostic_category: str + :param slot: Slot Name. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DiagnosticDetectorCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.DiagnosticDetectorCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticDetectorCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_detectors_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DiagnosticDetectorCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_site_detectors_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/detectors'} # type: ignore + + async def get_site_detector_slot( + self, + resource_group_name: str, + site_name: str, + diagnostic_category: str, + detector_name: str, + slot: str, + **kwargs: Any + ) -> "_models.DetectorDefinitionResource": + """Get Detector. + + Description for Get Detector. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Diagnostic Category. + :type diagnostic_category: str + :param detector_name: Detector Name. + :type detector_name: str + :param slot: Slot Name. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DetectorDefinitionResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.DetectorDefinitionResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DetectorDefinitionResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_site_detector_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'detectorName': self._serialize.url("detector_name", detector_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DetectorDefinitionResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_detector_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/detectors/{detectorName}'} # type: ignore + + async def execute_site_detector_slot( + self, + resource_group_name: str, + site_name: str, + detector_name: str, + diagnostic_category: str, + slot: str, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + time_grain: Optional[str] = None, + **kwargs: Any + ) -> "_models.DiagnosticDetectorResponse": + """Execute Detector. + + Description for Execute Detector. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param detector_name: Detector Resource Name. + :type detector_name: str + :param diagnostic_category: Category Name. + :type diagnostic_category: str + :param slot: Slot Name. + :type slot: str + :param start_time: Start Time. + :type start_time: ~datetime.datetime + :param end_time: End Time. + :type end_time: ~datetime.datetime + :param time_grain: Time Grain. + :type time_grain: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DiagnosticDetectorResponse, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.DiagnosticDetectorResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticDetectorResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.execute_site_detector_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'detectorName': self._serialize.url("detector_name", detector_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if start_time is not None: + query_parameters['startTime'] = self._serialize.query("start_time", start_time, 'iso-8601') + if end_time is not None: + query_parameters['endTime'] = self._serialize.query("end_time", end_time, 'iso-8601') + if time_grain is not None: + query_parameters['timeGrain'] = self._serialize.query("time_grain", time_grain, 'str', pattern=r'PT[1-9][0-9]+[SMH]') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DiagnosticDetectorResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + execute_site_detector_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/detectors/{detectorName}/execute'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_domain_registration_provider_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_domain_registration_provider_operations.py new file mode 100644 index 000000000000..cdaab080a843 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_domain_registration_provider_operations.py @@ -0,0 +1,108 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class DomainRegistrationProviderOperations: + """DomainRegistrationProviderOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2021_02_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_operations( + self, + **kwargs: Any + ) -> AsyncIterable["_models.CsmOperationCollection"]: + """Implements Csm operations Api to exposes the list of available Csm Apis under the resource provider. + + Description for Implements Csm operations Api to exposes the list of available Csm Apis under + the resource provider. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CsmOperationCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.CsmOperationCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmOperationCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_operations.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('CsmOperationCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_operations.metadata = {'url': '/providers/Microsoft.DomainRegistration/operations'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_domains_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_domains_operations.py new file mode 100644 index 000000000000..ea77de43abce --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_domains_operations.py @@ -0,0 +1,1119 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class DomainsOperations: + """DomainsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2021_02_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def check_availability( + self, + identifier: "_models.NameIdentifier", + **kwargs: Any + ) -> "_models.DomainAvailabilityCheckResult": + """Check if a domain is available for registration. + + Description for Check if a domain is available for registration. + + :param identifier: Name of the domain. + :type identifier: ~azure.mgmt.web.v2021_02_01.models.NameIdentifier + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DomainAvailabilityCheckResult, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.DomainAvailabilityCheckResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DomainAvailabilityCheckResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.check_availability.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(identifier, 'NameIdentifier') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DomainAvailabilityCheckResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + check_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/checkDomainAvailability'} # type: ignore + + def list( + self, + **kwargs: Any + ) -> AsyncIterable["_models.DomainCollection"]: + """Get all domains in a subscription. + + Description for Get all domains in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DomainCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.DomainCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DomainCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DomainCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/domains'} # type: ignore + + async def get_control_center_sso_request( + self, + **kwargs: Any + ) -> "_models.DomainControlCenterSsoRequest": + """Generate a single sign-on request for the domain management portal. + + Description for Generate a single sign-on request for the domain management portal. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DomainControlCenterSsoRequest, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.DomainControlCenterSsoRequest + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DomainControlCenterSsoRequest"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_control_center_sso_request.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DomainControlCenterSsoRequest', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_control_center_sso_request.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/generateSsoRequest'} # type: ignore + + def list_recommendations( + self, + parameters: "_models.DomainRecommendationSearchParameters", + **kwargs: Any + ) -> AsyncIterable["_models.NameIdentifierCollection"]: + """Get domain name recommendations based on keywords. + + Description for Get domain name recommendations based on keywords. + + :param parameters: Search parameters for domain name recommendations. + :type parameters: ~azure.mgmt.web.v2021_02_01.models.DomainRecommendationSearchParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NameIdentifierCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.NameIdentifierCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NameIdentifierCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = "application/json" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_recommendations.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'DomainRecommendationSearchParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'DomainRecommendationSearchParameters') + body_content_kwargs['content'] = body_content + request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('NameIdentifierCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_recommendations.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/listDomainRecommendations'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.DomainCollection"]: + """Get all domains in a resource group. + + Description for Get all domains in a resource group. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DomainCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.DomainCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DomainCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DomainCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains'} # type: ignore + + async def get( + self, + resource_group_name: str, + domain_name: str, + **kwargs: Any + ) -> "_models.Domain": + """Get a domain. + + Description for Get a domain. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param domain_name: Name of the domain. + :type domain_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Domain, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.Domain + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Domain"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Domain', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + domain_name: str, + domain: "_models.Domain", + **kwargs: Any + ) -> "_models.Domain": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Domain"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str', pattern=r'[a-zA-Z0-9][a-zA-Z0-9\.-]+'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(domain, 'Domain') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Domain', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Domain', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + domain_name: str, + domain: "_models.Domain", + **kwargs: Any + ) -> AsyncLROPoller["_models.Domain"]: + """Creates or updates a domain. + + Description for Creates or updates a domain. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param domain_name: Name of the domain. + :type domain_name: str + :param domain: Domain registration information. + :type domain: ~azure.mgmt.web.v2021_02_01.models.Domain + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Domain or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2021_02_01.models.Domain] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Domain"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + domain_name=domain_name, + domain=domain, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Domain', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str', pattern=r'[a-zA-Z0-9][a-zA-Z0-9\.-]+'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + domain_name: str, + force_hard_delete_domain: Optional[bool] = None, + **kwargs: Any + ) -> None: + """Delete a domain. + + Description for Delete a domain. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param domain_name: Name of the domain. + :type domain_name: str + :param force_hard_delete_domain: Specify :code:`true` to delete the domain + immediately. The default is :code:`false` which deletes the domain after 24 hours. + :type force_hard_delete_domain: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if force_hard_delete_domain is not None: + query_parameters['forceHardDeleteDomain'] = self._serialize.query("force_hard_delete_domain", force_hard_delete_domain, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}'} # type: ignore + + async def update( + self, + resource_group_name: str, + domain_name: str, + domain: "_models.DomainPatchResource", + **kwargs: Any + ) -> "_models.Domain": + """Creates or updates a domain. + + Description for Creates or updates a domain. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param domain_name: Name of the domain. + :type domain_name: str + :param domain: Domain registration information. + :type domain: ~azure.mgmt.web.v2021_02_01.models.DomainPatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Domain, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.Domain + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Domain"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str', pattern=r'[a-zA-Z0-9][a-zA-Z0-9\.-]+'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(domain, 'DomainPatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Domain', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Domain', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}'} # type: ignore + + def list_ownership_identifiers( + self, + resource_group_name: str, + domain_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.DomainOwnershipIdentifierCollection"]: + """Lists domain ownership identifiers. + + Description for Lists domain ownership identifiers. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param domain_name: Name of domain. + :type domain_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DomainOwnershipIdentifierCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.DomainOwnershipIdentifierCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DomainOwnershipIdentifierCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_ownership_identifiers.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DomainOwnershipIdentifierCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_ownership_identifiers.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers'} # type: ignore + + async def get_ownership_identifier( + self, + resource_group_name: str, + domain_name: str, + name: str, + **kwargs: Any + ) -> "_models.DomainOwnershipIdentifier": + """Get ownership identifier for domain. + + Description for Get ownership identifier for domain. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param domain_name: Name of domain. + :type domain_name: str + :param name: Name of identifier. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DomainOwnershipIdentifier, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.DomainOwnershipIdentifier + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DomainOwnershipIdentifier"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_ownership_identifier.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DomainOwnershipIdentifier', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers/{name}'} # type: ignore + + async def create_or_update_ownership_identifier( + self, + resource_group_name: str, + domain_name: str, + name: str, + domain_ownership_identifier: "_models.DomainOwnershipIdentifier", + **kwargs: Any + ) -> "_models.DomainOwnershipIdentifier": + """Creates an ownership identifier for a domain or updates identifier details for an existing identifier. + + Description for Creates an ownership identifier for a domain or updates identifier details for + an existing identifier. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param domain_name: Name of domain. + :type domain_name: str + :param name: Name of identifier. + :type name: str + :param domain_ownership_identifier: A JSON representation of the domain ownership properties. + :type domain_ownership_identifier: ~azure.mgmt.web.v2021_02_01.models.DomainOwnershipIdentifier + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DomainOwnershipIdentifier, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.DomainOwnershipIdentifier + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DomainOwnershipIdentifier"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_ownership_identifier.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(domain_ownership_identifier, 'DomainOwnershipIdentifier') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DomainOwnershipIdentifier', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers/{name}'} # type: ignore + + async def delete_ownership_identifier( + self, + resource_group_name: str, + domain_name: str, + name: str, + **kwargs: Any + ) -> None: + """Delete ownership identifier for domain. + + Description for Delete ownership identifier for domain. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param domain_name: Name of domain. + :type domain_name: str + :param name: Name of identifier. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_ownership_identifier.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers/{name}'} # type: ignore + + async def update_ownership_identifier( + self, + resource_group_name: str, + domain_name: str, + name: str, + domain_ownership_identifier: "_models.DomainOwnershipIdentifier", + **kwargs: Any + ) -> "_models.DomainOwnershipIdentifier": + """Creates an ownership identifier for a domain or updates identifier details for an existing identifier. + + Description for Creates an ownership identifier for a domain or updates identifier details for + an existing identifier. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param domain_name: Name of domain. + :type domain_name: str + :param name: Name of identifier. + :type name: str + :param domain_ownership_identifier: A JSON representation of the domain ownership properties. + :type domain_ownership_identifier: ~azure.mgmt.web.v2021_02_01.models.DomainOwnershipIdentifier + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DomainOwnershipIdentifier, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.DomainOwnershipIdentifier + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DomainOwnershipIdentifier"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_ownership_identifier.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(domain_ownership_identifier, 'DomainOwnershipIdentifier') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DomainOwnershipIdentifier', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers/{name}'} # type: ignore + + async def renew( + self, + resource_group_name: str, + domain_name: str, + **kwargs: Any + ) -> None: + """Renew a domain. + + Description for Renew a domain. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param domain_name: Name of the domain. + :type domain_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.renew.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + renew.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/renew'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_global_model_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_global_model_operations.py new file mode 100644 index 000000000000..048136e142a6 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_global_model_operations.py @@ -0,0 +1,213 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class GlobalOperations: + """GlobalOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2021_02_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get_deleted_web_app( + self, + deleted_site_id: str, + **kwargs: Any + ) -> "_models.DeletedSite": + """Get deleted app for a subscription. + + Description for Get deleted app for a subscription. + + :param deleted_site_id: The numeric ID of the deleted app, e.g. 12345. + :type deleted_site_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DeletedSite, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.DeletedSite + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DeletedSite"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_deleted_web_app.metadata['url'] # type: ignore + path_format_arguments = { + 'deletedSiteId': self._serialize.url("deleted_site_id", deleted_site_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DeletedSite', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_deleted_web_app.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/deletedSites/{deletedSiteId}'} # type: ignore + + async def get_deleted_web_app_snapshots( + self, + deleted_site_id: str, + **kwargs: Any + ) -> List["_models.Snapshot"]: + """Get all deleted apps for a subscription. + + Description for Get all deleted apps for a subscription. + + :param deleted_site_id: The numeric ID of the deleted app, e.g. 12345. + :type deleted_site_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of Snapshot, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2021_02_01.models.Snapshot] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.Snapshot"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_deleted_web_app_snapshots.metadata['url'] # type: ignore + path_format_arguments = { + 'deletedSiteId': self._serialize.url("deleted_site_id", deleted_site_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[Snapshot]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_deleted_web_app_snapshots.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/deletedSites/{deletedSiteId}/snapshots'} # type: ignore + + async def get_subscription_operation_with_async_response( + self, + location: str, + operation_id: str, + **kwargs: Any + ) -> None: + """Gets an operation in a subscription and given region. + + Description for Gets an operation in a subscription and given region. + + :param location: Location name. + :type location: str + :param operation_id: Operation Id. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_subscription_operation_with_async_response.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + get_subscription_operation_with_async_response.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/locations/{location}/operations/{operationId}'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_kube_environments_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_kube_environments_operations.py new file mode 100644 index 000000000000..a8622fe63344 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_kube_environments_operations.py @@ -0,0 +1,562 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class KubeEnvironmentsOperations: + """KubeEnvironmentsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2021_02_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_subscription( + self, + **kwargs: Any + ) -> AsyncIterable["_models.KubeEnvironmentCollection"]: + """Get all Kubernetes Environments for a subscription. + + Description for Get all Kubernetes Environments for a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either KubeEnvironmentCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.KubeEnvironmentCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.KubeEnvironmentCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('KubeEnvironmentCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/kubeEnvironments'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.KubeEnvironmentCollection"]: + """Get all the Kubernetes Environments in a resource group. + + Description for Get all the Kubernetes Environments in a resource group. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either KubeEnvironmentCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.KubeEnvironmentCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.KubeEnvironmentCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('KubeEnvironmentCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/kubeEnvironments'} # type: ignore + + async def get( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> "_models.KubeEnvironment": + """Get the properties of a Kubernetes Environment. + + Description for Get the properties of a Kubernetes Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the Kubernetes Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: KubeEnvironment, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.KubeEnvironment + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.KubeEnvironment"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('KubeEnvironment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/kubeEnvironments/{name}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + name: str, + kube_environment_envelope: "_models.KubeEnvironment", + **kwargs: Any + ) -> "_models.KubeEnvironment": + cls = kwargs.pop('cls', None) # type: ClsType["_models.KubeEnvironment"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(kube_environment_envelope, 'KubeEnvironment') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('KubeEnvironment', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('KubeEnvironment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/kubeEnvironments/{name}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + name: str, + kube_environment_envelope: "_models.KubeEnvironment", + **kwargs: Any + ) -> AsyncLROPoller["_models.KubeEnvironment"]: + """Creates or updates a Kubernetes Environment. + + Description for Creates or updates a Kubernetes Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the Kubernetes Environment. + :type name: str + :param kube_environment_envelope: Configuration details of the Kubernetes Environment. + :type kube_environment_envelope: ~azure.mgmt.web.v2021_02_01.models.KubeEnvironment + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either KubeEnvironment or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2021_02_01.models.KubeEnvironment] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.KubeEnvironment"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + name=name, + kube_environment_envelope=kube_environment_envelope, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('KubeEnvironment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/kubeEnvironments/{name}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/kubeEnvironments/{name}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete a Kubernetes Environment. + + Description for Delete a Kubernetes Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the Kubernetes Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + name=name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/kubeEnvironments/{name}'} # type: ignore + + async def update( + self, + resource_group_name: str, + name: str, + kube_environment_envelope: "_models.KubeEnvironmentPatchResource", + **kwargs: Any + ) -> "_models.KubeEnvironment": + """Creates or updates a Kubernetes Environment. + + Description for Creates or updates a Kubernetes Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the Kubernetes Environment. + :type name: str + :param kube_environment_envelope: Configuration details of the Kubernetes Environment. + :type kube_environment_envelope: ~azure.mgmt.web.v2021_02_01.models.KubeEnvironmentPatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: KubeEnvironment, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.KubeEnvironment + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.KubeEnvironment"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(kube_environment_envelope, 'KubeEnvironmentPatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('KubeEnvironment', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('KubeEnvironment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/kubeEnvironments/{name}'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_provider_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_provider_operations.py new file mode 100644 index 000000000000..2caad063f5eb --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_provider_operations.py @@ -0,0 +1,546 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ProviderOperations: + """ProviderOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2021_02_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get_available_stacks( + self, + os_type_selected: Optional[Union[str, "_models.Enum10"]] = None, + **kwargs: Any + ) -> AsyncIterable["_models.ApplicationStackCollection"]: + """Get available application frameworks and their versions. + + Description for Get available application frameworks and their versions. + + :param os_type_selected: + :type os_type_selected: str or ~azure.mgmt.web.v2021_02_01.models.Enum10 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ApplicationStackCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.ApplicationStackCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationStackCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_available_stacks.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if os_type_selected is not None: + query_parameters['osTypeSelected'] = self._serialize.query("os_type_selected", os_type_selected, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ApplicationStackCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + get_available_stacks.metadata = {'url': '/providers/Microsoft.Web/availableStacks'} # type: ignore + + def get_function_app_stacks( + self, + stack_os_type: Optional[Union[str, "_models.Enum11"]] = None, + **kwargs: Any + ) -> AsyncIterable["_models.FunctionAppStackCollection"]: + """Get available Function app frameworks and their versions. + + Description for Get available Function app frameworks and their versions. + + :param stack_os_type: Stack OS Type. + :type stack_os_type: str or ~azure.mgmt.web.v2021_02_01.models.Enum11 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either FunctionAppStackCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.FunctionAppStackCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionAppStackCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_function_app_stacks.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if stack_os_type is not None: + query_parameters['stackOsType'] = self._serialize.query("stack_os_type", stack_os_type, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('FunctionAppStackCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + get_function_app_stacks.metadata = {'url': '/providers/Microsoft.Web/functionAppStacks'} # type: ignore + + def get_function_app_stacks_for_location( + self, + location: str, + stack_os_type: Optional[Union[str, "_models.Enum12"]] = None, + **kwargs: Any + ) -> AsyncIterable["_models.FunctionAppStackCollection"]: + """Get available Function app frameworks and their versions for location. + + Description for Get available Function app frameworks and their versions for location. + + :param location: Function App stack location. + :type location: str + :param stack_os_type: Stack OS Type. + :type stack_os_type: str or ~azure.mgmt.web.v2021_02_01.models.Enum12 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either FunctionAppStackCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.FunctionAppStackCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionAppStackCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_function_app_stacks_for_location.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if stack_os_type is not None: + query_parameters['stackOsType'] = self._serialize.query("stack_os_type", stack_os_type, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('FunctionAppStackCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + get_function_app_stacks_for_location.metadata = {'url': '/providers/Microsoft.Web/locations/{location}/functionAppStacks'} # type: ignore + + def get_web_app_stacks_for_location( + self, + location: str, + stack_os_type: Optional[Union[str, "_models.Enum13"]] = None, + **kwargs: Any + ) -> AsyncIterable["_models.WebAppStackCollection"]: + """Get available Web app frameworks and their versions for location. + + Description for Get available Web app frameworks and their versions for location. + + :param location: Web App stack location. + :type location: str + :param stack_os_type: Stack OS Type. + :type stack_os_type: str or ~azure.mgmt.web.v2021_02_01.models.Enum13 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebAppStackCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.WebAppStackCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppStackCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_web_app_stacks_for_location.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if stack_os_type is not None: + query_parameters['stackOsType'] = self._serialize.query("stack_os_type", stack_os_type, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppStackCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + get_web_app_stacks_for_location.metadata = {'url': '/providers/Microsoft.Web/locations/{location}/webAppStacks'} # type: ignore + + def list_operations( + self, + **kwargs: Any + ) -> AsyncIterable["_models.CsmOperationCollection"]: + """Gets all available operations for the Microsoft.Web resource provider. Also exposes resource metric definitions. + + Description for Gets all available operations for the Microsoft.Web resource provider. Also + exposes resource metric definitions. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CsmOperationCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.CsmOperationCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmOperationCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_operations.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('CsmOperationCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_operations.metadata = {'url': '/providers/Microsoft.Web/operations'} # type: ignore + + def get_web_app_stacks( + self, + stack_os_type: Optional[Union[str, "_models.Enum14"]] = None, + **kwargs: Any + ) -> AsyncIterable["_models.WebAppStackCollection"]: + """Get available Web app frameworks and their versions. + + Description for Get available Web app frameworks and their versions. + + :param stack_os_type: Stack OS Type. + :type stack_os_type: str or ~azure.mgmt.web.v2021_02_01.models.Enum14 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebAppStackCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.WebAppStackCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppStackCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_web_app_stacks.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if stack_os_type is not None: + query_parameters['stackOsType'] = self._serialize.query("stack_os_type", stack_os_type, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppStackCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + get_web_app_stacks.metadata = {'url': '/providers/Microsoft.Web/webAppStacks'} # type: ignore + + def get_available_stacks_on_prem( + self, + os_type_selected: Optional[Union[str, "_models.Enum15"]] = None, + **kwargs: Any + ) -> AsyncIterable["_models.ApplicationStackCollection"]: + """Get available application frameworks and their versions. + + Description for Get available application frameworks and their versions. + + :param os_type_selected: + :type os_type_selected: str or ~azure.mgmt.web.v2021_02_01.models.Enum15 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ApplicationStackCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.ApplicationStackCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationStackCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_available_stacks_on_prem.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if os_type_selected is not None: + query_parameters['osTypeSelected'] = self._serialize.query("os_type_selected", os_type_selected, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ApplicationStackCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + get_available_stacks_on_prem.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/availableStacks'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_recommendations_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_recommendations_operations.py new file mode 100644 index 000000000000..5d9bd12db7d8 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_recommendations_operations.py @@ -0,0 +1,1109 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class RecommendationsOperations: + """RecommendationsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2021_02_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + featured: Optional[bool] = None, + filter: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.RecommendationCollection"]: + """List all recommendations for a subscription. + + Description for List all recommendations for a subscription. + + :param featured: Specify :code:`true` to return only the most critical + recommendations. The default is :code:`false`, which returns all recommendations. + :type featured: bool + :param filter: Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or + channel eq 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq + 2014-12-31T23:59:59Z and timeGrain eq duration'[PT1H|PT1M|P1D]. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RecommendationCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.RecommendationCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecommendationCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if featured is not None: + query_parameters['featured'] = self._serialize.query("featured", featured, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('RecommendationCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/recommendations'} # type: ignore + + async def reset_all_filters( + self, + **kwargs: Any + ) -> None: + """Reset all recommendation opt-out settings for a subscription. + + Description for Reset all recommendation opt-out settings for a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.reset_all_filters.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + reset_all_filters.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/recommendations/reset'} # type: ignore + + async def disable_recommendation_for_subscription( + self, + name: str, + **kwargs: Any + ) -> None: + """Disables the specified rule so it will not apply to a subscription in the future. + + Description for Disables the specified rule so it will not apply to a subscription in the + future. + + :param name: Rule name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.disable_recommendation_for_subscription.metadata['url'] # type: ignore + path_format_arguments = { + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + disable_recommendation_for_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/recommendations/{name}/disable'} # type: ignore + + def list_history_for_hosting_environment( + self, + resource_group_name: str, + hosting_environment_name: str, + expired_only: Optional[bool] = None, + filter: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.RecommendationCollection"]: + """Get past recommendations for an app, optionally specified by the time range. + + Description for Get past recommendations for an app, optionally specified by the time range. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param hosting_environment_name: Name of the hosting environment. + :type hosting_environment_name: str + :param expired_only: Specify :code:`false` to return all recommendations. The + default is :code:`true`, which returns only expired recommendations. + :type expired_only: bool + :param filter: Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or + channel eq 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq + 2014-12-31T23:59:59Z and timeGrain eq duration'[PT1H|PT1M|P1D]. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RecommendationCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.RecommendationCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecommendationCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_history_for_hosting_environment.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'hostingEnvironmentName': self._serialize.url("hosting_environment_name", hosting_environment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if expired_only is not None: + query_parameters['expiredOnly'] = self._serialize.query("expired_only", expired_only, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('RecommendationCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_history_for_hosting_environment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendationHistory'} # type: ignore + + def list_recommended_rules_for_hosting_environment( + self, + resource_group_name: str, + hosting_environment_name: str, + featured: Optional[bool] = None, + filter: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.RecommendationCollection"]: + """Get all recommendations for a hosting environment. + + Description for Get all recommendations for a hosting environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param hosting_environment_name: Name of the app. + :type hosting_environment_name: str + :param featured: Specify :code:`true` to return only the most critical + recommendations. The default is :code:`false`, which returns all recommendations. + :type featured: bool + :param filter: Return only channels specified in the filter. Filter is specified by using OData + syntax. Example: $filter=channel eq 'Api' or channel eq 'Notification'. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RecommendationCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.RecommendationCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecommendationCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_recommended_rules_for_hosting_environment.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'hostingEnvironmentName': self._serialize.url("hosting_environment_name", hosting_environment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if featured is not None: + query_parameters['featured'] = self._serialize.query("featured", featured, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('RecommendationCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_recommended_rules_for_hosting_environment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendations'} # type: ignore + + async def disable_all_for_hosting_environment( + self, + resource_group_name: str, + environment_name: str, + hosting_environment_name: str, + **kwargs: Any + ) -> None: + """Disable all recommendations for an app. + + Description for Disable all recommendations for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param environment_name: Name of the app. + :type environment_name: str + :param hosting_environment_name: + :type hosting_environment_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.disable_all_for_hosting_environment.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'hostingEnvironmentName': self._serialize.url("hosting_environment_name", hosting_environment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['environmentName'] = self._serialize.query("environment_name", environment_name, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + disable_all_for_hosting_environment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendations/disable'} # type: ignore + + async def reset_all_filters_for_hosting_environment( + self, + resource_group_name: str, + environment_name: str, + hosting_environment_name: str, + **kwargs: Any + ) -> None: + """Reset all recommendation opt-out settings for an app. + + Description for Reset all recommendation opt-out settings for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param environment_name: Name of the app. + :type environment_name: str + :param hosting_environment_name: + :type hosting_environment_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.reset_all_filters_for_hosting_environment.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'hostingEnvironmentName': self._serialize.url("hosting_environment_name", hosting_environment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['environmentName'] = self._serialize.query("environment_name", environment_name, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + reset_all_filters_for_hosting_environment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendations/reset'} # type: ignore + + async def get_rule_details_by_hosting_environment( + self, + resource_group_name: str, + hosting_environment_name: str, + name: str, + update_seen: Optional[bool] = None, + recommendation_id: Optional[str] = None, + **kwargs: Any + ) -> "_models.RecommendationRule": + """Get a recommendation rule for an app. + + Description for Get a recommendation rule for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param hosting_environment_name: Name of the hosting environment. + :type hosting_environment_name: str + :param name: Name of the recommendation. + :type name: str + :param update_seen: Specify :code:`true` to update the last-seen timestamp of the + recommendation object. + :type update_seen: bool + :param recommendation_id: The GUID of the recommendation object if you query an expired one. + You don't need to specify it to query an active entry. + :type recommendation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RecommendationRule, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.RecommendationRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecommendationRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_rule_details_by_hosting_environment.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'hostingEnvironmentName': self._serialize.url("hosting_environment_name", hosting_environment_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if update_seen is not None: + query_parameters['updateSeen'] = self._serialize.query("update_seen", update_seen, 'bool') + if recommendation_id is not None: + query_parameters['recommendationId'] = self._serialize.query("recommendation_id", recommendation_id, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RecommendationRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_rule_details_by_hosting_environment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendations/{name}'} # type: ignore + + async def disable_recommendation_for_hosting_environment( + self, + resource_group_name: str, + environment_name: str, + name: str, + hosting_environment_name: str, + **kwargs: Any + ) -> None: + """Disables the specific rule for a web site permanently. + + Description for Disables the specific rule for a web site permanently. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param environment_name: Site name. + :type environment_name: str + :param name: Rule name. + :type name: str + :param hosting_environment_name: + :type hosting_environment_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.disable_recommendation_for_hosting_environment.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'hostingEnvironmentName': self._serialize.url("hosting_environment_name", hosting_environment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['environmentName'] = self._serialize.query("environment_name", environment_name, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + disable_recommendation_for_hosting_environment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendations/{name}/disable'} # type: ignore + + def list_history_for_web_app( + self, + resource_group_name: str, + site_name: str, + expired_only: Optional[bool] = None, + filter: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.RecommendationCollection"]: + """Get past recommendations for an app, optionally specified by the time range. + + Description for Get past recommendations for an app, optionally specified by the time range. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Name of the app. + :type site_name: str + :param expired_only: Specify :code:`false` to return all recommendations. The + default is :code:`true`, which returns only expired recommendations. + :type expired_only: bool + :param filter: Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or + channel eq 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq + 2014-12-31T23:59:59Z and timeGrain eq duration'[PT1H|PT1M|P1D]. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RecommendationCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.RecommendationCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecommendationCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_history_for_web_app.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if expired_only is not None: + query_parameters['expiredOnly'] = self._serialize.query("expired_only", expired_only, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('RecommendationCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_history_for_web_app.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendationHistory'} # type: ignore + + def list_recommended_rules_for_web_app( + self, + resource_group_name: str, + site_name: str, + featured: Optional[bool] = None, + filter: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.RecommendationCollection"]: + """Get all recommendations for an app. + + Description for Get all recommendations for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Name of the app. + :type site_name: str + :param featured: Specify :code:`true` to return only the most critical + recommendations. The default is :code:`false`, which returns all recommendations. + :type featured: bool + :param filter: Return only channels specified in the filter. Filter is specified by using OData + syntax. Example: $filter=channel eq 'Api' or channel eq 'Notification'. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RecommendationCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.RecommendationCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecommendationCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_recommended_rules_for_web_app.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if featured is not None: + query_parameters['featured'] = self._serialize.query("featured", featured, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('RecommendationCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_recommended_rules_for_web_app.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations'} # type: ignore + + async def disable_all_for_web_app( + self, + resource_group_name: str, + site_name: str, + **kwargs: Any + ) -> None: + """Disable all recommendations for an app. + + Description for Disable all recommendations for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Name of the app. + :type site_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.disable_all_for_web_app.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + disable_all_for_web_app.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations/disable'} # type: ignore + + async def reset_all_filters_for_web_app( + self, + resource_group_name: str, + site_name: str, + **kwargs: Any + ) -> None: + """Reset all recommendation opt-out settings for an app. + + Description for Reset all recommendation opt-out settings for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Name of the app. + :type site_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.reset_all_filters_for_web_app.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + reset_all_filters_for_web_app.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations/reset'} # type: ignore + + async def get_rule_details_by_web_app( + self, + resource_group_name: str, + site_name: str, + name: str, + update_seen: Optional[bool] = None, + recommendation_id: Optional[str] = None, + **kwargs: Any + ) -> "_models.RecommendationRule": + """Get a recommendation rule for an app. + + Description for Get a recommendation rule for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Name of the app. + :type site_name: str + :param name: Name of the recommendation. + :type name: str + :param update_seen: Specify :code:`true` to update the last-seen timestamp of the + recommendation object. + :type update_seen: bool + :param recommendation_id: The GUID of the recommendation object if you query an expired one. + You don't need to specify it to query an active entry. + :type recommendation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RecommendationRule, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.RecommendationRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecommendationRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_rule_details_by_web_app.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if update_seen is not None: + query_parameters['updateSeen'] = self._serialize.query("update_seen", update_seen, 'bool') + if recommendation_id is not None: + query_parameters['recommendationId'] = self._serialize.query("recommendation_id", recommendation_id, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RecommendationRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_rule_details_by_web_app.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations/{name}'} # type: ignore + + async def disable_recommendation_for_site( + self, + resource_group_name: str, + site_name: str, + name: str, + **kwargs: Any + ) -> None: + """Disables the specific rule for a web site permanently. + + Description for Disables the specific rule for a web site permanently. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site name. + :type site_name: str + :param name: Rule name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.disable_recommendation_for_site.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + disable_recommendation_for_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations/{name}/disable'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_resource_health_metadata_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_resource_health_metadata_operations.py new file mode 100644 index 000000000000..0236ba479826 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_resource_health_metadata_operations.py @@ -0,0 +1,471 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ResourceHealthMetadataOperations: + """ResourceHealthMetadataOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2021_02_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs: Any + ) -> AsyncIterable["_models.ResourceHealthMetadataCollection"]: + """List all ResourceHealthMetadata for all sites in the subscription. + + Description for List all ResourceHealthMetadata for all sites in the subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceHealthMetadataCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.ResourceHealthMetadataCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceHealthMetadataCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceHealthMetadataCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/resourceHealthMetadata'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.ResourceHealthMetadataCollection"]: + """List all ResourceHealthMetadata for all sites in the resource group in the subscription. + + Description for List all ResourceHealthMetadata for all sites in the resource group in the + subscription. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceHealthMetadataCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.ResourceHealthMetadataCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceHealthMetadataCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceHealthMetadataCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/resourceHealthMetadata'} # type: ignore + + def list_by_site( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> AsyncIterable["_models.ResourceHealthMetadataCollection"]: + """Gets the category of ResourceHealthMetadata to use for the given site as a collection. + + Description for Gets the category of ResourceHealthMetadata to use for the given site as a + collection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceHealthMetadataCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.ResourceHealthMetadataCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceHealthMetadataCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_site.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceHealthMetadataCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/resourceHealthMetadata'} # type: ignore + + async def get_by_site( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> "_models.ResourceHealthMetadata": + """Gets the category of ResourceHealthMetadata to use for the given site. + + Description for Gets the category of ResourceHealthMetadata to use for the given site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ResourceHealthMetadata, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.ResourceHealthMetadata + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceHealthMetadata"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_by_site.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ResourceHealthMetadata', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_by_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/resourceHealthMetadata/default'} # type: ignore + + def list_by_site_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> AsyncIterable["_models.ResourceHealthMetadataCollection"]: + """Gets the category of ResourceHealthMetadata to use for the given site as a collection. + + Description for Gets the category of ResourceHealthMetadata to use for the given site as a + collection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceHealthMetadataCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.ResourceHealthMetadataCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceHealthMetadataCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_site_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceHealthMetadataCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_site_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/resourceHealthMetadata'} # type: ignore + + async def get_by_site_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> "_models.ResourceHealthMetadata": + """Gets the category of ResourceHealthMetadata to use for the given site. + + Description for Gets the category of ResourceHealthMetadata to use for the given site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ResourceHealthMetadata, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.ResourceHealthMetadata + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceHealthMetadata"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_by_site_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ResourceHealthMetadata', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_by_site_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/resourceHealthMetadata/default'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_static_sites_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_static_sites_operations.py new file mode 100644 index 000000000000..7ac00c36a01a --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_static_sites_operations.py @@ -0,0 +1,4156 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class StaticSitesOperations: + """StaticSitesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2021_02_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def preview_workflow( + self, + location: str, + static_sites_workflow_preview_request: "_models.StaticSitesWorkflowPreviewRequest", + **kwargs: Any + ) -> "_models.StaticSitesWorkflowPreview": + """Generates a preview workflow file for the static site. + + Description for Generates a preview workflow file for the static site. + + :param location: Location where you plan to create the static site. + :type location: str + :param static_sites_workflow_preview_request: A JSON representation of the + StaticSitesWorkflowPreviewRequest properties. See example. + :type static_sites_workflow_preview_request: ~azure.mgmt.web.v2021_02_01.models.StaticSitesWorkflowPreviewRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StaticSitesWorkflowPreview, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.StaticSitesWorkflowPreview + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSitesWorkflowPreview"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.preview_workflow.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(static_sites_workflow_preview_request, 'StaticSitesWorkflowPreviewRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StaticSitesWorkflowPreview', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + preview_workflow.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/locations/{location}/previewStaticSiteWorkflowFile'} # type: ignore + + def list( + self, + **kwargs: Any + ) -> AsyncIterable["_models.StaticSiteCollection"]: + """Get all Static Sites for a subscription. + + Description for Get all Static Sites for a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StaticSiteCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.StaticSiteCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('StaticSiteCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/staticSites'} # type: ignore + + def get_static_sites_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.StaticSiteCollection"]: + """Gets all static sites in the specified resource group. + + Description for Gets all static sites in the specified resource group. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StaticSiteCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.StaticSiteCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_static_sites_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('StaticSiteCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + get_static_sites_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites'} # type: ignore + + async def get_static_site( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> "_models.StaticSiteARMResource": + """Gets the details of a static site. + + Description for Gets the details of a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StaticSiteARMResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.StaticSiteARMResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_static_site.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StaticSiteARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_static_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}'} # type: ignore + + async def _create_or_update_static_site_initial( + self, + resource_group_name: str, + name: str, + static_site_envelope: "_models.StaticSiteARMResource", + **kwargs: Any + ) -> "_models.StaticSiteARMResource": + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_static_site_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(static_site_envelope, 'StaticSiteARMResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('StaticSiteARMResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('StaticSiteARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_static_site_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}'} # type: ignore + + async def begin_create_or_update_static_site( + self, + resource_group_name: str, + name: str, + static_site_envelope: "_models.StaticSiteARMResource", + **kwargs: Any + ) -> AsyncLROPoller["_models.StaticSiteARMResource"]: + """Creates a new static site in an existing resource group, or updates an existing static site. + + Description for Creates a new static site in an existing resource group, or updates an existing + static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site to create or update. + :type name: str + :param static_site_envelope: A JSON representation of the staticsite properties. See example. + :type static_site_envelope: ~azure.mgmt.web.v2021_02_01.models.StaticSiteARMResource + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either StaticSiteARMResource or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2021_02_01.models.StaticSiteARMResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteARMResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_static_site_initial( + resource_group_name=resource_group_name, + name=name, + static_site_envelope=static_site_envelope, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('StaticSiteARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update_static_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}'} # type: ignore + + async def _delete_static_site_initial( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._delete_static_site_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_static_site_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}'} # type: ignore + + async def begin_delete_static_site( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a static site. + + Description for Deletes a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site to delete. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_static_site_initial( + resource_group_name=resource_group_name, + name=name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete_static_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}'} # type: ignore + + async def update_static_site( + self, + resource_group_name: str, + name: str, + static_site_envelope: "_models.StaticSitePatchResource", + **kwargs: Any + ) -> "_models.StaticSiteARMResource": + """Creates a new static site in an existing resource group, or updates an existing static site. + + Description for Creates a new static site in an existing resource group, or updates an existing + static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site to create or update. + :type name: str + :param static_site_envelope: A JSON representation of the staticsite properties. See example. + :type static_site_envelope: ~azure.mgmt.web.v2021_02_01.models.StaticSitePatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StaticSiteARMResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.StaticSiteARMResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_static_site.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(static_site_envelope, 'StaticSitePatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('StaticSiteARMResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('StaticSiteARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_static_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}'} # type: ignore + + def list_static_site_users( + self, + resource_group_name: str, + name: str, + authprovider: str, + **kwargs: Any + ) -> AsyncIterable["_models.StaticSiteUserCollection"]: + """Gets the list of users of a static site. + + Description for Gets the list of users of a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param authprovider: The auth provider for the users. + :type authprovider: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StaticSiteUserCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.StaticSiteUserCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteUserCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_static_site_users.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'authprovider': self._serialize.url("authprovider", authprovider, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('StaticSiteUserCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_static_site_users.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/authproviders/{authprovider}/listUsers'} # type: ignore + + async def delete_static_site_user( + self, + resource_group_name: str, + name: str, + authprovider: str, + userid: str, + **kwargs: Any + ) -> None: + """Deletes the user entry from the static site. + + Description for Deletes the user entry from the static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the staticsite. + :type name: str + :param authprovider: The auth provider for this user. + :type authprovider: str + :param userid: The user id of the user. + :type userid: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_static_site_user.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'authprovider': self._serialize.url("authprovider", authprovider, 'str'), + 'userid': self._serialize.url("userid", userid, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_static_site_user.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/authproviders/{authprovider}/users/{userid}'} # type: ignore + + async def update_static_site_user( + self, + resource_group_name: str, + name: str, + authprovider: str, + userid: str, + static_site_user_envelope: "_models.StaticSiteUserARMResource", + **kwargs: Any + ) -> "_models.StaticSiteUserARMResource": + """Updates a user entry with the listed roles. + + Description for Updates a user entry with the listed roles. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param authprovider: The auth provider for this user. + :type authprovider: str + :param userid: The user id of the user. + :type userid: str + :param static_site_user_envelope: A JSON representation of the StaticSiteUser properties. See + example. + :type static_site_user_envelope: ~azure.mgmt.web.v2021_02_01.models.StaticSiteUserARMResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StaticSiteUserARMResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.StaticSiteUserARMResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteUserARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_static_site_user.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'authprovider': self._serialize.url("authprovider", authprovider, 'str'), + 'userid': self._serialize.url("userid", userid, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(static_site_user_envelope, 'StaticSiteUserARMResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StaticSiteUserARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_static_site_user.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/authproviders/{authprovider}/users/{userid}'} # type: ignore + + def get_static_site_builds( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> AsyncIterable["_models.StaticSiteBuildCollection"]: + """Gets all static site builds for a particular static site. + + Description for Gets all static site builds for a particular static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StaticSiteBuildCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.StaticSiteBuildCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteBuildCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_static_site_builds.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('StaticSiteBuildCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + get_static_site_builds.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds'} # type: ignore + + async def get_static_site_build( + self, + resource_group_name: str, + name: str, + environment_name: str, + **kwargs: Any + ) -> "_models.StaticSiteBuildARMResource": + """Gets the details of a static site build. + + Description for Gets the details of a static site build. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param environment_name: The stage site identifier. + :type environment_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StaticSiteBuildARMResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.StaticSiteBuildARMResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteBuildARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_static_site_build.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StaticSiteBuildARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_static_site_build.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}'} # type: ignore + + async def _delete_static_site_build_initial( + self, + resource_group_name: str, + name: str, + environment_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._delete_static_site_build_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_static_site_build_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}'} # type: ignore + + async def begin_delete_static_site_build( + self, + resource_group_name: str, + name: str, + environment_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a static site build. + + Description for Deletes a static site build. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param environment_name: The stage site identifier. + :type environment_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_static_site_build_initial( + resource_group_name=resource_group_name, + name=name, + environment_name=environment_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete_static_site_build.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}'} # type: ignore + + async def create_or_update_static_site_build_app_settings( + self, + resource_group_name: str, + name: str, + environment_name: str, + app_settings: "_models.StringDictionary", + **kwargs: Any + ) -> "_models.StringDictionary": + """Creates or updates the app settings of a static site build. + + Description for Creates or updates the app settings of a static site build. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param environment_name: The stage site identifier. + :type environment_name: str + :param app_settings: The dictionary containing the static site app settings to update. + :type app_settings: ~azure.mgmt.web.v2021_02_01.models.StringDictionary + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_static_site_build_app_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(app_settings, 'StringDictionary') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_static_site_build_app_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/config/appsettings'} # type: ignore + + async def create_or_update_static_site_build_function_app_settings( + self, + resource_group_name: str, + name: str, + environment_name: str, + app_settings: "_models.StringDictionary", + **kwargs: Any + ) -> "_models.StringDictionary": + """Creates or updates the function app settings of a static site build. + + Description for Creates or updates the function app settings of a static site build. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param environment_name: The stage site identifier. + :type environment_name: str + :param app_settings: The dictionary containing the static site function app settings to update. + :type app_settings: ~azure.mgmt.web.v2021_02_01.models.StringDictionary + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_static_site_build_function_app_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(app_settings, 'StringDictionary') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_static_site_build_function_app_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/config/functionappsettings'} # type: ignore + + def list_static_site_build_functions( + self, + resource_group_name: str, + name: str, + environment_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.StaticSiteFunctionOverviewCollection"]: + """Gets the functions of a particular static site build. + + Description for Gets the functions of a particular static site build. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param environment_name: The stage site identifier. + :type environment_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StaticSiteFunctionOverviewCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.StaticSiteFunctionOverviewCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteFunctionOverviewCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_static_site_build_functions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('StaticSiteFunctionOverviewCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_static_site_build_functions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/functions'} # type: ignore + + async def list_static_site_build_app_settings( + self, + resource_group_name: str, + name: str, + environment_name: str, + **kwargs: Any + ) -> "_models.StringDictionary": + """Gets the application settings of a static site build. + + Description for Gets the application settings of a static site build. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param environment_name: The stage site identifier. + :type environment_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_static_site_build_app_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_static_site_build_app_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/listAppSettings'} # type: ignore + + async def list_static_site_build_function_app_settings( + self, + resource_group_name: str, + name: str, + environment_name: str, + **kwargs: Any + ) -> "_models.StringDictionary": + """Gets the application settings of a static site build. + + Description for Gets the application settings of a static site build. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param environment_name: The stage site identifier. + :type environment_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_static_site_build_function_app_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_static_site_build_function_app_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/listFunctionAppSettings'} # type: ignore + + def get_user_provided_function_apps_for_static_site_build( + self, + resource_group_name: str, + name: str, + environment_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.StaticSiteUserProvidedFunctionAppsCollection"]: + """Gets the details of the user provided function apps registered with a static site build. + + Description for Gets the details of the user provided function apps registered with a static + site build. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param environment_name: The stage site identifier. + :type environment_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StaticSiteUserProvidedFunctionAppsCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.StaticSiteUserProvidedFunctionAppsCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteUserProvidedFunctionAppsCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_user_provided_function_apps_for_static_site_build.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('StaticSiteUserProvidedFunctionAppsCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + get_user_provided_function_apps_for_static_site_build.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/userProvidedFunctionApps'} # type: ignore + + async def get_user_provided_function_app_for_static_site_build( + self, + resource_group_name: str, + name: str, + environment_name: str, + function_app_name: str, + **kwargs: Any + ) -> "_models.StaticSiteUserProvidedFunctionAppARMResource": + """Gets the details of the user provided function app registered with a static site build. + + Description for Gets the details of the user provided function app registered with a static + site build. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param environment_name: The stage site identifier. + :type environment_name: str + :param function_app_name: Name of the function app registered with the static site build. + :type function_app_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StaticSiteUserProvidedFunctionAppARMResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.StaticSiteUserProvidedFunctionAppARMResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteUserProvidedFunctionAppARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_user_provided_function_app_for_static_site_build.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), + 'functionAppName': self._serialize.url("function_app_name", function_app_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StaticSiteUserProvidedFunctionAppARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_user_provided_function_app_for_static_site_build.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/userProvidedFunctionApps/{functionAppName}'} # type: ignore + + async def _register_user_provided_function_app_with_static_site_build_initial( + self, + resource_group_name: str, + name: str, + environment_name: str, + function_app_name: str, + static_site_user_provided_function_envelope: "_models.StaticSiteUserProvidedFunctionAppARMResource", + is_forced: Optional[bool] = None, + **kwargs: Any + ) -> "_models.StaticSiteUserProvidedFunctionAppARMResource": + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteUserProvidedFunctionAppARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._register_user_provided_function_app_with_static_site_build_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), + 'functionAppName': self._serialize.url("function_app_name", function_app_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if is_forced is not None: + query_parameters['isForced'] = self._serialize.query("is_forced", is_forced, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(static_site_user_provided_function_envelope, 'StaticSiteUserProvidedFunctionAppARMResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('StaticSiteUserProvidedFunctionAppARMResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('StaticSiteUserProvidedFunctionAppARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _register_user_provided_function_app_with_static_site_build_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/userProvidedFunctionApps/{functionAppName}'} # type: ignore + + async def begin_register_user_provided_function_app_with_static_site_build( + self, + resource_group_name: str, + name: str, + environment_name: str, + function_app_name: str, + static_site_user_provided_function_envelope: "_models.StaticSiteUserProvidedFunctionAppARMResource", + is_forced: Optional[bool] = None, + **kwargs: Any + ) -> AsyncLROPoller["_models.StaticSiteUserProvidedFunctionAppARMResource"]: + """Register a user provided function app with a static site build. + + Description for Register a user provided function app with a static site build. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param environment_name: The stage site identifier. + :type environment_name: str + :param function_app_name: Name of the function app to register with the static site build. + :type function_app_name: str + :param static_site_user_provided_function_envelope: A JSON representation of the user provided + function app properties. See example. + :type static_site_user_provided_function_envelope: ~azure.mgmt.web.v2021_02_01.models.StaticSiteUserProvidedFunctionAppARMResource + :param is_forced: Specify :code:`true` to force the update of the auth + configuration on the function app even if an AzureStaticWebApps provider is already configured + on the function app. The default is :code:`false`. + :type is_forced: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either StaticSiteUserProvidedFunctionAppARMResource or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2021_02_01.models.StaticSiteUserProvidedFunctionAppARMResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteUserProvidedFunctionAppARMResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._register_user_provided_function_app_with_static_site_build_initial( + resource_group_name=resource_group_name, + name=name, + environment_name=environment_name, + function_app_name=function_app_name, + static_site_user_provided_function_envelope=static_site_user_provided_function_envelope, + is_forced=is_forced, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('StaticSiteUserProvidedFunctionAppARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), + 'functionAppName': self._serialize.url("function_app_name", function_app_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_register_user_provided_function_app_with_static_site_build.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/userProvidedFunctionApps/{functionAppName}'} # type: ignore + + async def detach_user_provided_function_app_from_static_site_build( + self, + resource_group_name: str, + name: str, + environment_name: str, + function_app_name: str, + **kwargs: Any + ) -> None: + """Detach the user provided function app from the static site build. + + Description for Detach the user provided function app from the static site build. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param environment_name: The stage site identifier. + :type environment_name: str + :param function_app_name: Name of the function app registered with the static site build. + :type function_app_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.detach_user_provided_function_app_from_static_site_build.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), + 'functionAppName': self._serialize.url("function_app_name", function_app_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + detach_user_provided_function_app_from_static_site_build.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/userProvidedFunctionApps/{functionAppName}'} # type: ignore + + async def _create_zip_deployment_for_static_site_build_initial( + self, + resource_group_name: str, + name: str, + environment_name: str, + static_site_zip_deployment_envelope: "_models.StaticSiteZipDeploymentARMResource", + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_zip_deployment_for_static_site_build_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(static_site_zip_deployment_envelope, 'StaticSiteZipDeploymentARMResource') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _create_zip_deployment_for_static_site_build_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/zipdeploy'} # type: ignore + + async def begin_create_zip_deployment_for_static_site_build( + self, + resource_group_name: str, + name: str, + environment_name: str, + static_site_zip_deployment_envelope: "_models.StaticSiteZipDeploymentARMResource", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deploys zipped content to a specific environment of a static site. + + Description for Deploys zipped content to a specific environment of a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param environment_name: Name of the environment. + :type environment_name: str + :param static_site_zip_deployment_envelope: A JSON representation of the + StaticSiteZipDeployment properties. See example. + :type static_site_zip_deployment_envelope: ~azure.mgmt.web.v2021_02_01.models.StaticSiteZipDeploymentARMResource + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_zip_deployment_for_static_site_build_initial( + resource_group_name=resource_group_name, + name=name, + environment_name=environment_name, + static_site_zip_deployment_envelope=static_site_zip_deployment_envelope, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_zip_deployment_for_static_site_build.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/zipdeploy'} # type: ignore + + async def create_or_update_static_site_app_settings( + self, + resource_group_name: str, + name: str, + app_settings: "_models.StringDictionary", + **kwargs: Any + ) -> "_models.StringDictionary": + """Creates or updates the app settings of a static site. + + Description for Creates or updates the app settings of a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param app_settings: The dictionary containing the static site app settings to update. + :type app_settings: ~azure.mgmt.web.v2021_02_01.models.StringDictionary + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_static_site_app_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(app_settings, 'StringDictionary') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_static_site_app_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/config/appsettings'} # type: ignore + + async def create_or_update_static_site_function_app_settings( + self, + resource_group_name: str, + name: str, + app_settings: "_models.StringDictionary", + **kwargs: Any + ) -> "_models.StringDictionary": + """Creates or updates the function app settings of a static site. + + Description for Creates or updates the function app settings of a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param app_settings: The dictionary containing the static site function app settings to update. + :type app_settings: ~azure.mgmt.web.v2021_02_01.models.StringDictionary + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_static_site_function_app_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(app_settings, 'StringDictionary') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_static_site_function_app_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/config/functionappsettings'} # type: ignore + + async def create_user_roles_invitation_link( + self, + resource_group_name: str, + name: str, + static_site_user_roles_invitation_envelope: "_models.StaticSiteUserInvitationRequestResource", + **kwargs: Any + ) -> "_models.StaticSiteUserInvitationResponseResource": + """Creates an invitation link for a user with the role. + + Description for Creates an invitation link for a user with the role. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param static_site_user_roles_invitation_envelope: + :type static_site_user_roles_invitation_envelope: ~azure.mgmt.web.v2021_02_01.models.StaticSiteUserInvitationRequestResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StaticSiteUserInvitationResponseResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.StaticSiteUserInvitationResponseResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteUserInvitationResponseResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_user_roles_invitation_link.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(static_site_user_roles_invitation_envelope, 'StaticSiteUserInvitationRequestResource') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StaticSiteUserInvitationResponseResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_user_roles_invitation_link.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/createUserInvitation'} # type: ignore + + def list_static_site_custom_domains( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> AsyncIterable["_models.StaticSiteCustomDomainOverviewCollection"]: + """Gets all static site custom domains for a particular static site. + + Description for Gets all static site custom domains for a particular static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site resource to search in. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StaticSiteCustomDomainOverviewCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.StaticSiteCustomDomainOverviewCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteCustomDomainOverviewCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_static_site_custom_domains.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('StaticSiteCustomDomainOverviewCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_static_site_custom_domains.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains'} # type: ignore + + async def get_static_site_custom_domain( + self, + resource_group_name: str, + name: str, + domain_name: str, + **kwargs: Any + ) -> "_models.StaticSiteCustomDomainOverviewARMResource": + """Gets an existing custom domain for a particular static site. + + Description for Gets an existing custom domain for a particular static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site resource to search in. + :type name: str + :param domain_name: The custom domain name. + :type domain_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StaticSiteCustomDomainOverviewARMResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.StaticSiteCustomDomainOverviewARMResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteCustomDomainOverviewARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_static_site_custom_domain.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StaticSiteCustomDomainOverviewARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_static_site_custom_domain.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}'} # type: ignore + + async def _create_or_update_static_site_custom_domain_initial( + self, + resource_group_name: str, + name: str, + domain_name: str, + static_site_custom_domain_request_properties_envelope: "_models.StaticSiteCustomDomainRequestPropertiesARMResource", + **kwargs: Any + ) -> "_models.StaticSiteCustomDomainOverviewARMResource": + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteCustomDomainOverviewARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_static_site_custom_domain_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(static_site_custom_domain_request_properties_envelope, 'StaticSiteCustomDomainRequestPropertiesARMResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('StaticSiteCustomDomainOverviewARMResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('StaticSiteCustomDomainOverviewARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_static_site_custom_domain_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}'} # type: ignore + + async def begin_create_or_update_static_site_custom_domain( + self, + resource_group_name: str, + name: str, + domain_name: str, + static_site_custom_domain_request_properties_envelope: "_models.StaticSiteCustomDomainRequestPropertiesARMResource", + **kwargs: Any + ) -> AsyncLROPoller["_models.StaticSiteCustomDomainOverviewARMResource"]: + """Creates a new static site custom domain in an existing resource group and static site. + + Description for Creates a new static site custom domain in an existing resource group and + static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param domain_name: The custom domain to create. + :type domain_name: str + :param static_site_custom_domain_request_properties_envelope: A JSON representation of the + static site custom domain request properties. See example. + :type static_site_custom_domain_request_properties_envelope: ~azure.mgmt.web.v2021_02_01.models.StaticSiteCustomDomainRequestPropertiesARMResource + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either StaticSiteCustomDomainOverviewARMResource or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2021_02_01.models.StaticSiteCustomDomainOverviewARMResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteCustomDomainOverviewARMResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_static_site_custom_domain_initial( + resource_group_name=resource_group_name, + name=name, + domain_name=domain_name, + static_site_custom_domain_request_properties_envelope=static_site_custom_domain_request_properties_envelope, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('StaticSiteCustomDomainOverviewARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update_static_site_custom_domain.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}'} # type: ignore + + async def _delete_static_site_custom_domain_initial( + self, + resource_group_name: str, + name: str, + domain_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._delete_static_site_custom_domain_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_static_site_custom_domain_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}'} # type: ignore + + async def begin_delete_static_site_custom_domain( + self, + resource_group_name: str, + name: str, + domain_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a custom domain. + + Description for Deletes a custom domain. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param domain_name: The custom domain to delete. + :type domain_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_static_site_custom_domain_initial( + resource_group_name=resource_group_name, + name=name, + domain_name=domain_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete_static_site_custom_domain.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}'} # type: ignore + + async def _validate_custom_domain_can_be_added_to_static_site_initial( + self, + resource_group_name: str, + name: str, + domain_name: str, + static_site_custom_domain_request_properties_envelope: "_models.StaticSiteCustomDomainRequestPropertiesARMResource", + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._validate_custom_domain_can_be_added_to_static_site_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(static_site_custom_domain_request_properties_envelope, 'StaticSiteCustomDomainRequestPropertiesARMResource') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _validate_custom_domain_can_be_added_to_static_site_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}/validate'} # type: ignore + + async def begin_validate_custom_domain_can_be_added_to_static_site( + self, + resource_group_name: str, + name: str, + domain_name: str, + static_site_custom_domain_request_properties_envelope: "_models.StaticSiteCustomDomainRequestPropertiesARMResource", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Validates a particular custom domain can be added to a static site. + + Description for Validates a particular custom domain can be added to a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param domain_name: The custom domain to validate. + :type domain_name: str + :param static_site_custom_domain_request_properties_envelope: A JSON representation of the + static site custom domain request properties. See example. + :type static_site_custom_domain_request_properties_envelope: ~azure.mgmt.web.v2021_02_01.models.StaticSiteCustomDomainRequestPropertiesARMResource + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._validate_custom_domain_can_be_added_to_static_site_initial( + resource_group_name=resource_group_name, + name=name, + domain_name=domain_name, + static_site_custom_domain_request_properties_envelope=static_site_custom_domain_request_properties_envelope, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_validate_custom_domain_can_be_added_to_static_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}/validate'} # type: ignore + + async def _detach_static_site_initial( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._detach_static_site_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _detach_static_site_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/detach'} # type: ignore + + async def begin_detach_static_site( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Detaches a static site. + + Description for Detaches a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site to detach. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._detach_static_site_initial( + resource_group_name=resource_group_name, + name=name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_detach_static_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/detach'} # type: ignore + + def list_static_site_functions( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> AsyncIterable["_models.StaticSiteFunctionOverviewCollection"]: + """Gets the functions of a static site. + + Description for Gets the functions of a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StaticSiteFunctionOverviewCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.StaticSiteFunctionOverviewCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteFunctionOverviewCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_static_site_functions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('StaticSiteFunctionOverviewCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_static_site_functions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/functions'} # type: ignore + + async def list_static_site_app_settings( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> "_models.StringDictionary": + """Gets the application settings of a static site. + + Description for Gets the application settings of a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_static_site_app_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_static_site_app_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/listAppSettings'} # type: ignore + + async def list_static_site_configured_roles( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> "_models.StringList": + """Lists the roles configured for the static site. + + Description for Lists the roles configured for the static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringList, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.StringList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_static_site_configured_roles.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringList', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_static_site_configured_roles.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/listConfiguredRoles'} # type: ignore + + async def list_static_site_function_app_settings( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> "_models.StringDictionary": + """Gets the application settings of a static site. + + Description for Gets the application settings of a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_static_site_function_app_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_static_site_function_app_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/listFunctionAppSettings'} # type: ignore + + async def list_static_site_secrets( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> "_models.StringDictionary": + """Lists the secrets for an existing static site. + + Description for Lists the secrets for an existing static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_static_site_secrets.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_static_site_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/listSecrets'} # type: ignore + + def get_private_endpoint_connection_list( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> AsyncIterable["_models.PrivateEndpointConnectionCollection"]: + """Gets the list of private endpoint connections associated with a static site. + + Description for Gets the list of private endpoint connections associated with a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PrivateEndpointConnectionCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.PrivateEndpointConnectionCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_private_endpoint_connection_list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('PrivateEndpointConnectionCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + get_private_endpoint_connection_list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/privateEndpointConnections'} # type: ignore + + async def get_private_endpoint_connection( + self, + resource_group_name: str, + name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> "_models.RemotePrivateEndpointConnectionARMResource": + """Gets a private endpoint connection. + + Description for Gets a private endpoint connection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param private_endpoint_connection_name: Name of the private endpoint connection. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RemotePrivateEndpointConnectionARMResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.RemotePrivateEndpointConnectionARMResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RemotePrivateEndpointConnectionARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_private_endpoint_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RemotePrivateEndpointConnectionARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_private_endpoint_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def _approve_or_reject_private_endpoint_connection_initial( + self, + resource_group_name: str, + name: str, + private_endpoint_connection_name: str, + private_endpoint_wrapper: "_models.PrivateLinkConnectionApprovalRequestResource", + **kwargs: Any + ) -> "_models.RemotePrivateEndpointConnectionARMResource": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RemotePrivateEndpointConnectionARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._approve_or_reject_private_endpoint_connection_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(private_endpoint_wrapper, 'PrivateLinkConnectionApprovalRequestResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('RemotePrivateEndpointConnectionARMResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('RemotePrivateEndpointConnectionARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _approve_or_reject_private_endpoint_connection_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def begin_approve_or_reject_private_endpoint_connection( + self, + resource_group_name: str, + name: str, + private_endpoint_connection_name: str, + private_endpoint_wrapper: "_models.PrivateLinkConnectionApprovalRequestResource", + **kwargs: Any + ) -> AsyncLROPoller["_models.RemotePrivateEndpointConnectionARMResource"]: + """Approves or rejects a private endpoint connection. + + Description for Approves or rejects a private endpoint connection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param private_endpoint_connection_name: Name of the private endpoint connection. + :type private_endpoint_connection_name: str + :param private_endpoint_wrapper: Request body. + :type private_endpoint_wrapper: ~azure.mgmt.web.v2021_02_01.models.PrivateLinkConnectionApprovalRequestResource + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either RemotePrivateEndpointConnectionARMResource or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2021_02_01.models.RemotePrivateEndpointConnectionARMResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RemotePrivateEndpointConnectionARMResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._approve_or_reject_private_endpoint_connection_initial( + resource_group_name=resource_group_name, + name=name, + private_endpoint_connection_name=private_endpoint_connection_name, + private_endpoint_wrapper=private_endpoint_wrapper, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('RemotePrivateEndpointConnectionARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_approve_or_reject_private_endpoint_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def _delete_private_endpoint_connection_initial( + self, + resource_group_name: str, + name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> Any: + cls = kwargs.pop('cls', None) # type: ClsType[Any] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._delete_private_endpoint_connection_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('object', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('object', pipeline_response) + + if response.status_code == 204: + deserialized = self._deserialize('object', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _delete_private_endpoint_connection_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def begin_delete_private_endpoint_connection( + self, + resource_group_name: str, + name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> AsyncLROPoller[Any]: + """Deletes a private endpoint connection. + + Description for Deletes a private endpoint connection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param private_endpoint_connection_name: Name of the private endpoint connection. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either any or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[any] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[Any] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_private_endpoint_connection_initial( + resource_group_name=resource_group_name, + name=name, + private_endpoint_connection_name=private_endpoint_connection_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('object', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete_private_endpoint_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def get_private_link_resources( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> "_models.PrivateLinkResourcesWrapper": + """Gets the private link resources. + + Description for Gets the private link resources. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the site. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkResourcesWrapper, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.PrivateLinkResourcesWrapper + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourcesWrapper"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_private_link_resources.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateLinkResourcesWrapper', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_private_link_resources.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/privateLinkResources'} # type: ignore + + async def reset_static_site_api_key( + self, + resource_group_name: str, + name: str, + reset_properties_envelope: "_models.StaticSiteResetPropertiesARMResource", + **kwargs: Any + ) -> None: + """Resets the api key for an existing static site. + + Description for Resets the api key for an existing static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param reset_properties_envelope: + :type reset_properties_envelope: ~azure.mgmt.web.v2021_02_01.models.StaticSiteResetPropertiesARMResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.reset_static_site_api_key.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(reset_properties_envelope, 'StaticSiteResetPropertiesARMResource') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + reset_static_site_api_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/resetapikey'} # type: ignore + + def get_user_provided_function_apps_for_static_site( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> AsyncIterable["_models.StaticSiteUserProvidedFunctionAppsCollection"]: + """Gets the details of the user provided function apps registered with a static site. + + Description for Gets the details of the user provided function apps registered with a static + site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StaticSiteUserProvidedFunctionAppsCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.StaticSiteUserProvidedFunctionAppsCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteUserProvidedFunctionAppsCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_user_provided_function_apps_for_static_site.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('StaticSiteUserProvidedFunctionAppsCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + get_user_provided_function_apps_for_static_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/userProvidedFunctionApps'} # type: ignore + + async def get_user_provided_function_app_for_static_site( + self, + resource_group_name: str, + name: str, + function_app_name: str, + **kwargs: Any + ) -> "_models.StaticSiteUserProvidedFunctionAppARMResource": + """Gets the details of the user provided function app registered with a static site. + + Description for Gets the details of the user provided function app registered with a static + site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param function_app_name: Name of the function app registered with the static site. + :type function_app_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StaticSiteUserProvidedFunctionAppARMResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.StaticSiteUserProvidedFunctionAppARMResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteUserProvidedFunctionAppARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_user_provided_function_app_for_static_site.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionAppName': self._serialize.url("function_app_name", function_app_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StaticSiteUserProvidedFunctionAppARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_user_provided_function_app_for_static_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/userProvidedFunctionApps/{functionAppName}'} # type: ignore + + async def _register_user_provided_function_app_with_static_site_initial( + self, + resource_group_name: str, + name: str, + function_app_name: str, + static_site_user_provided_function_envelope: "_models.StaticSiteUserProvidedFunctionAppARMResource", + is_forced: Optional[bool] = None, + **kwargs: Any + ) -> "_models.StaticSiteUserProvidedFunctionAppARMResource": + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteUserProvidedFunctionAppARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._register_user_provided_function_app_with_static_site_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionAppName': self._serialize.url("function_app_name", function_app_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if is_forced is not None: + query_parameters['isForced'] = self._serialize.query("is_forced", is_forced, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(static_site_user_provided_function_envelope, 'StaticSiteUserProvidedFunctionAppARMResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('StaticSiteUserProvidedFunctionAppARMResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('StaticSiteUserProvidedFunctionAppARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _register_user_provided_function_app_with_static_site_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/userProvidedFunctionApps/{functionAppName}'} # type: ignore + + async def begin_register_user_provided_function_app_with_static_site( + self, + resource_group_name: str, + name: str, + function_app_name: str, + static_site_user_provided_function_envelope: "_models.StaticSiteUserProvidedFunctionAppARMResource", + is_forced: Optional[bool] = None, + **kwargs: Any + ) -> AsyncLROPoller["_models.StaticSiteUserProvidedFunctionAppARMResource"]: + """Register a user provided function app with a static site. + + Description for Register a user provided function app with a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param function_app_name: Name of the function app to register with the static site. + :type function_app_name: str + :param static_site_user_provided_function_envelope: A JSON representation of the user provided + function app properties. See example. + :type static_site_user_provided_function_envelope: ~azure.mgmt.web.v2021_02_01.models.StaticSiteUserProvidedFunctionAppARMResource + :param is_forced: Specify :code:`true` to force the update of the auth + configuration on the function app even if an AzureStaticWebApps provider is already configured + on the function app. The default is :code:`false`. + :type is_forced: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either StaticSiteUserProvidedFunctionAppARMResource or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2021_02_01.models.StaticSiteUserProvidedFunctionAppARMResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteUserProvidedFunctionAppARMResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._register_user_provided_function_app_with_static_site_initial( + resource_group_name=resource_group_name, + name=name, + function_app_name=function_app_name, + static_site_user_provided_function_envelope=static_site_user_provided_function_envelope, + is_forced=is_forced, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('StaticSiteUserProvidedFunctionAppARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionAppName': self._serialize.url("function_app_name", function_app_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_register_user_provided_function_app_with_static_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/userProvidedFunctionApps/{functionAppName}'} # type: ignore + + async def detach_user_provided_function_app_from_static_site( + self, + resource_group_name: str, + name: str, + function_app_name: str, + **kwargs: Any + ) -> None: + """Detach the user provided function app from the static site. + + Description for Detach the user provided function app from the static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param function_app_name: Name of the function app registered with the static site. + :type function_app_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.detach_user_provided_function_app_from_static_site.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionAppName': self._serialize.url("function_app_name", function_app_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + detach_user_provided_function_app_from_static_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/userProvidedFunctionApps/{functionAppName}'} # type: ignore + + async def _create_zip_deployment_for_static_site_initial( + self, + resource_group_name: str, + name: str, + static_site_zip_deployment_envelope: "_models.StaticSiteZipDeploymentARMResource", + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_zip_deployment_for_static_site_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(static_site_zip_deployment_envelope, 'StaticSiteZipDeploymentARMResource') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _create_zip_deployment_for_static_site_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/zipdeploy'} # type: ignore + + async def begin_create_zip_deployment_for_static_site( + self, + resource_group_name: str, + name: str, + static_site_zip_deployment_envelope: "_models.StaticSiteZipDeploymentARMResource", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deploys zipped content to a static site. + + Description for Deploys zipped content to a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param static_site_zip_deployment_envelope: A JSON representation of the + StaticSiteZipDeployment properties. See example. + :type static_site_zip_deployment_envelope: ~azure.mgmt.web.v2021_02_01.models.StaticSiteZipDeploymentARMResource + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_zip_deployment_for_static_site_initial( + resource_group_name=resource_group_name, + name=name, + static_site_zip_deployment_envelope=static_site_zip_deployment_envelope, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_zip_deployment_for_static_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/zipdeploy'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_top_level_domains_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_top_level_domains_operations.py new file mode 100644 index 000000000000..06c07ccb1e10 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_top_level_domains_operations.py @@ -0,0 +1,252 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class TopLevelDomainsOperations: + """TopLevelDomainsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2021_02_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs: Any + ) -> AsyncIterable["_models.TopLevelDomainCollection"]: + """Get all top-level domains supported for registration. + + Description for Get all top-level domains supported for registration. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either TopLevelDomainCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.TopLevelDomainCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TopLevelDomainCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('TopLevelDomainCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/topLevelDomains'} # type: ignore + + async def get( + self, + name: str, + **kwargs: Any + ) -> "_models.TopLevelDomain": + """Get details of a top-level domain. + + Description for Get details of a top-level domain. + + :param name: Name of the top-level domain. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TopLevelDomain, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.TopLevelDomain + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TopLevelDomain"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('TopLevelDomain', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/topLevelDomains/{name}'} # type: ignore + + def list_agreements( + self, + name: str, + agreement_option: "_models.TopLevelDomainAgreementOption", + **kwargs: Any + ) -> AsyncIterable["_models.TldLegalAgreementCollection"]: + """Gets all legal agreements that user needs to accept before purchasing a domain. + + Description for Gets all legal agreements that user needs to accept before purchasing a domain. + + :param name: Name of the top-level domain. + :type name: str + :param agreement_option: Domain agreement options. + :type agreement_option: ~azure.mgmt.web.v2021_02_01.models.TopLevelDomainAgreementOption + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either TldLegalAgreementCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.TldLegalAgreementCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TldLegalAgreementCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = "application/json" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_agreements.metadata['url'] # type: ignore + path_format_arguments = { + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(agreement_option, 'TopLevelDomainAgreementOption') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(agreement_option, 'TopLevelDomainAgreementOption') + body_content_kwargs['content'] = body_content + request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('TldLegalAgreementCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_agreements.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/topLevelDomains/{name}/listAgreements'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_web_apps_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_web_apps_operations.py new file mode 100644 index 000000000000..289b8e38ec20 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_web_apps_operations.py @@ -0,0 +1,29762 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, IO, List, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class WebAppsOperations: + """WebAppsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2021_02_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs: Any + ) -> AsyncIterable["_models.WebAppCollection"]: + """Get all apps for a subscription. + + Description for Get all apps for a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebAppCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.WebAppCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/sites'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + include_slots: Optional[bool] = None, + **kwargs: Any + ) -> AsyncIterable["_models.WebAppCollection"]: + """Gets all web, mobile, and API apps in the specified resource group. + + Description for Gets all web, mobile, and API apps in the specified resource group. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param include_slots: Specify :code:`true` to include deployment slots in + results. The default is false, which only gives you the production slot of all apps. + :type include_slots: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebAppCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.WebAppCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if include_slots is not None: + query_parameters['includeSlots'] = self._serialize.query("include_slots", include_slots, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites'} # type: ignore + + async def get( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> "_models.Site": + """Gets the details of a web, mobile, or API app. + + Description for Gets the details of a web, mobile, or API app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Site, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.Site + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Site"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Site', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + name: str, + site_envelope: "_models.Site", + **kwargs: Any + ) -> "_models.Site": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Site"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_envelope, 'Site') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Site', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Site', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + name: str, + site_envelope: "_models.Site", + **kwargs: Any + ) -> AsyncLROPoller["_models.Site"]: + """Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. + + Description for Creates a new web, mobile, or API app in an existing resource group, or updates + an existing app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Unique name of the app to create or update. To create or update a deployment slot, + use the {slot} parameter. + :type name: str + :param site_envelope: A JSON representation of the app properties. See example. + :type site_envelope: ~azure.mgmt.web.v2021_02_01.models.Site + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Site or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2021_02_01.models.Site] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Site"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + name=name, + site_envelope=site_envelope, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Site', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + name: str, + delete_metrics: Optional[bool] = None, + delete_empty_server_farm: Optional[bool] = None, + **kwargs: Any + ) -> None: + """Deletes a web, mobile, or API app, or one of the deployment slots. + + Description for Deletes a web, mobile, or API app, or one of the deployment slots. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app to delete. + :type name: str + :param delete_metrics: If true, web app metrics are also deleted. + :type delete_metrics: bool + :param delete_empty_server_farm: Specify false if you want to keep empty App Service plan. By + default, empty App Service plan is deleted. + :type delete_empty_server_farm: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if delete_metrics is not None: + query_parameters['deleteMetrics'] = self._serialize.query("delete_metrics", delete_metrics, 'bool') + if delete_empty_server_farm is not None: + query_parameters['deleteEmptyServerFarm'] = self._serialize.query("delete_empty_server_farm", delete_empty_server_farm, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}'} # type: ignore + + async def update( + self, + resource_group_name: str, + name: str, + site_envelope: "_models.SitePatchResource", + **kwargs: Any + ) -> "_models.Site": + """Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. + + Description for Creates a new web, mobile, or API app in an existing resource group, or updates + an existing app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Unique name of the app to create or update. To create or update a deployment slot, + use the {slot} parameter. + :type name: str + :param site_envelope: A JSON representation of the app properties. See example. + :type site_envelope: ~azure.mgmt.web.v2021_02_01.models.SitePatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Site, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.Site + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Site"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_envelope, 'SitePatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Site', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Site', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}'} # type: ignore + + async def analyze_custom_hostname( + self, + resource_group_name: str, + name: str, + host_name: Optional[str] = None, + **kwargs: Any + ) -> "_models.CustomHostnameAnalysisResult": + """Analyze a custom hostname. + + Description for Analyze a custom hostname. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param host_name: Custom hostname. + :type host_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CustomHostnameAnalysisResult, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.CustomHostnameAnalysisResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomHostnameAnalysisResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.analyze_custom_hostname.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if host_name is not None: + query_parameters['hostName'] = self._serialize.query("host_name", host_name, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CustomHostnameAnalysisResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + analyze_custom_hostname.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/analyzeCustomHostname'} # type: ignore + + async def apply_slot_config_to_production( + self, + resource_group_name: str, + name: str, + slot_swap_entity: "_models.CsmSlotEntity", + **kwargs: Any + ) -> None: + """Applies the configuration settings from the target slot onto the current slot. + + Description for Applies the configuration settings from the target slot onto the current slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot_swap_entity: JSON object that contains the target slot name. See example. + :type slot_swap_entity: ~azure.mgmt.web.v2021_02_01.models.CsmSlotEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.apply_slot_config_to_production.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(slot_swap_entity, 'CsmSlotEntity') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + apply_slot_config_to_production.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/applySlotConfig'} # type: ignore + + async def backup( + self, + resource_group_name: str, + name: str, + request: "_models.BackupRequest", + **kwargs: Any + ) -> "_models.BackupItem": + """Creates a backup of an app. + + Description for Creates a backup of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param request: Backup configuration. You can use the JSON response from the POST action as + input here. + :type request: ~azure.mgmt.web.v2021_02_01.models.BackupRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupItem, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.BackupItem + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupItem"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.backup.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'BackupRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupItem', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + backup.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backup'} # type: ignore + + def list_backups( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> AsyncIterable["_models.BackupItemCollection"]: + """Gets existing backups of an app. + + Description for Gets existing backups of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either BackupItemCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.BackupItemCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupItemCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_backups.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('BackupItemCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_backups.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups'} # type: ignore + + async def get_backup_status( + self, + resource_group_name: str, + name: str, + backup_id: str, + **kwargs: Any + ) -> "_models.BackupItem": + """Gets a backup of an app by its ID. + + Description for Gets a backup of an app by its ID. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param backup_id: ID of the backup. + :type backup_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupItem, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.BackupItem + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupItem"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_backup_status.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupItem', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_backup_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}'} # type: ignore + + async def delete_backup( + self, + resource_group_name: str, + name: str, + backup_id: str, + **kwargs: Any + ) -> None: + """Deletes a backup of an app by its ID. + + Description for Deletes a backup of an app by its ID. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param backup_id: ID of the backup. + :type backup_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_backup.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_backup.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}'} # type: ignore + + async def list_backup_status_secrets( + self, + resource_group_name: str, + name: str, + backup_id: str, + request: "_models.BackupRequest", + **kwargs: Any + ) -> "_models.BackupItem": + """Gets status of a web app backup that may be in progress, including secrets associated with the backup, such as the Azure Storage SAS URL. Also can be used to update the SAS URL for the backup if a new URL is passed in the request body. + + Description for Gets status of a web app backup that may be in progress, including secrets + associated with the backup, such as the Azure Storage SAS URL. Also can be used to update the + SAS URL for the backup if a new URL is passed in the request body. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param backup_id: ID of backup. + :type backup_id: str + :param request: Information on backup request. + :type request: ~azure.mgmt.web.v2021_02_01.models.BackupRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupItem, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.BackupItem + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupItem"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.list_backup_status_secrets.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'BackupRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupItem', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_backup_status_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}/list'} # type: ignore + + async def _restore_initial( + self, + resource_group_name: str, + name: str, + backup_id: str, + request: "_models.RestoreRequest", + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._restore_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'RestoreRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _restore_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}/restore'} # type: ignore + + async def begin_restore( + self, + resource_group_name: str, + name: str, + backup_id: str, + request: "_models.RestoreRequest", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Restores a specific backup to another app (or deployment slot, if specified). + + Description for Restores a specific backup to another app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param backup_id: ID of the backup. + :type backup_id: str + :param request: Information on restore request . + :type request: ~azure.mgmt.web.v2021_02_01.models.RestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._restore_initial( + resource_group_name=resource_group_name, + name=name, + backup_id=backup_id, + request=request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_restore.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}/restore'} # type: ignore + + def list_basic_publishing_credentials_policies( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> AsyncIterable["_models.PublishingCredentialsPoliciesCollection"]: + """Returns whether Scm basic auth is allowed and whether Ftp is allowed for a given site. + + Description for Returns whether Scm basic auth is allowed and whether Ftp is allowed for a + given site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PublishingCredentialsPoliciesCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.PublishingCredentialsPoliciesCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublishingCredentialsPoliciesCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_basic_publishing_credentials_policies.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('PublishingCredentialsPoliciesCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_basic_publishing_credentials_policies.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/basicPublishingCredentialsPolicies'} # type: ignore + + async def get_ftp_allowed( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> "_models.CsmPublishingCredentialsPoliciesEntity": + """Returns whether FTP is allowed on the site or not. + + Description for Returns whether FTP is allowed on the site or not. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CsmPublishingCredentialsPoliciesEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.CsmPublishingCredentialsPoliciesEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmPublishingCredentialsPoliciesEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_ftp_allowed.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CsmPublishingCredentialsPoliciesEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_ftp_allowed.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/basicPublishingCredentialsPolicies/ftp'} # type: ignore + + async def update_ftp_allowed( + self, + resource_group_name: str, + name: str, + csm_publishing_access_policies_entity: "_models.CsmPublishingCredentialsPoliciesEntity", + **kwargs: Any + ) -> "_models.CsmPublishingCredentialsPoliciesEntity": + """Updates whether FTP is allowed on the site or not. + + Description for Updates whether FTP is allowed on the site or not. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param csm_publishing_access_policies_entity: + :type csm_publishing_access_policies_entity: ~azure.mgmt.web.v2021_02_01.models.CsmPublishingCredentialsPoliciesEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CsmPublishingCredentialsPoliciesEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.CsmPublishingCredentialsPoliciesEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmPublishingCredentialsPoliciesEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_ftp_allowed.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(csm_publishing_access_policies_entity, 'CsmPublishingCredentialsPoliciesEntity') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CsmPublishingCredentialsPoliciesEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_ftp_allowed.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/basicPublishingCredentialsPolicies/ftp'} # type: ignore + + async def get_scm_allowed( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> "_models.CsmPublishingCredentialsPoliciesEntity": + """Returns whether Scm basic auth is allowed on the site or not. + + Description for Returns whether Scm basic auth is allowed on the site or not. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CsmPublishingCredentialsPoliciesEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.CsmPublishingCredentialsPoliciesEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmPublishingCredentialsPoliciesEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_scm_allowed.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CsmPublishingCredentialsPoliciesEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_scm_allowed.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/basicPublishingCredentialsPolicies/scm'} # type: ignore + + async def update_scm_allowed( + self, + resource_group_name: str, + name: str, + csm_publishing_access_policies_entity: "_models.CsmPublishingCredentialsPoliciesEntity", + **kwargs: Any + ) -> "_models.CsmPublishingCredentialsPoliciesEntity": + """Updates whether user publishing credentials are allowed on the site or not. + + Description for Updates whether user publishing credentials are allowed on the site or not. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param csm_publishing_access_policies_entity: + :type csm_publishing_access_policies_entity: ~azure.mgmt.web.v2021_02_01.models.CsmPublishingCredentialsPoliciesEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CsmPublishingCredentialsPoliciesEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.CsmPublishingCredentialsPoliciesEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmPublishingCredentialsPoliciesEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_scm_allowed.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(csm_publishing_access_policies_entity, 'CsmPublishingCredentialsPoliciesEntity') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CsmPublishingCredentialsPoliciesEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_scm_allowed.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/basicPublishingCredentialsPolicies/scm'} # type: ignore + + def list_configurations( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> AsyncIterable["_models.SiteConfigResourceCollection"]: + """List the configurations of an app. + + Description for List the configurations of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SiteConfigResourceCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.SiteConfigResourceCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigResourceCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_configurations.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SiteConfigResourceCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_configurations.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config'} # type: ignore + + async def update_application_settings( + self, + resource_group_name: str, + name: str, + app_settings: "_models.StringDictionary", + **kwargs: Any + ) -> "_models.StringDictionary": + """Replaces the application settings of an app. + + Description for Replaces the application settings of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param app_settings: Application settings of the app. + :type app_settings: ~azure.mgmt.web.v2021_02_01.models.StringDictionary + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_application_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(app_settings, 'StringDictionary') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_application_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/appsettings'} # type: ignore + + async def list_application_settings( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> "_models.StringDictionary": + """Gets the application settings of an app. + + Description for Gets the application settings of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_application_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_application_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/appsettings/list'} # type: ignore + + async def update_auth_settings( + self, + resource_group_name: str, + name: str, + site_auth_settings: "_models.SiteAuthSettings", + **kwargs: Any + ) -> "_models.SiteAuthSettings": + """Updates the Authentication / Authorization settings associated with web app. + + Description for Updates the Authentication / Authorization settings associated with web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param site_auth_settings: Auth settings associated with web app. + :type site_auth_settings: ~azure.mgmt.web.v2021_02_01.models.SiteAuthSettings + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteAuthSettings, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SiteAuthSettings + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteAuthSettings"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_auth_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_auth_settings, 'SiteAuthSettings') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteAuthSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_auth_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/authsettings'} # type: ignore + + async def get_auth_settings( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> "_models.SiteAuthSettings": + """Gets the Authentication/Authorization settings of an app. + + Description for Gets the Authentication/Authorization settings of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteAuthSettings, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SiteAuthSettings + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteAuthSettings"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_auth_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteAuthSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_auth_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/authsettings/list'} # type: ignore + + async def update_auth_settings_v2( + self, + resource_group_name: str, + name: str, + site_auth_settings_v2: "_models.SiteAuthSettingsV2", + **kwargs: Any + ) -> "_models.SiteAuthSettingsV2": + """Updates site's Authentication / Authorization settings for apps via the V2 format. + + Description for Updates site's Authentication / Authorization settings for apps via the V2 + format. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param site_auth_settings_v2: Auth settings associated with web app. + :type site_auth_settings_v2: ~azure.mgmt.web.v2021_02_01.models.SiteAuthSettingsV2 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteAuthSettingsV2, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SiteAuthSettingsV2 + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteAuthSettingsV2"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_auth_settings_v2.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_auth_settings_v2, 'SiteAuthSettingsV2') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteAuthSettingsV2', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_auth_settings_v2.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/authsettingsV2'} # type: ignore + + async def get_auth_settings_v2( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> "_models.SiteAuthSettingsV2": + """Gets site's Authentication / Authorization settings for apps via the V2 format. + + Description for Gets site's Authentication / Authorization settings for apps via the V2 format. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteAuthSettingsV2, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SiteAuthSettingsV2 + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteAuthSettingsV2"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_auth_settings_v2.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteAuthSettingsV2', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_auth_settings_v2.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/authsettingsV2/list'} # type: ignore + + async def update_azure_storage_accounts( + self, + resource_group_name: str, + name: str, + azure_storage_accounts: "_models.AzureStoragePropertyDictionaryResource", + **kwargs: Any + ) -> "_models.AzureStoragePropertyDictionaryResource": + """Updates the Azure storage account configurations of an app. + + Description for Updates the Azure storage account configurations of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param azure_storage_accounts: Azure storage accounts of the app. + :type azure_storage_accounts: ~azure.mgmt.web.v2021_02_01.models.AzureStoragePropertyDictionaryResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AzureStoragePropertyDictionaryResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.AzureStoragePropertyDictionaryResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureStoragePropertyDictionaryResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_azure_storage_accounts.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(azure_storage_accounts, 'AzureStoragePropertyDictionaryResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AzureStoragePropertyDictionaryResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_azure_storage_accounts.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/azurestorageaccounts'} # type: ignore + + async def list_azure_storage_accounts( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> "_models.AzureStoragePropertyDictionaryResource": + """Gets the Azure storage account configurations of an app. + + Description for Gets the Azure storage account configurations of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AzureStoragePropertyDictionaryResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.AzureStoragePropertyDictionaryResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureStoragePropertyDictionaryResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_azure_storage_accounts.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AzureStoragePropertyDictionaryResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_azure_storage_accounts.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/azurestorageaccounts/list'} # type: ignore + + async def update_backup_configuration( + self, + resource_group_name: str, + name: str, + request: "_models.BackupRequest", + **kwargs: Any + ) -> "_models.BackupRequest": + """Updates the backup configuration of an app. + + Description for Updates the backup configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param request: Edited backup configuration. + :type request: ~azure.mgmt.web.v2021_02_01.models.BackupRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupRequest, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.BackupRequest + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupRequest"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_backup_configuration.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'BackupRequest') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupRequest', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_backup_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/backup'} # type: ignore + + async def delete_backup_configuration( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> None: + """Deletes the backup configuration of an app. + + Description for Deletes the backup configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_backup_configuration.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_backup_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/backup'} # type: ignore + + async def get_backup_configuration( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> "_models.BackupRequest": + """Gets the backup configuration of an app. + + Description for Gets the backup configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupRequest, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.BackupRequest + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupRequest"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_backup_configuration.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupRequest', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_backup_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/backup/list'} # type: ignore + + def get_app_settings_key_vault_references( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> AsyncIterable["_models.ApiKVReferenceCollection"]: + """Gets the config reference app settings and status of an app. + + Description for Gets the config reference app settings and status of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ApiKVReferenceCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.ApiKVReferenceCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiKVReferenceCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_app_settings_key_vault_references.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ApiKVReferenceCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + get_app_settings_key_vault_references.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/configreferences/appsettings'} # type: ignore + + async def get_app_setting_key_vault_reference( + self, + resource_group_name: str, + name: str, + app_setting_key: str, + **kwargs: Any + ) -> "_models.ApiKVReference": + """Gets the config reference and status of an app. + + Description for Gets the config reference and status of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param app_setting_key: App Setting key name. + :type app_setting_key: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ApiKVReference, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.ApiKVReference + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiKVReference"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_app_setting_key_vault_reference.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'appSettingKey': self._serialize.url("app_setting_key", app_setting_key, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ApiKVReference', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_app_setting_key_vault_reference.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/configreferences/appsettings/{appSettingKey}'} # type: ignore + + def get_site_connection_string_key_vault_references( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> AsyncIterable["_models.ApiKVReferenceCollection"]: + """Gets the config reference app settings and status of an app. + + Description for Gets the config reference app settings and status of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ApiKVReferenceCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.ApiKVReferenceCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiKVReferenceCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_site_connection_string_key_vault_references.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ApiKVReferenceCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + get_site_connection_string_key_vault_references.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/configreferences/connectionstrings'} # type: ignore + + async def get_site_connection_string_key_vault_reference( + self, + resource_group_name: str, + name: str, + connection_string_key: str, + **kwargs: Any + ) -> "_models.ApiKVReference": + """Gets the config reference and status of an app. + + Description for Gets the config reference and status of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param connection_string_key: + :type connection_string_key: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ApiKVReference, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.ApiKVReference + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiKVReference"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_site_connection_string_key_vault_reference.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'connectionStringKey': self._serialize.url("connection_string_key", connection_string_key, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ApiKVReference', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_connection_string_key_vault_reference.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/configreferences/connectionstrings/{connectionStringKey}'} # type: ignore + + async def update_connection_strings( + self, + resource_group_name: str, + name: str, + connection_strings: "_models.ConnectionStringDictionary", + **kwargs: Any + ) -> "_models.ConnectionStringDictionary": + """Replaces the connection strings of an app. + + Description for Replaces the connection strings of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param connection_strings: Connection strings of the app or deployment slot. See example. + :type connection_strings: ~azure.mgmt.web.v2021_02_01.models.ConnectionStringDictionary + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ConnectionStringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.ConnectionStringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionStringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_connection_strings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_strings, 'ConnectionStringDictionary') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ConnectionStringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_connection_strings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/connectionstrings'} # type: ignore + + async def list_connection_strings( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> "_models.ConnectionStringDictionary": + """Gets the connection strings of an app. + + Description for Gets the connection strings of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ConnectionStringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.ConnectionStringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionStringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_connection_strings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ConnectionStringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_connection_strings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/connectionstrings/list'} # type: ignore + + async def get_diagnostic_logs_configuration( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> "_models.SiteLogsConfig": + """Gets the logging configuration of an app. + + Description for Gets the logging configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteLogsConfig, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SiteLogsConfig + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteLogsConfig"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_diagnostic_logs_configuration.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteLogsConfig', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_diagnostic_logs_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/logs'} # type: ignore + + async def update_diagnostic_logs_config( + self, + resource_group_name: str, + name: str, + site_logs_config: "_models.SiteLogsConfig", + **kwargs: Any + ) -> "_models.SiteLogsConfig": + """Updates the logging configuration of an app. + + Description for Updates the logging configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param site_logs_config: A SiteLogsConfig JSON object that contains the logging configuration + to change in the "properties" property. + :type site_logs_config: ~azure.mgmt.web.v2021_02_01.models.SiteLogsConfig + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteLogsConfig, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SiteLogsConfig + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteLogsConfig"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_diagnostic_logs_config.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_logs_config, 'SiteLogsConfig') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteLogsConfig', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_diagnostic_logs_config.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/logs'} # type: ignore + + async def update_metadata( + self, + resource_group_name: str, + name: str, + metadata: "_models.StringDictionary", + **kwargs: Any + ) -> "_models.StringDictionary": + """Replaces the metadata of an app. + + Description for Replaces the metadata of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param metadata: Edited metadata of the app or deployment slot. See example. + :type metadata: ~azure.mgmt.web.v2021_02_01.models.StringDictionary + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_metadata.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(metadata, 'StringDictionary') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_metadata.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/metadata'} # type: ignore + + async def list_metadata( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> "_models.StringDictionary": + """Gets the metadata of an app. + + Description for Gets the metadata of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_metadata.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_metadata.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/metadata/list'} # type: ignore + + async def _list_publishing_credentials_initial( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> "_models.User": + cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._list_publishing_credentials_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _list_publishing_credentials_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/publishingcredentials/list'} # type: ignore + + async def begin_list_publishing_credentials( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> AsyncLROPoller["_models.User"]: + """Gets the Git/FTP publishing credentials of an app. + + Description for Gets the Git/FTP publishing credentials of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either User or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2021_02_01.models.User] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._list_publishing_credentials_initial( + resource_group_name=resource_group_name, + name=name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_list_publishing_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/publishingcredentials/list'} # type: ignore + + async def update_site_push_settings( + self, + resource_group_name: str, + name: str, + push_settings: "_models.PushSettings", + **kwargs: Any + ) -> "_models.PushSettings": + """Updates the Push settings associated with web app. + + Description for Updates the Push settings associated with web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param push_settings: Push settings associated with web app. + :type push_settings: ~azure.mgmt.web.v2021_02_01.models.PushSettings + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PushSettings, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.PushSettings + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PushSettings"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_site_push_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(push_settings, 'PushSettings') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PushSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_site_push_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/pushsettings'} # type: ignore + + async def list_site_push_settings( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> "_models.PushSettings": + """Gets the Push settings associated with web app. + + Description for Gets the Push settings associated with web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PushSettings, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.PushSettings + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PushSettings"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_site_push_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PushSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_site_push_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/pushsettings/list'} # type: ignore + + async def list_slot_configuration_names( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> "_models.SlotConfigNamesResource": + """Gets the names of app settings and connection strings that stick to the slot (not swapped). + + Description for Gets the names of app settings and connection strings that stick to the slot + (not swapped). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SlotConfigNamesResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SlotConfigNamesResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SlotConfigNamesResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_slot_configuration_names.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SlotConfigNamesResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_slot_configuration_names.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/slotConfigNames'} # type: ignore + + async def update_slot_configuration_names( + self, + resource_group_name: str, + name: str, + slot_config_names: "_models.SlotConfigNamesResource", + **kwargs: Any + ) -> "_models.SlotConfigNamesResource": + """Updates the names of application settings and connection string that remain with the slot during swap operation. + + Description for Updates the names of application settings and connection string that remain + with the slot during swap operation. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot_config_names: Names of application settings and connection strings. See example. + :type slot_config_names: ~azure.mgmt.web.v2021_02_01.models.SlotConfigNamesResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SlotConfigNamesResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SlotConfigNamesResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SlotConfigNamesResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_slot_configuration_names.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(slot_config_names, 'SlotConfigNamesResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SlotConfigNamesResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_slot_configuration_names.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/slotConfigNames'} # type: ignore + + async def get_configuration( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> "_models.SiteConfigResource": + """Gets the configuration of an app, such as platform version and bitness, default documents, virtual applications, Always On, etc. + + Description for Gets the configuration of an app, such as platform version and bitness, default + documents, virtual applications, Always On, etc. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteConfigResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SiteConfigResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_configuration.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteConfigResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web'} # type: ignore + + async def create_or_update_configuration( + self, + resource_group_name: str, + name: str, + site_config: "_models.SiteConfigResource", + **kwargs: Any + ) -> "_models.SiteConfigResource": + """Updates the configuration of an app. + + Description for Updates the configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param site_config: JSON representation of a SiteConfig object. See example. + :type site_config: ~azure.mgmt.web.v2021_02_01.models.SiteConfigResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteConfigResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SiteConfigResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_configuration.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_config, 'SiteConfigResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteConfigResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web'} # type: ignore + + async def update_configuration( + self, + resource_group_name: str, + name: str, + site_config: "_models.SiteConfigResource", + **kwargs: Any + ) -> "_models.SiteConfigResource": + """Updates the configuration of an app. + + Description for Updates the configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param site_config: JSON representation of a SiteConfig object. See example. + :type site_config: ~azure.mgmt.web.v2021_02_01.models.SiteConfigResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteConfigResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SiteConfigResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_configuration.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_config, 'SiteConfigResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteConfigResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web'} # type: ignore + + def list_configuration_snapshot_info( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> AsyncIterable["_models.SiteConfigurationSnapshotInfoCollection"]: + """Gets a list of web app configuration snapshots identifiers. Each element of the list contains a timestamp and the ID of the snapshot. + + Description for Gets a list of web app configuration snapshots identifiers. Each element of the + list contains a timestamp and the ID of the snapshot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SiteConfigurationSnapshotInfoCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.SiteConfigurationSnapshotInfoCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigurationSnapshotInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_configuration_snapshot_info.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SiteConfigurationSnapshotInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_configuration_snapshot_info.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots'} # type: ignore + + async def get_configuration_snapshot( + self, + resource_group_name: str, + name: str, + snapshot_id: str, + **kwargs: Any + ) -> "_models.SiteConfigResource": + """Gets a snapshot of the configuration of an app at a previous point in time. + + Description for Gets a snapshot of the configuration of an app at a previous point in time. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param snapshot_id: The ID of the snapshot to read. + :type snapshot_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteConfigResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SiteConfigResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_configuration_snapshot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'snapshotId': self._serialize.url("snapshot_id", snapshot_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteConfigResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_configuration_snapshot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots/{snapshotId}'} # type: ignore + + async def recover_site_configuration_snapshot( + self, + resource_group_name: str, + name: str, + snapshot_id: str, + **kwargs: Any + ) -> None: + """Reverts the configuration of an app to a previous snapshot. + + Description for Reverts the configuration of an app to a previous snapshot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param snapshot_id: The ID of the snapshot to read. + :type snapshot_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.recover_site_configuration_snapshot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'snapshotId': self._serialize.url("snapshot_id", snapshot_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + recover_site_configuration_snapshot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots/{snapshotId}/recover'} # type: ignore + + async def get_web_site_container_logs( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> Optional[IO]: + """Gets the last lines of docker logs for the given site. + + Description for Gets the last lines of docker logs for the given site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional[IO]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/octet-stream" + + # Construct URL + url = self.get_web_site_container_logs.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_web_site_container_logs.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/containerlogs'} # type: ignore + + async def get_container_logs_zip( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> Optional[IO]: + """Gets the ZIP archived docker log files for the given site. + + Description for Gets the ZIP archived docker log files for the given site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional[IO]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/zip" + + # Construct URL + url = self.get_container_logs_zip.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_container_logs_zip.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/containerlogs/zip/download'} # type: ignore + + def list_continuous_web_jobs( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> AsyncIterable["_models.ContinuousWebJobCollection"]: + """List continuous web jobs for an app, or a deployment slot. + + Description for List continuous web jobs for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ContinuousWebJobCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.ContinuousWebJobCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ContinuousWebJobCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_continuous_web_jobs.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ContinuousWebJobCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_continuous_web_jobs.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs'} # type: ignore + + async def get_continuous_web_job( + self, + resource_group_name: str, + name: str, + web_job_name: str, + **kwargs: Any + ) -> "_models.ContinuousWebJob": + """Gets a continuous web job by its ID for an app, or a deployment slot. + + Description for Gets a continuous web job by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ContinuousWebJob, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.ContinuousWebJob + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ContinuousWebJob"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_continuous_web_job.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ContinuousWebJob', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_continuous_web_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}'} # type: ignore + + async def delete_continuous_web_job( + self, + resource_group_name: str, + name: str, + web_job_name: str, + **kwargs: Any + ) -> None: + """Delete a continuous web job by its ID for an app, or a deployment slot. + + Description for Delete a continuous web job by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_continuous_web_job.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_continuous_web_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}'} # type: ignore + + async def start_continuous_web_job( + self, + resource_group_name: str, + name: str, + web_job_name: str, + **kwargs: Any + ) -> None: + """Start a continuous web job for an app, or a deployment slot. + + Description for Start a continuous web job for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.start_continuous_web_job.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + start_continuous_web_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}/start'} # type: ignore + + async def stop_continuous_web_job( + self, + resource_group_name: str, + name: str, + web_job_name: str, + **kwargs: Any + ) -> None: + """Stop a continuous web job for an app, or a deployment slot. + + Description for Stop a continuous web job for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.stop_continuous_web_job.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + stop_continuous_web_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}/stop'} # type: ignore + + def list_deployments( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> AsyncIterable["_models.DeploymentCollection"]: + """List deployments for an app, or a deployment slot. + + Description for List deployments for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DeploymentCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.DeploymentCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DeploymentCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_deployments.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DeploymentCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_deployments.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments'} # type: ignore + + async def get_deployment( + self, + resource_group_name: str, + name: str, + id: str, + **kwargs: Any + ) -> "_models.Deployment": + """Get a deployment by its ID for an app, or a deployment slot. + + Description for Get a deployment by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param id: Deployment ID. + :type id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Deployment, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.Deployment + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Deployment"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_deployment.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Deployment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_deployment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}'} # type: ignore + + async def create_deployment( + self, + resource_group_name: str, + name: str, + id: str, + deployment: "_models.Deployment", + **kwargs: Any + ) -> "_models.Deployment": + """Create a deployment for an app, or a deployment slot. + + Description for Create a deployment for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param id: ID of an existing deployment. + :type id: str + :param deployment: Deployment details. + :type deployment: ~azure.mgmt.web.v2021_02_01.models.Deployment + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Deployment, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.Deployment + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Deployment"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_deployment.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(deployment, 'Deployment') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Deployment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_deployment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}'} # type: ignore + + async def delete_deployment( + self, + resource_group_name: str, + name: str, + id: str, + **kwargs: Any + ) -> None: + """Delete a deployment by its ID for an app, or a deployment slot. + + Description for Delete a deployment by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param id: Deployment ID. + :type id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_deployment.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_deployment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}'} # type: ignore + + async def list_deployment_log( + self, + resource_group_name: str, + name: str, + id: str, + **kwargs: Any + ) -> "_models.Deployment": + """List deployment log for specific deployment for an app, or a deployment slot. + + Description for List deployment log for specific deployment for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param id: The ID of a specific deployment. This is the value of the name property in the JSON + response from "GET /api/sites/{siteName}/deployments". + :type id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Deployment, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.Deployment + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Deployment"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_deployment_log.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Deployment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_deployment_log.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}/log'} # type: ignore + + async def discover_backup( + self, + resource_group_name: str, + name: str, + request: "_models.RestoreRequest", + **kwargs: Any + ) -> "_models.RestoreRequest": + """Discovers an existing app backup that can be restored from a blob in Azure storage. Use this to get information about the databases stored in a backup. + + Description for Discovers an existing app backup that can be restored from a blob in Azure + storage. Use this to get information about the databases stored in a backup. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param request: A RestoreRequest object that includes Azure storage URL and blog name for + discovery of backup. + :type request: ~azure.mgmt.web.v2021_02_01.models.RestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RestoreRequest, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.RestoreRequest + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RestoreRequest"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.discover_backup.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'RestoreRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RestoreRequest', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + discover_backup.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/discoverbackup'} # type: ignore + + def list_domain_ownership_identifiers( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> AsyncIterable["_models.IdentifierCollection"]: + """Lists ownership identifiers for domain associated with web app. + + Description for Lists ownership identifiers for domain associated with web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either IdentifierCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.IdentifierCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.IdentifierCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_domain_ownership_identifiers.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('IdentifierCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_domain_ownership_identifiers.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers'} # type: ignore + + async def get_domain_ownership_identifier( + self, + resource_group_name: str, + name: str, + domain_ownership_identifier_name: str, + **kwargs: Any + ) -> "_models.Identifier": + """Get domain ownership identifier for web app. + + Description for Get domain ownership identifier for web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param domain_ownership_identifier_name: Name of domain ownership identifier. + :type domain_ownership_identifier_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Identifier, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.Identifier + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Identifier"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_domain_ownership_identifier.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Identifier', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_domain_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} # type: ignore + + async def create_or_update_domain_ownership_identifier( + self, + resource_group_name: str, + name: str, + domain_ownership_identifier_name: str, + domain_ownership_identifier: "_models.Identifier", + **kwargs: Any + ) -> "_models.Identifier": + """Creates a domain ownership identifier for web app, or updates an existing ownership identifier. + + Description for Creates a domain ownership identifier for web app, or updates an existing + ownership identifier. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param domain_ownership_identifier_name: Name of domain ownership identifier. + :type domain_ownership_identifier_name: str + :param domain_ownership_identifier: A JSON representation of the domain ownership properties. + :type domain_ownership_identifier: ~azure.mgmt.web.v2021_02_01.models.Identifier + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Identifier, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.Identifier + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Identifier"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_domain_ownership_identifier.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(domain_ownership_identifier, 'Identifier') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Identifier', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_domain_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} # type: ignore + + async def delete_domain_ownership_identifier( + self, + resource_group_name: str, + name: str, + domain_ownership_identifier_name: str, + **kwargs: Any + ) -> None: + """Deletes a domain ownership identifier for a web app. + + Description for Deletes a domain ownership identifier for a web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param domain_ownership_identifier_name: Name of domain ownership identifier. + :type domain_ownership_identifier_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_domain_ownership_identifier.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_domain_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} # type: ignore + + async def update_domain_ownership_identifier( + self, + resource_group_name: str, + name: str, + domain_ownership_identifier_name: str, + domain_ownership_identifier: "_models.Identifier", + **kwargs: Any + ) -> "_models.Identifier": + """Creates a domain ownership identifier for web app, or updates an existing ownership identifier. + + Description for Creates a domain ownership identifier for web app, or updates an existing + ownership identifier. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param domain_ownership_identifier_name: Name of domain ownership identifier. + :type domain_ownership_identifier_name: str + :param domain_ownership_identifier: A JSON representation of the domain ownership properties. + :type domain_ownership_identifier: ~azure.mgmt.web.v2021_02_01.models.Identifier + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Identifier, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.Identifier + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Identifier"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_domain_ownership_identifier.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(domain_ownership_identifier, 'Identifier') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Identifier', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_domain_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} # type: ignore + + async def get_ms_deploy_status( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> "_models.MSDeployStatus": + """Get the status of the last MSDeploy operation. + + Description for Get the status of the last MSDeploy operation. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MSDeployStatus, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.MSDeployStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_ms_deploy_status.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_ms_deploy_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy'} # type: ignore + + async def _create_ms_deploy_operation_initial( + self, + resource_group_name: str, + name: str, + ms_deploy: "_models.MSDeploy", + **kwargs: Any + ) -> "_models.MSDeployStatus": + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_ms_deploy_operation_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(ms_deploy, 'MSDeploy') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_ms_deploy_operation_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy'} # type: ignore + + async def begin_create_ms_deploy_operation( + self, + resource_group_name: str, + name: str, + ms_deploy: "_models.MSDeploy", + **kwargs: Any + ) -> AsyncLROPoller["_models.MSDeployStatus"]: + """Invoke the MSDeploy web app extension. + + Description for Invoke the MSDeploy web app extension. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param ms_deploy: Details of MSDeploy operation. + :type ms_deploy: ~azure.mgmt.web.v2021_02_01.models.MSDeploy + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either MSDeployStatus or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2021_02_01.models.MSDeployStatus] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployStatus"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_ms_deploy_operation_initial( + resource_group_name=resource_group_name, + name=name, + ms_deploy=ms_deploy, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_ms_deploy_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy'} # type: ignore + + async def get_ms_deploy_log( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> "_models.MSDeployLog": + """Get the MSDeploy Log for the last MSDeploy operation. + + Description for Get the MSDeploy Log for the last MSDeploy operation. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MSDeployLog, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.MSDeployLog + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployLog"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_ms_deploy_log.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MSDeployLog', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_ms_deploy_log.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy/log'} # type: ignore + + def list_functions( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> AsyncIterable["_models.FunctionEnvelopeCollection"]: + """List the functions for a web site, or a deployment slot. + + Description for List the functions for a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either FunctionEnvelopeCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.FunctionEnvelopeCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionEnvelopeCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_functions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('FunctionEnvelopeCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_functions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions'} # type: ignore + + async def get_functions_admin_token( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> str: + """Fetch a short lived token that can be exchanged for a master key. + + Description for Fetch a short lived token that can be exchanged for a master key. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: str, or the result of cls(response) + :rtype: str + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[str] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_functions_admin_token.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_functions_admin_token.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/admin/token'} # type: ignore + + async def get_function( + self, + resource_group_name: str, + name: str, + function_name: str, + **kwargs: Any + ) -> "_models.FunctionEnvelope": + """Get function information by its ID for web site, or a deployment slot. + + Description for Get function information by its ID for web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: Function name. + :type function_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FunctionEnvelope, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.FunctionEnvelope + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionEnvelope"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_function.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FunctionEnvelope', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_function.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}'} # type: ignore + + async def _create_function_initial( + self, + resource_group_name: str, + name: str, + function_name: str, + function_envelope: "_models.FunctionEnvelope", + **kwargs: Any + ) -> "_models.FunctionEnvelope": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionEnvelope"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_function_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(function_envelope, 'FunctionEnvelope') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FunctionEnvelope', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_function_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}'} # type: ignore + + async def begin_create_function( + self, + resource_group_name: str, + name: str, + function_name: str, + function_envelope: "_models.FunctionEnvelope", + **kwargs: Any + ) -> AsyncLROPoller["_models.FunctionEnvelope"]: + """Create function for web site, or a deployment slot. + + Description for Create function for web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: Function name. + :type function_name: str + :param function_envelope: Function details. + :type function_envelope: ~azure.mgmt.web.v2021_02_01.models.FunctionEnvelope + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either FunctionEnvelope or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2021_02_01.models.FunctionEnvelope] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionEnvelope"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_function_initial( + resource_group_name=resource_group_name, + name=name, + function_name=function_name, + function_envelope=function_envelope, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('FunctionEnvelope', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_function.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}'} # type: ignore + + async def delete_function( + self, + resource_group_name: str, + name: str, + function_name: str, + **kwargs: Any + ) -> None: + """Delete a function for web site, or a deployment slot. + + Description for Delete a function for web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: Function name. + :type function_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_function.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_function.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}'} # type: ignore + + async def create_or_update_function_secret( + self, + resource_group_name: str, + name: str, + function_name: str, + key_name: str, + key: "_models.KeyInfo", + **kwargs: Any + ) -> "_models.KeyInfo": + """Add or update a function secret. + + Description for Add or update a function secret. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: The name of the function. + :type function_name: str + :param key_name: The name of the key. + :type key_name: str + :param key: The key to create or update. + :type key: ~azure.mgmt.web.v2021_02_01.models.KeyInfo + :keyword callable cls: A custom type or function that will be passed the direct response + :return: KeyInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.KeyInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.KeyInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_function_secret.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'keyName': self._serialize.url("key_name", key_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(key, 'KeyInfo') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('KeyInfo', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('KeyInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_function_secret.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/keys/{keyName}'} # type: ignore + + async def delete_function_secret( + self, + resource_group_name: str, + name: str, + function_name: str, + key_name: str, + **kwargs: Any + ) -> None: + """Delete a function secret. + + Description for Delete a function secret. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: The name of the function. + :type function_name: str + :param key_name: The name of the key. + :type key_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_function_secret.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'keyName': self._serialize.url("key_name", key_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_function_secret.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/keys/{keyName}'} # type: ignore + + async def list_function_keys( + self, + resource_group_name: str, + name: str, + function_name: str, + **kwargs: Any + ) -> "_models.StringDictionary": + """Get function keys for a function in a web site, or a deployment slot. + + Description for Get function keys for a function in a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: Function name. + :type function_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_function_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_function_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/listkeys'} # type: ignore + + async def list_function_secrets( + self, + resource_group_name: str, + name: str, + function_name: str, + **kwargs: Any + ) -> "_models.FunctionSecrets": + """Get function secrets for a function in a web site, or a deployment slot. + + Description for Get function secrets for a function in a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: Function name. + :type function_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FunctionSecrets, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.FunctionSecrets + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionSecrets"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_function_secrets.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FunctionSecrets', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_function_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/listsecrets'} # type: ignore + + async def list_host_keys( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> "_models.HostKeys": + """Get host secrets for a function app. + + Description for Get host secrets for a function app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HostKeys, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.HostKeys + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HostKeys"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_host_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HostKeys', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_host_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/listkeys'} # type: ignore + + async def list_sync_status( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> None: + """This is to allow calling via powershell and ARM template. + + Description for This is to allow calling via powershell and ARM template. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_sync_status.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + list_sync_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/listsyncstatus'} # type: ignore + + async def sync_functions( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> None: + """Syncs function trigger metadata to the management database. + + Description for Syncs function trigger metadata to the management database. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.sync_functions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + sync_functions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/sync'} # type: ignore + + async def create_or_update_host_secret( + self, + resource_group_name: str, + name: str, + key_type: str, + key_name: str, + key: "_models.KeyInfo", + **kwargs: Any + ) -> "_models.KeyInfo": + """Add or update a host level secret. + + Description for Add or update a host level secret. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param key_type: The type of host key. + :type key_type: str + :param key_name: The name of the key. + :type key_name: str + :param key: The key to create or update. + :type key: ~azure.mgmt.web.v2021_02_01.models.KeyInfo + :keyword callable cls: A custom type or function that will be passed the direct response + :return: KeyInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.KeyInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.KeyInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_host_secret.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'keyType': self._serialize.url("key_type", key_type, 'str'), + 'keyName': self._serialize.url("key_name", key_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(key, 'KeyInfo') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('KeyInfo', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('KeyInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_host_secret.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/{keyType}/{keyName}'} # type: ignore + + async def delete_host_secret( + self, + resource_group_name: str, + name: str, + key_type: str, + key_name: str, + **kwargs: Any + ) -> None: + """Delete a host level secret. + + Description for Delete a host level secret. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param key_type: The type of host key. + :type key_type: str + :param key_name: The name of the key. + :type key_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_host_secret.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'keyType': self._serialize.url("key_type", key_type, 'str'), + 'keyName': self._serialize.url("key_name", key_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_host_secret.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/{keyType}/{keyName}'} # type: ignore + + def list_host_name_bindings( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> AsyncIterable["_models.HostNameBindingCollection"]: + """Get hostname bindings for an app or a deployment slot. + + Description for Get hostname bindings for an app or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either HostNameBindingCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.HostNameBindingCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HostNameBindingCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_host_name_bindings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('HostNameBindingCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_host_name_bindings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings'} # type: ignore + + async def get_host_name_binding( + self, + resource_group_name: str, + name: str, + host_name: str, + **kwargs: Any + ) -> "_models.HostNameBinding": + """Get the named hostname binding for an app (or deployment slot, if specified). + + Description for Get the named hostname binding for an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param host_name: Hostname in the hostname binding. + :type host_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HostNameBinding, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.HostNameBinding + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HostNameBinding"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_host_name_binding.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HostNameBinding', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_host_name_binding.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}'} # type: ignore + + async def create_or_update_host_name_binding( + self, + resource_group_name: str, + name: str, + host_name: str, + host_name_binding: "_models.HostNameBinding", + **kwargs: Any + ) -> "_models.HostNameBinding": + """Creates a hostname binding for an app. + + Description for Creates a hostname binding for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param host_name: Hostname in the hostname binding. + :type host_name: str + :param host_name_binding: Binding details. This is the JSON representation of a HostNameBinding + object. + :type host_name_binding: ~azure.mgmt.web.v2021_02_01.models.HostNameBinding + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HostNameBinding, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.HostNameBinding + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HostNameBinding"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_host_name_binding.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(host_name_binding, 'HostNameBinding') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HostNameBinding', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_host_name_binding.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}'} # type: ignore + + async def delete_host_name_binding( + self, + resource_group_name: str, + name: str, + host_name: str, + **kwargs: Any + ) -> None: + """Deletes a hostname binding for an app. + + Description for Deletes a hostname binding for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param host_name: Hostname in the hostname binding. + :type host_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_host_name_binding.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_host_name_binding.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}'} # type: ignore + + async def get_hybrid_connection( + self, + resource_group_name: str, + name: str, + namespace_name: str, + relay_name: str, + **kwargs: Any + ) -> "_models.HybridConnection": + """Retrieves a specific Service Bus Hybrid Connection used by this Web App. + + Description for Retrieves a specific Service Bus Hybrid Connection used by this Web App. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param namespace_name: The namespace for this hybrid connection. + :type namespace_name: str + :param relay_name: The relay name for this hybrid connection. + :type relay_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnection, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.HybridConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_hybrid_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_hybrid_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} # type: ignore + + async def create_or_update_hybrid_connection( + self, + resource_group_name: str, + name: str, + namespace_name: str, + relay_name: str, + connection_envelope: "_models.HybridConnection", + **kwargs: Any + ) -> "_models.HybridConnection": + """Creates a new Hybrid Connection using a Service Bus relay. + + Description for Creates a new Hybrid Connection using a Service Bus relay. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param namespace_name: The namespace for this hybrid connection. + :type namespace_name: str + :param relay_name: The relay name for this hybrid connection. + :type relay_name: str + :param connection_envelope: The details of the hybrid connection. + :type connection_envelope: ~azure.mgmt.web.v2021_02_01.models.HybridConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnection, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.HybridConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_hybrid_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'HybridConnection') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_hybrid_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} # type: ignore + + async def delete_hybrid_connection( + self, + resource_group_name: str, + name: str, + namespace_name: str, + relay_name: str, + **kwargs: Any + ) -> None: + """Removes a Hybrid Connection from this site. + + Description for Removes a Hybrid Connection from this site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param namespace_name: The namespace for this hybrid connection. + :type namespace_name: str + :param relay_name: The relay name for this hybrid connection. + :type relay_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_hybrid_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_hybrid_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} # type: ignore + + async def update_hybrid_connection( + self, + resource_group_name: str, + name: str, + namespace_name: str, + relay_name: str, + connection_envelope: "_models.HybridConnection", + **kwargs: Any + ) -> "_models.HybridConnection": + """Creates a new Hybrid Connection using a Service Bus relay. + + Description for Creates a new Hybrid Connection using a Service Bus relay. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param namespace_name: The namespace for this hybrid connection. + :type namespace_name: str + :param relay_name: The relay name for this hybrid connection. + :type relay_name: str + :param connection_envelope: The details of the hybrid connection. + :type connection_envelope: ~azure.mgmt.web.v2021_02_01.models.HybridConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnection, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.HybridConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_hybrid_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'HybridConnection') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_hybrid_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} # type: ignore + + async def list_hybrid_connections( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> "_models.HybridConnection": + """Retrieves all Service Bus Hybrid Connections used by this Web App. + + Description for Retrieves all Service Bus Hybrid Connections used by this Web App. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnection, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.HybridConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_hybrid_connections.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_hybrid_connections.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionRelays'} # type: ignore + + async def list_relay_service_connections( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> "_models.RelayServiceConnectionEntity": + """Gets hybrid connections configured for an app (or deployment slot, if specified). + + Description for Gets hybrid connections configured for an app (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RelayServiceConnectionEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.RelayServiceConnectionEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RelayServiceConnectionEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_relay_service_connections.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RelayServiceConnectionEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_relay_service_connections.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection'} # type: ignore + + async def get_relay_service_connection( + self, + resource_group_name: str, + name: str, + entity_name: str, + **kwargs: Any + ) -> "_models.RelayServiceConnectionEntity": + """Gets a hybrid connection configuration by its name. + + Description for Gets a hybrid connection configuration by its name. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param entity_name: Name of the hybrid connection. + :type entity_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RelayServiceConnectionEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.RelayServiceConnectionEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RelayServiceConnectionEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_relay_service_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'entityName': self._serialize.url("entity_name", entity_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RelayServiceConnectionEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_relay_service_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}'} # type: ignore + + async def create_or_update_relay_service_connection( + self, + resource_group_name: str, + name: str, + entity_name: str, + connection_envelope: "_models.RelayServiceConnectionEntity", + **kwargs: Any + ) -> "_models.RelayServiceConnectionEntity": + """Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). + + Description for Creates a new hybrid connection configuration (PUT), or updates an existing one + (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param entity_name: Name of the hybrid connection configuration. + :type entity_name: str + :param connection_envelope: Details of the hybrid connection configuration. + :type connection_envelope: ~azure.mgmt.web.v2021_02_01.models.RelayServiceConnectionEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RelayServiceConnectionEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.RelayServiceConnectionEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RelayServiceConnectionEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_relay_service_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'entityName': self._serialize.url("entity_name", entity_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'RelayServiceConnectionEntity') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RelayServiceConnectionEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_relay_service_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}'} # type: ignore + + async def delete_relay_service_connection( + self, + resource_group_name: str, + name: str, + entity_name: str, + **kwargs: Any + ) -> None: + """Deletes a relay service connection by its name. + + Description for Deletes a relay service connection by its name. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param entity_name: Name of the hybrid connection configuration. + :type entity_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_relay_service_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'entityName': self._serialize.url("entity_name", entity_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_relay_service_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}'} # type: ignore + + async def update_relay_service_connection( + self, + resource_group_name: str, + name: str, + entity_name: str, + connection_envelope: "_models.RelayServiceConnectionEntity", + **kwargs: Any + ) -> "_models.RelayServiceConnectionEntity": + """Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). + + Description for Creates a new hybrid connection configuration (PUT), or updates an existing one + (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param entity_name: Name of the hybrid connection configuration. + :type entity_name: str + :param connection_envelope: Details of the hybrid connection configuration. + :type connection_envelope: ~azure.mgmt.web.v2021_02_01.models.RelayServiceConnectionEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RelayServiceConnectionEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.RelayServiceConnectionEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RelayServiceConnectionEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_relay_service_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'entityName': self._serialize.url("entity_name", entity_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'RelayServiceConnectionEntity') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RelayServiceConnectionEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_relay_service_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}'} # type: ignore + + def list_instance_identifiers( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> AsyncIterable["_models.WebAppInstanceStatusCollection"]: + """Gets all scale-out instances of an app. + + Description for Gets all scale-out instances of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebAppInstanceStatusCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.WebAppInstanceStatusCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppInstanceStatusCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_instance_identifiers.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppInstanceStatusCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_instance_identifiers.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances'} # type: ignore + + async def get_instance_info( + self, + resource_group_name: str, + name: str, + instance_id: str, + **kwargs: Any + ) -> "_models.WebSiteInstanceStatus": + """Gets all scale-out instances of an app. + + Description for Gets all scale-out instances of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param instance_id: + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WebSiteInstanceStatus, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.WebSiteInstanceStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebSiteInstanceStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_info.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('WebSiteInstanceStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_info.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}'} # type: ignore + + async def get_instance_ms_deploy_status( + self, + resource_group_name: str, + name: str, + instance_id: str, + **kwargs: Any + ) -> "_models.MSDeployStatus": + """Get the status of the last MSDeploy operation. + + Description for Get the status of the last MSDeploy operation. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param instance_id: ID of web app instance. + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MSDeployStatus, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.MSDeployStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_ms_deploy_status.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_ms_deploy_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy'} # type: ignore + + async def _create_instance_ms_deploy_operation_initial( + self, + resource_group_name: str, + name: str, + instance_id: str, + ms_deploy: "_models.MSDeploy", + **kwargs: Any + ) -> "_models.MSDeployStatus": + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_instance_ms_deploy_operation_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(ms_deploy, 'MSDeploy') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_instance_ms_deploy_operation_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy'} # type: ignore + + async def begin_create_instance_ms_deploy_operation( + self, + resource_group_name: str, + name: str, + instance_id: str, + ms_deploy: "_models.MSDeploy", + **kwargs: Any + ) -> AsyncLROPoller["_models.MSDeployStatus"]: + """Invoke the MSDeploy web app extension. + + Description for Invoke the MSDeploy web app extension. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param instance_id: ID of web app instance. + :type instance_id: str + :param ms_deploy: Details of MSDeploy operation. + :type ms_deploy: ~azure.mgmt.web.v2021_02_01.models.MSDeploy + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either MSDeployStatus or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2021_02_01.models.MSDeployStatus] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployStatus"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_instance_ms_deploy_operation_initial( + resource_group_name=resource_group_name, + name=name, + instance_id=instance_id, + ms_deploy=ms_deploy, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_instance_ms_deploy_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy'} # type: ignore + + async def get_instance_ms_deploy_log( + self, + resource_group_name: str, + name: str, + instance_id: str, + **kwargs: Any + ) -> "_models.MSDeployLog": + """Get the MSDeploy Log for the last MSDeploy operation. + + Description for Get the MSDeploy Log for the last MSDeploy operation. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param instance_id: ID of web app instance. + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MSDeployLog, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.MSDeployLog + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployLog"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_ms_deploy_log.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MSDeployLog', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_ms_deploy_log.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy/log'} # type: ignore + + def list_instance_processes( + self, + resource_group_name: str, + name: str, + instance_id: str, + **kwargs: Any + ) -> AsyncIterable["_models.ProcessInfoCollection"]: + """Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. + + Description for Get list of processes for a web site, or a deployment slot, or for a specific + scaled-out instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessInfoCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.ProcessInfoCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_instance_processes.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_instance_processes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes'} # type: ignore + + async def get_instance_process( + self, + resource_group_name: str, + name: str, + process_id: str, + instance_id: str, + **kwargs: Any + ) -> "_models.ProcessInfo": + """Get process information by its ID for a specific scaled-out instance in a web site. + + Description for Get process information by its ID for a specific scaled-out instance in a web + site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProcessInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.ProcessInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_process.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ProcessInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_process.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}'} # type: ignore + + async def delete_instance_process( + self, + resource_group_name: str, + name: str, + process_id: str, + instance_id: str, + **kwargs: Any + ) -> None: + """Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web site. + + Description for Terminate a process by its ID for a web site, or a deployment slot, or specific + scaled-out instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_instance_process.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_instance_process.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}'} # type: ignore + + async def get_instance_process_dump( + self, + resource_group_name: str, + name: str, + process_id: str, + instance_id: str, + **kwargs: Any + ) -> IO: + """Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. + + Description for Get a memory dump of a process by its ID for a specific scaled-out instance in + a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[IO] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_process_dump.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_process_dump.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/dump'} # type: ignore + + def list_instance_process_modules( + self, + resource_group_name: str, + name: str, + process_id: str, + instance_id: str, + **kwargs: Any + ) -> AsyncIterable["_models.ProcessModuleInfoCollection"]: + """List module information for a process by its ID for a specific scaled-out instance in a web site. + + Description for List module information for a process by its ID for a specific scaled-out + instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessModuleInfoCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.ProcessModuleInfoCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessModuleInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_instance_process_modules.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessModuleInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_instance_process_modules.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/modules'} # type: ignore + + async def get_instance_process_module( + self, + resource_group_name: str, + name: str, + process_id: str, + base_address: str, + instance_id: str, + **kwargs: Any + ) -> "_models.ProcessModuleInfo": + """Get process information by its ID for a specific scaled-out instance in a web site. + + Description for Get process information by its ID for a specific scaled-out instance in a web + site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param base_address: Module base address. + :type base_address: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProcessModuleInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.ProcessModuleInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessModuleInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_process_module.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'baseAddress': self._serialize.url("base_address", base_address, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ProcessModuleInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_process_module.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/modules/{baseAddress}'} # type: ignore + + def list_instance_process_threads( + self, + resource_group_name: str, + name: str, + process_id: str, + instance_id: str, + **kwargs: Any + ) -> AsyncIterable["_models.ProcessThreadInfoCollection"]: + """List the threads in a process by its ID for a specific scaled-out instance in a web site. + + Description for List the threads in a process by its ID for a specific scaled-out instance in a + web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessThreadInfoCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.ProcessThreadInfoCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessThreadInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_instance_process_threads.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessThreadInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_instance_process_threads.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/threads'} # type: ignore + + async def is_cloneable( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> "_models.SiteCloneability": + """Shows whether an app can be cloned to another resource group or subscription. + + Description for Shows whether an app can be cloned to another resource group or subscription. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteCloneability, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SiteCloneability + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteCloneability"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.is_cloneable.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteCloneability', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + is_cloneable.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/iscloneable'} # type: ignore + + def list_site_backups( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> AsyncIterable["_models.BackupItemCollection"]: + """Gets existing backups of an app. + + Description for Gets existing backups of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either BackupItemCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.BackupItemCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupItemCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_backups.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('BackupItemCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_site_backups.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/listbackups'} # type: ignore + + async def list_sync_function_triggers( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> "_models.FunctionSecrets": + """This is to allow calling via powershell and ARM template. + + Description for This is to allow calling via powershell and ARM template. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FunctionSecrets, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.FunctionSecrets + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionSecrets"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_sync_function_triggers.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FunctionSecrets', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_sync_function_triggers.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/listsyncfunctiontriggerstatus'} # type: ignore + + async def _migrate_storage_initial( + self, + subscription_name: str, + resource_group_name: str, + name: str, + migration_options: "_models.StorageMigrationOptions", + **kwargs: Any + ) -> "_models.StorageMigrationResponse": + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageMigrationResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._migrate_storage_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['subscriptionName'] = self._serialize.query("subscription_name", subscription_name, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(migration_options, 'StorageMigrationOptions') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StorageMigrationResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _migrate_storage_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migrate'} # type: ignore + + async def begin_migrate_storage( + self, + subscription_name: str, + resource_group_name: str, + name: str, + migration_options: "_models.StorageMigrationOptions", + **kwargs: Any + ) -> AsyncLROPoller["_models.StorageMigrationResponse"]: + """Restores a web app. + + Description for Restores a web app. + + :param subscription_name: Azure subscription. + :type subscription_name: str + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param migration_options: Migration migrationOptions. + :type migration_options: ~azure.mgmt.web.v2021_02_01.models.StorageMigrationOptions + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either StorageMigrationResponse or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2021_02_01.models.StorageMigrationResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageMigrationResponse"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._migrate_storage_initial( + subscription_name=subscription_name, + resource_group_name=resource_group_name, + name=name, + migration_options=migration_options, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('StorageMigrationResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_migrate_storage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migrate'} # type: ignore + + async def _migrate_my_sql_initial( + self, + resource_group_name: str, + name: str, + migration_request_envelope: "_models.MigrateMySqlRequest", + **kwargs: Any + ) -> "_models.Operation": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Operation"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._migrate_my_sql_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(migration_request_envelope, 'MigrateMySqlRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Operation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _migrate_my_sql_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migratemysql'} # type: ignore + + async def begin_migrate_my_sql( + self, + resource_group_name: str, + name: str, + migration_request_envelope: "_models.MigrateMySqlRequest", + **kwargs: Any + ) -> AsyncLROPoller["_models.Operation"]: + """Migrates a local (in-app) MySql database to a remote MySql database. + + Description for Migrates a local (in-app) MySql database to a remote MySql database. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param migration_request_envelope: MySql migration options. + :type migration_request_envelope: ~azure.mgmt.web.v2021_02_01.models.MigrateMySqlRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Operation or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2021_02_01.models.Operation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Operation"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._migrate_my_sql_initial( + resource_group_name=resource_group_name, + name=name, + migration_request_envelope=migration_request_envelope, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Operation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_migrate_my_sql.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migratemysql'} # type: ignore + + async def get_migrate_my_sql_status( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> "_models.MigrateMySqlStatus": + """Returns the status of MySql in app migration, if one is active, and whether or not MySql in app is enabled. + + Description for Returns the status of MySql in app migration, if one is active, and whether or + not MySql in app is enabled. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MigrateMySqlStatus, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.MigrateMySqlStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MigrateMySqlStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_migrate_my_sql_status.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MigrateMySqlStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_migrate_my_sql_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migratemysql/status'} # type: ignore + + async def get_swift_virtual_network_connection( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> "_models.SwiftVirtualNetwork": + """Gets a Swift Virtual Network connection. + + Description for Gets a Swift Virtual Network connection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SwiftVirtualNetwork, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SwiftVirtualNetwork + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SwiftVirtualNetwork"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_swift_virtual_network_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SwiftVirtualNetwork', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_swift_virtual_network_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork'} # type: ignore + + async def create_or_update_swift_virtual_network_connection_with_check( + self, + resource_group_name: str, + name: str, + connection_envelope: "_models.SwiftVirtualNetwork", + **kwargs: Any + ) -> "_models.SwiftVirtualNetwork": + """Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet has already been delegated, and is not + in use by another App Service Plan other than the one this App is in. + + Description for Integrates this Web App with a Virtual Network. This requires that 1) + "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet + has already been delegated, and is not + in use by another App Service Plan other than the one this App is in. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param connection_envelope: Properties of the Virtual Network connection. See example. + :type connection_envelope: ~azure.mgmt.web.v2021_02_01.models.SwiftVirtualNetwork + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SwiftVirtualNetwork, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SwiftVirtualNetwork + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SwiftVirtualNetwork"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_swift_virtual_network_connection_with_check.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'SwiftVirtualNetwork') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SwiftVirtualNetwork', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_swift_virtual_network_connection_with_check.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork'} # type: ignore + + async def delete_swift_virtual_network( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> None: + """Deletes a Swift Virtual Network connection from an app (or deployment slot). + + Description for Deletes a Swift Virtual Network connection from an app (or deployment slot). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_swift_virtual_network.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_swift_virtual_network.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork'} # type: ignore + + async def update_swift_virtual_network_connection_with_check( + self, + resource_group_name: str, + name: str, + connection_envelope: "_models.SwiftVirtualNetwork", + **kwargs: Any + ) -> "_models.SwiftVirtualNetwork": + """Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet has already been delegated, and is not + in use by another App Service Plan other than the one this App is in. + + Description for Integrates this Web App with a Virtual Network. This requires that 1) + "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet + has already been delegated, and is not + in use by another App Service Plan other than the one this App is in. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param connection_envelope: Properties of the Virtual Network connection. See example. + :type connection_envelope: ~azure.mgmt.web.v2021_02_01.models.SwiftVirtualNetwork + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SwiftVirtualNetwork, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SwiftVirtualNetwork + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SwiftVirtualNetwork"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_swift_virtual_network_connection_with_check.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'SwiftVirtualNetwork') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SwiftVirtualNetwork', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_swift_virtual_network_connection_with_check.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork'} # type: ignore + + async def list_network_features( + self, + resource_group_name: str, + name: str, + view: str, + **kwargs: Any + ) -> "_models.NetworkFeatures": + """Gets all network features used by the app (or deployment slot, if specified). + + Description for Gets all network features used by the app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param view: The type of view. Only "summary" is supported at this time. + :type view: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkFeatures, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.NetworkFeatures + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFeatures"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_network_features.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'view': self._serialize.url("view", view, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkFeatures', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_network_features.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkFeatures/{view}'} # type: ignore + + async def get_network_trace_operation( + self, + resource_group_name: str, + name: str, + operation_id: str, + **kwargs: Any + ) -> List["_models.NetworkTrace"]: + """Gets a named operation for a network trace capturing (or deployment slot, if specified). + + Description for Gets a named operation for a network trace capturing (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param operation_id: GUID of the operation. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of NetworkTrace, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2021_02_01.models.NetworkTrace] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_network_trace_operation.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_network_trace_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/operationresults/{operationId}'} # type: ignore + + async def start_web_site_network_trace( + self, + resource_group_name: str, + name: str, + duration_in_seconds: Optional[int] = None, + max_frame_length: Optional[int] = None, + sas_url: Optional[str] = None, + **kwargs: Any + ) -> str: + """Start capturing network packets for the site (To be deprecated). + + Description for Start capturing network packets for the site (To be deprecated). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param duration_in_seconds: The duration to keep capturing in seconds. + :type duration_in_seconds: int + :param max_frame_length: The maximum frame length in bytes (Optional). + :type max_frame_length: int + :param sas_url: The Blob URL to store capture file. + :type sas_url: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: str, or the result of cls(response) + :rtype: str + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[str] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.start_web_site_network_trace.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if duration_in_seconds is not None: + query_parameters['durationInSeconds'] = self._serialize.query("duration_in_seconds", duration_in_seconds, 'int') + if max_frame_length is not None: + query_parameters['maxFrameLength'] = self._serialize.query("max_frame_length", max_frame_length, 'int') + if sas_url is not None: + query_parameters['sasUrl'] = self._serialize.query("sas_url", sas_url, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + start_web_site_network_trace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/start'} # type: ignore + + async def _start_web_site_network_trace_operation_initial( + self, + resource_group_name: str, + name: str, + duration_in_seconds: Optional[int] = None, + max_frame_length: Optional[int] = None, + sas_url: Optional[str] = None, + **kwargs: Any + ) -> List["_models.NetworkTrace"]: + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._start_web_site_network_trace_operation_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if duration_in_seconds is not None: + query_parameters['durationInSeconds'] = self._serialize.query("duration_in_seconds", duration_in_seconds, 'int') + if max_frame_length is not None: + query_parameters['maxFrameLength'] = self._serialize.query("max_frame_length", max_frame_length, 'int') + if sas_url is not None: + query_parameters['sasUrl'] = self._serialize.query("sas_url", sas_url, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _start_web_site_network_trace_operation_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/startOperation'} # type: ignore + + async def begin_start_web_site_network_trace_operation( + self, + resource_group_name: str, + name: str, + duration_in_seconds: Optional[int] = None, + max_frame_length: Optional[int] = None, + sas_url: Optional[str] = None, + **kwargs: Any + ) -> AsyncLROPoller[List["_models.NetworkTrace"]]: + """Start capturing network packets for the site. + + Description for Start capturing network packets for the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param duration_in_seconds: The duration to keep capturing in seconds. + :type duration_in_seconds: int + :param max_frame_length: The maximum frame length in bytes (Optional). + :type max_frame_length: int + :param sas_url: The Blob URL to store capture file. + :type sas_url: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either list of NetworkTrace or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[list[~azure.mgmt.web.v2021_02_01.models.NetworkTrace]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._start_web_site_network_trace_operation_initial( + resource_group_name=resource_group_name, + name=name, + duration_in_seconds=duration_in_seconds, + max_frame_length=max_frame_length, + sas_url=sas_url, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start_web_site_network_trace_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/startOperation'} # type: ignore + + async def stop_web_site_network_trace( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> None: + """Stop ongoing capturing network packets for the site. + + Description for Stop ongoing capturing network packets for the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.stop_web_site_network_trace.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + stop_web_site_network_trace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/stop'} # type: ignore + + async def get_network_traces( + self, + resource_group_name: str, + name: str, + operation_id: str, + **kwargs: Any + ) -> List["_models.NetworkTrace"]: + """Gets a named operation for a network trace capturing (or deployment slot, if specified). + + Description for Gets a named operation for a network trace capturing (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param operation_id: GUID of the operation. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of NetworkTrace, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2021_02_01.models.NetworkTrace] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_network_traces.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_network_traces.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/{operationId}'} # type: ignore + + async def get_network_trace_operation_v2( + self, + resource_group_name: str, + name: str, + operation_id: str, + **kwargs: Any + ) -> List["_models.NetworkTrace"]: + """Gets a named operation for a network trace capturing (or deployment slot, if specified). + + Description for Gets a named operation for a network trace capturing (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param operation_id: GUID of the operation. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of NetworkTrace, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2021_02_01.models.NetworkTrace] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_network_trace_operation_v2.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_network_trace_operation_v2.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTraces/current/operationresults/{operationId}'} # type: ignore + + async def get_network_traces_v2( + self, + resource_group_name: str, + name: str, + operation_id: str, + **kwargs: Any + ) -> List["_models.NetworkTrace"]: + """Gets a named operation for a network trace capturing (or deployment slot, if specified). + + Description for Gets a named operation for a network trace capturing (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param operation_id: GUID of the operation. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of NetworkTrace, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2021_02_01.models.NetworkTrace] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_network_traces_v2.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_network_traces_v2.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTraces/{operationId}'} # type: ignore + + async def generate_new_site_publishing_password( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> None: + """Generates a new publishing password for an app (or deployment slot, if specified). + + Description for Generates a new publishing password for an app (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.generate_new_site_publishing_password.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + generate_new_site_publishing_password.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/newpassword'} # type: ignore + + def list_perf_mon_counters( + self, + resource_group_name: str, + name: str, + filter: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.PerfMonCounterCollection"]: + """Gets perfmon counters for web app. + + Description for Gets perfmon counters for web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param filter: Return only usages/metrics specified in the filter. Filter conforms to odata + syntax. Example: $filter=(startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z + and timeGrain eq duration'[Hour|Minute|Day]'. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PerfMonCounterCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.PerfMonCounterCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PerfMonCounterCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_perf_mon_counters.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('PerfMonCounterCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_perf_mon_counters.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/perfcounters'} # type: ignore + + async def get_site_php_error_log_flag( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> "_models.SitePhpErrorLogFlag": + """Gets web app's event logs. + + Description for Gets web app's event logs. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SitePhpErrorLogFlag, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SitePhpErrorLogFlag + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SitePhpErrorLogFlag"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_site_php_error_log_flag.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SitePhpErrorLogFlag', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_php_error_log_flag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/phplogging'} # type: ignore + + async def list_premier_add_ons( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> "_models.PremierAddOn": + """Gets the premier add-ons of an app. + + Description for Gets the premier add-ons of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PremierAddOn, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.PremierAddOn + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PremierAddOn"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_premier_add_ons.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PremierAddOn', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_premier_add_ons.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons'} # type: ignore + + async def get_premier_add_on( + self, + resource_group_name: str, + name: str, + premier_add_on_name: str, + **kwargs: Any + ) -> "_models.PremierAddOn": + """Gets a named add-on of an app. + + Description for Gets a named add-on of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param premier_add_on_name: Add-on name. + :type premier_add_on_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PremierAddOn, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.PremierAddOn + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PremierAddOn"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_premier_add_on.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PremierAddOn', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_premier_add_on.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}'} # type: ignore + + async def add_premier_add_on( + self, + resource_group_name: str, + name: str, + premier_add_on_name: str, + premier_add_on: "_models.PremierAddOn", + **kwargs: Any + ) -> "_models.PremierAddOn": + """Updates a named add-on of an app. + + Description for Updates a named add-on of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param premier_add_on_name: Add-on name. + :type premier_add_on_name: str + :param premier_add_on: A JSON representation of the edited premier add-on. + :type premier_add_on: ~azure.mgmt.web.v2021_02_01.models.PremierAddOn + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PremierAddOn, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.PremierAddOn + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PremierAddOn"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.add_premier_add_on.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(premier_add_on, 'PremierAddOn') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PremierAddOn', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + add_premier_add_on.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}'} # type: ignore + + async def delete_premier_add_on( + self, + resource_group_name: str, + name: str, + premier_add_on_name: str, + **kwargs: Any + ) -> None: + """Delete a premier add-on from an app. + + Description for Delete a premier add-on from an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param premier_add_on_name: Add-on name. + :type premier_add_on_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_premier_add_on.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_premier_add_on.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}'} # type: ignore + + async def update_premier_add_on( + self, + resource_group_name: str, + name: str, + premier_add_on_name: str, + premier_add_on: "_models.PremierAddOnPatchResource", + **kwargs: Any + ) -> "_models.PremierAddOn": + """Updates a named add-on of an app. + + Description for Updates a named add-on of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param premier_add_on_name: Add-on name. + :type premier_add_on_name: str + :param premier_add_on: A JSON representation of the edited premier add-on. + :type premier_add_on: ~azure.mgmt.web.v2021_02_01.models.PremierAddOnPatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PremierAddOn, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.PremierAddOn + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PremierAddOn"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_premier_add_on.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(premier_add_on, 'PremierAddOnPatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PremierAddOn', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_premier_add_on.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}'} # type: ignore + + async def get_private_access( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> "_models.PrivateAccess": + """Gets data around private site access enablement and authorized Virtual Networks that can access the site. + + Description for Gets data around private site access enablement and authorized Virtual Networks + that can access the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateAccess, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.PrivateAccess + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateAccess"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_private_access.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateAccess', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_private_access.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateAccess/virtualNetworks'} # type: ignore + + async def put_private_access_vnet( + self, + resource_group_name: str, + name: str, + access: "_models.PrivateAccess", + **kwargs: Any + ) -> "_models.PrivateAccess": + """Sets data around private site access enablement and authorized Virtual Networks that can access the site. + + Description for Sets data around private site access enablement and authorized Virtual Networks + that can access the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param access: The information for the private access. + :type access: ~azure.mgmt.web.v2021_02_01.models.PrivateAccess + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateAccess, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.PrivateAccess + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateAccess"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.put_private_access_vnet.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(access, 'PrivateAccess') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateAccess', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + put_private_access_vnet.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateAccess/virtualNetworks'} # type: ignore + + def get_private_endpoint_connection_list( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> AsyncIterable["_models.PrivateEndpointConnectionCollection"]: + """Gets the list of private endpoint connections associated with a site. + + Description for Gets the list of private endpoint connections associated with a site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the site. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PrivateEndpointConnectionCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.PrivateEndpointConnectionCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_private_endpoint_connection_list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('PrivateEndpointConnectionCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + get_private_endpoint_connection_list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections'} # type: ignore + + async def get_private_endpoint_connection( + self, + resource_group_name: str, + name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> "_models.RemotePrivateEndpointConnectionARMResource": + """Gets a private endpoint connection. + + Description for Gets a private endpoint connection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the site. + :type name: str + :param private_endpoint_connection_name: Name of the private endpoint connection. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RemotePrivateEndpointConnectionARMResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.RemotePrivateEndpointConnectionARMResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RemotePrivateEndpointConnectionARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_private_endpoint_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RemotePrivateEndpointConnectionARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_private_endpoint_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def _approve_or_reject_private_endpoint_connection_initial( + self, + resource_group_name: str, + name: str, + private_endpoint_connection_name: str, + private_endpoint_wrapper: "_models.PrivateLinkConnectionApprovalRequestResource", + **kwargs: Any + ) -> "_models.RemotePrivateEndpointConnectionARMResource": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RemotePrivateEndpointConnectionARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._approve_or_reject_private_endpoint_connection_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(private_endpoint_wrapper, 'PrivateLinkConnectionApprovalRequestResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('RemotePrivateEndpointConnectionARMResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('RemotePrivateEndpointConnectionARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _approve_or_reject_private_endpoint_connection_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def begin_approve_or_reject_private_endpoint_connection( + self, + resource_group_name: str, + name: str, + private_endpoint_connection_name: str, + private_endpoint_wrapper: "_models.PrivateLinkConnectionApprovalRequestResource", + **kwargs: Any + ) -> AsyncLROPoller["_models.RemotePrivateEndpointConnectionARMResource"]: + """Approves or rejects a private endpoint connection. + + Description for Approves or rejects a private endpoint connection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the site. + :type name: str + :param private_endpoint_connection_name: + :type private_endpoint_connection_name: str + :param private_endpoint_wrapper: + :type private_endpoint_wrapper: ~azure.mgmt.web.v2021_02_01.models.PrivateLinkConnectionApprovalRequestResource + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either RemotePrivateEndpointConnectionARMResource or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2021_02_01.models.RemotePrivateEndpointConnectionARMResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RemotePrivateEndpointConnectionARMResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._approve_or_reject_private_endpoint_connection_initial( + resource_group_name=resource_group_name, + name=name, + private_endpoint_connection_name=private_endpoint_connection_name, + private_endpoint_wrapper=private_endpoint_wrapper, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('RemotePrivateEndpointConnectionARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_approve_or_reject_private_endpoint_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def _delete_private_endpoint_connection_initial( + self, + resource_group_name: str, + name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> Any: + cls = kwargs.pop('cls', None) # type: ClsType[Any] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._delete_private_endpoint_connection_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('object', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('object', pipeline_response) + + if response.status_code == 204: + deserialized = self._deserialize('object', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _delete_private_endpoint_connection_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def begin_delete_private_endpoint_connection( + self, + resource_group_name: str, + name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> AsyncLROPoller[Any]: + """Deletes a private endpoint connection. + + Description for Deletes a private endpoint connection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the site. + :type name: str + :param private_endpoint_connection_name: + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either any or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[any] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[Any] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_private_endpoint_connection_initial( + resource_group_name=resource_group_name, + name=name, + private_endpoint_connection_name=private_endpoint_connection_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('object', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete_private_endpoint_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def get_private_link_resources( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> "_models.PrivateLinkResourcesWrapper": + """Gets the private link resources. + + Description for Gets the private link resources. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the site. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkResourcesWrapper, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.PrivateLinkResourcesWrapper + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourcesWrapper"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_private_link_resources.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateLinkResourcesWrapper', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_private_link_resources.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateLinkResources'} # type: ignore + + def list_processes( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> AsyncIterable["_models.ProcessInfoCollection"]: + """Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. + + Description for Get list of processes for a web site, or a deployment slot, or for a specific + scaled-out instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessInfoCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.ProcessInfoCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_processes.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_processes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes'} # type: ignore + + async def get_process( + self, + resource_group_name: str, + name: str, + process_id: str, + **kwargs: Any + ) -> "_models.ProcessInfo": + """Get process information by its ID for a specific scaled-out instance in a web site. + + Description for Get process information by its ID for a specific scaled-out instance in a web + site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProcessInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.ProcessInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_process.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ProcessInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_process.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}'} # type: ignore + + async def delete_process( + self, + resource_group_name: str, + name: str, + process_id: str, + **kwargs: Any + ) -> None: + """Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web site. + + Description for Terminate a process by its ID for a web site, or a deployment slot, or specific + scaled-out instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_process.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_process.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}'} # type: ignore + + async def get_process_dump( + self, + resource_group_name: str, + name: str, + process_id: str, + **kwargs: Any + ) -> IO: + """Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. + + Description for Get a memory dump of a process by its ID for a specific scaled-out instance in + a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[IO] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_process_dump.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_process_dump.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/dump'} # type: ignore + + def list_process_modules( + self, + resource_group_name: str, + name: str, + process_id: str, + **kwargs: Any + ) -> AsyncIterable["_models.ProcessModuleInfoCollection"]: + """List module information for a process by its ID for a specific scaled-out instance in a web site. + + Description for List module information for a process by its ID for a specific scaled-out + instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessModuleInfoCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.ProcessModuleInfoCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessModuleInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_process_modules.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessModuleInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_process_modules.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/modules'} # type: ignore + + async def get_process_module( + self, + resource_group_name: str, + name: str, + process_id: str, + base_address: str, + **kwargs: Any + ) -> "_models.ProcessModuleInfo": + """Get process information by its ID for a specific scaled-out instance in a web site. + + Description for Get process information by its ID for a specific scaled-out instance in a web + site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param base_address: Module base address. + :type base_address: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProcessModuleInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.ProcessModuleInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessModuleInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_process_module.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'baseAddress': self._serialize.url("base_address", base_address, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ProcessModuleInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_process_module.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/modules/{baseAddress}'} # type: ignore + + def list_process_threads( + self, + resource_group_name: str, + name: str, + process_id: str, + **kwargs: Any + ) -> AsyncIterable["_models.ProcessThreadInfoCollection"]: + """List the threads in a process by its ID for a specific scaled-out instance in a web site. + + Description for List the threads in a process by its ID for a specific scaled-out instance in a + web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessThreadInfoCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.ProcessThreadInfoCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessThreadInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_process_threads.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessThreadInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_process_threads.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/threads'} # type: ignore + + def list_public_certificates( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> AsyncIterable["_models.PublicCertificateCollection"]: + """Get public certificates for an app or a deployment slot. + + Description for Get public certificates for an app or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PublicCertificateCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.PublicCertificateCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicCertificateCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_public_certificates.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('PublicCertificateCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_public_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates'} # type: ignore + + async def get_public_certificate( + self, + resource_group_name: str, + name: str, + public_certificate_name: str, + **kwargs: Any + ) -> "_models.PublicCertificate": + """Get the named public certificate for an app (or deployment slot, if specified). + + Description for Get the named public certificate for an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param public_certificate_name: Public certificate name. + :type public_certificate_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PublicCertificate, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.PublicCertificate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicCertificate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_public_certificate.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'publicCertificateName': self._serialize.url("public_certificate_name", public_certificate_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PublicCertificate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_public_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}'} # type: ignore + + async def create_or_update_public_certificate( + self, + resource_group_name: str, + name: str, + public_certificate_name: str, + public_certificate: "_models.PublicCertificate", + **kwargs: Any + ) -> "_models.PublicCertificate": + """Creates a hostname binding for an app. + + Description for Creates a hostname binding for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param public_certificate_name: Public certificate name. + :type public_certificate_name: str + :param public_certificate: Public certificate details. This is the JSON representation of a + PublicCertificate object. + :type public_certificate: ~azure.mgmt.web.v2021_02_01.models.PublicCertificate + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PublicCertificate, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.PublicCertificate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicCertificate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_public_certificate.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'publicCertificateName': self._serialize.url("public_certificate_name", public_certificate_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(public_certificate, 'PublicCertificate') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PublicCertificate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_public_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}'} # type: ignore + + async def delete_public_certificate( + self, + resource_group_name: str, + name: str, + public_certificate_name: str, + **kwargs: Any + ) -> None: + """Deletes a hostname binding for an app. + + Description for Deletes a hostname binding for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param public_certificate_name: Public certificate name. + :type public_certificate_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_public_certificate.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'publicCertificateName': self._serialize.url("public_certificate_name", public_certificate_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_public_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}'} # type: ignore + + async def list_publishing_profile_xml_with_secrets( + self, + resource_group_name: str, + name: str, + publishing_profile_options: "_models.CsmPublishingProfileOptions", + **kwargs: Any + ) -> IO: + """Gets the publishing profile for an app (or deployment slot, if specified). + + Description for Gets the publishing profile for an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param publishing_profile_options: Specifies publishingProfileOptions for publishing profile. + For example, use {"format": "FileZilla3"} to get a FileZilla publishing profile. + :type publishing_profile_options: ~azure.mgmt.web.v2021_02_01.models.CsmPublishingProfileOptions + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[IO] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/xml" + + # Construct URL + url = self.list_publishing_profile_xml_with_secrets.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(publishing_profile_options, 'CsmPublishingProfileOptions') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_publishing_profile_xml_with_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publishxml'} # type: ignore + + async def reset_production_slot_config( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> None: + """Resets the configuration settings of the current slot if they were previously modified by calling the API with POST. + + Description for Resets the configuration settings of the current slot if they were previously + modified by calling the API with POST. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.reset_production_slot_config.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + reset_production_slot_config.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/resetSlotConfig'} # type: ignore + + async def restart( + self, + resource_group_name: str, + name: str, + soft_restart: Optional[bool] = None, + synchronous: Optional[bool] = None, + **kwargs: Any + ) -> None: + """Restarts an app (or deployment slot, if specified). + + Description for Restarts an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param soft_restart: Specify true to apply the configuration settings and restarts the app only + if necessary. By default, the API always restarts and reprovisions the app. + :type soft_restart: bool + :param synchronous: Specify true to block until the app is restarted. By default, it is set to + false, and the API responds immediately (asynchronous). + :type synchronous: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.restart.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if soft_restart is not None: + query_parameters['softRestart'] = self._serialize.query("soft_restart", soft_restart, 'bool') + if synchronous is not None: + query_parameters['synchronous'] = self._serialize.query("synchronous", synchronous, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restart'} # type: ignore + + async def _restore_from_backup_blob_initial( + self, + resource_group_name: str, + name: str, + request: "_models.RestoreRequest", + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._restore_from_backup_blob_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'RestoreRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _restore_from_backup_blob_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreFromBackupBlob'} # type: ignore + + async def begin_restore_from_backup_blob( + self, + resource_group_name: str, + name: str, + request: "_models.RestoreRequest", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Restores an app from a backup blob in Azure Storage. + + Description for Restores an app from a backup blob in Azure Storage. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param request: Information on restore request . + :type request: ~azure.mgmt.web.v2021_02_01.models.RestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._restore_from_backup_blob_initial( + resource_group_name=resource_group_name, + name=name, + request=request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_restore_from_backup_blob.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreFromBackupBlob'} # type: ignore + + async def _restore_from_deleted_app_initial( + self, + resource_group_name: str, + name: str, + restore_request: "_models.DeletedAppRestoreRequest", + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._restore_from_deleted_app_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(restore_request, 'DeletedAppRestoreRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _restore_from_deleted_app_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreFromDeletedApp'} # type: ignore + + async def begin_restore_from_deleted_app( + self, + resource_group_name: str, + name: str, + restore_request: "_models.DeletedAppRestoreRequest", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Restores a deleted web app to this web app. + + Description for Restores a deleted web app to this web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param restore_request: Deleted web app restore information. + :type restore_request: ~azure.mgmt.web.v2021_02_01.models.DeletedAppRestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._restore_from_deleted_app_initial( + resource_group_name=resource_group_name, + name=name, + restore_request=restore_request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_restore_from_deleted_app.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreFromDeletedApp'} # type: ignore + + async def _restore_snapshot_initial( + self, + resource_group_name: str, + name: str, + restore_request: "_models.SnapshotRestoreRequest", + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._restore_snapshot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(restore_request, 'SnapshotRestoreRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _restore_snapshot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreSnapshot'} # type: ignore + + async def begin_restore_snapshot( + self, + resource_group_name: str, + name: str, + restore_request: "_models.SnapshotRestoreRequest", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Restores a web app from a snapshot. + + Description for Restores a web app from a snapshot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param restore_request: Snapshot restore settings. Snapshot information can be obtained by + calling GetDeletedSites or GetSiteSnapshots API. + :type restore_request: ~azure.mgmt.web.v2021_02_01.models.SnapshotRestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._restore_snapshot_initial( + resource_group_name=resource_group_name, + name=name, + restore_request=restore_request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_restore_snapshot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreSnapshot'} # type: ignore + + def list_site_extensions( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> AsyncIterable["_models.SiteExtensionInfoCollection"]: + """Get list of siteextensions for a web site, or a deployment slot. + + Description for Get list of siteextensions for a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SiteExtensionInfoCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.SiteExtensionInfoCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteExtensionInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_extensions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SiteExtensionInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_site_extensions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions'} # type: ignore + + async def get_site_extension( + self, + resource_group_name: str, + name: str, + site_extension_id: str, + **kwargs: Any + ) -> "_models.SiteExtensionInfo": + """Get site extension information by its ID for a web site, or a deployment slot. + + Description for Get site extension information by its ID for a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param site_extension_id: Site extension name. + :type site_extension_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteExtensionInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SiteExtensionInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteExtensionInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_site_extension.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'siteExtensionId': self._serialize.url("site_extension_id", site_extension_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteExtensionInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_extension.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}'} # type: ignore + + async def _install_site_extension_initial( + self, + resource_group_name: str, + name: str, + site_extension_id: str, + **kwargs: Any + ) -> "_models.SiteExtensionInfo": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteExtensionInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._install_site_extension_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'siteExtensionId': self._serialize.url("site_extension_id", site_extension_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.put(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SiteExtensionInfo', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SiteExtensionInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _install_site_extension_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}'} # type: ignore + + async def begin_install_site_extension( + self, + resource_group_name: str, + name: str, + site_extension_id: str, + **kwargs: Any + ) -> AsyncLROPoller["_models.SiteExtensionInfo"]: + """Install site extension on a web site, or a deployment slot. + + Description for Install site extension on a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param site_extension_id: Site extension name. + :type site_extension_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either SiteExtensionInfo or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2021_02_01.models.SiteExtensionInfo] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteExtensionInfo"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._install_site_extension_initial( + resource_group_name=resource_group_name, + name=name, + site_extension_id=site_extension_id, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('SiteExtensionInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'siteExtensionId': self._serialize.url("site_extension_id", site_extension_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_install_site_extension.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}'} # type: ignore + + async def delete_site_extension( + self, + resource_group_name: str, + name: str, + site_extension_id: str, + **kwargs: Any + ) -> None: + """Remove a site extension from a web site, or a deployment slot. + + Description for Remove a site extension from a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param site_extension_id: Site extension name. + :type site_extension_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_site_extension.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'siteExtensionId': self._serialize.url("site_extension_id", site_extension_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_site_extension.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}'} # type: ignore + + def list_slots( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> AsyncIterable["_models.WebAppCollection"]: + """Gets an app's deployment slots. + + Description for Gets an app's deployment slots. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebAppCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.WebAppCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_slots.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_slots.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots'} # type: ignore + + async def get_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> "_models.Site": + """Gets the details of a web, mobile, or API app. + + Description for Gets the details of a web, mobile, or API app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. By default, this API returns the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Site, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.Site + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Site"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Site', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}'} # type: ignore + + async def _create_or_update_slot_initial( + self, + resource_group_name: str, + name: str, + slot: str, + site_envelope: "_models.Site", + **kwargs: Any + ) -> "_models.Site": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Site"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_envelope, 'Site') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Site', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Site', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}'} # type: ignore + + async def begin_create_or_update_slot( + self, + resource_group_name: str, + name: str, + slot: str, + site_envelope: "_models.Site", + **kwargs: Any + ) -> AsyncLROPoller["_models.Site"]: + """Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. + + Description for Creates a new web, mobile, or API app in an existing resource group, or updates + an existing app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Unique name of the app to create or update. To create or update a deployment slot, + use the {slot} parameter. + :type name: str + :param slot: Name of the deployment slot to create or update. By default, this API attempts to + create or modify the production slot. + :type slot: str + :param site_envelope: A JSON representation of the app properties. See example. + :type site_envelope: ~azure.mgmt.web.v2021_02_01.models.Site + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Site or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2021_02_01.models.Site] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Site"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + site_envelope=site_envelope, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Site', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}'} # type: ignore + + async def delete_slot( + self, + resource_group_name: str, + name: str, + slot: str, + delete_metrics: Optional[bool] = None, + delete_empty_server_farm: Optional[bool] = None, + **kwargs: Any + ) -> None: + """Deletes a web, mobile, or API app, or one of the deployment slots. + + Description for Deletes a web, mobile, or API app, or one of the deployment slots. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app to delete. + :type name: str + :param slot: Name of the deployment slot to delete. By default, the API deletes the production + slot. + :type slot: str + :param delete_metrics: If true, web app metrics are also deleted. + :type delete_metrics: bool + :param delete_empty_server_farm: Specify false if you want to keep empty App Service plan. By + default, empty App Service plan is deleted. + :type delete_empty_server_farm: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if delete_metrics is not None: + query_parameters['deleteMetrics'] = self._serialize.query("delete_metrics", delete_metrics, 'bool') + if delete_empty_server_farm is not None: + query_parameters['deleteEmptyServerFarm'] = self._serialize.query("delete_empty_server_farm", delete_empty_server_farm, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}'} # type: ignore + + async def update_slot( + self, + resource_group_name: str, + name: str, + slot: str, + site_envelope: "_models.SitePatchResource", + **kwargs: Any + ) -> "_models.Site": + """Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. + + Description for Creates a new web, mobile, or API app in an existing resource group, or updates + an existing app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Unique name of the app to create or update. To create or update a deployment slot, + use the {slot} parameter. + :type name: str + :param slot: Name of the deployment slot to create or update. By default, this API attempts to + create or modify the production slot. + :type slot: str + :param site_envelope: A JSON representation of the app properties. See example. + :type site_envelope: ~azure.mgmt.web.v2021_02_01.models.SitePatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Site, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.Site + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Site"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_envelope, 'SitePatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Site', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Site', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}'} # type: ignore + + async def analyze_custom_hostname_slot( + self, + resource_group_name: str, + name: str, + slot: str, + host_name: Optional[str] = None, + **kwargs: Any + ) -> "_models.CustomHostnameAnalysisResult": + """Analyze a custom hostname. + + Description for Analyze a custom hostname. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param host_name: Custom hostname. + :type host_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CustomHostnameAnalysisResult, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.CustomHostnameAnalysisResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomHostnameAnalysisResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.analyze_custom_hostname_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if host_name is not None: + query_parameters['hostName'] = self._serialize.query("host_name", host_name, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CustomHostnameAnalysisResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + analyze_custom_hostname_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/analyzeCustomHostname'} # type: ignore + + async def apply_slot_configuration_slot( + self, + resource_group_name: str, + name: str, + slot: str, + slot_swap_entity: "_models.CsmSlotEntity", + **kwargs: Any + ) -> None: + """Applies the configuration settings from the target slot onto the current slot. + + Description for Applies the configuration settings from the target slot onto the current slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the source slot. If a slot is not specified, the production slot is used + as the source slot. + :type slot: str + :param slot_swap_entity: JSON object that contains the target slot name. See example. + :type slot_swap_entity: ~azure.mgmt.web.v2021_02_01.models.CsmSlotEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.apply_slot_configuration_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(slot_swap_entity, 'CsmSlotEntity') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + apply_slot_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/applySlotConfig'} # type: ignore + + async def backup_slot( + self, + resource_group_name: str, + name: str, + slot: str, + request: "_models.BackupRequest", + **kwargs: Any + ) -> "_models.BackupItem": + """Creates a backup of an app. + + Description for Creates a backup of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will create a + backup for the production slot. + :type slot: str + :param request: Backup configuration. You can use the JSON response from the POST action as + input here. + :type request: ~azure.mgmt.web.v2021_02_01.models.BackupRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupItem, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.BackupItem + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupItem"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.backup_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'BackupRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupItem', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + backup_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backup'} # type: ignore + + def list_backups_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> AsyncIterable["_models.BackupItemCollection"]: + """Gets existing backups of an app. + + Description for Gets existing backups of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get backups + of the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either BackupItemCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.BackupItemCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupItemCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_backups_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('BackupItemCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_backups_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups'} # type: ignore + + async def get_backup_status_slot( + self, + resource_group_name: str, + name: str, + backup_id: str, + slot: str, + **kwargs: Any + ) -> "_models.BackupItem": + """Gets a backup of an app by its ID. + + Description for Gets a backup of an app by its ID. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param backup_id: ID of the backup. + :type backup_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get a backup + of the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupItem, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.BackupItem + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupItem"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_backup_status_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupItem', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_backup_status_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}'} # type: ignore + + async def delete_backup_slot( + self, + resource_group_name: str, + name: str, + backup_id: str, + slot: str, + **kwargs: Any + ) -> None: + """Deletes a backup of an app by its ID. + + Description for Deletes a backup of an app by its ID. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param backup_id: ID of the backup. + :type backup_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete a + backup of the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_backup_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_backup_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}'} # type: ignore + + async def list_backup_status_secrets_slot( + self, + resource_group_name: str, + name: str, + backup_id: str, + slot: str, + request: "_models.BackupRequest", + **kwargs: Any + ) -> "_models.BackupItem": + """Gets status of a web app backup that may be in progress, including secrets associated with the backup, such as the Azure Storage SAS URL. Also can be used to update the SAS URL for the backup if a new URL is passed in the request body. + + Description for Gets status of a web app backup that may be in progress, including secrets + associated with the backup, such as the Azure Storage SAS URL. Also can be used to update the + SAS URL for the backup if a new URL is passed in the request body. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param backup_id: ID of backup. + :type backup_id: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param request: Information on backup request. + :type request: ~azure.mgmt.web.v2021_02_01.models.BackupRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupItem, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.BackupItem + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupItem"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.list_backup_status_secrets_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'BackupRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupItem', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_backup_status_secrets_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}/list'} # type: ignore + + async def _restore_slot_initial( + self, + resource_group_name: str, + name: str, + backup_id: str, + slot: str, + request: "_models.RestoreRequest", + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._restore_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'RestoreRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _restore_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}/restore'} # type: ignore + + async def begin_restore_slot( + self, + resource_group_name: str, + name: str, + backup_id: str, + slot: str, + request: "_models.RestoreRequest", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Restores a specific backup to another app (or deployment slot, if specified). + + Description for Restores a specific backup to another app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param backup_id: ID of the backup. + :type backup_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will restore a + backup of the production slot. + :type slot: str + :param request: Information on restore request . + :type request: ~azure.mgmt.web.v2021_02_01.models.RestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._restore_slot_initial( + resource_group_name=resource_group_name, + name=name, + backup_id=backup_id, + slot=slot, + request=request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_restore_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}/restore'} # type: ignore + + def list_basic_publishing_credentials_policies_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> AsyncIterable["_models.PublishingCredentialsPoliciesCollection"]: + """Returns whether Scm basic auth is allowed and whether Ftp is allowed for a given site. + + Description for Returns whether Scm basic auth is allowed and whether Ftp is allowed for a + given site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PublishingCredentialsPoliciesCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.PublishingCredentialsPoliciesCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublishingCredentialsPoliciesCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_basic_publishing_credentials_policies_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('PublishingCredentialsPoliciesCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_basic_publishing_credentials_policies_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/basicPublishingCredentialsPolicies'} # type: ignore + + async def get_ftp_allowed_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> "_models.CsmPublishingCredentialsPoliciesEntity": + """Returns whether FTP is allowed on the site or not. + + Description for Returns whether FTP is allowed on the site or not. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CsmPublishingCredentialsPoliciesEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.CsmPublishingCredentialsPoliciesEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmPublishingCredentialsPoliciesEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_ftp_allowed_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CsmPublishingCredentialsPoliciesEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_ftp_allowed_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/basicPublishingCredentialsPolicies/ftp'} # type: ignore + + async def update_ftp_allowed_slot( + self, + resource_group_name: str, + name: str, + slot: str, + csm_publishing_access_policies_entity: "_models.CsmPublishingCredentialsPoliciesEntity", + **kwargs: Any + ) -> "_models.CsmPublishingCredentialsPoliciesEntity": + """Updates whether FTP is allowed on the site or not. + + Description for Updates whether FTP is allowed on the site or not. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: + :type slot: str + :param csm_publishing_access_policies_entity: + :type csm_publishing_access_policies_entity: ~azure.mgmt.web.v2021_02_01.models.CsmPublishingCredentialsPoliciesEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CsmPublishingCredentialsPoliciesEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.CsmPublishingCredentialsPoliciesEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmPublishingCredentialsPoliciesEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_ftp_allowed_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(csm_publishing_access_policies_entity, 'CsmPublishingCredentialsPoliciesEntity') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CsmPublishingCredentialsPoliciesEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_ftp_allowed_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/basicPublishingCredentialsPolicies/ftp'} # type: ignore + + async def get_scm_allowed_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> "_models.CsmPublishingCredentialsPoliciesEntity": + """Returns whether Scm basic auth is allowed on the site or not. + + Description for Returns whether Scm basic auth is allowed on the site or not. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CsmPublishingCredentialsPoliciesEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.CsmPublishingCredentialsPoliciesEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmPublishingCredentialsPoliciesEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_scm_allowed_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CsmPublishingCredentialsPoliciesEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_scm_allowed_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/basicPublishingCredentialsPolicies/scm'} # type: ignore + + async def update_scm_allowed_slot( + self, + resource_group_name: str, + name: str, + slot: str, + csm_publishing_access_policies_entity: "_models.CsmPublishingCredentialsPoliciesEntity", + **kwargs: Any + ) -> "_models.CsmPublishingCredentialsPoliciesEntity": + """Updates whether user publishing credentials are allowed on the site or not. + + Description for Updates whether user publishing credentials are allowed on the site or not. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: + :type slot: str + :param csm_publishing_access_policies_entity: + :type csm_publishing_access_policies_entity: ~azure.mgmt.web.v2021_02_01.models.CsmPublishingCredentialsPoliciesEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CsmPublishingCredentialsPoliciesEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.CsmPublishingCredentialsPoliciesEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmPublishingCredentialsPoliciesEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_scm_allowed_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(csm_publishing_access_policies_entity, 'CsmPublishingCredentialsPoliciesEntity') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CsmPublishingCredentialsPoliciesEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_scm_allowed_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/basicPublishingCredentialsPolicies/scm'} # type: ignore + + def list_configurations_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> AsyncIterable["_models.SiteConfigResourceCollection"]: + """List the configurations of an app. + + Description for List the configurations of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will return + configuration for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SiteConfigResourceCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.SiteConfigResourceCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigResourceCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_configurations_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SiteConfigResourceCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_configurations_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config'} # type: ignore + + async def update_application_settings_slot( + self, + resource_group_name: str, + name: str, + slot: str, + app_settings: "_models.StringDictionary", + **kwargs: Any + ) -> "_models.StringDictionary": + """Replaces the application settings of an app. + + Description for Replaces the application settings of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + application settings for the production slot. + :type slot: str + :param app_settings: Application settings of the app. + :type app_settings: ~azure.mgmt.web.v2021_02_01.models.StringDictionary + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_application_settings_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(app_settings, 'StringDictionary') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_application_settings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/appsettings'} # type: ignore + + async def list_application_settings_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> "_models.StringDictionary": + """Gets the application settings of an app. + + Description for Gets the application settings of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + application settings for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_application_settings_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_application_settings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/appsettings/list'} # type: ignore + + async def update_auth_settings_slot( + self, + resource_group_name: str, + name: str, + slot: str, + site_auth_settings: "_models.SiteAuthSettings", + **kwargs: Any + ) -> "_models.SiteAuthSettings": + """Updates the Authentication / Authorization settings associated with web app. + + Description for Updates the Authentication / Authorization settings associated with web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param site_auth_settings: Auth settings associated with web app. + :type site_auth_settings: ~azure.mgmt.web.v2021_02_01.models.SiteAuthSettings + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteAuthSettings, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SiteAuthSettings + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteAuthSettings"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_auth_settings_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_auth_settings, 'SiteAuthSettings') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteAuthSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_auth_settings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettings'} # type: ignore + + async def get_auth_settings_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> "_models.SiteAuthSettings": + """Gets the Authentication/Authorization settings of an app. + + Description for Gets the Authentication/Authorization settings of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + settings for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteAuthSettings, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SiteAuthSettings + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteAuthSettings"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_auth_settings_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteAuthSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_auth_settings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettings/list'} # type: ignore + + async def update_auth_settings_v2_slot( + self, + resource_group_name: str, + name: str, + slot: str, + site_auth_settings_v2: "_models.SiteAuthSettingsV2", + **kwargs: Any + ) -> "_models.SiteAuthSettingsV2": + """Updates site's Authentication / Authorization settings for apps via the V2 format. + + Description for Updates site's Authentication / Authorization settings for apps via the V2 + format. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param site_auth_settings_v2: Auth settings associated with web app. + :type site_auth_settings_v2: ~azure.mgmt.web.v2021_02_01.models.SiteAuthSettingsV2 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteAuthSettingsV2, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SiteAuthSettingsV2 + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteAuthSettingsV2"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_auth_settings_v2_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_auth_settings_v2, 'SiteAuthSettingsV2') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteAuthSettingsV2', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_auth_settings_v2_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettingsV2'} # type: ignore + + async def get_auth_settings_v2_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> "_models.SiteAuthSettingsV2": + """Gets site's Authentication / Authorization settings for apps via the V2 format. + + Description for Gets site's Authentication / Authorization settings for apps via the V2 format. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + settings for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteAuthSettingsV2, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SiteAuthSettingsV2 + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteAuthSettingsV2"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_auth_settings_v2_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteAuthSettingsV2', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_auth_settings_v2_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettingsV2/list'} # type: ignore + + async def update_azure_storage_accounts_slot( + self, + resource_group_name: str, + name: str, + slot: str, + azure_storage_accounts: "_models.AzureStoragePropertyDictionaryResource", + **kwargs: Any + ) -> "_models.AzureStoragePropertyDictionaryResource": + """Updates the Azure storage account configurations of an app. + + Description for Updates the Azure storage account configurations of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + Azure storage account configurations for the production slot. + :type slot: str + :param azure_storage_accounts: Azure storage accounts of the app. + :type azure_storage_accounts: ~azure.mgmt.web.v2021_02_01.models.AzureStoragePropertyDictionaryResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AzureStoragePropertyDictionaryResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.AzureStoragePropertyDictionaryResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureStoragePropertyDictionaryResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_azure_storage_accounts_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(azure_storage_accounts, 'AzureStoragePropertyDictionaryResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AzureStoragePropertyDictionaryResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_azure_storage_accounts_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/azurestorageaccounts'} # type: ignore + + async def list_azure_storage_accounts_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> "_models.AzureStoragePropertyDictionaryResource": + """Gets the Azure storage account configurations of an app. + + Description for Gets the Azure storage account configurations of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + Azure storage account configurations for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AzureStoragePropertyDictionaryResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.AzureStoragePropertyDictionaryResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureStoragePropertyDictionaryResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_azure_storage_accounts_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AzureStoragePropertyDictionaryResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_azure_storage_accounts_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/azurestorageaccounts/list'} # type: ignore + + async def update_backup_configuration_slot( + self, + resource_group_name: str, + name: str, + slot: str, + request: "_models.BackupRequest", + **kwargs: Any + ) -> "_models.BackupRequest": + """Updates the backup configuration of an app. + + Description for Updates the backup configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + backup configuration for the production slot. + :type slot: str + :param request: Edited backup configuration. + :type request: ~azure.mgmt.web.v2021_02_01.models.BackupRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupRequest, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.BackupRequest + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupRequest"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_backup_configuration_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'BackupRequest') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupRequest', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_backup_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup'} # type: ignore + + async def delete_backup_configuration_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> None: + """Deletes the backup configuration of an app. + + Description for Deletes the backup configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + backup configuration for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_backup_configuration_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_backup_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup'} # type: ignore + + async def get_backup_configuration_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> "_models.BackupRequest": + """Gets the backup configuration of an app. + + Description for Gets the backup configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + backup configuration for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupRequest, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.BackupRequest + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupRequest"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_backup_configuration_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupRequest', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_backup_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup/list'} # type: ignore + + def get_app_settings_key_vault_references_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> AsyncIterable["_models.ApiKVReferenceCollection"]: + """Gets the config reference app settings and status of an app. + + Description for Gets the config reference app settings and status of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ApiKVReferenceCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.ApiKVReferenceCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiKVReferenceCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_app_settings_key_vault_references_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ApiKVReferenceCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + get_app_settings_key_vault_references_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/configreferences/appsettings'} # type: ignore + + async def get_app_setting_key_vault_reference_slot( + self, + resource_group_name: str, + name: str, + app_setting_key: str, + slot: str, + **kwargs: Any + ) -> "_models.ApiKVReference": + """Gets the config reference and status of an app. + + Description for Gets the config reference and status of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param app_setting_key: App Setting key name. + :type app_setting_key: str + :param slot: + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ApiKVReference, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.ApiKVReference + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiKVReference"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_app_setting_key_vault_reference_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'appSettingKey': self._serialize.url("app_setting_key", app_setting_key, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ApiKVReference', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_app_setting_key_vault_reference_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/configreferences/appsettings/{appSettingKey}'} # type: ignore + + def get_site_connection_string_key_vault_references_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> AsyncIterable["_models.ApiKVReferenceCollection"]: + """Gets the config reference app settings and status of an app. + + Description for Gets the config reference app settings and status of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ApiKVReferenceCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.ApiKVReferenceCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiKVReferenceCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_site_connection_string_key_vault_references_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ApiKVReferenceCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + get_site_connection_string_key_vault_references_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/configreferences/connectionstrings'} # type: ignore + + async def get_site_connection_string_key_vault_reference_slot( + self, + resource_group_name: str, + name: str, + connection_string_key: str, + slot: str, + **kwargs: Any + ) -> "_models.ApiKVReference": + """Gets the config reference and status of an app. + + Description for Gets the config reference and status of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param connection_string_key: + :type connection_string_key: str + :param slot: + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ApiKVReference, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.ApiKVReference + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiKVReference"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_site_connection_string_key_vault_reference_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'connectionStringKey': self._serialize.url("connection_string_key", connection_string_key, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ApiKVReference', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_connection_string_key_vault_reference_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/configreferences/connectionstrings/{connectionStringKey}'} # type: ignore + + async def update_connection_strings_slot( + self, + resource_group_name: str, + name: str, + slot: str, + connection_strings: "_models.ConnectionStringDictionary", + **kwargs: Any + ) -> "_models.ConnectionStringDictionary": + """Replaces the connection strings of an app. + + Description for Replaces the connection strings of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + connection settings for the production slot. + :type slot: str + :param connection_strings: Connection strings of the app or deployment slot. See example. + :type connection_strings: ~azure.mgmt.web.v2021_02_01.models.ConnectionStringDictionary + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ConnectionStringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.ConnectionStringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionStringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_connection_strings_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_strings, 'ConnectionStringDictionary') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ConnectionStringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_connection_strings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/connectionstrings'} # type: ignore + + async def list_connection_strings_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> "_models.ConnectionStringDictionary": + """Gets the connection strings of an app. + + Description for Gets the connection strings of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + connection settings for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ConnectionStringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.ConnectionStringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionStringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_connection_strings_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ConnectionStringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_connection_strings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/connectionstrings/list'} # type: ignore + + async def get_diagnostic_logs_configuration_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> "_models.SiteLogsConfig": + """Gets the logging configuration of an app. + + Description for Gets the logging configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + logging configuration for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteLogsConfig, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SiteLogsConfig + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteLogsConfig"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_diagnostic_logs_configuration_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteLogsConfig', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_diagnostic_logs_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/logs'} # type: ignore + + async def update_diagnostic_logs_config_slot( + self, + resource_group_name: str, + name: str, + slot: str, + site_logs_config: "_models.SiteLogsConfig", + **kwargs: Any + ) -> "_models.SiteLogsConfig": + """Updates the logging configuration of an app. + + Description for Updates the logging configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + logging configuration for the production slot. + :type slot: str + :param site_logs_config: A SiteLogsConfig JSON object that contains the logging configuration + to change in the "properties" property. + :type site_logs_config: ~azure.mgmt.web.v2021_02_01.models.SiteLogsConfig + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteLogsConfig, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SiteLogsConfig + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteLogsConfig"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_diagnostic_logs_config_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_logs_config, 'SiteLogsConfig') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteLogsConfig', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_diagnostic_logs_config_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/logs'} # type: ignore + + async def update_metadata_slot( + self, + resource_group_name: str, + name: str, + slot: str, + metadata: "_models.StringDictionary", + **kwargs: Any + ) -> "_models.StringDictionary": + """Replaces the metadata of an app. + + Description for Replaces the metadata of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + metadata for the production slot. + :type slot: str + :param metadata: Edited metadata of the app or deployment slot. See example. + :type metadata: ~azure.mgmt.web.v2021_02_01.models.StringDictionary + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_metadata_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(metadata, 'StringDictionary') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_metadata_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/metadata'} # type: ignore + + async def list_metadata_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> "_models.StringDictionary": + """Gets the metadata of an app. + + Description for Gets the metadata of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + metadata for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_metadata_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_metadata_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/metadata/list'} # type: ignore + + async def _list_publishing_credentials_slot_initial( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> "_models.User": + cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._list_publishing_credentials_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _list_publishing_credentials_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/publishingcredentials/list'} # type: ignore + + async def begin_list_publishing_credentials_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> AsyncLROPoller["_models.User"]: + """Gets the Git/FTP publishing credentials of an app. + + Description for Gets the Git/FTP publishing credentials of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + publishing credentials for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either User or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2021_02_01.models.User] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._list_publishing_credentials_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_list_publishing_credentials_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/publishingcredentials/list'} # type: ignore + + async def update_site_push_settings_slot( + self, + resource_group_name: str, + name: str, + slot: str, + push_settings: "_models.PushSettings", + **kwargs: Any + ) -> "_models.PushSettings": + """Updates the Push settings associated with web app. + + Description for Updates the Push settings associated with web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param push_settings: Push settings associated with web app. + :type push_settings: ~azure.mgmt.web.v2021_02_01.models.PushSettings + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PushSettings, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.PushSettings + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PushSettings"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_site_push_settings_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(push_settings, 'PushSettings') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PushSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_site_push_settings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/pushsettings'} # type: ignore + + async def list_site_push_settings_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> "_models.PushSettings": + """Gets the Push settings associated with web app. + + Description for Gets the Push settings associated with web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PushSettings, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.PushSettings + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PushSettings"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_site_push_settings_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PushSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_site_push_settings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/pushsettings/list'} # type: ignore + + async def get_configuration_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> "_models.SiteConfigResource": + """Gets the configuration of an app, such as platform version and bitness, default documents, virtual applications, Always On, etc. + + Description for Gets the configuration of an app, such as platform version and bitness, default + documents, virtual applications, Always On, etc. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will return + configuration for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteConfigResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SiteConfigResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_configuration_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteConfigResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web'} # type: ignore + + async def create_or_update_configuration_slot( + self, + resource_group_name: str, + name: str, + slot: str, + site_config: "_models.SiteConfigResource", + **kwargs: Any + ) -> "_models.SiteConfigResource": + """Updates the configuration of an app. + + Description for Updates the configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update + configuration for the production slot. + :type slot: str + :param site_config: JSON representation of a SiteConfig object. See example. + :type site_config: ~azure.mgmt.web.v2021_02_01.models.SiteConfigResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteConfigResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SiteConfigResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_configuration_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_config, 'SiteConfigResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteConfigResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web'} # type: ignore + + async def update_configuration_slot( + self, + resource_group_name: str, + name: str, + slot: str, + site_config: "_models.SiteConfigResource", + **kwargs: Any + ) -> "_models.SiteConfigResource": + """Updates the configuration of an app. + + Description for Updates the configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update + configuration for the production slot. + :type slot: str + :param site_config: JSON representation of a SiteConfig object. See example. + :type site_config: ~azure.mgmt.web.v2021_02_01.models.SiteConfigResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteConfigResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SiteConfigResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_configuration_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_config, 'SiteConfigResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteConfigResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web'} # type: ignore + + def list_configuration_snapshot_info_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> AsyncIterable["_models.SiteConfigurationSnapshotInfoCollection"]: + """Gets a list of web app configuration snapshots identifiers. Each element of the list contains a timestamp and the ID of the snapshot. + + Description for Gets a list of web app configuration snapshots identifiers. Each element of the + list contains a timestamp and the ID of the snapshot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will return + configuration for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SiteConfigurationSnapshotInfoCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.SiteConfigurationSnapshotInfoCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigurationSnapshotInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_configuration_snapshot_info_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SiteConfigurationSnapshotInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_configuration_snapshot_info_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots'} # type: ignore + + async def get_configuration_snapshot_slot( + self, + resource_group_name: str, + name: str, + snapshot_id: str, + slot: str, + **kwargs: Any + ) -> "_models.SiteConfigResource": + """Gets a snapshot of the configuration of an app at a previous point in time. + + Description for Gets a snapshot of the configuration of an app at a previous point in time. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param snapshot_id: The ID of the snapshot to read. + :type snapshot_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will return + configuration for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteConfigResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SiteConfigResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_configuration_snapshot_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'snapshotId': self._serialize.url("snapshot_id", snapshot_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteConfigResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_configuration_snapshot_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots/{snapshotId}'} # type: ignore + + async def recover_site_configuration_snapshot_slot( + self, + resource_group_name: str, + name: str, + snapshot_id: str, + slot: str, + **kwargs: Any + ) -> None: + """Reverts the configuration of an app to a previous snapshot. + + Description for Reverts the configuration of an app to a previous snapshot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param snapshot_id: The ID of the snapshot to read. + :type snapshot_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will return + configuration for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.recover_site_configuration_snapshot_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'snapshotId': self._serialize.url("snapshot_id", snapshot_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + recover_site_configuration_snapshot_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots/{snapshotId}/recover'} # type: ignore + + async def get_web_site_container_logs_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> Optional[IO]: + """Gets the last lines of docker logs for the given site. + + Description for Gets the last lines of docker logs for the given site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional[IO]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/octet-stream" + + # Construct URL + url = self.get_web_site_container_logs_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_web_site_container_logs_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/containerlogs'} # type: ignore + + async def get_container_logs_zip_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> Optional[IO]: + """Gets the ZIP archived docker log files for the given site. + + Description for Gets the ZIP archived docker log files for the given site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional[IO]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/zip" + + # Construct URL + url = self.get_container_logs_zip_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_container_logs_zip_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/containerlogs/zip/download'} # type: ignore + + def list_continuous_web_jobs_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> AsyncIterable["_models.ContinuousWebJobCollection"]: + """List continuous web jobs for an app, or a deployment slot. + + Description for List continuous web jobs for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API deletes a + deployment for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ContinuousWebJobCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.ContinuousWebJobCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ContinuousWebJobCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_continuous_web_jobs_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ContinuousWebJobCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_continuous_web_jobs_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs'} # type: ignore + + async def get_continuous_web_job_slot( + self, + resource_group_name: str, + name: str, + web_job_name: str, + slot: str, + **kwargs: Any + ) -> "_models.ContinuousWebJob": + """Gets a continuous web job by its ID for an app, or a deployment slot. + + Description for Gets a continuous web job by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API deletes a + deployment for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ContinuousWebJob, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.ContinuousWebJob + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ContinuousWebJob"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_continuous_web_job_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ContinuousWebJob', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_continuous_web_job_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}'} # type: ignore + + async def delete_continuous_web_job_slot( + self, + resource_group_name: str, + name: str, + web_job_name: str, + slot: str, + **kwargs: Any + ) -> None: + """Delete a continuous web job by its ID for an app, or a deployment slot. + + Description for Delete a continuous web job by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API deletes a + deployment for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_continuous_web_job_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_continuous_web_job_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}'} # type: ignore + + async def start_continuous_web_job_slot( + self, + resource_group_name: str, + name: str, + web_job_name: str, + slot: str, + **kwargs: Any + ) -> None: + """Start a continuous web job for an app, or a deployment slot. + + Description for Start a continuous web job for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API deletes a + deployment for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.start_continuous_web_job_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + start_continuous_web_job_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}/start'} # type: ignore + + async def stop_continuous_web_job_slot( + self, + resource_group_name: str, + name: str, + web_job_name: str, + slot: str, + **kwargs: Any + ) -> None: + """Stop a continuous web job for an app, or a deployment slot. + + Description for Stop a continuous web job for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API deletes a + deployment for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.stop_continuous_web_job_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + stop_continuous_web_job_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}/stop'} # type: ignore + + def list_deployments_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> AsyncIterable["_models.DeploymentCollection"]: + """List deployments for an app, or a deployment slot. + + Description for List deployments for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DeploymentCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.DeploymentCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DeploymentCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_deployments_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DeploymentCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_deployments_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments'} # type: ignore + + async def get_deployment_slot( + self, + resource_group_name: str, + name: str, + id: str, + slot: str, + **kwargs: Any + ) -> "_models.Deployment": + """Get a deployment by its ID for an app, or a deployment slot. + + Description for Get a deployment by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param id: Deployment ID. + :type id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API gets a deployment + for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Deployment, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.Deployment + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Deployment"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_deployment_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Deployment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_deployment_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}'} # type: ignore + + async def create_deployment_slot( + self, + resource_group_name: str, + name: str, + id: str, + slot: str, + deployment: "_models.Deployment", + **kwargs: Any + ) -> "_models.Deployment": + """Create a deployment for an app, or a deployment slot. + + Description for Create a deployment for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param id: ID of an existing deployment. + :type id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API creates a + deployment for the production slot. + :type slot: str + :param deployment: Deployment details. + :type deployment: ~azure.mgmt.web.v2021_02_01.models.Deployment + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Deployment, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.Deployment + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Deployment"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_deployment_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(deployment, 'Deployment') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Deployment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_deployment_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}'} # type: ignore + + async def delete_deployment_slot( + self, + resource_group_name: str, + name: str, + id: str, + slot: str, + **kwargs: Any + ) -> None: + """Delete a deployment by its ID for an app, or a deployment slot. + + Description for Delete a deployment by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param id: Deployment ID. + :type id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API deletes a + deployment for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_deployment_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_deployment_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}'} # type: ignore + + async def list_deployment_log_slot( + self, + resource_group_name: str, + name: str, + id: str, + slot: str, + **kwargs: Any + ) -> "_models.Deployment": + """List deployment log for specific deployment for an app, or a deployment slot. + + Description for List deployment log for specific deployment for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param id: The ID of a specific deployment. This is the value of the name property in the JSON + response from "GET /api/sites/{siteName}/deployments". + :type id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Deployment, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.Deployment + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Deployment"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_deployment_log_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Deployment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_deployment_log_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}/log'} # type: ignore + + async def discover_backup_slot( + self, + resource_group_name: str, + name: str, + slot: str, + request: "_models.RestoreRequest", + **kwargs: Any + ) -> "_models.RestoreRequest": + """Discovers an existing app backup that can be restored from a blob in Azure storage. Use this to get information about the databases stored in a backup. + + Description for Discovers an existing app backup that can be restored from a blob in Azure + storage. Use this to get information about the databases stored in a backup. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will perform + discovery for the production slot. + :type slot: str + :param request: A RestoreRequest object that includes Azure storage URL and blog name for + discovery of backup. + :type request: ~azure.mgmt.web.v2021_02_01.models.RestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RestoreRequest, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.RestoreRequest + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RestoreRequest"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.discover_backup_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'RestoreRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RestoreRequest', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + discover_backup_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/discoverbackup'} # type: ignore + + def list_domain_ownership_identifiers_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> AsyncIterable["_models.IdentifierCollection"]: + """Lists ownership identifiers for domain associated with web app. + + Description for Lists ownership identifiers for domain associated with web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + binding for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either IdentifierCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.IdentifierCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.IdentifierCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_domain_ownership_identifiers_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('IdentifierCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_domain_ownership_identifiers_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers'} # type: ignore + + async def get_domain_ownership_identifier_slot( + self, + resource_group_name: str, + name: str, + domain_ownership_identifier_name: str, + slot: str, + **kwargs: Any + ) -> "_models.Identifier": + """Get domain ownership identifier for web app. + + Description for Get domain ownership identifier for web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param domain_ownership_identifier_name: Name of domain ownership identifier. + :type domain_ownership_identifier_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + binding for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Identifier, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.Identifier + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Identifier"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_domain_ownership_identifier_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Identifier', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_domain_ownership_identifier_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} # type: ignore + + async def create_or_update_domain_ownership_identifier_slot( + self, + resource_group_name: str, + name: str, + domain_ownership_identifier_name: str, + slot: str, + domain_ownership_identifier: "_models.Identifier", + **kwargs: Any + ) -> "_models.Identifier": + """Creates a domain ownership identifier for web app, or updates an existing ownership identifier. + + Description for Creates a domain ownership identifier for web app, or updates an existing + ownership identifier. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param domain_ownership_identifier_name: Name of domain ownership identifier. + :type domain_ownership_identifier_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + binding for the production slot. + :type slot: str + :param domain_ownership_identifier: A JSON representation of the domain ownership properties. + :type domain_ownership_identifier: ~azure.mgmt.web.v2021_02_01.models.Identifier + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Identifier, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.Identifier + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Identifier"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_domain_ownership_identifier_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(domain_ownership_identifier, 'Identifier') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Identifier', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_domain_ownership_identifier_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} # type: ignore + + async def delete_domain_ownership_identifier_slot( + self, + resource_group_name: str, + name: str, + domain_ownership_identifier_name: str, + slot: str, + **kwargs: Any + ) -> None: + """Deletes a domain ownership identifier for a web app. + + Description for Deletes a domain ownership identifier for a web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param domain_ownership_identifier_name: Name of domain ownership identifier. + :type domain_ownership_identifier_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + binding for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_domain_ownership_identifier_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_domain_ownership_identifier_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} # type: ignore + + async def update_domain_ownership_identifier_slot( + self, + resource_group_name: str, + name: str, + domain_ownership_identifier_name: str, + slot: str, + domain_ownership_identifier: "_models.Identifier", + **kwargs: Any + ) -> "_models.Identifier": + """Creates a domain ownership identifier for web app, or updates an existing ownership identifier. + + Description for Creates a domain ownership identifier for web app, or updates an existing + ownership identifier. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param domain_ownership_identifier_name: Name of domain ownership identifier. + :type domain_ownership_identifier_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + binding for the production slot. + :type slot: str + :param domain_ownership_identifier: A JSON representation of the domain ownership properties. + :type domain_ownership_identifier: ~azure.mgmt.web.v2021_02_01.models.Identifier + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Identifier, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.Identifier + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Identifier"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_domain_ownership_identifier_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(domain_ownership_identifier, 'Identifier') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Identifier', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_domain_ownership_identifier_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} # type: ignore + + async def get_ms_deploy_status_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> "_models.MSDeployStatus": + """Get the status of the last MSDeploy operation. + + Description for Get the status of the last MSDeploy operation. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MSDeployStatus, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.MSDeployStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_ms_deploy_status_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_ms_deploy_status_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy'} # type: ignore + + async def _create_ms_deploy_operation_slot_initial( + self, + resource_group_name: str, + name: str, + slot: str, + ms_deploy: "_models.MSDeploy", + **kwargs: Any + ) -> "_models.MSDeployStatus": + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_ms_deploy_operation_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(ms_deploy, 'MSDeploy') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_ms_deploy_operation_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy'} # type: ignore + + async def begin_create_ms_deploy_operation_slot( + self, + resource_group_name: str, + name: str, + slot: str, + ms_deploy: "_models.MSDeploy", + **kwargs: Any + ) -> AsyncLROPoller["_models.MSDeployStatus"]: + """Invoke the MSDeploy web app extension. + + Description for Invoke the MSDeploy web app extension. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param ms_deploy: Details of MSDeploy operation. + :type ms_deploy: ~azure.mgmt.web.v2021_02_01.models.MSDeploy + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either MSDeployStatus or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2021_02_01.models.MSDeployStatus] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployStatus"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_ms_deploy_operation_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + ms_deploy=ms_deploy, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_ms_deploy_operation_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy'} # type: ignore + + async def get_ms_deploy_log_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> "_models.MSDeployLog": + """Get the MSDeploy Log for the last MSDeploy operation. + + Description for Get the MSDeploy Log for the last MSDeploy operation. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MSDeployLog, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.MSDeployLog + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployLog"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_ms_deploy_log_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MSDeployLog', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_ms_deploy_log_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy/log'} # type: ignore + + def list_instance_functions_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> AsyncIterable["_models.FunctionEnvelopeCollection"]: + """List the functions for a web site, or a deployment slot. + + Description for List the functions for a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either FunctionEnvelopeCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.FunctionEnvelopeCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionEnvelopeCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_instance_functions_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('FunctionEnvelopeCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_instance_functions_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions'} # type: ignore + + async def get_functions_admin_token_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> str: + """Fetch a short lived token that can be exchanged for a master key. + + Description for Fetch a short lived token that can be exchanged for a master key. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: str, or the result of cls(response) + :rtype: str + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[str] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_functions_admin_token_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_functions_admin_token_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/admin/token'} # type: ignore + + async def get_instance_function_slot( + self, + resource_group_name: str, + name: str, + function_name: str, + slot: str, + **kwargs: Any + ) -> "_models.FunctionEnvelope": + """Get function information by its ID for web site, or a deployment slot. + + Description for Get function information by its ID for web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: Function name. + :type function_name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FunctionEnvelope, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.FunctionEnvelope + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionEnvelope"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_function_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FunctionEnvelope', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_function_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}'} # type: ignore + + async def _create_instance_function_slot_initial( + self, + resource_group_name: str, + name: str, + function_name: str, + slot: str, + function_envelope: "_models.FunctionEnvelope", + **kwargs: Any + ) -> "_models.FunctionEnvelope": + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionEnvelope"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_instance_function_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(function_envelope, 'FunctionEnvelope') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FunctionEnvelope', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_instance_function_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}'} # type: ignore + + async def begin_create_instance_function_slot( + self, + resource_group_name: str, + name: str, + function_name: str, + slot: str, + function_envelope: "_models.FunctionEnvelope", + **kwargs: Any + ) -> AsyncLROPoller["_models.FunctionEnvelope"]: + """Create function for web site, or a deployment slot. + + Description for Create function for web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: Function name. + :type function_name: str + :param slot: Name of the deployment slot. + :type slot: str + :param function_envelope: Function details. + :type function_envelope: ~azure.mgmt.web.v2021_02_01.models.FunctionEnvelope + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either FunctionEnvelope or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2021_02_01.models.FunctionEnvelope] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionEnvelope"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_instance_function_slot_initial( + resource_group_name=resource_group_name, + name=name, + function_name=function_name, + slot=slot, + function_envelope=function_envelope, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('FunctionEnvelope', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_instance_function_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}'} # type: ignore + + async def delete_instance_function_slot( + self, + resource_group_name: str, + name: str, + function_name: str, + slot: str, + **kwargs: Any + ) -> None: + """Delete a function for web site, or a deployment slot. + + Description for Delete a function for web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: Function name. + :type function_name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_instance_function_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_instance_function_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}'} # type: ignore + + async def create_or_update_function_secret_slot( + self, + resource_group_name: str, + name: str, + function_name: str, + key_name: str, + slot: str, + key: "_models.KeyInfo", + **kwargs: Any + ) -> "_models.KeyInfo": + """Add or update a function secret. + + Description for Add or update a function secret. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: The name of the function. + :type function_name: str + :param key_name: The name of the key. + :type key_name: str + :param slot: Name of the deployment slot. + :type slot: str + :param key: The key to create or update. + :type key: ~azure.mgmt.web.v2021_02_01.models.KeyInfo + :keyword callable cls: A custom type or function that will be passed the direct response + :return: KeyInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.KeyInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.KeyInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_function_secret_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'keyName': self._serialize.url("key_name", key_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(key, 'KeyInfo') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('KeyInfo', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('KeyInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_function_secret_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/keys/{keyName}'} # type: ignore + + async def delete_function_secret_slot( + self, + resource_group_name: str, + name: str, + function_name: str, + key_name: str, + slot: str, + **kwargs: Any + ) -> None: + """Delete a function secret. + + Description for Delete a function secret. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: The name of the function. + :type function_name: str + :param key_name: The name of the key. + :type key_name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_function_secret_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'keyName': self._serialize.url("key_name", key_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_function_secret_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/keys/{keyName}'} # type: ignore + + async def list_function_keys_slot( + self, + resource_group_name: str, + name: str, + function_name: str, + slot: str, + **kwargs: Any + ) -> "_models.StringDictionary": + """Get function keys for a function in a web site, or a deployment slot. + + Description for Get function keys for a function in a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: Function name. + :type function_name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_function_keys_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_function_keys_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/listkeys'} # type: ignore + + async def list_function_secrets_slot( + self, + resource_group_name: str, + name: str, + function_name: str, + slot: str, + **kwargs: Any + ) -> "_models.FunctionSecrets": + """Get function secrets for a function in a web site, or a deployment slot. + + Description for Get function secrets for a function in a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: Function name. + :type function_name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FunctionSecrets, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.FunctionSecrets + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionSecrets"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_function_secrets_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FunctionSecrets', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_function_secrets_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/listsecrets'} # type: ignore + + async def list_host_keys_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> "_models.HostKeys": + """Get host secrets for a function app. + + Description for Get host secrets for a function app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HostKeys, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.HostKeys + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HostKeys"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_host_keys_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HostKeys', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_host_keys_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/listkeys'} # type: ignore + + async def list_sync_status_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> None: + """This is to allow calling via powershell and ARM template. + + Description for This is to allow calling via powershell and ARM template. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_sync_status_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + list_sync_status_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/listsyncstatus'} # type: ignore + + async def sync_functions_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> None: + """Syncs function trigger metadata to the management database. + + Description for Syncs function trigger metadata to the management database. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.sync_functions_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + sync_functions_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/sync'} # type: ignore + + async def create_or_update_host_secret_slot( + self, + resource_group_name: str, + name: str, + key_type: str, + key_name: str, + slot: str, + key: "_models.KeyInfo", + **kwargs: Any + ) -> "_models.KeyInfo": + """Add or update a host level secret. + + Description for Add or update a host level secret. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param key_type: The type of host key. + :type key_type: str + :param key_name: The name of the key. + :type key_name: str + :param slot: Name of the deployment slot. + :type slot: str + :param key: The key to create or update. + :type key: ~azure.mgmt.web.v2021_02_01.models.KeyInfo + :keyword callable cls: A custom type or function that will be passed the direct response + :return: KeyInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.KeyInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.KeyInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_host_secret_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'keyType': self._serialize.url("key_type", key_type, 'str'), + 'keyName': self._serialize.url("key_name", key_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(key, 'KeyInfo') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('KeyInfo', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('KeyInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_host_secret_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/{keyType}/{keyName}'} # type: ignore + + async def delete_host_secret_slot( + self, + resource_group_name: str, + name: str, + key_type: str, + key_name: str, + slot: str, + **kwargs: Any + ) -> None: + """Delete a host level secret. + + Description for Delete a host level secret. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param key_type: The type of host key. + :type key_type: str + :param key_name: The name of the key. + :type key_name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_host_secret_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'keyType': self._serialize.url("key_type", key_type, 'str'), + 'keyName': self._serialize.url("key_name", key_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_host_secret_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/{keyType}/{keyName}'} # type: ignore + + def list_host_name_bindings_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> AsyncIterable["_models.HostNameBindingCollection"]: + """Get hostname bindings for an app or a deployment slot. + + Description for Get hostname bindings for an app or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API gets hostname + bindings for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either HostNameBindingCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.HostNameBindingCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HostNameBindingCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_host_name_bindings_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('HostNameBindingCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_host_name_bindings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings'} # type: ignore + + async def get_host_name_binding_slot( + self, + resource_group_name: str, + name: str, + slot: str, + host_name: str, + **kwargs: Any + ) -> "_models.HostNameBinding": + """Get the named hostname binding for an app (or deployment slot, if specified). + + Description for Get the named hostname binding for an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API the named binding + for the production slot. + :type slot: str + :param host_name: Hostname in the hostname binding. + :type host_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HostNameBinding, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.HostNameBinding + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HostNameBinding"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_host_name_binding_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HostNameBinding', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_host_name_binding_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}'} # type: ignore + + async def create_or_update_host_name_binding_slot( + self, + resource_group_name: str, + name: str, + host_name: str, + slot: str, + host_name_binding: "_models.HostNameBinding", + **kwargs: Any + ) -> "_models.HostNameBinding": + """Creates a hostname binding for an app. + + Description for Creates a hostname binding for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param host_name: Hostname in the hostname binding. + :type host_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will create a + binding for the production slot. + :type slot: str + :param host_name_binding: Binding details. This is the JSON representation of a HostNameBinding + object. + :type host_name_binding: ~azure.mgmt.web.v2021_02_01.models.HostNameBinding + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HostNameBinding, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.HostNameBinding + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HostNameBinding"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_host_name_binding_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(host_name_binding, 'HostNameBinding') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HostNameBinding', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_host_name_binding_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}'} # type: ignore + + async def delete_host_name_binding_slot( + self, + resource_group_name: str, + name: str, + slot: str, + host_name: str, + **kwargs: Any + ) -> None: + """Deletes a hostname binding for an app. + + Description for Deletes a hostname binding for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + binding for the production slot. + :type slot: str + :param host_name: Hostname in the hostname binding. + :type host_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_host_name_binding_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_host_name_binding_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}'} # type: ignore + + async def get_hybrid_connection_slot( + self, + resource_group_name: str, + name: str, + namespace_name: str, + relay_name: str, + slot: str, + **kwargs: Any + ) -> "_models.HybridConnection": + """Retrieves a specific Service Bus Hybrid Connection used by this Web App. + + Description for Retrieves a specific Service Bus Hybrid Connection used by this Web App. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param namespace_name: The namespace for this hybrid connection. + :type namespace_name: str + :param relay_name: The relay name for this hybrid connection. + :type relay_name: str + :param slot: The name of the slot for the web app. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnection, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.HybridConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_hybrid_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_hybrid_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} # type: ignore + + async def create_or_update_hybrid_connection_slot( + self, + resource_group_name: str, + name: str, + namespace_name: str, + relay_name: str, + slot: str, + connection_envelope: "_models.HybridConnection", + **kwargs: Any + ) -> "_models.HybridConnection": + """Creates a new Hybrid Connection using a Service Bus relay. + + Description for Creates a new Hybrid Connection using a Service Bus relay. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param namespace_name: The namespace for this hybrid connection. + :type namespace_name: str + :param relay_name: The relay name for this hybrid connection. + :type relay_name: str + :param slot: The name of the slot for the web app. + :type slot: str + :param connection_envelope: The details of the hybrid connection. + :type connection_envelope: ~azure.mgmt.web.v2021_02_01.models.HybridConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnection, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.HybridConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_hybrid_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'HybridConnection') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_hybrid_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} # type: ignore + + async def delete_hybrid_connection_slot( + self, + resource_group_name: str, + name: str, + namespace_name: str, + relay_name: str, + slot: str, + **kwargs: Any + ) -> None: + """Removes a Hybrid Connection from this site. + + Description for Removes a Hybrid Connection from this site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param namespace_name: The namespace for this hybrid connection. + :type namespace_name: str + :param relay_name: The relay name for this hybrid connection. + :type relay_name: str + :param slot: The name of the slot for the web app. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_hybrid_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_hybrid_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} # type: ignore + + async def update_hybrid_connection_slot( + self, + resource_group_name: str, + name: str, + namespace_name: str, + relay_name: str, + slot: str, + connection_envelope: "_models.HybridConnection", + **kwargs: Any + ) -> "_models.HybridConnection": + """Creates a new Hybrid Connection using a Service Bus relay. + + Description for Creates a new Hybrid Connection using a Service Bus relay. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param namespace_name: The namespace for this hybrid connection. + :type namespace_name: str + :param relay_name: The relay name for this hybrid connection. + :type relay_name: str + :param slot: The name of the slot for the web app. + :type slot: str + :param connection_envelope: The details of the hybrid connection. + :type connection_envelope: ~azure.mgmt.web.v2021_02_01.models.HybridConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnection, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.HybridConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_hybrid_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'HybridConnection') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_hybrid_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} # type: ignore + + async def list_hybrid_connections_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> "_models.HybridConnection": + """Retrieves all Service Bus Hybrid Connections used by this Web App. + + Description for Retrieves all Service Bus Hybrid Connections used by this Web App. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param slot: The name of the slot for the web app. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnection, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.HybridConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_hybrid_connections_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_hybrid_connections_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionRelays'} # type: ignore + + async def list_relay_service_connections_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> "_models.RelayServiceConnectionEntity": + """Gets hybrid connections configured for an app (or deployment slot, if specified). + + Description for Gets hybrid connections configured for an app (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get hybrid + connections for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RelayServiceConnectionEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.RelayServiceConnectionEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RelayServiceConnectionEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_relay_service_connections_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RelayServiceConnectionEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_relay_service_connections_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection'} # type: ignore + + async def get_relay_service_connection_slot( + self, + resource_group_name: str, + name: str, + entity_name: str, + slot: str, + **kwargs: Any + ) -> "_models.RelayServiceConnectionEntity": + """Gets a hybrid connection configuration by its name. + + Description for Gets a hybrid connection configuration by its name. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param entity_name: Name of the hybrid connection. + :type entity_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get a hybrid + connection for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RelayServiceConnectionEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.RelayServiceConnectionEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RelayServiceConnectionEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_relay_service_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'entityName': self._serialize.url("entity_name", entity_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RelayServiceConnectionEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_relay_service_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}'} # type: ignore + + async def create_or_update_relay_service_connection_slot( + self, + resource_group_name: str, + name: str, + entity_name: str, + slot: str, + connection_envelope: "_models.RelayServiceConnectionEntity", + **kwargs: Any + ) -> "_models.RelayServiceConnectionEntity": + """Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). + + Description for Creates a new hybrid connection configuration (PUT), or updates an existing one + (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param entity_name: Name of the hybrid connection configuration. + :type entity_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will create or + update a hybrid connection for the production slot. + :type slot: str + :param connection_envelope: Details of the hybrid connection configuration. + :type connection_envelope: ~azure.mgmt.web.v2021_02_01.models.RelayServiceConnectionEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RelayServiceConnectionEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.RelayServiceConnectionEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RelayServiceConnectionEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_relay_service_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'entityName': self._serialize.url("entity_name", entity_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'RelayServiceConnectionEntity') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RelayServiceConnectionEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_relay_service_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}'} # type: ignore + + async def delete_relay_service_connection_slot( + self, + resource_group_name: str, + name: str, + entity_name: str, + slot: str, + **kwargs: Any + ) -> None: + """Deletes a relay service connection by its name. + + Description for Deletes a relay service connection by its name. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param entity_name: Name of the hybrid connection configuration. + :type entity_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete a + hybrid connection for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_relay_service_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'entityName': self._serialize.url("entity_name", entity_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_relay_service_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}'} # type: ignore + + async def update_relay_service_connection_slot( + self, + resource_group_name: str, + name: str, + entity_name: str, + slot: str, + connection_envelope: "_models.RelayServiceConnectionEntity", + **kwargs: Any + ) -> "_models.RelayServiceConnectionEntity": + """Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). + + Description for Creates a new hybrid connection configuration (PUT), or updates an existing one + (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param entity_name: Name of the hybrid connection configuration. + :type entity_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will create or + update a hybrid connection for the production slot. + :type slot: str + :param connection_envelope: Details of the hybrid connection configuration. + :type connection_envelope: ~azure.mgmt.web.v2021_02_01.models.RelayServiceConnectionEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RelayServiceConnectionEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.RelayServiceConnectionEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RelayServiceConnectionEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_relay_service_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'entityName': self._serialize.url("entity_name", entity_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'RelayServiceConnectionEntity') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RelayServiceConnectionEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_relay_service_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}'} # type: ignore + + def list_instance_identifiers_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> AsyncIterable["_models.WebAppInstanceStatusCollection"]: + """Gets all scale-out instances of an app. + + Description for Gets all scale-out instances of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API gets the + production slot instances. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebAppInstanceStatusCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.WebAppInstanceStatusCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppInstanceStatusCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_instance_identifiers_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppInstanceStatusCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_instance_identifiers_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances'} # type: ignore + + async def get_instance_info_slot( + self, + resource_group_name: str, + name: str, + instance_id: str, + slot: str, + **kwargs: Any + ) -> "_models.WebSiteInstanceStatus": + """Gets all scale-out instances of an app. + + Description for Gets all scale-out instances of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param instance_id: + :type instance_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API gets the + production slot instances. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WebSiteInstanceStatus, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.WebSiteInstanceStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebSiteInstanceStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_info_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('WebSiteInstanceStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_info_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}'} # type: ignore + + async def get_instance_ms_deploy_status_slot( + self, + resource_group_name: str, + name: str, + slot: str, + instance_id: str, + **kwargs: Any + ) -> "_models.MSDeployStatus": + """Get the status of the last MSDeploy operation. + + Description for Get the status of the last MSDeploy operation. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param instance_id: ID of web app instance. + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MSDeployStatus, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.MSDeployStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_ms_deploy_status_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_ms_deploy_status_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy'} # type: ignore + + async def _create_instance_ms_deploy_operation_slot_initial( + self, + resource_group_name: str, + name: str, + slot: str, + instance_id: str, + ms_deploy: "_models.MSDeploy", + **kwargs: Any + ) -> "_models.MSDeployStatus": + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_instance_ms_deploy_operation_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(ms_deploy, 'MSDeploy') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_instance_ms_deploy_operation_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy'} # type: ignore + + async def begin_create_instance_ms_deploy_operation_slot( + self, + resource_group_name: str, + name: str, + slot: str, + instance_id: str, + ms_deploy: "_models.MSDeploy", + **kwargs: Any + ) -> AsyncLROPoller["_models.MSDeployStatus"]: + """Invoke the MSDeploy web app extension. + + Description for Invoke the MSDeploy web app extension. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param instance_id: ID of web app instance. + :type instance_id: str + :param ms_deploy: Details of MSDeploy operation. + :type ms_deploy: ~azure.mgmt.web.v2021_02_01.models.MSDeploy + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either MSDeployStatus or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2021_02_01.models.MSDeployStatus] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployStatus"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_instance_ms_deploy_operation_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + instance_id=instance_id, + ms_deploy=ms_deploy, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_instance_ms_deploy_operation_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy'} # type: ignore + + async def get_instance_ms_deploy_log_slot( + self, + resource_group_name: str, + name: str, + slot: str, + instance_id: str, + **kwargs: Any + ) -> "_models.MSDeployLog": + """Get the MSDeploy Log for the last MSDeploy operation. + + Description for Get the MSDeploy Log for the last MSDeploy operation. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param instance_id: ID of web app instance. + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MSDeployLog, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.MSDeployLog + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployLog"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_ms_deploy_log_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MSDeployLog', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_ms_deploy_log_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy/log'} # type: ignore + + def list_instance_processes_slot( + self, + resource_group_name: str, + name: str, + slot: str, + instance_id: str, + **kwargs: Any + ) -> AsyncIterable["_models.ProcessInfoCollection"]: + """Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. + + Description for Get list of processes for a web site, or a deployment slot, or for a specific + scaled-out instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessInfoCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.ProcessInfoCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_instance_processes_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_instance_processes_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes'} # type: ignore + + async def get_instance_process_slot( + self, + resource_group_name: str, + name: str, + process_id: str, + slot: str, + instance_id: str, + **kwargs: Any + ) -> "_models.ProcessInfo": + """Get process information by its ID for a specific scaled-out instance in a web site. + + Description for Get process information by its ID for a specific scaled-out instance in a web + site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProcessInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.ProcessInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_process_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ProcessInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_process_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}'} # type: ignore + + async def delete_instance_process_slot( + self, + resource_group_name: str, + name: str, + process_id: str, + slot: str, + instance_id: str, + **kwargs: Any + ) -> None: + """Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web site. + + Description for Terminate a process by its ID for a web site, or a deployment slot, or specific + scaled-out instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_instance_process_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_instance_process_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}'} # type: ignore + + async def get_instance_process_dump_slot( + self, + resource_group_name: str, + name: str, + process_id: str, + slot: str, + instance_id: str, + **kwargs: Any + ) -> IO: + """Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. + + Description for Get a memory dump of a process by its ID for a specific scaled-out instance in + a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[IO] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_process_dump_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_process_dump_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/dump'} # type: ignore + + def list_instance_process_modules_slot( + self, + resource_group_name: str, + name: str, + process_id: str, + slot: str, + instance_id: str, + **kwargs: Any + ) -> AsyncIterable["_models.ProcessModuleInfoCollection"]: + """List module information for a process by its ID for a specific scaled-out instance in a web site. + + Description for List module information for a process by its ID for a specific scaled-out + instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessModuleInfoCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.ProcessModuleInfoCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessModuleInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_instance_process_modules_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessModuleInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_instance_process_modules_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/modules'} # type: ignore + + async def get_instance_process_module_slot( + self, + resource_group_name: str, + name: str, + process_id: str, + base_address: str, + slot: str, + instance_id: str, + **kwargs: Any + ) -> "_models.ProcessModuleInfo": + """Get process information by its ID for a specific scaled-out instance in a web site. + + Description for Get process information by its ID for a specific scaled-out instance in a web + site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param base_address: Module base address. + :type base_address: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProcessModuleInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.ProcessModuleInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessModuleInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_process_module_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'baseAddress': self._serialize.url("base_address", base_address, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ProcessModuleInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_process_module_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/modules/{baseAddress}'} # type: ignore + + def list_instance_process_threads_slot( + self, + resource_group_name: str, + name: str, + process_id: str, + slot: str, + instance_id: str, + **kwargs: Any + ) -> AsyncIterable["_models.ProcessThreadInfoCollection"]: + """List the threads in a process by its ID for a specific scaled-out instance in a web site. + + Description for List the threads in a process by its ID for a specific scaled-out instance in a + web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessThreadInfoCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.ProcessThreadInfoCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessThreadInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_instance_process_threads_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessThreadInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_instance_process_threads_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/threads'} # type: ignore + + async def is_cloneable_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> "_models.SiteCloneability": + """Shows whether an app can be cloned to another resource group or subscription. + + Description for Shows whether an app can be cloned to another resource group or subscription. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. By default, this API returns information on the + production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteCloneability, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SiteCloneability + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteCloneability"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.is_cloneable_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteCloneability', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + is_cloneable_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/iscloneable'} # type: ignore + + def list_site_backups_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> AsyncIterable["_models.BackupItemCollection"]: + """Gets existing backups of an app. + + Description for Gets existing backups of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get backups + of the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either BackupItemCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.BackupItemCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupItemCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_backups_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('BackupItemCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_site_backups_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/listbackups'} # type: ignore + + async def list_sync_function_triggers_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> "_models.FunctionSecrets": + """This is to allow calling via powershell and ARM template. + + Description for This is to allow calling via powershell and ARM template. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FunctionSecrets, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.FunctionSecrets + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionSecrets"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_sync_function_triggers_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FunctionSecrets', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_sync_function_triggers_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/listsyncfunctiontriggerstatus'} # type: ignore + + async def get_migrate_my_sql_status_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> "_models.MigrateMySqlStatus": + """Returns the status of MySql in app migration, if one is active, and whether or not MySql in app is enabled. + + Description for Returns the status of MySql in app migration, if one is active, and whether or + not MySql in app is enabled. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MigrateMySqlStatus, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.MigrateMySqlStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MigrateMySqlStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_migrate_my_sql_status_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MigrateMySqlStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_migrate_my_sql_status_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/migratemysql/status'} # type: ignore + + async def get_swift_virtual_network_connection_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> "_models.SwiftVirtualNetwork": + """Gets a Swift Virtual Network connection. + + Description for Gets a Swift Virtual Network connection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get a + gateway for the production slot's Virtual Network. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SwiftVirtualNetwork, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SwiftVirtualNetwork + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SwiftVirtualNetwork"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_swift_virtual_network_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SwiftVirtualNetwork', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_swift_virtual_network_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork'} # type: ignore + + async def create_or_update_swift_virtual_network_connection_with_check_slot( + self, + resource_group_name: str, + name: str, + slot: str, + connection_envelope: "_models.SwiftVirtualNetwork", + **kwargs: Any + ) -> "_models.SwiftVirtualNetwork": + """Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet has already been delegated, and is not + in use by another App Service Plan other than the one this App is in. + + Description for Integrates this Web App with a Virtual Network. This requires that 1) + "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet + has already been delegated, and is not + in use by another App Service Plan other than the one this App is in. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will add or + update connections for the production slot. + :type slot: str + :param connection_envelope: Properties of the Virtual Network connection. See example. + :type connection_envelope: ~azure.mgmt.web.v2021_02_01.models.SwiftVirtualNetwork + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SwiftVirtualNetwork, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SwiftVirtualNetwork + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SwiftVirtualNetwork"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_swift_virtual_network_connection_with_check_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'SwiftVirtualNetwork') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SwiftVirtualNetwork', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_swift_virtual_network_connection_with_check_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork'} # type: ignore + + async def delete_swift_virtual_network_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> None: + """Deletes a Swift Virtual Network connection from an app (or deployment slot). + + Description for Deletes a Swift Virtual Network connection from an app (or deployment slot). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + connection for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_swift_virtual_network_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_swift_virtual_network_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork'} # type: ignore + + async def update_swift_virtual_network_connection_with_check_slot( + self, + resource_group_name: str, + name: str, + slot: str, + connection_envelope: "_models.SwiftVirtualNetwork", + **kwargs: Any + ) -> "_models.SwiftVirtualNetwork": + """Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet has already been delegated, and is not + in use by another App Service Plan other than the one this App is in. + + Description for Integrates this Web App with a Virtual Network. This requires that 1) + "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet + has already been delegated, and is not + in use by another App Service Plan other than the one this App is in. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will add or + update connections for the production slot. + :type slot: str + :param connection_envelope: Properties of the Virtual Network connection. See example. + :type connection_envelope: ~azure.mgmt.web.v2021_02_01.models.SwiftVirtualNetwork + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SwiftVirtualNetwork, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SwiftVirtualNetwork + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SwiftVirtualNetwork"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_swift_virtual_network_connection_with_check_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'SwiftVirtualNetwork') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SwiftVirtualNetwork', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_swift_virtual_network_connection_with_check_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork'} # type: ignore + + async def list_network_features_slot( + self, + resource_group_name: str, + name: str, + view: str, + slot: str, + **kwargs: Any + ) -> "_models.NetworkFeatures": + """Gets all network features used by the app (or deployment slot, if specified). + + Description for Gets all network features used by the app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param view: The type of view. Only "summary" is supported at this time. + :type view: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get network + features for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkFeatures, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.NetworkFeatures + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFeatures"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_network_features_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'view': self._serialize.url("view", view, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkFeatures', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_network_features_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkFeatures/{view}'} # type: ignore + + async def get_network_trace_operation_slot( + self, + resource_group_name: str, + name: str, + operation_id: str, + slot: str, + **kwargs: Any + ) -> List["_models.NetworkTrace"]: + """Gets a named operation for a network trace capturing (or deployment slot, if specified). + + Description for Gets a named operation for a network trace capturing (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param operation_id: GUID of the operation. + :type operation_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get an + operation for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of NetworkTrace, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2021_02_01.models.NetworkTrace] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_network_trace_operation_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_network_trace_operation_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/operationresults/{operationId}'} # type: ignore + + async def start_web_site_network_trace_slot( + self, + resource_group_name: str, + name: str, + slot: str, + duration_in_seconds: Optional[int] = None, + max_frame_length: Optional[int] = None, + sas_url: Optional[str] = None, + **kwargs: Any + ) -> str: + """Start capturing network packets for the site (To be deprecated). + + Description for Start capturing network packets for the site (To be deprecated). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param slot: The name of the slot for this web app. + :type slot: str + :param duration_in_seconds: The duration to keep capturing in seconds. + :type duration_in_seconds: int + :param max_frame_length: The maximum frame length in bytes (Optional). + :type max_frame_length: int + :param sas_url: The Blob URL to store capture file. + :type sas_url: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: str, or the result of cls(response) + :rtype: str + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[str] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.start_web_site_network_trace_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if duration_in_seconds is not None: + query_parameters['durationInSeconds'] = self._serialize.query("duration_in_seconds", duration_in_seconds, 'int') + if max_frame_length is not None: + query_parameters['maxFrameLength'] = self._serialize.query("max_frame_length", max_frame_length, 'int') + if sas_url is not None: + query_parameters['sasUrl'] = self._serialize.query("sas_url", sas_url, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + start_web_site_network_trace_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/start'} # type: ignore + + async def _start_web_site_network_trace_operation_slot_initial( + self, + resource_group_name: str, + name: str, + slot: str, + duration_in_seconds: Optional[int] = None, + max_frame_length: Optional[int] = None, + sas_url: Optional[str] = None, + **kwargs: Any + ) -> List["_models.NetworkTrace"]: + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._start_web_site_network_trace_operation_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if duration_in_seconds is not None: + query_parameters['durationInSeconds'] = self._serialize.query("duration_in_seconds", duration_in_seconds, 'int') + if max_frame_length is not None: + query_parameters['maxFrameLength'] = self._serialize.query("max_frame_length", max_frame_length, 'int') + if sas_url is not None: + query_parameters['sasUrl'] = self._serialize.query("sas_url", sas_url, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _start_web_site_network_trace_operation_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/startOperation'} # type: ignore + + async def begin_start_web_site_network_trace_operation_slot( + self, + resource_group_name: str, + name: str, + slot: str, + duration_in_seconds: Optional[int] = None, + max_frame_length: Optional[int] = None, + sas_url: Optional[str] = None, + **kwargs: Any + ) -> AsyncLROPoller[List["_models.NetworkTrace"]]: + """Start capturing network packets for the site. + + Description for Start capturing network packets for the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param slot: The name of the slot for this web app. + :type slot: str + :param duration_in_seconds: The duration to keep capturing in seconds. + :type duration_in_seconds: int + :param max_frame_length: The maximum frame length in bytes (Optional). + :type max_frame_length: int + :param sas_url: The Blob URL to store capture file. + :type sas_url: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either list of NetworkTrace or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[list[~azure.mgmt.web.v2021_02_01.models.NetworkTrace]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._start_web_site_network_trace_operation_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + duration_in_seconds=duration_in_seconds, + max_frame_length=max_frame_length, + sas_url=sas_url, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start_web_site_network_trace_operation_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/startOperation'} # type: ignore + + async def stop_web_site_network_trace_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> None: + """Stop ongoing capturing network packets for the site. + + Description for Stop ongoing capturing network packets for the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param slot: The name of the slot for this web app. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.stop_web_site_network_trace_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + stop_web_site_network_trace_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/stop'} # type: ignore + + async def get_network_traces_slot( + self, + resource_group_name: str, + name: str, + operation_id: str, + slot: str, + **kwargs: Any + ) -> List["_models.NetworkTrace"]: + """Gets a named operation for a network trace capturing (or deployment slot, if specified). + + Description for Gets a named operation for a network trace capturing (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param operation_id: GUID of the operation. + :type operation_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get an + operation for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of NetworkTrace, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2021_02_01.models.NetworkTrace] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_network_traces_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_network_traces_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/{operationId}'} # type: ignore + + async def get_network_trace_operation_slot_v2( + self, + resource_group_name: str, + name: str, + operation_id: str, + slot: str, + **kwargs: Any + ) -> List["_models.NetworkTrace"]: + """Gets a named operation for a network trace capturing (or deployment slot, if specified). + + Description for Gets a named operation for a network trace capturing (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param operation_id: GUID of the operation. + :type operation_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get an + operation for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of NetworkTrace, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2021_02_01.models.NetworkTrace] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_network_trace_operation_slot_v2.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_network_trace_operation_slot_v2.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTraces/current/operationresults/{operationId}'} # type: ignore + + async def get_network_traces_slot_v2( + self, + resource_group_name: str, + name: str, + operation_id: str, + slot: str, + **kwargs: Any + ) -> List["_models.NetworkTrace"]: + """Gets a named operation for a network trace capturing (or deployment slot, if specified). + + Description for Gets a named operation for a network trace capturing (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param operation_id: GUID of the operation. + :type operation_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get an + operation for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of NetworkTrace, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2021_02_01.models.NetworkTrace] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_network_traces_slot_v2.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_network_traces_slot_v2.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTraces/{operationId}'} # type: ignore + + async def generate_new_site_publishing_password_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> None: + """Generates a new publishing password for an app (or deployment slot, if specified). + + Description for Generates a new publishing password for an app (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API generate a new + publishing password for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.generate_new_site_publishing_password_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + generate_new_site_publishing_password_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/newpassword'} # type: ignore + + def list_perf_mon_counters_slot( + self, + resource_group_name: str, + name: str, + slot: str, + filter: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.PerfMonCounterCollection"]: + """Gets perfmon counters for web app. + + Description for Gets perfmon counters for web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param filter: Return only usages/metrics specified in the filter. Filter conforms to odata + syntax. Example: $filter=(startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z + and timeGrain eq duration'[Hour|Minute|Day]'. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PerfMonCounterCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.PerfMonCounterCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PerfMonCounterCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_perf_mon_counters_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('PerfMonCounterCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_perf_mon_counters_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/perfcounters'} # type: ignore + + async def get_site_php_error_log_flag_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> "_models.SitePhpErrorLogFlag": + """Gets web app's event logs. + + Description for Gets web app's event logs. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SitePhpErrorLogFlag, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SitePhpErrorLogFlag + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SitePhpErrorLogFlag"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_site_php_error_log_flag_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SitePhpErrorLogFlag', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_php_error_log_flag_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/phplogging'} # type: ignore + + async def list_premier_add_ons_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> "_models.PremierAddOn": + """Gets the premier add-ons of an app. + + Description for Gets the premier add-ons of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + premier add-ons for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PremierAddOn, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.PremierAddOn + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PremierAddOn"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_premier_add_ons_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PremierAddOn', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_premier_add_ons_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons'} # type: ignore + + async def get_premier_add_on_slot( + self, + resource_group_name: str, + name: str, + premier_add_on_name: str, + slot: str, + **kwargs: Any + ) -> "_models.PremierAddOn": + """Gets a named add-on of an app. + + Description for Gets a named add-on of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param premier_add_on_name: Add-on name. + :type premier_add_on_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + named add-on for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PremierAddOn, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.PremierAddOn + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PremierAddOn"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_premier_add_on_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PremierAddOn', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_premier_add_on_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}'} # type: ignore + + async def add_premier_add_on_slot( + self, + resource_group_name: str, + name: str, + premier_add_on_name: str, + slot: str, + premier_add_on: "_models.PremierAddOn", + **kwargs: Any + ) -> "_models.PremierAddOn": + """Updates a named add-on of an app. + + Description for Updates a named add-on of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param premier_add_on_name: Add-on name. + :type premier_add_on_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + named add-on for the production slot. + :type slot: str + :param premier_add_on: A JSON representation of the edited premier add-on. + :type premier_add_on: ~azure.mgmt.web.v2021_02_01.models.PremierAddOn + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PremierAddOn, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.PremierAddOn + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PremierAddOn"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.add_premier_add_on_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(premier_add_on, 'PremierAddOn') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PremierAddOn', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + add_premier_add_on_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}'} # type: ignore + + async def delete_premier_add_on_slot( + self, + resource_group_name: str, + name: str, + premier_add_on_name: str, + slot: str, + **kwargs: Any + ) -> None: + """Delete a premier add-on from an app. + + Description for Delete a premier add-on from an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param premier_add_on_name: Add-on name. + :type premier_add_on_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + named add-on for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_premier_add_on_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_premier_add_on_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}'} # type: ignore + + async def update_premier_add_on_slot( + self, + resource_group_name: str, + name: str, + premier_add_on_name: str, + slot: str, + premier_add_on: "_models.PremierAddOnPatchResource", + **kwargs: Any + ) -> "_models.PremierAddOn": + """Updates a named add-on of an app. + + Description for Updates a named add-on of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param premier_add_on_name: Add-on name. + :type premier_add_on_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + named add-on for the production slot. + :type slot: str + :param premier_add_on: A JSON representation of the edited premier add-on. + :type premier_add_on: ~azure.mgmt.web.v2021_02_01.models.PremierAddOnPatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PremierAddOn, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.PremierAddOn + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PremierAddOn"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_premier_add_on_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(premier_add_on, 'PremierAddOnPatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PremierAddOn', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_premier_add_on_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}'} # type: ignore + + async def get_private_access_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> "_models.PrivateAccess": + """Gets data around private site access enablement and authorized Virtual Networks that can access the site. + + Description for Gets data around private site access enablement and authorized Virtual Networks + that can access the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param slot: The name of the slot for the web app. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateAccess, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.PrivateAccess + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateAccess"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_private_access_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateAccess', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_private_access_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateAccess/virtualNetworks'} # type: ignore + + async def put_private_access_vnet_slot( + self, + resource_group_name: str, + name: str, + slot: str, + access: "_models.PrivateAccess", + **kwargs: Any + ) -> "_models.PrivateAccess": + """Sets data around private site access enablement and authorized Virtual Networks that can access the site. + + Description for Sets data around private site access enablement and authorized Virtual Networks + that can access the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param slot: The name of the slot for the web app. + :type slot: str + :param access: The information for the private access. + :type access: ~azure.mgmt.web.v2021_02_01.models.PrivateAccess + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateAccess, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.PrivateAccess + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateAccess"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.put_private_access_vnet_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(access, 'PrivateAccess') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateAccess', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + put_private_access_vnet_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateAccess/virtualNetworks'} # type: ignore + + def get_private_endpoint_connection_list_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> AsyncIterable["_models.PrivateEndpointConnectionCollection"]: + """Gets the list of private endpoint connections associated with a site. + + Description for Gets the list of private endpoint connections associated with a site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the site. + :type name: str + :param slot: Name of the site deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PrivateEndpointConnectionCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.PrivateEndpointConnectionCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_private_endpoint_connection_list_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('PrivateEndpointConnectionCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + get_private_endpoint_connection_list_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateEndpointConnections'} # type: ignore + + async def get_private_endpoint_connection_slot( + self, + resource_group_name: str, + name: str, + private_endpoint_connection_name: str, + slot: str, + **kwargs: Any + ) -> "_models.RemotePrivateEndpointConnectionARMResource": + """Gets a private endpoint connection. + + Description for Gets a private endpoint connection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the site. + :type name: str + :param private_endpoint_connection_name: Name of the private endpoint connection. + :type private_endpoint_connection_name: str + :param slot: Name of the site deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RemotePrivateEndpointConnectionARMResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.RemotePrivateEndpointConnectionARMResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RemotePrivateEndpointConnectionARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_private_endpoint_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RemotePrivateEndpointConnectionARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_private_endpoint_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def _approve_or_reject_private_endpoint_connection_slot_initial( + self, + resource_group_name: str, + name: str, + private_endpoint_connection_name: str, + slot: str, + private_endpoint_wrapper: "_models.PrivateLinkConnectionApprovalRequestResource", + **kwargs: Any + ) -> "_models.RemotePrivateEndpointConnectionARMResource": + cls = kwargs.pop('cls', None) # type: ClsType["_models.RemotePrivateEndpointConnectionARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._approve_or_reject_private_endpoint_connection_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(private_endpoint_wrapper, 'PrivateLinkConnectionApprovalRequestResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('RemotePrivateEndpointConnectionARMResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('RemotePrivateEndpointConnectionARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _approve_or_reject_private_endpoint_connection_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def begin_approve_or_reject_private_endpoint_connection_slot( + self, + resource_group_name: str, + name: str, + private_endpoint_connection_name: str, + slot: str, + private_endpoint_wrapper: "_models.PrivateLinkConnectionApprovalRequestResource", + **kwargs: Any + ) -> AsyncLROPoller["_models.RemotePrivateEndpointConnectionARMResource"]: + """Approves or rejects a private endpoint connection. + + Description for Approves or rejects a private endpoint connection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the site. + :type name: str + :param private_endpoint_connection_name: + :type private_endpoint_connection_name: str + :param slot: + :type slot: str + :param private_endpoint_wrapper: + :type private_endpoint_wrapper: ~azure.mgmt.web.v2021_02_01.models.PrivateLinkConnectionApprovalRequestResource + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either RemotePrivateEndpointConnectionARMResource or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2021_02_01.models.RemotePrivateEndpointConnectionARMResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RemotePrivateEndpointConnectionARMResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._approve_or_reject_private_endpoint_connection_slot_initial( + resource_group_name=resource_group_name, + name=name, + private_endpoint_connection_name=private_endpoint_connection_name, + slot=slot, + private_endpoint_wrapper=private_endpoint_wrapper, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('RemotePrivateEndpointConnectionARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_approve_or_reject_private_endpoint_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def _delete_private_endpoint_connection_slot_initial( + self, + resource_group_name: str, + name: str, + private_endpoint_connection_name: str, + slot: str, + **kwargs: Any + ) -> Any: + cls = kwargs.pop('cls', None) # type: ClsType[Any] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._delete_private_endpoint_connection_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('object', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('object', pipeline_response) + + if response.status_code == 204: + deserialized = self._deserialize('object', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _delete_private_endpoint_connection_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def begin_delete_private_endpoint_connection_slot( + self, + resource_group_name: str, + name: str, + private_endpoint_connection_name: str, + slot: str, + **kwargs: Any + ) -> AsyncLROPoller[Any]: + """Deletes a private endpoint connection. + + Description for Deletes a private endpoint connection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the site. + :type name: str + :param private_endpoint_connection_name: + :type private_endpoint_connection_name: str + :param slot: + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either any or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[any] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[Any] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_private_endpoint_connection_slot_initial( + resource_group_name=resource_group_name, + name=name, + private_endpoint_connection_name=private_endpoint_connection_name, + slot=slot, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('object', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete_private_endpoint_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def get_private_link_resources_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> "_models.PrivateLinkResourcesWrapper": + """Gets the private link resources. + + Description for Gets the private link resources. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the site. + :type name: str + :param slot: + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkResourcesWrapper, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.PrivateLinkResourcesWrapper + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourcesWrapper"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_private_link_resources_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateLinkResourcesWrapper', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_private_link_resources_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateLinkResources'} # type: ignore + + def list_processes_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> AsyncIterable["_models.ProcessInfoCollection"]: + """Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. + + Description for Get list of processes for a web site, or a deployment slot, or for a specific + scaled-out instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessInfoCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.ProcessInfoCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_processes_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_processes_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes'} # type: ignore + + async def get_process_slot( + self, + resource_group_name: str, + name: str, + process_id: str, + slot: str, + **kwargs: Any + ) -> "_models.ProcessInfo": + """Get process information by its ID for a specific scaled-out instance in a web site. + + Description for Get process information by its ID for a specific scaled-out instance in a web + site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProcessInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.ProcessInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_process_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ProcessInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_process_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}'} # type: ignore + + async def delete_process_slot( + self, + resource_group_name: str, + name: str, + process_id: str, + slot: str, + **kwargs: Any + ) -> None: + """Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web site. + + Description for Terminate a process by its ID for a web site, or a deployment slot, or specific + scaled-out instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_process_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_process_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}'} # type: ignore + + async def get_process_dump_slot( + self, + resource_group_name: str, + name: str, + process_id: str, + slot: str, + **kwargs: Any + ) -> IO: + """Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. + + Description for Get a memory dump of a process by its ID for a specific scaled-out instance in + a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[IO] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_process_dump_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_process_dump_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/dump'} # type: ignore + + def list_process_modules_slot( + self, + resource_group_name: str, + name: str, + process_id: str, + slot: str, + **kwargs: Any + ) -> AsyncIterable["_models.ProcessModuleInfoCollection"]: + """List module information for a process by its ID for a specific scaled-out instance in a web site. + + Description for List module information for a process by its ID for a specific scaled-out + instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessModuleInfoCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.ProcessModuleInfoCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessModuleInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_process_modules_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessModuleInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_process_modules_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/modules'} # type: ignore + + async def get_process_module_slot( + self, + resource_group_name: str, + name: str, + process_id: str, + base_address: str, + slot: str, + **kwargs: Any + ) -> "_models.ProcessModuleInfo": + """Get process information by its ID for a specific scaled-out instance in a web site. + + Description for Get process information by its ID for a specific scaled-out instance in a web + site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param base_address: Module base address. + :type base_address: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProcessModuleInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.ProcessModuleInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessModuleInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_process_module_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'baseAddress': self._serialize.url("base_address", base_address, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ProcessModuleInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_process_module_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/modules/{baseAddress}'} # type: ignore + + def list_process_threads_slot( + self, + resource_group_name: str, + name: str, + process_id: str, + slot: str, + **kwargs: Any + ) -> AsyncIterable["_models.ProcessThreadInfoCollection"]: + """List the threads in a process by its ID for a specific scaled-out instance in a web site. + + Description for List the threads in a process by its ID for a specific scaled-out instance in a + web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessThreadInfoCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.ProcessThreadInfoCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessThreadInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_process_threads_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessThreadInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_process_threads_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/threads'} # type: ignore + + def list_public_certificates_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> AsyncIterable["_models.PublicCertificateCollection"]: + """Get public certificates for an app or a deployment slot. + + Description for Get public certificates for an app or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API gets hostname + bindings for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PublicCertificateCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.PublicCertificateCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicCertificateCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_public_certificates_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('PublicCertificateCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_public_certificates_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates'} # type: ignore + + async def get_public_certificate_slot( + self, + resource_group_name: str, + name: str, + slot: str, + public_certificate_name: str, + **kwargs: Any + ) -> "_models.PublicCertificate": + """Get the named public certificate for an app (or deployment slot, if specified). + + Description for Get the named public certificate for an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API the named binding + for the production slot. + :type slot: str + :param public_certificate_name: Public certificate name. + :type public_certificate_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PublicCertificate, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.PublicCertificate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicCertificate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_public_certificate_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'publicCertificateName': self._serialize.url("public_certificate_name", public_certificate_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PublicCertificate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_public_certificate_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}'} # type: ignore + + async def create_or_update_public_certificate_slot( + self, + resource_group_name: str, + name: str, + public_certificate_name: str, + slot: str, + public_certificate: "_models.PublicCertificate", + **kwargs: Any + ) -> "_models.PublicCertificate": + """Creates a hostname binding for an app. + + Description for Creates a hostname binding for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param public_certificate_name: Public certificate name. + :type public_certificate_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will create a + binding for the production slot. + :type slot: str + :param public_certificate: Public certificate details. This is the JSON representation of a + PublicCertificate object. + :type public_certificate: ~azure.mgmt.web.v2021_02_01.models.PublicCertificate + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PublicCertificate, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.PublicCertificate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicCertificate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_public_certificate_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'publicCertificateName': self._serialize.url("public_certificate_name", public_certificate_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(public_certificate, 'PublicCertificate') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PublicCertificate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_public_certificate_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}'} # type: ignore + + async def delete_public_certificate_slot( + self, + resource_group_name: str, + name: str, + slot: str, + public_certificate_name: str, + **kwargs: Any + ) -> None: + """Deletes a hostname binding for an app. + + Description for Deletes a hostname binding for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + binding for the production slot. + :type slot: str + :param public_certificate_name: Public certificate name. + :type public_certificate_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_public_certificate_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'publicCertificateName': self._serialize.url("public_certificate_name", public_certificate_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_public_certificate_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}'} # type: ignore + + async def list_publishing_profile_xml_with_secrets_slot( + self, + resource_group_name: str, + name: str, + slot: str, + publishing_profile_options: "_models.CsmPublishingProfileOptions", + **kwargs: Any + ) -> IO: + """Gets the publishing profile for an app (or deployment slot, if specified). + + Description for Gets the publishing profile for an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + publishing profile for the production slot. + :type slot: str + :param publishing_profile_options: Specifies publishingProfileOptions for publishing profile. + For example, use {"format": "FileZilla3"} to get a FileZilla publishing profile. + :type publishing_profile_options: ~azure.mgmt.web.v2021_02_01.models.CsmPublishingProfileOptions + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[IO] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/xml" + + # Construct URL + url = self.list_publishing_profile_xml_with_secrets_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(publishing_profile_options, 'CsmPublishingProfileOptions') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_publishing_profile_xml_with_secrets_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publishxml'} # type: ignore + + async def reset_slot_configuration_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> None: + """Resets the configuration settings of the current slot if they were previously modified by calling the API with POST. + + Description for Resets the configuration settings of the current slot if they were previously + modified by calling the API with POST. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API resets + configuration settings for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.reset_slot_configuration_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + reset_slot_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/resetSlotConfig'} # type: ignore + + async def restart_slot( + self, + resource_group_name: str, + name: str, + slot: str, + soft_restart: Optional[bool] = None, + synchronous: Optional[bool] = None, + **kwargs: Any + ) -> None: + """Restarts an app (or deployment slot, if specified). + + Description for Restarts an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will restart the + production slot. + :type slot: str + :param soft_restart: Specify true to apply the configuration settings and restarts the app only + if necessary. By default, the API always restarts and reprovisions the app. + :type soft_restart: bool + :param synchronous: Specify true to block until the app is restarted. By default, it is set to + false, and the API responds immediately (asynchronous). + :type synchronous: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.restart_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if soft_restart is not None: + query_parameters['softRestart'] = self._serialize.query("soft_restart", soft_restart, 'bool') + if synchronous is not None: + query_parameters['synchronous'] = self._serialize.query("synchronous", synchronous, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + restart_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restart'} # type: ignore + + async def _restore_from_backup_blob_slot_initial( + self, + resource_group_name: str, + name: str, + slot: str, + request: "_models.RestoreRequest", + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._restore_from_backup_blob_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'RestoreRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _restore_from_backup_blob_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreFromBackupBlob'} # type: ignore + + async def begin_restore_from_backup_blob_slot( + self, + resource_group_name: str, + name: str, + slot: str, + request: "_models.RestoreRequest", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Restores an app from a backup blob in Azure Storage. + + Description for Restores an app from a backup blob in Azure Storage. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will restore a + backup of the production slot. + :type slot: str + :param request: Information on restore request . + :type request: ~azure.mgmt.web.v2021_02_01.models.RestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._restore_from_backup_blob_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + request=request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_restore_from_backup_blob_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreFromBackupBlob'} # type: ignore + + async def _restore_from_deleted_app_slot_initial( + self, + resource_group_name: str, + name: str, + slot: str, + restore_request: "_models.DeletedAppRestoreRequest", + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._restore_from_deleted_app_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(restore_request, 'DeletedAppRestoreRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _restore_from_deleted_app_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreFromDeletedApp'} # type: ignore + + async def begin_restore_from_deleted_app_slot( + self, + resource_group_name: str, + name: str, + slot: str, + restore_request: "_models.DeletedAppRestoreRequest", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Restores a deleted web app to this web app. + + Description for Restores a deleted web app to this web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param restore_request: Deleted web app restore information. + :type restore_request: ~azure.mgmt.web.v2021_02_01.models.DeletedAppRestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._restore_from_deleted_app_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + restore_request=restore_request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_restore_from_deleted_app_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreFromDeletedApp'} # type: ignore + + async def _restore_snapshot_slot_initial( + self, + resource_group_name: str, + name: str, + slot: str, + restore_request: "_models.SnapshotRestoreRequest", + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._restore_snapshot_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(restore_request, 'SnapshotRestoreRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _restore_snapshot_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreSnapshot'} # type: ignore + + async def begin_restore_snapshot_slot( + self, + resource_group_name: str, + name: str, + slot: str, + restore_request: "_models.SnapshotRestoreRequest", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Restores a web app from a snapshot. + + Description for Restores a web app from a snapshot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param restore_request: Snapshot restore settings. Snapshot information can be obtained by + calling GetDeletedSites or GetSiteSnapshots API. + :type restore_request: ~azure.mgmt.web.v2021_02_01.models.SnapshotRestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._restore_snapshot_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + restore_request=restore_request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_restore_snapshot_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreSnapshot'} # type: ignore + + def list_site_extensions_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> AsyncIterable["_models.SiteExtensionInfoCollection"]: + """Get list of siteextensions for a web site, or a deployment slot. + + Description for Get list of siteextensions for a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API uses the + production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SiteExtensionInfoCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.SiteExtensionInfoCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteExtensionInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_extensions_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SiteExtensionInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_site_extensions_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions'} # type: ignore + + async def get_site_extension_slot( + self, + resource_group_name: str, + name: str, + site_extension_id: str, + slot: str, + **kwargs: Any + ) -> "_models.SiteExtensionInfo": + """Get site extension information by its ID for a web site, or a deployment slot. + + Description for Get site extension information by its ID for a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param site_extension_id: Site extension name. + :type site_extension_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API uses the + production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteExtensionInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SiteExtensionInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteExtensionInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_site_extension_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'siteExtensionId': self._serialize.url("site_extension_id", site_extension_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteExtensionInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_extension_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}'} # type: ignore + + async def _install_site_extension_slot_initial( + self, + resource_group_name: str, + name: str, + site_extension_id: str, + slot: str, + **kwargs: Any + ) -> "_models.SiteExtensionInfo": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteExtensionInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._install_site_extension_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'siteExtensionId': self._serialize.url("site_extension_id", site_extension_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.put(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SiteExtensionInfo', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SiteExtensionInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _install_site_extension_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}'} # type: ignore + + async def begin_install_site_extension_slot( + self, + resource_group_name: str, + name: str, + site_extension_id: str, + slot: str, + **kwargs: Any + ) -> AsyncLROPoller["_models.SiteExtensionInfo"]: + """Install site extension on a web site, or a deployment slot. + + Description for Install site extension on a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param site_extension_id: Site extension name. + :type site_extension_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API uses the + production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either SiteExtensionInfo or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2021_02_01.models.SiteExtensionInfo] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteExtensionInfo"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._install_site_extension_slot_initial( + resource_group_name=resource_group_name, + name=name, + site_extension_id=site_extension_id, + slot=slot, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('SiteExtensionInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'siteExtensionId': self._serialize.url("site_extension_id", site_extension_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_install_site_extension_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}'} # type: ignore + + async def delete_site_extension_slot( + self, + resource_group_name: str, + name: str, + site_extension_id: str, + slot: str, + **kwargs: Any + ) -> None: + """Remove a site extension from a web site, or a deployment slot. + + Description for Remove a site extension from a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param site_extension_id: Site extension name. + :type site_extension_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API deletes a + deployment for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_site_extension_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'siteExtensionId': self._serialize.url("site_extension_id", site_extension_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_site_extension_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}'} # type: ignore + + def list_slot_differences_slot( + self, + resource_group_name: str, + name: str, + slot: str, + slot_swap_entity: "_models.CsmSlotEntity", + **kwargs: Any + ) -> AsyncIterable["_models.SlotDifferenceCollection"]: + """Get the difference in configuration settings between two web app slots. + + Description for Get the difference in configuration settings between two web app slots. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the source slot. If a slot is not specified, the production slot is used + as the source slot. + :type slot: str + :param slot_swap_entity: JSON object that contains the target slot name. See example. + :type slot_swap_entity: ~azure.mgmt.web.v2021_02_01.models.CsmSlotEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SlotDifferenceCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.SlotDifferenceCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SlotDifferenceCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = "application/json" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_slot_differences_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(slot_swap_entity, 'CsmSlotEntity') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(slot_swap_entity, 'CsmSlotEntity') + body_content_kwargs['content'] = body_content + request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SlotDifferenceCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_slot_differences_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotsdiffs'} # type: ignore + + async def _swap_slot_initial( + self, + resource_group_name: str, + name: str, + slot: str, + slot_swap_entity: "_models.CsmSlotEntity", + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._swap_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(slot_swap_entity, 'CsmSlotEntity') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _swap_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotsswap'} # type: ignore + + async def begin_swap_slot( + self, + resource_group_name: str, + name: str, + slot: str, + slot_swap_entity: "_models.CsmSlotEntity", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Swaps two deployment slots of an app. + + Description for Swaps two deployment slots of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the source slot. If a slot is not specified, the production slot is used + as the source slot. + :type slot: str + :param slot_swap_entity: JSON object that contains the target slot name. See example. + :type slot_swap_entity: ~azure.mgmt.web.v2021_02_01.models.CsmSlotEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._swap_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + slot_swap_entity=slot_swap_entity, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_swap_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotsswap'} # type: ignore + + def list_snapshots_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> AsyncIterable["_models.SnapshotCollection"]: + """Returns all Snapshots to the user. + + Description for Returns all Snapshots to the user. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Website Name. + :type name: str + :param slot: Website Slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SnapshotCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.SnapshotCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_snapshots_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SnapshotCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_snapshots_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/snapshots'} # type: ignore + + def list_snapshots_from_dr_secondary_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> AsyncIterable["_models.SnapshotCollection"]: + """Returns all Snapshots to the user from DRSecondary endpoint. + + Description for Returns all Snapshots to the user from DRSecondary endpoint. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Website Name. + :type name: str + :param slot: Website Slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SnapshotCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.SnapshotCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_snapshots_from_dr_secondary_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SnapshotCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_snapshots_from_dr_secondary_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/snapshotsdr'} # type: ignore + + async def get_source_control_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> "_models.SiteSourceControl": + """Gets the source control configuration of an app. + + Description for Gets the source control configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + source control configuration for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteSourceControl, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SiteSourceControl + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteSourceControl"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_source_control_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_source_control_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web'} # type: ignore + + async def _create_or_update_source_control_slot_initial( + self, + resource_group_name: str, + name: str, + slot: str, + site_source_control: "_models.SiteSourceControl", + **kwargs: Any + ) -> "_models.SiteSourceControl": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteSourceControl"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_source_control_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_source_control, 'SiteSourceControl') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_source_control_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web'} # type: ignore + + async def begin_create_or_update_source_control_slot( + self, + resource_group_name: str, + name: str, + slot: str, + site_source_control: "_models.SiteSourceControl", + **kwargs: Any + ) -> AsyncLROPoller["_models.SiteSourceControl"]: + """Updates the source control configuration of an app. + + Description for Updates the source control configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + source control configuration for the production slot. + :type slot: str + :param site_source_control: JSON representation of a SiteSourceControl object. See example. + :type site_source_control: ~azure.mgmt.web.v2021_02_01.models.SiteSourceControl + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either SiteSourceControl or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2021_02_01.models.SiteSourceControl] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteSourceControl"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_source_control_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + site_source_control=site_source_control, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update_source_control_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web'} # type: ignore + + async def delete_source_control_slot( + self, + resource_group_name: str, + name: str, + slot: str, + additional_flags: Optional[str] = None, + **kwargs: Any + ) -> None: + """Deletes the source control configuration of an app. + + Description for Deletes the source control configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + source control configuration for the production slot. + :type slot: str + :param additional_flags: + :type additional_flags: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_source_control_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if additional_flags is not None: + query_parameters['additionalFlags'] = self._serialize.query("additional_flags", additional_flags, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_source_control_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web'} # type: ignore + + async def update_source_control_slot( + self, + resource_group_name: str, + name: str, + slot: str, + site_source_control: "_models.SiteSourceControl", + **kwargs: Any + ) -> "_models.SiteSourceControl": + """Updates the source control configuration of an app. + + Description for Updates the source control configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + source control configuration for the production slot. + :type slot: str + :param site_source_control: JSON representation of a SiteSourceControl object. See example. + :type site_source_control: ~azure.mgmt.web.v2021_02_01.models.SiteSourceControl + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteSourceControl, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SiteSourceControl + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteSourceControl"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_source_control_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_source_control, 'SiteSourceControl') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_source_control_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web'} # type: ignore + + async def start_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> None: + """Starts an app (or deployment slot, if specified). + + Description for Starts an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will start the + production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.start_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + start_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/start'} # type: ignore + + async def _start_network_trace_slot_initial( + self, + resource_group_name: str, + name: str, + slot: str, + duration_in_seconds: Optional[int] = None, + max_frame_length: Optional[int] = None, + sas_url: Optional[str] = None, + **kwargs: Any + ) -> List["_models.NetworkTrace"]: + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._start_network_trace_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if duration_in_seconds is not None: + query_parameters['durationInSeconds'] = self._serialize.query("duration_in_seconds", duration_in_seconds, 'int') + if max_frame_length is not None: + query_parameters['maxFrameLength'] = self._serialize.query("max_frame_length", max_frame_length, 'int') + if sas_url is not None: + query_parameters['sasUrl'] = self._serialize.query("sas_url", sas_url, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _start_network_trace_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/startNetworkTrace'} # type: ignore + + async def begin_start_network_trace_slot( + self, + resource_group_name: str, + name: str, + slot: str, + duration_in_seconds: Optional[int] = None, + max_frame_length: Optional[int] = None, + sas_url: Optional[str] = None, + **kwargs: Any + ) -> AsyncLROPoller[List["_models.NetworkTrace"]]: + """Start capturing network packets for the site. + + Description for Start capturing network packets for the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param slot: The name of the slot for this web app. + :type slot: str + :param duration_in_seconds: The duration to keep capturing in seconds. + :type duration_in_seconds: int + :param max_frame_length: The maximum frame length in bytes (Optional). + :type max_frame_length: int + :param sas_url: The Blob URL to store capture file. + :type sas_url: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either list of NetworkTrace or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[list[~azure.mgmt.web.v2021_02_01.models.NetworkTrace]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._start_network_trace_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + duration_in_seconds=duration_in_seconds, + max_frame_length=max_frame_length, + sas_url=sas_url, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start_network_trace_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/startNetworkTrace'} # type: ignore + + async def stop_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> None: + """Stops an app (or deployment slot, if specified). + + Description for Stops an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will stop the + production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.stop_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + stop_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/stop'} # type: ignore + + async def stop_network_trace_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> None: + """Stop ongoing capturing network packets for the site. + + Description for Stop ongoing capturing network packets for the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param slot: The name of the slot for this web app. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.stop_network_trace_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + stop_network_trace_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/stopNetworkTrace'} # type: ignore + + async def sync_repository_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> None: + """Sync web app repository. + + Description for Sync web app repository. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.sync_repository_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + sync_repository_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sync'} # type: ignore + + async def sync_function_triggers_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> None: + """Syncs function trigger metadata to the management database. + + Description for Syncs function trigger metadata to the management database. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.sync_function_triggers_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + sync_function_triggers_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/syncfunctiontriggers'} # type: ignore + + def list_triggered_web_jobs_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> AsyncIterable["_models.TriggeredWebJobCollection"]: + """List triggered web jobs for an app, or a deployment slot. + + Description for List triggered web jobs for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API deletes a + deployment for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either TriggeredWebJobCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.TriggeredWebJobCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TriggeredWebJobCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_triggered_web_jobs_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('TriggeredWebJobCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_triggered_web_jobs_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs'} # type: ignore + + async def get_triggered_web_job_slot( + self, + resource_group_name: str, + name: str, + web_job_name: str, + slot: str, + **kwargs: Any + ) -> "_models.TriggeredWebJob": + """Gets a triggered web job by its ID for an app, or a deployment slot. + + Description for Gets a triggered web job by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API uses the + production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TriggeredWebJob, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.TriggeredWebJob + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TriggeredWebJob"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_triggered_web_job_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('TriggeredWebJob', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_triggered_web_job_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}'} # type: ignore + + async def delete_triggered_web_job_slot( + self, + resource_group_name: str, + name: str, + web_job_name: str, + slot: str, + **kwargs: Any + ) -> None: + """Delete a triggered web job by its ID for an app, or a deployment slot. + + Description for Delete a triggered web job by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API deletes web job + for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_triggered_web_job_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_triggered_web_job_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}'} # type: ignore + + def list_triggered_web_job_history_slot( + self, + resource_group_name: str, + name: str, + web_job_name: str, + slot: str, + **kwargs: Any + ) -> AsyncIterable["_models.TriggeredJobHistoryCollection"]: + """List a triggered web job's history for an app, or a deployment slot. + + Description for List a triggered web job's history for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API uses the + production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either TriggeredJobHistoryCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.TriggeredJobHistoryCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TriggeredJobHistoryCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_triggered_web_job_history_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('TriggeredJobHistoryCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_triggered_web_job_history_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/history'} # type: ignore + + async def get_triggered_web_job_history_slot( + self, + resource_group_name: str, + name: str, + web_job_name: str, + id: str, + slot: str, + **kwargs: Any + ) -> "_models.TriggeredJobHistory": + """Gets a triggered web job's history by its ID for an app, , or a deployment slot. + + Description for Gets a triggered web job's history by its ID for an app, , or a deployment + slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param id: History ID. + :type id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API uses the + production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TriggeredJobHistory, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.TriggeredJobHistory + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TriggeredJobHistory"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_triggered_web_job_history_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('TriggeredJobHistory', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_triggered_web_job_history_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/history/{id}'} # type: ignore + + async def run_triggered_web_job_slot( + self, + resource_group_name: str, + name: str, + web_job_name: str, + slot: str, + **kwargs: Any + ) -> None: + """Run a triggered web job for an app, or a deployment slot. + + Description for Run a triggered web job for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API uses the + production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.run_triggered_web_job_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + run_triggered_web_job_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/run'} # type: ignore + + def list_usages_slot( + self, + resource_group_name: str, + name: str, + slot: str, + filter: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.CsmUsageQuotaCollection"]: + """Gets the quota usage information of an app (or deployment slot, if specified). + + Description for Gets the quota usage information of an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get quota + information of the production slot. + :type slot: str + :param filter: Return only information specified in the filter (using OData syntax). For + example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq + 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + duration'[Hour|Minute|Day]'. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CsmUsageQuotaCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.CsmUsageQuotaCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmUsageQuotaCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_usages_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('CsmUsageQuotaCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_usages_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/usages'} # type: ignore + + async def list_vnet_connections_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> List["_models.VnetInfoResource"]: + """Gets the virtual networks the app (or deployment slot) is connected to. + + Description for Gets the virtual networks the app (or deployment slot) is connected to. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get virtual + network connections for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of VnetInfoResource, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2021_02_01.models.VnetInfoResource] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VnetInfoResource"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_vnet_connections_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[VnetInfoResource]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_vnet_connections_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections'} # type: ignore + + async def get_vnet_connection_slot( + self, + resource_group_name: str, + name: str, + vnet_name: str, + slot: str, + **kwargs: Any + ) -> "_models.VnetInfoResource": + """Gets a virtual network the app (or deployment slot) is connected to by name. + + Description for Gets a virtual network the app (or deployment slot) is connected to by name. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of the virtual network. + :type vnet_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + named virtual network for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetInfoResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.VnetInfoResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetInfoResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_vnet_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetInfoResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_vnet_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}'} # type: ignore + + async def create_or_update_vnet_connection_slot( + self, + resource_group_name: str, + name: str, + vnet_name: str, + slot: str, + connection_envelope: "_models.VnetInfoResource", + **kwargs: Any + ) -> "_models.VnetInfoResource": + """Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). + + Description for Adds a Virtual Network connection to an app or slot (PUT) or updates the + connection properties (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of an existing Virtual Network. + :type vnet_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will add or + update connections for the production slot. + :type slot: str + :param connection_envelope: Properties of the Virtual Network connection. See example. + :type connection_envelope: ~azure.mgmt.web.v2021_02_01.models.VnetInfoResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetInfoResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.VnetInfoResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetInfoResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_vnet_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'VnetInfoResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetInfoResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_vnet_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}'} # type: ignore + + async def delete_vnet_connection_slot( + self, + resource_group_name: str, + name: str, + vnet_name: str, + slot: str, + **kwargs: Any + ) -> None: + """Deletes a connection from an app (or deployment slot to a named virtual network. + + Description for Deletes a connection from an app (or deployment slot to a named virtual + network. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of the virtual network. + :type vnet_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + connection for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_vnet_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_vnet_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}'} # type: ignore + + async def update_vnet_connection_slot( + self, + resource_group_name: str, + name: str, + vnet_name: str, + slot: str, + connection_envelope: "_models.VnetInfoResource", + **kwargs: Any + ) -> "_models.VnetInfoResource": + """Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). + + Description for Adds a Virtual Network connection to an app or slot (PUT) or updates the + connection properties (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of an existing Virtual Network. + :type vnet_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will add or + update connections for the production slot. + :type slot: str + :param connection_envelope: Properties of the Virtual Network connection. See example. + :type connection_envelope: ~azure.mgmt.web.v2021_02_01.models.VnetInfoResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetInfoResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.VnetInfoResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetInfoResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_vnet_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'VnetInfoResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetInfoResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_vnet_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}'} # type: ignore + + async def get_vnet_connection_gateway_slot( + self, + resource_group_name: str, + name: str, + vnet_name: str, + gateway_name: str, + slot: str, + **kwargs: Any + ) -> "_models.VnetGateway": + """Gets an app's Virtual Network gateway. + + Description for Gets an app's Virtual Network gateway. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param gateway_name: Name of the gateway. Currently, the only supported string is "primary". + :type gateway_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get a + gateway for the production slot's Virtual Network. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetGateway, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.VnetGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_vnet_connection_gateway_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_vnet_connection_gateway_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'} # type: ignore + + async def create_or_update_vnet_connection_gateway_slot( + self, + resource_group_name: str, + name: str, + vnet_name: str, + gateway_name: str, + slot: str, + connection_envelope: "_models.VnetGateway", + **kwargs: Any + ) -> "_models.VnetGateway": + """Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + + Description for Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param gateway_name: Name of the gateway. Currently, the only supported string is "primary". + :type gateway_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will add or + update a gateway for the production slot's Virtual Network. + :type slot: str + :param connection_envelope: The properties to update this gateway with. + :type connection_envelope: ~azure.mgmt.web.v2021_02_01.models.VnetGateway + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetGateway, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.VnetGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_vnet_connection_gateway_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'VnetGateway') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_vnet_connection_gateway_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'} # type: ignore + + async def update_vnet_connection_gateway_slot( + self, + resource_group_name: str, + name: str, + vnet_name: str, + gateway_name: str, + slot: str, + connection_envelope: "_models.VnetGateway", + **kwargs: Any + ) -> "_models.VnetGateway": + """Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + + Description for Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param gateway_name: Name of the gateway. Currently, the only supported string is "primary". + :type gateway_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will add or + update a gateway for the production slot's Virtual Network. + :type slot: str + :param connection_envelope: The properties to update this gateway with. + :type connection_envelope: ~azure.mgmt.web.v2021_02_01.models.VnetGateway + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetGateway, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.VnetGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_vnet_connection_gateway_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'VnetGateway') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_vnet_connection_gateway_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'} # type: ignore + + def list_web_jobs_slot( + self, + resource_group_name: str, + name: str, + slot: str, + **kwargs: Any + ) -> AsyncIterable["_models.WebJobCollection"]: + """List webjobs for an app, or a deployment slot. + + Description for List webjobs for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebJobCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.WebJobCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebJobCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_web_jobs_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WebJobCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_web_jobs_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/webjobs'} # type: ignore + + async def get_web_job_slot( + self, + resource_group_name: str, + name: str, + web_job_name: str, + slot: str, + **kwargs: Any + ) -> "_models.WebJob": + """Get webjob information for an app, or a deployment slot. + + Description for Get webjob information for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of the web job. + :type web_job_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WebJob, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.WebJob + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebJob"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_web_job_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('WebJob', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_web_job_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/webjobs/{webJobName}'} # type: ignore + + def list_slot_differences_from_production( + self, + resource_group_name: str, + name: str, + slot_swap_entity: "_models.CsmSlotEntity", + **kwargs: Any + ) -> AsyncIterable["_models.SlotDifferenceCollection"]: + """Get the difference in configuration settings between two web app slots. + + Description for Get the difference in configuration settings between two web app slots. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot_swap_entity: JSON object that contains the target slot name. See example. + :type slot_swap_entity: ~azure.mgmt.web.v2021_02_01.models.CsmSlotEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SlotDifferenceCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.SlotDifferenceCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SlotDifferenceCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = "application/json" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_slot_differences_from_production.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(slot_swap_entity, 'CsmSlotEntity') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(slot_swap_entity, 'CsmSlotEntity') + body_content_kwargs['content'] = body_content + request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SlotDifferenceCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_slot_differences_from_production.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotsdiffs'} # type: ignore + + async def _swap_slot_with_production_initial( + self, + resource_group_name: str, + name: str, + slot_swap_entity: "_models.CsmSlotEntity", + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._swap_slot_with_production_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(slot_swap_entity, 'CsmSlotEntity') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _swap_slot_with_production_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotsswap'} # type: ignore + + async def begin_swap_slot_with_production( + self, + resource_group_name: str, + name: str, + slot_swap_entity: "_models.CsmSlotEntity", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Swaps two deployment slots of an app. + + Description for Swaps two deployment slots of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot_swap_entity: JSON object that contains the target slot name. See example. + :type slot_swap_entity: ~azure.mgmt.web.v2021_02_01.models.CsmSlotEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._swap_slot_with_production_initial( + resource_group_name=resource_group_name, + name=name, + slot_swap_entity=slot_swap_entity, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_swap_slot_with_production.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotsswap'} # type: ignore + + def list_snapshots( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> AsyncIterable["_models.SnapshotCollection"]: + """Returns all Snapshots to the user. + + Description for Returns all Snapshots to the user. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Website Name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SnapshotCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.SnapshotCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_snapshots.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SnapshotCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_snapshots.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/snapshots'} # type: ignore + + def list_snapshots_from_dr_secondary( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> AsyncIterable["_models.SnapshotCollection"]: + """Returns all Snapshots to the user from DRSecondary endpoint. + + Description for Returns all Snapshots to the user from DRSecondary endpoint. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Website Name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SnapshotCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.SnapshotCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_snapshots_from_dr_secondary.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SnapshotCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_snapshots_from_dr_secondary.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/snapshotsdr'} # type: ignore + + async def get_source_control( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> "_models.SiteSourceControl": + """Gets the source control configuration of an app. + + Description for Gets the source control configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteSourceControl, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SiteSourceControl + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteSourceControl"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_source_control.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_source_control.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web'} # type: ignore + + async def _create_or_update_source_control_initial( + self, + resource_group_name: str, + name: str, + site_source_control: "_models.SiteSourceControl", + **kwargs: Any + ) -> "_models.SiteSourceControl": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteSourceControl"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_source_control_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_source_control, 'SiteSourceControl') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_source_control_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web'} # type: ignore + + async def begin_create_or_update_source_control( + self, + resource_group_name: str, + name: str, + site_source_control: "_models.SiteSourceControl", + **kwargs: Any + ) -> AsyncLROPoller["_models.SiteSourceControl"]: + """Updates the source control configuration of an app. + + Description for Updates the source control configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param site_source_control: JSON representation of a SiteSourceControl object. See example. + :type site_source_control: ~azure.mgmt.web.v2021_02_01.models.SiteSourceControl + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either SiteSourceControl or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.web.v2021_02_01.models.SiteSourceControl] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteSourceControl"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_source_control_initial( + resource_group_name=resource_group_name, + name=name, + site_source_control=site_source_control, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update_source_control.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web'} # type: ignore + + async def delete_source_control( + self, + resource_group_name: str, + name: str, + additional_flags: Optional[str] = None, + **kwargs: Any + ) -> None: + """Deletes the source control configuration of an app. + + Description for Deletes the source control configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param additional_flags: + :type additional_flags: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_source_control.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if additional_flags is not None: + query_parameters['additionalFlags'] = self._serialize.query("additional_flags", additional_flags, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_source_control.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web'} # type: ignore + + async def update_source_control( + self, + resource_group_name: str, + name: str, + site_source_control: "_models.SiteSourceControl", + **kwargs: Any + ) -> "_models.SiteSourceControl": + """Updates the source control configuration of an app. + + Description for Updates the source control configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param site_source_control: JSON representation of a SiteSourceControl object. See example. + :type site_source_control: ~azure.mgmt.web.v2021_02_01.models.SiteSourceControl + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteSourceControl, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SiteSourceControl + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteSourceControl"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_source_control.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_source_control, 'SiteSourceControl') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_source_control.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web'} # type: ignore + + async def start( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> None: + """Starts an app (or deployment slot, if specified). + + Description for Starts an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.start.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/start'} # type: ignore + + async def _start_network_trace_initial( + self, + resource_group_name: str, + name: str, + duration_in_seconds: Optional[int] = None, + max_frame_length: Optional[int] = None, + sas_url: Optional[str] = None, + **kwargs: Any + ) -> List["_models.NetworkTrace"]: + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._start_network_trace_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if duration_in_seconds is not None: + query_parameters['durationInSeconds'] = self._serialize.query("duration_in_seconds", duration_in_seconds, 'int') + if max_frame_length is not None: + query_parameters['maxFrameLength'] = self._serialize.query("max_frame_length", max_frame_length, 'int') + if sas_url is not None: + query_parameters['sasUrl'] = self._serialize.query("sas_url", sas_url, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _start_network_trace_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/startNetworkTrace'} # type: ignore + + async def begin_start_network_trace( + self, + resource_group_name: str, + name: str, + duration_in_seconds: Optional[int] = None, + max_frame_length: Optional[int] = None, + sas_url: Optional[str] = None, + **kwargs: Any + ) -> AsyncLROPoller[List["_models.NetworkTrace"]]: + """Start capturing network packets for the site. + + Description for Start capturing network packets for the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param duration_in_seconds: The duration to keep capturing in seconds. + :type duration_in_seconds: int + :param max_frame_length: The maximum frame length in bytes (Optional). + :type max_frame_length: int + :param sas_url: The Blob URL to store capture file. + :type sas_url: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either list of NetworkTrace or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[list[~azure.mgmt.web.v2021_02_01.models.NetworkTrace]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._start_network_trace_initial( + resource_group_name=resource_group_name, + name=name, + duration_in_seconds=duration_in_seconds, + max_frame_length=max_frame_length, + sas_url=sas_url, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start_network_trace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/startNetworkTrace'} # type: ignore + + async def stop( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> None: + """Stops an app (or deployment slot, if specified). + + Description for Stops an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.stop.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/stop'} # type: ignore + + async def stop_network_trace( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> None: + """Stop ongoing capturing network packets for the site. + + Description for Stop ongoing capturing network packets for the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.stop_network_trace.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + stop_network_trace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/stopNetworkTrace'} # type: ignore + + async def sync_repository( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> None: + """Sync web app repository. + + Description for Sync web app repository. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.sync_repository.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + sync_repository.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sync'} # type: ignore + + async def sync_function_triggers( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> None: + """Syncs function trigger metadata to the management database. + + Description for Syncs function trigger metadata to the management database. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.sync_function_triggers.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + sync_function_triggers.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/syncfunctiontriggers'} # type: ignore + + def list_triggered_web_jobs( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> AsyncIterable["_models.TriggeredWebJobCollection"]: + """List triggered web jobs for an app, or a deployment slot. + + Description for List triggered web jobs for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either TriggeredWebJobCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.TriggeredWebJobCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TriggeredWebJobCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_triggered_web_jobs.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('TriggeredWebJobCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_triggered_web_jobs.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs'} # type: ignore + + async def get_triggered_web_job( + self, + resource_group_name: str, + name: str, + web_job_name: str, + **kwargs: Any + ) -> "_models.TriggeredWebJob": + """Gets a triggered web job by its ID for an app, or a deployment slot. + + Description for Gets a triggered web job by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TriggeredWebJob, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.TriggeredWebJob + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TriggeredWebJob"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_triggered_web_job.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('TriggeredWebJob', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_triggered_web_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}'} # type: ignore + + async def delete_triggered_web_job( + self, + resource_group_name: str, + name: str, + web_job_name: str, + **kwargs: Any + ) -> None: + """Delete a triggered web job by its ID for an app, or a deployment slot. + + Description for Delete a triggered web job by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_triggered_web_job.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_triggered_web_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}'} # type: ignore + + def list_triggered_web_job_history( + self, + resource_group_name: str, + name: str, + web_job_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.TriggeredJobHistoryCollection"]: + """List a triggered web job's history for an app, or a deployment slot. + + Description for List a triggered web job's history for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either TriggeredJobHistoryCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.TriggeredJobHistoryCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TriggeredJobHistoryCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_triggered_web_job_history.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('TriggeredJobHistoryCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_triggered_web_job_history.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}/history'} # type: ignore + + async def get_triggered_web_job_history( + self, + resource_group_name: str, + name: str, + web_job_name: str, + id: str, + **kwargs: Any + ) -> "_models.TriggeredJobHistory": + """Gets a triggered web job's history by its ID for an app, , or a deployment slot. + + Description for Gets a triggered web job's history by its ID for an app, , or a deployment + slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param id: History ID. + :type id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TriggeredJobHistory, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.TriggeredJobHistory + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TriggeredJobHistory"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_triggered_web_job_history.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('TriggeredJobHistory', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_triggered_web_job_history.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}/history/{id}'} # type: ignore + + async def run_triggered_web_job( + self, + resource_group_name: str, + name: str, + web_job_name: str, + **kwargs: Any + ) -> None: + """Run a triggered web job for an app, or a deployment slot. + + Description for Run a triggered web job for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.run_triggered_web_job.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + run_triggered_web_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}/run'} # type: ignore + + def list_usages( + self, + resource_group_name: str, + name: str, + filter: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.CsmUsageQuotaCollection"]: + """Gets the quota usage information of an app (or deployment slot, if specified). + + Description for Gets the quota usage information of an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param filter: Return only information specified in the filter (using OData syntax). For + example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq + 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + duration'[Hour|Minute|Day]'. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CsmUsageQuotaCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.CsmUsageQuotaCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmUsageQuotaCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_usages.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('CsmUsageQuotaCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_usages.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/usages'} # type: ignore + + async def list_vnet_connections( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> List["_models.VnetInfoResource"]: + """Gets the virtual networks the app (or deployment slot) is connected to. + + Description for Gets the virtual networks the app (or deployment slot) is connected to. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of VnetInfoResource, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2021_02_01.models.VnetInfoResource] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VnetInfoResource"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_vnet_connections.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[VnetInfoResource]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_vnet_connections.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections'} # type: ignore + + async def get_vnet_connection( + self, + resource_group_name: str, + name: str, + vnet_name: str, + **kwargs: Any + ) -> "_models.VnetInfoResource": + """Gets a virtual network the app (or deployment slot) is connected to by name. + + Description for Gets a virtual network the app (or deployment slot) is connected to by name. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of the virtual network. + :type vnet_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetInfoResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.VnetInfoResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetInfoResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_vnet_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetInfoResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_vnet_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}'} # type: ignore + + async def create_or_update_vnet_connection( + self, + resource_group_name: str, + name: str, + vnet_name: str, + connection_envelope: "_models.VnetInfoResource", + **kwargs: Any + ) -> "_models.VnetInfoResource": + """Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). + + Description for Adds a Virtual Network connection to an app or slot (PUT) or updates the + connection properties (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of an existing Virtual Network. + :type vnet_name: str + :param connection_envelope: Properties of the Virtual Network connection. See example. + :type connection_envelope: ~azure.mgmt.web.v2021_02_01.models.VnetInfoResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetInfoResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.VnetInfoResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetInfoResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_vnet_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'VnetInfoResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetInfoResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_vnet_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}'} # type: ignore + + async def delete_vnet_connection( + self, + resource_group_name: str, + name: str, + vnet_name: str, + **kwargs: Any + ) -> None: + """Deletes a connection from an app (or deployment slot to a named virtual network. + + Description for Deletes a connection from an app (or deployment slot to a named virtual + network. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of the virtual network. + :type vnet_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_vnet_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_vnet_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}'} # type: ignore + + async def update_vnet_connection( + self, + resource_group_name: str, + name: str, + vnet_name: str, + connection_envelope: "_models.VnetInfoResource", + **kwargs: Any + ) -> "_models.VnetInfoResource": + """Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). + + Description for Adds a Virtual Network connection to an app or slot (PUT) or updates the + connection properties (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of an existing Virtual Network. + :type vnet_name: str + :param connection_envelope: Properties of the Virtual Network connection. See example. + :type connection_envelope: ~azure.mgmt.web.v2021_02_01.models.VnetInfoResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetInfoResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.VnetInfoResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetInfoResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_vnet_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'VnetInfoResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetInfoResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_vnet_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}'} # type: ignore + + async def get_vnet_connection_gateway( + self, + resource_group_name: str, + name: str, + vnet_name: str, + gateway_name: str, + **kwargs: Any + ) -> "_models.VnetGateway": + """Gets an app's Virtual Network gateway. + + Description for Gets an app's Virtual Network gateway. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param gateway_name: Name of the gateway. Currently, the only supported string is "primary". + :type gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetGateway, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.VnetGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_vnet_connection_gateway.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_vnet_connection_gateway.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'} # type: ignore + + async def create_or_update_vnet_connection_gateway( + self, + resource_group_name: str, + name: str, + vnet_name: str, + gateway_name: str, + connection_envelope: "_models.VnetGateway", + **kwargs: Any + ) -> "_models.VnetGateway": + """Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + + Description for Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param gateway_name: Name of the gateway. Currently, the only supported string is "primary". + :type gateway_name: str + :param connection_envelope: The properties to update this gateway with. + :type connection_envelope: ~azure.mgmt.web.v2021_02_01.models.VnetGateway + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetGateway, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.VnetGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_vnet_connection_gateway.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'VnetGateway') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_vnet_connection_gateway.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'} # type: ignore + + async def update_vnet_connection_gateway( + self, + resource_group_name: str, + name: str, + vnet_name: str, + gateway_name: str, + connection_envelope: "_models.VnetGateway", + **kwargs: Any + ) -> "_models.VnetGateway": + """Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + + Description for Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param gateway_name: Name of the gateway. Currently, the only supported string is "primary". + :type gateway_name: str + :param connection_envelope: The properties to update this gateway with. + :type connection_envelope: ~azure.mgmt.web.v2021_02_01.models.VnetGateway + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetGateway, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.VnetGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_vnet_connection_gateway.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'VnetGateway') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_vnet_connection_gateway.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'} # type: ignore + + def list_web_jobs( + self, + resource_group_name: str, + name: str, + **kwargs: Any + ) -> AsyncIterable["_models.WebJobCollection"]: + """List webjobs for an app, or a deployment slot. + + Description for List webjobs for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebJobCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.WebJobCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebJobCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_web_jobs.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WebJobCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_web_jobs.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/webjobs'} # type: ignore + + async def get_web_job( + self, + resource_group_name: str, + name: str, + web_job_name: str, + **kwargs: Any + ) -> "_models.WebJob": + """Get webjob information for an app, or a deployment slot. + + Description for Get webjob information for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of the web job. + :type web_job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WebJob, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.WebJob + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebJob"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_web_job.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('WebJob', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_web_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/webjobs/{webJobName}'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_web_site_management_client_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_web_site_management_client_operations.py new file mode 100644 index 000000000000..648808933c2a --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/aio/operations/_web_site_management_client_operations.py @@ -0,0 +1,1121 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class WebSiteManagementClientOperationsMixin: + + async def generate_github_access_token_for_appservice_cli_async( + self, + code: str, + state: str, + **kwargs: Any + ) -> "_models.AppserviceGithubToken": + """Exchange code for GitHub access token for AppService CLI. + + Description for Exchange code for GitHub access token for AppService CLI. + + :param code: Code string to exchange for Github Access token. + :type code: str + :param state: State string used for verification. + :type state: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AppserviceGithubToken, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.AppserviceGithubToken + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppserviceGithubToken"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + _request = _models.AppserviceGithubTokenRequest(code=code, state=state) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.generate_github_access_token_for_appservice_cli_async.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_request, 'AppserviceGithubTokenRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AppserviceGithubToken', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + generate_github_access_token_for_appservice_cli_async.metadata = {'url': '/providers/Microsoft.Web/generateGithubAccessTokenForAppserviceCLI'} # type: ignore + + async def get_publishing_user( + self, + **kwargs: Any + ) -> "_models.User": + """Gets publishing user. + + Description for Gets publishing user. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: User, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.User + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_publishing_user.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_publishing_user.metadata = {'url': '/providers/Microsoft.Web/publishingUsers/web'} # type: ignore + + async def update_publishing_user( + self, + user_details: "_models.User", + **kwargs: Any + ) -> "_models.User": + """Updates publishing user. + + Description for Updates publishing user. + + :param user_details: Details of publishing user. + :type user_details: ~azure.mgmt.web.v2021_02_01.models.User + :keyword callable cls: A custom type or function that will be passed the direct response + :return: User, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.User + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_publishing_user.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(user_details, 'User') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_publishing_user.metadata = {'url': '/providers/Microsoft.Web/publishingUsers/web'} # type: ignore + + def list_source_controls( + self, + **kwargs: Any + ) -> AsyncIterable["_models.SourceControlCollection"]: + """Gets the source controls available for Azure websites. + + Description for Gets the source controls available for Azure websites. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SourceControlCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.SourceControlCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_source_controls.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SourceControlCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_source_controls.metadata = {'url': '/providers/Microsoft.Web/sourcecontrols'} # type: ignore + + async def get_source_control( + self, + source_control_type: str, + **kwargs: Any + ) -> "_models.SourceControl": + """Gets source control token. + + Description for Gets source control token. + + :param source_control_type: Type of source control. + :type source_control_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SourceControl, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SourceControl + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControl"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_source_control.metadata['url'] # type: ignore + path_format_arguments = { + 'sourceControlType': self._serialize.url("source_control_type", source_control_type, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_source_control.metadata = {'url': '/providers/Microsoft.Web/sourcecontrols/{sourceControlType}'} # type: ignore + + async def update_source_control( + self, + source_control_type: str, + request_message: "_models.SourceControl", + **kwargs: Any + ) -> "_models.SourceControl": + """Updates source control token. + + Description for Updates source control token. + + :param source_control_type: Type of source control. + :type source_control_type: str + :param request_message: Source control token information. + :type request_message: ~azure.mgmt.web.v2021_02_01.models.SourceControl + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SourceControl, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SourceControl + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControl"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_source_control.metadata['url'] # type: ignore + path_format_arguments = { + 'sourceControlType': self._serialize.url("source_control_type", source_control_type, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request_message, 'SourceControl') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_source_control.metadata = {'url': '/providers/Microsoft.Web/sourcecontrols/{sourceControlType}'} # type: ignore + + def list_billing_meters( + self, + billing_location: Optional[str] = None, + os_type: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.BillingMeterCollection"]: + """Gets a list of meters for a given location. + + Description for Gets a list of meters for a given location. + + :param billing_location: Azure Location of billable resource. + :type billing_location: str + :param os_type: App Service OS type meters used for. + :type os_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either BillingMeterCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.BillingMeterCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BillingMeterCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_billing_meters.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if billing_location is not None: + query_parameters['billingLocation'] = self._serialize.query("billing_location", billing_location, 'str') + if os_type is not None: + query_parameters['osType'] = self._serialize.query("os_type", os_type, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('BillingMeterCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_billing_meters.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/billingMeters'} # type: ignore + + async def check_name_availability( + self, + name: str, + type: Union[str, "_models.CheckNameResourceTypes"], + is_fqdn: Optional[bool] = None, + **kwargs: Any + ) -> "_models.ResourceNameAvailability": + """Check if a resource name is available. + + Description for Check if a resource name is available. + + :param name: Resource name to verify. + :type name: str + :param type: Resource type used for verification. + :type type: str or ~azure.mgmt.web.v2021_02_01.models.CheckNameResourceTypes + :param is_fqdn: Is fully qualified domain name. + :type is_fqdn: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ResourceNameAvailability, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.ResourceNameAvailability + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceNameAvailability"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + _request = _models.ResourceNameAvailabilityRequest(name=name, type=type, is_fqdn=is_fqdn) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.check_name_availability.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_request, 'ResourceNameAvailabilityRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ResourceNameAvailability', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/checknameavailability'} # type: ignore + + async def get_subscription_deployment_locations( + self, + **kwargs: Any + ) -> "_models.DeploymentLocations": + """Gets list of available geo regions plus ministamps. + + Description for Gets list of available geo regions plus ministamps. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DeploymentLocations, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.DeploymentLocations + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DeploymentLocations"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_subscription_deployment_locations.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DeploymentLocations', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_subscription_deployment_locations.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/deploymentLocations'} # type: ignore + + def list_geo_regions( + self, + sku: Optional[Union[str, "_models.SkuName"]] = None, + linux_workers_enabled: Optional[bool] = None, + xenon_workers_enabled: Optional[bool] = None, + linux_dynamic_workers_enabled: Optional[bool] = None, + **kwargs: Any + ) -> AsyncIterable["_models.GeoRegionCollection"]: + """Get a list of available geographical regions. + + Description for Get a list of available geographical regions. + + :param sku: Name of SKU used to filter the regions. + :type sku: str or ~azure.mgmt.web.v2021_02_01.models.SkuName + :param linux_workers_enabled: Specify :code:`true` if you want to filter to only + regions that support Linux workers. + :type linux_workers_enabled: bool + :param xenon_workers_enabled: Specify :code:`true` if you want to filter to only + regions that support Xenon workers. + :type xenon_workers_enabled: bool + :param linux_dynamic_workers_enabled: Specify :code:`true` if you want to filter + to only regions that support Linux Consumption Workers. + :type linux_dynamic_workers_enabled: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either GeoRegionCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.GeoRegionCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GeoRegionCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_geo_regions.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if sku is not None: + query_parameters['sku'] = self._serialize.query("sku", sku, 'str') + if linux_workers_enabled is not None: + query_parameters['linuxWorkersEnabled'] = self._serialize.query("linux_workers_enabled", linux_workers_enabled, 'bool') + if xenon_workers_enabled is not None: + query_parameters['xenonWorkersEnabled'] = self._serialize.query("xenon_workers_enabled", xenon_workers_enabled, 'bool') + if linux_dynamic_workers_enabled is not None: + query_parameters['linuxDynamicWorkersEnabled'] = self._serialize.query("linux_dynamic_workers_enabled", linux_dynamic_workers_enabled, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('GeoRegionCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_geo_regions.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/geoRegions'} # type: ignore + + def list_site_identifiers_assigned_to_host_name( + self, + name_identifier: "_models.NameIdentifier", + **kwargs: Any + ) -> AsyncIterable["_models.IdentifierCollection"]: + """List all apps that are assigned to a hostname. + + Description for List all apps that are assigned to a hostname. + + :param name_identifier: Hostname information. + :type name_identifier: ~azure.mgmt.web.v2021_02_01.models.NameIdentifier + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either IdentifierCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.IdentifierCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.IdentifierCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = "application/json" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_identifiers_assigned_to_host_name.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(name_identifier, 'NameIdentifier') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(name_identifier, 'NameIdentifier') + body_content_kwargs['content'] = body_content + request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('IdentifierCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_site_identifiers_assigned_to_host_name.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/listSitesAssignedToHostName'} # type: ignore + + def list_premier_add_on_offers( + self, + **kwargs: Any + ) -> AsyncIterable["_models.PremierAddOnOfferCollection"]: + """List all premier add-on offers. + + Description for List all premier add-on offers. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PremierAddOnOfferCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2021_02_01.models.PremierAddOnOfferCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PremierAddOnOfferCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_premier_add_on_offers.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('PremierAddOnOfferCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_premier_add_on_offers.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/premieraddonoffers'} # type: ignore + + async def list_skus( + self, + **kwargs: Any + ) -> "_models.SkuInfos": + """List all SKUs. + + Description for List all SKUs. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SkuInfos, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SkuInfos + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuInfos"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_skus.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SkuInfos', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_skus.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/skus'} # type: ignore + + async def verify_hosting_environment_vnet( + self, + parameters: "_models.VnetParameters", + **kwargs: Any + ) -> "_models.VnetValidationFailureDetails": + """Verifies if this VNET is compatible with an App Service Environment by analyzing the Network Security Group rules. + + Description for Verifies if this VNET is compatible with an App Service Environment by + analyzing the Network Security Group rules. + + :param parameters: VNET information. + :type parameters: ~azure.mgmt.web.v2021_02_01.models.VnetParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetValidationFailureDetails, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.VnetValidationFailureDetails + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetValidationFailureDetails"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.verify_hosting_environment_vnet.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'VnetParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetValidationFailureDetails', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + verify_hosting_environment_vnet.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/verifyHostingEnvironmentVnet'} # type: ignore + + async def move( + self, + resource_group_name: str, + move_resource_envelope: "_models.CsmMoveResourceEnvelope", + **kwargs: Any + ) -> None: + """Move resources between resource groups. + + Description for Move resources between resource groups. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param move_resource_envelope: Object that represents the resource to move. + :type move_resource_envelope: ~azure.mgmt.web.v2021_02_01.models.CsmMoveResourceEnvelope + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.move.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(move_resource_envelope, 'CsmMoveResourceEnvelope') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + move.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/moveResources'} # type: ignore + + async def validate( + self, + resource_group_name: str, + validate_request: "_models.ValidateRequest", + **kwargs: Any + ) -> "_models.ValidateResponse": + """Validate if a resource can be created. + + Description for Validate if a resource can be created. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param validate_request: Request with the resources to validate. + :type validate_request: ~azure.mgmt.web.v2021_02_01.models.ValidateRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ValidateResponse, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.ValidateResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidateResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.validate.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(validate_request, 'ValidateRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ValidateResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + validate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/validate'} # type: ignore + + async def validate_move( + self, + resource_group_name: str, + move_resource_envelope: "_models.CsmMoveResourceEnvelope", + **kwargs: Any + ) -> None: + """Validate whether a resource can be moved. + + Description for Validate whether a resource can be moved. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param move_resource_envelope: Object that represents the resource to move. + :type move_resource_envelope: ~azure.mgmt.web.v2021_02_01.models.CsmMoveResourceEnvelope + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.validate_move.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(move_resource_envelope, 'CsmMoveResourceEnvelope') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + validate_move.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/validateMoveResources'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/models/__init__.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/models/__init__.py new file mode 100644 index 000000000000..d65b6c7dd7af --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/models/__init__.py @@ -0,0 +1,1403 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import AbnormalTimePeriod + from ._models_py3 import Address + from ._models_py3 import AddressResponse + from ._models_py3 import AllowedAudiencesValidation + from ._models_py3 import AllowedPrincipals + from ._models_py3 import AnalysisData + from ._models_py3 import AnalysisDefinition + from ._models_py3 import ApiDefinitionInfo + from ._models_py3 import ApiKVReference + from ._models_py3 import ApiKVReferenceCollection + from ._models_py3 import ApiManagementConfig + from ._models_py3 import AppInsightsWebAppStackSettings + from ._models_py3 import AppLogsConfiguration + from ._models_py3 import AppRegistration + from ._models_py3 import AppServiceCertificate + from ._models_py3 import AppServiceCertificateCollection + from ._models_py3 import AppServiceCertificateOrder + from ._models_py3 import AppServiceCertificateOrderCollection + from ._models_py3 import AppServiceCertificateOrderPatchResource + from ._models_py3 import AppServiceCertificatePatchResource + from ._models_py3 import AppServiceCertificateResource + from ._models_py3 import AppServiceEnvironment + from ._models_py3 import AppServiceEnvironmentCollection + from ._models_py3 import AppServiceEnvironmentPatchResource + from ._models_py3 import AppServiceEnvironmentResource + from ._models_py3 import AppServicePlan + from ._models_py3 import AppServicePlanCollection + from ._models_py3 import AppServicePlanPatchResource + from ._models_py3 import Apple + from ._models_py3 import AppleRegistration + from ._models_py3 import ApplicationLogsConfig + from ._models_py3 import ApplicationStack + from ._models_py3 import ApplicationStackCollection + from ._models_py3 import ApplicationStackResource + from ._models_py3 import AppserviceGithubToken + from ._models_py3 import AppserviceGithubTokenRequest + from ._models_py3 import ArcConfiguration + from ._models_py3 import ArmIdWrapper + from ._models_py3 import ArmPlan + from ._models_py3 import AseV3NetworkingConfiguration + from ._models_py3 import AuthPlatform + from ._models_py3 import AutoHealActions + from ._models_py3 import AutoHealCustomAction + from ._models_py3 import AutoHealRules + from ._models_py3 import AutoHealTriggers + from ._models_py3 import AzureActiveDirectory + from ._models_py3 import AzureActiveDirectoryLogin + from ._models_py3 import AzureActiveDirectoryRegistration + from ._models_py3 import AzureActiveDirectoryValidation + from ._models_py3 import AzureBlobStorageApplicationLogsConfig + from ._models_py3 import AzureBlobStorageHttpLogsConfig + from ._models_py3 import AzureStaticWebApps + from ._models_py3 import AzureStaticWebAppsRegistration + from ._models_py3 import AzureStorageInfoValue + from ._models_py3 import AzureStoragePropertyDictionaryResource + from ._models_py3 import AzureTableStorageApplicationLogsConfig + from ._models_py3 import BackupItem + from ._models_py3 import BackupItemCollection + from ._models_py3 import BackupRequest + from ._models_py3 import BackupSchedule + from ._models_py3 import BillingMeter + from ._models_py3 import BillingMeterCollection + from ._models_py3 import BlobStorageTokenStore + from ._models_py3 import Capability + from ._models_py3 import Certificate + from ._models_py3 import CertificateCollection + from ._models_py3 import CertificateDetails + from ._models_py3 import CertificateEmail + from ._models_py3 import CertificateOrderAction + from ._models_py3 import CertificateOrderContact + from ._models_py3 import CertificatePatchResource + from ._models_py3 import ClientRegistration + from ._models_py3 import CloningInfo + from ._models_py3 import ConnStringInfo + from ._models_py3 import ConnStringValueTypePair + from ._models_py3 import ConnectionStringDictionary + from ._models_py3 import Contact + from ._models_py3 import ContainerCpuStatistics + from ._models_py3 import ContainerCpuUsage + from ._models_py3 import ContainerInfo + from ._models_py3 import ContainerMemoryStatistics + from ._models_py3 import ContainerNetworkInterfaceStatistics + from ._models_py3 import ContainerThrottlingData + from ._models_py3 import ContinuousWebJob + from ._models_py3 import ContinuousWebJobCollection + from ._models_py3 import CookieExpiration + from ._models_py3 import CorsSettings + from ._models_py3 import CsmMoveResourceEnvelope + from ._models_py3 import CsmOperationCollection + from ._models_py3 import CsmOperationDescription + from ._models_py3 import CsmOperationDescriptionProperties + from ._models_py3 import CsmOperationDisplay + from ._models_py3 import CsmPublishingCredentialsPoliciesEntity + from ._models_py3 import CsmPublishingProfileOptions + from ._models_py3 import CsmSlotEntity + from ._models_py3 import CsmUsageQuota + from ._models_py3 import CsmUsageQuotaCollection + from ._models_py3 import CustomHostnameAnalysisResult + from ._models_py3 import CustomOpenIdConnectProvider + from ._models_py3 import DataProviderMetadata + from ._models_py3 import DataSource + from ._models_py3 import DataTableResponseColumn + from ._models_py3 import DataTableResponseObject + from ._models_py3 import DatabaseBackupSetting + from ._models_py3 import DefaultAuthorizationPolicy + from ._models_py3 import DefaultErrorResponse + from ._models_py3 import DefaultErrorResponseError + from ._models_py3 import DefaultErrorResponseErrorDetailsItem + from ._models_py3 import DeletedAppRestoreRequest + from ._models_py3 import DeletedSite + from ._models_py3 import DeletedWebAppCollection + from ._models_py3 import Deployment + from ._models_py3 import DeploymentCollection + from ._models_py3 import DeploymentLocations + from ._models_py3 import DetectorAbnormalTimePeriod + from ._models_py3 import DetectorDefinition + from ._models_py3 import DetectorDefinitionResource + from ._models_py3 import DetectorInfo + from ._models_py3 import DetectorResponse + from ._models_py3 import DetectorResponseCollection + from ._models_py3 import DiagnosticAnalysis + from ._models_py3 import DiagnosticAnalysisCollection + from ._models_py3 import DiagnosticCategory + from ._models_py3 import DiagnosticCategoryCollection + from ._models_py3 import DiagnosticData + from ._models_py3 import DiagnosticDetectorCollection + from ._models_py3 import DiagnosticDetectorResponse + from ._models_py3 import DiagnosticMetricSample + from ._models_py3 import DiagnosticMetricSet + from ._models_py3 import Dimension + from ._models_py3 import Domain + from ._models_py3 import DomainAvailabilityCheckResult + from ._models_py3 import DomainCollection + from ._models_py3 import DomainControlCenterSsoRequest + from ._models_py3 import DomainOwnershipIdentifier + from ._models_py3 import DomainOwnershipIdentifierCollection + from ._models_py3 import DomainPatchResource + from ._models_py3 import DomainPurchaseConsent + from ._models_py3 import DomainRecommendationSearchParameters + from ._models_py3 import EnabledConfig + from ._models_py3 import EndpointDependency + from ._models_py3 import EndpointDetail + from ._models_py3 import ErrorEntity + from ._models_py3 import Experiments + from ._models_py3 import ExtendedLocation + from ._models_py3 import Facebook + from ._models_py3 import FileSystemApplicationLogsConfig + from ._models_py3 import FileSystemHttpLogsConfig + from ._models_py3 import FileSystemTokenStore + from ._models_py3 import ForwardProxy + from ._models_py3 import FrontEndConfiguration + from ._models_py3 import FunctionAppMajorVersion + from ._models_py3 import FunctionAppMinorVersion + from ._models_py3 import FunctionAppRuntimeSettings + from ._models_py3 import FunctionAppRuntimes + from ._models_py3 import FunctionAppStack + from ._models_py3 import FunctionAppStackCollection + from ._models_py3 import FunctionEnvelope + from ._models_py3 import FunctionEnvelopeCollection + from ._models_py3 import FunctionSecrets + from ._models_py3 import GeoRegion + from ._models_py3 import GeoRegionCollection + from ._models_py3 import GitHub + from ._models_py3 import GitHubActionCodeConfiguration + from ._models_py3 import GitHubActionConfiguration + from ._models_py3 import GitHubActionContainerConfiguration + from ._models_py3 import GitHubActionWebAppStackSettings + from ._models_py3 import GlobalCsmSkuDescription + from ._models_py3 import GlobalValidation + from ._models_py3 import Google + from ._models_py3 import HandlerMapping + from ._models_py3 import HostKeys + from ._models_py3 import HostName + from ._models_py3 import HostNameBinding + from ._models_py3 import HostNameBindingCollection + from ._models_py3 import HostNameSslState + from ._models_py3 import HostingEnvironmentDeploymentInfo + from ._models_py3 import HostingEnvironmentDiagnostics + from ._models_py3 import HostingEnvironmentProfile + from ._models_py3 import HttpLogsConfig + from ._models_py3 import HttpSettings + from ._models_py3 import HttpSettingsRoutes + from ._models_py3 import HybridConnection + from ._models_py3 import HybridConnectionCollection + from ._models_py3 import HybridConnectionKey + from ._models_py3 import HybridConnectionLimits + from ._models_py3 import Identifier + from ._models_py3 import IdentifierCollection + from ._models_py3 import IdentityProviders + from ._models_py3 import InboundEnvironmentEndpoint + from ._models_py3 import InboundEnvironmentEndpointCollection + from ._models_py3 import IpSecurityRestriction + from ._models_py3 import JwtClaimChecks + from ._models_py3 import KeyInfo + from ._models_py3 import KeyValuePairStringObject + from ._models_py3 import KubeEnvironment + from ._models_py3 import KubeEnvironmentCollection + from ._models_py3 import KubeEnvironmentPatchResource + from ._models_py3 import KubeEnvironmentProfile + from ._models_py3 import LegacyMicrosoftAccount + from ._models_py3 import LinuxJavaContainerSettings + from ._models_py3 import LocalizableString + from ._models_py3 import LogAnalyticsConfiguration + from ._models_py3 import LogSpecification + from ._models_py3 import Login + from ._models_py3 import LoginRoutes + from ._models_py3 import LoginScopes + from ._models_py3 import MSDeploy + from ._models_py3 import MSDeployLog + from ._models_py3 import MSDeployLogEntry + from ._models_py3 import MSDeployStatus + from ._models_py3 import ManagedServiceIdentity + from ._models_py3 import MetricAvailability + from ._models_py3 import MetricSpecification + from ._models_py3 import MigrateMySqlRequest + from ._models_py3 import MigrateMySqlStatus + from ._models_py3 import NameIdentifier + from ._models_py3 import NameIdentifierCollection + from ._models_py3 import NameValuePair + from ._models_py3 import NetworkFeatures + from ._models_py3 import NetworkTrace + from ._models_py3 import Nonce + from ._models_py3 import OpenIdConnectClientCredential + from ._models_py3 import OpenIdConnectConfig + from ._models_py3 import OpenIdConnectLogin + from ._models_py3 import OpenIdConnectRegistration + from ._models_py3 import Operation + from ._models_py3 import OutboundEnvironmentEndpoint + from ._models_py3 import OutboundEnvironmentEndpointCollection + from ._models_py3 import PerfMonCounterCollection + from ._models_py3 import PerfMonResponse + from ._models_py3 import PerfMonSample + from ._models_py3 import PerfMonSet + from ._models_py3 import PremierAddOn + from ._models_py3 import PremierAddOnOffer + from ._models_py3 import PremierAddOnOfferCollection + from ._models_py3 import PremierAddOnPatchResource + from ._models_py3 import PrivateAccess + from ._models_py3 import PrivateAccessSubnet + from ._models_py3 import PrivateAccessVirtualNetwork + from ._models_py3 import PrivateEndpointConnectionCollection + from ._models_py3 import PrivateLinkConnectionApprovalRequestResource + from ._models_py3 import PrivateLinkConnectionState + from ._models_py3 import PrivateLinkResource + from ._models_py3 import PrivateLinkResourceProperties + from ._models_py3 import PrivateLinkResourcesWrapper + from ._models_py3 import ProcessInfo + from ._models_py3 import ProcessInfoCollection + from ._models_py3 import ProcessModuleInfo + from ._models_py3 import ProcessModuleInfoCollection + from ._models_py3 import ProcessThreadInfo + from ._models_py3 import ProcessThreadInfoCollection + from ._models_py3 import ProxyOnlyResource + from ._models_py3 import PublicCertificate + from ._models_py3 import PublicCertificateCollection + from ._models_py3 import PublishingCredentialsPoliciesCollection + from ._models_py3 import PushSettings + from ._models_py3 import QueryUtterancesResult + from ._models_py3 import QueryUtterancesResults + from ._models_py3 import RampUpRule + from ._models_py3 import Recommendation + from ._models_py3 import RecommendationCollection + from ._models_py3 import RecommendationRule + from ._models_py3 import ReissueCertificateOrderRequest + from ._models_py3 import RelayServiceConnectionEntity + from ._models_py3 import RemotePrivateEndpointConnection + from ._models_py3 import RemotePrivateEndpointConnectionARMResource + from ._models_py3 import Rendering + from ._models_py3 import RenewCertificateOrderRequest + from ._models_py3 import RequestsBasedTrigger + from ._models_py3 import Resource + from ._models_py3 import ResourceCollection + from ._models_py3 import ResourceHealthMetadata + from ._models_py3 import ResourceHealthMetadataCollection + from ._models_py3 import ResourceMetricAvailability + from ._models_py3 import ResourceMetricDefinition + from ._models_py3 import ResourceMetricDefinitionCollection + from ._models_py3 import ResourceNameAvailability + from ._models_py3 import ResourceNameAvailabilityRequest + from ._models_py3 import ResponseMessageEnvelopeRemotePrivateEndpointConnection + from ._models_py3 import ResponseMetaData + from ._models_py3 import RestoreRequest + from ._models_py3 import SampleUtterance + from ._models_py3 import ServiceSpecification + from ._models_py3 import Site + from ._models_py3 import SiteAuthSettings + from ._models_py3 import SiteAuthSettingsV2 + from ._models_py3 import SiteCloneability + from ._models_py3 import SiteCloneabilityCriterion + from ._models_py3 import SiteConfig + from ._models_py3 import SiteConfigPropertiesDictionary + from ._models_py3 import SiteConfigResource + from ._models_py3 import SiteConfigResourceCollection + from ._models_py3 import SiteConfigurationSnapshotInfo + from ._models_py3 import SiteConfigurationSnapshotInfoCollection + from ._models_py3 import SiteExtensionInfo + from ._models_py3 import SiteExtensionInfoCollection + from ._models_py3 import SiteLimits + from ._models_py3 import SiteLogsConfig + from ._models_py3 import SiteMachineKey + from ._models_py3 import SitePatchResource + from ._models_py3 import SitePhpErrorLogFlag + from ._models_py3 import SiteSeal + from ._models_py3 import SiteSealRequest + from ._models_py3 import SiteSourceControl + from ._models_py3 import SkuCapacity + from ._models_py3 import SkuDescription + from ._models_py3 import SkuInfo + from ._models_py3 import SkuInfoCollection + from ._models_py3 import SkuInfos + from ._models_py3 import SlotConfigNamesResource + from ._models_py3 import SlotDifference + from ._models_py3 import SlotDifferenceCollection + from ._models_py3 import SlotSwapStatus + from ._models_py3 import SlowRequestsBasedTrigger + from ._models_py3 import Snapshot + from ._models_py3 import SnapshotCollection + from ._models_py3 import SnapshotRecoverySource + from ._models_py3 import SnapshotRestoreRequest + from ._models_py3 import Solution + from ._models_py3 import SourceControl + from ._models_py3 import SourceControlCollection + from ._models_py3 import StackMajorVersion + from ._models_py3 import StackMinorVersion + from ._models_py3 import StampCapacity + from ._models_py3 import StampCapacityCollection + from ._models_py3 import StaticSiteARMResource + from ._models_py3 import StaticSiteBuildARMResource + from ._models_py3 import StaticSiteBuildCollection + from ._models_py3 import StaticSiteBuildProperties + from ._models_py3 import StaticSiteCollection + from ._models_py3 import StaticSiteCustomDomainOverviewARMResource + from ._models_py3 import StaticSiteCustomDomainOverviewCollection + from ._models_py3 import StaticSiteCustomDomainRequestPropertiesARMResource + from ._models_py3 import StaticSiteFunctionOverviewARMResource + from ._models_py3 import StaticSiteFunctionOverviewCollection + from ._models_py3 import StaticSitePatchResource + from ._models_py3 import StaticSiteResetPropertiesARMResource + from ._models_py3 import StaticSiteTemplateOptions + from ._models_py3 import StaticSiteUserARMResource + from ._models_py3 import StaticSiteUserCollection + from ._models_py3 import StaticSiteUserInvitationRequestResource + from ._models_py3 import StaticSiteUserInvitationResponseResource + from ._models_py3 import StaticSiteUserProvidedFunctionApp + from ._models_py3 import StaticSiteUserProvidedFunctionAppARMResource + from ._models_py3 import StaticSiteUserProvidedFunctionAppsCollection + from ._models_py3 import StaticSiteZipDeploymentARMResource + from ._models_py3 import StaticSitesWorkflowPreview + from ._models_py3 import StaticSitesWorkflowPreviewRequest + from ._models_py3 import Status + from ._models_py3 import StatusCodesBasedTrigger + from ._models_py3 import StatusCodesRangeBasedTrigger + from ._models_py3 import StorageMigrationOptions + from ._models_py3 import StorageMigrationResponse + from ._models_py3 import StringDictionary + from ._models_py3 import StringList + from ._models_py3 import SupportTopic + from ._models_py3 import SwiftVirtualNetwork + from ._models_py3 import TldLegalAgreement + from ._models_py3 import TldLegalAgreementCollection + from ._models_py3 import TokenStore + from ._models_py3 import TopLevelDomain + from ._models_py3 import TopLevelDomainAgreementOption + from ._models_py3 import TopLevelDomainCollection + from ._models_py3 import TriggeredJobHistory + from ._models_py3 import TriggeredJobHistoryCollection + from ._models_py3 import TriggeredJobRun + from ._models_py3 import TriggeredWebJob + from ._models_py3 import TriggeredWebJobCollection + from ._models_py3 import Twitter + from ._models_py3 import TwitterRegistration + from ._models_py3 import Usage + from ._models_py3 import UsageCollection + from ._models_py3 import User + from ._models_py3 import UserAssignedIdentity + from ._models_py3 import ValidateRequest + from ._models_py3 import ValidateResponse + from ._models_py3 import ValidateResponseError + from ._models_py3 import VirtualApplication + from ._models_py3 import VirtualDirectory + from ._models_py3 import VirtualIPMapping + from ._models_py3 import VirtualNetworkProfile + from ._models_py3 import VnetGateway + from ._models_py3 import VnetInfo + from ._models_py3 import VnetInfoResource + from ._models_py3 import VnetParameters + from ._models_py3 import VnetRoute + from ._models_py3 import VnetValidationFailureDetails + from ._models_py3 import VnetValidationTestFailure + from ._models_py3 import WebAppCollection + from ._models_py3 import WebAppInstanceStatusCollection + from ._models_py3 import WebAppMajorVersion + from ._models_py3 import WebAppMinorVersion + from ._models_py3 import WebAppRuntimeSettings + from ._models_py3 import WebAppRuntimes + from ._models_py3 import WebAppStack + from ._models_py3 import WebAppStackCollection + from ._models_py3 import WebJob + from ._models_py3 import WebJobCollection + from ._models_py3 import WebSiteInstanceStatus + from ._models_py3 import WindowsJavaContainerSettings + from ._models_py3 import WorkerPoolCollection + from ._models_py3 import WorkerPoolResource +except (SyntaxError, ImportError): + from ._models import AbnormalTimePeriod # type: ignore + from ._models import Address # type: ignore + from ._models import AddressResponse # type: ignore + from ._models import AllowedAudiencesValidation # type: ignore + from ._models import AllowedPrincipals # type: ignore + from ._models import AnalysisData # type: ignore + from ._models import AnalysisDefinition # type: ignore + from ._models import ApiDefinitionInfo # type: ignore + from ._models import ApiKVReference # type: ignore + from ._models import ApiKVReferenceCollection # type: ignore + from ._models import ApiManagementConfig # type: ignore + from ._models import AppInsightsWebAppStackSettings # type: ignore + from ._models import AppLogsConfiguration # type: ignore + from ._models import AppRegistration # type: ignore + from ._models import AppServiceCertificate # type: ignore + from ._models import AppServiceCertificateCollection # type: ignore + from ._models import AppServiceCertificateOrder # type: ignore + from ._models import AppServiceCertificateOrderCollection # type: ignore + from ._models import AppServiceCertificateOrderPatchResource # type: ignore + from ._models import AppServiceCertificatePatchResource # type: ignore + from ._models import AppServiceCertificateResource # type: ignore + from ._models import AppServiceEnvironment # type: ignore + from ._models import AppServiceEnvironmentCollection # type: ignore + from ._models import AppServiceEnvironmentPatchResource # type: ignore + from ._models import AppServiceEnvironmentResource # type: ignore + from ._models import AppServicePlan # type: ignore + from ._models import AppServicePlanCollection # type: ignore + from ._models import AppServicePlanPatchResource # type: ignore + from ._models import Apple # type: ignore + from ._models import AppleRegistration # type: ignore + from ._models import ApplicationLogsConfig # type: ignore + from ._models import ApplicationStack # type: ignore + from ._models import ApplicationStackCollection # type: ignore + from ._models import ApplicationStackResource # type: ignore + from ._models import AppserviceGithubToken # type: ignore + from ._models import AppserviceGithubTokenRequest # type: ignore + from ._models import ArcConfiguration # type: ignore + from ._models import ArmIdWrapper # type: ignore + from ._models import ArmPlan # type: ignore + from ._models import AseV3NetworkingConfiguration # type: ignore + from ._models import AuthPlatform # type: ignore + from ._models import AutoHealActions # type: ignore + from ._models import AutoHealCustomAction # type: ignore + from ._models import AutoHealRules # type: ignore + from ._models import AutoHealTriggers # type: ignore + from ._models import AzureActiveDirectory # type: ignore + from ._models import AzureActiveDirectoryLogin # type: ignore + from ._models import AzureActiveDirectoryRegistration # type: ignore + from ._models import AzureActiveDirectoryValidation # type: ignore + from ._models import AzureBlobStorageApplicationLogsConfig # type: ignore + from ._models import AzureBlobStorageHttpLogsConfig # type: ignore + from ._models import AzureStaticWebApps # type: ignore + from ._models import AzureStaticWebAppsRegistration # type: ignore + from ._models import AzureStorageInfoValue # type: ignore + from ._models import AzureStoragePropertyDictionaryResource # type: ignore + from ._models import AzureTableStorageApplicationLogsConfig # type: ignore + from ._models import BackupItem # type: ignore + from ._models import BackupItemCollection # type: ignore + from ._models import BackupRequest # type: ignore + from ._models import BackupSchedule # type: ignore + from ._models import BillingMeter # type: ignore + from ._models import BillingMeterCollection # type: ignore + from ._models import BlobStorageTokenStore # type: ignore + from ._models import Capability # type: ignore + from ._models import Certificate # type: ignore + from ._models import CertificateCollection # type: ignore + from ._models import CertificateDetails # type: ignore + from ._models import CertificateEmail # type: ignore + from ._models import CertificateOrderAction # type: ignore + from ._models import CertificateOrderContact # type: ignore + from ._models import CertificatePatchResource # type: ignore + from ._models import ClientRegistration # type: ignore + from ._models import CloningInfo # type: ignore + from ._models import ConnStringInfo # type: ignore + from ._models import ConnStringValueTypePair # type: ignore + from ._models import ConnectionStringDictionary # type: ignore + from ._models import Contact # type: ignore + from ._models import ContainerCpuStatistics # type: ignore + from ._models import ContainerCpuUsage # type: ignore + from ._models import ContainerInfo # type: ignore + from ._models import ContainerMemoryStatistics # type: ignore + from ._models import ContainerNetworkInterfaceStatistics # type: ignore + from ._models import ContainerThrottlingData # type: ignore + from ._models import ContinuousWebJob # type: ignore + from ._models import ContinuousWebJobCollection # type: ignore + from ._models import CookieExpiration # type: ignore + from ._models import CorsSettings # type: ignore + from ._models import CsmMoveResourceEnvelope # type: ignore + from ._models import CsmOperationCollection # type: ignore + from ._models import CsmOperationDescription # type: ignore + from ._models import CsmOperationDescriptionProperties # type: ignore + from ._models import CsmOperationDisplay # type: ignore + from ._models import CsmPublishingCredentialsPoliciesEntity # type: ignore + from ._models import CsmPublishingProfileOptions # type: ignore + from ._models import CsmSlotEntity # type: ignore + from ._models import CsmUsageQuota # type: ignore + from ._models import CsmUsageQuotaCollection # type: ignore + from ._models import CustomHostnameAnalysisResult # type: ignore + from ._models import CustomOpenIdConnectProvider # type: ignore + from ._models import DataProviderMetadata # type: ignore + from ._models import DataSource # type: ignore + from ._models import DataTableResponseColumn # type: ignore + from ._models import DataTableResponseObject # type: ignore + from ._models import DatabaseBackupSetting # type: ignore + from ._models import DefaultAuthorizationPolicy # type: ignore + from ._models import DefaultErrorResponse # type: ignore + from ._models import DefaultErrorResponseError # type: ignore + from ._models import DefaultErrorResponseErrorDetailsItem # type: ignore + from ._models import DeletedAppRestoreRequest # type: ignore + from ._models import DeletedSite # type: ignore + from ._models import DeletedWebAppCollection # type: ignore + from ._models import Deployment # type: ignore + from ._models import DeploymentCollection # type: ignore + from ._models import DeploymentLocations # type: ignore + from ._models import DetectorAbnormalTimePeriod # type: ignore + from ._models import DetectorDefinition # type: ignore + from ._models import DetectorDefinitionResource # type: ignore + from ._models import DetectorInfo # type: ignore + from ._models import DetectorResponse # type: ignore + from ._models import DetectorResponseCollection # type: ignore + from ._models import DiagnosticAnalysis # type: ignore + from ._models import DiagnosticAnalysisCollection # type: ignore + from ._models import DiagnosticCategory # type: ignore + from ._models import DiagnosticCategoryCollection # type: ignore + from ._models import DiagnosticData # type: ignore + from ._models import DiagnosticDetectorCollection # type: ignore + from ._models import DiagnosticDetectorResponse # type: ignore + from ._models import DiagnosticMetricSample # type: ignore + from ._models import DiagnosticMetricSet # type: ignore + from ._models import Dimension # type: ignore + from ._models import Domain # type: ignore + from ._models import DomainAvailabilityCheckResult # type: ignore + from ._models import DomainCollection # type: ignore + from ._models import DomainControlCenterSsoRequest # type: ignore + from ._models import DomainOwnershipIdentifier # type: ignore + from ._models import DomainOwnershipIdentifierCollection # type: ignore + from ._models import DomainPatchResource # type: ignore + from ._models import DomainPurchaseConsent # type: ignore + from ._models import DomainRecommendationSearchParameters # type: ignore + from ._models import EnabledConfig # type: ignore + from ._models import EndpointDependency # type: ignore + from ._models import EndpointDetail # type: ignore + from ._models import ErrorEntity # type: ignore + from ._models import Experiments # type: ignore + from ._models import ExtendedLocation # type: ignore + from ._models import Facebook # type: ignore + from ._models import FileSystemApplicationLogsConfig # type: ignore + from ._models import FileSystemHttpLogsConfig # type: ignore + from ._models import FileSystemTokenStore # type: ignore + from ._models import ForwardProxy # type: ignore + from ._models import FrontEndConfiguration # type: ignore + from ._models import FunctionAppMajorVersion # type: ignore + from ._models import FunctionAppMinorVersion # type: ignore + from ._models import FunctionAppRuntimeSettings # type: ignore + from ._models import FunctionAppRuntimes # type: ignore + from ._models import FunctionAppStack # type: ignore + from ._models import FunctionAppStackCollection # type: ignore + from ._models import FunctionEnvelope # type: ignore + from ._models import FunctionEnvelopeCollection # type: ignore + from ._models import FunctionSecrets # type: ignore + from ._models import GeoRegion # type: ignore + from ._models import GeoRegionCollection # type: ignore + from ._models import GitHub # type: ignore + from ._models import GitHubActionCodeConfiguration # type: ignore + from ._models import GitHubActionConfiguration # type: ignore + from ._models import GitHubActionContainerConfiguration # type: ignore + from ._models import GitHubActionWebAppStackSettings # type: ignore + from ._models import GlobalCsmSkuDescription # type: ignore + from ._models import GlobalValidation # type: ignore + from ._models import Google # type: ignore + from ._models import HandlerMapping # type: ignore + from ._models import HostKeys # type: ignore + from ._models import HostName # type: ignore + from ._models import HostNameBinding # type: ignore + from ._models import HostNameBindingCollection # type: ignore + from ._models import HostNameSslState # type: ignore + from ._models import HostingEnvironmentDeploymentInfo # type: ignore + from ._models import HostingEnvironmentDiagnostics # type: ignore + from ._models import HostingEnvironmentProfile # type: ignore + from ._models import HttpLogsConfig # type: ignore + from ._models import HttpSettings # type: ignore + from ._models import HttpSettingsRoutes # type: ignore + from ._models import HybridConnection # type: ignore + from ._models import HybridConnectionCollection # type: ignore + from ._models import HybridConnectionKey # type: ignore + from ._models import HybridConnectionLimits # type: ignore + from ._models import Identifier # type: ignore + from ._models import IdentifierCollection # type: ignore + from ._models import IdentityProviders # type: ignore + from ._models import InboundEnvironmentEndpoint # type: ignore + from ._models import InboundEnvironmentEndpointCollection # type: ignore + from ._models import IpSecurityRestriction # type: ignore + from ._models import JwtClaimChecks # type: ignore + from ._models import KeyInfo # type: ignore + from ._models import KeyValuePairStringObject # type: ignore + from ._models import KubeEnvironment # type: ignore + from ._models import KubeEnvironmentCollection # type: ignore + from ._models import KubeEnvironmentPatchResource # type: ignore + from ._models import KubeEnvironmentProfile # type: ignore + from ._models import LegacyMicrosoftAccount # type: ignore + from ._models import LinuxJavaContainerSettings # type: ignore + from ._models import LocalizableString # type: ignore + from ._models import LogAnalyticsConfiguration # type: ignore + from ._models import LogSpecification # type: ignore + from ._models import Login # type: ignore + from ._models import LoginRoutes # type: ignore + from ._models import LoginScopes # type: ignore + from ._models import MSDeploy # type: ignore + from ._models import MSDeployLog # type: ignore + from ._models import MSDeployLogEntry # type: ignore + from ._models import MSDeployStatus # type: ignore + from ._models import ManagedServiceIdentity # type: ignore + from ._models import MetricAvailability # type: ignore + from ._models import MetricSpecification # type: ignore + from ._models import MigrateMySqlRequest # type: ignore + from ._models import MigrateMySqlStatus # type: ignore + from ._models import NameIdentifier # type: ignore + from ._models import NameIdentifierCollection # type: ignore + from ._models import NameValuePair # type: ignore + from ._models import NetworkFeatures # type: ignore + from ._models import NetworkTrace # type: ignore + from ._models import Nonce # type: ignore + from ._models import OpenIdConnectClientCredential # type: ignore + from ._models import OpenIdConnectConfig # type: ignore + from ._models import OpenIdConnectLogin # type: ignore + from ._models import OpenIdConnectRegistration # type: ignore + from ._models import Operation # type: ignore + from ._models import OutboundEnvironmentEndpoint # type: ignore + from ._models import OutboundEnvironmentEndpointCollection # type: ignore + from ._models import PerfMonCounterCollection # type: ignore + from ._models import PerfMonResponse # type: ignore + from ._models import PerfMonSample # type: ignore + from ._models import PerfMonSet # type: ignore + from ._models import PremierAddOn # type: ignore + from ._models import PremierAddOnOffer # type: ignore + from ._models import PremierAddOnOfferCollection # type: ignore + from ._models import PremierAddOnPatchResource # type: ignore + from ._models import PrivateAccess # type: ignore + from ._models import PrivateAccessSubnet # type: ignore + from ._models import PrivateAccessVirtualNetwork # type: ignore + from ._models import PrivateEndpointConnectionCollection # type: ignore + from ._models import PrivateLinkConnectionApprovalRequestResource # type: ignore + from ._models import PrivateLinkConnectionState # type: ignore + from ._models import PrivateLinkResource # type: ignore + from ._models import PrivateLinkResourceProperties # type: ignore + from ._models import PrivateLinkResourcesWrapper # type: ignore + from ._models import ProcessInfo # type: ignore + from ._models import ProcessInfoCollection # type: ignore + from ._models import ProcessModuleInfo # type: ignore + from ._models import ProcessModuleInfoCollection # type: ignore + from ._models import ProcessThreadInfo # type: ignore + from ._models import ProcessThreadInfoCollection # type: ignore + from ._models import ProxyOnlyResource # type: ignore + from ._models import PublicCertificate # type: ignore + from ._models import PublicCertificateCollection # type: ignore + from ._models import PublishingCredentialsPoliciesCollection # type: ignore + from ._models import PushSettings # type: ignore + from ._models import QueryUtterancesResult # type: ignore + from ._models import QueryUtterancesResults # type: ignore + from ._models import RampUpRule # type: ignore + from ._models import Recommendation # type: ignore + from ._models import RecommendationCollection # type: ignore + from ._models import RecommendationRule # type: ignore + from ._models import ReissueCertificateOrderRequest # type: ignore + from ._models import RelayServiceConnectionEntity # type: ignore + from ._models import RemotePrivateEndpointConnection # type: ignore + from ._models import RemotePrivateEndpointConnectionARMResource # type: ignore + from ._models import Rendering # type: ignore + from ._models import RenewCertificateOrderRequest # type: ignore + from ._models import RequestsBasedTrigger # type: ignore + from ._models import Resource # type: ignore + from ._models import ResourceCollection # type: ignore + from ._models import ResourceHealthMetadata # type: ignore + from ._models import ResourceHealthMetadataCollection # type: ignore + from ._models import ResourceMetricAvailability # type: ignore + from ._models import ResourceMetricDefinition # type: ignore + from ._models import ResourceMetricDefinitionCollection # type: ignore + from ._models import ResourceNameAvailability # type: ignore + from ._models import ResourceNameAvailabilityRequest # type: ignore + from ._models import ResponseMessageEnvelopeRemotePrivateEndpointConnection # type: ignore + from ._models import ResponseMetaData # type: ignore + from ._models import RestoreRequest # type: ignore + from ._models import SampleUtterance # type: ignore + from ._models import ServiceSpecification # type: ignore + from ._models import Site # type: ignore + from ._models import SiteAuthSettings # type: ignore + from ._models import SiteAuthSettingsV2 # type: ignore + from ._models import SiteCloneability # type: ignore + from ._models import SiteCloneabilityCriterion # type: ignore + from ._models import SiteConfig # type: ignore + from ._models import SiteConfigPropertiesDictionary # type: ignore + from ._models import SiteConfigResource # type: ignore + from ._models import SiteConfigResourceCollection # type: ignore + from ._models import SiteConfigurationSnapshotInfo # type: ignore + from ._models import SiteConfigurationSnapshotInfoCollection # type: ignore + from ._models import SiteExtensionInfo # type: ignore + from ._models import SiteExtensionInfoCollection # type: ignore + from ._models import SiteLimits # type: ignore + from ._models import SiteLogsConfig # type: ignore + from ._models import SiteMachineKey # type: ignore + from ._models import SitePatchResource # type: ignore + from ._models import SitePhpErrorLogFlag # type: ignore + from ._models import SiteSeal # type: ignore + from ._models import SiteSealRequest # type: ignore + from ._models import SiteSourceControl # type: ignore + from ._models import SkuCapacity # type: ignore + from ._models import SkuDescription # type: ignore + from ._models import SkuInfo # type: ignore + from ._models import SkuInfoCollection # type: ignore + from ._models import SkuInfos # type: ignore + from ._models import SlotConfigNamesResource # type: ignore + from ._models import SlotDifference # type: ignore + from ._models import SlotDifferenceCollection # type: ignore + from ._models import SlotSwapStatus # type: ignore + from ._models import SlowRequestsBasedTrigger # type: ignore + from ._models import Snapshot # type: ignore + from ._models import SnapshotCollection # type: ignore + from ._models import SnapshotRecoverySource # type: ignore + from ._models import SnapshotRestoreRequest # type: ignore + from ._models import Solution # type: ignore + from ._models import SourceControl # type: ignore + from ._models import SourceControlCollection # type: ignore + from ._models import StackMajorVersion # type: ignore + from ._models import StackMinorVersion # type: ignore + from ._models import StampCapacity # type: ignore + from ._models import StampCapacityCollection # type: ignore + from ._models import StaticSiteARMResource # type: ignore + from ._models import StaticSiteBuildARMResource # type: ignore + from ._models import StaticSiteBuildCollection # type: ignore + from ._models import StaticSiteBuildProperties # type: ignore + from ._models import StaticSiteCollection # type: ignore + from ._models import StaticSiteCustomDomainOverviewARMResource # type: ignore + from ._models import StaticSiteCustomDomainOverviewCollection # type: ignore + from ._models import StaticSiteCustomDomainRequestPropertiesARMResource # type: ignore + from ._models import StaticSiteFunctionOverviewARMResource # type: ignore + from ._models import StaticSiteFunctionOverviewCollection # type: ignore + from ._models import StaticSitePatchResource # type: ignore + from ._models import StaticSiteResetPropertiesARMResource # type: ignore + from ._models import StaticSiteTemplateOptions # type: ignore + from ._models import StaticSiteUserARMResource # type: ignore + from ._models import StaticSiteUserCollection # type: ignore + from ._models import StaticSiteUserInvitationRequestResource # type: ignore + from ._models import StaticSiteUserInvitationResponseResource # type: ignore + from ._models import StaticSiteUserProvidedFunctionApp # type: ignore + from ._models import StaticSiteUserProvidedFunctionAppARMResource # type: ignore + from ._models import StaticSiteUserProvidedFunctionAppsCollection # type: ignore + from ._models import StaticSiteZipDeploymentARMResource # type: ignore + from ._models import StaticSitesWorkflowPreview # type: ignore + from ._models import StaticSitesWorkflowPreviewRequest # type: ignore + from ._models import Status # type: ignore + from ._models import StatusCodesBasedTrigger # type: ignore + from ._models import StatusCodesRangeBasedTrigger # type: ignore + from ._models import StorageMigrationOptions # type: ignore + from ._models import StorageMigrationResponse # type: ignore + from ._models import StringDictionary # type: ignore + from ._models import StringList # type: ignore + from ._models import SupportTopic # type: ignore + from ._models import SwiftVirtualNetwork # type: ignore + from ._models import TldLegalAgreement # type: ignore + from ._models import TldLegalAgreementCollection # type: ignore + from ._models import TokenStore # type: ignore + from ._models import TopLevelDomain # type: ignore + from ._models import TopLevelDomainAgreementOption # type: ignore + from ._models import TopLevelDomainCollection # type: ignore + from ._models import TriggeredJobHistory # type: ignore + from ._models import TriggeredJobHistoryCollection # type: ignore + from ._models import TriggeredJobRun # type: ignore + from ._models import TriggeredWebJob # type: ignore + from ._models import TriggeredWebJobCollection # type: ignore + from ._models import Twitter # type: ignore + from ._models import TwitterRegistration # type: ignore + from ._models import Usage # type: ignore + from ._models import UsageCollection # type: ignore + from ._models import User # type: ignore + from ._models import UserAssignedIdentity # type: ignore + from ._models import ValidateRequest # type: ignore + from ._models import ValidateResponse # type: ignore + from ._models import ValidateResponseError # type: ignore + from ._models import VirtualApplication # type: ignore + from ._models import VirtualDirectory # type: ignore + from ._models import VirtualIPMapping # type: ignore + from ._models import VirtualNetworkProfile # type: ignore + from ._models import VnetGateway # type: ignore + from ._models import VnetInfo # type: ignore + from ._models import VnetInfoResource # type: ignore + from ._models import VnetParameters # type: ignore + from ._models import VnetRoute # type: ignore + from ._models import VnetValidationFailureDetails # type: ignore + from ._models import VnetValidationTestFailure # type: ignore + from ._models import WebAppCollection # type: ignore + from ._models import WebAppInstanceStatusCollection # type: ignore + from ._models import WebAppMajorVersion # type: ignore + from ._models import WebAppMinorVersion # type: ignore + from ._models import WebAppRuntimeSettings # type: ignore + from ._models import WebAppRuntimes # type: ignore + from ._models import WebAppStack # type: ignore + from ._models import WebAppStackCollection # type: ignore + from ._models import WebJob # type: ignore + from ._models import WebJobCollection # type: ignore + from ._models import WebSiteInstanceStatus # type: ignore + from ._models import WindowsJavaContainerSettings # type: ignore + from ._models import WorkerPoolCollection # type: ignore + from ._models import WorkerPoolResource # type: ignore + +from ._web_site_management_client_enums import ( + AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem, + AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem, + AppServicePlanRestrictions, + AutoHealActionType, + AzureResourceType, + AzureStorageState, + AzureStorageType, + BackupItemStatus, + BackupRestoreOperationType, + BuildStatus, + BuiltInAuthenticationProvider, + CertificateOrderActionType, + CertificateOrderStatus, + CertificateProductType, + Channels, + CheckNameResourceTypes, + ClientCertMode, + CloneAbilityResult, + ComputeModeOptions, + ConnectionStringType, + ContinuousWebJobStatus, + CookieExpirationConvention, + CustomDomainStatus, + CustomHostNameDnsRecordType, + DatabaseType, + DetectorType, + DnsType, + DnsVerificationTestResult, + DomainPatchResourcePropertiesDomainNotRenewableReasonsItem, + DomainPropertiesDomainNotRenewableReasonsItem, + DomainStatus, + DomainType, + Enum10, + Enum11, + Enum12, + Enum13, + Enum14, + Enum15, + ForwardProxyConvention, + FrequencyUnit, + FrontEndServiceType, + FtpsState, + HostNameType, + HostType, + HostingEnvironmentStatus, + InAvailabilityReasonType, + InsightStatus, + IpFilterTag, + IssueType, + KeyVaultSecretStatus, + KubeEnvironmentProvisioningState, + LoadBalancingMode, + LogLevel, + MSDeployLogEntryType, + MSDeployProvisioningState, + ManagedPipelineMode, + ManagedServiceIdentityType, + MySqlMigrationType, + NotificationLevel, + OperationStatus, + ProvisioningState, + PublicCertificateLocation, + PublishingProfileFormat, + RedundancyMode, + RenderingType, + ResolveStatus, + ResourceScopeType, + RouteType, + ScmType, + SiteAvailabilityState, + SiteExtensionType, + SiteLoadBalancing, + SiteRuntimeState, + SkuName, + SolutionType, + SslState, + StackPreferredOs, + StagingEnvironmentPolicy, + StatusOptions, + StorageType, + SupportedTlsVersions, + TriggerTypes, + TriggeredWebJobStatus, + UnauthenticatedClientAction, + UnauthenticatedClientActionV2, + UsageState, + ValidateResourceTypes, + WebJobType, + WorkerSizeOptions, +) + +__all__ = [ + 'AbnormalTimePeriod', + 'Address', + 'AddressResponse', + 'AllowedAudiencesValidation', + 'AllowedPrincipals', + 'AnalysisData', + 'AnalysisDefinition', + 'ApiDefinitionInfo', + 'ApiKVReference', + 'ApiKVReferenceCollection', + 'ApiManagementConfig', + 'AppInsightsWebAppStackSettings', + 'AppLogsConfiguration', + 'AppRegistration', + 'AppServiceCertificate', + 'AppServiceCertificateCollection', + 'AppServiceCertificateOrder', + 'AppServiceCertificateOrderCollection', + 'AppServiceCertificateOrderPatchResource', + 'AppServiceCertificatePatchResource', + 'AppServiceCertificateResource', + 'AppServiceEnvironment', + 'AppServiceEnvironmentCollection', + 'AppServiceEnvironmentPatchResource', + 'AppServiceEnvironmentResource', + 'AppServicePlan', + 'AppServicePlanCollection', + 'AppServicePlanPatchResource', + 'Apple', + 'AppleRegistration', + 'ApplicationLogsConfig', + 'ApplicationStack', + 'ApplicationStackCollection', + 'ApplicationStackResource', + 'AppserviceGithubToken', + 'AppserviceGithubTokenRequest', + 'ArcConfiguration', + 'ArmIdWrapper', + 'ArmPlan', + 'AseV3NetworkingConfiguration', + 'AuthPlatform', + 'AutoHealActions', + 'AutoHealCustomAction', + 'AutoHealRules', + 'AutoHealTriggers', + 'AzureActiveDirectory', + 'AzureActiveDirectoryLogin', + 'AzureActiveDirectoryRegistration', + 'AzureActiveDirectoryValidation', + 'AzureBlobStorageApplicationLogsConfig', + 'AzureBlobStorageHttpLogsConfig', + 'AzureStaticWebApps', + 'AzureStaticWebAppsRegistration', + 'AzureStorageInfoValue', + 'AzureStoragePropertyDictionaryResource', + 'AzureTableStorageApplicationLogsConfig', + 'BackupItem', + 'BackupItemCollection', + 'BackupRequest', + 'BackupSchedule', + 'BillingMeter', + 'BillingMeterCollection', + 'BlobStorageTokenStore', + 'Capability', + 'Certificate', + 'CertificateCollection', + 'CertificateDetails', + 'CertificateEmail', + 'CertificateOrderAction', + 'CertificateOrderContact', + 'CertificatePatchResource', + 'ClientRegistration', + 'CloningInfo', + 'ConnStringInfo', + 'ConnStringValueTypePair', + 'ConnectionStringDictionary', + 'Contact', + 'ContainerCpuStatistics', + 'ContainerCpuUsage', + 'ContainerInfo', + 'ContainerMemoryStatistics', + 'ContainerNetworkInterfaceStatistics', + 'ContainerThrottlingData', + 'ContinuousWebJob', + 'ContinuousWebJobCollection', + 'CookieExpiration', + 'CorsSettings', + 'CsmMoveResourceEnvelope', + 'CsmOperationCollection', + 'CsmOperationDescription', + 'CsmOperationDescriptionProperties', + 'CsmOperationDisplay', + 'CsmPublishingCredentialsPoliciesEntity', + 'CsmPublishingProfileOptions', + 'CsmSlotEntity', + 'CsmUsageQuota', + 'CsmUsageQuotaCollection', + 'CustomHostnameAnalysisResult', + 'CustomOpenIdConnectProvider', + 'DataProviderMetadata', + 'DataSource', + 'DataTableResponseColumn', + 'DataTableResponseObject', + 'DatabaseBackupSetting', + 'DefaultAuthorizationPolicy', + 'DefaultErrorResponse', + 'DefaultErrorResponseError', + 'DefaultErrorResponseErrorDetailsItem', + 'DeletedAppRestoreRequest', + 'DeletedSite', + 'DeletedWebAppCollection', + 'Deployment', + 'DeploymentCollection', + 'DeploymentLocations', + 'DetectorAbnormalTimePeriod', + 'DetectorDefinition', + 'DetectorDefinitionResource', + 'DetectorInfo', + 'DetectorResponse', + 'DetectorResponseCollection', + 'DiagnosticAnalysis', + 'DiagnosticAnalysisCollection', + 'DiagnosticCategory', + 'DiagnosticCategoryCollection', + 'DiagnosticData', + 'DiagnosticDetectorCollection', + 'DiagnosticDetectorResponse', + 'DiagnosticMetricSample', + 'DiagnosticMetricSet', + 'Dimension', + 'Domain', + 'DomainAvailabilityCheckResult', + 'DomainCollection', + 'DomainControlCenterSsoRequest', + 'DomainOwnershipIdentifier', + 'DomainOwnershipIdentifierCollection', + 'DomainPatchResource', + 'DomainPurchaseConsent', + 'DomainRecommendationSearchParameters', + 'EnabledConfig', + 'EndpointDependency', + 'EndpointDetail', + 'ErrorEntity', + 'Experiments', + 'ExtendedLocation', + 'Facebook', + 'FileSystemApplicationLogsConfig', + 'FileSystemHttpLogsConfig', + 'FileSystemTokenStore', + 'ForwardProxy', + 'FrontEndConfiguration', + 'FunctionAppMajorVersion', + 'FunctionAppMinorVersion', + 'FunctionAppRuntimeSettings', + 'FunctionAppRuntimes', + 'FunctionAppStack', + 'FunctionAppStackCollection', + 'FunctionEnvelope', + 'FunctionEnvelopeCollection', + 'FunctionSecrets', + 'GeoRegion', + 'GeoRegionCollection', + 'GitHub', + 'GitHubActionCodeConfiguration', + 'GitHubActionConfiguration', + 'GitHubActionContainerConfiguration', + 'GitHubActionWebAppStackSettings', + 'GlobalCsmSkuDescription', + 'GlobalValidation', + 'Google', + 'HandlerMapping', + 'HostKeys', + 'HostName', + 'HostNameBinding', + 'HostNameBindingCollection', + 'HostNameSslState', + 'HostingEnvironmentDeploymentInfo', + 'HostingEnvironmentDiagnostics', + 'HostingEnvironmentProfile', + 'HttpLogsConfig', + 'HttpSettings', + 'HttpSettingsRoutes', + 'HybridConnection', + 'HybridConnectionCollection', + 'HybridConnectionKey', + 'HybridConnectionLimits', + 'Identifier', + 'IdentifierCollection', + 'IdentityProviders', + 'InboundEnvironmentEndpoint', + 'InboundEnvironmentEndpointCollection', + 'IpSecurityRestriction', + 'JwtClaimChecks', + 'KeyInfo', + 'KeyValuePairStringObject', + 'KubeEnvironment', + 'KubeEnvironmentCollection', + 'KubeEnvironmentPatchResource', + 'KubeEnvironmentProfile', + 'LegacyMicrosoftAccount', + 'LinuxJavaContainerSettings', + 'LocalizableString', + 'LogAnalyticsConfiguration', + 'LogSpecification', + 'Login', + 'LoginRoutes', + 'LoginScopes', + 'MSDeploy', + 'MSDeployLog', + 'MSDeployLogEntry', + 'MSDeployStatus', + 'ManagedServiceIdentity', + 'MetricAvailability', + 'MetricSpecification', + 'MigrateMySqlRequest', + 'MigrateMySqlStatus', + 'NameIdentifier', + 'NameIdentifierCollection', + 'NameValuePair', + 'NetworkFeatures', + 'NetworkTrace', + 'Nonce', + 'OpenIdConnectClientCredential', + 'OpenIdConnectConfig', + 'OpenIdConnectLogin', + 'OpenIdConnectRegistration', + 'Operation', + 'OutboundEnvironmentEndpoint', + 'OutboundEnvironmentEndpointCollection', + 'PerfMonCounterCollection', + 'PerfMonResponse', + 'PerfMonSample', + 'PerfMonSet', + 'PremierAddOn', + 'PremierAddOnOffer', + 'PremierAddOnOfferCollection', + 'PremierAddOnPatchResource', + 'PrivateAccess', + 'PrivateAccessSubnet', + 'PrivateAccessVirtualNetwork', + 'PrivateEndpointConnectionCollection', + 'PrivateLinkConnectionApprovalRequestResource', + 'PrivateLinkConnectionState', + 'PrivateLinkResource', + 'PrivateLinkResourceProperties', + 'PrivateLinkResourcesWrapper', + 'ProcessInfo', + 'ProcessInfoCollection', + 'ProcessModuleInfo', + 'ProcessModuleInfoCollection', + 'ProcessThreadInfo', + 'ProcessThreadInfoCollection', + 'ProxyOnlyResource', + 'PublicCertificate', + 'PublicCertificateCollection', + 'PublishingCredentialsPoliciesCollection', + 'PushSettings', + 'QueryUtterancesResult', + 'QueryUtterancesResults', + 'RampUpRule', + 'Recommendation', + 'RecommendationCollection', + 'RecommendationRule', + 'ReissueCertificateOrderRequest', + 'RelayServiceConnectionEntity', + 'RemotePrivateEndpointConnection', + 'RemotePrivateEndpointConnectionARMResource', + 'Rendering', + 'RenewCertificateOrderRequest', + 'RequestsBasedTrigger', + 'Resource', + 'ResourceCollection', + 'ResourceHealthMetadata', + 'ResourceHealthMetadataCollection', + 'ResourceMetricAvailability', + 'ResourceMetricDefinition', + 'ResourceMetricDefinitionCollection', + 'ResourceNameAvailability', + 'ResourceNameAvailabilityRequest', + 'ResponseMessageEnvelopeRemotePrivateEndpointConnection', + 'ResponseMetaData', + 'RestoreRequest', + 'SampleUtterance', + 'ServiceSpecification', + 'Site', + 'SiteAuthSettings', + 'SiteAuthSettingsV2', + 'SiteCloneability', + 'SiteCloneabilityCriterion', + 'SiteConfig', + 'SiteConfigPropertiesDictionary', + 'SiteConfigResource', + 'SiteConfigResourceCollection', + 'SiteConfigurationSnapshotInfo', + 'SiteConfigurationSnapshotInfoCollection', + 'SiteExtensionInfo', + 'SiteExtensionInfoCollection', + 'SiteLimits', + 'SiteLogsConfig', + 'SiteMachineKey', + 'SitePatchResource', + 'SitePhpErrorLogFlag', + 'SiteSeal', + 'SiteSealRequest', + 'SiteSourceControl', + 'SkuCapacity', + 'SkuDescription', + 'SkuInfo', + 'SkuInfoCollection', + 'SkuInfos', + 'SlotConfigNamesResource', + 'SlotDifference', + 'SlotDifferenceCollection', + 'SlotSwapStatus', + 'SlowRequestsBasedTrigger', + 'Snapshot', + 'SnapshotCollection', + 'SnapshotRecoverySource', + 'SnapshotRestoreRequest', + 'Solution', + 'SourceControl', + 'SourceControlCollection', + 'StackMajorVersion', + 'StackMinorVersion', + 'StampCapacity', + 'StampCapacityCollection', + 'StaticSiteARMResource', + 'StaticSiteBuildARMResource', + 'StaticSiteBuildCollection', + 'StaticSiteBuildProperties', + 'StaticSiteCollection', + 'StaticSiteCustomDomainOverviewARMResource', + 'StaticSiteCustomDomainOverviewCollection', + 'StaticSiteCustomDomainRequestPropertiesARMResource', + 'StaticSiteFunctionOverviewARMResource', + 'StaticSiteFunctionOverviewCollection', + 'StaticSitePatchResource', + 'StaticSiteResetPropertiesARMResource', + 'StaticSiteTemplateOptions', + 'StaticSiteUserARMResource', + 'StaticSiteUserCollection', + 'StaticSiteUserInvitationRequestResource', + 'StaticSiteUserInvitationResponseResource', + 'StaticSiteUserProvidedFunctionApp', + 'StaticSiteUserProvidedFunctionAppARMResource', + 'StaticSiteUserProvidedFunctionAppsCollection', + 'StaticSiteZipDeploymentARMResource', + 'StaticSitesWorkflowPreview', + 'StaticSitesWorkflowPreviewRequest', + 'Status', + 'StatusCodesBasedTrigger', + 'StatusCodesRangeBasedTrigger', + 'StorageMigrationOptions', + 'StorageMigrationResponse', + 'StringDictionary', + 'StringList', + 'SupportTopic', + 'SwiftVirtualNetwork', + 'TldLegalAgreement', + 'TldLegalAgreementCollection', + 'TokenStore', + 'TopLevelDomain', + 'TopLevelDomainAgreementOption', + 'TopLevelDomainCollection', + 'TriggeredJobHistory', + 'TriggeredJobHistoryCollection', + 'TriggeredJobRun', + 'TriggeredWebJob', + 'TriggeredWebJobCollection', + 'Twitter', + 'TwitterRegistration', + 'Usage', + 'UsageCollection', + 'User', + 'UserAssignedIdentity', + 'ValidateRequest', + 'ValidateResponse', + 'ValidateResponseError', + 'VirtualApplication', + 'VirtualDirectory', + 'VirtualIPMapping', + 'VirtualNetworkProfile', + 'VnetGateway', + 'VnetInfo', + 'VnetInfoResource', + 'VnetParameters', + 'VnetRoute', + 'VnetValidationFailureDetails', + 'VnetValidationTestFailure', + 'WebAppCollection', + 'WebAppInstanceStatusCollection', + 'WebAppMajorVersion', + 'WebAppMinorVersion', + 'WebAppRuntimeSettings', + 'WebAppRuntimes', + 'WebAppStack', + 'WebAppStackCollection', + 'WebJob', + 'WebJobCollection', + 'WebSiteInstanceStatus', + 'WindowsJavaContainerSettings', + 'WorkerPoolCollection', + 'WorkerPoolResource', + 'AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem', + 'AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem', + 'AppServicePlanRestrictions', + 'AutoHealActionType', + 'AzureResourceType', + 'AzureStorageState', + 'AzureStorageType', + 'BackupItemStatus', + 'BackupRestoreOperationType', + 'BuildStatus', + 'BuiltInAuthenticationProvider', + 'CertificateOrderActionType', + 'CertificateOrderStatus', + 'CertificateProductType', + 'Channels', + 'CheckNameResourceTypes', + 'ClientCertMode', + 'CloneAbilityResult', + 'ComputeModeOptions', + 'ConnectionStringType', + 'ContinuousWebJobStatus', + 'CookieExpirationConvention', + 'CustomDomainStatus', + 'CustomHostNameDnsRecordType', + 'DatabaseType', + 'DetectorType', + 'DnsType', + 'DnsVerificationTestResult', + 'DomainPatchResourcePropertiesDomainNotRenewableReasonsItem', + 'DomainPropertiesDomainNotRenewableReasonsItem', + 'DomainStatus', + 'DomainType', + 'Enum10', + 'Enum11', + 'Enum12', + 'Enum13', + 'Enum14', + 'Enum15', + 'ForwardProxyConvention', + 'FrequencyUnit', + 'FrontEndServiceType', + 'FtpsState', + 'HostNameType', + 'HostType', + 'HostingEnvironmentStatus', + 'InAvailabilityReasonType', + 'InsightStatus', + 'IpFilterTag', + 'IssueType', + 'KeyVaultSecretStatus', + 'KubeEnvironmentProvisioningState', + 'LoadBalancingMode', + 'LogLevel', + 'MSDeployLogEntryType', + 'MSDeployProvisioningState', + 'ManagedPipelineMode', + 'ManagedServiceIdentityType', + 'MySqlMigrationType', + 'NotificationLevel', + 'OperationStatus', + 'ProvisioningState', + 'PublicCertificateLocation', + 'PublishingProfileFormat', + 'RedundancyMode', + 'RenderingType', + 'ResolveStatus', + 'ResourceScopeType', + 'RouteType', + 'ScmType', + 'SiteAvailabilityState', + 'SiteExtensionType', + 'SiteLoadBalancing', + 'SiteRuntimeState', + 'SkuName', + 'SolutionType', + 'SslState', + 'StackPreferredOs', + 'StagingEnvironmentPolicy', + 'StatusOptions', + 'StorageType', + 'SupportedTlsVersions', + 'TriggerTypes', + 'TriggeredWebJobStatus', + 'UnauthenticatedClientAction', + 'UnauthenticatedClientActionV2', + 'UsageState', + 'ValidateResourceTypes', + 'WebJobType', + 'WorkerSizeOptions', +] diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/models/_models.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/models/_models.py new file mode 100644 index 000000000000..ee4ca3c657ba --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/models/_models.py @@ -0,0 +1,18903 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + + +class AbnormalTimePeriod(msrest.serialization.Model): + """Class representing Abnormal Time Period identified in diagnosis. + + :param start_time: Start time of the downtime. + :type start_time: ~datetime.datetime + :param end_time: End time of the downtime. + :type end_time: ~datetime.datetime + :param events: List of Possible Cause of downtime. + :type events: list[~azure.mgmt.web.v2021_02_01.models.DetectorAbnormalTimePeriod] + :param solutions: List of proposed solutions. + :type solutions: list[~azure.mgmt.web.v2021_02_01.models.Solution] + """ + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'events': {'key': 'events', 'type': '[DetectorAbnormalTimePeriod]'}, + 'solutions': {'key': 'solutions', 'type': '[Solution]'}, + } + + def __init__( + self, + **kwargs + ): + super(AbnormalTimePeriod, self).__init__(**kwargs) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.events = kwargs.get('events', None) + self.solutions = kwargs.get('solutions', None) + + +class Address(msrest.serialization.Model): + """Address information for domain registration. + + All required parameters must be populated in order to send to Azure. + + :param address1: Required. First line of an Address. + :type address1: str + :param address2: The second line of the Address. Optional. + :type address2: str + :param city: Required. The city for the address. + :type city: str + :param country: Required. The country for the address. + :type country: str + :param postal_code: Required. The postal code for the address. + :type postal_code: str + :param state: Required. The state or province for the address. + :type state: str + """ + + _validation = { + 'address1': {'required': True}, + 'city': {'required': True}, + 'country': {'required': True}, + 'postal_code': {'required': True}, + 'state': {'required': True}, + } + + _attribute_map = { + 'address1': {'key': 'address1', 'type': 'str'}, + 'address2': {'key': 'address2', 'type': 'str'}, + 'city': {'key': 'city', 'type': 'str'}, + 'country': {'key': 'country', 'type': 'str'}, + 'postal_code': {'key': 'postalCode', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Address, self).__init__(**kwargs) + self.address1 = kwargs['address1'] + self.address2 = kwargs.get('address2', None) + self.city = kwargs['city'] + self.country = kwargs['country'] + self.postal_code = kwargs['postal_code'] + self.state = kwargs['state'] + + +class ProxyOnlyResource(msrest.serialization.Model): + """Azure proxy only resource. This resource is not tracked by Azure Resource Manager. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProxyOnlyResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.kind = kwargs.get('kind', None) + self.type = None + + +class AddressResponse(ProxyOnlyResource): + """Describes main public IP address and any extra virtual IPs. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param service_ip_address: Main public virtual IP. + :type service_ip_address: str + :param internal_ip_address: Virtual Network internal IP address of the App Service Environment + if it is in internal load-balancing mode. + :type internal_ip_address: str + :param outbound_ip_addresses: IP addresses appearing on outbound connections. + :type outbound_ip_addresses: list[str] + :param vip_mappings: Additional virtual IPs. + :type vip_mappings: list[~azure.mgmt.web.v2021_02_01.models.VirtualIPMapping] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'service_ip_address': {'key': 'properties.serviceIpAddress', 'type': 'str'}, + 'internal_ip_address': {'key': 'properties.internalIpAddress', 'type': 'str'}, + 'outbound_ip_addresses': {'key': 'properties.outboundIpAddresses', 'type': '[str]'}, + 'vip_mappings': {'key': 'properties.vipMappings', 'type': '[VirtualIPMapping]'}, + } + + def __init__( + self, + **kwargs + ): + super(AddressResponse, self).__init__(**kwargs) + self.service_ip_address = kwargs.get('service_ip_address', None) + self.internal_ip_address = kwargs.get('internal_ip_address', None) + self.outbound_ip_addresses = kwargs.get('outbound_ip_addresses', None) + self.vip_mappings = kwargs.get('vip_mappings', None) + + +class AllowedAudiencesValidation(msrest.serialization.Model): + """The configuration settings of the Allowed Audiences validation flow. + + :param allowed_audiences: The configuration settings of the allowed list of audiences from + which to validate the JWT token. + :type allowed_audiences: list[str] + """ + + _attribute_map = { + 'allowed_audiences': {'key': 'allowedAudiences', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(AllowedAudiencesValidation, self).__init__(**kwargs) + self.allowed_audiences = kwargs.get('allowed_audiences', None) + + +class AllowedPrincipals(msrest.serialization.Model): + """The configuration settings of the Azure Active Directory allowed principals. + + :param groups: The list of the allowed groups. + :type groups: list[str] + :param identities: The list of the allowed identities. + :type identities: list[str] + """ + + _attribute_map = { + 'groups': {'key': 'groups', 'type': '[str]'}, + 'identities': {'key': 'identities', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(AllowedPrincipals, self).__init__(**kwargs) + self.groups = kwargs.get('groups', None) + self.identities = kwargs.get('identities', None) + + +class AnalysisData(msrest.serialization.Model): + """Class Representing Detector Evidence used for analysis. + + :param source: Name of the Detector. + :type source: str + :param detector_definition: Detector Definition. + :type detector_definition: ~azure.mgmt.web.v2021_02_01.models.DetectorDefinition + :param metrics: Source Metrics. + :type metrics: list[~azure.mgmt.web.v2021_02_01.models.DiagnosticMetricSet] + :param data: Additional Source Data. + :type data: list[list[~azure.mgmt.web.v2021_02_01.models.NameValuePair]] + :param detector_meta_data: Detector Meta Data. + :type detector_meta_data: ~azure.mgmt.web.v2021_02_01.models.ResponseMetaData + """ + + _attribute_map = { + 'source': {'key': 'source', 'type': 'str'}, + 'detector_definition': {'key': 'detectorDefinition', 'type': 'DetectorDefinition'}, + 'metrics': {'key': 'metrics', 'type': '[DiagnosticMetricSet]'}, + 'data': {'key': 'data', 'type': '[[NameValuePair]]'}, + 'detector_meta_data': {'key': 'detectorMetaData', 'type': 'ResponseMetaData'}, + } + + def __init__( + self, + **kwargs + ): + super(AnalysisData, self).__init__(**kwargs) + self.source = kwargs.get('source', None) + self.detector_definition = kwargs.get('detector_definition', None) + self.metrics = kwargs.get('metrics', None) + self.data = kwargs.get('data', None) + self.detector_meta_data = kwargs.get('detector_meta_data', None) + + +class AnalysisDefinition(ProxyOnlyResource): + """Definition of Analysis. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar description: Description of the Analysis. + :vartype description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AnalysisDefinition, self).__init__(**kwargs) + self.description = None + + +class ApiDefinitionInfo(msrest.serialization.Model): + """Information about the formal API definition for the app. + + :param url: The URL of the API definition. + :type url: str + """ + + _attribute_map = { + 'url': {'key': 'url', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApiDefinitionInfo, self).__init__(**kwargs) + self.url = kwargs.get('url', None) + + +class ApiKVReference(ProxyOnlyResource): + """Description of site key vault references. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param reference: + :type reference: str + :param status: Possible values include: "Initialized", "Resolved", "InvalidSyntax", + "MSINotEnabled", "VaultNotFound", "SecretNotFound", "SecretVersionNotFound", + "AccessToKeyVaultDenied", "OtherReasons", "FetchTimedOut", "UnauthorizedClient". + :type status: str or ~azure.mgmt.web.v2021_02_01.models.ResolveStatus + :param vault_name: + :type vault_name: str + :param secret_name: + :type secret_name: str + :param secret_version: + :type secret_version: str + :param identity_type: Managed service identity. + :type identity_type: ~azure.mgmt.web.v2021_02_01.models.ManagedServiceIdentity + :param details: + :type details: str + :param source: The only acceptable values to pass in are None and "KeyVault". The default + value is None. + :type source: str + :param active_version: + :type active_version: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'reference': {'key': 'properties.reference', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'vault_name': {'key': 'properties.vaultName', 'type': 'str'}, + 'secret_name': {'key': 'properties.secretName', 'type': 'str'}, + 'secret_version': {'key': 'properties.secretVersion', 'type': 'str'}, + 'identity_type': {'key': 'properties.identityType', 'type': 'ManagedServiceIdentity'}, + 'details': {'key': 'properties.details', 'type': 'str'}, + 'source': {'key': 'properties.source', 'type': 'str'}, + 'active_version': {'key': 'properties.activeVersion', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApiKVReference, self).__init__(**kwargs) + self.reference = kwargs.get('reference', None) + self.status = kwargs.get('status', None) + self.vault_name = kwargs.get('vault_name', None) + self.secret_name = kwargs.get('secret_name', None) + self.secret_version = kwargs.get('secret_version', None) + self.identity_type = kwargs.get('identity_type', None) + self.details = kwargs.get('details', None) + self.source = kwargs.get('source', None) + self.active_version = kwargs.get('active_version', None) + + +class ApiKVReferenceCollection(msrest.serialization.Model): + """ApiKVReferenceCollection. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.ApiKVReference] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ApiKVReference]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApiKVReferenceCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class ApiManagementConfig(msrest.serialization.Model): + """Azure API management (APIM) configuration linked to the app. + + :param id: APIM-Api Identifier. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApiManagementConfig, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + +class AppInsightsWebAppStackSettings(msrest.serialization.Model): + """App Insights Web App stack settings. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar is_supported: :code:`true` if remote Application Insights is supported for + the stack; otherwise, :code:`false`. + :vartype is_supported: bool + :ivar is_default_off: :code:`true` if Application Insights is disabled by default + for the stack; otherwise, :code:`false`. + :vartype is_default_off: bool + """ + + _validation = { + 'is_supported': {'readonly': True}, + 'is_default_off': {'readonly': True}, + } + + _attribute_map = { + 'is_supported': {'key': 'isSupported', 'type': 'bool'}, + 'is_default_off': {'key': 'isDefaultOff', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(AppInsightsWebAppStackSettings, self).__init__(**kwargs) + self.is_supported = None + self.is_default_off = None + + +class Apple(msrest.serialization.Model): + """The configuration settings of the Apple provider. + + :param enabled: :code:`false` if the Apple provider should not be enabled despite + the set registration; otherwise, :code:`true`. + :type enabled: bool + :param registration: The configuration settings of the Apple registration. + :type registration: ~azure.mgmt.web.v2021_02_01.models.AppleRegistration + :param login: The configuration settings of the login flow. + :type login: ~azure.mgmt.web.v2021_02_01.models.LoginScopes + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'AppleRegistration'}, + 'login': {'key': 'login', 'type': 'LoginScopes'}, + } + + def __init__( + self, + **kwargs + ): + super(Apple, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.registration = kwargs.get('registration', None) + self.login = kwargs.get('login', None) + + +class AppleRegistration(msrest.serialization.Model): + """The configuration settings of the registration for the Apple provider. + + :param client_id: The Client ID of the app used for login. + :type client_id: str + :param client_secret_setting_name: The app setting name that contains the client secret. + :type client_secret_setting_name: str + """ + + _attribute_map = { + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'client_secret_setting_name': {'key': 'clientSecretSettingName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AppleRegistration, self).__init__(**kwargs) + self.client_id = kwargs.get('client_id', None) + self.client_secret_setting_name = kwargs.get('client_secret_setting_name', None) + + +class ApplicationLogsConfig(msrest.serialization.Model): + """Application logs configuration. + + :param file_system: Application logs to file system configuration. + :type file_system: ~azure.mgmt.web.v2021_02_01.models.FileSystemApplicationLogsConfig + :param azure_table_storage: Application logs to azure table storage configuration. + :type azure_table_storage: + ~azure.mgmt.web.v2021_02_01.models.AzureTableStorageApplicationLogsConfig + :param azure_blob_storage: Application logs to blob storage configuration. + :type azure_blob_storage: + ~azure.mgmt.web.v2021_02_01.models.AzureBlobStorageApplicationLogsConfig + """ + + _attribute_map = { + 'file_system': {'key': 'fileSystem', 'type': 'FileSystemApplicationLogsConfig'}, + 'azure_table_storage': {'key': 'azureTableStorage', 'type': 'AzureTableStorageApplicationLogsConfig'}, + 'azure_blob_storage': {'key': 'azureBlobStorage', 'type': 'AzureBlobStorageApplicationLogsConfig'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationLogsConfig, self).__init__(**kwargs) + self.file_system = kwargs.get('file_system', None) + self.azure_table_storage = kwargs.get('azure_table_storage', None) + self.azure_blob_storage = kwargs.get('azure_blob_storage', None) + + +class ApplicationStack(msrest.serialization.Model): + """Application stack. + + :param name: Application stack name. + :type name: str + :param display: Application stack display name. + :type display: str + :param dependency: Application stack dependency. + :type dependency: str + :param major_versions: List of major versions available. + :type major_versions: list[~azure.mgmt.web.v2021_02_01.models.StackMajorVersion] + :param frameworks: List of frameworks associated with application stack. + :type frameworks: list[~azure.mgmt.web.v2021_02_01.models.ApplicationStack] + :param is_deprecated: :code:`true` if this is the stack is deprecated; otherwise, + :code:`false`. + :type is_deprecated: list[~azure.mgmt.web.v2021_02_01.models.ApplicationStack] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'str'}, + 'dependency': {'key': 'dependency', 'type': 'str'}, + 'major_versions': {'key': 'majorVersions', 'type': '[StackMajorVersion]'}, + 'frameworks': {'key': 'frameworks', 'type': '[ApplicationStack]'}, + 'is_deprecated': {'key': 'isDeprecated', 'type': '[ApplicationStack]'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationStack, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + self.dependency = kwargs.get('dependency', None) + self.major_versions = kwargs.get('major_versions', None) + self.frameworks = kwargs.get('frameworks', None) + self.is_deprecated = kwargs.get('is_deprecated', None) + + +class ApplicationStackCollection(msrest.serialization.Model): + """Collection of Application Stacks. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.ApplicationStackResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ApplicationStackResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationStackCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class ApplicationStackResource(ProxyOnlyResource): + """ARM resource for a ApplicationStack. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param name_properties_name: Application stack name. + :type name_properties_name: str + :param display: Application stack display name. + :type display: str + :param dependency: Application stack dependency. + :type dependency: str + :param major_versions: List of major versions available. + :type major_versions: list[~azure.mgmt.web.v2021_02_01.models.StackMajorVersion] + :param frameworks: List of frameworks associated with application stack. + :type frameworks: list[~azure.mgmt.web.v2021_02_01.models.ApplicationStack] + :param is_deprecated: :code:`true` if this is the stack is deprecated; otherwise, + :code:`false`. + :type is_deprecated: list[~azure.mgmt.web.v2021_02_01.models.ApplicationStack] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name_properties_name': {'key': 'properties.name', 'type': 'str'}, + 'display': {'key': 'properties.display', 'type': 'str'}, + 'dependency': {'key': 'properties.dependency', 'type': 'str'}, + 'major_versions': {'key': 'properties.majorVersions', 'type': '[StackMajorVersion]'}, + 'frameworks': {'key': 'properties.frameworks', 'type': '[ApplicationStack]'}, + 'is_deprecated': {'key': 'properties.isDeprecated', 'type': '[ApplicationStack]'}, + } + + def __init__( + self, + **kwargs + ): + super(ApplicationStackResource, self).__init__(**kwargs) + self.name_properties_name = kwargs.get('name_properties_name', None) + self.display = kwargs.get('display', None) + self.dependency = kwargs.get('dependency', None) + self.major_versions = kwargs.get('major_versions', None) + self.frameworks = kwargs.get('frameworks', None) + self.is_deprecated = kwargs.get('is_deprecated', None) + + +class AppLogsConfiguration(msrest.serialization.Model): + """AppLogsConfiguration. + + :param destination: + :type destination: str + :param log_analytics_configuration: + :type log_analytics_configuration: ~azure.mgmt.web.v2021_02_01.models.LogAnalyticsConfiguration + """ + + _attribute_map = { + 'destination': {'key': 'destination', 'type': 'str'}, + 'log_analytics_configuration': {'key': 'logAnalyticsConfiguration', 'type': 'LogAnalyticsConfiguration'}, + } + + def __init__( + self, + **kwargs + ): + super(AppLogsConfiguration, self).__init__(**kwargs) + self.destination = kwargs.get('destination', None) + self.log_analytics_configuration = kwargs.get('log_analytics_configuration', None) + + +class AppRegistration(msrest.serialization.Model): + """The configuration settings of the app registration for providers that have app ids and app secrets. + + :param app_id: The App ID of the app used for login. + :type app_id: str + :param app_secret_setting_name: The app setting name that contains the app secret. + :type app_secret_setting_name: str + """ + + _attribute_map = { + 'app_id': {'key': 'appId', 'type': 'str'}, + 'app_secret_setting_name': {'key': 'appSecretSettingName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AppRegistration, self).__init__(**kwargs) + self.app_id = kwargs.get('app_id', None) + self.app_secret_setting_name = kwargs.get('app_secret_setting_name', None) + + +class AppServiceCertificate(msrest.serialization.Model): + """Key Vault container for a certificate that is purchased through Azure. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param key_vault_id: Key Vault resource Id. + :type key_vault_id: str + :param key_vault_secret_name: Key Vault secret name. + :type key_vault_secret_name: str + :ivar provisioning_state: Status of the Key Vault secret. Possible values include: + "Initialized", "WaitingOnCertificateOrder", "Succeeded", "CertificateOrderFailed", + "OperationNotPermittedOnKeyVault", "AzureServiceUnauthorizedToAccessKeyVault", + "KeyVaultDoesNotExist", "KeyVaultSecretDoesNotExist", "UnknownError", "ExternalPrivateKey", + "Unknown". + :vartype provisioning_state: str or ~azure.mgmt.web.v2021_02_01.models.KeyVaultSecretStatus + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'key_vault_id': {'key': 'keyVaultId', 'type': 'str'}, + 'key_vault_secret_name': {'key': 'keyVaultSecretName', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AppServiceCertificate, self).__init__(**kwargs) + self.key_vault_id = kwargs.get('key_vault_id', None) + self.key_vault_secret_name = kwargs.get('key_vault_secret_name', None) + self.provisioning_state = None + + +class AppServiceCertificateCollection(msrest.serialization.Model): + """Collection of certificate order certificates. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.AppServiceCertificateResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AppServiceCertificateResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AppServiceCertificateCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class Resource(msrest.serialization.Model): + """Azure resource. This resource is tracked in Azure Resource Manager. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.kind = kwargs.get('kind', None) + self.location = kwargs['location'] + self.type = None + self.tags = kwargs.get('tags', None) + + +class AppServiceCertificateOrder(Resource): + """SSL certificate purchase order. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param certificates: State of the Key Vault secret. + :type certificates: dict[str, ~azure.mgmt.web.v2021_02_01.models.AppServiceCertificate] + :param distinguished_name: Certificate distinguished name. + :type distinguished_name: str + :ivar domain_verification_token: Domain verification token. + :vartype domain_verification_token: str + :param validity_in_years: Duration in years (must be 1). + :type validity_in_years: int + :param key_size: Certificate key size. + :type key_size: int + :param product_type: Certificate product type. Possible values include: + "StandardDomainValidatedSsl", "StandardDomainValidatedWildCardSsl". + :type product_type: str or ~azure.mgmt.web.v2021_02_01.models.CertificateProductType + :param auto_renew: :code:`true` if the certificate should be automatically renewed + when it expires; otherwise, :code:`false`. + :type auto_renew: bool + :ivar provisioning_state: Status of certificate order. Possible values include: "Succeeded", + "Failed", "Canceled", "InProgress", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.web.v2021_02_01.models.ProvisioningState + :ivar status: Current order status. Possible values include: "Pendingissuance", "Issued", + "Revoked", "Canceled", "Denied", "Pendingrevocation", "PendingRekey", "Unused", "Expired", + "NotSubmitted". + :vartype status: str or ~azure.mgmt.web.v2021_02_01.models.CertificateOrderStatus + :ivar signed_certificate: Signed certificate. + :vartype signed_certificate: ~azure.mgmt.web.v2021_02_01.models.CertificateDetails + :param csr: Last CSR that was created for this order. + :type csr: str + :ivar intermediate: Intermediate certificate. + :vartype intermediate: ~azure.mgmt.web.v2021_02_01.models.CertificateDetails + :ivar root: Root certificate. + :vartype root: ~azure.mgmt.web.v2021_02_01.models.CertificateDetails + :ivar serial_number: Current serial number of the certificate. + :vartype serial_number: str + :ivar last_certificate_issuance_time: Certificate last issuance time. + :vartype last_certificate_issuance_time: ~datetime.datetime + :ivar expiration_time: Certificate expiration time. + :vartype expiration_time: ~datetime.datetime + :ivar is_private_key_external: :code:`true` if private key is external; otherwise, + :code:`false`. + :vartype is_private_key_external: bool + :ivar app_service_certificate_not_renewable_reasons: Reasons why App Service Certificate is not + renewable at the current moment. + :vartype app_service_certificate_not_renewable_reasons: list[str or + ~azure.mgmt.web.v2021_02_01.models.AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem] + :ivar next_auto_renewal_time_stamp: Time stamp when the certificate would be auto renewed next. + :vartype next_auto_renewal_time_stamp: ~datetime.datetime + :ivar contact: Contact info. + :vartype contact: ~azure.mgmt.web.v2021_02_01.models.CertificateOrderContact + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'domain_verification_token': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + 'signed_certificate': {'readonly': True}, + 'intermediate': {'readonly': True}, + 'root': {'readonly': True}, + 'serial_number': {'readonly': True}, + 'last_certificate_issuance_time': {'readonly': True}, + 'expiration_time': {'readonly': True}, + 'is_private_key_external': {'readonly': True}, + 'app_service_certificate_not_renewable_reasons': {'readonly': True}, + 'next_auto_renewal_time_stamp': {'readonly': True}, + 'contact': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'certificates': {'key': 'properties.certificates', 'type': '{AppServiceCertificate}'}, + 'distinguished_name': {'key': 'properties.distinguishedName', 'type': 'str'}, + 'domain_verification_token': {'key': 'properties.domainVerificationToken', 'type': 'str'}, + 'validity_in_years': {'key': 'properties.validityInYears', 'type': 'int'}, + 'key_size': {'key': 'properties.keySize', 'type': 'int'}, + 'product_type': {'key': 'properties.productType', 'type': 'str'}, + 'auto_renew': {'key': 'properties.autoRenew', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'signed_certificate': {'key': 'properties.signedCertificate', 'type': 'CertificateDetails'}, + 'csr': {'key': 'properties.csr', 'type': 'str'}, + 'intermediate': {'key': 'properties.intermediate', 'type': 'CertificateDetails'}, + 'root': {'key': 'properties.root', 'type': 'CertificateDetails'}, + 'serial_number': {'key': 'properties.serialNumber', 'type': 'str'}, + 'last_certificate_issuance_time': {'key': 'properties.lastCertificateIssuanceTime', 'type': 'iso-8601'}, + 'expiration_time': {'key': 'properties.expirationTime', 'type': 'iso-8601'}, + 'is_private_key_external': {'key': 'properties.isPrivateKeyExternal', 'type': 'bool'}, + 'app_service_certificate_not_renewable_reasons': {'key': 'properties.appServiceCertificateNotRenewableReasons', 'type': '[str]'}, + 'next_auto_renewal_time_stamp': {'key': 'properties.nextAutoRenewalTimeStamp', 'type': 'iso-8601'}, + 'contact': {'key': 'properties.contact', 'type': 'CertificateOrderContact'}, + } + + def __init__( + self, + **kwargs + ): + super(AppServiceCertificateOrder, self).__init__(**kwargs) + self.certificates = kwargs.get('certificates', None) + self.distinguished_name = kwargs.get('distinguished_name', None) + self.domain_verification_token = None + self.validity_in_years = kwargs.get('validity_in_years', 1) + self.key_size = kwargs.get('key_size', 2048) + self.product_type = kwargs.get('product_type', None) + self.auto_renew = kwargs.get('auto_renew', True) + self.provisioning_state = None + self.status = None + self.signed_certificate = None + self.csr = kwargs.get('csr', None) + self.intermediate = None + self.root = None + self.serial_number = None + self.last_certificate_issuance_time = None + self.expiration_time = None + self.is_private_key_external = None + self.app_service_certificate_not_renewable_reasons = None + self.next_auto_renewal_time_stamp = None + self.contact = None + + +class AppServiceCertificateOrderCollection(msrest.serialization.Model): + """Collection of certificate orders. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.AppServiceCertificateOrder] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AppServiceCertificateOrder]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AppServiceCertificateOrderCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class AppServiceCertificateOrderPatchResource(ProxyOnlyResource): + """ARM resource for a certificate order that is purchased through Azure. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param certificates: State of the Key Vault secret. + :type certificates: dict[str, ~azure.mgmt.web.v2021_02_01.models.AppServiceCertificate] + :param distinguished_name: Certificate distinguished name. + :type distinguished_name: str + :ivar domain_verification_token: Domain verification token. + :vartype domain_verification_token: str + :param validity_in_years: Duration in years (must be 1). + :type validity_in_years: int + :param key_size: Certificate key size. + :type key_size: int + :param product_type: Certificate product type. Possible values include: + "StandardDomainValidatedSsl", "StandardDomainValidatedWildCardSsl". + :type product_type: str or ~azure.mgmt.web.v2021_02_01.models.CertificateProductType + :param auto_renew: :code:`true` if the certificate should be automatically renewed + when it expires; otherwise, :code:`false`. + :type auto_renew: bool + :ivar provisioning_state: Status of certificate order. Possible values include: "Succeeded", + "Failed", "Canceled", "InProgress", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.web.v2021_02_01.models.ProvisioningState + :ivar status: Current order status. Possible values include: "Pendingissuance", "Issued", + "Revoked", "Canceled", "Denied", "Pendingrevocation", "PendingRekey", "Unused", "Expired", + "NotSubmitted". + :vartype status: str or ~azure.mgmt.web.v2021_02_01.models.CertificateOrderStatus + :ivar signed_certificate: Signed certificate. + :vartype signed_certificate: ~azure.mgmt.web.v2021_02_01.models.CertificateDetails + :param csr: Last CSR that was created for this order. + :type csr: str + :ivar intermediate: Intermediate certificate. + :vartype intermediate: ~azure.mgmt.web.v2021_02_01.models.CertificateDetails + :ivar root: Root certificate. + :vartype root: ~azure.mgmt.web.v2021_02_01.models.CertificateDetails + :ivar serial_number: Current serial number of the certificate. + :vartype serial_number: str + :ivar last_certificate_issuance_time: Certificate last issuance time. + :vartype last_certificate_issuance_time: ~datetime.datetime + :ivar expiration_time: Certificate expiration time. + :vartype expiration_time: ~datetime.datetime + :ivar is_private_key_external: :code:`true` if private key is external; otherwise, + :code:`false`. + :vartype is_private_key_external: bool + :ivar app_service_certificate_not_renewable_reasons: Reasons why App Service Certificate is not + renewable at the current moment. + :vartype app_service_certificate_not_renewable_reasons: list[str or + ~azure.mgmt.web.v2021_02_01.models.AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem] + :ivar next_auto_renewal_time_stamp: Time stamp when the certificate would be auto renewed next. + :vartype next_auto_renewal_time_stamp: ~datetime.datetime + :ivar contact: Contact info. + :vartype contact: ~azure.mgmt.web.v2021_02_01.models.CertificateOrderContact + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'domain_verification_token': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + 'signed_certificate': {'readonly': True}, + 'intermediate': {'readonly': True}, + 'root': {'readonly': True}, + 'serial_number': {'readonly': True}, + 'last_certificate_issuance_time': {'readonly': True}, + 'expiration_time': {'readonly': True}, + 'is_private_key_external': {'readonly': True}, + 'app_service_certificate_not_renewable_reasons': {'readonly': True}, + 'next_auto_renewal_time_stamp': {'readonly': True}, + 'contact': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'certificates': {'key': 'properties.certificates', 'type': '{AppServiceCertificate}'}, + 'distinguished_name': {'key': 'properties.distinguishedName', 'type': 'str'}, + 'domain_verification_token': {'key': 'properties.domainVerificationToken', 'type': 'str'}, + 'validity_in_years': {'key': 'properties.validityInYears', 'type': 'int'}, + 'key_size': {'key': 'properties.keySize', 'type': 'int'}, + 'product_type': {'key': 'properties.productType', 'type': 'str'}, + 'auto_renew': {'key': 'properties.autoRenew', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'signed_certificate': {'key': 'properties.signedCertificate', 'type': 'CertificateDetails'}, + 'csr': {'key': 'properties.csr', 'type': 'str'}, + 'intermediate': {'key': 'properties.intermediate', 'type': 'CertificateDetails'}, + 'root': {'key': 'properties.root', 'type': 'CertificateDetails'}, + 'serial_number': {'key': 'properties.serialNumber', 'type': 'str'}, + 'last_certificate_issuance_time': {'key': 'properties.lastCertificateIssuanceTime', 'type': 'iso-8601'}, + 'expiration_time': {'key': 'properties.expirationTime', 'type': 'iso-8601'}, + 'is_private_key_external': {'key': 'properties.isPrivateKeyExternal', 'type': 'bool'}, + 'app_service_certificate_not_renewable_reasons': {'key': 'properties.appServiceCertificateNotRenewableReasons', 'type': '[str]'}, + 'next_auto_renewal_time_stamp': {'key': 'properties.nextAutoRenewalTimeStamp', 'type': 'iso-8601'}, + 'contact': {'key': 'properties.contact', 'type': 'CertificateOrderContact'}, + } + + def __init__( + self, + **kwargs + ): + super(AppServiceCertificateOrderPatchResource, self).__init__(**kwargs) + self.certificates = kwargs.get('certificates', None) + self.distinguished_name = kwargs.get('distinguished_name', None) + self.domain_verification_token = None + self.validity_in_years = kwargs.get('validity_in_years', 1) + self.key_size = kwargs.get('key_size', 2048) + self.product_type = kwargs.get('product_type', None) + self.auto_renew = kwargs.get('auto_renew', True) + self.provisioning_state = None + self.status = None + self.signed_certificate = None + self.csr = kwargs.get('csr', None) + self.intermediate = None + self.root = None + self.serial_number = None + self.last_certificate_issuance_time = None + self.expiration_time = None + self.is_private_key_external = None + self.app_service_certificate_not_renewable_reasons = None + self.next_auto_renewal_time_stamp = None + self.contact = None + + +class AppServiceCertificatePatchResource(ProxyOnlyResource): + """Key Vault container ARM resource for a certificate that is purchased through Azure. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param key_vault_id: Key Vault resource Id. + :type key_vault_id: str + :param key_vault_secret_name: Key Vault secret name. + :type key_vault_secret_name: str + :ivar provisioning_state: Status of the Key Vault secret. Possible values include: + "Initialized", "WaitingOnCertificateOrder", "Succeeded", "CertificateOrderFailed", + "OperationNotPermittedOnKeyVault", "AzureServiceUnauthorizedToAccessKeyVault", + "KeyVaultDoesNotExist", "KeyVaultSecretDoesNotExist", "UnknownError", "ExternalPrivateKey", + "Unknown". + :vartype provisioning_state: str or ~azure.mgmt.web.v2021_02_01.models.KeyVaultSecretStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'key_vault_id': {'key': 'properties.keyVaultId', 'type': 'str'}, + 'key_vault_secret_name': {'key': 'properties.keyVaultSecretName', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AppServiceCertificatePatchResource, self).__init__(**kwargs) + self.key_vault_id = kwargs.get('key_vault_id', None) + self.key_vault_secret_name = kwargs.get('key_vault_secret_name', None) + self.provisioning_state = None + + +class AppServiceCertificateResource(Resource): + """Key Vault container ARM resource for a certificate that is purchased through Azure. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param key_vault_id: Key Vault resource Id. + :type key_vault_id: str + :param key_vault_secret_name: Key Vault secret name. + :type key_vault_secret_name: str + :ivar provisioning_state: Status of the Key Vault secret. Possible values include: + "Initialized", "WaitingOnCertificateOrder", "Succeeded", "CertificateOrderFailed", + "OperationNotPermittedOnKeyVault", "AzureServiceUnauthorizedToAccessKeyVault", + "KeyVaultDoesNotExist", "KeyVaultSecretDoesNotExist", "UnknownError", "ExternalPrivateKey", + "Unknown". + :vartype provisioning_state: str or ~azure.mgmt.web.v2021_02_01.models.KeyVaultSecretStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'key_vault_id': {'key': 'properties.keyVaultId', 'type': 'str'}, + 'key_vault_secret_name': {'key': 'properties.keyVaultSecretName', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AppServiceCertificateResource, self).__init__(**kwargs) + self.key_vault_id = kwargs.get('key_vault_id', None) + self.key_vault_secret_name = kwargs.get('key_vault_secret_name', None) + self.provisioning_state = None + + +class AppServiceEnvironment(msrest.serialization.Model): + """Description of an App Service Environment. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar provisioning_state: Provisioning state of the App Service Environment. Possible values + include: "Succeeded", "Failed", "Canceled", "InProgress", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.web.v2021_02_01.models.ProvisioningState + :ivar status: Current status of the App Service Environment. Possible values include: + "Preparing", "Ready", "Scaling", "Deleting". + :vartype status: str or ~azure.mgmt.web.v2021_02_01.models.HostingEnvironmentStatus + :param virtual_network: Required. Description of the Virtual Network. + :type virtual_network: ~azure.mgmt.web.v2021_02_01.models.VirtualNetworkProfile + :param internal_load_balancing_mode: Specifies which endpoints to serve internally in the + Virtual Network for the App Service Environment. Possible values include: "None", "Web", + "Publishing", "Web, Publishing". + :type internal_load_balancing_mode: str or ~azure.mgmt.web.v2021_02_01.models.LoadBalancingMode + :param multi_size: Front-end VM size, e.g. "Medium", "Large". + :type multi_size: str + :ivar multi_role_count: Number of front-end instances. + :vartype multi_role_count: int + :param ipssl_address_count: Number of IP SSL addresses reserved for the App Service + Environment. + :type ipssl_address_count: int + :param dns_suffix: DNS suffix of the App Service Environment. + :type dns_suffix: str + :ivar maximum_number_of_machines: Maximum number of VMs in the App Service Environment. + :vartype maximum_number_of_machines: int + :param front_end_scale_factor: Scale factor for front-ends. + :type front_end_scale_factor: int + :ivar suspended: :code:`true` if the App Service Environment is suspended; + otherwise, :code:`false`. The environment can be suspended, e.g. when the + management endpoint is no longer available + (most likely because NSG blocked the incoming traffic). + :vartype suspended: bool + :param cluster_settings: Custom settings for changing the behavior of the App Service + Environment. + :type cluster_settings: list[~azure.mgmt.web.v2021_02_01.models.NameValuePair] + :param user_whitelisted_ip_ranges: User added ip ranges to whitelist on ASE db. + :type user_whitelisted_ip_ranges: list[str] + :ivar has_linux_workers: Flag that displays whether an ASE has linux workers or not. + :vartype has_linux_workers: bool + :param dedicated_host_count: Dedicated Host Count. + :type dedicated_host_count: int + :param zone_redundant: Whether or not this App Service Environment is zone-redundant. + :type zone_redundant: bool + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + 'virtual_network': {'required': True}, + 'multi_role_count': {'readonly': True}, + 'maximum_number_of_machines': {'readonly': True}, + 'suspended': {'readonly': True}, + 'has_linux_workers': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'virtual_network': {'key': 'virtualNetwork', 'type': 'VirtualNetworkProfile'}, + 'internal_load_balancing_mode': {'key': 'internalLoadBalancingMode', 'type': 'str'}, + 'multi_size': {'key': 'multiSize', 'type': 'str'}, + 'multi_role_count': {'key': 'multiRoleCount', 'type': 'int'}, + 'ipssl_address_count': {'key': 'ipsslAddressCount', 'type': 'int'}, + 'dns_suffix': {'key': 'dnsSuffix', 'type': 'str'}, + 'maximum_number_of_machines': {'key': 'maximumNumberOfMachines', 'type': 'int'}, + 'front_end_scale_factor': {'key': 'frontEndScaleFactor', 'type': 'int'}, + 'suspended': {'key': 'suspended', 'type': 'bool'}, + 'cluster_settings': {'key': 'clusterSettings', 'type': '[NameValuePair]'}, + 'user_whitelisted_ip_ranges': {'key': 'userWhitelistedIpRanges', 'type': '[str]'}, + 'has_linux_workers': {'key': 'hasLinuxWorkers', 'type': 'bool'}, + 'dedicated_host_count': {'key': 'dedicatedHostCount', 'type': 'int'}, + 'zone_redundant': {'key': 'zoneRedundant', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(AppServiceEnvironment, self).__init__(**kwargs) + self.provisioning_state = None + self.status = None + self.virtual_network = kwargs['virtual_network'] + self.internal_load_balancing_mode = kwargs.get('internal_load_balancing_mode', None) + self.multi_size = kwargs.get('multi_size', None) + self.multi_role_count = None + self.ipssl_address_count = kwargs.get('ipssl_address_count', None) + self.dns_suffix = kwargs.get('dns_suffix', None) + self.maximum_number_of_machines = None + self.front_end_scale_factor = kwargs.get('front_end_scale_factor', None) + self.suspended = None + self.cluster_settings = kwargs.get('cluster_settings', None) + self.user_whitelisted_ip_ranges = kwargs.get('user_whitelisted_ip_ranges', None) + self.has_linux_workers = None + self.dedicated_host_count = kwargs.get('dedicated_host_count', None) + self.zone_redundant = kwargs.get('zone_redundant', None) + + +class AppServiceEnvironmentCollection(msrest.serialization.Model): + """Collection of App Service Environments. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.AppServiceEnvironmentResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AppServiceEnvironmentResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AppServiceEnvironmentCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class AppServiceEnvironmentPatchResource(ProxyOnlyResource): + """ARM resource for a app service environment. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar provisioning_state: Provisioning state of the App Service Environment. Possible values + include: "Succeeded", "Failed", "Canceled", "InProgress", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.web.v2021_02_01.models.ProvisioningState + :ivar status: Current status of the App Service Environment. Possible values include: + "Preparing", "Ready", "Scaling", "Deleting". + :vartype status: str or ~azure.mgmt.web.v2021_02_01.models.HostingEnvironmentStatus + :param virtual_network: Description of the Virtual Network. + :type virtual_network: ~azure.mgmt.web.v2021_02_01.models.VirtualNetworkProfile + :param internal_load_balancing_mode: Specifies which endpoints to serve internally in the + Virtual Network for the App Service Environment. Possible values include: "None", "Web", + "Publishing", "Web, Publishing". + :type internal_load_balancing_mode: str or ~azure.mgmt.web.v2021_02_01.models.LoadBalancingMode + :param multi_size: Front-end VM size, e.g. "Medium", "Large". + :type multi_size: str + :ivar multi_role_count: Number of front-end instances. + :vartype multi_role_count: int + :param ipssl_address_count: Number of IP SSL addresses reserved for the App Service + Environment. + :type ipssl_address_count: int + :param dns_suffix: DNS suffix of the App Service Environment. + :type dns_suffix: str + :ivar maximum_number_of_machines: Maximum number of VMs in the App Service Environment. + :vartype maximum_number_of_machines: int + :param front_end_scale_factor: Scale factor for front-ends. + :type front_end_scale_factor: int + :ivar suspended: :code:`true` if the App Service Environment is suspended; + otherwise, :code:`false`. The environment can be suspended, e.g. when the + management endpoint is no longer available + (most likely because NSG blocked the incoming traffic). + :vartype suspended: bool + :param cluster_settings: Custom settings for changing the behavior of the App Service + Environment. + :type cluster_settings: list[~azure.mgmt.web.v2021_02_01.models.NameValuePair] + :param user_whitelisted_ip_ranges: User added ip ranges to whitelist on ASE db. + :type user_whitelisted_ip_ranges: list[str] + :ivar has_linux_workers: Flag that displays whether an ASE has linux workers or not. + :vartype has_linux_workers: bool + :param dedicated_host_count: Dedicated Host Count. + :type dedicated_host_count: int + :param zone_redundant: Whether or not this App Service Environment is zone-redundant. + :type zone_redundant: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + 'multi_role_count': {'readonly': True}, + 'maximum_number_of_machines': {'readonly': True}, + 'suspended': {'readonly': True}, + 'has_linux_workers': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'virtual_network': {'key': 'properties.virtualNetwork', 'type': 'VirtualNetworkProfile'}, + 'internal_load_balancing_mode': {'key': 'properties.internalLoadBalancingMode', 'type': 'str'}, + 'multi_size': {'key': 'properties.multiSize', 'type': 'str'}, + 'multi_role_count': {'key': 'properties.multiRoleCount', 'type': 'int'}, + 'ipssl_address_count': {'key': 'properties.ipsslAddressCount', 'type': 'int'}, + 'dns_suffix': {'key': 'properties.dnsSuffix', 'type': 'str'}, + 'maximum_number_of_machines': {'key': 'properties.maximumNumberOfMachines', 'type': 'int'}, + 'front_end_scale_factor': {'key': 'properties.frontEndScaleFactor', 'type': 'int'}, + 'suspended': {'key': 'properties.suspended', 'type': 'bool'}, + 'cluster_settings': {'key': 'properties.clusterSettings', 'type': '[NameValuePair]'}, + 'user_whitelisted_ip_ranges': {'key': 'properties.userWhitelistedIpRanges', 'type': '[str]'}, + 'has_linux_workers': {'key': 'properties.hasLinuxWorkers', 'type': 'bool'}, + 'dedicated_host_count': {'key': 'properties.dedicatedHostCount', 'type': 'int'}, + 'zone_redundant': {'key': 'properties.zoneRedundant', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(AppServiceEnvironmentPatchResource, self).__init__(**kwargs) + self.provisioning_state = None + self.status = None + self.virtual_network = kwargs.get('virtual_network', None) + self.internal_load_balancing_mode = kwargs.get('internal_load_balancing_mode', None) + self.multi_size = kwargs.get('multi_size', None) + self.multi_role_count = None + self.ipssl_address_count = kwargs.get('ipssl_address_count', None) + self.dns_suffix = kwargs.get('dns_suffix', None) + self.maximum_number_of_machines = None + self.front_end_scale_factor = kwargs.get('front_end_scale_factor', None) + self.suspended = None + self.cluster_settings = kwargs.get('cluster_settings', None) + self.user_whitelisted_ip_ranges = kwargs.get('user_whitelisted_ip_ranges', None) + self.has_linux_workers = None + self.dedicated_host_count = kwargs.get('dedicated_host_count', None) + self.zone_redundant = kwargs.get('zone_redundant', None) + + +class AppServiceEnvironmentResource(Resource): + """App Service Environment ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar provisioning_state: Provisioning state of the App Service Environment. Possible values + include: "Succeeded", "Failed", "Canceled", "InProgress", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.web.v2021_02_01.models.ProvisioningState + :ivar status: Current status of the App Service Environment. Possible values include: + "Preparing", "Ready", "Scaling", "Deleting". + :vartype status: str or ~azure.mgmt.web.v2021_02_01.models.HostingEnvironmentStatus + :param virtual_network: Description of the Virtual Network. + :type virtual_network: ~azure.mgmt.web.v2021_02_01.models.VirtualNetworkProfile + :param internal_load_balancing_mode: Specifies which endpoints to serve internally in the + Virtual Network for the App Service Environment. Possible values include: "None", "Web", + "Publishing", "Web, Publishing". + :type internal_load_balancing_mode: str or ~azure.mgmt.web.v2021_02_01.models.LoadBalancingMode + :param multi_size: Front-end VM size, e.g. "Medium", "Large". + :type multi_size: str + :ivar multi_role_count: Number of front-end instances. + :vartype multi_role_count: int + :param ipssl_address_count: Number of IP SSL addresses reserved for the App Service + Environment. + :type ipssl_address_count: int + :param dns_suffix: DNS suffix of the App Service Environment. + :type dns_suffix: str + :ivar maximum_number_of_machines: Maximum number of VMs in the App Service Environment. + :vartype maximum_number_of_machines: int + :param front_end_scale_factor: Scale factor for front-ends. + :type front_end_scale_factor: int + :ivar suspended: :code:`true` if the App Service Environment is suspended; + otherwise, :code:`false`. The environment can be suspended, e.g. when the + management endpoint is no longer available + (most likely because NSG blocked the incoming traffic). + :vartype suspended: bool + :param cluster_settings: Custom settings for changing the behavior of the App Service + Environment. + :type cluster_settings: list[~azure.mgmt.web.v2021_02_01.models.NameValuePair] + :param user_whitelisted_ip_ranges: User added ip ranges to whitelist on ASE db. + :type user_whitelisted_ip_ranges: list[str] + :ivar has_linux_workers: Flag that displays whether an ASE has linux workers or not. + :vartype has_linux_workers: bool + :param dedicated_host_count: Dedicated Host Count. + :type dedicated_host_count: int + :param zone_redundant: Whether or not this App Service Environment is zone-redundant. + :type zone_redundant: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + 'multi_role_count': {'readonly': True}, + 'maximum_number_of_machines': {'readonly': True}, + 'suspended': {'readonly': True}, + 'has_linux_workers': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'virtual_network': {'key': 'properties.virtualNetwork', 'type': 'VirtualNetworkProfile'}, + 'internal_load_balancing_mode': {'key': 'properties.internalLoadBalancingMode', 'type': 'str'}, + 'multi_size': {'key': 'properties.multiSize', 'type': 'str'}, + 'multi_role_count': {'key': 'properties.multiRoleCount', 'type': 'int'}, + 'ipssl_address_count': {'key': 'properties.ipsslAddressCount', 'type': 'int'}, + 'dns_suffix': {'key': 'properties.dnsSuffix', 'type': 'str'}, + 'maximum_number_of_machines': {'key': 'properties.maximumNumberOfMachines', 'type': 'int'}, + 'front_end_scale_factor': {'key': 'properties.frontEndScaleFactor', 'type': 'int'}, + 'suspended': {'key': 'properties.suspended', 'type': 'bool'}, + 'cluster_settings': {'key': 'properties.clusterSettings', 'type': '[NameValuePair]'}, + 'user_whitelisted_ip_ranges': {'key': 'properties.userWhitelistedIpRanges', 'type': '[str]'}, + 'has_linux_workers': {'key': 'properties.hasLinuxWorkers', 'type': 'bool'}, + 'dedicated_host_count': {'key': 'properties.dedicatedHostCount', 'type': 'int'}, + 'zone_redundant': {'key': 'properties.zoneRedundant', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(AppServiceEnvironmentResource, self).__init__(**kwargs) + self.provisioning_state = None + self.status = None + self.virtual_network = kwargs.get('virtual_network', None) + self.internal_load_balancing_mode = kwargs.get('internal_load_balancing_mode', None) + self.multi_size = kwargs.get('multi_size', None) + self.multi_role_count = None + self.ipssl_address_count = kwargs.get('ipssl_address_count', None) + self.dns_suffix = kwargs.get('dns_suffix', None) + self.maximum_number_of_machines = None + self.front_end_scale_factor = kwargs.get('front_end_scale_factor', None) + self.suspended = None + self.cluster_settings = kwargs.get('cluster_settings', None) + self.user_whitelisted_ip_ranges = kwargs.get('user_whitelisted_ip_ranges', None) + self.has_linux_workers = None + self.dedicated_host_count = kwargs.get('dedicated_host_count', None) + self.zone_redundant = kwargs.get('zone_redundant', None) + + +class AppserviceGithubToken(msrest.serialization.Model): + """Github access token for Appservice CLI github integration. + + :param access_token: Github access token for Appservice CLI github integration. + :type access_token: str + :param scope: Scope of the github access token. + :type scope: str + :param token_type: token type. + :type token_type: str + :param got_token: True if valid github token received, False otherwise. + :type got_token: bool + :param error_message: Error message if unable to get token. + :type error_message: str + """ + + _attribute_map = { + 'access_token': {'key': 'accessToken', 'type': 'str'}, + 'scope': {'key': 'scope', 'type': 'str'}, + 'token_type': {'key': 'tokenType', 'type': 'str'}, + 'got_token': {'key': 'gotToken', 'type': 'bool'}, + 'error_message': {'key': 'errorMessage', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AppserviceGithubToken, self).__init__(**kwargs) + self.access_token = kwargs.get('access_token', None) + self.scope = kwargs.get('scope', None) + self.token_type = kwargs.get('token_type', None) + self.got_token = kwargs.get('got_token', None) + self.error_message = kwargs.get('error_message', None) + + +class AppserviceGithubTokenRequest(msrest.serialization.Model): + """Appservice Github token request content. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. Code string to exchange for Github Access token. + :type code: str + :param state: Required. State string used for verification. + :type state: str + """ + + _validation = { + 'code': {'required': True}, + 'state': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AppserviceGithubTokenRequest, self).__init__(**kwargs) + self.code = kwargs['code'] + self.state = kwargs['state'] + + +class AppServicePlan(Resource): + """App Service plan. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param sku: Description of a SKU for a scalable resource. + :type sku: ~azure.mgmt.web.v2021_02_01.models.SkuDescription + :param extended_location: Extended Location. + :type extended_location: ~azure.mgmt.web.v2021_02_01.models.ExtendedLocation + :param worker_tier_name: Target worker tier assigned to the App Service plan. + :type worker_tier_name: str + :ivar status: App Service plan status. Possible values include: "Ready", "Pending", "Creating". + :vartype status: str or ~azure.mgmt.web.v2021_02_01.models.StatusOptions + :ivar subscription: App Service plan subscription. + :vartype subscription: str + :param hosting_environment_profile: Specification for the App Service Environment to use for + the App Service plan. + :type hosting_environment_profile: ~azure.mgmt.web.v2021_02_01.models.HostingEnvironmentProfile + :ivar maximum_number_of_workers: Maximum number of instances that can be assigned to this App + Service plan. + :vartype maximum_number_of_workers: int + :ivar geo_region: Geographical location for the App Service plan. + :vartype geo_region: str + :param per_site_scaling: If :code:`true`, apps assigned to this App Service plan + can be scaled independently. + If :code:`false`, apps assigned to this App Service plan will scale to all + instances of the plan. + :type per_site_scaling: bool + :param elastic_scale_enabled: ServerFarm supports ElasticScale. Apps in this plan will scale as + if the ServerFarm was ElasticPremium sku. + :type elastic_scale_enabled: bool + :param maximum_elastic_worker_count: Maximum number of total workers allowed for this + ElasticScaleEnabled App Service Plan. + :type maximum_elastic_worker_count: int + :ivar number_of_sites: Number of apps assigned to this App Service plan. + :vartype number_of_sites: int + :param is_spot: If :code:`true`, this App Service Plan owns spot instances. + :type is_spot: bool + :param spot_expiration_time: The time when the server farm expires. Valid only if it is a spot + server farm. + :type spot_expiration_time: ~datetime.datetime + :param free_offer_expiration_time: The time when the server farm free offer expires. + :type free_offer_expiration_time: ~datetime.datetime + :ivar resource_group: Resource group of the App Service plan. + :vartype resource_group: str + :param reserved: If Linux app service plan :code:`true`, + :code:`false` otherwise. + :type reserved: bool + :param is_xenon: Obsolete: If Hyper-V container app service plan :code:`true`, + :code:`false` otherwise. + :type is_xenon: bool + :param hyper_v: If Hyper-V container app service plan :code:`true`, + :code:`false` otherwise. + :type hyper_v: bool + :param target_worker_count: Scaling worker count. + :type target_worker_count: int + :param target_worker_size_id: Scaling worker size ID. + :type target_worker_size_id: int + :ivar provisioning_state: Provisioning state of the App Service Plan. Possible values include: + "Succeeded", "Failed", "Canceled", "InProgress", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.web.v2021_02_01.models.ProvisioningState + :param kube_environment_profile: Specification for the Kubernetes Environment to use for the + App Service plan. + :type kube_environment_profile: ~azure.mgmt.web.v2021_02_01.models.KubeEnvironmentProfile + :param zone_redundant: If :code:`true`, this App Service Plan will perform + availability zone balancing. + If :code:`false`, this App Service Plan will not perform availability zone + balancing. + :type zone_redundant: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'status': {'readonly': True}, + 'subscription': {'readonly': True}, + 'maximum_number_of_workers': {'readonly': True}, + 'geo_region': {'readonly': True}, + 'number_of_sites': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'SkuDescription'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'worker_tier_name': {'key': 'properties.workerTierName', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'subscription': {'key': 'properties.subscription', 'type': 'str'}, + 'hosting_environment_profile': {'key': 'properties.hostingEnvironmentProfile', 'type': 'HostingEnvironmentProfile'}, + 'maximum_number_of_workers': {'key': 'properties.maximumNumberOfWorkers', 'type': 'int'}, + 'geo_region': {'key': 'properties.geoRegion', 'type': 'str'}, + 'per_site_scaling': {'key': 'properties.perSiteScaling', 'type': 'bool'}, + 'elastic_scale_enabled': {'key': 'properties.elasticScaleEnabled', 'type': 'bool'}, + 'maximum_elastic_worker_count': {'key': 'properties.maximumElasticWorkerCount', 'type': 'int'}, + 'number_of_sites': {'key': 'properties.numberOfSites', 'type': 'int'}, + 'is_spot': {'key': 'properties.isSpot', 'type': 'bool'}, + 'spot_expiration_time': {'key': 'properties.spotExpirationTime', 'type': 'iso-8601'}, + 'free_offer_expiration_time': {'key': 'properties.freeOfferExpirationTime', 'type': 'iso-8601'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'reserved': {'key': 'properties.reserved', 'type': 'bool'}, + 'is_xenon': {'key': 'properties.isXenon', 'type': 'bool'}, + 'hyper_v': {'key': 'properties.hyperV', 'type': 'bool'}, + 'target_worker_count': {'key': 'properties.targetWorkerCount', 'type': 'int'}, + 'target_worker_size_id': {'key': 'properties.targetWorkerSizeId', 'type': 'int'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'kube_environment_profile': {'key': 'properties.kubeEnvironmentProfile', 'type': 'KubeEnvironmentProfile'}, + 'zone_redundant': {'key': 'properties.zoneRedundant', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(AppServicePlan, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.extended_location = kwargs.get('extended_location', None) + self.worker_tier_name = kwargs.get('worker_tier_name', None) + self.status = None + self.subscription = None + self.hosting_environment_profile = kwargs.get('hosting_environment_profile', None) + self.maximum_number_of_workers = None + self.geo_region = None + self.per_site_scaling = kwargs.get('per_site_scaling', False) + self.elastic_scale_enabled = kwargs.get('elastic_scale_enabled', None) + self.maximum_elastic_worker_count = kwargs.get('maximum_elastic_worker_count', None) + self.number_of_sites = None + self.is_spot = kwargs.get('is_spot', None) + self.spot_expiration_time = kwargs.get('spot_expiration_time', None) + self.free_offer_expiration_time = kwargs.get('free_offer_expiration_time', None) + self.resource_group = None + self.reserved = kwargs.get('reserved', False) + self.is_xenon = kwargs.get('is_xenon', False) + self.hyper_v = kwargs.get('hyper_v', False) + self.target_worker_count = kwargs.get('target_worker_count', None) + self.target_worker_size_id = kwargs.get('target_worker_size_id', None) + self.provisioning_state = None + self.kube_environment_profile = kwargs.get('kube_environment_profile', None) + self.zone_redundant = kwargs.get('zone_redundant', False) + + +class AppServicePlanCollection(msrest.serialization.Model): + """Collection of App Service plans. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.AppServicePlan] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AppServicePlan]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AppServicePlanCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class AppServicePlanPatchResource(ProxyOnlyResource): + """ARM resource for a app service plan. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param worker_tier_name: Target worker tier assigned to the App Service plan. + :type worker_tier_name: str + :ivar status: App Service plan status. Possible values include: "Ready", "Pending", "Creating". + :vartype status: str or ~azure.mgmt.web.v2021_02_01.models.StatusOptions + :ivar subscription: App Service plan subscription. + :vartype subscription: str + :param hosting_environment_profile: Specification for the App Service Environment to use for + the App Service plan. + :type hosting_environment_profile: ~azure.mgmt.web.v2021_02_01.models.HostingEnvironmentProfile + :ivar maximum_number_of_workers: Maximum number of instances that can be assigned to this App + Service plan. + :vartype maximum_number_of_workers: int + :ivar geo_region: Geographical location for the App Service plan. + :vartype geo_region: str + :param per_site_scaling: If :code:`true`, apps assigned to this App Service plan + can be scaled independently. + If :code:`false`, apps assigned to this App Service plan will scale to all + instances of the plan. + :type per_site_scaling: bool + :param elastic_scale_enabled: ServerFarm supports ElasticScale. Apps in this plan will scale as + if the ServerFarm was ElasticPremium sku. + :type elastic_scale_enabled: bool + :param maximum_elastic_worker_count: Maximum number of total workers allowed for this + ElasticScaleEnabled App Service Plan. + :type maximum_elastic_worker_count: int + :ivar number_of_sites: Number of apps assigned to this App Service plan. + :vartype number_of_sites: int + :param is_spot: If :code:`true`, this App Service Plan owns spot instances. + :type is_spot: bool + :param spot_expiration_time: The time when the server farm expires. Valid only if it is a spot + server farm. + :type spot_expiration_time: ~datetime.datetime + :param free_offer_expiration_time: The time when the server farm free offer expires. + :type free_offer_expiration_time: ~datetime.datetime + :ivar resource_group: Resource group of the App Service plan. + :vartype resource_group: str + :param reserved: If Linux app service plan :code:`true`, + :code:`false` otherwise. + :type reserved: bool + :param is_xenon: Obsolete: If Hyper-V container app service plan :code:`true`, + :code:`false` otherwise. + :type is_xenon: bool + :param hyper_v: If Hyper-V container app service plan :code:`true`, + :code:`false` otherwise. + :type hyper_v: bool + :param target_worker_count: Scaling worker count. + :type target_worker_count: int + :param target_worker_size_id: Scaling worker size ID. + :type target_worker_size_id: int + :ivar provisioning_state: Provisioning state of the App Service Plan. Possible values include: + "Succeeded", "Failed", "Canceled", "InProgress", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.web.v2021_02_01.models.ProvisioningState + :param kube_environment_profile: Specification for the Kubernetes Environment to use for the + App Service plan. + :type kube_environment_profile: ~azure.mgmt.web.v2021_02_01.models.KubeEnvironmentProfile + :param zone_redundant: If :code:`true`, this App Service Plan will perform + availability zone balancing. + If :code:`false`, this App Service Plan will not perform availability zone + balancing. + :type zone_redundant: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'status': {'readonly': True}, + 'subscription': {'readonly': True}, + 'maximum_number_of_workers': {'readonly': True}, + 'geo_region': {'readonly': True}, + 'number_of_sites': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'worker_tier_name': {'key': 'properties.workerTierName', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'subscription': {'key': 'properties.subscription', 'type': 'str'}, + 'hosting_environment_profile': {'key': 'properties.hostingEnvironmentProfile', 'type': 'HostingEnvironmentProfile'}, + 'maximum_number_of_workers': {'key': 'properties.maximumNumberOfWorkers', 'type': 'int'}, + 'geo_region': {'key': 'properties.geoRegion', 'type': 'str'}, + 'per_site_scaling': {'key': 'properties.perSiteScaling', 'type': 'bool'}, + 'elastic_scale_enabled': {'key': 'properties.elasticScaleEnabled', 'type': 'bool'}, + 'maximum_elastic_worker_count': {'key': 'properties.maximumElasticWorkerCount', 'type': 'int'}, + 'number_of_sites': {'key': 'properties.numberOfSites', 'type': 'int'}, + 'is_spot': {'key': 'properties.isSpot', 'type': 'bool'}, + 'spot_expiration_time': {'key': 'properties.spotExpirationTime', 'type': 'iso-8601'}, + 'free_offer_expiration_time': {'key': 'properties.freeOfferExpirationTime', 'type': 'iso-8601'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'reserved': {'key': 'properties.reserved', 'type': 'bool'}, + 'is_xenon': {'key': 'properties.isXenon', 'type': 'bool'}, + 'hyper_v': {'key': 'properties.hyperV', 'type': 'bool'}, + 'target_worker_count': {'key': 'properties.targetWorkerCount', 'type': 'int'}, + 'target_worker_size_id': {'key': 'properties.targetWorkerSizeId', 'type': 'int'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'kube_environment_profile': {'key': 'properties.kubeEnvironmentProfile', 'type': 'KubeEnvironmentProfile'}, + 'zone_redundant': {'key': 'properties.zoneRedundant', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(AppServicePlanPatchResource, self).__init__(**kwargs) + self.worker_tier_name = kwargs.get('worker_tier_name', None) + self.status = None + self.subscription = None + self.hosting_environment_profile = kwargs.get('hosting_environment_profile', None) + self.maximum_number_of_workers = None + self.geo_region = None + self.per_site_scaling = kwargs.get('per_site_scaling', False) + self.elastic_scale_enabled = kwargs.get('elastic_scale_enabled', None) + self.maximum_elastic_worker_count = kwargs.get('maximum_elastic_worker_count', None) + self.number_of_sites = None + self.is_spot = kwargs.get('is_spot', None) + self.spot_expiration_time = kwargs.get('spot_expiration_time', None) + self.free_offer_expiration_time = kwargs.get('free_offer_expiration_time', None) + self.resource_group = None + self.reserved = kwargs.get('reserved', False) + self.is_xenon = kwargs.get('is_xenon', False) + self.hyper_v = kwargs.get('hyper_v', False) + self.target_worker_count = kwargs.get('target_worker_count', None) + self.target_worker_size_id = kwargs.get('target_worker_size_id', None) + self.provisioning_state = None + self.kube_environment_profile = kwargs.get('kube_environment_profile', None) + self.zone_redundant = kwargs.get('zone_redundant', False) + + +class ArcConfiguration(msrest.serialization.Model): + """ArcConfiguration. + + :param artifacts_storage_type: Possible values include: "LocalNode", "NetworkFileSystem". + :type artifacts_storage_type: str or ~azure.mgmt.web.v2021_02_01.models.StorageType + :param artifact_storage_class_name: + :type artifact_storage_class_name: str + :param artifact_storage_mount_path: + :type artifact_storage_mount_path: str + :param artifact_storage_node_name: + :type artifact_storage_node_name: str + :param artifact_storage_access_mode: + :type artifact_storage_access_mode: str + :param front_end_service_configuration: + :type front_end_service_configuration: ~azure.mgmt.web.v2021_02_01.models.FrontEndConfiguration + :param kube_config: + :type kube_config: str + """ + + _attribute_map = { + 'artifacts_storage_type': {'key': 'artifactsStorageType', 'type': 'str'}, + 'artifact_storage_class_name': {'key': 'artifactStorageClassName', 'type': 'str'}, + 'artifact_storage_mount_path': {'key': 'artifactStorageMountPath', 'type': 'str'}, + 'artifact_storage_node_name': {'key': 'artifactStorageNodeName', 'type': 'str'}, + 'artifact_storage_access_mode': {'key': 'artifactStorageAccessMode', 'type': 'str'}, + 'front_end_service_configuration': {'key': 'frontEndServiceConfiguration', 'type': 'FrontEndConfiguration'}, + 'kube_config': {'key': 'kubeConfig', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ArcConfiguration, self).__init__(**kwargs) + self.artifacts_storage_type = kwargs.get('artifacts_storage_type', None) + self.artifact_storage_class_name = kwargs.get('artifact_storage_class_name', None) + self.artifact_storage_mount_path = kwargs.get('artifact_storage_mount_path', None) + self.artifact_storage_node_name = kwargs.get('artifact_storage_node_name', None) + self.artifact_storage_access_mode = kwargs.get('artifact_storage_access_mode', None) + self.front_end_service_configuration = kwargs.get('front_end_service_configuration', None) + self.kube_config = kwargs.get('kube_config', None) + + +class ArmIdWrapper(msrest.serialization.Model): + """A wrapper for an ARM resource id. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ArmIdWrapper, self).__init__(**kwargs) + self.id = None + + +class ArmPlan(msrest.serialization.Model): + """The plan object in Azure Resource Manager, represents a marketplace plan. + + :param name: The name. + :type name: str + :param publisher: The publisher. + :type publisher: str + :param product: The product. + :type product: str + :param promotion_code: The promotion code. + :type promotion_code: str + :param version: Version of product. + :type version: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'product': {'key': 'product', 'type': 'str'}, + 'promotion_code': {'key': 'promotionCode', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ArmPlan, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.publisher = kwargs.get('publisher', None) + self.product = kwargs.get('product', None) + self.promotion_code = kwargs.get('promotion_code', None) + self.version = kwargs.get('version', None) + + +class AseV3NetworkingConfiguration(ProxyOnlyResource): + """Full view of networking configuration for an ASE. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar windows_outbound_ip_addresses: + :vartype windows_outbound_ip_addresses: list[str] + :ivar linux_outbound_ip_addresses: + :vartype linux_outbound_ip_addresses: list[str] + :ivar external_inbound_ip_addresses: + :vartype external_inbound_ip_addresses: list[str] + :ivar internal_inbound_ip_addresses: + :vartype internal_inbound_ip_addresses: list[str] + :param allow_new_private_endpoint_connections: Property to enable and disable new private + endpoint connection creation on ASE. + :type allow_new_private_endpoint_connections: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'windows_outbound_ip_addresses': {'readonly': True}, + 'linux_outbound_ip_addresses': {'readonly': True}, + 'external_inbound_ip_addresses': {'readonly': True}, + 'internal_inbound_ip_addresses': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'windows_outbound_ip_addresses': {'key': 'properties.windowsOutboundIpAddresses', 'type': '[str]'}, + 'linux_outbound_ip_addresses': {'key': 'properties.linuxOutboundIpAddresses', 'type': '[str]'}, + 'external_inbound_ip_addresses': {'key': 'properties.externalInboundIpAddresses', 'type': '[str]'}, + 'internal_inbound_ip_addresses': {'key': 'properties.internalInboundIpAddresses', 'type': '[str]'}, + 'allow_new_private_endpoint_connections': {'key': 'properties.allowNewPrivateEndpointConnections', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(AseV3NetworkingConfiguration, self).__init__(**kwargs) + self.windows_outbound_ip_addresses = None + self.linux_outbound_ip_addresses = None + self.external_inbound_ip_addresses = None + self.internal_inbound_ip_addresses = None + self.allow_new_private_endpoint_connections = kwargs.get('allow_new_private_endpoint_connections', None) + + +class AuthPlatform(msrest.serialization.Model): + """The configuration settings of the platform of App Service Authentication/Authorization. + + :param enabled: :code:`true` if the Authentication / Authorization feature is + enabled for the current app; otherwise, :code:`false`. + :type enabled: bool + :param runtime_version: The RuntimeVersion of the Authentication / Authorization feature in use + for the current app. + The setting in this value can control the behavior of certain features in the Authentication / + Authorization module. + :type runtime_version: str + :param config_file_path: The path of the config file containing auth settings if they come from + a file. + If the path is relative, base will the site's root directory. + :type config_file_path: str + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, + 'config_file_path': {'key': 'configFilePath', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AuthPlatform, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.runtime_version = kwargs.get('runtime_version', None) + self.config_file_path = kwargs.get('config_file_path', None) + + +class AutoHealActions(msrest.serialization.Model): + """Actions which to take by the auto-heal module when a rule is triggered. + + :param action_type: Predefined action to be taken. Possible values include: "Recycle", + "LogEvent", "CustomAction". + :type action_type: str or ~azure.mgmt.web.v2021_02_01.models.AutoHealActionType + :param custom_action: Custom action to be taken. + :type custom_action: ~azure.mgmt.web.v2021_02_01.models.AutoHealCustomAction + :param min_process_execution_time: Minimum time the process must execute + before taking the action. + :type min_process_execution_time: str + """ + + _attribute_map = { + 'action_type': {'key': 'actionType', 'type': 'str'}, + 'custom_action': {'key': 'customAction', 'type': 'AutoHealCustomAction'}, + 'min_process_execution_time': {'key': 'minProcessExecutionTime', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AutoHealActions, self).__init__(**kwargs) + self.action_type = kwargs.get('action_type', None) + self.custom_action = kwargs.get('custom_action', None) + self.min_process_execution_time = kwargs.get('min_process_execution_time', None) + + +class AutoHealCustomAction(msrest.serialization.Model): + """Custom action to be executed +when an auto heal rule is triggered. + + :param exe: Executable to be run. + :type exe: str + :param parameters: Parameters for the executable. + :type parameters: str + """ + + _attribute_map = { + 'exe': {'key': 'exe', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AutoHealCustomAction, self).__init__(**kwargs) + self.exe = kwargs.get('exe', None) + self.parameters = kwargs.get('parameters', None) + + +class AutoHealRules(msrest.serialization.Model): + """Rules that can be defined for auto-heal. + + :param triggers: Conditions that describe when to execute the auto-heal actions. + :type triggers: ~azure.mgmt.web.v2021_02_01.models.AutoHealTriggers + :param actions: Actions to be executed when a rule is triggered. + :type actions: ~azure.mgmt.web.v2021_02_01.models.AutoHealActions + """ + + _attribute_map = { + 'triggers': {'key': 'triggers', 'type': 'AutoHealTriggers'}, + 'actions': {'key': 'actions', 'type': 'AutoHealActions'}, + } + + def __init__( + self, + **kwargs + ): + super(AutoHealRules, self).__init__(**kwargs) + self.triggers = kwargs.get('triggers', None) + self.actions = kwargs.get('actions', None) + + +class AutoHealTriggers(msrest.serialization.Model): + """Triggers for auto-heal. + + :param requests: A rule based on total requests. + :type requests: ~azure.mgmt.web.v2021_02_01.models.RequestsBasedTrigger + :param private_bytes_in_kb: A rule based on private bytes. + :type private_bytes_in_kb: int + :param status_codes: A rule based on status codes. + :type status_codes: list[~azure.mgmt.web.v2021_02_01.models.StatusCodesBasedTrigger] + :param slow_requests: A rule based on request execution time. + :type slow_requests: ~azure.mgmt.web.v2021_02_01.models.SlowRequestsBasedTrigger + :param slow_requests_with_path: A rule based on multiple Slow Requests Rule with path. + :type slow_requests_with_path: + list[~azure.mgmt.web.v2021_02_01.models.SlowRequestsBasedTrigger] + :param status_codes_range: A rule based on status codes ranges. + :type status_codes_range: list[~azure.mgmt.web.v2021_02_01.models.StatusCodesRangeBasedTrigger] + """ + + _attribute_map = { + 'requests': {'key': 'requests', 'type': 'RequestsBasedTrigger'}, + 'private_bytes_in_kb': {'key': 'privateBytesInKB', 'type': 'int'}, + 'status_codes': {'key': 'statusCodes', 'type': '[StatusCodesBasedTrigger]'}, + 'slow_requests': {'key': 'slowRequests', 'type': 'SlowRequestsBasedTrigger'}, + 'slow_requests_with_path': {'key': 'slowRequestsWithPath', 'type': '[SlowRequestsBasedTrigger]'}, + 'status_codes_range': {'key': 'statusCodesRange', 'type': '[StatusCodesRangeBasedTrigger]'}, + } + + def __init__( + self, + **kwargs + ): + super(AutoHealTriggers, self).__init__(**kwargs) + self.requests = kwargs.get('requests', None) + self.private_bytes_in_kb = kwargs.get('private_bytes_in_kb', None) + self.status_codes = kwargs.get('status_codes', None) + self.slow_requests = kwargs.get('slow_requests', None) + self.slow_requests_with_path = kwargs.get('slow_requests_with_path', None) + self.status_codes_range = kwargs.get('status_codes_range', None) + + +class AzureActiveDirectory(msrest.serialization.Model): + """The configuration settings of the Azure Active directory provider. + + :param enabled: :code:`false` if the Azure Active Directory provider should not be + enabled despite the set registration; otherwise, :code:`true`. + :type enabled: bool + :param registration: The configuration settings of the Azure Active Directory app registration. + :type registration: ~azure.mgmt.web.v2021_02_01.models.AzureActiveDirectoryRegistration + :param login: The configuration settings of the Azure Active Directory login flow. + :type login: ~azure.mgmt.web.v2021_02_01.models.AzureActiveDirectoryLogin + :param validation: The configuration settings of the Azure Active Directory token validation + flow. + :type validation: ~azure.mgmt.web.v2021_02_01.models.AzureActiveDirectoryValidation + :param is_auto_provisioned: Gets a value indicating whether the Azure AD configuration was + auto-provisioned using 1st party tooling. + This is an internal flag primarily intended to support the Azure Management Portal. Users + should not + read or write to this property. + :type is_auto_provisioned: bool + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'AzureActiveDirectoryRegistration'}, + 'login': {'key': 'login', 'type': 'AzureActiveDirectoryLogin'}, + 'validation': {'key': 'validation', 'type': 'AzureActiveDirectoryValidation'}, + 'is_auto_provisioned': {'key': 'isAutoProvisioned', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureActiveDirectory, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.registration = kwargs.get('registration', None) + self.login = kwargs.get('login', None) + self.validation = kwargs.get('validation', None) + self.is_auto_provisioned = kwargs.get('is_auto_provisioned', None) + + +class AzureActiveDirectoryLogin(msrest.serialization.Model): + """The configuration settings of the Azure Active Directory login flow. + + :param login_parameters: Login parameters to send to the OpenID Connect authorization endpoint + when + a user logs in. Each parameter must be in the form "key=value". + :type login_parameters: list[str] + :param disable_www_authenticate: :code:`true` if the www-authenticate provider + should be omitted from the request; otherwise, :code:`false`. + :type disable_www_authenticate: bool + """ + + _attribute_map = { + 'login_parameters': {'key': 'loginParameters', 'type': '[str]'}, + 'disable_www_authenticate': {'key': 'disableWWWAuthenticate', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureActiveDirectoryLogin, self).__init__(**kwargs) + self.login_parameters = kwargs.get('login_parameters', None) + self.disable_www_authenticate = kwargs.get('disable_www_authenticate', None) + + +class AzureActiveDirectoryRegistration(msrest.serialization.Model): + """The configuration settings of the Azure Active Directory app registration. + + :param open_id_issuer: The OpenID Connect Issuer URI that represents the entity which issues + access tokens for this application. + When using Azure Active Directory, this value is the URI of the directory tenant, e.g. + https://login.microsoftonline.com/v2.0/{tenant-guid}/. + This URI is a case-sensitive identifier for the token issuer. + More information on OpenID Connect Discovery: + http://openid.net/specs/openid-connect-discovery-1_0.html. + :type open_id_issuer: str + :param client_id: The Client ID of this relying party application, known as the client_id. + This setting is required for enabling OpenID Connection authentication with Azure Active + Directory or + other 3rd party OpenID Connect providers. + More information on OpenID Connect: http://openid.net/specs/openid-connect-core-1_0.html. + :type client_id: str + :param client_secret_setting_name: The app setting name that contains the client secret of the + relying party application. + :type client_secret_setting_name: str + :param client_secret_certificate_thumbprint: An alternative to the client secret, that is the + thumbprint of a certificate used for signing purposes. This property acts as + a replacement for the Client Secret. It is also optional. + :type client_secret_certificate_thumbprint: str + :param client_secret_certificate_subject_alternative_name: An alternative to the client secret + thumbprint, that is the subject alternative name of a certificate used for signing purposes. + This property acts as + a replacement for the Client Secret Certificate Thumbprint. It is also optional. + :type client_secret_certificate_subject_alternative_name: str + :param client_secret_certificate_issuer: An alternative to the client secret thumbprint, that + is the issuer of a certificate used for signing purposes. This property acts as + a replacement for the Client Secret Certificate Thumbprint. It is also optional. + :type client_secret_certificate_issuer: str + """ + + _attribute_map = { + 'open_id_issuer': {'key': 'openIdIssuer', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'client_secret_setting_name': {'key': 'clientSecretSettingName', 'type': 'str'}, + 'client_secret_certificate_thumbprint': {'key': 'clientSecretCertificateThumbprint', 'type': 'str'}, + 'client_secret_certificate_subject_alternative_name': {'key': 'clientSecretCertificateSubjectAlternativeName', 'type': 'str'}, + 'client_secret_certificate_issuer': {'key': 'clientSecretCertificateIssuer', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureActiveDirectoryRegistration, self).__init__(**kwargs) + self.open_id_issuer = kwargs.get('open_id_issuer', None) + self.client_id = kwargs.get('client_id', None) + self.client_secret_setting_name = kwargs.get('client_secret_setting_name', None) + self.client_secret_certificate_thumbprint = kwargs.get('client_secret_certificate_thumbprint', None) + self.client_secret_certificate_subject_alternative_name = kwargs.get('client_secret_certificate_subject_alternative_name', None) + self.client_secret_certificate_issuer = kwargs.get('client_secret_certificate_issuer', None) + + +class AzureActiveDirectoryValidation(msrest.serialization.Model): + """The configuration settings of the Azure Active Directory token validation flow. + + :param jwt_claim_checks: The configuration settings of the checks that should be made while + validating the JWT Claims. + :type jwt_claim_checks: ~azure.mgmt.web.v2021_02_01.models.JwtClaimChecks + :param allowed_audiences: The list of audiences that can make successful + authentication/authorization requests. + :type allowed_audiences: list[str] + :param default_authorization_policy: The configuration settings of the default authorization + policy. + :type default_authorization_policy: + ~azure.mgmt.web.v2021_02_01.models.DefaultAuthorizationPolicy + """ + + _attribute_map = { + 'jwt_claim_checks': {'key': 'jwtClaimChecks', 'type': 'JwtClaimChecks'}, + 'allowed_audiences': {'key': 'allowedAudiences', 'type': '[str]'}, + 'default_authorization_policy': {'key': 'defaultAuthorizationPolicy', 'type': 'DefaultAuthorizationPolicy'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureActiveDirectoryValidation, self).__init__(**kwargs) + self.jwt_claim_checks = kwargs.get('jwt_claim_checks', None) + self.allowed_audiences = kwargs.get('allowed_audiences', None) + self.default_authorization_policy = kwargs.get('default_authorization_policy', None) + + +class AzureBlobStorageApplicationLogsConfig(msrest.serialization.Model): + """Application logs azure blob storage configuration. + + :param level: Log level. Possible values include: "Off", "Verbose", "Information", "Warning", + "Error". + :type level: str or ~azure.mgmt.web.v2021_02_01.models.LogLevel + :param sas_url: SAS url to a azure blob container with read/write/list/delete permissions. + :type sas_url: str + :param retention_in_days: Retention in days. + Remove blobs older than X days. + 0 or lower means no retention. + :type retention_in_days: int + """ + + _attribute_map = { + 'level': {'key': 'level', 'type': 'str'}, + 'sas_url': {'key': 'sasUrl', 'type': 'str'}, + 'retention_in_days': {'key': 'retentionInDays', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureBlobStorageApplicationLogsConfig, self).__init__(**kwargs) + self.level = kwargs.get('level', None) + self.sas_url = kwargs.get('sas_url', None) + self.retention_in_days = kwargs.get('retention_in_days', None) + + +class AzureBlobStorageHttpLogsConfig(msrest.serialization.Model): + """Http logs to azure blob storage configuration. + + :param sas_url: SAS url to a azure blob container with read/write/list/delete permissions. + :type sas_url: str + :param retention_in_days: Retention in days. + Remove blobs older than X days. + 0 or lower means no retention. + :type retention_in_days: int + :param enabled: True if configuration is enabled, false if it is disabled and null if + configuration is not set. + :type enabled: bool + """ + + _attribute_map = { + 'sas_url': {'key': 'sasUrl', 'type': 'str'}, + 'retention_in_days': {'key': 'retentionInDays', 'type': 'int'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureBlobStorageHttpLogsConfig, self).__init__(**kwargs) + self.sas_url = kwargs.get('sas_url', None) + self.retention_in_days = kwargs.get('retention_in_days', None) + self.enabled = kwargs.get('enabled', None) + + +class AzureStaticWebApps(msrest.serialization.Model): + """The configuration settings of the Azure Static Web Apps provider. + + :param enabled: :code:`false` if the Azure Static Web Apps provider should not be + enabled despite the set registration; otherwise, :code:`true`. + :type enabled: bool + :param registration: The configuration settings of the Azure Static Web Apps registration. + :type registration: ~azure.mgmt.web.v2021_02_01.models.AzureStaticWebAppsRegistration + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'AzureStaticWebAppsRegistration'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureStaticWebApps, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.registration = kwargs.get('registration', None) + + +class AzureStaticWebAppsRegistration(msrest.serialization.Model): + """The configuration settings of the registration for the Azure Static Web Apps provider. + + :param client_id: The Client ID of the app used for login. + :type client_id: str + """ + + _attribute_map = { + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureStaticWebAppsRegistration, self).__init__(**kwargs) + self.client_id = kwargs.get('client_id', None) + + +class AzureStorageInfoValue(msrest.serialization.Model): + """Azure Files or Blob Storage access information value for dictionary storage. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param type: Type of storage. Possible values include: "AzureFiles", "AzureBlob". + :type type: str or ~azure.mgmt.web.v2021_02_01.models.AzureStorageType + :param account_name: Name of the storage account. + :type account_name: str + :param share_name: Name of the file share (container name, for Blob storage). + :type share_name: str + :param access_key: Access key for the storage account. + :type access_key: str + :param mount_path: Path to mount the storage within the site's runtime environment. + :type mount_path: str + :ivar state: State of the storage account. Possible values include: "Ok", "InvalidCredentials", + "InvalidShare", "NotValidated". + :vartype state: str or ~azure.mgmt.web.v2021_02_01.models.AzureStorageState + """ + + _validation = { + 'state': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'account_name': {'key': 'accountName', 'type': 'str'}, + 'share_name': {'key': 'shareName', 'type': 'str'}, + 'access_key': {'key': 'accessKey', 'type': 'str'}, + 'mount_path': {'key': 'mountPath', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureStorageInfoValue, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.account_name = kwargs.get('account_name', None) + self.share_name = kwargs.get('share_name', None) + self.access_key = kwargs.get('access_key', None) + self.mount_path = kwargs.get('mount_path', None) + self.state = None + + +class AzureStoragePropertyDictionaryResource(ProxyOnlyResource): + """AzureStorageInfo dictionary resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param properties: Azure storage accounts. + :type properties: dict[str, ~azure.mgmt.web.v2021_02_01.models.AzureStorageInfoValue] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': '{AzureStorageInfoValue}'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureStoragePropertyDictionaryResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class AzureTableStorageApplicationLogsConfig(msrest.serialization.Model): + """Application logs to Azure table storage configuration. + + All required parameters must be populated in order to send to Azure. + + :param level: Log level. Possible values include: "Off", "Verbose", "Information", "Warning", + "Error". + :type level: str or ~azure.mgmt.web.v2021_02_01.models.LogLevel + :param sas_url: Required. SAS URL to an Azure table with add/query/delete permissions. + :type sas_url: str + """ + + _validation = { + 'sas_url': {'required': True}, + } + + _attribute_map = { + 'level': {'key': 'level', 'type': 'str'}, + 'sas_url': {'key': 'sasUrl', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureTableStorageApplicationLogsConfig, self).__init__(**kwargs) + self.level = kwargs.get('level', None) + self.sas_url = kwargs['sas_url'] + + +class BackupItem(ProxyOnlyResource): + """Backup description. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar backup_id: Id of the backup. + :vartype backup_id: int + :ivar storage_account_url: SAS URL for the storage account container which contains this + backup. + :vartype storage_account_url: str + :ivar blob_name: Name of the blob which contains data for this backup. + :vartype blob_name: str + :ivar name_properties_name: Name of this backup. + :vartype name_properties_name: str + :ivar status: Backup status. Possible values include: "InProgress", "Failed", "Succeeded", + "TimedOut", "Created", "Skipped", "PartiallySucceeded", "DeleteInProgress", "DeleteFailed", + "Deleted". + :vartype status: str or ~azure.mgmt.web.v2021_02_01.models.BackupItemStatus + :ivar size_in_bytes: Size of the backup in bytes. + :vartype size_in_bytes: long + :ivar created: Timestamp of the backup creation. + :vartype created: ~datetime.datetime + :ivar log: Details regarding this backup. Might contain an error message. + :vartype log: str + :ivar databases: List of databases included in the backup. + :vartype databases: list[~azure.mgmt.web.v2021_02_01.models.DatabaseBackupSetting] + :ivar scheduled: True if this backup has been created due to a schedule being triggered. + :vartype scheduled: bool + :ivar last_restore_time_stamp: Timestamp of a last restore operation which used this backup. + :vartype last_restore_time_stamp: ~datetime.datetime + :ivar finished_time_stamp: Timestamp when this backup finished. + :vartype finished_time_stamp: ~datetime.datetime + :ivar correlation_id: Unique correlation identifier. Please use this along with the timestamp + while communicating with Azure support. + :vartype correlation_id: str + :ivar website_size_in_bytes: Size of the original web app which has been backed up. + :vartype website_size_in_bytes: long + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'backup_id': {'readonly': True}, + 'storage_account_url': {'readonly': True}, + 'blob_name': {'readonly': True}, + 'name_properties_name': {'readonly': True}, + 'status': {'readonly': True}, + 'size_in_bytes': {'readonly': True}, + 'created': {'readonly': True}, + 'log': {'readonly': True}, + 'databases': {'readonly': True}, + 'scheduled': {'readonly': True}, + 'last_restore_time_stamp': {'readonly': True}, + 'finished_time_stamp': {'readonly': True}, + 'correlation_id': {'readonly': True}, + 'website_size_in_bytes': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'backup_id': {'key': 'properties.id', 'type': 'int'}, + 'storage_account_url': {'key': 'properties.storageAccountUrl', 'type': 'str'}, + 'blob_name': {'key': 'properties.blobName', 'type': 'str'}, + 'name_properties_name': {'key': 'properties.name', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'size_in_bytes': {'key': 'properties.sizeInBytes', 'type': 'long'}, + 'created': {'key': 'properties.created', 'type': 'iso-8601'}, + 'log': {'key': 'properties.log', 'type': 'str'}, + 'databases': {'key': 'properties.databases', 'type': '[DatabaseBackupSetting]'}, + 'scheduled': {'key': 'properties.scheduled', 'type': 'bool'}, + 'last_restore_time_stamp': {'key': 'properties.lastRestoreTimeStamp', 'type': 'iso-8601'}, + 'finished_time_stamp': {'key': 'properties.finishedTimeStamp', 'type': 'iso-8601'}, + 'correlation_id': {'key': 'properties.correlationId', 'type': 'str'}, + 'website_size_in_bytes': {'key': 'properties.websiteSizeInBytes', 'type': 'long'}, + } + + def __init__( + self, + **kwargs + ): + super(BackupItem, self).__init__(**kwargs) + self.backup_id = None + self.storage_account_url = None + self.blob_name = None + self.name_properties_name = None + self.status = None + self.size_in_bytes = None + self.created = None + self.log = None + self.databases = None + self.scheduled = None + self.last_restore_time_stamp = None + self.finished_time_stamp = None + self.correlation_id = None + self.website_size_in_bytes = None + + +class BackupItemCollection(msrest.serialization.Model): + """Collection of backup items. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.BackupItem] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BackupItem]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(BackupItemCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class BackupRequest(ProxyOnlyResource): + """Description of a backup which will be performed. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param backup_name: Name of the backup. + :type backup_name: str + :param enabled: True if the backup schedule is enabled (must be included in that case), false + if the backup schedule should be disabled. + :type enabled: bool + :param storage_account_url: SAS URL to the container. + :type storage_account_url: str + :param backup_schedule: Schedule for the backup if it is executed periodically. + :type backup_schedule: ~azure.mgmt.web.v2021_02_01.models.BackupSchedule + :param databases: Databases included in the backup. + :type databases: list[~azure.mgmt.web.v2021_02_01.models.DatabaseBackupSetting] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'backup_name': {'key': 'properties.backupName', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'storage_account_url': {'key': 'properties.storageAccountUrl', 'type': 'str'}, + 'backup_schedule': {'key': 'properties.backupSchedule', 'type': 'BackupSchedule'}, + 'databases': {'key': 'properties.databases', 'type': '[DatabaseBackupSetting]'}, + } + + def __init__( + self, + **kwargs + ): + super(BackupRequest, self).__init__(**kwargs) + self.backup_name = kwargs.get('backup_name', None) + self.enabled = kwargs.get('enabled', None) + self.storage_account_url = kwargs.get('storage_account_url', None) + self.backup_schedule = kwargs.get('backup_schedule', None) + self.databases = kwargs.get('databases', None) + + +class BackupSchedule(msrest.serialization.Model): + """Description of a backup schedule. Describes how often should be the backup performed and what should be the retention policy. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param frequency_interval: Required. How often the backup should be executed (e.g. for weekly + backup, this should be set to 7 and FrequencyUnit should be set to Day). + :type frequency_interval: int + :param frequency_unit: Required. The unit of time for how often the backup should be executed + (e.g. for weekly backup, this should be set to Day and FrequencyInterval should be set to 7). + Possible values include: "Day", "Hour". Default value: "Day". + :type frequency_unit: str or ~azure.mgmt.web.v2021_02_01.models.FrequencyUnit + :param keep_at_least_one_backup: Required. True if the retention policy should always keep at + least one backup in the storage account, regardless how old it is; false otherwise. + :type keep_at_least_one_backup: bool + :param retention_period_in_days: Required. After how many days backups should be deleted. + :type retention_period_in_days: int + :param start_time: When the schedule should start working. + :type start_time: ~datetime.datetime + :ivar last_execution_time: Last time when this schedule was triggered. + :vartype last_execution_time: ~datetime.datetime + """ + + _validation = { + 'frequency_interval': {'required': True}, + 'frequency_unit': {'required': True}, + 'keep_at_least_one_backup': {'required': True}, + 'retention_period_in_days': {'required': True}, + 'last_execution_time': {'readonly': True}, + } + + _attribute_map = { + 'frequency_interval': {'key': 'frequencyInterval', 'type': 'int'}, + 'frequency_unit': {'key': 'frequencyUnit', 'type': 'str'}, + 'keep_at_least_one_backup': {'key': 'keepAtLeastOneBackup', 'type': 'bool'}, + 'retention_period_in_days': {'key': 'retentionPeriodInDays', 'type': 'int'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'last_execution_time': {'key': 'lastExecutionTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(BackupSchedule, self).__init__(**kwargs) + self.frequency_interval = kwargs.get('frequency_interval', 7) + self.frequency_unit = kwargs.get('frequency_unit', "Day") + self.keep_at_least_one_backup = kwargs.get('keep_at_least_one_backup', True) + self.retention_period_in_days = kwargs.get('retention_period_in_days', 30) + self.start_time = kwargs.get('start_time', None) + self.last_execution_time = None + + +class BillingMeter(ProxyOnlyResource): + """App Service billing entity that contains information about meter which the Azure billing system utilizes to charge users for services. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param meter_id: Meter GUID onboarded in Commerce. + :type meter_id: str + :param billing_location: Azure Location of billable resource. + :type billing_location: str + :param short_name: Short Name from App Service Azure pricing Page. + :type short_name: str + :param friendly_name: Friendly name of the meter. + :type friendly_name: str + :param resource_type: App Service ResourceType meter used for. + :type resource_type: str + :param os_type: App Service OS type meter used for. + :type os_type: str + :param multiplier: Meter Multiplier. + :type multiplier: float + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'meter_id': {'key': 'properties.meterId', 'type': 'str'}, + 'billing_location': {'key': 'properties.billingLocation', 'type': 'str'}, + 'short_name': {'key': 'properties.shortName', 'type': 'str'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'resource_type': {'key': 'properties.resourceType', 'type': 'str'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'multiplier': {'key': 'properties.multiplier', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(BillingMeter, self).__init__(**kwargs) + self.meter_id = kwargs.get('meter_id', None) + self.billing_location = kwargs.get('billing_location', None) + self.short_name = kwargs.get('short_name', None) + self.friendly_name = kwargs.get('friendly_name', None) + self.resource_type = kwargs.get('resource_type', None) + self.os_type = kwargs.get('os_type', None) + self.multiplier = kwargs.get('multiplier', None) + + +class BillingMeterCollection(msrest.serialization.Model): + """Collection of Billing Meters. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.BillingMeter] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BillingMeter]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(BillingMeterCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class BlobStorageTokenStore(msrest.serialization.Model): + """The configuration settings of the storage of the tokens if blob storage is used. + + :param sas_url_setting_name: The name of the app setting containing the SAS URL of the blob + storage containing the tokens. + :type sas_url_setting_name: str + """ + + _attribute_map = { + 'sas_url_setting_name': {'key': 'sasUrlSettingName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(BlobStorageTokenStore, self).__init__(**kwargs) + self.sas_url_setting_name = kwargs.get('sas_url_setting_name', None) + + +class Capability(msrest.serialization.Model): + """Describes the capabilities/features allowed for a specific SKU. + + :param name: Name of the SKU capability. + :type name: str + :param value: Value of the SKU capability. + :type value: str + :param reason: Reason of the SKU capability. + :type reason: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'reason': {'key': 'reason', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Capability, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) + self.reason = kwargs.get('reason', None) + + +class Certificate(Resource): + """SSL certificate for an app. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param password: Certificate password. + :type password: str + :ivar friendly_name: Friendly name of the certificate. + :vartype friendly_name: str + :ivar subject_name: Subject name of the certificate. + :vartype subject_name: str + :param host_names: Host names the certificate applies to. + :type host_names: list[str] + :param pfx_blob: Pfx blob. + :type pfx_blob: bytearray + :ivar site_name: App name. + :vartype site_name: str + :ivar self_link: Self link. + :vartype self_link: str + :ivar issuer: Certificate issuer. + :vartype issuer: str + :ivar issue_date: Certificate issue Date. + :vartype issue_date: ~datetime.datetime + :ivar expiration_date: Certificate expiration date. + :vartype expiration_date: ~datetime.datetime + :ivar thumbprint: Certificate thumbprint. + :vartype thumbprint: str + :ivar valid: Is the certificate valid?. + :vartype valid: bool + :ivar cer_blob: Raw bytes of .cer file. + :vartype cer_blob: bytearray + :ivar public_key_hash: Public key hash. + :vartype public_key_hash: str + :ivar hosting_environment_profile: Specification for the App Service Environment to use for the + certificate. + :vartype hosting_environment_profile: + ~azure.mgmt.web.v2021_02_01.models.HostingEnvironmentProfile + :param key_vault_id: Key Vault Csm resource Id. + :type key_vault_id: str + :param key_vault_secret_name: Key Vault secret name. + :type key_vault_secret_name: str + :ivar key_vault_secret_status: Status of the Key Vault secret. Possible values include: + "Initialized", "WaitingOnCertificateOrder", "Succeeded", "CertificateOrderFailed", + "OperationNotPermittedOnKeyVault", "AzureServiceUnauthorizedToAccessKeyVault", + "KeyVaultDoesNotExist", "KeyVaultSecretDoesNotExist", "UnknownError", "ExternalPrivateKey", + "Unknown". + :vartype key_vault_secret_status: str or + ~azure.mgmt.web.v2021_02_01.models.KeyVaultSecretStatus + :param server_farm_id: Resource ID of the associated App Service plan, formatted as: + "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + :type server_farm_id: str + :param canonical_name: CNAME of the certificate to be issued via free certificate. + :type canonical_name: str + :param domain_validation_method: Method of domain validation for free cert. + :type domain_validation_method: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'friendly_name': {'readonly': True}, + 'subject_name': {'readonly': True}, + 'site_name': {'readonly': True}, + 'self_link': {'readonly': True}, + 'issuer': {'readonly': True}, + 'issue_date': {'readonly': True}, + 'expiration_date': {'readonly': True}, + 'thumbprint': {'readonly': True}, + 'valid': {'readonly': True}, + 'cer_blob': {'readonly': True}, + 'public_key_hash': {'readonly': True}, + 'hosting_environment_profile': {'readonly': True}, + 'key_vault_secret_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'password': {'key': 'properties.password', 'type': 'str'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'subject_name': {'key': 'properties.subjectName', 'type': 'str'}, + 'host_names': {'key': 'properties.hostNames', 'type': '[str]'}, + 'pfx_blob': {'key': 'properties.pfxBlob', 'type': 'bytearray'}, + 'site_name': {'key': 'properties.siteName', 'type': 'str'}, + 'self_link': {'key': 'properties.selfLink', 'type': 'str'}, + 'issuer': {'key': 'properties.issuer', 'type': 'str'}, + 'issue_date': {'key': 'properties.issueDate', 'type': 'iso-8601'}, + 'expiration_date': {'key': 'properties.expirationDate', 'type': 'iso-8601'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + 'valid': {'key': 'properties.valid', 'type': 'bool'}, + 'cer_blob': {'key': 'properties.cerBlob', 'type': 'bytearray'}, + 'public_key_hash': {'key': 'properties.publicKeyHash', 'type': 'str'}, + 'hosting_environment_profile': {'key': 'properties.hostingEnvironmentProfile', 'type': 'HostingEnvironmentProfile'}, + 'key_vault_id': {'key': 'properties.keyVaultId', 'type': 'str'}, + 'key_vault_secret_name': {'key': 'properties.keyVaultSecretName', 'type': 'str'}, + 'key_vault_secret_status': {'key': 'properties.keyVaultSecretStatus', 'type': 'str'}, + 'server_farm_id': {'key': 'properties.serverFarmId', 'type': 'str'}, + 'canonical_name': {'key': 'properties.canonicalName', 'type': 'str'}, + 'domain_validation_method': {'key': 'properties.domainValidationMethod', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Certificate, self).__init__(**kwargs) + self.password = kwargs.get('password', None) + self.friendly_name = None + self.subject_name = None + self.host_names = kwargs.get('host_names', None) + self.pfx_blob = kwargs.get('pfx_blob', None) + self.site_name = None + self.self_link = None + self.issuer = None + self.issue_date = None + self.expiration_date = None + self.thumbprint = None + self.valid = None + self.cer_blob = None + self.public_key_hash = None + self.hosting_environment_profile = None + self.key_vault_id = kwargs.get('key_vault_id', None) + self.key_vault_secret_name = kwargs.get('key_vault_secret_name', None) + self.key_vault_secret_status = None + self.server_farm_id = kwargs.get('server_farm_id', None) + self.canonical_name = kwargs.get('canonical_name', None) + self.domain_validation_method = kwargs.get('domain_validation_method', None) + + +class CertificateCollection(msrest.serialization.Model): + """Collection of certificates. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.Certificate] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Certificate]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CertificateCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class CertificateDetails(msrest.serialization.Model): + """SSL certificate details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar version: Certificate Version. + :vartype version: int + :ivar serial_number: Certificate Serial Number. + :vartype serial_number: str + :ivar thumbprint: Certificate Thumbprint. + :vartype thumbprint: str + :ivar subject: Certificate Subject. + :vartype subject: str + :ivar not_before: Date Certificate is valid from. + :vartype not_before: ~datetime.datetime + :ivar not_after: Date Certificate is valid to. + :vartype not_after: ~datetime.datetime + :ivar signature_algorithm: Certificate Signature algorithm. + :vartype signature_algorithm: str + :ivar issuer: Certificate Issuer. + :vartype issuer: str + :ivar raw_data: Raw certificate data. + :vartype raw_data: str + """ + + _validation = { + 'version': {'readonly': True}, + 'serial_number': {'readonly': True}, + 'thumbprint': {'readonly': True}, + 'subject': {'readonly': True}, + 'not_before': {'readonly': True}, + 'not_after': {'readonly': True}, + 'signature_algorithm': {'readonly': True}, + 'issuer': {'readonly': True}, + 'raw_data': {'readonly': True}, + } + + _attribute_map = { + 'version': {'key': 'version', 'type': 'int'}, + 'serial_number': {'key': 'serialNumber', 'type': 'str'}, + 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + 'subject': {'key': 'subject', 'type': 'str'}, + 'not_before': {'key': 'notBefore', 'type': 'iso-8601'}, + 'not_after': {'key': 'notAfter', 'type': 'iso-8601'}, + 'signature_algorithm': {'key': 'signatureAlgorithm', 'type': 'str'}, + 'issuer': {'key': 'issuer', 'type': 'str'}, + 'raw_data': {'key': 'rawData', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CertificateDetails, self).__init__(**kwargs) + self.version = None + self.serial_number = None + self.thumbprint = None + self.subject = None + self.not_before = None + self.not_after = None + self.signature_algorithm = None + self.issuer = None + self.raw_data = None + + +class CertificateEmail(ProxyOnlyResource): + """SSL certificate email. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param email_id: Email id. + :type email_id: str + :param time_stamp: Time stamp. + :type time_stamp: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'email_id': {'key': 'properties.emailId', 'type': 'str'}, + 'time_stamp': {'key': 'properties.timeStamp', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(CertificateEmail, self).__init__(**kwargs) + self.email_id = kwargs.get('email_id', None) + self.time_stamp = kwargs.get('time_stamp', None) + + +class CertificateOrderAction(ProxyOnlyResource): + """Certificate order action. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar action_type: Action type. Possible values include: "CertificateIssued", + "CertificateOrderCanceled", "CertificateOrderCreated", "CertificateRevoked", + "DomainValidationComplete", "FraudDetected", "OrgNameChange", "OrgValidationComplete", + "SanDrop", "FraudCleared", "CertificateExpired", "CertificateExpirationWarning", + "FraudDocumentationRequired", "Unknown". + :vartype action_type: str or ~azure.mgmt.web.v2021_02_01.models.CertificateOrderActionType + :ivar created_at: Time at which the certificate action was performed. + :vartype created_at: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'action_type': {'readonly': True}, + 'created_at': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'action_type': {'key': 'properties.actionType', 'type': 'str'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(CertificateOrderAction, self).__init__(**kwargs) + self.action_type = None + self.created_at = None + + +class CertificateOrderContact(msrest.serialization.Model): + """CertificateOrderContact. + + :param email: + :type email: str + :param name_first: + :type name_first: str + :param name_last: + :type name_last: str + :param phone: + :type phone: str + """ + + _attribute_map = { + 'email': {'key': 'email', 'type': 'str'}, + 'name_first': {'key': 'nameFirst', 'type': 'str'}, + 'name_last': {'key': 'nameLast', 'type': 'str'}, + 'phone': {'key': 'phone', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CertificateOrderContact, self).__init__(**kwargs) + self.email = kwargs.get('email', None) + self.name_first = kwargs.get('name_first', None) + self.name_last = kwargs.get('name_last', None) + self.phone = kwargs.get('phone', None) + + +class CertificatePatchResource(ProxyOnlyResource): + """ARM resource for a certificate. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param password: Certificate password. + :type password: str + :ivar friendly_name: Friendly name of the certificate. + :vartype friendly_name: str + :ivar subject_name: Subject name of the certificate. + :vartype subject_name: str + :param host_names: Host names the certificate applies to. + :type host_names: list[str] + :param pfx_blob: Pfx blob. + :type pfx_blob: bytearray + :ivar site_name: App name. + :vartype site_name: str + :ivar self_link: Self link. + :vartype self_link: str + :ivar issuer: Certificate issuer. + :vartype issuer: str + :ivar issue_date: Certificate issue Date. + :vartype issue_date: ~datetime.datetime + :ivar expiration_date: Certificate expiration date. + :vartype expiration_date: ~datetime.datetime + :ivar thumbprint: Certificate thumbprint. + :vartype thumbprint: str + :ivar valid: Is the certificate valid?. + :vartype valid: bool + :ivar cer_blob: Raw bytes of .cer file. + :vartype cer_blob: bytearray + :ivar public_key_hash: Public key hash. + :vartype public_key_hash: str + :ivar hosting_environment_profile: Specification for the App Service Environment to use for the + certificate. + :vartype hosting_environment_profile: + ~azure.mgmt.web.v2021_02_01.models.HostingEnvironmentProfile + :param key_vault_id: Key Vault Csm resource Id. + :type key_vault_id: str + :param key_vault_secret_name: Key Vault secret name. + :type key_vault_secret_name: str + :ivar key_vault_secret_status: Status of the Key Vault secret. Possible values include: + "Initialized", "WaitingOnCertificateOrder", "Succeeded", "CertificateOrderFailed", + "OperationNotPermittedOnKeyVault", "AzureServiceUnauthorizedToAccessKeyVault", + "KeyVaultDoesNotExist", "KeyVaultSecretDoesNotExist", "UnknownError", "ExternalPrivateKey", + "Unknown". + :vartype key_vault_secret_status: str or + ~azure.mgmt.web.v2021_02_01.models.KeyVaultSecretStatus + :param server_farm_id: Resource ID of the associated App Service plan, formatted as: + "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + :type server_farm_id: str + :param canonical_name: CNAME of the certificate to be issued via free certificate. + :type canonical_name: str + :param domain_validation_method: Method of domain validation for free cert. + :type domain_validation_method: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'friendly_name': {'readonly': True}, + 'subject_name': {'readonly': True}, + 'site_name': {'readonly': True}, + 'self_link': {'readonly': True}, + 'issuer': {'readonly': True}, + 'issue_date': {'readonly': True}, + 'expiration_date': {'readonly': True}, + 'thumbprint': {'readonly': True}, + 'valid': {'readonly': True}, + 'cer_blob': {'readonly': True}, + 'public_key_hash': {'readonly': True}, + 'hosting_environment_profile': {'readonly': True}, + 'key_vault_secret_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'password': {'key': 'properties.password', 'type': 'str'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'subject_name': {'key': 'properties.subjectName', 'type': 'str'}, + 'host_names': {'key': 'properties.hostNames', 'type': '[str]'}, + 'pfx_blob': {'key': 'properties.pfxBlob', 'type': 'bytearray'}, + 'site_name': {'key': 'properties.siteName', 'type': 'str'}, + 'self_link': {'key': 'properties.selfLink', 'type': 'str'}, + 'issuer': {'key': 'properties.issuer', 'type': 'str'}, + 'issue_date': {'key': 'properties.issueDate', 'type': 'iso-8601'}, + 'expiration_date': {'key': 'properties.expirationDate', 'type': 'iso-8601'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + 'valid': {'key': 'properties.valid', 'type': 'bool'}, + 'cer_blob': {'key': 'properties.cerBlob', 'type': 'bytearray'}, + 'public_key_hash': {'key': 'properties.publicKeyHash', 'type': 'str'}, + 'hosting_environment_profile': {'key': 'properties.hostingEnvironmentProfile', 'type': 'HostingEnvironmentProfile'}, + 'key_vault_id': {'key': 'properties.keyVaultId', 'type': 'str'}, + 'key_vault_secret_name': {'key': 'properties.keyVaultSecretName', 'type': 'str'}, + 'key_vault_secret_status': {'key': 'properties.keyVaultSecretStatus', 'type': 'str'}, + 'server_farm_id': {'key': 'properties.serverFarmId', 'type': 'str'}, + 'canonical_name': {'key': 'properties.canonicalName', 'type': 'str'}, + 'domain_validation_method': {'key': 'properties.domainValidationMethod', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CertificatePatchResource, self).__init__(**kwargs) + self.password = kwargs.get('password', None) + self.friendly_name = None + self.subject_name = None + self.host_names = kwargs.get('host_names', None) + self.pfx_blob = kwargs.get('pfx_blob', None) + self.site_name = None + self.self_link = None + self.issuer = None + self.issue_date = None + self.expiration_date = None + self.thumbprint = None + self.valid = None + self.cer_blob = None + self.public_key_hash = None + self.hosting_environment_profile = None + self.key_vault_id = kwargs.get('key_vault_id', None) + self.key_vault_secret_name = kwargs.get('key_vault_secret_name', None) + self.key_vault_secret_status = None + self.server_farm_id = kwargs.get('server_farm_id', None) + self.canonical_name = kwargs.get('canonical_name', None) + self.domain_validation_method = kwargs.get('domain_validation_method', None) + + +class ClientRegistration(msrest.serialization.Model): + """The configuration settings of the app registration for providers that have client ids and client secrets. + + :param client_id: The Client ID of the app used for login. + :type client_id: str + :param client_secret_setting_name: The app setting name that contains the client secret. + :type client_secret_setting_name: str + """ + + _attribute_map = { + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'client_secret_setting_name': {'key': 'clientSecretSettingName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ClientRegistration, self).__init__(**kwargs) + self.client_id = kwargs.get('client_id', None) + self.client_secret_setting_name = kwargs.get('client_secret_setting_name', None) + + +class CloningInfo(msrest.serialization.Model): + """Information needed for cloning operation. + + All required parameters must be populated in order to send to Azure. + + :param correlation_id: Correlation ID of cloning operation. This ID ties multiple cloning + operations + together to use the same snapshot. + :type correlation_id: str + :param overwrite: :code:`true` to overwrite destination app; otherwise, + :code:`false`. + :type overwrite: bool + :param clone_custom_host_names: :code:`true` to clone custom hostnames from source + app; otherwise, :code:`false`. + :type clone_custom_host_names: bool + :param clone_source_control: :code:`true` to clone source control from source app; + otherwise, :code:`false`. + :type clone_source_control: bool + :param source_web_app_id: Required. ARM resource ID of the source app. App resource ID is of + the form + /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + for production slots and + /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + for other slots. + :type source_web_app_id: str + :param source_web_app_location: Location of source app ex: West US or North Europe. + :type source_web_app_location: str + :param hosting_environment: App Service Environment. + :type hosting_environment: str + :param app_settings_overrides: Application setting overrides for cloned app. If specified, + these settings override the settings cloned + from source app. Otherwise, application settings from source app are retained. + :type app_settings_overrides: dict[str, str] + :param configure_load_balancing: :code:`true` to configure load balancing for + source and destination app. + :type configure_load_balancing: bool + :param traffic_manager_profile_id: ARM resource ID of the Traffic Manager profile to use, if it + exists. Traffic Manager resource ID is of the form + /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. + :type traffic_manager_profile_id: str + :param traffic_manager_profile_name: Name of Traffic Manager profile to create. This is only + needed if Traffic Manager profile does not already exist. + :type traffic_manager_profile_name: str + """ + + _validation = { + 'source_web_app_id': {'required': True}, + } + + _attribute_map = { + 'correlation_id': {'key': 'correlationId', 'type': 'str'}, + 'overwrite': {'key': 'overwrite', 'type': 'bool'}, + 'clone_custom_host_names': {'key': 'cloneCustomHostNames', 'type': 'bool'}, + 'clone_source_control': {'key': 'cloneSourceControl', 'type': 'bool'}, + 'source_web_app_id': {'key': 'sourceWebAppId', 'type': 'str'}, + 'source_web_app_location': {'key': 'sourceWebAppLocation', 'type': 'str'}, + 'hosting_environment': {'key': 'hostingEnvironment', 'type': 'str'}, + 'app_settings_overrides': {'key': 'appSettingsOverrides', 'type': '{str}'}, + 'configure_load_balancing': {'key': 'configureLoadBalancing', 'type': 'bool'}, + 'traffic_manager_profile_id': {'key': 'trafficManagerProfileId', 'type': 'str'}, + 'traffic_manager_profile_name': {'key': 'trafficManagerProfileName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CloningInfo, self).__init__(**kwargs) + self.correlation_id = kwargs.get('correlation_id', None) + self.overwrite = kwargs.get('overwrite', None) + self.clone_custom_host_names = kwargs.get('clone_custom_host_names', None) + self.clone_source_control = kwargs.get('clone_source_control', None) + self.source_web_app_id = kwargs['source_web_app_id'] + self.source_web_app_location = kwargs.get('source_web_app_location', None) + self.hosting_environment = kwargs.get('hosting_environment', None) + self.app_settings_overrides = kwargs.get('app_settings_overrides', None) + self.configure_load_balancing = kwargs.get('configure_load_balancing', None) + self.traffic_manager_profile_id = kwargs.get('traffic_manager_profile_id', None) + self.traffic_manager_profile_name = kwargs.get('traffic_manager_profile_name', None) + + +class ConnectionStringDictionary(ProxyOnlyResource): + """String dictionary resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param properties: Connection strings. + :type properties: dict[str, ~azure.mgmt.web.v2021_02_01.models.ConnStringValueTypePair] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': '{ConnStringValueTypePair}'}, + } + + def __init__( + self, + **kwargs + ): + super(ConnectionStringDictionary, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class ConnStringInfo(msrest.serialization.Model): + """Database connection string information. + + :param name: Name of connection string. + :type name: str + :param connection_string: Connection string value. + :type connection_string: str + :param type: Type of database. Possible values include: "MySql", "SQLServer", "SQLAzure", + "Custom", "NotificationHub", "ServiceBus", "EventHub", "ApiHub", "DocDb", "RedisCache", + "PostgreSQL". + :type type: str or ~azure.mgmt.web.v2021_02_01.models.ConnectionStringType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'connection_string': {'key': 'connectionString', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ConnStringInfo, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.connection_string = kwargs.get('connection_string', None) + self.type = kwargs.get('type', None) + + +class ConnStringValueTypePair(msrest.serialization.Model): + """Database connection string value to type pair. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Value of pair. + :type value: str + :param type: Required. Type of database. Possible values include: "MySql", "SQLServer", + "SQLAzure", "Custom", "NotificationHub", "ServiceBus", "EventHub", "ApiHub", "DocDb", + "RedisCache", "PostgreSQL". + :type type: str or ~azure.mgmt.web.v2021_02_01.models.ConnectionStringType + """ + + _validation = { + 'value': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ConnStringValueTypePair, self).__init__(**kwargs) + self.value = kwargs['value'] + self.type = kwargs['type'] + + +class Contact(msrest.serialization.Model): + """Contact information for domain registration. If 'Domain Privacy' option is not selected then the contact information is made publicly available through the Whois +directories as per ICANN requirements. + + All required parameters must be populated in order to send to Azure. + + :param address_mailing: Mailing address. + :type address_mailing: ~azure.mgmt.web.v2021_02_01.models.Address + :param email: Required. Email address. + :type email: str + :param fax: Fax number. + :type fax: str + :param job_title: Job title. + :type job_title: str + :param name_first: Required. First name. + :type name_first: str + :param name_last: Required. Last name. + :type name_last: str + :param name_middle: Middle name. + :type name_middle: str + :param organization: Organization contact belongs to. + :type organization: str + :param phone: Required. Phone number. + :type phone: str + """ + + _validation = { + 'email': {'required': True}, + 'name_first': {'required': True}, + 'name_last': {'required': True}, + 'phone': {'required': True}, + } + + _attribute_map = { + 'address_mailing': {'key': 'addressMailing', 'type': 'Address'}, + 'email': {'key': 'email', 'type': 'str'}, + 'fax': {'key': 'fax', 'type': 'str'}, + 'job_title': {'key': 'jobTitle', 'type': 'str'}, + 'name_first': {'key': 'nameFirst', 'type': 'str'}, + 'name_last': {'key': 'nameLast', 'type': 'str'}, + 'name_middle': {'key': 'nameMiddle', 'type': 'str'}, + 'organization': {'key': 'organization', 'type': 'str'}, + 'phone': {'key': 'phone', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Contact, self).__init__(**kwargs) + self.address_mailing = kwargs.get('address_mailing', None) + self.email = kwargs['email'] + self.fax = kwargs.get('fax', None) + self.job_title = kwargs.get('job_title', None) + self.name_first = kwargs['name_first'] + self.name_last = kwargs['name_last'] + self.name_middle = kwargs.get('name_middle', None) + self.organization = kwargs.get('organization', None) + self.phone = kwargs['phone'] + + +class ContainerCpuStatistics(msrest.serialization.Model): + """ContainerCpuStatistics. + + :param cpu_usage: + :type cpu_usage: ~azure.mgmt.web.v2021_02_01.models.ContainerCpuUsage + :param system_cpu_usage: + :type system_cpu_usage: long + :param online_cpu_count: + :type online_cpu_count: int + :param throttling_data: + :type throttling_data: ~azure.mgmt.web.v2021_02_01.models.ContainerThrottlingData + """ + + _attribute_map = { + 'cpu_usage': {'key': 'cpuUsage', 'type': 'ContainerCpuUsage'}, + 'system_cpu_usage': {'key': 'systemCpuUsage', 'type': 'long'}, + 'online_cpu_count': {'key': 'onlineCpuCount', 'type': 'int'}, + 'throttling_data': {'key': 'throttlingData', 'type': 'ContainerThrottlingData'}, + } + + def __init__( + self, + **kwargs + ): + super(ContainerCpuStatistics, self).__init__(**kwargs) + self.cpu_usage = kwargs.get('cpu_usage', None) + self.system_cpu_usage = kwargs.get('system_cpu_usage', None) + self.online_cpu_count = kwargs.get('online_cpu_count', None) + self.throttling_data = kwargs.get('throttling_data', None) + + +class ContainerCpuUsage(msrest.serialization.Model): + """ContainerCpuUsage. + + :param total_usage: + :type total_usage: long + :param per_cpu_usage: + :type per_cpu_usage: list[long] + :param kernel_mode_usage: + :type kernel_mode_usage: long + :param user_mode_usage: + :type user_mode_usage: long + """ + + _attribute_map = { + 'total_usage': {'key': 'totalUsage', 'type': 'long'}, + 'per_cpu_usage': {'key': 'perCpuUsage', 'type': '[long]'}, + 'kernel_mode_usage': {'key': 'kernelModeUsage', 'type': 'long'}, + 'user_mode_usage': {'key': 'userModeUsage', 'type': 'long'}, + } + + def __init__( + self, + **kwargs + ): + super(ContainerCpuUsage, self).__init__(**kwargs) + self.total_usage = kwargs.get('total_usage', None) + self.per_cpu_usage = kwargs.get('per_cpu_usage', None) + self.kernel_mode_usage = kwargs.get('kernel_mode_usage', None) + self.user_mode_usage = kwargs.get('user_mode_usage', None) + + +class ContainerInfo(msrest.serialization.Model): + """ContainerInfo. + + :param current_time_stamp: + :type current_time_stamp: ~datetime.datetime + :param previous_time_stamp: + :type previous_time_stamp: ~datetime.datetime + :param current_cpu_stats: + :type current_cpu_stats: ~azure.mgmt.web.v2021_02_01.models.ContainerCpuStatistics + :param previous_cpu_stats: + :type previous_cpu_stats: ~azure.mgmt.web.v2021_02_01.models.ContainerCpuStatistics + :param memory_stats: + :type memory_stats: ~azure.mgmt.web.v2021_02_01.models.ContainerMemoryStatistics + :param name: + :type name: str + :param id: + :type id: str + :param eth0: + :type eth0: ~azure.mgmt.web.v2021_02_01.models.ContainerNetworkInterfaceStatistics + """ + + _attribute_map = { + 'current_time_stamp': {'key': 'currentTimeStamp', 'type': 'iso-8601'}, + 'previous_time_stamp': {'key': 'previousTimeStamp', 'type': 'iso-8601'}, + 'current_cpu_stats': {'key': 'currentCpuStats', 'type': 'ContainerCpuStatistics'}, + 'previous_cpu_stats': {'key': 'previousCpuStats', 'type': 'ContainerCpuStatistics'}, + 'memory_stats': {'key': 'memoryStats', 'type': 'ContainerMemoryStatistics'}, + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'eth0': {'key': 'eth0', 'type': 'ContainerNetworkInterfaceStatistics'}, + } + + def __init__( + self, + **kwargs + ): + super(ContainerInfo, self).__init__(**kwargs) + self.current_time_stamp = kwargs.get('current_time_stamp', None) + self.previous_time_stamp = kwargs.get('previous_time_stamp', None) + self.current_cpu_stats = kwargs.get('current_cpu_stats', None) + self.previous_cpu_stats = kwargs.get('previous_cpu_stats', None) + self.memory_stats = kwargs.get('memory_stats', None) + self.name = kwargs.get('name', None) + self.id = kwargs.get('id', None) + self.eth0 = kwargs.get('eth0', None) + + +class ContainerMemoryStatistics(msrest.serialization.Model): + """ContainerMemoryStatistics. + + :param usage: + :type usage: long + :param max_usage: + :type max_usage: long + :param limit: + :type limit: long + """ + + _attribute_map = { + 'usage': {'key': 'usage', 'type': 'long'}, + 'max_usage': {'key': 'maxUsage', 'type': 'long'}, + 'limit': {'key': 'limit', 'type': 'long'}, + } + + def __init__( + self, + **kwargs + ): + super(ContainerMemoryStatistics, self).__init__(**kwargs) + self.usage = kwargs.get('usage', None) + self.max_usage = kwargs.get('max_usage', None) + self.limit = kwargs.get('limit', None) + + +class ContainerNetworkInterfaceStatistics(msrest.serialization.Model): + """ContainerNetworkInterfaceStatistics. + + :param rx_bytes: + :type rx_bytes: long + :param rx_packets: + :type rx_packets: long + :param rx_errors: + :type rx_errors: long + :param rx_dropped: + :type rx_dropped: long + :param tx_bytes: + :type tx_bytes: long + :param tx_packets: + :type tx_packets: long + :param tx_errors: + :type tx_errors: long + :param tx_dropped: + :type tx_dropped: long + """ + + _attribute_map = { + 'rx_bytes': {'key': 'rxBytes', 'type': 'long'}, + 'rx_packets': {'key': 'rxPackets', 'type': 'long'}, + 'rx_errors': {'key': 'rxErrors', 'type': 'long'}, + 'rx_dropped': {'key': 'rxDropped', 'type': 'long'}, + 'tx_bytes': {'key': 'txBytes', 'type': 'long'}, + 'tx_packets': {'key': 'txPackets', 'type': 'long'}, + 'tx_errors': {'key': 'txErrors', 'type': 'long'}, + 'tx_dropped': {'key': 'txDropped', 'type': 'long'}, + } + + def __init__( + self, + **kwargs + ): + super(ContainerNetworkInterfaceStatistics, self).__init__(**kwargs) + self.rx_bytes = kwargs.get('rx_bytes', None) + self.rx_packets = kwargs.get('rx_packets', None) + self.rx_errors = kwargs.get('rx_errors', None) + self.rx_dropped = kwargs.get('rx_dropped', None) + self.tx_bytes = kwargs.get('tx_bytes', None) + self.tx_packets = kwargs.get('tx_packets', None) + self.tx_errors = kwargs.get('tx_errors', None) + self.tx_dropped = kwargs.get('tx_dropped', None) + + +class ContainerThrottlingData(msrest.serialization.Model): + """ContainerThrottlingData. + + :param periods: + :type periods: int + :param throttled_periods: + :type throttled_periods: int + :param throttled_time: + :type throttled_time: int + """ + + _attribute_map = { + 'periods': {'key': 'periods', 'type': 'int'}, + 'throttled_periods': {'key': 'throttledPeriods', 'type': 'int'}, + 'throttled_time': {'key': 'throttledTime', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(ContainerThrottlingData, self).__init__(**kwargs) + self.periods = kwargs.get('periods', None) + self.throttled_periods = kwargs.get('throttled_periods', None) + self.throttled_time = kwargs.get('throttled_time', None) + + +class ContinuousWebJob(ProxyOnlyResource): + """Continuous Web Job Information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param status: Job status. Possible values include: "Initializing", "Starting", "Running", + "PendingRestart", "Stopped". + :type status: str or ~azure.mgmt.web.v2021_02_01.models.ContinuousWebJobStatus + :param detailed_status: Detailed status. + :type detailed_status: str + :param log_url: Log URL. + :type log_url: str + :param run_command: Run command. + :type run_command: str + :param url: Job URL. + :type url: str + :param extra_info_url: Extra Info URL. + :type extra_info_url: str + :param web_job_type: Job type. Possible values include: "Continuous", "Triggered". + :type web_job_type: str or ~azure.mgmt.web.v2021_02_01.models.WebJobType + :param error: Error information. + :type error: str + :param using_sdk: Using SDK?. + :type using_sdk: bool + :param settings: Job settings. + :type settings: dict[str, any] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'detailed_status': {'key': 'properties.detailed_status', 'type': 'str'}, + 'log_url': {'key': 'properties.log_url', 'type': 'str'}, + 'run_command': {'key': 'properties.run_command', 'type': 'str'}, + 'url': {'key': 'properties.url', 'type': 'str'}, + 'extra_info_url': {'key': 'properties.extra_info_url', 'type': 'str'}, + 'web_job_type': {'key': 'properties.web_job_type', 'type': 'str'}, + 'error': {'key': 'properties.error', 'type': 'str'}, + 'using_sdk': {'key': 'properties.using_sdk', 'type': 'bool'}, + 'settings': {'key': 'properties.settings', 'type': '{object}'}, + } + + def __init__( + self, + **kwargs + ): + super(ContinuousWebJob, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.detailed_status = kwargs.get('detailed_status', None) + self.log_url = kwargs.get('log_url', None) + self.run_command = kwargs.get('run_command', None) + self.url = kwargs.get('url', None) + self.extra_info_url = kwargs.get('extra_info_url', None) + self.web_job_type = kwargs.get('web_job_type', None) + self.error = kwargs.get('error', None) + self.using_sdk = kwargs.get('using_sdk', None) + self.settings = kwargs.get('settings', None) + + +class ContinuousWebJobCollection(msrest.serialization.Model): + """Collection of Kudu continuous web job information elements. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.ContinuousWebJob] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ContinuousWebJob]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ContinuousWebJobCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class CookieExpiration(msrest.serialization.Model): + """The configuration settings of the session cookie's expiration. + + :param convention: The convention used when determining the session cookie's expiration. + Possible values include: "FixedTime", "IdentityProviderDerived". + :type convention: str or ~azure.mgmt.web.v2021_02_01.models.CookieExpirationConvention + :param time_to_expiration: The time after the request is made when the session cookie should + expire. + :type time_to_expiration: str + """ + + _attribute_map = { + 'convention': {'key': 'convention', 'type': 'str'}, + 'time_to_expiration': {'key': 'timeToExpiration', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CookieExpiration, self).__init__(**kwargs) + self.convention = kwargs.get('convention', None) + self.time_to_expiration = kwargs.get('time_to_expiration', None) + + +class CorsSettings(msrest.serialization.Model): + """Cross-Origin Resource Sharing (CORS) settings for the app. + + :param allowed_origins: Gets or sets the list of origins that should be allowed to make + cross-origin + calls (for example: http://example.com:12345). Use "*" to allow all. + :type allowed_origins: list[str] + :param support_credentials: Gets or sets whether CORS requests with credentials are allowed. + See + https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + for more details. + :type support_credentials: bool + """ + + _attribute_map = { + 'allowed_origins': {'key': 'allowedOrigins', 'type': '[str]'}, + 'support_credentials': {'key': 'supportCredentials', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(CorsSettings, self).__init__(**kwargs) + self.allowed_origins = kwargs.get('allowed_origins', None) + self.support_credentials = kwargs.get('support_credentials', None) + + +class CsmMoveResourceEnvelope(msrest.serialization.Model): + """Object with a list of the resources that need to be moved and the resource group they should be moved to. + + :param target_resource_group: + :type target_resource_group: str + :param resources: + :type resources: list[str] + """ + + _validation = { + 'target_resource_group': {'max_length': 90, 'min_length': 1, 'pattern': r' ^[-\w\._\(\)]+[^\.]$'}, + } + + _attribute_map = { + 'target_resource_group': {'key': 'targetResourceGroup', 'type': 'str'}, + 'resources': {'key': 'resources', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(CsmMoveResourceEnvelope, self).__init__(**kwargs) + self.target_resource_group = kwargs.get('target_resource_group', None) + self.resources = kwargs.get('resources', None) + + +class CsmOperationCollection(msrest.serialization.Model): + """Collection of Azure resource manager operation metadata. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.CsmOperationDescription] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[CsmOperationDescription]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CsmOperationCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class CsmOperationDescription(msrest.serialization.Model): + """Description of an operation available for Microsoft.Web resource provider. + + :param name: + :type name: str + :param is_data_action: + :type is_data_action: bool + :param display: Meta data about operation used for display in portal. + :type display: ~azure.mgmt.web.v2021_02_01.models.CsmOperationDisplay + :param origin: + :type origin: str + :param properties: Properties available for a Microsoft.Web resource provider operation. + :type properties: ~azure.mgmt.web.v2021_02_01.models.CsmOperationDescriptionProperties + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'display': {'key': 'display', 'type': 'CsmOperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'CsmOperationDescriptionProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(CsmOperationDescription, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.is_data_action = kwargs.get('is_data_action', None) + self.display = kwargs.get('display', None) + self.origin = kwargs.get('origin', None) + self.properties = kwargs.get('properties', None) + + +class CsmOperationDescriptionProperties(msrest.serialization.Model): + """Properties available for a Microsoft.Web resource provider operation. + + :param service_specification: Resource metrics service provided by Microsoft.Insights resource + provider. + :type service_specification: ~azure.mgmt.web.v2021_02_01.models.ServiceSpecification + """ + + _attribute_map = { + 'service_specification': {'key': 'serviceSpecification', 'type': 'ServiceSpecification'}, + } + + def __init__( + self, + **kwargs + ): + super(CsmOperationDescriptionProperties, self).__init__(**kwargs) + self.service_specification = kwargs.get('service_specification', None) + + +class CsmOperationDisplay(msrest.serialization.Model): + """Meta data about operation used for display in portal. + + :param provider: + :type provider: str + :param resource: + :type resource: str + :param operation: + :type operation: str + :param description: + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CsmOperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) + + +class CsmPublishingCredentialsPoliciesEntity(ProxyOnlyResource): + """Publishing Credentials Policies parameters. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param allow: :code:`true` to allow access to a publishing method; otherwise, + :code:`false`. + :type allow: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'allow': {'key': 'properties.allow', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(CsmPublishingCredentialsPoliciesEntity, self).__init__(**kwargs) + self.allow = kwargs.get('allow', None) + + +class CsmPublishingProfileOptions(msrest.serialization.Model): + """Publishing options for requested profile. + + :param format: Name of the format. Valid values are: + FileZilla3 + WebDeploy -- default + Ftp. Possible values include: "FileZilla3", "WebDeploy", "Ftp". + :type format: str or ~azure.mgmt.web.v2021_02_01.models.PublishingProfileFormat + :param include_disaster_recovery_endpoints: Include the DisasterRecover endpoint if true. + :type include_disaster_recovery_endpoints: bool + """ + + _attribute_map = { + 'format': {'key': 'format', 'type': 'str'}, + 'include_disaster_recovery_endpoints': {'key': 'includeDisasterRecoveryEndpoints', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(CsmPublishingProfileOptions, self).__init__(**kwargs) + self.format = kwargs.get('format', None) + self.include_disaster_recovery_endpoints = kwargs.get('include_disaster_recovery_endpoints', None) + + +class CsmSlotEntity(msrest.serialization.Model): + """Deployment slot parameters. + + All required parameters must be populated in order to send to Azure. + + :param target_slot: Required. Destination deployment slot during swap operation. + :type target_slot: str + :param preserve_vnet: Required. :code:`true` to preserve Virtual Network to the + slot during swap; otherwise, :code:`false`. + :type preserve_vnet: bool + """ + + _validation = { + 'target_slot': {'required': True}, + 'preserve_vnet': {'required': True}, + } + + _attribute_map = { + 'target_slot': {'key': 'targetSlot', 'type': 'str'}, + 'preserve_vnet': {'key': 'preserveVnet', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(CsmSlotEntity, self).__init__(**kwargs) + self.target_slot = kwargs['target_slot'] + self.preserve_vnet = kwargs['preserve_vnet'] + + +class CsmUsageQuota(msrest.serialization.Model): + """Usage of the quota resource. + + :param unit: Units of measurement for the quota resource. + :type unit: str + :param next_reset_time: Next reset time for the resource counter. + :type next_reset_time: ~datetime.datetime + :param current_value: The current value of the resource counter. + :type current_value: long + :param limit: The resource limit. + :type limit: long + :param name: Quota name. + :type name: ~azure.mgmt.web.v2021_02_01.models.LocalizableString + """ + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'str'}, + 'next_reset_time': {'key': 'nextResetTime', 'type': 'iso-8601'}, + 'current_value': {'key': 'currentValue', 'type': 'long'}, + 'limit': {'key': 'limit', 'type': 'long'}, + 'name': {'key': 'name', 'type': 'LocalizableString'}, + } + + def __init__( + self, + **kwargs + ): + super(CsmUsageQuota, self).__init__(**kwargs) + self.unit = kwargs.get('unit', None) + self.next_reset_time = kwargs.get('next_reset_time', None) + self.current_value = kwargs.get('current_value', None) + self.limit = kwargs.get('limit', None) + self.name = kwargs.get('name', None) + + +class CsmUsageQuotaCollection(msrest.serialization.Model): + """Collection of CSM usage quotas. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.CsmUsageQuota] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[CsmUsageQuota]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CsmUsageQuotaCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class CustomHostnameAnalysisResult(ProxyOnlyResource): + """Custom domain analysis. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar is_hostname_already_verified: :code:`true` if hostname is already verified; + otherwise, :code:`false`. + :vartype is_hostname_already_verified: bool + :ivar custom_domain_verification_test: DNS verification test result. Possible values include: + "Passed", "Failed", "Skipped". + :vartype custom_domain_verification_test: str or + ~azure.mgmt.web.v2021_02_01.models.DnsVerificationTestResult + :ivar custom_domain_verification_failure_info: Raw failure information if DNS verification + fails. + :vartype custom_domain_verification_failure_info: + ~azure.mgmt.web.v2021_02_01.models.ErrorEntity + :ivar has_conflict_on_scale_unit: :code:`true` if there is a conflict on a scale + unit; otherwise, :code:`false`. + :vartype has_conflict_on_scale_unit: bool + :ivar has_conflict_across_subscription: :code:`true` if there is a conflict across + subscriptions; otherwise, :code:`false`. + :vartype has_conflict_across_subscription: bool + :ivar conflicting_app_resource_id: Name of the conflicting app on scale unit if it's within the + same subscription. + :vartype conflicting_app_resource_id: str + :param c_name_records: CName records controller can see for this hostname. + :type c_name_records: list[str] + :param txt_records: TXT records controller can see for this hostname. + :type txt_records: list[str] + :param a_records: A records controller can see for this hostname. + :type a_records: list[str] + :param alternate_c_name_records: Alternate CName records controller can see for this hostname. + :type alternate_c_name_records: list[str] + :param alternate_txt_records: Alternate TXT records controller can see for this hostname. + :type alternate_txt_records: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'is_hostname_already_verified': {'readonly': True}, + 'custom_domain_verification_test': {'readonly': True}, + 'custom_domain_verification_failure_info': {'readonly': True}, + 'has_conflict_on_scale_unit': {'readonly': True}, + 'has_conflict_across_subscription': {'readonly': True}, + 'conflicting_app_resource_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'is_hostname_already_verified': {'key': 'properties.isHostnameAlreadyVerified', 'type': 'bool'}, + 'custom_domain_verification_test': {'key': 'properties.customDomainVerificationTest', 'type': 'str'}, + 'custom_domain_verification_failure_info': {'key': 'properties.customDomainVerificationFailureInfo', 'type': 'ErrorEntity'}, + 'has_conflict_on_scale_unit': {'key': 'properties.hasConflictOnScaleUnit', 'type': 'bool'}, + 'has_conflict_across_subscription': {'key': 'properties.hasConflictAcrossSubscription', 'type': 'bool'}, + 'conflicting_app_resource_id': {'key': 'properties.conflictingAppResourceId', 'type': 'str'}, + 'c_name_records': {'key': 'properties.cNameRecords', 'type': '[str]'}, + 'txt_records': {'key': 'properties.txtRecords', 'type': '[str]'}, + 'a_records': {'key': 'properties.aRecords', 'type': '[str]'}, + 'alternate_c_name_records': {'key': 'properties.alternateCNameRecords', 'type': '[str]'}, + 'alternate_txt_records': {'key': 'properties.alternateTxtRecords', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(CustomHostnameAnalysisResult, self).__init__(**kwargs) + self.is_hostname_already_verified = None + self.custom_domain_verification_test = None + self.custom_domain_verification_failure_info = None + self.has_conflict_on_scale_unit = None + self.has_conflict_across_subscription = None + self.conflicting_app_resource_id = None + self.c_name_records = kwargs.get('c_name_records', None) + self.txt_records = kwargs.get('txt_records', None) + self.a_records = kwargs.get('a_records', None) + self.alternate_c_name_records = kwargs.get('alternate_c_name_records', None) + self.alternate_txt_records = kwargs.get('alternate_txt_records', None) + + +class CustomOpenIdConnectProvider(msrest.serialization.Model): + """The configuration settings of the custom Open ID Connect provider. + + :param enabled: :code:`false` if the custom Open ID provider provider should not + be enabled; otherwise, :code:`true`. + :type enabled: bool + :param registration: The configuration settings of the app registration for the custom Open ID + Connect provider. + :type registration: ~azure.mgmt.web.v2021_02_01.models.OpenIdConnectRegistration + :param login: The configuration settings of the login flow of the custom Open ID Connect + provider. + :type login: ~azure.mgmt.web.v2021_02_01.models.OpenIdConnectLogin + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'OpenIdConnectRegistration'}, + 'login': {'key': 'login', 'type': 'OpenIdConnectLogin'}, + } + + def __init__( + self, + **kwargs + ): + super(CustomOpenIdConnectProvider, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.registration = kwargs.get('registration', None) + self.login = kwargs.get('login', None) + + +class DatabaseBackupSetting(msrest.serialization.Model): + """Database backup settings. + + All required parameters must be populated in order to send to Azure. + + :param database_type: Required. Database type (e.g. SqlAzure / MySql). Possible values include: + "SqlAzure", "MySql", "LocalMySql", "PostgreSql". + :type database_type: str or ~azure.mgmt.web.v2021_02_01.models.DatabaseType + :param name: + :type name: str + :param connection_string_name: Contains a connection string name that is linked to the + SiteConfig.ConnectionStrings. + This is used during restore with overwrite connection strings options. + :type connection_string_name: str + :param connection_string: Contains a connection string to a database which is being backed up + or restored. If the restore should happen to a new database, the database name inside is the + new one. + :type connection_string: str + """ + + _validation = { + 'database_type': {'required': True}, + } + + _attribute_map = { + 'database_type': {'key': 'databaseType', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'connection_string_name': {'key': 'connectionStringName', 'type': 'str'}, + 'connection_string': {'key': 'connectionString', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DatabaseBackupSetting, self).__init__(**kwargs) + self.database_type = kwargs['database_type'] + self.name = kwargs.get('name', None) + self.connection_string_name = kwargs.get('connection_string_name', None) + self.connection_string = kwargs.get('connection_string', None) + + +class DataProviderMetadata(msrest.serialization.Model): + """Additional configuration for a data providers. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param provider_name: + :type provider_name: str + :ivar property_bag: Settings for the data provider. + :vartype property_bag: list[~azure.mgmt.web.v2021_02_01.models.KeyValuePairStringObject] + """ + + _validation = { + 'property_bag': {'readonly': True}, + } + + _attribute_map = { + 'provider_name': {'key': 'providerName', 'type': 'str'}, + 'property_bag': {'key': 'propertyBag', 'type': '[KeyValuePairStringObject]'}, + } + + def __init__( + self, + **kwargs + ): + super(DataProviderMetadata, self).__init__(**kwargs) + self.provider_name = kwargs.get('provider_name', None) + self.property_bag = None + + +class DataSource(msrest.serialization.Model): + """Class representing data source used by the detectors. + + :param instructions: Instructions if any for the data source. + :type instructions: list[str] + :param data_source_uri: Datasource Uri Links. + :type data_source_uri: list[~azure.mgmt.web.v2021_02_01.models.NameValuePair] + """ + + _attribute_map = { + 'instructions': {'key': 'instructions', 'type': '[str]'}, + 'data_source_uri': {'key': 'dataSourceUri', 'type': '[NameValuePair]'}, + } + + def __init__( + self, + **kwargs + ): + super(DataSource, self).__init__(**kwargs) + self.instructions = kwargs.get('instructions', None) + self.data_source_uri = kwargs.get('data_source_uri', None) + + +class DataTableResponseColumn(msrest.serialization.Model): + """Column definition. + + :param column_name: Name of the column. + :type column_name: str + :param data_type: Data type which looks like 'String' or 'Int32'. + :type data_type: str + :param column_type: Column Type. + :type column_type: str + """ + + _attribute_map = { + 'column_name': {'key': 'columnName', 'type': 'str'}, + 'data_type': {'key': 'dataType', 'type': 'str'}, + 'column_type': {'key': 'columnType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DataTableResponseColumn, self).__init__(**kwargs) + self.column_name = kwargs.get('column_name', None) + self.data_type = kwargs.get('data_type', None) + self.column_type = kwargs.get('column_type', None) + + +class DataTableResponseObject(msrest.serialization.Model): + """Data Table which defines columns and raw row values. + + :param table_name: Name of the table. + :type table_name: str + :param columns: List of columns with data types. + :type columns: list[~azure.mgmt.web.v2021_02_01.models.DataTableResponseColumn] + :param rows: Raw row values. + :type rows: list[list[str]] + """ + + _attribute_map = { + 'table_name': {'key': 'tableName', 'type': 'str'}, + 'columns': {'key': 'columns', 'type': '[DataTableResponseColumn]'}, + 'rows': {'key': 'rows', 'type': '[[str]]'}, + } + + def __init__( + self, + **kwargs + ): + super(DataTableResponseObject, self).__init__(**kwargs) + self.table_name = kwargs.get('table_name', None) + self.columns = kwargs.get('columns', None) + self.rows = kwargs.get('rows', None) + + +class DefaultAuthorizationPolicy(msrest.serialization.Model): + """The configuration settings of the Azure Active Directory default authorization policy. + + :param allowed_principals: The configuration settings of the Azure Active Directory allowed + principals. + :type allowed_principals: ~azure.mgmt.web.v2021_02_01.models.AllowedPrincipals + :param allowed_applications: The configuration settings of the Azure Active Directory allowed + applications. + :type allowed_applications: list[str] + """ + + _attribute_map = { + 'allowed_principals': {'key': 'allowedPrincipals', 'type': 'AllowedPrincipals'}, + 'allowed_applications': {'key': 'allowedApplications', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(DefaultAuthorizationPolicy, self).__init__(**kwargs) + self.allowed_principals = kwargs.get('allowed_principals', None) + self.allowed_applications = kwargs.get('allowed_applications', None) + + +class DefaultErrorResponse(msrest.serialization.Model): + """App Service error response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar error: Error model. + :vartype error: ~azure.mgmt.web.v2021_02_01.models.DefaultErrorResponseError + """ + + _validation = { + 'error': {'readonly': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'DefaultErrorResponseError'}, + } + + def __init__( + self, + **kwargs + ): + super(DefaultErrorResponse, self).__init__(**kwargs) + self.error = None + + +class DefaultErrorResponseError(msrest.serialization.Model): + """Error model. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Standardized string to programmatically identify the error. + :vartype code: str + :ivar message: Detailed error description and debugging information. + :vartype message: str + :ivar target: Detailed error description and debugging information. + :vartype target: str + :param details: + :type details: list[~azure.mgmt.web.v2021_02_01.models.DefaultErrorResponseErrorDetailsItem] + :ivar innererror: More information to debug error. + :vartype innererror: str + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'innererror': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[DefaultErrorResponseErrorDetailsItem]'}, + 'innererror': {'key': 'innererror', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DefaultErrorResponseError, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = kwargs.get('details', None) + self.innererror = None + + +class DefaultErrorResponseErrorDetailsItem(msrest.serialization.Model): + """Detailed errors. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Standardized string to programmatically identify the error. + :vartype code: str + :ivar message: Detailed error description and debugging information. + :vartype message: str + :ivar target: Detailed error description and debugging information. + :vartype target: str + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DefaultErrorResponseErrorDetailsItem, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + + +class DeletedAppRestoreRequest(ProxyOnlyResource): + """Details about restoring a deleted app. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param deleted_site_id: ARM resource ID of the deleted app. Example: + /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId}. + :type deleted_site_id: str + :param recover_configuration: If true, deleted site configuration, in addition to content, will + be restored. + :type recover_configuration: bool + :param snapshot_time: Point in time to restore the deleted app from, formatted as a DateTime + string. + If unspecified, default value is the time that the app was deleted. + :type snapshot_time: str + :param use_dr_secondary: If true, the snapshot is retrieved from DRSecondary endpoint. + :type use_dr_secondary: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'deleted_site_id': {'key': 'properties.deletedSiteId', 'type': 'str'}, + 'recover_configuration': {'key': 'properties.recoverConfiguration', 'type': 'bool'}, + 'snapshot_time': {'key': 'properties.snapshotTime', 'type': 'str'}, + 'use_dr_secondary': {'key': 'properties.useDRSecondary', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(DeletedAppRestoreRequest, self).__init__(**kwargs) + self.deleted_site_id = kwargs.get('deleted_site_id', None) + self.recover_configuration = kwargs.get('recover_configuration', None) + self.snapshot_time = kwargs.get('snapshot_time', None) + self.use_dr_secondary = kwargs.get('use_dr_secondary', None) + + +class DeletedSite(ProxyOnlyResource): + """A deleted app. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar deleted_site_id: Numeric id for the deleted site. + :vartype deleted_site_id: int + :ivar deleted_timestamp: Time in UTC when the app was deleted. + :vartype deleted_timestamp: str + :ivar subscription: Subscription containing the deleted site. + :vartype subscription: str + :ivar resource_group: ResourceGroup that contained the deleted site. + :vartype resource_group: str + :ivar deleted_site_name: Name of the deleted site. + :vartype deleted_site_name: str + :ivar slot: Slot of the deleted site. + :vartype slot: str + :ivar kind_properties_kind: Kind of site that was deleted. + :vartype kind_properties_kind: str + :ivar geo_region_name: Geo Region of the deleted site. + :vartype geo_region_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'deleted_site_id': {'readonly': True}, + 'deleted_timestamp': {'readonly': True}, + 'subscription': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'deleted_site_name': {'readonly': True}, + 'slot': {'readonly': True}, + 'kind_properties_kind': {'readonly': True}, + 'geo_region_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'deleted_site_id': {'key': 'properties.deletedSiteId', 'type': 'int'}, + 'deleted_timestamp': {'key': 'properties.deletedTimestamp', 'type': 'str'}, + 'subscription': {'key': 'properties.subscription', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'deleted_site_name': {'key': 'properties.deletedSiteName', 'type': 'str'}, + 'slot': {'key': 'properties.slot', 'type': 'str'}, + 'kind_properties_kind': {'key': 'properties.kind', 'type': 'str'}, + 'geo_region_name': {'key': 'properties.geoRegionName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DeletedSite, self).__init__(**kwargs) + self.deleted_site_id = None + self.deleted_timestamp = None + self.subscription = None + self.resource_group = None + self.deleted_site_name = None + self.slot = None + self.kind_properties_kind = None + self.geo_region_name = None + + +class DeletedWebAppCollection(msrest.serialization.Model): + """Collection of deleted apps. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.DeletedSite] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DeletedSite]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DeletedWebAppCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class Deployment(ProxyOnlyResource): + """User credentials used for publishing activity. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param status: Deployment status. + :type status: int + :param message: Details about deployment status. + :type message: str + :param author: Who authored the deployment. + :type author: str + :param deployer: Who performed the deployment. + :type deployer: str + :param author_email: Author email. + :type author_email: str + :param start_time: Start time. + :type start_time: ~datetime.datetime + :param end_time: End time. + :type end_time: ~datetime.datetime + :param active: True if deployment is currently active, false if completed and null if not + started. + :type active: bool + :param details: Details on deployment. + :type details: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'int'}, + 'message': {'key': 'properties.message', 'type': 'str'}, + 'author': {'key': 'properties.author', 'type': 'str'}, + 'deployer': {'key': 'properties.deployer', 'type': 'str'}, + 'author_email': {'key': 'properties.author_email', 'type': 'str'}, + 'start_time': {'key': 'properties.start_time', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.end_time', 'type': 'iso-8601'}, + 'active': {'key': 'properties.active', 'type': 'bool'}, + 'details': {'key': 'properties.details', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Deployment, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.message = kwargs.get('message', None) + self.author = kwargs.get('author', None) + self.deployer = kwargs.get('deployer', None) + self.author_email = kwargs.get('author_email', None) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.active = kwargs.get('active', None) + self.details = kwargs.get('details', None) + + +class DeploymentCollection(msrest.serialization.Model): + """Collection of app deployments. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.Deployment] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Deployment]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DeploymentCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class DeploymentLocations(msrest.serialization.Model): + """List of available locations (regions or App Service Environments) for +deployment of App Service resources. + + :param locations: Available regions. + :type locations: list[~azure.mgmt.web.v2021_02_01.models.GeoRegion] + :param hosting_environments: Available App Service Environments with full descriptions of the + environments. + :type hosting_environments: list[~azure.mgmt.web.v2021_02_01.models.AppServiceEnvironment] + :param hosting_environment_deployment_infos: Available App Service Environments with basic + information. + :type hosting_environment_deployment_infos: + list[~azure.mgmt.web.v2021_02_01.models.HostingEnvironmentDeploymentInfo] + """ + + _attribute_map = { + 'locations': {'key': 'locations', 'type': '[GeoRegion]'}, + 'hosting_environments': {'key': 'hostingEnvironments', 'type': '[AppServiceEnvironment]'}, + 'hosting_environment_deployment_infos': {'key': 'hostingEnvironmentDeploymentInfos', 'type': '[HostingEnvironmentDeploymentInfo]'}, + } + + def __init__( + self, + **kwargs + ): + super(DeploymentLocations, self).__init__(**kwargs) + self.locations = kwargs.get('locations', None) + self.hosting_environments = kwargs.get('hosting_environments', None) + self.hosting_environment_deployment_infos = kwargs.get('hosting_environment_deployment_infos', None) + + +class DetectorAbnormalTimePeriod(msrest.serialization.Model): + """Class representing Abnormal Time Period detected. + + :param start_time: Start time of the correlated event. + :type start_time: ~datetime.datetime + :param end_time: End time of the correlated event. + :type end_time: ~datetime.datetime + :param message: Message describing the event. + :type message: str + :param source: Represents the name of the Detector. + :type source: str + :param priority: Represents the rank of the Detector. + :type priority: float + :param meta_data: Downtime metadata. + :type meta_data: list[list[~azure.mgmt.web.v2021_02_01.models.NameValuePair]] + :param type: Represents the type of the Detector. Possible values include: "ServiceIncident", + "AppDeployment", "AppCrash", "RuntimeIssueDetected", "AseDeployment", "UserIssue", + "PlatformIssue", "Other". + :type type: str or ~azure.mgmt.web.v2021_02_01.models.IssueType + :param solutions: List of proposed solutions. + :type solutions: list[~azure.mgmt.web.v2021_02_01.models.Solution] + """ + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'message': {'key': 'message', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'str'}, + 'priority': {'key': 'priority', 'type': 'float'}, + 'meta_data': {'key': 'metaData', 'type': '[[NameValuePair]]'}, + 'type': {'key': 'type', 'type': 'str'}, + 'solutions': {'key': 'solutions', 'type': '[Solution]'}, + } + + def __init__( + self, + **kwargs + ): + super(DetectorAbnormalTimePeriod, self).__init__(**kwargs) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.message = kwargs.get('message', None) + self.source = kwargs.get('source', None) + self.priority = kwargs.get('priority', None) + self.meta_data = kwargs.get('meta_data', None) + self.type = kwargs.get('type', None) + self.solutions = kwargs.get('solutions', None) + + +class DetectorDefinition(msrest.serialization.Model): + """Class representing detector definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar display_name: Display name of the detector. + :vartype display_name: str + :ivar description: Description of the detector. + :vartype description: str + :ivar rank: Detector Rank. + :vartype rank: float + :ivar is_enabled: Flag representing whether detector is enabled or not. + :vartype is_enabled: bool + """ + + _validation = { + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'rank': {'readonly': True}, + 'is_enabled': {'readonly': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'rank': {'key': 'rank', 'type': 'float'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(DetectorDefinition, self).__init__(**kwargs) + self.display_name = None + self.description = None + self.rank = None + self.is_enabled = None + + +class DetectorDefinitionResource(ProxyOnlyResource): + """ARM resource for a detector definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar display_name: Display name of the detector. + :vartype display_name: str + :ivar description: Description of the detector. + :vartype description: str + :ivar rank: Detector Rank. + :vartype rank: float + :ivar is_enabled: Flag representing whether detector is enabled or not. + :vartype is_enabled: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'rank': {'readonly': True}, + 'is_enabled': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'rank': {'key': 'properties.rank', 'type': 'float'}, + 'is_enabled': {'key': 'properties.isEnabled', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(DetectorDefinitionResource, self).__init__(**kwargs) + self.display_name = None + self.description = None + self.rank = None + self.is_enabled = None + + +class DetectorInfo(msrest.serialization.Model): + """Definition of Detector. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Id of detector. + :vartype id: str + :ivar name: Name of detector. + :vartype name: str + :ivar description: Short description of the detector and its purpose. + :vartype description: str + :ivar author: Author of the detector. + :vartype author: str + :ivar category: Problem category. This serves for organizing group for detectors. + :vartype category: str + :ivar support_topic_list: List of Support Topics for which this detector is enabled. + :vartype support_topic_list: list[~azure.mgmt.web.v2021_02_01.models.SupportTopic] + :ivar analysis_type: Analysis Types for which this detector should apply to. + :vartype analysis_type: list[str] + :ivar type: Whether this detector is an Analysis Detector or not. Possible values include: + "Detector", "Analysis", "CategoryOverview". + :vartype type: str or ~azure.mgmt.web.v2021_02_01.models.DetectorType + :ivar score: Defines score of a detector to power ML based matching. + :vartype score: float + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'description': {'readonly': True}, + 'author': {'readonly': True}, + 'category': {'readonly': True}, + 'support_topic_list': {'readonly': True}, + 'analysis_type': {'readonly': True}, + 'type': {'readonly': True}, + 'score': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'author': {'key': 'author', 'type': 'str'}, + 'category': {'key': 'category', 'type': 'str'}, + 'support_topic_list': {'key': 'supportTopicList', 'type': '[SupportTopic]'}, + 'analysis_type': {'key': 'analysisType', 'type': '[str]'}, + 'type': {'key': 'type', 'type': 'str'}, + 'score': {'key': 'score', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(DetectorInfo, self).__init__(**kwargs) + self.id = None + self.name = None + self.description = None + self.author = None + self.category = None + self.support_topic_list = None + self.analysis_type = None + self.type = None + self.score = None + + +class DetectorResponse(ProxyOnlyResource): + """Class representing Response from Detector. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param metadata: metadata for the detector. + :type metadata: ~azure.mgmt.web.v2021_02_01.models.DetectorInfo + :param dataset: Data Set. + :type dataset: list[~azure.mgmt.web.v2021_02_01.models.DiagnosticData] + :param status: Indicates status of the most severe insight. + :type status: ~azure.mgmt.web.v2021_02_01.models.Status + :param data_providers_metadata: Additional configuration for different data providers to be + used by the UI. + :type data_providers_metadata: list[~azure.mgmt.web.v2021_02_01.models.DataProviderMetadata] + :param suggested_utterances: Suggested utterances where the detector can be applicable. + :type suggested_utterances: ~azure.mgmt.web.v2021_02_01.models.QueryUtterancesResults + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': 'DetectorInfo'}, + 'dataset': {'key': 'properties.dataset', 'type': '[DiagnosticData]'}, + 'status': {'key': 'properties.status', 'type': 'Status'}, + 'data_providers_metadata': {'key': 'properties.dataProvidersMetadata', 'type': '[DataProviderMetadata]'}, + 'suggested_utterances': {'key': 'properties.suggestedUtterances', 'type': 'QueryUtterancesResults'}, + } + + def __init__( + self, + **kwargs + ): + super(DetectorResponse, self).__init__(**kwargs) + self.metadata = kwargs.get('metadata', None) + self.dataset = kwargs.get('dataset', None) + self.status = kwargs.get('status', None) + self.data_providers_metadata = kwargs.get('data_providers_metadata', None) + self.suggested_utterances = kwargs.get('suggested_utterances', None) + + +class DetectorResponseCollection(msrest.serialization.Model): + """Collection of detector responses. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.DetectorResponse] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DetectorResponse]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DetectorResponseCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class DiagnosticAnalysis(ProxyOnlyResource): + """Class representing a diagnostic analysis done on an application. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param start_time: Start time of the period. + :type start_time: ~datetime.datetime + :param end_time: End time of the period. + :type end_time: ~datetime.datetime + :param abnormal_time_periods: List of time periods. + :type abnormal_time_periods: list[~azure.mgmt.web.v2021_02_01.models.AbnormalTimePeriod] + :param payload: Data by each detector. + :type payload: list[~azure.mgmt.web.v2021_02_01.models.AnalysisData] + :param non_correlated_detectors: Data by each detector for detectors that did not corelate. + :type non_correlated_detectors: list[~azure.mgmt.web.v2021_02_01.models.DetectorDefinition] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'abnormal_time_periods': {'key': 'properties.abnormalTimePeriods', 'type': '[AbnormalTimePeriod]'}, + 'payload': {'key': 'properties.payload', 'type': '[AnalysisData]'}, + 'non_correlated_detectors': {'key': 'properties.nonCorrelatedDetectors', 'type': '[DetectorDefinition]'}, + } + + def __init__( + self, + **kwargs + ): + super(DiagnosticAnalysis, self).__init__(**kwargs) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.abnormal_time_periods = kwargs.get('abnormal_time_periods', None) + self.payload = kwargs.get('payload', None) + self.non_correlated_detectors = kwargs.get('non_correlated_detectors', None) + + +class DiagnosticAnalysisCollection(msrest.serialization.Model): + """Collection of Diagnostic Analyses. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.AnalysisDefinition] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AnalysisDefinition]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DiagnosticAnalysisCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class DiagnosticCategory(ProxyOnlyResource): + """Class representing detector definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar description: Description of the diagnostic category. + :vartype description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DiagnosticCategory, self).__init__(**kwargs) + self.description = None + + +class DiagnosticCategoryCollection(msrest.serialization.Model): + """Collection of Diagnostic Categories. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.DiagnosticCategory] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DiagnosticCategory]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DiagnosticCategoryCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class DiagnosticData(msrest.serialization.Model): + """Set of data with rendering instructions. + + :param table: Data in table form. + :type table: ~azure.mgmt.web.v2021_02_01.models.DataTableResponseObject + :param rendering_properties: Properties that describe how the table should be rendered. + :type rendering_properties: ~azure.mgmt.web.v2021_02_01.models.Rendering + """ + + _attribute_map = { + 'table': {'key': 'table', 'type': 'DataTableResponseObject'}, + 'rendering_properties': {'key': 'renderingProperties', 'type': 'Rendering'}, + } + + def __init__( + self, + **kwargs + ): + super(DiagnosticData, self).__init__(**kwargs) + self.table = kwargs.get('table', None) + self.rendering_properties = kwargs.get('rendering_properties', None) + + +class DiagnosticDetectorCollection(msrest.serialization.Model): + """Collection of Diagnostic Detectors. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.DetectorDefinitionResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DetectorDefinitionResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DiagnosticDetectorCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class DiagnosticDetectorResponse(ProxyOnlyResource): + """Class representing Response from Diagnostic Detectors. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param start_time: Start time of the period. + :type start_time: ~datetime.datetime + :param end_time: End time of the period. + :type end_time: ~datetime.datetime + :param issue_detected: Flag representing Issue was detected. + :type issue_detected: bool + :param detector_definition: Detector's definition. + :type detector_definition: ~azure.mgmt.web.v2021_02_01.models.DetectorDefinition + :param metrics: Metrics provided by the detector. + :type metrics: list[~azure.mgmt.web.v2021_02_01.models.DiagnosticMetricSet] + :param abnormal_time_periods: List of Correlated events found by the detector. + :type abnormal_time_periods: + list[~azure.mgmt.web.v2021_02_01.models.DetectorAbnormalTimePeriod] + :param data: Additional Data that detector wants to send. + :type data: list[list[~azure.mgmt.web.v2021_02_01.models.NameValuePair]] + :param response_meta_data: Meta Data. + :type response_meta_data: ~azure.mgmt.web.v2021_02_01.models.ResponseMetaData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'issue_detected': {'key': 'properties.issueDetected', 'type': 'bool'}, + 'detector_definition': {'key': 'properties.detectorDefinition', 'type': 'DetectorDefinition'}, + 'metrics': {'key': 'properties.metrics', 'type': '[DiagnosticMetricSet]'}, + 'abnormal_time_periods': {'key': 'properties.abnormalTimePeriods', 'type': '[DetectorAbnormalTimePeriod]'}, + 'data': {'key': 'properties.data', 'type': '[[NameValuePair]]'}, + 'response_meta_data': {'key': 'properties.responseMetaData', 'type': 'ResponseMetaData'}, + } + + def __init__( + self, + **kwargs + ): + super(DiagnosticDetectorResponse, self).__init__(**kwargs) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.issue_detected = kwargs.get('issue_detected', None) + self.detector_definition = kwargs.get('detector_definition', None) + self.metrics = kwargs.get('metrics', None) + self.abnormal_time_periods = kwargs.get('abnormal_time_periods', None) + self.data = kwargs.get('data', None) + self.response_meta_data = kwargs.get('response_meta_data', None) + + +class DiagnosticMetricSample(msrest.serialization.Model): + """Class representing Diagnostic Metric. + + :param timestamp: Time at which metric is measured. + :type timestamp: ~datetime.datetime + :param role_instance: Role Instance. Null if this counter is not per instance + This is returned and should be whichever instance name we desire to be returned + i.e. CPU and Memory return RDWORKERNAME (LargeDed..._IN_0) + where RDWORKERNAME is Machine name below and RoleInstance name in parenthesis. + :type role_instance: str + :param total: Total value of the metric. If multiple measurements are made this will have sum + of all. + :type total: float + :param maximum: Maximum of the metric sampled during the time period. + :type maximum: float + :param minimum: Minimum of the metric sampled during the time period. + :type minimum: float + :param is_aggregated: Whether the values are aggregates across all workers or not. + :type is_aggregated: bool + """ + + _attribute_map = { + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'role_instance': {'key': 'roleInstance', 'type': 'str'}, + 'total': {'key': 'total', 'type': 'float'}, + 'maximum': {'key': 'maximum', 'type': 'float'}, + 'minimum': {'key': 'minimum', 'type': 'float'}, + 'is_aggregated': {'key': 'isAggregated', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(DiagnosticMetricSample, self).__init__(**kwargs) + self.timestamp = kwargs.get('timestamp', None) + self.role_instance = kwargs.get('role_instance', None) + self.total = kwargs.get('total', None) + self.maximum = kwargs.get('maximum', None) + self.minimum = kwargs.get('minimum', None) + self.is_aggregated = kwargs.get('is_aggregated', None) + + +class DiagnosticMetricSet(msrest.serialization.Model): + """Class representing Diagnostic Metric information. + + :param name: Name of the metric. + :type name: str + :param unit: Metric's unit. + :type unit: str + :param start_time: Start time of the period. + :type start_time: ~datetime.datetime + :param end_time: End time of the period. + :type end_time: ~datetime.datetime + :param time_grain: Presented time grain. Supported grains at the moment are PT1M, PT1H, P1D. + :type time_grain: str + :param values: Collection of metric values for the selected period based on the + {Microsoft.Web.Hosting.Administration.DiagnosticMetricSet.TimeGrain}. + :type values: list[~azure.mgmt.web.v2021_02_01.models.DiagnosticMetricSample] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'time_grain': {'key': 'timeGrain', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[DiagnosticMetricSample]'}, + } + + def __init__( + self, + **kwargs + ): + super(DiagnosticMetricSet, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.unit = kwargs.get('unit', None) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.time_grain = kwargs.get('time_grain', None) + self.values = kwargs.get('values', None) + + +class Dimension(msrest.serialization.Model): + """Dimension of a resource metric. For e.g. instance specific HTTP requests for a web app, +where instance name is dimension of the metric HTTP request. + + :param name: + :type name: str + :param display_name: + :type display_name: str + :param internal_name: + :type internal_name: str + :param to_be_exported_for_shoebox: + :type to_be_exported_for_shoebox: bool + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'internal_name': {'key': 'internalName', 'type': 'str'}, + 'to_be_exported_for_shoebox': {'key': 'toBeExportedForShoebox', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(Dimension, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.internal_name = kwargs.get('internal_name', None) + self.to_be_exported_for_shoebox = kwargs.get('to_be_exported_for_shoebox', None) + + +class Domain(Resource): + """Information about a domain. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param contact_admin: Administrative contact. + :type contact_admin: ~azure.mgmt.web.v2021_02_01.models.Contact + :param contact_billing: Billing contact. + :type contact_billing: ~azure.mgmt.web.v2021_02_01.models.Contact + :param contact_registrant: Registrant contact. + :type contact_registrant: ~azure.mgmt.web.v2021_02_01.models.Contact + :param contact_tech: Technical contact. + :type contact_tech: ~azure.mgmt.web.v2021_02_01.models.Contact + :ivar registration_status: Domain registration status. Possible values include: "Active", + "Awaiting", "Cancelled", "Confiscated", "Disabled", "Excluded", "Expired", "Failed", "Held", + "Locked", "Parked", "Pending", "Reserved", "Reverted", "Suspended", "Transferred", "Unknown", + "Unlocked", "Unparked", "Updated", "JsonConverterFailed". + :vartype registration_status: str or ~azure.mgmt.web.v2021_02_01.models.DomainStatus + :ivar provisioning_state: Domain provisioning state. Possible values include: "Succeeded", + "Failed", "Canceled", "InProgress", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.web.v2021_02_01.models.ProvisioningState + :ivar name_servers: Name servers. + :vartype name_servers: list[str] + :param privacy: :code:`true` if domain privacy is enabled for this domain; + otherwise, :code:`false`. + :type privacy: bool + :ivar created_time: Domain creation timestamp. + :vartype created_time: ~datetime.datetime + :ivar expiration_time: Domain expiration timestamp. + :vartype expiration_time: ~datetime.datetime + :ivar last_renewed_time: Timestamp when the domain was renewed last time. + :vartype last_renewed_time: ~datetime.datetime + :param auto_renew: :code:`true` if the domain should be automatically renewed; + otherwise, :code:`false`. + :type auto_renew: bool + :ivar ready_for_dns_record_management: :code:`true` if Azure can assign this + domain to App Service apps; otherwise, :code:`false`. This value will be + :code:`true` if domain registration status is active and + it is hosted on name servers Azure has programmatic access to. + :vartype ready_for_dns_record_management: bool + :ivar managed_host_names: All hostnames derived from the domain and assigned to Azure + resources. + :vartype managed_host_names: list[~azure.mgmt.web.v2021_02_01.models.HostName] + :param consent: Legal agreement consent. + :type consent: ~azure.mgmt.web.v2021_02_01.models.DomainPurchaseConsent + :ivar domain_not_renewable_reasons: Reasons why domain is not renewable. + :vartype domain_not_renewable_reasons: list[str or + ~azure.mgmt.web.v2021_02_01.models.DomainPropertiesDomainNotRenewableReasonsItem] + :param dns_type: Current DNS type. Possible values include: "AzureDns", + "DefaultDomainRegistrarDns". + :type dns_type: str or ~azure.mgmt.web.v2021_02_01.models.DnsType + :param dns_zone_id: Azure DNS Zone to use. + :type dns_zone_id: str + :param target_dns_type: Target DNS type (would be used for migration). Possible values include: + "AzureDns", "DefaultDomainRegistrarDns". + :type target_dns_type: str or ~azure.mgmt.web.v2021_02_01.models.DnsType + :param auth_code: + :type auth_code: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'registration_status': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'name_servers': {'readonly': True}, + 'created_time': {'readonly': True}, + 'expiration_time': {'readonly': True}, + 'last_renewed_time': {'readonly': True}, + 'ready_for_dns_record_management': {'readonly': True}, + 'managed_host_names': {'readonly': True}, + 'domain_not_renewable_reasons': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'contact_admin': {'key': 'properties.contactAdmin', 'type': 'Contact'}, + 'contact_billing': {'key': 'properties.contactBilling', 'type': 'Contact'}, + 'contact_registrant': {'key': 'properties.contactRegistrant', 'type': 'Contact'}, + 'contact_tech': {'key': 'properties.contactTech', 'type': 'Contact'}, + 'registration_status': {'key': 'properties.registrationStatus', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name_servers': {'key': 'properties.nameServers', 'type': '[str]'}, + 'privacy': {'key': 'properties.privacy', 'type': 'bool'}, + 'created_time': {'key': 'properties.createdTime', 'type': 'iso-8601'}, + 'expiration_time': {'key': 'properties.expirationTime', 'type': 'iso-8601'}, + 'last_renewed_time': {'key': 'properties.lastRenewedTime', 'type': 'iso-8601'}, + 'auto_renew': {'key': 'properties.autoRenew', 'type': 'bool'}, + 'ready_for_dns_record_management': {'key': 'properties.readyForDnsRecordManagement', 'type': 'bool'}, + 'managed_host_names': {'key': 'properties.managedHostNames', 'type': '[HostName]'}, + 'consent': {'key': 'properties.consent', 'type': 'DomainPurchaseConsent'}, + 'domain_not_renewable_reasons': {'key': 'properties.domainNotRenewableReasons', 'type': '[str]'}, + 'dns_type': {'key': 'properties.dnsType', 'type': 'str'}, + 'dns_zone_id': {'key': 'properties.dnsZoneId', 'type': 'str'}, + 'target_dns_type': {'key': 'properties.targetDnsType', 'type': 'str'}, + 'auth_code': {'key': 'properties.authCode', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Domain, self).__init__(**kwargs) + self.contact_admin = kwargs.get('contact_admin', None) + self.contact_billing = kwargs.get('contact_billing', None) + self.contact_registrant = kwargs.get('contact_registrant', None) + self.contact_tech = kwargs.get('contact_tech', None) + self.registration_status = None + self.provisioning_state = None + self.name_servers = None + self.privacy = kwargs.get('privacy', None) + self.created_time = None + self.expiration_time = None + self.last_renewed_time = None + self.auto_renew = kwargs.get('auto_renew', True) + self.ready_for_dns_record_management = None + self.managed_host_names = None + self.consent = kwargs.get('consent', None) + self.domain_not_renewable_reasons = None + self.dns_type = kwargs.get('dns_type', None) + self.dns_zone_id = kwargs.get('dns_zone_id', None) + self.target_dns_type = kwargs.get('target_dns_type', None) + self.auth_code = kwargs.get('auth_code', None) + + +class DomainAvailabilityCheckResult(msrest.serialization.Model): + """Domain availability check result. + + :param name: Name of the domain. + :type name: str + :param available: :code:`true` if domain can be purchased using CreateDomain API; + otherwise, :code:`false`. + :type available: bool + :param domain_type: Valid values are Regular domain: Azure will charge the full price of domain + registration, SoftDeleted: Purchasing this domain will simply restore it and this operation + will not cost anything. Possible values include: "Regular", "SoftDeleted". + :type domain_type: str or ~azure.mgmt.web.v2021_02_01.models.DomainType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'available': {'key': 'available', 'type': 'bool'}, + 'domain_type': {'key': 'domainType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DomainAvailabilityCheckResult, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.available = kwargs.get('available', None) + self.domain_type = kwargs.get('domain_type', None) + + +class DomainCollection(msrest.serialization.Model): + """Collection of domains. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.Domain] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Domain]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DomainCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class DomainControlCenterSsoRequest(msrest.serialization.Model): + """Single sign-on request information for domain management. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar url: URL where the single sign-on request is to be made. + :vartype url: str + :ivar post_parameter_key: Post parameter key. + :vartype post_parameter_key: str + :ivar post_parameter_value: Post parameter value. Client should use + 'application/x-www-form-urlencoded' encoding for this value. + :vartype post_parameter_value: str + """ + + _validation = { + 'url': {'readonly': True}, + 'post_parameter_key': {'readonly': True}, + 'post_parameter_value': {'readonly': True}, + } + + _attribute_map = { + 'url': {'key': 'url', 'type': 'str'}, + 'post_parameter_key': {'key': 'postParameterKey', 'type': 'str'}, + 'post_parameter_value': {'key': 'postParameterValue', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DomainControlCenterSsoRequest, self).__init__(**kwargs) + self.url = None + self.post_parameter_key = None + self.post_parameter_value = None + + +class DomainOwnershipIdentifier(ProxyOnlyResource): + """Domain ownership Identifier. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param ownership_id: Ownership Id. + :type ownership_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'ownership_id': {'key': 'properties.ownershipId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DomainOwnershipIdentifier, self).__init__(**kwargs) + self.ownership_id = kwargs.get('ownership_id', None) + + +class DomainOwnershipIdentifierCollection(msrest.serialization.Model): + """Collection of domain ownership identifiers. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.DomainOwnershipIdentifier] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DomainOwnershipIdentifier]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DomainOwnershipIdentifierCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class DomainPatchResource(ProxyOnlyResource): + """ARM resource for a domain. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param contact_admin: Administrative contact. + :type contact_admin: ~azure.mgmt.web.v2021_02_01.models.Contact + :param contact_billing: Billing contact. + :type contact_billing: ~azure.mgmt.web.v2021_02_01.models.Contact + :param contact_registrant: Registrant contact. + :type contact_registrant: ~azure.mgmt.web.v2021_02_01.models.Contact + :param contact_tech: Technical contact. + :type contact_tech: ~azure.mgmt.web.v2021_02_01.models.Contact + :ivar registration_status: Domain registration status. Possible values include: "Active", + "Awaiting", "Cancelled", "Confiscated", "Disabled", "Excluded", "Expired", "Failed", "Held", + "Locked", "Parked", "Pending", "Reserved", "Reverted", "Suspended", "Transferred", "Unknown", + "Unlocked", "Unparked", "Updated", "JsonConverterFailed". + :vartype registration_status: str or ~azure.mgmt.web.v2021_02_01.models.DomainStatus + :ivar provisioning_state: Domain provisioning state. Possible values include: "Succeeded", + "Failed", "Canceled", "InProgress", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.web.v2021_02_01.models.ProvisioningState + :ivar name_servers: Name servers. + :vartype name_servers: list[str] + :param privacy: :code:`true` if domain privacy is enabled for this domain; + otherwise, :code:`false`. + :type privacy: bool + :ivar created_time: Domain creation timestamp. + :vartype created_time: ~datetime.datetime + :ivar expiration_time: Domain expiration timestamp. + :vartype expiration_time: ~datetime.datetime + :ivar last_renewed_time: Timestamp when the domain was renewed last time. + :vartype last_renewed_time: ~datetime.datetime + :param auto_renew: :code:`true` if the domain should be automatically renewed; + otherwise, :code:`false`. + :type auto_renew: bool + :ivar ready_for_dns_record_management: :code:`true` if Azure can assign this + domain to App Service apps; otherwise, :code:`false`. This value will be + :code:`true` if domain registration status is active and + it is hosted on name servers Azure has programmatic access to. + :vartype ready_for_dns_record_management: bool + :ivar managed_host_names: All hostnames derived from the domain and assigned to Azure + resources. + :vartype managed_host_names: list[~azure.mgmt.web.v2021_02_01.models.HostName] + :param consent: Legal agreement consent. + :type consent: ~azure.mgmt.web.v2021_02_01.models.DomainPurchaseConsent + :ivar domain_not_renewable_reasons: Reasons why domain is not renewable. + :vartype domain_not_renewable_reasons: list[str or + ~azure.mgmt.web.v2021_02_01.models.DomainPatchResourcePropertiesDomainNotRenewableReasonsItem] + :param dns_type: Current DNS type. Possible values include: "AzureDns", + "DefaultDomainRegistrarDns". + :type dns_type: str or ~azure.mgmt.web.v2021_02_01.models.DnsType + :param dns_zone_id: Azure DNS Zone to use. + :type dns_zone_id: str + :param target_dns_type: Target DNS type (would be used for migration). Possible values include: + "AzureDns", "DefaultDomainRegistrarDns". + :type target_dns_type: str or ~azure.mgmt.web.v2021_02_01.models.DnsType + :param auth_code: + :type auth_code: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'registration_status': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'name_servers': {'readonly': True}, + 'created_time': {'readonly': True}, + 'expiration_time': {'readonly': True}, + 'last_renewed_time': {'readonly': True}, + 'ready_for_dns_record_management': {'readonly': True}, + 'managed_host_names': {'readonly': True}, + 'domain_not_renewable_reasons': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'contact_admin': {'key': 'properties.contactAdmin', 'type': 'Contact'}, + 'contact_billing': {'key': 'properties.contactBilling', 'type': 'Contact'}, + 'contact_registrant': {'key': 'properties.contactRegistrant', 'type': 'Contact'}, + 'contact_tech': {'key': 'properties.contactTech', 'type': 'Contact'}, + 'registration_status': {'key': 'properties.registrationStatus', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name_servers': {'key': 'properties.nameServers', 'type': '[str]'}, + 'privacy': {'key': 'properties.privacy', 'type': 'bool'}, + 'created_time': {'key': 'properties.createdTime', 'type': 'iso-8601'}, + 'expiration_time': {'key': 'properties.expirationTime', 'type': 'iso-8601'}, + 'last_renewed_time': {'key': 'properties.lastRenewedTime', 'type': 'iso-8601'}, + 'auto_renew': {'key': 'properties.autoRenew', 'type': 'bool'}, + 'ready_for_dns_record_management': {'key': 'properties.readyForDnsRecordManagement', 'type': 'bool'}, + 'managed_host_names': {'key': 'properties.managedHostNames', 'type': '[HostName]'}, + 'consent': {'key': 'properties.consent', 'type': 'DomainPurchaseConsent'}, + 'domain_not_renewable_reasons': {'key': 'properties.domainNotRenewableReasons', 'type': '[str]'}, + 'dns_type': {'key': 'properties.dnsType', 'type': 'str'}, + 'dns_zone_id': {'key': 'properties.dnsZoneId', 'type': 'str'}, + 'target_dns_type': {'key': 'properties.targetDnsType', 'type': 'str'}, + 'auth_code': {'key': 'properties.authCode', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DomainPatchResource, self).__init__(**kwargs) + self.contact_admin = kwargs.get('contact_admin', None) + self.contact_billing = kwargs.get('contact_billing', None) + self.contact_registrant = kwargs.get('contact_registrant', None) + self.contact_tech = kwargs.get('contact_tech', None) + self.registration_status = None + self.provisioning_state = None + self.name_servers = None + self.privacy = kwargs.get('privacy', None) + self.created_time = None + self.expiration_time = None + self.last_renewed_time = None + self.auto_renew = kwargs.get('auto_renew', True) + self.ready_for_dns_record_management = None + self.managed_host_names = None + self.consent = kwargs.get('consent', None) + self.domain_not_renewable_reasons = None + self.dns_type = kwargs.get('dns_type', None) + self.dns_zone_id = kwargs.get('dns_zone_id', None) + self.target_dns_type = kwargs.get('target_dns_type', None) + self.auth_code = kwargs.get('auth_code', None) + + +class DomainPurchaseConsent(msrest.serialization.Model): + """Domain purchase consent object, representing acceptance of applicable legal agreements. + + :param agreement_keys: List of applicable legal agreement keys. This list can be retrieved + using ListLegalAgreements API under :code:`TopLevelDomain` resource. + :type agreement_keys: list[str] + :param agreed_by: Client IP address. + :type agreed_by: str + :param agreed_at: Timestamp when the agreements were accepted. + :type agreed_at: ~datetime.datetime + """ + + _attribute_map = { + 'agreement_keys': {'key': 'agreementKeys', 'type': '[str]'}, + 'agreed_by': {'key': 'agreedBy', 'type': 'str'}, + 'agreed_at': {'key': 'agreedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(DomainPurchaseConsent, self).__init__(**kwargs) + self.agreement_keys = kwargs.get('agreement_keys', None) + self.agreed_by = kwargs.get('agreed_by', None) + self.agreed_at = kwargs.get('agreed_at', None) + + +class DomainRecommendationSearchParameters(msrest.serialization.Model): + """Domain recommendation search parameters. + + :param keywords: Keywords to be used for generating domain recommendations. + :type keywords: str + :param max_domain_recommendations: Maximum number of recommendations. + :type max_domain_recommendations: int + """ + + _attribute_map = { + 'keywords': {'key': 'keywords', 'type': 'str'}, + 'max_domain_recommendations': {'key': 'maxDomainRecommendations', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(DomainRecommendationSearchParameters, self).__init__(**kwargs) + self.keywords = kwargs.get('keywords', None) + self.max_domain_recommendations = kwargs.get('max_domain_recommendations', None) + + +class EnabledConfig(msrest.serialization.Model): + """Enabled configuration. + + :param enabled: True if configuration is enabled, false if it is disabled and null if + configuration is not set. + :type enabled: bool + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(EnabledConfig, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + + +class EndpointDependency(msrest.serialization.Model): + """A domain name that a service is reached at, including details of the current connection status. + + :param domain_name: The domain name of the dependency. + :type domain_name: str + :param endpoint_details: The IP Addresses and Ports used when connecting to DomainName. + :type endpoint_details: list[~azure.mgmt.web.v2021_02_01.models.EndpointDetail] + """ + + _attribute_map = { + 'domain_name': {'key': 'domainName', 'type': 'str'}, + 'endpoint_details': {'key': 'endpointDetails', 'type': '[EndpointDetail]'}, + } + + def __init__( + self, + **kwargs + ): + super(EndpointDependency, self).__init__(**kwargs) + self.domain_name = kwargs.get('domain_name', None) + self.endpoint_details = kwargs.get('endpoint_details', None) + + +class EndpointDetail(msrest.serialization.Model): + """Current TCP connectivity information from the App Service Environment to a single endpoint. + + :param ip_address: An IP Address that Domain Name currently resolves to. + :type ip_address: str + :param port: The port an endpoint is connected to. + :type port: int + :param latency: The time in milliseconds it takes for a TCP connection to be created from the + App Service Environment to this IpAddress at this Port. + :type latency: float + :param is_accessible: Whether it is possible to create a TCP connection from the App Service + Environment to this IpAddress at this Port. + :type is_accessible: bool + """ + + _attribute_map = { + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + 'latency': {'key': 'latency', 'type': 'float'}, + 'is_accessible': {'key': 'isAccessible', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(EndpointDetail, self).__init__(**kwargs) + self.ip_address = kwargs.get('ip_address', None) + self.port = kwargs.get('port', None) + self.latency = kwargs.get('latency', None) + self.is_accessible = kwargs.get('is_accessible', None) + + +class ErrorEntity(msrest.serialization.Model): + """Body of the error response returned from the API. + + :param extended_code: Type of error. + :type extended_code: str + :param message_template: Message template. + :type message_template: str + :param parameters: Parameters for the template. + :type parameters: list[str] + :param inner_errors: Inner errors. + :type inner_errors: list[~azure.mgmt.web.v2021_02_01.models.ErrorEntity] + :param details: Error Details. + :type details: list[~azure.mgmt.web.v2021_02_01.models.ErrorEntity] + :param target: The error target. + :type target: str + :param code: Basic error code. + :type code: str + :param message: Any details of the error. + :type message: str + """ + + _attribute_map = { + 'extended_code': {'key': 'extendedCode', 'type': 'str'}, + 'message_template': {'key': 'messageTemplate', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': '[str]'}, + 'inner_errors': {'key': 'innerErrors', 'type': '[ErrorEntity]'}, + 'details': {'key': 'details', 'type': '[ErrorEntity]'}, + 'target': {'key': 'target', 'type': 'str'}, + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorEntity, self).__init__(**kwargs) + self.extended_code = kwargs.get('extended_code', None) + self.message_template = kwargs.get('message_template', None) + self.parameters = kwargs.get('parameters', None) + self.inner_errors = kwargs.get('inner_errors', None) + self.details = kwargs.get('details', None) + self.target = kwargs.get('target', None) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + + +class Experiments(msrest.serialization.Model): + """Routing rules in production experiments. + + :param ramp_up_rules: List of ramp-up rules. + :type ramp_up_rules: list[~azure.mgmt.web.v2021_02_01.models.RampUpRule] + """ + + _attribute_map = { + 'ramp_up_rules': {'key': 'rampUpRules', 'type': '[RampUpRule]'}, + } + + def __init__( + self, + **kwargs + ): + super(Experiments, self).__init__(**kwargs) + self.ramp_up_rules = kwargs.get('ramp_up_rules', None) + + +class ExtendedLocation(msrest.serialization.Model): + """Extended Location. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param name: Name of extended location. + :type name: str + :ivar type: Type of extended location. + :vartype type: str + """ + + _validation = { + 'type': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExtendedLocation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = None + + +class Facebook(msrest.serialization.Model): + """The configuration settings of the Facebook provider. + + :param enabled: :code:`false` if the Facebook provider should not be enabled + despite the set registration; otherwise, :code:`true`. + :type enabled: bool + :param registration: The configuration settings of the app registration for the Facebook + provider. + :type registration: ~azure.mgmt.web.v2021_02_01.models.AppRegistration + :param graph_api_version: The version of the Facebook api to be used while logging in. + :type graph_api_version: str + :param login: The configuration settings of the login flow. + :type login: ~azure.mgmt.web.v2021_02_01.models.LoginScopes + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'AppRegistration'}, + 'graph_api_version': {'key': 'graphApiVersion', 'type': 'str'}, + 'login': {'key': 'login', 'type': 'LoginScopes'}, + } + + def __init__( + self, + **kwargs + ): + super(Facebook, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.registration = kwargs.get('registration', None) + self.graph_api_version = kwargs.get('graph_api_version', None) + self.login = kwargs.get('login', None) + + +class FileSystemApplicationLogsConfig(msrest.serialization.Model): + """Application logs to file system configuration. + + :param level: Log level. Possible values include: "Off", "Verbose", "Information", "Warning", + "Error". + :type level: str or ~azure.mgmt.web.v2021_02_01.models.LogLevel + """ + + _attribute_map = { + 'level': {'key': 'level', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(FileSystemApplicationLogsConfig, self).__init__(**kwargs) + self.level = kwargs.get('level', None) + + +class FileSystemHttpLogsConfig(msrest.serialization.Model): + """Http logs to file system configuration. + + :param retention_in_mb: Maximum size in megabytes that http log files can use. + When reached old log files will be removed to make space for new ones. + Value can range between 25 and 100. + :type retention_in_mb: int + :param retention_in_days: Retention in days. + Remove files older than X days. + 0 or lower means no retention. + :type retention_in_days: int + :param enabled: True if configuration is enabled, false if it is disabled and null if + configuration is not set. + :type enabled: bool + """ + + _validation = { + 'retention_in_mb': {'maximum': 100, 'minimum': 25}, + } + + _attribute_map = { + 'retention_in_mb': {'key': 'retentionInMb', 'type': 'int'}, + 'retention_in_days': {'key': 'retentionInDays', 'type': 'int'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(FileSystemHttpLogsConfig, self).__init__(**kwargs) + self.retention_in_mb = kwargs.get('retention_in_mb', None) + self.retention_in_days = kwargs.get('retention_in_days', None) + self.enabled = kwargs.get('enabled', None) + + +class FileSystemTokenStore(msrest.serialization.Model): + """The configuration settings of the storage of the tokens if a file system is used. + + :param directory: The directory in which the tokens will be stored. + :type directory: str + """ + + _attribute_map = { + 'directory': {'key': 'directory', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(FileSystemTokenStore, self).__init__(**kwargs) + self.directory = kwargs.get('directory', None) + + +class ForwardProxy(msrest.serialization.Model): + """The configuration settings of a forward proxy used to make the requests. + + :param convention: The convention used to determine the url of the request made. Possible + values include: "NoProxy", "Standard", "Custom". + :type convention: str or ~azure.mgmt.web.v2021_02_01.models.ForwardProxyConvention + :param custom_host_header_name: The name of the header containing the host of the request. + :type custom_host_header_name: str + :param custom_proto_header_name: The name of the header containing the scheme of the request. + :type custom_proto_header_name: str + """ + + _attribute_map = { + 'convention': {'key': 'convention', 'type': 'str'}, + 'custom_host_header_name': {'key': 'customHostHeaderName', 'type': 'str'}, + 'custom_proto_header_name': {'key': 'customProtoHeaderName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ForwardProxy, self).__init__(**kwargs) + self.convention = kwargs.get('convention', None) + self.custom_host_header_name = kwargs.get('custom_host_header_name', None) + self.custom_proto_header_name = kwargs.get('custom_proto_header_name', None) + + +class FrontEndConfiguration(msrest.serialization.Model): + """FrontEndConfiguration. + + :param kind: Possible values include: "NodePort", "LoadBalancer". + :type kind: str or ~azure.mgmt.web.v2021_02_01.models.FrontEndServiceType + """ + + _attribute_map = { + 'kind': {'key': 'kind', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(FrontEndConfiguration, self).__init__(**kwargs) + self.kind = kwargs.get('kind', None) + + +class FunctionAppMajorVersion(msrest.serialization.Model): + """Function App stack major version. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar display_text: Function App stack major version (display only). + :vartype display_text: str + :ivar value: Function App stack major version name. + :vartype value: str + :ivar minor_versions: Minor versions associated with the major version. + :vartype minor_versions: list[~azure.mgmt.web.v2021_02_01.models.FunctionAppMinorVersion] + """ + + _validation = { + 'display_text': {'readonly': True}, + 'value': {'readonly': True}, + 'minor_versions': {'readonly': True}, + } + + _attribute_map = { + 'display_text': {'key': 'displayText', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'minor_versions': {'key': 'minorVersions', 'type': '[FunctionAppMinorVersion]'}, + } + + def __init__( + self, + **kwargs + ): + super(FunctionAppMajorVersion, self).__init__(**kwargs) + self.display_text = None + self.value = None + self.minor_versions = None + + +class FunctionAppMinorVersion(msrest.serialization.Model): + """Function App stack minor version. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar display_text: Function App stack (display only). + :vartype display_text: str + :ivar value: Function App stack name. + :vartype value: str + :ivar stack_settings: Settings associated with the minor version. + :vartype stack_settings: ~azure.mgmt.web.v2021_02_01.models.FunctionAppRuntimes + """ + + _validation = { + 'display_text': {'readonly': True}, + 'value': {'readonly': True}, + 'stack_settings': {'readonly': True}, + } + + _attribute_map = { + 'display_text': {'key': 'displayText', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'stack_settings': {'key': 'stackSettings', 'type': 'FunctionAppRuntimes'}, + } + + def __init__( + self, + **kwargs + ): + super(FunctionAppMinorVersion, self).__init__(**kwargs) + self.display_text = None + self.value = None + self.stack_settings = None + + +class FunctionAppRuntimes(msrest.serialization.Model): + """Function App stack runtimes. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar linux_runtime_settings: Linux-specific settings associated with the minor version. + :vartype linux_runtime_settings: ~azure.mgmt.web.v2021_02_01.models.FunctionAppRuntimeSettings + :ivar windows_runtime_settings: Windows-specific settings associated with the minor version. + :vartype windows_runtime_settings: + ~azure.mgmt.web.v2021_02_01.models.FunctionAppRuntimeSettings + """ + + _validation = { + 'linux_runtime_settings': {'readonly': True}, + 'windows_runtime_settings': {'readonly': True}, + } + + _attribute_map = { + 'linux_runtime_settings': {'key': 'linuxRuntimeSettings', 'type': 'FunctionAppRuntimeSettings'}, + 'windows_runtime_settings': {'key': 'windowsRuntimeSettings', 'type': 'FunctionAppRuntimeSettings'}, + } + + def __init__( + self, + **kwargs + ): + super(FunctionAppRuntimes, self).__init__(**kwargs) + self.linux_runtime_settings = None + self.windows_runtime_settings = None + + +class FunctionAppRuntimeSettings(msrest.serialization.Model): + """Function App runtime settings. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar runtime_version: Function App stack minor version (runtime only). + :vartype runtime_version: str + :ivar remote_debugging_supported: :code:`true` if remote debugging is supported + for the stack; otherwise, :code:`false`. + :vartype remote_debugging_supported: bool + :ivar app_insights_settings: Application Insights settings associated with the minor version. + :vartype app_insights_settings: + ~azure.mgmt.web.v2021_02_01.models.AppInsightsWebAppStackSettings + :ivar git_hub_action_settings: GitHub Actions settings associated with the minor version. + :vartype git_hub_action_settings: + ~azure.mgmt.web.v2021_02_01.models.GitHubActionWebAppStackSettings + :ivar app_settings_dictionary: Application settings associated with the minor version. + :vartype app_settings_dictionary: dict[str, str] + :ivar site_config_properties_dictionary: Configuration settings associated with the minor + version. + :vartype site_config_properties_dictionary: + ~azure.mgmt.web.v2021_02_01.models.SiteConfigPropertiesDictionary + :ivar supported_functions_extension_versions: List of supported Functions extension versions. + :vartype supported_functions_extension_versions: list[str] + :ivar is_preview: :code:`true` if the stack is in preview; otherwise, + :code:`false`. + :vartype is_preview: bool + :ivar is_deprecated: :code:`true` if the stack is deprecated; otherwise, + :code:`false`. + :vartype is_deprecated: bool + :ivar is_hidden: :code:`true` if the stack should be hidden; otherwise, + :code:`false`. + :vartype is_hidden: bool + :ivar end_of_life_date: End-of-life date for the minor version. + :vartype end_of_life_date: ~datetime.datetime + :ivar is_auto_update: :code:`true` if the stack version is auto-updated; + otherwise, :code:`false`. + :vartype is_auto_update: bool + :ivar is_early_access: :code:`true` if the minor version is early-access; + otherwise, :code:`false`. + :vartype is_early_access: bool + :ivar is_default: :code:`true` if the minor version the default; otherwise, + :code:`false`. + :vartype is_default: bool + """ + + _validation = { + 'runtime_version': {'readonly': True}, + 'remote_debugging_supported': {'readonly': True}, + 'app_insights_settings': {'readonly': True}, + 'git_hub_action_settings': {'readonly': True}, + 'app_settings_dictionary': {'readonly': True}, + 'site_config_properties_dictionary': {'readonly': True}, + 'supported_functions_extension_versions': {'readonly': True}, + 'is_preview': {'readonly': True}, + 'is_deprecated': {'readonly': True}, + 'is_hidden': {'readonly': True}, + 'end_of_life_date': {'readonly': True}, + 'is_auto_update': {'readonly': True}, + 'is_early_access': {'readonly': True}, + 'is_default': {'readonly': True}, + } + + _attribute_map = { + 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, + 'remote_debugging_supported': {'key': 'remoteDebuggingSupported', 'type': 'bool'}, + 'app_insights_settings': {'key': 'appInsightsSettings', 'type': 'AppInsightsWebAppStackSettings'}, + 'git_hub_action_settings': {'key': 'gitHubActionSettings', 'type': 'GitHubActionWebAppStackSettings'}, + 'app_settings_dictionary': {'key': 'appSettingsDictionary', 'type': '{str}'}, + 'site_config_properties_dictionary': {'key': 'siteConfigPropertiesDictionary', 'type': 'SiteConfigPropertiesDictionary'}, + 'supported_functions_extension_versions': {'key': 'supportedFunctionsExtensionVersions', 'type': '[str]'}, + 'is_preview': {'key': 'isPreview', 'type': 'bool'}, + 'is_deprecated': {'key': 'isDeprecated', 'type': 'bool'}, + 'is_hidden': {'key': 'isHidden', 'type': 'bool'}, + 'end_of_life_date': {'key': 'endOfLifeDate', 'type': 'iso-8601'}, + 'is_auto_update': {'key': 'isAutoUpdate', 'type': 'bool'}, + 'is_early_access': {'key': 'isEarlyAccess', 'type': 'bool'}, + 'is_default': {'key': 'isDefault', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(FunctionAppRuntimeSettings, self).__init__(**kwargs) + self.runtime_version = None + self.remote_debugging_supported = None + self.app_insights_settings = None + self.git_hub_action_settings = None + self.app_settings_dictionary = None + self.site_config_properties_dictionary = None + self.supported_functions_extension_versions = None + self.is_preview = None + self.is_deprecated = None + self.is_hidden = None + self.end_of_life_date = None + self.is_auto_update = None + self.is_early_access = None + self.is_default = None + + +class FunctionAppStack(ProxyOnlyResource): + """Function App Stack. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Function App stack location. + :vartype location: str + :ivar display_text: Function App stack (display only). + :vartype display_text: str + :ivar value: Function App stack name. + :vartype value: str + :ivar major_versions: List of major versions available. + :vartype major_versions: list[~azure.mgmt.web.v2021_02_01.models.FunctionAppMajorVersion] + :ivar preferred_os: Function App stack preferred OS. Possible values include: "Windows", + "Linux". + :vartype preferred_os: str or ~azure.mgmt.web.v2021_02_01.models.StackPreferredOs + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'readonly': True}, + 'display_text': {'readonly': True}, + 'value': {'readonly': True}, + 'major_versions': {'readonly': True}, + 'preferred_os': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'display_text': {'key': 'properties.displayText', 'type': 'str'}, + 'value': {'key': 'properties.value', 'type': 'str'}, + 'major_versions': {'key': 'properties.majorVersions', 'type': '[FunctionAppMajorVersion]'}, + 'preferred_os': {'key': 'properties.preferredOs', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(FunctionAppStack, self).__init__(**kwargs) + self.location = None + self.display_text = None + self.value = None + self.major_versions = None + self.preferred_os = None + + +class FunctionAppStackCollection(msrest.serialization.Model): + """Collection of Function app Stacks. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.FunctionAppStack] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[FunctionAppStack]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(FunctionAppStackCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class FunctionEnvelope(ProxyOnlyResource): + """Function information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param function_app_id: Function App ID. + :type function_app_id: str + :param script_root_path_href: Script root path URI. + :type script_root_path_href: str + :param script_href: Script URI. + :type script_href: str + :param config_href: Config URI. + :type config_href: str + :param test_data_href: Test data URI. + :type test_data_href: str + :param secrets_file_href: Secrets file URI. + :type secrets_file_href: str + :param href: Function URI. + :type href: str + :param config: Config information. + :type config: any + :param files: File list. + :type files: dict[str, str] + :param test_data: Test data used when testing via the Azure Portal. + :type test_data: str + :param invoke_url_template: The invocation URL. + :type invoke_url_template: str + :param language: The function language. + :type language: str + :param is_disabled: Gets or sets a value indicating whether the function is disabled. + :type is_disabled: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'function_app_id': {'key': 'properties.function_app_id', 'type': 'str'}, + 'script_root_path_href': {'key': 'properties.script_root_path_href', 'type': 'str'}, + 'script_href': {'key': 'properties.script_href', 'type': 'str'}, + 'config_href': {'key': 'properties.config_href', 'type': 'str'}, + 'test_data_href': {'key': 'properties.test_data_href', 'type': 'str'}, + 'secrets_file_href': {'key': 'properties.secrets_file_href', 'type': 'str'}, + 'href': {'key': 'properties.href', 'type': 'str'}, + 'config': {'key': 'properties.config', 'type': 'object'}, + 'files': {'key': 'properties.files', 'type': '{str}'}, + 'test_data': {'key': 'properties.test_data', 'type': 'str'}, + 'invoke_url_template': {'key': 'properties.invoke_url_template', 'type': 'str'}, + 'language': {'key': 'properties.language', 'type': 'str'}, + 'is_disabled': {'key': 'properties.isDisabled', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(FunctionEnvelope, self).__init__(**kwargs) + self.function_app_id = kwargs.get('function_app_id', None) + self.script_root_path_href = kwargs.get('script_root_path_href', None) + self.script_href = kwargs.get('script_href', None) + self.config_href = kwargs.get('config_href', None) + self.test_data_href = kwargs.get('test_data_href', None) + self.secrets_file_href = kwargs.get('secrets_file_href', None) + self.href = kwargs.get('href', None) + self.config = kwargs.get('config', None) + self.files = kwargs.get('files', None) + self.test_data = kwargs.get('test_data', None) + self.invoke_url_template = kwargs.get('invoke_url_template', None) + self.language = kwargs.get('language', None) + self.is_disabled = kwargs.get('is_disabled', None) + + +class FunctionEnvelopeCollection(msrest.serialization.Model): + """Collection of Kudu function information elements. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.FunctionEnvelope] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[FunctionEnvelope]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(FunctionEnvelopeCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class FunctionSecrets(msrest.serialization.Model): + """Function secrets. + + :param key: Secret key. + :type key: str + :param trigger_url: Trigger URL. + :type trigger_url: str + """ + + _attribute_map = { + 'key': {'key': 'key', 'type': 'str'}, + 'trigger_url': {'key': 'trigger_url', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(FunctionSecrets, self).__init__(**kwargs) + self.key = kwargs.get('key', None) + self.trigger_url = kwargs.get('trigger_url', None) + + +class GeoRegion(ProxyOnlyResource): + """Geographical region. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar description: Region description. + :vartype description: str + :ivar display_name: Display name for region. + :vartype display_name: str + :ivar org_domain: Display name for region. + :vartype org_domain: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'description': {'readonly': True}, + 'display_name': {'readonly': True}, + 'org_domain': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'org_domain': {'key': 'properties.orgDomain', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GeoRegion, self).__init__(**kwargs) + self.description = None + self.display_name = None + self.org_domain = None + + +class GeoRegionCollection(msrest.serialization.Model): + """Collection of geographical regions. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.GeoRegion] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[GeoRegion]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GeoRegionCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class GitHub(msrest.serialization.Model): + """The configuration settings of the GitHub provider. + + :param enabled: :code:`false` if the GitHub provider should not be enabled despite + the set registration; otherwise, :code:`true`. + :type enabled: bool + :param registration: The configuration settings of the app registration for the GitHub + provider. + :type registration: ~azure.mgmt.web.v2021_02_01.models.ClientRegistration + :param login: The configuration settings of the login flow. + :type login: ~azure.mgmt.web.v2021_02_01.models.LoginScopes + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'ClientRegistration'}, + 'login': {'key': 'login', 'type': 'LoginScopes'}, + } + + def __init__( + self, + **kwargs + ): + super(GitHub, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.registration = kwargs.get('registration', None) + self.login = kwargs.get('login', None) + + +class GitHubActionCodeConfiguration(msrest.serialization.Model): + """The GitHub action code configuration. + + :param runtime_stack: Runtime stack is used to determine the workflow file content for code + base apps. + :type runtime_stack: str + :param runtime_version: Runtime version is used to determine what build version to set in the + workflow file. + :type runtime_version: str + """ + + _attribute_map = { + 'runtime_stack': {'key': 'runtimeStack', 'type': 'str'}, + 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GitHubActionCodeConfiguration, self).__init__(**kwargs) + self.runtime_stack = kwargs.get('runtime_stack', None) + self.runtime_version = kwargs.get('runtime_version', None) + + +class GitHubActionConfiguration(msrest.serialization.Model): + """The GitHub action configuration. + + :param code_configuration: GitHub Action code configuration. + :type code_configuration: ~azure.mgmt.web.v2021_02_01.models.GitHubActionCodeConfiguration + :param container_configuration: GitHub Action container configuration. + :type container_configuration: + ~azure.mgmt.web.v2021_02_01.models.GitHubActionContainerConfiguration + :param is_linux: This will help determine the workflow configuration to select. + :type is_linux: bool + :param generate_workflow_file: Workflow option to determine whether the workflow file should be + generated and written to the repository. + :type generate_workflow_file: bool + """ + + _attribute_map = { + 'code_configuration': {'key': 'codeConfiguration', 'type': 'GitHubActionCodeConfiguration'}, + 'container_configuration': {'key': 'containerConfiguration', 'type': 'GitHubActionContainerConfiguration'}, + 'is_linux': {'key': 'isLinux', 'type': 'bool'}, + 'generate_workflow_file': {'key': 'generateWorkflowFile', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(GitHubActionConfiguration, self).__init__(**kwargs) + self.code_configuration = kwargs.get('code_configuration', None) + self.container_configuration = kwargs.get('container_configuration', None) + self.is_linux = kwargs.get('is_linux', None) + self.generate_workflow_file = kwargs.get('generate_workflow_file', None) + + +class GitHubActionContainerConfiguration(msrest.serialization.Model): + """The GitHub action container configuration. + + :param server_url: The server URL for the container registry where the build will be hosted. + :type server_url: str + :param image_name: The image name for the build. + :type image_name: str + :param username: The username used to upload the image to the container registry. + :type username: str + :param password: The password used to upload the image to the container registry. + :type password: str + """ + + _attribute_map = { + 'server_url': {'key': 'serverUrl', 'type': 'str'}, + 'image_name': {'key': 'imageName', 'type': 'str'}, + 'username': {'key': 'username', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GitHubActionContainerConfiguration, self).__init__(**kwargs) + self.server_url = kwargs.get('server_url', None) + self.image_name = kwargs.get('image_name', None) + self.username = kwargs.get('username', None) + self.password = kwargs.get('password', None) + + +class GitHubActionWebAppStackSettings(msrest.serialization.Model): + """GitHub Actions Web App stack settings. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar is_supported: :code:`true` if GitHub Actions is supported for the stack; + otherwise, :code:`false`. + :vartype is_supported: bool + :ivar supported_version: The minor version that is supported for GitHub Actions. + :vartype supported_version: str + """ + + _validation = { + 'is_supported': {'readonly': True}, + 'supported_version': {'readonly': True}, + } + + _attribute_map = { + 'is_supported': {'key': 'isSupported', 'type': 'bool'}, + 'supported_version': {'key': 'supportedVersion', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GitHubActionWebAppStackSettings, self).__init__(**kwargs) + self.is_supported = None + self.supported_version = None + + +class GlobalCsmSkuDescription(msrest.serialization.Model): + """A Global SKU Description. + + :param name: Name of the resource SKU. + :type name: str + :param tier: Service Tier of the resource SKU. + :type tier: str + :param size: Size specifier of the resource SKU. + :type size: str + :param family: Family code of the resource SKU. + :type family: str + :param capacity: Min, max, and default scale values of the SKU. + :type capacity: ~azure.mgmt.web.v2021_02_01.models.SkuCapacity + :param locations: Locations of the SKU. + :type locations: list[str] + :param capabilities: Capabilities of the SKU, e.g., is traffic manager enabled?. + :type capabilities: list[~azure.mgmt.web.v2021_02_01.models.Capability] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'SkuCapacity'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[Capability]'}, + } + + def __init__( + self, + **kwargs + ): + super(GlobalCsmSkuDescription, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.size = kwargs.get('size', None) + self.family = kwargs.get('family', None) + self.capacity = kwargs.get('capacity', None) + self.locations = kwargs.get('locations', None) + self.capabilities = kwargs.get('capabilities', None) + + +class GlobalValidation(msrest.serialization.Model): + """The configuration settings that determines the validation flow of users using App Service Authentication/Authorization. + + :param require_authentication: :code:`true` if the authentication flow is required + any request is made; otherwise, :code:`false`. + :type require_authentication: bool + :param unauthenticated_client_action: The action to take when an unauthenticated client + attempts to access the app. Possible values include: "RedirectToLoginPage", "AllowAnonymous", + "Return401", "Return403". + :type unauthenticated_client_action: str or + ~azure.mgmt.web.v2021_02_01.models.UnauthenticatedClientActionV2 + :param redirect_to_provider: The default authentication provider to use when multiple providers + are configured. + This setting is only needed if multiple providers are configured and the unauthenticated + client + action is set to "RedirectToLoginPage". + :type redirect_to_provider: str + :param excluded_paths: The paths for which unauthenticated flow would not be redirected to the + login page. + :type excluded_paths: list[str] + """ + + _attribute_map = { + 'require_authentication': {'key': 'requireAuthentication', 'type': 'bool'}, + 'unauthenticated_client_action': {'key': 'unauthenticatedClientAction', 'type': 'str'}, + 'redirect_to_provider': {'key': 'redirectToProvider', 'type': 'str'}, + 'excluded_paths': {'key': 'excludedPaths', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(GlobalValidation, self).__init__(**kwargs) + self.require_authentication = kwargs.get('require_authentication', None) + self.unauthenticated_client_action = kwargs.get('unauthenticated_client_action', None) + self.redirect_to_provider = kwargs.get('redirect_to_provider', None) + self.excluded_paths = kwargs.get('excluded_paths', None) + + +class Google(msrest.serialization.Model): + """The configuration settings of the Google provider. + + :param enabled: :code:`false` if the Google provider should not be enabled despite + the set registration; otherwise, :code:`true`. + :type enabled: bool + :param registration: The configuration settings of the app registration for the Google + provider. + :type registration: ~azure.mgmt.web.v2021_02_01.models.ClientRegistration + :param login: The configuration settings of the login flow. + :type login: ~azure.mgmt.web.v2021_02_01.models.LoginScopes + :param validation: The configuration settings of the Azure Active Directory token validation + flow. + :type validation: ~azure.mgmt.web.v2021_02_01.models.AllowedAudiencesValidation + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'ClientRegistration'}, + 'login': {'key': 'login', 'type': 'LoginScopes'}, + 'validation': {'key': 'validation', 'type': 'AllowedAudiencesValidation'}, + } + + def __init__( + self, + **kwargs + ): + super(Google, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.registration = kwargs.get('registration', None) + self.login = kwargs.get('login', None) + self.validation = kwargs.get('validation', None) + + +class HandlerMapping(msrest.serialization.Model): + """The IIS handler mappings used to define which handler processes HTTP requests with certain extension. +For example, it is used to configure php-cgi.exe process to handle all HTTP requests with *.php extension. + + :param extension: Requests with this extension will be handled using the specified FastCGI + application. + :type extension: str + :param script_processor: The absolute path to the FastCGI application. + :type script_processor: str + :param arguments: Command-line arguments to be passed to the script processor. + :type arguments: str + """ + + _attribute_map = { + 'extension': {'key': 'extension', 'type': 'str'}, + 'script_processor': {'key': 'scriptProcessor', 'type': 'str'}, + 'arguments': {'key': 'arguments', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HandlerMapping, self).__init__(**kwargs) + self.extension = kwargs.get('extension', None) + self.script_processor = kwargs.get('script_processor', None) + self.arguments = kwargs.get('arguments', None) + + +class HostingEnvironmentDeploymentInfo(msrest.serialization.Model): + """Information needed to create resources on an App Service Environment. + + :param name: Name of the App Service Environment. + :type name: str + :param location: Location of the App Service Environment. + :type location: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HostingEnvironmentDeploymentInfo, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.location = kwargs.get('location', None) + + +class HostingEnvironmentDiagnostics(msrest.serialization.Model): + """Diagnostics for an App Service Environment. + + :param name: Name/identifier of the diagnostics. + :type name: str + :param diagnostics_output: Diagnostics output. + :type diagnostics_output: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'diagnostics_output': {'key': 'diagnosticsOutput', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HostingEnvironmentDiagnostics, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.diagnostics_output = kwargs.get('diagnostics_output', None) + + +class HostingEnvironmentProfile(msrest.serialization.Model): + """Specification for an App Service Environment to use for this resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID of the App Service Environment. + :type id: str + :ivar name: Name of the App Service Environment. + :vartype name: str + :ivar type: Resource type of the App Service Environment. + :vartype type: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HostingEnvironmentProfile, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = None + self.type = None + + +class HostKeys(msrest.serialization.Model): + """Functions host level keys. + + :param master_key: Secret key. + :type master_key: str + :param function_keys: Host level function keys. + :type function_keys: dict[str, str] + :param system_keys: System keys. + :type system_keys: dict[str, str] + """ + + _attribute_map = { + 'master_key': {'key': 'masterKey', 'type': 'str'}, + 'function_keys': {'key': 'functionKeys', 'type': '{str}'}, + 'system_keys': {'key': 'systemKeys', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(HostKeys, self).__init__(**kwargs) + self.master_key = kwargs.get('master_key', None) + self.function_keys = kwargs.get('function_keys', None) + self.system_keys = kwargs.get('system_keys', None) + + +class HostName(msrest.serialization.Model): + """Details of a hostname derived from a domain. + + :param name: Name of the hostname. + :type name: str + :param site_names: List of apps the hostname is assigned to. This list will have more than one + app only if the hostname is pointing to a Traffic Manager. + :type site_names: list[str] + :param azure_resource_name: Name of the Azure resource the hostname is assigned to. If it is + assigned to a Traffic Manager then it will be the Traffic Manager name otherwise it will be the + app name. + :type azure_resource_name: str + :param azure_resource_type: Type of the Azure resource the hostname is assigned to. Possible + values include: "Website", "TrafficManager". + :type azure_resource_type: str or ~azure.mgmt.web.v2021_02_01.models.AzureResourceType + :param custom_host_name_dns_record_type: Type of the DNS record. Possible values include: + "CName", "A". + :type custom_host_name_dns_record_type: str or + ~azure.mgmt.web.v2021_02_01.models.CustomHostNameDnsRecordType + :param host_name_type: Type of the hostname. Possible values include: "Verified", "Managed". + :type host_name_type: str or ~azure.mgmt.web.v2021_02_01.models.HostNameType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'site_names': {'key': 'siteNames', 'type': '[str]'}, + 'azure_resource_name': {'key': 'azureResourceName', 'type': 'str'}, + 'azure_resource_type': {'key': 'azureResourceType', 'type': 'str'}, + 'custom_host_name_dns_record_type': {'key': 'customHostNameDnsRecordType', 'type': 'str'}, + 'host_name_type': {'key': 'hostNameType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HostName, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.site_names = kwargs.get('site_names', None) + self.azure_resource_name = kwargs.get('azure_resource_name', None) + self.azure_resource_type = kwargs.get('azure_resource_type', None) + self.custom_host_name_dns_record_type = kwargs.get('custom_host_name_dns_record_type', None) + self.host_name_type = kwargs.get('host_name_type', None) + + +class HostNameBinding(ProxyOnlyResource): + """A hostname binding object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param site_name: App Service app name. + :type site_name: str + :param domain_id: Fully qualified ARM domain resource URI. + :type domain_id: str + :param azure_resource_name: Azure resource name. + :type azure_resource_name: str + :param azure_resource_type: Azure resource type. Possible values include: "Website", + "TrafficManager". + :type azure_resource_type: str or ~azure.mgmt.web.v2021_02_01.models.AzureResourceType + :param custom_host_name_dns_record_type: Custom DNS record type. Possible values include: + "CName", "A". + :type custom_host_name_dns_record_type: str or + ~azure.mgmt.web.v2021_02_01.models.CustomHostNameDnsRecordType + :param host_name_type: Hostname type. Possible values include: "Verified", "Managed". + :type host_name_type: str or ~azure.mgmt.web.v2021_02_01.models.HostNameType + :param ssl_state: SSL type. Possible values include: "Disabled", "SniEnabled", + "IpBasedEnabled". + :type ssl_state: str or ~azure.mgmt.web.v2021_02_01.models.SslState + :param thumbprint: SSL certificate thumbprint. + :type thumbprint: str + :ivar virtual_ip: Virtual IP address assigned to the hostname if IP based SSL is enabled. + :vartype virtual_ip: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'virtual_ip': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'site_name': {'key': 'properties.siteName', 'type': 'str'}, + 'domain_id': {'key': 'properties.domainId', 'type': 'str'}, + 'azure_resource_name': {'key': 'properties.azureResourceName', 'type': 'str'}, + 'azure_resource_type': {'key': 'properties.azureResourceType', 'type': 'str'}, + 'custom_host_name_dns_record_type': {'key': 'properties.customHostNameDnsRecordType', 'type': 'str'}, + 'host_name_type': {'key': 'properties.hostNameType', 'type': 'str'}, + 'ssl_state': {'key': 'properties.sslState', 'type': 'str'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + 'virtual_ip': {'key': 'properties.virtualIP', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HostNameBinding, self).__init__(**kwargs) + self.site_name = kwargs.get('site_name', None) + self.domain_id = kwargs.get('domain_id', None) + self.azure_resource_name = kwargs.get('azure_resource_name', None) + self.azure_resource_type = kwargs.get('azure_resource_type', None) + self.custom_host_name_dns_record_type = kwargs.get('custom_host_name_dns_record_type', None) + self.host_name_type = kwargs.get('host_name_type', None) + self.ssl_state = kwargs.get('ssl_state', None) + self.thumbprint = kwargs.get('thumbprint', None) + self.virtual_ip = None + + +class HostNameBindingCollection(msrest.serialization.Model): + """Collection of hostname bindings. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.HostNameBinding] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[HostNameBinding]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HostNameBindingCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class HostNameSslState(msrest.serialization.Model): + """SSL-enabled hostname. + + :param name: Hostname. + :type name: str + :param ssl_state: SSL type. Possible values include: "Disabled", "SniEnabled", + "IpBasedEnabled". + :type ssl_state: str or ~azure.mgmt.web.v2021_02_01.models.SslState + :param virtual_ip: Virtual IP address assigned to the hostname if IP based SSL is enabled. + :type virtual_ip: str + :param thumbprint: SSL certificate thumbprint. + :type thumbprint: str + :param to_update: Set to :code:`true` to update existing hostname. + :type to_update: bool + :param host_type: Indicates whether the hostname is a standard or repository hostname. Possible + values include: "Standard", "Repository". + :type host_type: str or ~azure.mgmt.web.v2021_02_01.models.HostType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'ssl_state': {'key': 'sslState', 'type': 'str'}, + 'virtual_ip': {'key': 'virtualIP', 'type': 'str'}, + 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + 'to_update': {'key': 'toUpdate', 'type': 'bool'}, + 'host_type': {'key': 'hostType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HostNameSslState, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.ssl_state = kwargs.get('ssl_state', None) + self.virtual_ip = kwargs.get('virtual_ip', None) + self.thumbprint = kwargs.get('thumbprint', None) + self.to_update = kwargs.get('to_update', None) + self.host_type = kwargs.get('host_type', None) + + +class HttpLogsConfig(msrest.serialization.Model): + """Http logs configuration. + + :param file_system: Http logs to file system configuration. + :type file_system: ~azure.mgmt.web.v2021_02_01.models.FileSystemHttpLogsConfig + :param azure_blob_storage: Http logs to azure blob storage configuration. + :type azure_blob_storage: ~azure.mgmt.web.v2021_02_01.models.AzureBlobStorageHttpLogsConfig + """ + + _attribute_map = { + 'file_system': {'key': 'fileSystem', 'type': 'FileSystemHttpLogsConfig'}, + 'azure_blob_storage': {'key': 'azureBlobStorage', 'type': 'AzureBlobStorageHttpLogsConfig'}, + } + + def __init__( + self, + **kwargs + ): + super(HttpLogsConfig, self).__init__(**kwargs) + self.file_system = kwargs.get('file_system', None) + self.azure_blob_storage = kwargs.get('azure_blob_storage', None) + + +class HttpSettings(msrest.serialization.Model): + """The configuration settings of the HTTP requests for authentication and authorization requests made against App Service Authentication/Authorization. + + :param require_https: :code:`false` if the authentication/authorization responses + not having the HTTPS scheme are permissible; otherwise, :code:`true`. + :type require_https: bool + :param routes: The configuration settings of the paths HTTP requests. + :type routes: ~azure.mgmt.web.v2021_02_01.models.HttpSettingsRoutes + :param forward_proxy: The configuration settings of a forward proxy used to make the requests. + :type forward_proxy: ~azure.mgmt.web.v2021_02_01.models.ForwardProxy + """ + + _attribute_map = { + 'require_https': {'key': 'requireHttps', 'type': 'bool'}, + 'routes': {'key': 'routes', 'type': 'HttpSettingsRoutes'}, + 'forward_proxy': {'key': 'forwardProxy', 'type': 'ForwardProxy'}, + } + + def __init__( + self, + **kwargs + ): + super(HttpSettings, self).__init__(**kwargs) + self.require_https = kwargs.get('require_https', None) + self.routes = kwargs.get('routes', None) + self.forward_proxy = kwargs.get('forward_proxy', None) + + +class HttpSettingsRoutes(msrest.serialization.Model): + """The configuration settings of the paths HTTP requests. + + :param api_prefix: The prefix that should precede all the authentication/authorization paths. + :type api_prefix: str + """ + + _attribute_map = { + 'api_prefix': {'key': 'apiPrefix', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HttpSettingsRoutes, self).__init__(**kwargs) + self.api_prefix = kwargs.get('api_prefix', None) + + +class HybridConnection(ProxyOnlyResource): + """Hybrid Connection contract. This is used to configure a Hybrid Connection. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param service_bus_namespace: The name of the Service Bus namespace. + :type service_bus_namespace: str + :param relay_name: The name of the Service Bus relay. + :type relay_name: str + :param relay_arm_uri: The ARM URI to the Service Bus relay. + :type relay_arm_uri: str + :param hostname: The hostname of the endpoint. + :type hostname: str + :param port: The port of the endpoint. + :type port: int + :param send_key_name: The name of the Service Bus key which has Send permissions. This is used + to authenticate to Service Bus. + :type send_key_name: str + :param send_key_value: The value of the Service Bus key. This is used to authenticate to + Service Bus. In ARM this key will not be returned + normally, use the POST /listKeys API instead. + :type send_key_value: str + :param service_bus_suffix: The suffix for the service bus endpoint. By default this is + .servicebus.windows.net. + :type service_bus_suffix: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'service_bus_namespace': {'key': 'properties.serviceBusNamespace', 'type': 'str'}, + 'relay_name': {'key': 'properties.relayName', 'type': 'str'}, + 'relay_arm_uri': {'key': 'properties.relayArmUri', 'type': 'str'}, + 'hostname': {'key': 'properties.hostname', 'type': 'str'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + 'send_key_name': {'key': 'properties.sendKeyName', 'type': 'str'}, + 'send_key_value': {'key': 'properties.sendKeyValue', 'type': 'str'}, + 'service_bus_suffix': {'key': 'properties.serviceBusSuffix', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HybridConnection, self).__init__(**kwargs) + self.service_bus_namespace = kwargs.get('service_bus_namespace', None) + self.relay_name = kwargs.get('relay_name', None) + self.relay_arm_uri = kwargs.get('relay_arm_uri', None) + self.hostname = kwargs.get('hostname', None) + self.port = kwargs.get('port', None) + self.send_key_name = kwargs.get('send_key_name', None) + self.send_key_value = kwargs.get('send_key_value', None) + self.service_bus_suffix = kwargs.get('service_bus_suffix', None) + + +class HybridConnectionCollection(msrest.serialization.Model): + """Collection of hostname bindings. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.HybridConnection] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[HybridConnection]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HybridConnectionCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class HybridConnectionKey(ProxyOnlyResource): + """Hybrid Connection key contract. This has the send key name and value for a Hybrid Connection. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar send_key_name: The name of the send key. + :vartype send_key_name: str + :ivar send_key_value: The value of the send key. + :vartype send_key_value: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'send_key_name': {'readonly': True}, + 'send_key_value': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'send_key_name': {'key': 'properties.sendKeyName', 'type': 'str'}, + 'send_key_value': {'key': 'properties.sendKeyValue', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HybridConnectionKey, self).__init__(**kwargs) + self.send_key_name = None + self.send_key_value = None + + +class HybridConnectionLimits(ProxyOnlyResource): + """Hybrid Connection limits contract. This is used to return the plan limits of Hybrid Connections. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar current: The current number of Hybrid Connections. + :vartype current: int + :ivar maximum: The maximum number of Hybrid Connections allowed. + :vartype maximum: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'current': {'readonly': True}, + 'maximum': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'current': {'key': 'properties.current', 'type': 'int'}, + 'maximum': {'key': 'properties.maximum', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(HybridConnectionLimits, self).__init__(**kwargs) + self.current = None + self.maximum = None + + +class Identifier(ProxyOnlyResource): + """A domain specific resource identifier. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param value: String representation of the identity. + :type value: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'value': {'key': 'properties.id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Identifier, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class IdentifierCollection(msrest.serialization.Model): + """Collection of identifiers. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.Identifier] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Identifier]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IdentifierCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class IdentityProviders(msrest.serialization.Model): + """The configuration settings of each of the identity providers used to configure App Service Authentication/Authorization. + + :param azure_active_directory: The configuration settings of the Azure Active directory + provider. + :type azure_active_directory: ~azure.mgmt.web.v2021_02_01.models.AzureActiveDirectory + :param facebook: The configuration settings of the Facebook provider. + :type facebook: ~azure.mgmt.web.v2021_02_01.models.Facebook + :param git_hub: The configuration settings of the GitHub provider. + :type git_hub: ~azure.mgmt.web.v2021_02_01.models.GitHub + :param google: The configuration settings of the Google provider. + :type google: ~azure.mgmt.web.v2021_02_01.models.Google + :param legacy_microsoft_account: The configuration settings of the legacy Microsoft Account + provider. + :type legacy_microsoft_account: ~azure.mgmt.web.v2021_02_01.models.LegacyMicrosoftAccount + :param twitter: The configuration settings of the Twitter provider. + :type twitter: ~azure.mgmt.web.v2021_02_01.models.Twitter + :param apple: The configuration settings of the Apple provider. + :type apple: ~azure.mgmt.web.v2021_02_01.models.Apple + :param azure_static_web_apps: The configuration settings of the Azure Static Web Apps provider. + :type azure_static_web_apps: ~azure.mgmt.web.v2021_02_01.models.AzureStaticWebApps + :param custom_open_id_connect_providers: The map of the name of the alias of each custom Open + ID Connect provider to the + configuration settings of the custom Open ID Connect provider. + :type custom_open_id_connect_providers: dict[str, + ~azure.mgmt.web.v2021_02_01.models.CustomOpenIdConnectProvider] + """ + + _attribute_map = { + 'azure_active_directory': {'key': 'azureActiveDirectory', 'type': 'AzureActiveDirectory'}, + 'facebook': {'key': 'facebook', 'type': 'Facebook'}, + 'git_hub': {'key': 'gitHub', 'type': 'GitHub'}, + 'google': {'key': 'google', 'type': 'Google'}, + 'legacy_microsoft_account': {'key': 'legacyMicrosoftAccount', 'type': 'LegacyMicrosoftAccount'}, + 'twitter': {'key': 'twitter', 'type': 'Twitter'}, + 'apple': {'key': 'apple', 'type': 'Apple'}, + 'azure_static_web_apps': {'key': 'azureStaticWebApps', 'type': 'AzureStaticWebApps'}, + 'custom_open_id_connect_providers': {'key': 'customOpenIdConnectProviders', 'type': '{CustomOpenIdConnectProvider}'}, + } + + def __init__( + self, + **kwargs + ): + super(IdentityProviders, self).__init__(**kwargs) + self.azure_active_directory = kwargs.get('azure_active_directory', None) + self.facebook = kwargs.get('facebook', None) + self.git_hub = kwargs.get('git_hub', None) + self.google = kwargs.get('google', None) + self.legacy_microsoft_account = kwargs.get('legacy_microsoft_account', None) + self.twitter = kwargs.get('twitter', None) + self.apple = kwargs.get('apple', None) + self.azure_static_web_apps = kwargs.get('azure_static_web_apps', None) + self.custom_open_id_connect_providers = kwargs.get('custom_open_id_connect_providers', None) + + +class InboundEnvironmentEndpoint(msrest.serialization.Model): + """The IP Addresses and Ports that require inbound network access to and within the subnet of the App Service Environment. + + :param description: Short text describing the purpose of the network traffic. + :type description: str + :param endpoints: The IP addresses that network traffic will originate from in cidr notation. + :type endpoints: list[str] + :param ports: The ports that network traffic will arrive to the App Service Environment at. + :type ports: list[str] + """ + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'endpoints': {'key': 'endpoints', 'type': '[str]'}, + 'ports': {'key': 'ports', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(InboundEnvironmentEndpoint, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.endpoints = kwargs.get('endpoints', None) + self.ports = kwargs.get('ports', None) + + +class InboundEnvironmentEndpointCollection(msrest.serialization.Model): + """Collection of Inbound Environment Endpoints. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.InboundEnvironmentEndpoint] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[InboundEnvironmentEndpoint]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(InboundEnvironmentEndpointCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class IpSecurityRestriction(msrest.serialization.Model): + """IP security restriction on an app. + + :param ip_address: IP address the security restriction is valid for. + It can be in form of pure ipv4 address (required SubnetMask property) or + CIDR notation such as ipv4/mask (leading bit match). For CIDR, + SubnetMask property must not be specified. + :type ip_address: str + :param subnet_mask: Subnet mask for the range of IP addresses the restriction is valid for. + :type subnet_mask: str + :param vnet_subnet_resource_id: Virtual network resource id. + :type vnet_subnet_resource_id: str + :param vnet_traffic_tag: (internal) Vnet traffic tag. + :type vnet_traffic_tag: int + :param subnet_traffic_tag: (internal) Subnet traffic tag. + :type subnet_traffic_tag: int + :param action: Allow or Deny access for this IP range. + :type action: str + :param tag: Defines what this IP filter will be used for. This is to support IP filtering on + proxies. Possible values include: "Default", "XffProxy", "ServiceTag". + :type tag: str or ~azure.mgmt.web.v2021_02_01.models.IpFilterTag + :param priority: Priority of IP restriction rule. + :type priority: int + :param name: IP restriction rule name. + :type name: str + :param description: IP restriction rule description. + :type description: str + :param headers: IP restriction rule headers. + X-Forwarded-Host + (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Host#Examples). + The matching logic is .. + + + * If the property is null or empty (default), all hosts(or lack of) are allowed. + * A value is compared using ordinal-ignore-case (excluding port number). + * Subdomain wildcards are permitted but don't match the root domain. For example, + *.contoso.com matches the subdomain foo.contoso.com + but not the root domain contoso.com or multi-level foo.bar.contoso.com + * Unicode host names are allowed but are converted to Punycode for matching. + + X-Forwarded-For + (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For#Examples). + The matching logic is .. + + + * If the property is null or empty (default), any forwarded-for chains (or lack of) are + allowed. + * If any address (excluding port number) in the chain (comma separated) matches the CIDR + defined by the property. + + X-Azure-FDID and X-FD-HealthProbe. + The matching logic is exact match. + :type headers: dict[str, list[str]] + """ + + _attribute_map = { + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'subnet_mask': {'key': 'subnetMask', 'type': 'str'}, + 'vnet_subnet_resource_id': {'key': 'vnetSubnetResourceId', 'type': 'str'}, + 'vnet_traffic_tag': {'key': 'vnetTrafficTag', 'type': 'int'}, + 'subnet_traffic_tag': {'key': 'subnetTrafficTag', 'type': 'int'}, + 'action': {'key': 'action', 'type': 'str'}, + 'tag': {'key': 'tag', 'type': 'str'}, + 'priority': {'key': 'priority', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'headers': {'key': 'headers', 'type': '{[str]}'}, + } + + def __init__( + self, + **kwargs + ): + super(IpSecurityRestriction, self).__init__(**kwargs) + self.ip_address = kwargs.get('ip_address', None) + self.subnet_mask = kwargs.get('subnet_mask', None) + self.vnet_subnet_resource_id = kwargs.get('vnet_subnet_resource_id', None) + self.vnet_traffic_tag = kwargs.get('vnet_traffic_tag', None) + self.subnet_traffic_tag = kwargs.get('subnet_traffic_tag', None) + self.action = kwargs.get('action', None) + self.tag = kwargs.get('tag', None) + self.priority = kwargs.get('priority', None) + self.name = kwargs.get('name', None) + self.description = kwargs.get('description', None) + self.headers = kwargs.get('headers', None) + + +class JwtClaimChecks(msrest.serialization.Model): + """The configuration settings of the checks that should be made while validating the JWT Claims. + + :param allowed_groups: The list of the allowed groups. + :type allowed_groups: list[str] + :param allowed_client_applications: The list of the allowed client applications. + :type allowed_client_applications: list[str] + """ + + _attribute_map = { + 'allowed_groups': {'key': 'allowedGroups', 'type': '[str]'}, + 'allowed_client_applications': {'key': 'allowedClientApplications', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(JwtClaimChecks, self).__init__(**kwargs) + self.allowed_groups = kwargs.get('allowed_groups', None) + self.allowed_client_applications = kwargs.get('allowed_client_applications', None) + + +class KeyInfo(msrest.serialization.Model): + """Function key info. + + :param name: Key name. + :type name: str + :param value: Key value. + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(KeyInfo, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) + + +class KeyValuePairStringObject(msrest.serialization.Model): + """KeyValuePairStringObject. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar key: + :vartype key: str + :ivar value: Any object. + :vartype value: any + """ + + _validation = { + 'key': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'key': {'key': 'key', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(KeyValuePairStringObject, self).__init__(**kwargs) + self.key = None + self.value = None + + +class KubeEnvironment(Resource): + """A Kubernetes cluster specialized for web workloads by Azure App Service. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param extended_location: Extended Location. + :type extended_location: ~azure.mgmt.web.v2021_02_01.models.ExtendedLocation + :ivar provisioning_state: Provisioning state of the Kubernetes Environment. Possible values + include: "Succeeded", "Failed", "Canceled", "Waiting", "InitializationInProgress", + "InfrastructureSetupInProgress", "InfrastructureSetupComplete", "ScheduledForDelete", + "UpgradeRequested", "UpgradeFailed". + :vartype provisioning_state: str or + ~azure.mgmt.web.v2021_02_01.models.KubeEnvironmentProvisioningState + :ivar deployment_errors: Any errors that occurred during deployment or deployment validation. + :vartype deployment_errors: str + :param internal_load_balancer_enabled: Only visible within Vnet/Subnet. + :type internal_load_balancer_enabled: bool + :ivar default_domain: Default Domain Name for the cluster. + :vartype default_domain: str + :param static_ip: Static IP of the KubeEnvironment. + :type static_ip: str + :param arc_configuration: Cluster configuration which determines the ARC cluster + components types. Eg: Choosing between BuildService kind, + FrontEnd Service ArtifactsStorageType etc. + :type arc_configuration: ~azure.mgmt.web.v2021_02_01.models.ArcConfiguration + :param app_logs_configuration: Cluster configuration which enables the log daemon to export + app logs to a destination. Currently only "log-analytics" is + supported. + :type app_logs_configuration: ~azure.mgmt.web.v2021_02_01.models.AppLogsConfiguration + :param aks_resource_id: + :type aks_resource_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'deployment_errors': {'readonly': True}, + 'default_domain': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'deployment_errors': {'key': 'properties.deploymentErrors', 'type': 'str'}, + 'internal_load_balancer_enabled': {'key': 'properties.internalLoadBalancerEnabled', 'type': 'bool'}, + 'default_domain': {'key': 'properties.defaultDomain', 'type': 'str'}, + 'static_ip': {'key': 'properties.staticIp', 'type': 'str'}, + 'arc_configuration': {'key': 'properties.arcConfiguration', 'type': 'ArcConfiguration'}, + 'app_logs_configuration': {'key': 'properties.appLogsConfiguration', 'type': 'AppLogsConfiguration'}, + 'aks_resource_id': {'key': 'properties.aksResourceID', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(KubeEnvironment, self).__init__(**kwargs) + self.extended_location = kwargs.get('extended_location', None) + self.provisioning_state = None + self.deployment_errors = None + self.internal_load_balancer_enabled = kwargs.get('internal_load_balancer_enabled', None) + self.default_domain = None + self.static_ip = kwargs.get('static_ip', None) + self.arc_configuration = kwargs.get('arc_configuration', None) + self.app_logs_configuration = kwargs.get('app_logs_configuration', None) + self.aks_resource_id = kwargs.get('aks_resource_id', None) + + +class KubeEnvironmentCollection(msrest.serialization.Model): + """Collection of Kubernetes Environments. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.KubeEnvironment] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[KubeEnvironment]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(KubeEnvironmentCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class KubeEnvironmentPatchResource(ProxyOnlyResource): + """ARM resource for a KubeEnvironment when patching. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar provisioning_state: Provisioning state of the Kubernetes Environment. Possible values + include: "Succeeded", "Failed", "Canceled", "Waiting", "InitializationInProgress", + "InfrastructureSetupInProgress", "InfrastructureSetupComplete", "ScheduledForDelete", + "UpgradeRequested", "UpgradeFailed". + :vartype provisioning_state: str or + ~azure.mgmt.web.v2021_02_01.models.KubeEnvironmentProvisioningState + :ivar deployment_errors: Any errors that occurred during deployment or deployment validation. + :vartype deployment_errors: str + :param internal_load_balancer_enabled: Only visible within Vnet/Subnet. + :type internal_load_balancer_enabled: bool + :ivar default_domain: Default Domain Name for the cluster. + :vartype default_domain: str + :param static_ip: Static IP of the KubeEnvironment. + :type static_ip: str + :param arc_configuration: Cluster configuration which determines the ARC cluster + components types. Eg: Choosing between BuildService kind, + FrontEnd Service ArtifactsStorageType etc. + :type arc_configuration: ~azure.mgmt.web.v2021_02_01.models.ArcConfiguration + :param app_logs_configuration: Cluster configuration which enables the log daemon to export + app logs to a destination. Currently only "log-analytics" is + supported. + :type app_logs_configuration: ~azure.mgmt.web.v2021_02_01.models.AppLogsConfiguration + :param aks_resource_id: + :type aks_resource_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'deployment_errors': {'readonly': True}, + 'default_domain': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'deployment_errors': {'key': 'properties.deploymentErrors', 'type': 'str'}, + 'internal_load_balancer_enabled': {'key': 'properties.internalLoadBalancerEnabled', 'type': 'bool'}, + 'default_domain': {'key': 'properties.defaultDomain', 'type': 'str'}, + 'static_ip': {'key': 'properties.staticIp', 'type': 'str'}, + 'arc_configuration': {'key': 'properties.arcConfiguration', 'type': 'ArcConfiguration'}, + 'app_logs_configuration': {'key': 'properties.appLogsConfiguration', 'type': 'AppLogsConfiguration'}, + 'aks_resource_id': {'key': 'properties.aksResourceID', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(KubeEnvironmentPatchResource, self).__init__(**kwargs) + self.provisioning_state = None + self.deployment_errors = None + self.internal_load_balancer_enabled = kwargs.get('internal_load_balancer_enabled', None) + self.default_domain = None + self.static_ip = kwargs.get('static_ip', None) + self.arc_configuration = kwargs.get('arc_configuration', None) + self.app_logs_configuration = kwargs.get('app_logs_configuration', None) + self.aks_resource_id = kwargs.get('aks_resource_id', None) + + +class KubeEnvironmentProfile(msrest.serialization.Model): + """Specification for a Kubernetes Environment to use for this resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID of the Kubernetes Environment. + :type id: str + :ivar name: Name of the Kubernetes Environment. + :vartype name: str + :ivar type: Resource type of the Kubernetes Environment. + :vartype type: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(KubeEnvironmentProfile, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = None + self.type = None + + +class LegacyMicrosoftAccount(msrest.serialization.Model): + """The configuration settings of the legacy Microsoft Account provider. + + :param enabled: :code:`false` if the legacy Microsoft Account provider should not + be enabled despite the set registration; otherwise, :code:`true`. + :type enabled: bool + :param registration: The configuration settings of the app registration for the legacy + Microsoft Account provider. + :type registration: ~azure.mgmt.web.v2021_02_01.models.ClientRegistration + :param login: The configuration settings of the login flow. + :type login: ~azure.mgmt.web.v2021_02_01.models.LoginScopes + :param validation: The configuration settings of the legacy Microsoft Account provider token + validation flow. + :type validation: ~azure.mgmt.web.v2021_02_01.models.AllowedAudiencesValidation + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'ClientRegistration'}, + 'login': {'key': 'login', 'type': 'LoginScopes'}, + 'validation': {'key': 'validation', 'type': 'AllowedAudiencesValidation'}, + } + + def __init__( + self, + **kwargs + ): + super(LegacyMicrosoftAccount, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.registration = kwargs.get('registration', None) + self.login = kwargs.get('login', None) + self.validation = kwargs.get('validation', None) + + +class LinuxJavaContainerSettings(msrest.serialization.Model): + """Linux Java Container settings. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar java11_runtime: Java 11 version (runtime only). + :vartype java11_runtime: str + :ivar java8_runtime: Java 8 version (runtime only). + :vartype java8_runtime: str + :ivar is_preview: :code:`true` if the stack is in preview; otherwise, + :code:`false`. + :vartype is_preview: bool + :ivar is_deprecated: :code:`true` if the stack is deprecated; otherwise, + :code:`false`. + :vartype is_deprecated: bool + :ivar is_hidden: :code:`true` if the stack should be hidden; otherwise, + :code:`false`. + :vartype is_hidden: bool + :ivar end_of_life_date: End-of-life date for the minor version. + :vartype end_of_life_date: ~datetime.datetime + :ivar is_auto_update: :code:`true` if the stack version is auto-updated; + otherwise, :code:`false`. + :vartype is_auto_update: bool + :ivar is_early_access: :code:`true` if the minor version is early-access; + otherwise, :code:`false`. + :vartype is_early_access: bool + """ + + _validation = { + 'java11_runtime': {'readonly': True}, + 'java8_runtime': {'readonly': True}, + 'is_preview': {'readonly': True}, + 'is_deprecated': {'readonly': True}, + 'is_hidden': {'readonly': True}, + 'end_of_life_date': {'readonly': True}, + 'is_auto_update': {'readonly': True}, + 'is_early_access': {'readonly': True}, + } + + _attribute_map = { + 'java11_runtime': {'key': 'java11Runtime', 'type': 'str'}, + 'java8_runtime': {'key': 'java8Runtime', 'type': 'str'}, + 'is_preview': {'key': 'isPreview', 'type': 'bool'}, + 'is_deprecated': {'key': 'isDeprecated', 'type': 'bool'}, + 'is_hidden': {'key': 'isHidden', 'type': 'bool'}, + 'end_of_life_date': {'key': 'endOfLifeDate', 'type': 'iso-8601'}, + 'is_auto_update': {'key': 'isAutoUpdate', 'type': 'bool'}, + 'is_early_access': {'key': 'isEarlyAccess', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(LinuxJavaContainerSettings, self).__init__(**kwargs) + self.java11_runtime = None + self.java8_runtime = None + self.is_preview = None + self.is_deprecated = None + self.is_hidden = None + self.end_of_life_date = None + self.is_auto_update = None + self.is_early_access = None + + +class LocalizableString(msrest.serialization.Model): + """Localizable string object containing the name and a localized value. + + :param value: Non-localized name. + :type value: str + :param localized_value: Localized name. + :type localized_value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LocalizableString, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.localized_value = kwargs.get('localized_value', None) + + +class LogAnalyticsConfiguration(msrest.serialization.Model): + """LogAnalyticsConfiguration. + + :param customer_id: + :type customer_id: str + :param shared_key: + :type shared_key: str + """ + + _attribute_map = { + 'customer_id': {'key': 'customerId', 'type': 'str'}, + 'shared_key': {'key': 'sharedKey', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LogAnalyticsConfiguration, self).__init__(**kwargs) + self.customer_id = kwargs.get('customer_id', None) + self.shared_key = kwargs.get('shared_key', None) + + +class Login(msrest.serialization.Model): + """The configuration settings of the login flow of users using App Service Authentication/Authorization. + + :param routes: The routes that specify the endpoints used for login and logout requests. + :type routes: ~azure.mgmt.web.v2021_02_01.models.LoginRoutes + :param token_store: The configuration settings of the token store. + :type token_store: ~azure.mgmt.web.v2021_02_01.models.TokenStore + :param preserve_url_fragments_for_logins: :code:`true` if the fragments from the + request are preserved after the login request is made; otherwise, :code:`false`. + :type preserve_url_fragments_for_logins: bool + :param allowed_external_redirect_urls: External URLs that can be redirected to as part of + logging in or logging out of the app. Note that the query string part of the URL is ignored. + This is an advanced setting typically only needed by Windows Store application backends. + Note that URLs within the current domain are always implicitly allowed. + :type allowed_external_redirect_urls: list[str] + :param cookie_expiration: The configuration settings of the session cookie's expiration. + :type cookie_expiration: ~azure.mgmt.web.v2021_02_01.models.CookieExpiration + :param nonce: The configuration settings of the nonce used in the login flow. + :type nonce: ~azure.mgmt.web.v2021_02_01.models.Nonce + """ + + _attribute_map = { + 'routes': {'key': 'routes', 'type': 'LoginRoutes'}, + 'token_store': {'key': 'tokenStore', 'type': 'TokenStore'}, + 'preserve_url_fragments_for_logins': {'key': 'preserveUrlFragmentsForLogins', 'type': 'bool'}, + 'allowed_external_redirect_urls': {'key': 'allowedExternalRedirectUrls', 'type': '[str]'}, + 'cookie_expiration': {'key': 'cookieExpiration', 'type': 'CookieExpiration'}, + 'nonce': {'key': 'nonce', 'type': 'Nonce'}, + } + + def __init__( + self, + **kwargs + ): + super(Login, self).__init__(**kwargs) + self.routes = kwargs.get('routes', None) + self.token_store = kwargs.get('token_store', None) + self.preserve_url_fragments_for_logins = kwargs.get('preserve_url_fragments_for_logins', None) + self.allowed_external_redirect_urls = kwargs.get('allowed_external_redirect_urls', None) + self.cookie_expiration = kwargs.get('cookie_expiration', None) + self.nonce = kwargs.get('nonce', None) + + +class LoginRoutes(msrest.serialization.Model): + """The routes that specify the endpoints used for login and logout requests. + + :param logout_endpoint: The endpoint at which a logout request should be made. + :type logout_endpoint: str + """ + + _attribute_map = { + 'logout_endpoint': {'key': 'logoutEndpoint', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LoginRoutes, self).__init__(**kwargs) + self.logout_endpoint = kwargs.get('logout_endpoint', None) + + +class LoginScopes(msrest.serialization.Model): + """The configuration settings of the login flow, including the scopes that should be requested. + + :param scopes: A list of the scopes that should be requested while authenticating. + :type scopes: list[str] + """ + + _attribute_map = { + 'scopes': {'key': 'scopes', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(LoginScopes, self).__init__(**kwargs) + self.scopes = kwargs.get('scopes', None) + + +class LogSpecification(msrest.serialization.Model): + """Log Definition of a single resource metric. + + :param name: + :type name: str + :param display_name: + :type display_name: str + :param blob_duration: + :type blob_duration: str + :param log_filter_pattern: + :type log_filter_pattern: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, + 'log_filter_pattern': {'key': 'logFilterPattern', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LogSpecification, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.blob_duration = kwargs.get('blob_duration', None) + self.log_filter_pattern = kwargs.get('log_filter_pattern', None) + + +class ManagedServiceIdentity(msrest.serialization.Model): + """Managed service identity. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param type: Type of managed service identity. Possible values include: "SystemAssigned", + "UserAssigned", "SystemAssigned, UserAssigned", "None". + :type type: str or ~azure.mgmt.web.v2021_02_01.models.ManagedServiceIdentityType + :ivar tenant_id: Tenant of managed service identity. + :vartype tenant_id: str + :ivar principal_id: Principal Id of managed service identity. + :vartype principal_id: str + :param user_assigned_identities: The list of user assigned identities associated with the + resource. The user identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + :type user_assigned_identities: dict[str, + ~azure.mgmt.web.v2021_02_01.models.UserAssignedIdentity] + """ + + _validation = { + 'tenant_id': {'readonly': True}, + 'principal_id': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedServiceIdentity, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.tenant_id = None + self.principal_id = None + self.user_assigned_identities = kwargs.get('user_assigned_identities', None) + + +class MetricAvailability(msrest.serialization.Model): + """Retention policy of a resource metric. + + :param time_grain: + :type time_grain: str + :param blob_duration: + :type blob_duration: str + """ + + _attribute_map = { + 'time_grain': {'key': 'timeGrain', 'type': 'str'}, + 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MetricAvailability, self).__init__(**kwargs) + self.time_grain = kwargs.get('time_grain', None) + self.blob_duration = kwargs.get('blob_duration', None) + + +class MetricSpecification(msrest.serialization.Model): + """Definition of a single resource metric. + + :param name: + :type name: str + :param display_name: + :type display_name: str + :param display_description: + :type display_description: str + :param unit: + :type unit: str + :param aggregation_type: + :type aggregation_type: str + :param supports_instance_level_aggregation: + :type supports_instance_level_aggregation: bool + :param enable_regional_mdm_account: + :type enable_regional_mdm_account: bool + :param source_mdm_account: + :type source_mdm_account: str + :param source_mdm_namespace: + :type source_mdm_namespace: str + :param metric_filter_pattern: + :type metric_filter_pattern: str + :param fill_gap_with_zero: + :type fill_gap_with_zero: bool + :param is_internal: + :type is_internal: bool + :param dimensions: + :type dimensions: list[~azure.mgmt.web.v2021_02_01.models.Dimension] + :param category: + :type category: str + :param availabilities: + :type availabilities: list[~azure.mgmt.web.v2021_02_01.models.MetricAvailability] + :param supported_time_grain_types: + :type supported_time_grain_types: list[str] + :param supported_aggregation_types: + :type supported_aggregation_types: list[str] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'supports_instance_level_aggregation': {'key': 'supportsInstanceLevelAggregation', 'type': 'bool'}, + 'enable_regional_mdm_account': {'key': 'enableRegionalMdmAccount', 'type': 'bool'}, + 'source_mdm_account': {'key': 'sourceMdmAccount', 'type': 'str'}, + 'source_mdm_namespace': {'key': 'sourceMdmNamespace', 'type': 'str'}, + 'metric_filter_pattern': {'key': 'metricFilterPattern', 'type': 'str'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'is_internal': {'key': 'isInternal', 'type': 'bool'}, + 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, + 'category': {'key': 'category', 'type': 'str'}, + 'availabilities': {'key': 'availabilities', 'type': '[MetricAvailability]'}, + 'supported_time_grain_types': {'key': 'supportedTimeGrainTypes', 'type': '[str]'}, + 'supported_aggregation_types': {'key': 'supportedAggregationTypes', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(MetricSpecification, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.display_description = kwargs.get('display_description', None) + self.unit = kwargs.get('unit', None) + self.aggregation_type = kwargs.get('aggregation_type', None) + self.supports_instance_level_aggregation = kwargs.get('supports_instance_level_aggregation', None) + self.enable_regional_mdm_account = kwargs.get('enable_regional_mdm_account', None) + self.source_mdm_account = kwargs.get('source_mdm_account', None) + self.source_mdm_namespace = kwargs.get('source_mdm_namespace', None) + self.metric_filter_pattern = kwargs.get('metric_filter_pattern', None) + self.fill_gap_with_zero = kwargs.get('fill_gap_with_zero', None) + self.is_internal = kwargs.get('is_internal', None) + self.dimensions = kwargs.get('dimensions', None) + self.category = kwargs.get('category', None) + self.availabilities = kwargs.get('availabilities', None) + self.supported_time_grain_types = kwargs.get('supported_time_grain_types', None) + self.supported_aggregation_types = kwargs.get('supported_aggregation_types', None) + + +class MigrateMySqlRequest(ProxyOnlyResource): + """MySQL migration request. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param connection_string: Connection string to the remote MySQL database. + :type connection_string: str + :param migration_type: The type of migration operation to be done. Possible values include: + "LocalToRemote", "RemoteToLocal". + :type migration_type: str or ~azure.mgmt.web.v2021_02_01.models.MySqlMigrationType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'connection_string': {'key': 'properties.connectionString', 'type': 'str'}, + 'migration_type': {'key': 'properties.migrationType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MigrateMySqlRequest, self).__init__(**kwargs) + self.connection_string = kwargs.get('connection_string', None) + self.migration_type = kwargs.get('migration_type', None) + + +class MigrateMySqlStatus(ProxyOnlyResource): + """MySQL migration status. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar migration_operation_status: Status of the migration task. Possible values include: + "InProgress", "Failed", "Succeeded", "TimedOut", "Created". + :vartype migration_operation_status: str or ~azure.mgmt.web.v2021_02_01.models.OperationStatus + :ivar operation_id: Operation ID for the migration task. + :vartype operation_id: str + :ivar local_my_sql_enabled: True if the web app has in app MySql enabled. + :vartype local_my_sql_enabled: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'migration_operation_status': {'readonly': True}, + 'operation_id': {'readonly': True}, + 'local_my_sql_enabled': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'migration_operation_status': {'key': 'properties.migrationOperationStatus', 'type': 'str'}, + 'operation_id': {'key': 'properties.operationId', 'type': 'str'}, + 'local_my_sql_enabled': {'key': 'properties.localMySqlEnabled', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(MigrateMySqlStatus, self).__init__(**kwargs) + self.migration_operation_status = None + self.operation_id = None + self.local_my_sql_enabled = None + + +class MSDeploy(ProxyOnlyResource): + """MSDeploy ARM PUT information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param package_uri: Package URI. + :type package_uri: str + :param connection_string: SQL Connection String. + :type connection_string: str + :param db_type: Database Type. + :type db_type: str + :param set_parameters_xml_file_uri: URI of MSDeploy Parameters file. Must not be set if + SetParameters is used. + :type set_parameters_xml_file_uri: str + :param set_parameters: MSDeploy Parameters. Must not be set if SetParametersXmlFileUri is used. + :type set_parameters: dict[str, str] + :param skip_app_data: Controls whether the MSDeploy operation skips the App_Data directory. + If set to :code:`true`, the existing App_Data directory on the destination + will not be deleted, and any App_Data directory in the source will be ignored. + Setting is :code:`false` by default. + :type skip_app_data: bool + :param app_offline: Sets the AppOffline rule while the MSDeploy operation executes. + Setting is :code:`false` by default. + :type app_offline: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'package_uri': {'key': 'properties.packageUri', 'type': 'str'}, + 'connection_string': {'key': 'properties.connectionString', 'type': 'str'}, + 'db_type': {'key': 'properties.dbType', 'type': 'str'}, + 'set_parameters_xml_file_uri': {'key': 'properties.setParametersXmlFileUri', 'type': 'str'}, + 'set_parameters': {'key': 'properties.setParameters', 'type': '{str}'}, + 'skip_app_data': {'key': 'properties.skipAppData', 'type': 'bool'}, + 'app_offline': {'key': 'properties.appOffline', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(MSDeploy, self).__init__(**kwargs) + self.package_uri = kwargs.get('package_uri', None) + self.connection_string = kwargs.get('connection_string', None) + self.db_type = kwargs.get('db_type', None) + self.set_parameters_xml_file_uri = kwargs.get('set_parameters_xml_file_uri', None) + self.set_parameters = kwargs.get('set_parameters', None) + self.skip_app_data = kwargs.get('skip_app_data', None) + self.app_offline = kwargs.get('app_offline', None) + + +class MSDeployLog(ProxyOnlyResource): + """MSDeploy log. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar entries: List of log entry messages. + :vartype entries: list[~azure.mgmt.web.v2021_02_01.models.MSDeployLogEntry] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'entries': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'entries': {'key': 'properties.entries', 'type': '[MSDeployLogEntry]'}, + } + + def __init__( + self, + **kwargs + ): + super(MSDeployLog, self).__init__(**kwargs) + self.entries = None + + +class MSDeployLogEntry(msrest.serialization.Model): + """MSDeploy log entry. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar time: Timestamp of log entry. + :vartype time: ~datetime.datetime + :ivar type: Log entry type. Possible values include: "Message", "Warning", "Error". + :vartype type: str or ~azure.mgmt.web.v2021_02_01.models.MSDeployLogEntryType + :ivar message: Log entry message. + :vartype message: str + """ + + _validation = { + 'time': {'readonly': True}, + 'type': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'time': {'key': 'time', 'type': 'iso-8601'}, + 'type': {'key': 'type', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MSDeployLogEntry, self).__init__(**kwargs) + self.time = None + self.type = None + self.message = None + + +class MSDeployStatus(ProxyOnlyResource): + """MSDeploy ARM response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar deployer: Username of deployer. + :vartype deployer: str + :ivar provisioning_state: Provisioning state. Possible values include: "accepted", "running", + "succeeded", "failed", "canceled". + :vartype provisioning_state: str or + ~azure.mgmt.web.v2021_02_01.models.MSDeployProvisioningState + :ivar start_time: Start time of deploy operation. + :vartype start_time: ~datetime.datetime + :ivar end_time: End time of deploy operation. + :vartype end_time: ~datetime.datetime + :ivar complete: Whether the deployment operation has completed. + :vartype complete: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'deployer': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'complete': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'deployer': {'key': 'properties.deployer', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'complete': {'key': 'properties.complete', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(MSDeployStatus, self).__init__(**kwargs) + self.deployer = None + self.provisioning_state = None + self.start_time = None + self.end_time = None + self.complete = None + + +class NameIdentifier(msrest.serialization.Model): + """Identifies an object. + + :param name: Name of the object. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NameIdentifier, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + + +class NameIdentifierCollection(msrest.serialization.Model): + """Collection of domain name identifiers. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.NameIdentifier] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[NameIdentifier]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NameIdentifierCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class NameValuePair(msrest.serialization.Model): + """Name value pair. + + :param name: Pair name. + :type name: str + :param value: Pair value. + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NameValuePair, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) + + +class NetworkFeatures(ProxyOnlyResource): + """Full view of network features for an app (presently VNET integration and Hybrid Connections). + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar virtual_network_name: The Virtual Network name. + :vartype virtual_network_name: str + :ivar virtual_network_connection: The Virtual Network summary view. + :vartype virtual_network_connection: ~azure.mgmt.web.v2021_02_01.models.VnetInfo + :ivar hybrid_connections: The Hybrid Connections summary view. + :vartype hybrid_connections: + list[~azure.mgmt.web.v2021_02_01.models.RelayServiceConnectionEntity] + :ivar hybrid_connections_v2: The Hybrid Connection V2 (Service Bus) view. + :vartype hybrid_connections_v2: list[~azure.mgmt.web.v2021_02_01.models.HybridConnection] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'virtual_network_name': {'readonly': True}, + 'virtual_network_connection': {'readonly': True}, + 'hybrid_connections': {'readonly': True}, + 'hybrid_connections_v2': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'virtual_network_name': {'key': 'properties.virtualNetworkName', 'type': 'str'}, + 'virtual_network_connection': {'key': 'properties.virtualNetworkConnection', 'type': 'VnetInfo'}, + 'hybrid_connections': {'key': 'properties.hybridConnections', 'type': '[RelayServiceConnectionEntity]'}, + 'hybrid_connections_v2': {'key': 'properties.hybridConnectionsV2', 'type': '[HybridConnection]'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkFeatures, self).__init__(**kwargs) + self.virtual_network_name = None + self.virtual_network_connection = None + self.hybrid_connections = None + self.hybrid_connections_v2 = None + + +class NetworkTrace(msrest.serialization.Model): + """Network trace. + + :param path: Local file path for the captured network trace file. + :type path: str + :param status: Current status of the network trace operation, same as Operation.Status + (InProgress/Succeeded/Failed). + :type status: str + :param message: Detailed message of a network trace operation, e.g. error message in case of + failure. + :type message: str + """ + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkTrace, self).__init__(**kwargs) + self.path = kwargs.get('path', None) + self.status = kwargs.get('status', None) + self.message = kwargs.get('message', None) + + +class Nonce(msrest.serialization.Model): + """The configuration settings of the nonce used in the login flow. + + :param validate_nonce: :code:`false` if the nonce should not be validated while + completing the login flow; otherwise, :code:`true`. + :type validate_nonce: bool + :param nonce_expiration_interval: The time after the request is made when the nonce should + expire. + :type nonce_expiration_interval: str + """ + + _attribute_map = { + 'validate_nonce': {'key': 'validateNonce', 'type': 'bool'}, + 'nonce_expiration_interval': {'key': 'nonceExpirationInterval', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Nonce, self).__init__(**kwargs) + self.validate_nonce = kwargs.get('validate_nonce', None) + self.nonce_expiration_interval = kwargs.get('nonce_expiration_interval', None) + + +class OpenIdConnectClientCredential(msrest.serialization.Model): + """The authentication client credentials of the custom Open ID Connect provider. + + :param method: The method that should be used to authenticate the user. The only acceptable + values to pass in are None and "ClientSecretPost". The default value is None. + :type method: str + :param client_secret_setting_name: The app setting that contains the client secret for the + custom Open ID Connect provider. + :type client_secret_setting_name: str + """ + + _attribute_map = { + 'method': {'key': 'method', 'type': 'str'}, + 'client_secret_setting_name': {'key': 'clientSecretSettingName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OpenIdConnectClientCredential, self).__init__(**kwargs) + self.method = kwargs.get('method', None) + self.client_secret_setting_name = kwargs.get('client_secret_setting_name', None) + + +class OpenIdConnectConfig(msrest.serialization.Model): + """The configuration settings of the endpoints used for the custom Open ID Connect provider. + + :param authorization_endpoint: The endpoint to be used to make an authorization request. + :type authorization_endpoint: str + :param token_endpoint: The endpoint to be used to request a token. + :type token_endpoint: str + :param issuer: The endpoint that issues the token. + :type issuer: str + :param certification_uri: The endpoint that provides the keys necessary to validate the token. + :type certification_uri: str + :param well_known_open_id_configuration: The endpoint that contains all the configuration + endpoints for the provider. + :type well_known_open_id_configuration: str + """ + + _attribute_map = { + 'authorization_endpoint': {'key': 'authorizationEndpoint', 'type': 'str'}, + 'token_endpoint': {'key': 'tokenEndpoint', 'type': 'str'}, + 'issuer': {'key': 'issuer', 'type': 'str'}, + 'certification_uri': {'key': 'certificationUri', 'type': 'str'}, + 'well_known_open_id_configuration': {'key': 'wellKnownOpenIdConfiguration', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OpenIdConnectConfig, self).__init__(**kwargs) + self.authorization_endpoint = kwargs.get('authorization_endpoint', None) + self.token_endpoint = kwargs.get('token_endpoint', None) + self.issuer = kwargs.get('issuer', None) + self.certification_uri = kwargs.get('certification_uri', None) + self.well_known_open_id_configuration = kwargs.get('well_known_open_id_configuration', None) + + +class OpenIdConnectLogin(msrest.serialization.Model): + """The configuration settings of the login flow of the custom Open ID Connect provider. + + :param name_claim_type: The name of the claim that contains the users name. + :type name_claim_type: str + :param scopes: A list of the scopes that should be requested while authenticating. + :type scopes: list[str] + """ + + _attribute_map = { + 'name_claim_type': {'key': 'nameClaimType', 'type': 'str'}, + 'scopes': {'key': 'scopes', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(OpenIdConnectLogin, self).__init__(**kwargs) + self.name_claim_type = kwargs.get('name_claim_type', None) + self.scopes = kwargs.get('scopes', None) + + +class OpenIdConnectRegistration(msrest.serialization.Model): + """The configuration settings of the app registration for the custom Open ID Connect provider. + + :param client_id: The client id of the custom Open ID Connect provider. + :type client_id: str + :param client_credential: The authentication credentials of the custom Open ID Connect + provider. + :type client_credential: ~azure.mgmt.web.v2021_02_01.models.OpenIdConnectClientCredential + :param open_id_connect_configuration: The configuration settings of the endpoints used for the + custom Open ID Connect provider. + :type open_id_connect_configuration: ~azure.mgmt.web.v2021_02_01.models.OpenIdConnectConfig + """ + + _attribute_map = { + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'client_credential': {'key': 'clientCredential', 'type': 'OpenIdConnectClientCredential'}, + 'open_id_connect_configuration': {'key': 'openIdConnectConfiguration', 'type': 'OpenIdConnectConfig'}, + } + + def __init__( + self, + **kwargs + ): + super(OpenIdConnectRegistration, self).__init__(**kwargs) + self.client_id = kwargs.get('client_id', None) + self.client_credential = kwargs.get('client_credential', None) + self.open_id_connect_configuration = kwargs.get('open_id_connect_configuration', None) + + +class Operation(msrest.serialization.Model): + """An operation on a resource. + + :param id: Operation ID. + :type id: str + :param name: Operation name. + :type name: str + :param status: The current status of the operation. Possible values include: "InProgress", + "Failed", "Succeeded", "TimedOut", "Created". + :type status: str or ~azure.mgmt.web.v2021_02_01.models.OperationStatus + :param errors: Any errors associate with the operation. + :type errors: list[~azure.mgmt.web.v2021_02_01.models.ErrorEntity] + :param created_time: Time when operation has started. + :type created_time: ~datetime.datetime + :param modified_time: Time when operation has been updated. + :type modified_time: ~datetime.datetime + :param expiration_time: Time when operation will expire. + :type expiration_time: ~datetime.datetime + :param geo_master_operation_id: Applicable only for stamp operation ids. + :type geo_master_operation_id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'errors': {'key': 'errors', 'type': '[ErrorEntity]'}, + 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, + 'modified_time': {'key': 'modifiedTime', 'type': 'iso-8601'}, + 'expiration_time': {'key': 'expirationTime', 'type': 'iso-8601'}, + 'geo_master_operation_id': {'key': 'geoMasterOperationId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + self.status = kwargs.get('status', None) + self.errors = kwargs.get('errors', None) + self.created_time = kwargs.get('created_time', None) + self.modified_time = kwargs.get('modified_time', None) + self.expiration_time = kwargs.get('expiration_time', None) + self.geo_master_operation_id = kwargs.get('geo_master_operation_id', None) + + +class OutboundEnvironmentEndpoint(msrest.serialization.Model): + """Endpoints accessed for a common purpose that the App Service Environment requires outbound network access to. + + :param category: The type of service accessed by the App Service Environment, e.g., Azure + Storage, Azure SQL Database, and Azure Active Directory. + :type category: str + :param endpoints: The endpoints that the App Service Environment reaches the service at. + :type endpoints: list[~azure.mgmt.web.v2021_02_01.models.EndpointDependency] + """ + + _attribute_map = { + 'category': {'key': 'category', 'type': 'str'}, + 'endpoints': {'key': 'endpoints', 'type': '[EndpointDependency]'}, + } + + def __init__( + self, + **kwargs + ): + super(OutboundEnvironmentEndpoint, self).__init__(**kwargs) + self.category = kwargs.get('category', None) + self.endpoints = kwargs.get('endpoints', None) + + +class OutboundEnvironmentEndpointCollection(msrest.serialization.Model): + """Collection of Outbound Environment Endpoints. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.OutboundEnvironmentEndpoint] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[OutboundEnvironmentEndpoint]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OutboundEnvironmentEndpointCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class PerfMonCounterCollection(msrest.serialization.Model): + """Collection of performance monitor counters. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.PerfMonResponse] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PerfMonResponse]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PerfMonCounterCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class PerfMonResponse(msrest.serialization.Model): + """Performance monitor API response. + + :param code: The response code. + :type code: str + :param message: The message. + :type message: str + :param data: The performance monitor counters. + :type data: ~azure.mgmt.web.v2021_02_01.models.PerfMonSet + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'data': {'key': 'data', 'type': 'PerfMonSet'}, + } + + def __init__( + self, + **kwargs + ): + super(PerfMonResponse, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.data = kwargs.get('data', None) + + +class PerfMonSample(msrest.serialization.Model): + """Performance monitor sample in a set. + + :param time: Point in time for which counter was measured. + :type time: ~datetime.datetime + :param instance_name: Name of the server on which the measurement is made. + :type instance_name: str + :param value: Value of counter at a certain time. + :type value: float + """ + + _attribute_map = { + 'time': {'key': 'time', 'type': 'iso-8601'}, + 'instance_name': {'key': 'instanceName', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(PerfMonSample, self).__init__(**kwargs) + self.time = kwargs.get('time', None) + self.instance_name = kwargs.get('instance_name', None) + self.value = kwargs.get('value', None) + + +class PerfMonSet(msrest.serialization.Model): + """Metric information. + + :param name: Unique key name of the counter. + :type name: str + :param start_time: Start time of the period. + :type start_time: ~datetime.datetime + :param end_time: End time of the period. + :type end_time: ~datetime.datetime + :param time_grain: Presented time grain. + :type time_grain: str + :param values: Collection of workers that are active during this time. + :type values: list[~azure.mgmt.web.v2021_02_01.models.PerfMonSample] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'time_grain': {'key': 'timeGrain', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[PerfMonSample]'}, + } + + def __init__( + self, + **kwargs + ): + super(PerfMonSet, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.time_grain = kwargs.get('time_grain', None) + self.values = kwargs.get('values', None) + + +class PremierAddOn(Resource): + """Premier add-on. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param sku: Premier add on SKU. + :type sku: str + :param product: Premier add on Product. + :type product: str + :param vendor: Premier add on Vendor. + :type vendor: str + :param marketplace_publisher: Premier add on Marketplace publisher. + :type marketplace_publisher: str + :param marketplace_offer: Premier add on Marketplace offer. + :type marketplace_offer: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'properties.sku', 'type': 'str'}, + 'product': {'key': 'properties.product', 'type': 'str'}, + 'vendor': {'key': 'properties.vendor', 'type': 'str'}, + 'marketplace_publisher': {'key': 'properties.marketplacePublisher', 'type': 'str'}, + 'marketplace_offer': {'key': 'properties.marketplaceOffer', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PremierAddOn, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.product = kwargs.get('product', None) + self.vendor = kwargs.get('vendor', None) + self.marketplace_publisher = kwargs.get('marketplace_publisher', None) + self.marketplace_offer = kwargs.get('marketplace_offer', None) + + +class PremierAddOnOffer(ProxyOnlyResource): + """Premier add-on offer. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param sku: Premier add on SKU. + :type sku: str + :param product: Premier add on offer Product. + :type product: str + :param vendor: Premier add on offer Vendor. + :type vendor: str + :param promo_code_required: :code:`true` if promotion code is required; otherwise, + :code:`false`. + :type promo_code_required: bool + :param quota: Premier add on offer Quota. + :type quota: int + :param web_hosting_plan_restrictions: App Service plans this offer is restricted to. Possible + values include: "None", "Free", "Shared", "Basic", "Standard", "Premium". + :type web_hosting_plan_restrictions: str or + ~azure.mgmt.web.v2021_02_01.models.AppServicePlanRestrictions + :param privacy_policy_url: Privacy policy URL. + :type privacy_policy_url: str + :param legal_terms_url: Legal terms URL. + :type legal_terms_url: str + :param marketplace_publisher: Marketplace publisher. + :type marketplace_publisher: str + :param marketplace_offer: Marketplace offer. + :type marketplace_offer: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'sku': {'key': 'properties.sku', 'type': 'str'}, + 'product': {'key': 'properties.product', 'type': 'str'}, + 'vendor': {'key': 'properties.vendor', 'type': 'str'}, + 'promo_code_required': {'key': 'properties.promoCodeRequired', 'type': 'bool'}, + 'quota': {'key': 'properties.quota', 'type': 'int'}, + 'web_hosting_plan_restrictions': {'key': 'properties.webHostingPlanRestrictions', 'type': 'str'}, + 'privacy_policy_url': {'key': 'properties.privacyPolicyUrl', 'type': 'str'}, + 'legal_terms_url': {'key': 'properties.legalTermsUrl', 'type': 'str'}, + 'marketplace_publisher': {'key': 'properties.marketplacePublisher', 'type': 'str'}, + 'marketplace_offer': {'key': 'properties.marketplaceOffer', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PremierAddOnOffer, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.product = kwargs.get('product', None) + self.vendor = kwargs.get('vendor', None) + self.promo_code_required = kwargs.get('promo_code_required', None) + self.quota = kwargs.get('quota', None) + self.web_hosting_plan_restrictions = kwargs.get('web_hosting_plan_restrictions', None) + self.privacy_policy_url = kwargs.get('privacy_policy_url', None) + self.legal_terms_url = kwargs.get('legal_terms_url', None) + self.marketplace_publisher = kwargs.get('marketplace_publisher', None) + self.marketplace_offer = kwargs.get('marketplace_offer', None) + + +class PremierAddOnOfferCollection(msrest.serialization.Model): + """Collection of premier add-on offers. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.PremierAddOnOffer] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PremierAddOnOffer]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PremierAddOnOfferCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class PremierAddOnPatchResource(ProxyOnlyResource): + """ARM resource for a PremierAddOn. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param sku: Premier add on SKU. + :type sku: str + :param product: Premier add on Product. + :type product: str + :param vendor: Premier add on Vendor. + :type vendor: str + :param marketplace_publisher: Premier add on Marketplace publisher. + :type marketplace_publisher: str + :param marketplace_offer: Premier add on Marketplace offer. + :type marketplace_offer: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'sku': {'key': 'properties.sku', 'type': 'str'}, + 'product': {'key': 'properties.product', 'type': 'str'}, + 'vendor': {'key': 'properties.vendor', 'type': 'str'}, + 'marketplace_publisher': {'key': 'properties.marketplacePublisher', 'type': 'str'}, + 'marketplace_offer': {'key': 'properties.marketplaceOffer', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PremierAddOnPatchResource, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.product = kwargs.get('product', None) + self.vendor = kwargs.get('vendor', None) + self.marketplace_publisher = kwargs.get('marketplace_publisher', None) + self.marketplace_offer = kwargs.get('marketplace_offer', None) + + +class PrivateAccess(ProxyOnlyResource): + """Description of the parameters of Private Access for a Web Site. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param enabled: Whether private access is enabled or not. + :type enabled: bool + :param virtual_networks: The Virtual Networks (and subnets) allowed to access the site + privately. + :type virtual_networks: list[~azure.mgmt.web.v2021_02_01.models.PrivateAccessVirtualNetwork] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'virtual_networks': {'key': 'properties.virtualNetworks', 'type': '[PrivateAccessVirtualNetwork]'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateAccess, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.virtual_networks = kwargs.get('virtual_networks', None) + + +class PrivateAccessSubnet(msrest.serialization.Model): + """Description of a Virtual Network subnet that is useable for private site access. + + :param name: The name of the subnet. + :type name: str + :param key: The key (ID) of the subnet. + :type key: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'key': {'key': 'key', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateAccessSubnet, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.key = kwargs.get('key', None) + + +class PrivateAccessVirtualNetwork(msrest.serialization.Model): + """Description of a Virtual Network that is useable for private site access. + + :param name: The name of the Virtual Network. + :type name: str + :param key: The key (ID) of the Virtual Network. + :type key: int + :param resource_id: The ARM uri of the Virtual Network. + :type resource_id: str + :param subnets: A List of subnets that access is allowed to on this Virtual Network. An empty + array (but not null) is interpreted to mean that all subnets are allowed within this Virtual + Network. + :type subnets: list[~azure.mgmt.web.v2021_02_01.models.PrivateAccessSubnet] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'key': {'key': 'key', 'type': 'int'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'subnets': {'key': 'subnets', 'type': '[PrivateAccessSubnet]'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateAccessVirtualNetwork, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.key = kwargs.get('key', None) + self.resource_id = kwargs.get('resource_id', None) + self.subnets = kwargs.get('subnets', None) + + +class PrivateEndpointConnectionCollection(msrest.serialization.Model): + """PrivateEndpointConnectionCollection. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: + list[~azure.mgmt.web.v2021_02_01.models.RemotePrivateEndpointConnectionARMResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[RemotePrivateEndpointConnectionARMResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpointConnectionCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class PrivateLinkConnectionApprovalRequestResource(ProxyOnlyResource): + """Private Endpoint Connection Approval ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param private_link_service_connection_state: The state of a private link connection. + :type private_link_service_connection_state: + ~azure.mgmt.web.v2021_02_01.models.PrivateLinkConnectionState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkConnectionState'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkConnectionApprovalRequestResource, self).__init__(**kwargs) + self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) + + +class PrivateLinkConnectionState(msrest.serialization.Model): + """The state of a private link connection. + + :param status: Status of a private link connection. + :type status: str + :param description: Description of a private link connection. + :type description: str + :param actions_required: ActionsRequired for a private link connection. + :type actions_required: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkConnectionState, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.description = kwargs.get('description', None) + self.actions_required = kwargs.get('actions_required', None) + + +class PrivateLinkResource(msrest.serialization.Model): + """A private link resource. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. + :type id: str + :param name: Required. Name of a private link resource. + :type name: str + :param type: Required. + :type type: str + :param properties: Required. Properties of a private link resource. + :type properties: ~azure.mgmt.web.v2021_02_01.models.PrivateLinkResourceProperties + """ + + _validation = { + 'id': {'required': True}, + 'name': {'required': True}, + 'type': {'required': True}, + 'properties': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'PrivateLinkResourceProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkResource, self).__init__(**kwargs) + self.id = kwargs['id'] + self.name = kwargs['name'] + self.type = kwargs['type'] + self.properties = kwargs['properties'] + + +class PrivateLinkResourceProperties(msrest.serialization.Model): + """Properties of a private link resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar group_id: GroupId of a private link resource. + :vartype group_id: str + :ivar required_members: RequiredMembers of a private link resource. + :vartype required_members: list[str] + :ivar required_zone_names: RequiredZoneNames of a private link resource. + :vartype required_zone_names: list[str] + """ + + _validation = { + 'group_id': {'readonly': True}, + 'required_members': {'readonly': True}, + 'required_zone_names': {'readonly': True}, + } + + _attribute_map = { + 'group_id': {'key': 'groupId', 'type': 'str'}, + 'required_members': {'key': 'requiredMembers', 'type': '[str]'}, + 'required_zone_names': {'key': 'requiredZoneNames', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkResourceProperties, self).__init__(**kwargs) + self.group_id = None + self.required_members = None + self.required_zone_names = None + + +class PrivateLinkResourcesWrapper(msrest.serialization.Model): + """Wrapper for a collection of private link resources. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. + :type value: list[~azure.mgmt.web.v2021_02_01.models.PrivateLinkResource] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkResourcesWrapper, self).__init__(**kwargs) + self.value = kwargs['value'] + + +class ProcessInfo(ProxyOnlyResource): + """Process Information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar identifier: ARM Identifier for deployment. + :vartype identifier: int + :param deployment_name: Deployment name. + :type deployment_name: str + :param href: HRef URI. + :type href: str + :param minidump: Minidump URI. + :type minidump: str + :param is_profile_running: Is profile running?. + :type is_profile_running: bool + :param is_iis_profile_running: Is the IIS Profile running?. + :type is_iis_profile_running: bool + :param iis_profile_timeout_in_seconds: IIS Profile timeout (seconds). + :type iis_profile_timeout_in_seconds: float + :param parent: Parent process. + :type parent: str + :param children: Child process list. + :type children: list[str] + :param threads: Thread list. + :type threads: list[~azure.mgmt.web.v2021_02_01.models.ProcessThreadInfo] + :param open_file_handles: List of open files. + :type open_file_handles: list[str] + :param modules: List of modules. + :type modules: list[~azure.mgmt.web.v2021_02_01.models.ProcessModuleInfo] + :param file_name: File name of this process. + :type file_name: str + :param command_line: Command line. + :type command_line: str + :param user_name: User name. + :type user_name: str + :param handle_count: Handle count. + :type handle_count: int + :param module_count: Module count. + :type module_count: int + :param thread_count: Thread count. + :type thread_count: int + :param start_time: Start time. + :type start_time: ~datetime.datetime + :param total_cpu_time: Total CPU time. + :type total_cpu_time: str + :param user_cpu_time: User CPU time. + :type user_cpu_time: str + :param privileged_cpu_time: Privileged CPU time. + :type privileged_cpu_time: str + :param working_set: Working set. + :type working_set: long + :param peak_working_set: Peak working set. + :type peak_working_set: long + :param private_memory: Private memory size. + :type private_memory: long + :param virtual_memory: Virtual memory size. + :type virtual_memory: long + :param peak_virtual_memory: Peak virtual memory usage. + :type peak_virtual_memory: long + :param paged_system_memory: Paged system memory. + :type paged_system_memory: long + :param non_paged_system_memory: Non-paged system memory. + :type non_paged_system_memory: long + :param paged_memory: Paged memory. + :type paged_memory: long + :param peak_paged_memory: Peak paged memory. + :type peak_paged_memory: long + :param time_stamp: Time stamp. + :type time_stamp: ~datetime.datetime + :param environment_variables: List of environment variables. + :type environment_variables: dict[str, str] + :param is_scm_site: Is this the SCM site?. + :type is_scm_site: bool + :param is_webjob: Is this a Web Job?. + :type is_webjob: bool + :param description: Description of process. + :type description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'identifier': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'identifier': {'key': 'properties.identifier', 'type': 'int'}, + 'deployment_name': {'key': 'properties.deployment_name', 'type': 'str'}, + 'href': {'key': 'properties.href', 'type': 'str'}, + 'minidump': {'key': 'properties.minidump', 'type': 'str'}, + 'is_profile_running': {'key': 'properties.is_profile_running', 'type': 'bool'}, + 'is_iis_profile_running': {'key': 'properties.is_iis_profile_running', 'type': 'bool'}, + 'iis_profile_timeout_in_seconds': {'key': 'properties.iis_profile_timeout_in_seconds', 'type': 'float'}, + 'parent': {'key': 'properties.parent', 'type': 'str'}, + 'children': {'key': 'properties.children', 'type': '[str]'}, + 'threads': {'key': 'properties.threads', 'type': '[ProcessThreadInfo]'}, + 'open_file_handles': {'key': 'properties.open_file_handles', 'type': '[str]'}, + 'modules': {'key': 'properties.modules', 'type': '[ProcessModuleInfo]'}, + 'file_name': {'key': 'properties.file_name', 'type': 'str'}, + 'command_line': {'key': 'properties.command_line', 'type': 'str'}, + 'user_name': {'key': 'properties.user_name', 'type': 'str'}, + 'handle_count': {'key': 'properties.handle_count', 'type': 'int'}, + 'module_count': {'key': 'properties.module_count', 'type': 'int'}, + 'thread_count': {'key': 'properties.thread_count', 'type': 'int'}, + 'start_time': {'key': 'properties.start_time', 'type': 'iso-8601'}, + 'total_cpu_time': {'key': 'properties.total_cpu_time', 'type': 'str'}, + 'user_cpu_time': {'key': 'properties.user_cpu_time', 'type': 'str'}, + 'privileged_cpu_time': {'key': 'properties.privileged_cpu_time', 'type': 'str'}, + 'working_set': {'key': 'properties.working_set', 'type': 'long'}, + 'peak_working_set': {'key': 'properties.peak_working_set', 'type': 'long'}, + 'private_memory': {'key': 'properties.private_memory', 'type': 'long'}, + 'virtual_memory': {'key': 'properties.virtual_memory', 'type': 'long'}, + 'peak_virtual_memory': {'key': 'properties.peak_virtual_memory', 'type': 'long'}, + 'paged_system_memory': {'key': 'properties.paged_system_memory', 'type': 'long'}, + 'non_paged_system_memory': {'key': 'properties.non_paged_system_memory', 'type': 'long'}, + 'paged_memory': {'key': 'properties.paged_memory', 'type': 'long'}, + 'peak_paged_memory': {'key': 'properties.peak_paged_memory', 'type': 'long'}, + 'time_stamp': {'key': 'properties.time_stamp', 'type': 'iso-8601'}, + 'environment_variables': {'key': 'properties.environment_variables', 'type': '{str}'}, + 'is_scm_site': {'key': 'properties.is_scm_site', 'type': 'bool'}, + 'is_webjob': {'key': 'properties.is_webjob', 'type': 'bool'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProcessInfo, self).__init__(**kwargs) + self.identifier = None + self.deployment_name = kwargs.get('deployment_name', None) + self.href = kwargs.get('href', None) + self.minidump = kwargs.get('minidump', None) + self.is_profile_running = kwargs.get('is_profile_running', None) + self.is_iis_profile_running = kwargs.get('is_iis_profile_running', None) + self.iis_profile_timeout_in_seconds = kwargs.get('iis_profile_timeout_in_seconds', None) + self.parent = kwargs.get('parent', None) + self.children = kwargs.get('children', None) + self.threads = kwargs.get('threads', None) + self.open_file_handles = kwargs.get('open_file_handles', None) + self.modules = kwargs.get('modules', None) + self.file_name = kwargs.get('file_name', None) + self.command_line = kwargs.get('command_line', None) + self.user_name = kwargs.get('user_name', None) + self.handle_count = kwargs.get('handle_count', None) + self.module_count = kwargs.get('module_count', None) + self.thread_count = kwargs.get('thread_count', None) + self.start_time = kwargs.get('start_time', None) + self.total_cpu_time = kwargs.get('total_cpu_time', None) + self.user_cpu_time = kwargs.get('user_cpu_time', None) + self.privileged_cpu_time = kwargs.get('privileged_cpu_time', None) + self.working_set = kwargs.get('working_set', None) + self.peak_working_set = kwargs.get('peak_working_set', None) + self.private_memory = kwargs.get('private_memory', None) + self.virtual_memory = kwargs.get('virtual_memory', None) + self.peak_virtual_memory = kwargs.get('peak_virtual_memory', None) + self.paged_system_memory = kwargs.get('paged_system_memory', None) + self.non_paged_system_memory = kwargs.get('non_paged_system_memory', None) + self.paged_memory = kwargs.get('paged_memory', None) + self.peak_paged_memory = kwargs.get('peak_paged_memory', None) + self.time_stamp = kwargs.get('time_stamp', None) + self.environment_variables = kwargs.get('environment_variables', None) + self.is_scm_site = kwargs.get('is_scm_site', None) + self.is_webjob = kwargs.get('is_webjob', None) + self.description = kwargs.get('description', None) + + +class ProcessInfoCollection(msrest.serialization.Model): + """Collection of Kudu process information elements. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.ProcessInfo] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ProcessInfo]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProcessInfoCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class ProcessModuleInfo(ProxyOnlyResource): + """Process Module Information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param base_address: Base address. Used as module identifier in ARM resource URI. + :type base_address: str + :param file_name: File name. + :type file_name: str + :param href: HRef URI. + :type href: str + :param file_path: File path. + :type file_path: str + :param module_memory_size: Module memory size. + :type module_memory_size: int + :param file_version: File version. + :type file_version: str + :param file_description: File description. + :type file_description: str + :param product: Product name. + :type product: str + :param product_version: Product version. + :type product_version: str + :param is_debug: Is debug?. + :type is_debug: bool + :param language: Module language (locale). + :type language: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'base_address': {'key': 'properties.base_address', 'type': 'str'}, + 'file_name': {'key': 'properties.file_name', 'type': 'str'}, + 'href': {'key': 'properties.href', 'type': 'str'}, + 'file_path': {'key': 'properties.file_path', 'type': 'str'}, + 'module_memory_size': {'key': 'properties.module_memory_size', 'type': 'int'}, + 'file_version': {'key': 'properties.file_version', 'type': 'str'}, + 'file_description': {'key': 'properties.file_description', 'type': 'str'}, + 'product': {'key': 'properties.product', 'type': 'str'}, + 'product_version': {'key': 'properties.product_version', 'type': 'str'}, + 'is_debug': {'key': 'properties.is_debug', 'type': 'bool'}, + 'language': {'key': 'properties.language', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProcessModuleInfo, self).__init__(**kwargs) + self.base_address = kwargs.get('base_address', None) + self.file_name = kwargs.get('file_name', None) + self.href = kwargs.get('href', None) + self.file_path = kwargs.get('file_path', None) + self.module_memory_size = kwargs.get('module_memory_size', None) + self.file_version = kwargs.get('file_version', None) + self.file_description = kwargs.get('file_description', None) + self.product = kwargs.get('product', None) + self.product_version = kwargs.get('product_version', None) + self.is_debug = kwargs.get('is_debug', None) + self.language = kwargs.get('language', None) + + +class ProcessModuleInfoCollection(msrest.serialization.Model): + """Collection of Kudu thread information elements. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.ProcessModuleInfo] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ProcessModuleInfo]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProcessModuleInfoCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class ProcessThreadInfo(ProxyOnlyResource): + """Process Thread Information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar identifier: Site extension ID. + :vartype identifier: int + :param href: HRef URI. + :type href: str + :param process: Process URI. + :type process: str + :param start_address: Start address. + :type start_address: str + :param current_priority: Current thread priority. + :type current_priority: int + :param priority_level: Thread priority level. + :type priority_level: str + :param base_priority: Base priority. + :type base_priority: int + :param start_time: Start time. + :type start_time: ~datetime.datetime + :param total_processor_time: Total processor time. + :type total_processor_time: str + :param user_processor_time: User processor time. + :type user_processor_time: str + :param state: Thread state. + :type state: str + :param wait_reason: Wait reason. + :type wait_reason: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'identifier': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'identifier': {'key': 'properties.identifier', 'type': 'int'}, + 'href': {'key': 'properties.href', 'type': 'str'}, + 'process': {'key': 'properties.process', 'type': 'str'}, + 'start_address': {'key': 'properties.start_address', 'type': 'str'}, + 'current_priority': {'key': 'properties.current_priority', 'type': 'int'}, + 'priority_level': {'key': 'properties.priority_level', 'type': 'str'}, + 'base_priority': {'key': 'properties.base_priority', 'type': 'int'}, + 'start_time': {'key': 'properties.start_time', 'type': 'iso-8601'}, + 'total_processor_time': {'key': 'properties.total_processor_time', 'type': 'str'}, + 'user_processor_time': {'key': 'properties.user_processor_time', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'wait_reason': {'key': 'properties.wait_reason', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProcessThreadInfo, self).__init__(**kwargs) + self.identifier = None + self.href = kwargs.get('href', None) + self.process = kwargs.get('process', None) + self.start_address = kwargs.get('start_address', None) + self.current_priority = kwargs.get('current_priority', None) + self.priority_level = kwargs.get('priority_level', None) + self.base_priority = kwargs.get('base_priority', None) + self.start_time = kwargs.get('start_time', None) + self.total_processor_time = kwargs.get('total_processor_time', None) + self.user_processor_time = kwargs.get('user_processor_time', None) + self.state = kwargs.get('state', None) + self.wait_reason = kwargs.get('wait_reason', None) + + +class ProcessThreadInfoCollection(msrest.serialization.Model): + """Collection of Kudu thread information elements. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.ProcessThreadInfo] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ProcessThreadInfo]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProcessThreadInfoCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class PublicCertificate(ProxyOnlyResource): + """Public certificate object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param blob: Public Certificate byte array. + :type blob: bytearray + :param public_certificate_location: Public Certificate Location. Possible values include: + "CurrentUserMy", "LocalMachineMy", "Unknown". + :type public_certificate_location: str or + ~azure.mgmt.web.v2021_02_01.models.PublicCertificateLocation + :ivar thumbprint: Certificate Thumbprint. + :vartype thumbprint: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'thumbprint': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'blob': {'key': 'properties.blob', 'type': 'bytearray'}, + 'public_certificate_location': {'key': 'properties.publicCertificateLocation', 'type': 'str'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PublicCertificate, self).__init__(**kwargs) + self.blob = kwargs.get('blob', None) + self.public_certificate_location = kwargs.get('public_certificate_location', None) + self.thumbprint = None + + +class PublicCertificateCollection(msrest.serialization.Model): + """Collection of public certificates. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.PublicCertificate] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PublicCertificate]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PublicCertificateCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class PublishingCredentialsPoliciesCollection(msrest.serialization.Model): + """Publishing Credentials Policies entity collection ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.CsmPublishingCredentialsPoliciesEntity] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[CsmPublishingCredentialsPoliciesEntity]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PublishingCredentialsPoliciesCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class PushSettings(ProxyOnlyResource): + """Push settings for the App. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param is_push_enabled: Gets or sets a flag indicating whether the Push endpoint is enabled. + :type is_push_enabled: bool + :param tag_whitelist_json: Gets or sets a JSON string containing a list of tags that are + whitelisted for use by the push registration endpoint. + :type tag_whitelist_json: str + :param tags_requiring_auth: Gets or sets a JSON string containing a list of tags that require + user authentication to be used in the push registration endpoint. + Tags can consist of alphanumeric characters and the following: + '_', '@', '#', '.', ':', '-'. + Validation should be performed at the PushRequestHandler. + :type tags_requiring_auth: str + :param dynamic_tags_json: Gets or sets a JSON string containing a list of dynamic tags that + will be evaluated from user claims in the push registration endpoint. + :type dynamic_tags_json: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'is_push_enabled': {'key': 'properties.isPushEnabled', 'type': 'bool'}, + 'tag_whitelist_json': {'key': 'properties.tagWhitelistJson', 'type': 'str'}, + 'tags_requiring_auth': {'key': 'properties.tagsRequiringAuth', 'type': 'str'}, + 'dynamic_tags_json': {'key': 'properties.dynamicTagsJson', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PushSettings, self).__init__(**kwargs) + self.is_push_enabled = kwargs.get('is_push_enabled', None) + self.tag_whitelist_json = kwargs.get('tag_whitelist_json', None) + self.tags_requiring_auth = kwargs.get('tags_requiring_auth', None) + self.dynamic_tags_json = kwargs.get('dynamic_tags_json', None) + + +class QueryUtterancesResult(msrest.serialization.Model): + """Result for utterances query. + + :param sample_utterance: A sample utterance. + :type sample_utterance: ~azure.mgmt.web.v2021_02_01.models.SampleUtterance + :param score: Score of a sample utterance. + :type score: float + """ + + _attribute_map = { + 'sample_utterance': {'key': 'sampleUtterance', 'type': 'SampleUtterance'}, + 'score': {'key': 'score', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(QueryUtterancesResult, self).__init__(**kwargs) + self.sample_utterance = kwargs.get('sample_utterance', None) + self.score = kwargs.get('score', None) + + +class QueryUtterancesResults(msrest.serialization.Model): + """Suggested utterances where the detector can be applicable. + + :param query: Search Query. + :type query: str + :param results: Array of utterance results for search query. + :type results: list[~azure.mgmt.web.v2021_02_01.models.QueryUtterancesResult] + """ + + _attribute_map = { + 'query': {'key': 'query', 'type': 'str'}, + 'results': {'key': 'results', 'type': '[QueryUtterancesResult]'}, + } + + def __init__( + self, + **kwargs + ): + super(QueryUtterancesResults, self).__init__(**kwargs) + self.query = kwargs.get('query', None) + self.results = kwargs.get('results', None) + + +class RampUpRule(msrest.serialization.Model): + """Routing rules for ramp up testing. This rule allows to redirect static traffic % to a slot or to gradually change routing % based on performance. + + :param action_host_name: Hostname of a slot to which the traffic will be redirected if decided + to. E.g. myapp-stage.azurewebsites.net. + :type action_host_name: str + :param reroute_percentage: Percentage of the traffic which will be redirected to + :code:`ActionHostName`. + :type reroute_percentage: float + :param change_step: In auto ramp up scenario this is the step to add/remove from + :code:`ReroutePercentage` until it reaches + \n:code:`MinReroutePercentage` or + :code:`MaxReroutePercentage`. Site metrics are checked every N minutes specified + in :code:`ChangeIntervalInMinutes`.\nCustom decision algorithm + can be provided in TiPCallback site extension which URL can be specified in + :code:`ChangeDecisionCallbackUrl`. + :type change_step: float + :param change_interval_in_minutes: Specifies interval in minutes to reevaluate + ReroutePercentage. + :type change_interval_in_minutes: int + :param min_reroute_percentage: Specifies lower boundary above which ReroutePercentage will + stay. + :type min_reroute_percentage: float + :param max_reroute_percentage: Specifies upper boundary below which ReroutePercentage will + stay. + :type max_reroute_percentage: float + :param change_decision_callback_url: Custom decision algorithm can be provided in TiPCallback + site extension which URL can be specified. See TiPCallback site extension for the scaffold and + contracts. + https://www.siteextensions.net/packages/TiPCallback/. + :type change_decision_callback_url: str + :param name: Name of the routing rule. The recommended name would be to point to the slot which + will receive the traffic in the experiment. + :type name: str + """ + + _attribute_map = { + 'action_host_name': {'key': 'actionHostName', 'type': 'str'}, + 'reroute_percentage': {'key': 'reroutePercentage', 'type': 'float'}, + 'change_step': {'key': 'changeStep', 'type': 'float'}, + 'change_interval_in_minutes': {'key': 'changeIntervalInMinutes', 'type': 'int'}, + 'min_reroute_percentage': {'key': 'minReroutePercentage', 'type': 'float'}, + 'max_reroute_percentage': {'key': 'maxReroutePercentage', 'type': 'float'}, + 'change_decision_callback_url': {'key': 'changeDecisionCallbackUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RampUpRule, self).__init__(**kwargs) + self.action_host_name = kwargs.get('action_host_name', None) + self.reroute_percentage = kwargs.get('reroute_percentage', None) + self.change_step = kwargs.get('change_step', None) + self.change_interval_in_minutes = kwargs.get('change_interval_in_minutes', None) + self.min_reroute_percentage = kwargs.get('min_reroute_percentage', None) + self.max_reroute_percentage = kwargs.get('max_reroute_percentage', None) + self.change_decision_callback_url = kwargs.get('change_decision_callback_url', None) + self.name = kwargs.get('name', None) + + +class Recommendation(ProxyOnlyResource): + """Represents a recommendation result generated by the recommendation engine. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param creation_time: Timestamp when this instance was created. + :type creation_time: ~datetime.datetime + :param recommendation_id: A GUID value that each recommendation object is associated with. + :type recommendation_id: str + :param resource_id: Full ARM resource ID string that this recommendation object is associated + with. + :type resource_id: str + :param resource_scope: Name of a resource type this recommendation applies, e.g. Subscription, + ServerFarm, Site. Possible values include: "ServerFarm", "Subscription", "WebSite". + :type resource_scope: str or ~azure.mgmt.web.v2021_02_01.models.ResourceScopeType + :param rule_name: Unique name of the rule. + :type rule_name: str + :param display_name: UI friendly name of the rule (may not be unique). + :type display_name: str + :param message: Recommendation text. + :type message: str + :param level: Level indicating how critical this recommendation can impact. Possible values + include: "Critical", "Warning", "Information", "NonUrgentSuggestion". + :type level: str or ~azure.mgmt.web.v2021_02_01.models.NotificationLevel + :param channels: List of channels that this recommendation can apply. Possible values include: + "Notification", "Api", "Email", "Webhook", "All". + :type channels: str or ~azure.mgmt.web.v2021_02_01.models.Channels + :ivar category_tags: The list of category tags that this recommendation belongs to. + :vartype category_tags: list[str] + :param action_name: Name of action recommended by this object. + :type action_name: str + :param enabled: True if this recommendation is still valid (i.e. "actionable"). False if it is + invalid. + :type enabled: int + :param states: The list of states of this recommendation. If it's null then it should be + considered "Active". + :type states: list[str] + :param start_time: The beginning time in UTC of a range that the recommendation refers to. + :type start_time: ~datetime.datetime + :param end_time: The end time in UTC of a range that the recommendation refers to. + :type end_time: ~datetime.datetime + :param next_notification_time: When to notify this recommendation next in UTC. Null means that + this will never be notified anymore. + :type next_notification_time: ~datetime.datetime + :param notification_expiration_time: Date and time in UTC when this notification expires. + :type notification_expiration_time: ~datetime.datetime + :param notified_time: Last timestamp in UTC this instance was actually notified. Null means + that this recommendation hasn't been notified yet. + :type notified_time: ~datetime.datetime + :param score: A metric value measured by the rule. + :type score: float + :param is_dynamic: True if this is associated with a dynamically added rule. + :type is_dynamic: bool + :param extension_name: Extension name of the portal if exists. + :type extension_name: str + :param blade_name: Deep link to a blade on the portal. + :type blade_name: str + :param forward_link: Forward link to an external document associated with the rule. + :type forward_link: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'category_tags': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'recommendation_id': {'key': 'properties.recommendationId', 'type': 'str'}, + 'resource_id': {'key': 'properties.resourceId', 'type': 'str'}, + 'resource_scope': {'key': 'properties.resourceScope', 'type': 'str'}, + 'rule_name': {'key': 'properties.ruleName', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'message': {'key': 'properties.message', 'type': 'str'}, + 'level': {'key': 'properties.level', 'type': 'str'}, + 'channels': {'key': 'properties.channels', 'type': 'str'}, + 'category_tags': {'key': 'properties.categoryTags', 'type': '[str]'}, + 'action_name': {'key': 'properties.actionName', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'int'}, + 'states': {'key': 'properties.states', 'type': '[str]'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'next_notification_time': {'key': 'properties.nextNotificationTime', 'type': 'iso-8601'}, + 'notification_expiration_time': {'key': 'properties.notificationExpirationTime', 'type': 'iso-8601'}, + 'notified_time': {'key': 'properties.notifiedTime', 'type': 'iso-8601'}, + 'score': {'key': 'properties.score', 'type': 'float'}, + 'is_dynamic': {'key': 'properties.isDynamic', 'type': 'bool'}, + 'extension_name': {'key': 'properties.extensionName', 'type': 'str'}, + 'blade_name': {'key': 'properties.bladeName', 'type': 'str'}, + 'forward_link': {'key': 'properties.forwardLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Recommendation, self).__init__(**kwargs) + self.creation_time = kwargs.get('creation_time', None) + self.recommendation_id = kwargs.get('recommendation_id', None) + self.resource_id = kwargs.get('resource_id', None) + self.resource_scope = kwargs.get('resource_scope', None) + self.rule_name = kwargs.get('rule_name', None) + self.display_name = kwargs.get('display_name', None) + self.message = kwargs.get('message', None) + self.level = kwargs.get('level', None) + self.channels = kwargs.get('channels', None) + self.category_tags = None + self.action_name = kwargs.get('action_name', None) + self.enabled = kwargs.get('enabled', None) + self.states = kwargs.get('states', None) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.next_notification_time = kwargs.get('next_notification_time', None) + self.notification_expiration_time = kwargs.get('notification_expiration_time', None) + self.notified_time = kwargs.get('notified_time', None) + self.score = kwargs.get('score', None) + self.is_dynamic = kwargs.get('is_dynamic', None) + self.extension_name = kwargs.get('extension_name', None) + self.blade_name = kwargs.get('blade_name', None) + self.forward_link = kwargs.get('forward_link', None) + + +class RecommendationCollection(msrest.serialization.Model): + """Collection of recommendations. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.Recommendation] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Recommendation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RecommendationCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class RecommendationRule(ProxyOnlyResource): + """Represents a recommendation rule that the recommendation engine can perform. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param recommendation_name: Unique name of the rule. + :type recommendation_name: str + :param display_name: UI friendly name of the rule. + :type display_name: str + :param message: Localized name of the rule (Good for UI). + :type message: str + :param recommendation_id: Recommendation ID of an associated recommendation object tied to the + rule, if exists. + If such an object doesn't exist, it is set to null. + :type recommendation_id: str + :param description: Localized detailed description of the rule. + :type description: str + :param action_name: Name of action that is recommended by this rule in string. + :type action_name: str + :param level: Level of impact indicating how critical this rule is. Possible values include: + "Critical", "Warning", "Information", "NonUrgentSuggestion". + :type level: str or ~azure.mgmt.web.v2021_02_01.models.NotificationLevel + :param channels: List of available channels that this rule applies. Possible values include: + "Notification", "Api", "Email", "Webhook", "All". + :type channels: str or ~azure.mgmt.web.v2021_02_01.models.Channels + :ivar category_tags: The list of category tags that this recommendation rule belongs to. + :vartype category_tags: list[str] + :param is_dynamic: True if this is associated with a dynamically added rule. + :type is_dynamic: bool + :param extension_name: Extension name of the portal if exists. Applicable to dynamic rule only. + :type extension_name: str + :param blade_name: Deep link to a blade on the portal. Applicable to dynamic rule only. + :type blade_name: str + :param forward_link: Forward link to an external document associated with the rule. Applicable + to dynamic rule only. + :type forward_link: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'category_tags': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'recommendation_name': {'key': 'properties.recommendationName', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'message': {'key': 'properties.message', 'type': 'str'}, + 'recommendation_id': {'key': 'properties.recommendationId', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'action_name': {'key': 'properties.actionName', 'type': 'str'}, + 'level': {'key': 'properties.level', 'type': 'str'}, + 'channels': {'key': 'properties.channels', 'type': 'str'}, + 'category_tags': {'key': 'properties.categoryTags', 'type': '[str]'}, + 'is_dynamic': {'key': 'properties.isDynamic', 'type': 'bool'}, + 'extension_name': {'key': 'properties.extensionName', 'type': 'str'}, + 'blade_name': {'key': 'properties.bladeName', 'type': 'str'}, + 'forward_link': {'key': 'properties.forwardLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RecommendationRule, self).__init__(**kwargs) + self.recommendation_name = kwargs.get('recommendation_name', None) + self.display_name = kwargs.get('display_name', None) + self.message = kwargs.get('message', None) + self.recommendation_id = kwargs.get('recommendation_id', None) + self.description = kwargs.get('description', None) + self.action_name = kwargs.get('action_name', None) + self.level = kwargs.get('level', None) + self.channels = kwargs.get('channels', None) + self.category_tags = None + self.is_dynamic = kwargs.get('is_dynamic', None) + self.extension_name = kwargs.get('extension_name', None) + self.blade_name = kwargs.get('blade_name', None) + self.forward_link = kwargs.get('forward_link', None) + + +class ReissueCertificateOrderRequest(ProxyOnlyResource): + """Class representing certificate reissue request. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param key_size: Certificate Key Size. + :type key_size: int + :param delay_existing_revoke_in_hours: Delay in hours to revoke existing certificate after the + new certificate is issued. + :type delay_existing_revoke_in_hours: int + :param csr: Csr to be used for re-key operation. + :type csr: str + :param is_private_key_external: Should we change the ASC type (from managed private key to + external private key and vice versa). + :type is_private_key_external: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'key_size': {'key': 'properties.keySize', 'type': 'int'}, + 'delay_existing_revoke_in_hours': {'key': 'properties.delayExistingRevokeInHours', 'type': 'int'}, + 'csr': {'key': 'properties.csr', 'type': 'str'}, + 'is_private_key_external': {'key': 'properties.isPrivateKeyExternal', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(ReissueCertificateOrderRequest, self).__init__(**kwargs) + self.key_size = kwargs.get('key_size', None) + self.delay_existing_revoke_in_hours = kwargs.get('delay_existing_revoke_in_hours', None) + self.csr = kwargs.get('csr', None) + self.is_private_key_external = kwargs.get('is_private_key_external', None) + + +class RelayServiceConnectionEntity(ProxyOnlyResource): + """Hybrid Connection for an App Service app. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param entity_name: + :type entity_name: str + :param entity_connection_string: + :type entity_connection_string: str + :param resource_type: + :type resource_type: str + :param resource_connection_string: + :type resource_connection_string: str + :param hostname: + :type hostname: str + :param port: + :type port: int + :param biztalk_uri: + :type biztalk_uri: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'entity_name': {'key': 'properties.entityName', 'type': 'str'}, + 'entity_connection_string': {'key': 'properties.entityConnectionString', 'type': 'str'}, + 'resource_type': {'key': 'properties.resourceType', 'type': 'str'}, + 'resource_connection_string': {'key': 'properties.resourceConnectionString', 'type': 'str'}, + 'hostname': {'key': 'properties.hostname', 'type': 'str'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + 'biztalk_uri': {'key': 'properties.biztalkUri', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RelayServiceConnectionEntity, self).__init__(**kwargs) + self.entity_name = kwargs.get('entity_name', None) + self.entity_connection_string = kwargs.get('entity_connection_string', None) + self.resource_type = kwargs.get('resource_type', None) + self.resource_connection_string = kwargs.get('resource_connection_string', None) + self.hostname = kwargs.get('hostname', None) + self.port = kwargs.get('port', None) + self.biztalk_uri = kwargs.get('biztalk_uri', None) + + +class RemotePrivateEndpointConnection(ProxyOnlyResource): + """A remote private endpoint connection. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar provisioning_state: + :vartype provisioning_state: str + :param private_endpoint: PrivateEndpoint of a remote private endpoint connection. + :type private_endpoint: ~azure.mgmt.web.v2021_02_01.models.ArmIdWrapper + :param private_link_service_connection_state: The state of a private link connection. + :type private_link_service_connection_state: + ~azure.mgmt.web.v2021_02_01.models.PrivateLinkConnectionState + :param ip_addresses: Private IPAddresses mapped to the remote private endpoint. + :type ip_addresses: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'ArmIdWrapper'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkConnectionState'}, + 'ip_addresses': {'key': 'properties.ipAddresses', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(RemotePrivateEndpointConnection, self).__init__(**kwargs) + self.provisioning_state = None + self.private_endpoint = kwargs.get('private_endpoint', None) + self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) + self.ip_addresses = kwargs.get('ip_addresses', None) + + +class RemotePrivateEndpointConnectionARMResource(ProxyOnlyResource): + """Remote Private Endpoint Connection ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar provisioning_state: + :vartype provisioning_state: str + :param private_endpoint: PrivateEndpoint of a remote private endpoint connection. + :type private_endpoint: ~azure.mgmt.web.v2021_02_01.models.ArmIdWrapper + :param private_link_service_connection_state: The state of a private link connection. + :type private_link_service_connection_state: + ~azure.mgmt.web.v2021_02_01.models.PrivateLinkConnectionState + :param ip_addresses: Private IPAddresses mapped to the remote private endpoint. + :type ip_addresses: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'ArmIdWrapper'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkConnectionState'}, + 'ip_addresses': {'key': 'properties.ipAddresses', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(RemotePrivateEndpointConnectionARMResource, self).__init__(**kwargs) + self.provisioning_state = None + self.private_endpoint = kwargs.get('private_endpoint', None) + self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) + self.ip_addresses = kwargs.get('ip_addresses', None) + + +class Rendering(msrest.serialization.Model): + """Instructions for rendering the data. + + :param type: Rendering Type. Possible values include: "NoGraph", "Table", "TimeSeries", + "TimeSeriesPerInstance", "PieChart", "DataSummary", "Email", "Insights", "DynamicInsight", + "Markdown", "Detector", "DropDown", "Card", "Solution", "Guage", "Form", "ChangeSets", + "ChangeAnalysisOnboarding", "ChangesView", "AppInsight", "DependencyGraph", "DownTime", + "SummaryCard", "SearchComponent", "AppInsightEnablement". + :type type: str or ~azure.mgmt.web.v2021_02_01.models.RenderingType + :param title: Title of data. + :type title: str + :param description: Description of the data that will help it be interpreted. + :type description: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'title': {'key': 'title', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Rendering, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.title = kwargs.get('title', None) + self.description = kwargs.get('description', None) + + +class RenewCertificateOrderRequest(ProxyOnlyResource): + """Class representing certificate renew request. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param key_size: Certificate Key Size. + :type key_size: int + :param csr: Csr to be used for re-key operation. + :type csr: str + :param is_private_key_external: Should we change the ASC type (from managed private key to + external private key and vice versa). + :type is_private_key_external: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'key_size': {'key': 'properties.keySize', 'type': 'int'}, + 'csr': {'key': 'properties.csr', 'type': 'str'}, + 'is_private_key_external': {'key': 'properties.isPrivateKeyExternal', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(RenewCertificateOrderRequest, self).__init__(**kwargs) + self.key_size = kwargs.get('key_size', None) + self.csr = kwargs.get('csr', None) + self.is_private_key_external = kwargs.get('is_private_key_external', None) + + +class RequestsBasedTrigger(msrest.serialization.Model): + """Trigger based on total requests. + + :param count: Request Count. + :type count: int + :param time_interval: Time interval. + :type time_interval: str + """ + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + 'time_interval': {'key': 'timeInterval', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RequestsBasedTrigger, self).__init__(**kwargs) + self.count = kwargs.get('count', None) + self.time_interval = kwargs.get('time_interval', None) + + +class ResourceCollection(msrest.serialization.Model): + """Collection of resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[str] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[str]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class ResourceHealthMetadata(ProxyOnlyResource): + """Used for getting ResourceHealthCheck settings. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param category: The category that the resource matches in the RHC Policy File. + :type category: str + :param signal_availability: Is there a health signal for the resource. + :type signal_availability: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'category': {'key': 'properties.category', 'type': 'str'}, + 'signal_availability': {'key': 'properties.signalAvailability', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceHealthMetadata, self).__init__(**kwargs) + self.category = kwargs.get('category', None) + self.signal_availability = kwargs.get('signal_availability', None) + + +class ResourceHealthMetadataCollection(msrest.serialization.Model): + """Collection of resource health metadata. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.ResourceHealthMetadata] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ResourceHealthMetadata]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceHealthMetadataCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class ResourceMetricAvailability(msrest.serialization.Model): + """Metrics availability and retention. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar time_grain: Time grain . + :vartype time_grain: str + :ivar retention: Retention period for the current time grain. + :vartype retention: str + """ + + _validation = { + 'time_grain': {'readonly': True}, + 'retention': {'readonly': True}, + } + + _attribute_map = { + 'time_grain': {'key': 'timeGrain', 'type': 'str'}, + 'retention': {'key': 'retention', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceMetricAvailability, self).__init__(**kwargs) + self.time_grain = None + self.retention = None + + +class ResourceMetricDefinition(ProxyOnlyResource): + """Metadata for the metrics. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar unit: Unit of the metric. + :vartype unit: str + :ivar primary_aggregation_type: Primary aggregation type. + :vartype primary_aggregation_type: str + :ivar metric_availabilities: List of time grains supported for the metric together with + retention period. + :vartype metric_availabilities: + list[~azure.mgmt.web.v2021_02_01.models.ResourceMetricAvailability] + :ivar resource_uri: Resource URI. + :vartype resource_uri: str + :ivar properties: Resource metric definition properties. + :vartype properties: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'unit': {'readonly': True}, + 'primary_aggregation_type': {'readonly': True}, + 'metric_availabilities': {'readonly': True}, + 'resource_uri': {'readonly': True}, + 'properties': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'unit': {'key': 'properties.unit', 'type': 'str'}, + 'primary_aggregation_type': {'key': 'properties.primaryAggregationType', 'type': 'str'}, + 'metric_availabilities': {'key': 'properties.metricAvailabilities', 'type': '[ResourceMetricAvailability]'}, + 'resource_uri': {'key': 'properties.resourceUri', 'type': 'str'}, + 'properties': {'key': 'properties.properties', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceMetricDefinition, self).__init__(**kwargs) + self.unit = None + self.primary_aggregation_type = None + self.metric_availabilities = None + self.resource_uri = None + self.properties = None + + +class ResourceMetricDefinitionCollection(msrest.serialization.Model): + """Collection of metric definitions. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.ResourceMetricDefinition] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ResourceMetricDefinition]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceMetricDefinitionCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class ResourceNameAvailability(msrest.serialization.Model): + """Information regarding availability of a resource name. + + :param name_available: :code:`true` indicates name is valid and available. + :code:`false` indicates the name is invalid, unavailable, or both. + :type name_available: bool + :param reason: :code:`Invalid` indicates the name provided does not match Azure + App Service naming requirements. :code:`AlreadyExists` indicates that the name is + already in use and is therefore unavailable. Possible values include: "Invalid", + "AlreadyExists". + :type reason: str or ~azure.mgmt.web.v2021_02_01.models.InAvailabilityReasonType + :param message: If reason == invalid, provide the user with the reason why the given name is + invalid, and provide the resource naming requirements so that the user can select a valid name. + If reason == AlreadyExists, explain that resource name is already in use, and direct them to + select a different name. + :type message: str + """ + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceNameAvailability, self).__init__(**kwargs) + self.name_available = kwargs.get('name_available', None) + self.reason = kwargs.get('reason', None) + self.message = kwargs.get('message', None) + + +class ResourceNameAvailabilityRequest(msrest.serialization.Model): + """Resource name availability request content. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Resource name to verify. + :type name: str + :param type: Required. Resource type used for verification. Possible values include: "Site", + "Slot", "HostingEnvironment", "PublishingUser", "Microsoft.Web/sites", + "Microsoft.Web/sites/slots", "Microsoft.Web/hostingEnvironments", + "Microsoft.Web/publishingUsers". + :type type: str or ~azure.mgmt.web.v2021_02_01.models.CheckNameResourceTypes + :param is_fqdn: Is fully qualified domain name. + :type is_fqdn: bool + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'is_fqdn': {'key': 'isFqdn', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceNameAvailabilityRequest, self).__init__(**kwargs) + self.name = kwargs['name'] + self.type = kwargs['type'] + self.is_fqdn = kwargs.get('is_fqdn', None) + + +class ResponseMessageEnvelopeRemotePrivateEndpointConnection(msrest.serialization.Model): + """Message envelope that contains the common Azure resource manager properties and the resource provider specific content. + + :param id: Resource Id. Typically ID is populated only for responses to GET requests. Caller is + responsible for passing in this + value for GET requests only. + For example: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupId}/providers/Microsoft.Web/sites/{sitename}. + :type id: str + :param name: Name of resource. + :type name: str + :param type: Type of resource e.g "Microsoft.Web/sites". + :type type: str + :param location: Geographical region resource belongs to e.g. SouthCentralUS, SouthEastAsia. + :type location: str + :param tags: A set of tags. Tags associated with resource. + :type tags: dict[str, str] + :param plan: Azure resource manager plan. + :type plan: ~azure.mgmt.web.v2021_02_01.models.ArmPlan + :param properties: Resource specific properties. + :type properties: ~azure.mgmt.web.v2021_02_01.models.RemotePrivateEndpointConnection + :param sku: SKU description of the resource. + :type sku: ~azure.mgmt.web.v2021_02_01.models.SkuDescription + :param status: Azure-AsyncOperation Status info. + :type status: str + :param error: Azure-AsyncOperation Error info. + :type error: ~azure.mgmt.web.v2021_02_01.models.ErrorEntity + :param identity: MSI resource. + :type identity: ~azure.mgmt.web.v2021_02_01.models.ManagedServiceIdentity + :param zones: Logical Availability Zones the service is hosted in. + :type zones: list[str] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'plan': {'key': 'plan', 'type': 'ArmPlan'}, + 'properties': {'key': 'properties', 'type': 'RemotePrivateEndpointConnection'}, + 'sku': {'key': 'sku', 'type': 'SkuDescription'}, + 'status': {'key': 'status', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'ErrorEntity'}, + 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(ResponseMessageEnvelopeRemotePrivateEndpointConnection, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.plan = kwargs.get('plan', None) + self.properties = kwargs.get('properties', None) + self.sku = kwargs.get('sku', None) + self.status = kwargs.get('status', None) + self.error = kwargs.get('error', None) + self.identity = kwargs.get('identity', None) + self.zones = kwargs.get('zones', None) + + +class ResponseMetaData(msrest.serialization.Model): + """ResponseMetaData. + + :param data_source: Source of the Data. + :type data_source: ~azure.mgmt.web.v2021_02_01.models.DataSource + """ + + _attribute_map = { + 'data_source': {'key': 'dataSource', 'type': 'DataSource'}, + } + + def __init__( + self, + **kwargs + ): + super(ResponseMetaData, self).__init__(**kwargs) + self.data_source = kwargs.get('data_source', None) + + +class RestoreRequest(ProxyOnlyResource): + """Description of a restore request. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param storage_account_url: SAS URL to the container. + :type storage_account_url: str + :param blob_name: Name of a blob which contains the backup. + :type blob_name: str + :param overwrite: :code:`true` if the restore operation can overwrite target app; + otherwise, :code:`false`. :code:`true` is needed if trying to restore + over an existing app. + :type overwrite: bool + :param site_name: Name of an app. + :type site_name: str + :param databases: Collection of databases which should be restored. This list has to match the + list of databases included in the backup. + :type databases: list[~azure.mgmt.web.v2021_02_01.models.DatabaseBackupSetting] + :param ignore_conflicting_host_names: Changes a logic when restoring an app with custom + domains. :code:`true` to remove custom domains automatically. If + :code:`false`, custom domains are added to + the app's object when it is being restored, but that might fail due to conflicts during the + operation. + :type ignore_conflicting_host_names: bool + :param ignore_databases: Ignore the databases and only restore the site content. + :type ignore_databases: bool + :param app_service_plan: Specify app service plan that will own restored site. + :type app_service_plan: str + :param operation_type: Operation type. Possible values include: "Default", "Clone", + "Relocation", "Snapshot", "CloudFS". Default value: "Default". + :type operation_type: str or ~azure.mgmt.web.v2021_02_01.models.BackupRestoreOperationType + :param adjust_connection_strings: :code:`true` if SiteConfig.ConnectionStrings + should be set in new app; otherwise, :code:`false`. + :type adjust_connection_strings: bool + :param hosting_environment: App Service Environment name, if needed (only when restoring an app + to an App Service Environment). + :type hosting_environment: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'storage_account_url': {'key': 'properties.storageAccountUrl', 'type': 'str'}, + 'blob_name': {'key': 'properties.blobName', 'type': 'str'}, + 'overwrite': {'key': 'properties.overwrite', 'type': 'bool'}, + 'site_name': {'key': 'properties.siteName', 'type': 'str'}, + 'databases': {'key': 'properties.databases', 'type': '[DatabaseBackupSetting]'}, + 'ignore_conflicting_host_names': {'key': 'properties.ignoreConflictingHostNames', 'type': 'bool'}, + 'ignore_databases': {'key': 'properties.ignoreDatabases', 'type': 'bool'}, + 'app_service_plan': {'key': 'properties.appServicePlan', 'type': 'str'}, + 'operation_type': {'key': 'properties.operationType', 'type': 'str'}, + 'adjust_connection_strings': {'key': 'properties.adjustConnectionStrings', 'type': 'bool'}, + 'hosting_environment': {'key': 'properties.hostingEnvironment', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RestoreRequest, self).__init__(**kwargs) + self.storage_account_url = kwargs.get('storage_account_url', None) + self.blob_name = kwargs.get('blob_name', None) + self.overwrite = kwargs.get('overwrite', None) + self.site_name = kwargs.get('site_name', None) + self.databases = kwargs.get('databases', None) + self.ignore_conflicting_host_names = kwargs.get('ignore_conflicting_host_names', False) + self.ignore_databases = kwargs.get('ignore_databases', False) + self.app_service_plan = kwargs.get('app_service_plan', None) + self.operation_type = kwargs.get('operation_type', "Default") + self.adjust_connection_strings = kwargs.get('adjust_connection_strings', None) + self.hosting_environment = kwargs.get('hosting_environment', None) + + +class SampleUtterance(msrest.serialization.Model): + """Sample utterance. + + :param text: Text attribute of sample utterance. + :type text: str + :param links: Links attribute of sample utterance. + :type links: list[str] + :param qid: Question id of sample utterance (for stackoverflow questions titles). + :type qid: str + """ + + _attribute_map = { + 'text': {'key': 'text', 'type': 'str'}, + 'links': {'key': 'links', 'type': '[str]'}, + 'qid': {'key': 'qid', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SampleUtterance, self).__init__(**kwargs) + self.text = kwargs.get('text', None) + self.links = kwargs.get('links', None) + self.qid = kwargs.get('qid', None) + + +class ServiceSpecification(msrest.serialization.Model): + """Resource metrics service provided by Microsoft.Insights resource provider. + + :param metric_specifications: + :type metric_specifications: list[~azure.mgmt.web.v2021_02_01.models.MetricSpecification] + :param log_specifications: + :type log_specifications: list[~azure.mgmt.web.v2021_02_01.models.LogSpecification] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + 'log_specifications': {'key': 'logSpecifications', 'type': '[LogSpecification]'}, + } + + def __init__( + self, + **kwargs + ): + super(ServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = kwargs.get('metric_specifications', None) + self.log_specifications = kwargs.get('log_specifications', None) + + +class Site(Resource): + """A web app, a mobile app backend, or an API app. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param identity: Managed service identity. + :type identity: ~azure.mgmt.web.v2021_02_01.models.ManagedServiceIdentity + :param extended_location: Extended Location. + :type extended_location: ~azure.mgmt.web.v2021_02_01.models.ExtendedLocation + :ivar state: Current state of the app. + :vartype state: str + :ivar host_names: Hostnames associated with the app. + :vartype host_names: list[str] + :ivar repository_site_name: Name of the repository site. + :vartype repository_site_name: str + :ivar usage_state: State indicating whether the app has exceeded its quota usage. Read-only. + Possible values include: "Normal", "Exceeded". + :vartype usage_state: str or ~azure.mgmt.web.v2021_02_01.models.UsageState + :param enabled: :code:`true` if the app is enabled; otherwise, + :code:`false`. Setting this value to false disables the app (takes the app + offline). + :type enabled: bool + :ivar enabled_host_names: Enabled hostnames for the app.Hostnames need to be assigned (see + HostNames) AND enabled. Otherwise, + the app is not served on those hostnames. + :vartype enabled_host_names: list[str] + :ivar availability_state: Management information availability state for the app. Possible + values include: "Normal", "Limited", "DisasterRecoveryMode". + :vartype availability_state: str or ~azure.mgmt.web.v2021_02_01.models.SiteAvailabilityState + :param host_name_ssl_states: Hostname SSL states are used to manage the SSL bindings for app's + hostnames. + :type host_name_ssl_states: list[~azure.mgmt.web.v2021_02_01.models.HostNameSslState] + :param server_farm_id: Resource ID of the associated App Service plan, formatted as: + "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + :type server_farm_id: str + :param reserved: :code:`true` if reserved; otherwise, :code:`false`. + :type reserved: bool + :param is_xenon: Obsolete: Hyper-V sandbox. + :type is_xenon: bool + :param hyper_v: Hyper-V sandbox. + :type hyper_v: bool + :ivar last_modified_time_utc: Last time the app was modified, in UTC. Read-only. + :vartype last_modified_time_utc: ~datetime.datetime + :param site_config: Configuration of the app. + :type site_config: ~azure.mgmt.web.v2021_02_01.models.SiteConfig + :ivar traffic_manager_host_names: Azure Traffic Manager hostnames associated with the app. + Read-only. + :vartype traffic_manager_host_names: list[str] + :param scm_site_also_stopped: :code:`true` to stop SCM (KUDU) site when the app is + stopped; otherwise, :code:`false`. The default is :code:`false`. + :type scm_site_also_stopped: bool + :ivar target_swap_slot: Specifies which deployment slot this app will swap into. Read-only. + :vartype target_swap_slot: str + :param hosting_environment_profile: App Service Environment to use for the app. + :type hosting_environment_profile: ~azure.mgmt.web.v2021_02_01.models.HostingEnvironmentProfile + :param client_affinity_enabled: :code:`true` to enable client affinity; + :code:`false` to stop sending session affinity cookies, which route client + requests in the same session to the same instance. Default is :code:`true`. + :type client_affinity_enabled: bool + :param client_cert_enabled: :code:`true` to enable client certificate + authentication (TLS mutual authentication); otherwise, :code:`false`. Default is + :code:`false`. + :type client_cert_enabled: bool + :param client_cert_mode: This composes with ClientCertEnabled setting. + + + * ClientCertEnabled: false means ClientCert is ignored. + * ClientCertEnabled: true and ClientCertMode: Required means ClientCert is required. + * ClientCertEnabled: true and ClientCertMode: Optional means ClientCert is optional or + accepted. Possible values include: "Required", "Optional", "OptionalInteractiveUser". + :type client_cert_mode: str or ~azure.mgmt.web.v2021_02_01.models.ClientCertMode + :param client_cert_exclusion_paths: client certificate authentication comma-separated exclusion + paths. + :type client_cert_exclusion_paths: str + :param host_names_disabled: :code:`true` to disable the public hostnames of the + app; otherwise, :code:`false`. + If :code:`true`, the app is only accessible via API management process. + :type host_names_disabled: bool + :param custom_domain_verification_id: Unique identifier that verifies the custom domains + assigned to the app. Customer will add this id to a txt record for verification. + :type custom_domain_verification_id: str + :ivar outbound_ip_addresses: List of IP addresses that the app uses for outbound connections + (e.g. database access). Includes VIPs from tenants that site can be hosted with current + settings. Read-only. + :vartype outbound_ip_addresses: str + :ivar possible_outbound_ip_addresses: List of IP addresses that the app uses for outbound + connections (e.g. database access). Includes VIPs from all tenants except dataComponent. + Read-only. + :vartype possible_outbound_ip_addresses: str + :param container_size: Size of the function container. + :type container_size: int + :param daily_memory_time_quota: Maximum allowed daily memory-time quota (applicable on dynamic + apps only). + :type daily_memory_time_quota: int + :ivar suspended_till: App suspended till in case memory-time quota is exceeded. + :vartype suspended_till: ~datetime.datetime + :ivar max_number_of_workers: Maximum number of workers. + This only applies to Functions container. + :vartype max_number_of_workers: int + :param cloning_info: If specified during app creation, the app is cloned from a source app. + :type cloning_info: ~azure.mgmt.web.v2021_02_01.models.CloningInfo + :ivar resource_group: Name of the resource group the app belongs to. Read-only. + :vartype resource_group: str + :ivar is_default_container: :code:`true` if the app is a default container; + otherwise, :code:`false`. + :vartype is_default_container: bool + :ivar default_host_name: Default hostname of the app. Read-only. + :vartype default_host_name: str + :ivar slot_swap_status: Status of the last deployment slot swap operation. + :vartype slot_swap_status: ~azure.mgmt.web.v2021_02_01.models.SlotSwapStatus + :param https_only: HttpsOnly: configures a web site to accept only https requests. Issues + redirect for + http requests. + :type https_only: bool + :param redundancy_mode: Site redundancy mode. Possible values include: "None", "Manual", + "Failover", "ActiveActive", "GeoRedundant". + :type redundancy_mode: str or ~azure.mgmt.web.v2021_02_01.models.RedundancyMode + :ivar in_progress_operation_id: Specifies an operation id if this site has a pending operation. + :vartype in_progress_operation_id: str + :param storage_account_required: Checks if Customer provided storage account is required. + :type storage_account_required: bool + :param key_vault_reference_identity: Identity to use for Key Vault Reference authentication. + :type key_vault_reference_identity: str + :param virtual_network_subnet_id: Azure Resource Manager ID of the Virtual network and subnet + to be joined by Regional VNET Integration. + This must be of the form + /subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + :type virtual_network_subnet_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'state': {'readonly': True}, + 'host_names': {'readonly': True}, + 'repository_site_name': {'readonly': True}, + 'usage_state': {'readonly': True}, + 'enabled_host_names': {'readonly': True}, + 'availability_state': {'readonly': True}, + 'last_modified_time_utc': {'readonly': True}, + 'traffic_manager_host_names': {'readonly': True}, + 'target_swap_slot': {'readonly': True}, + 'outbound_ip_addresses': {'readonly': True}, + 'possible_outbound_ip_addresses': {'readonly': True}, + 'suspended_till': {'readonly': True}, + 'max_number_of_workers': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'is_default_container': {'readonly': True}, + 'default_host_name': {'readonly': True}, + 'slot_swap_status': {'readonly': True}, + 'in_progress_operation_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'host_names': {'key': 'properties.hostNames', 'type': '[str]'}, + 'repository_site_name': {'key': 'properties.repositorySiteName', 'type': 'str'}, + 'usage_state': {'key': 'properties.usageState', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'enabled_host_names': {'key': 'properties.enabledHostNames', 'type': '[str]'}, + 'availability_state': {'key': 'properties.availabilityState', 'type': 'str'}, + 'host_name_ssl_states': {'key': 'properties.hostNameSslStates', 'type': '[HostNameSslState]'}, + 'server_farm_id': {'key': 'properties.serverFarmId', 'type': 'str'}, + 'reserved': {'key': 'properties.reserved', 'type': 'bool'}, + 'is_xenon': {'key': 'properties.isXenon', 'type': 'bool'}, + 'hyper_v': {'key': 'properties.hyperV', 'type': 'bool'}, + 'last_modified_time_utc': {'key': 'properties.lastModifiedTimeUtc', 'type': 'iso-8601'}, + 'site_config': {'key': 'properties.siteConfig', 'type': 'SiteConfig'}, + 'traffic_manager_host_names': {'key': 'properties.trafficManagerHostNames', 'type': '[str]'}, + 'scm_site_also_stopped': {'key': 'properties.scmSiteAlsoStopped', 'type': 'bool'}, + 'target_swap_slot': {'key': 'properties.targetSwapSlot', 'type': 'str'}, + 'hosting_environment_profile': {'key': 'properties.hostingEnvironmentProfile', 'type': 'HostingEnvironmentProfile'}, + 'client_affinity_enabled': {'key': 'properties.clientAffinityEnabled', 'type': 'bool'}, + 'client_cert_enabled': {'key': 'properties.clientCertEnabled', 'type': 'bool'}, + 'client_cert_mode': {'key': 'properties.clientCertMode', 'type': 'str'}, + 'client_cert_exclusion_paths': {'key': 'properties.clientCertExclusionPaths', 'type': 'str'}, + 'host_names_disabled': {'key': 'properties.hostNamesDisabled', 'type': 'bool'}, + 'custom_domain_verification_id': {'key': 'properties.customDomainVerificationId', 'type': 'str'}, + 'outbound_ip_addresses': {'key': 'properties.outboundIpAddresses', 'type': 'str'}, + 'possible_outbound_ip_addresses': {'key': 'properties.possibleOutboundIpAddresses', 'type': 'str'}, + 'container_size': {'key': 'properties.containerSize', 'type': 'int'}, + 'daily_memory_time_quota': {'key': 'properties.dailyMemoryTimeQuota', 'type': 'int'}, + 'suspended_till': {'key': 'properties.suspendedTill', 'type': 'iso-8601'}, + 'max_number_of_workers': {'key': 'properties.maxNumberOfWorkers', 'type': 'int'}, + 'cloning_info': {'key': 'properties.cloningInfo', 'type': 'CloningInfo'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'is_default_container': {'key': 'properties.isDefaultContainer', 'type': 'bool'}, + 'default_host_name': {'key': 'properties.defaultHostName', 'type': 'str'}, + 'slot_swap_status': {'key': 'properties.slotSwapStatus', 'type': 'SlotSwapStatus'}, + 'https_only': {'key': 'properties.httpsOnly', 'type': 'bool'}, + 'redundancy_mode': {'key': 'properties.redundancyMode', 'type': 'str'}, + 'in_progress_operation_id': {'key': 'properties.inProgressOperationId', 'type': 'str'}, + 'storage_account_required': {'key': 'properties.storageAccountRequired', 'type': 'bool'}, + 'key_vault_reference_identity': {'key': 'properties.keyVaultReferenceIdentity', 'type': 'str'}, + 'virtual_network_subnet_id': {'key': 'properties.virtualNetworkSubnetId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Site, self).__init__(**kwargs) + self.identity = kwargs.get('identity', None) + self.extended_location = kwargs.get('extended_location', None) + self.state = None + self.host_names = None + self.repository_site_name = None + self.usage_state = None + self.enabled = kwargs.get('enabled', None) + self.enabled_host_names = None + self.availability_state = None + self.host_name_ssl_states = kwargs.get('host_name_ssl_states', None) + self.server_farm_id = kwargs.get('server_farm_id', None) + self.reserved = kwargs.get('reserved', False) + self.is_xenon = kwargs.get('is_xenon', False) + self.hyper_v = kwargs.get('hyper_v', False) + self.last_modified_time_utc = None + self.site_config = kwargs.get('site_config', None) + self.traffic_manager_host_names = None + self.scm_site_also_stopped = kwargs.get('scm_site_also_stopped', False) + self.target_swap_slot = None + self.hosting_environment_profile = kwargs.get('hosting_environment_profile', None) + self.client_affinity_enabled = kwargs.get('client_affinity_enabled', None) + self.client_cert_enabled = kwargs.get('client_cert_enabled', None) + self.client_cert_mode = kwargs.get('client_cert_mode', None) + self.client_cert_exclusion_paths = kwargs.get('client_cert_exclusion_paths', None) + self.host_names_disabled = kwargs.get('host_names_disabled', None) + self.custom_domain_verification_id = kwargs.get('custom_domain_verification_id', None) + self.outbound_ip_addresses = None + self.possible_outbound_ip_addresses = None + self.container_size = kwargs.get('container_size', None) + self.daily_memory_time_quota = kwargs.get('daily_memory_time_quota', None) + self.suspended_till = None + self.max_number_of_workers = None + self.cloning_info = kwargs.get('cloning_info', None) + self.resource_group = None + self.is_default_container = None + self.default_host_name = None + self.slot_swap_status = None + self.https_only = kwargs.get('https_only', None) + self.redundancy_mode = kwargs.get('redundancy_mode', None) + self.in_progress_operation_id = None + self.storage_account_required = kwargs.get('storage_account_required', None) + self.key_vault_reference_identity = kwargs.get('key_vault_reference_identity', None) + self.virtual_network_subnet_id = kwargs.get('virtual_network_subnet_id', None) + + +class SiteAuthSettings(ProxyOnlyResource): + """Configuration settings for the Azure App Service Authentication / Authorization feature. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param enabled: :code:`true` if the Authentication / Authorization feature is + enabled for the current app; otherwise, :code:`false`. + :type enabled: bool + :param runtime_version: The RuntimeVersion of the Authentication / Authorization feature in use + for the current app. + The setting in this value can control the behavior of certain features in the Authentication / + Authorization module. + :type runtime_version: str + :param unauthenticated_client_action: The action to take when an unauthenticated client + attempts to access the app. Possible values include: "RedirectToLoginPage", "AllowAnonymous". + :type unauthenticated_client_action: str or + ~azure.mgmt.web.v2021_02_01.models.UnauthenticatedClientAction + :param token_store_enabled: :code:`true` to durably store platform-specific + security tokens that are obtained during login flows; otherwise, :code:`false`. + The default is :code:`false`. + :type token_store_enabled: bool + :param allowed_external_redirect_urls: External URLs that can be redirected to as part of + logging in or logging out of the app. Note that the query string part of the URL is ignored. + This is an advanced setting typically only needed by Windows Store application backends. + Note that URLs within the current domain are always implicitly allowed. + :type allowed_external_redirect_urls: list[str] + :param default_provider: The default authentication provider to use when multiple providers are + configured. + This setting is only needed if multiple providers are configured and the unauthenticated + client + action is set to "RedirectToLoginPage". Possible values include: "AzureActiveDirectory", + "Facebook", "Google", "MicrosoftAccount", "Twitter", "Github". + :type default_provider: str or ~azure.mgmt.web.v2021_02_01.models.BuiltInAuthenticationProvider + :param token_refresh_extension_hours: The number of hours after session token expiration that a + session token can be used to + call the token refresh API. The default is 72 hours. + :type token_refresh_extension_hours: float + :param client_id: The Client ID of this relying party application, known as the client_id. + This setting is required for enabling OpenID Connection authentication with Azure Active + Directory or + other 3rd party OpenID Connect providers. + More information on OpenID Connect: http://openid.net/specs/openid-connect-core-1_0.html. + :type client_id: str + :param client_secret: The Client Secret of this relying party application (in Azure Active + Directory, this is also referred to as the Key). + This setting is optional. If no client secret is configured, the OpenID Connect implicit auth + flow is used to authenticate end users. + Otherwise, the OpenID Connect Authorization Code Flow is used to authenticate end users. + More information on OpenID Connect: http://openid.net/specs/openid-connect-core-1_0.html. + :type client_secret: str + :param client_secret_setting_name: The app setting name that contains the client secret of the + relying party application. + :type client_secret_setting_name: str + :param client_secret_certificate_thumbprint: An alternative to the client secret, that is the + thumbprint of a certificate used for signing purposes. This property acts as + a replacement for the Client Secret. It is also optional. + :type client_secret_certificate_thumbprint: str + :param issuer: The OpenID Connect Issuer URI that represents the entity which issues access + tokens for this application. + When using Azure Active Directory, this value is the URI of the directory tenant, e.g. + https://sts.windows.net/{tenant-guid}/. + This URI is a case-sensitive identifier for the token issuer. + More information on OpenID Connect Discovery: + http://openid.net/specs/openid-connect-discovery-1_0.html. + :type issuer: str + :param validate_issuer: Gets a value indicating whether the issuer should be a valid HTTPS url + and be validated as such. + :type validate_issuer: bool + :param allowed_audiences: Allowed audience values to consider when validating JWTs issued by + Azure Active Directory. Note that the :code:`ClientID` value is always considered + an + allowed audience, regardless of this setting. + :type allowed_audiences: list[str] + :param additional_login_params: Login parameters to send to the OpenID Connect authorization + endpoint when + a user logs in. Each parameter must be in the form "key=value". + :type additional_login_params: list[str] + :param aad_claims_authorization: Gets a JSON string containing the Azure AD Acl settings. + :type aad_claims_authorization: str + :param google_client_id: The OpenID Connect Client ID for the Google web application. + This setting is required for enabling Google Sign-In. + Google Sign-In documentation: https://developers.google.com/identity/sign-in/web/. + :type google_client_id: str + :param google_client_secret: The client secret associated with the Google web application. + This setting is required for enabling Google Sign-In. + Google Sign-In documentation: https://developers.google.com/identity/sign-in/web/. + :type google_client_secret: str + :param google_client_secret_setting_name: The app setting name that contains the client secret + associated with + the Google web application. + :type google_client_secret_setting_name: str + :param google_o_auth_scopes: The OAuth 2.0 scopes that will be requested as part of Google + Sign-In authentication. + This setting is optional. If not specified, "openid", "profile", and "email" are used as + default scopes. + Google Sign-In documentation: https://developers.google.com/identity/sign-in/web/. + :type google_o_auth_scopes: list[str] + :param facebook_app_id: The App ID of the Facebook app used for login. + This setting is required for enabling Facebook Login. + Facebook Login documentation: https://developers.facebook.com/docs/facebook-login. + :type facebook_app_id: str + :param facebook_app_secret: The App Secret of the Facebook app used for Facebook Login. + This setting is required for enabling Facebook Login. + Facebook Login documentation: https://developers.facebook.com/docs/facebook-login. + :type facebook_app_secret: str + :param facebook_app_secret_setting_name: The app setting name that contains the app secret used + for Facebook Login. + :type facebook_app_secret_setting_name: str + :param facebook_o_auth_scopes: The OAuth 2.0 scopes that will be requested as part of Facebook + Login authentication. + This setting is optional. + Facebook Login documentation: https://developers.facebook.com/docs/facebook-login. + :type facebook_o_auth_scopes: list[str] + :param git_hub_client_id: The Client Id of the GitHub app used for login. + This setting is required for enabling Github login. + :type git_hub_client_id: str + :param git_hub_client_secret: The Client Secret of the GitHub app used for Github Login. + This setting is required for enabling Github login. + :type git_hub_client_secret: str + :param git_hub_client_secret_setting_name: The app setting name that contains the client secret + of the Github + app used for GitHub Login. + :type git_hub_client_secret_setting_name: str + :param git_hub_o_auth_scopes: The OAuth 2.0 scopes that will be requested as part of GitHub + Login authentication. + This setting is optional. + :type git_hub_o_auth_scopes: list[str] + :param twitter_consumer_key: The OAuth 1.0a consumer key of the Twitter application used for + sign-in. + This setting is required for enabling Twitter Sign-In. + Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in. + :type twitter_consumer_key: str + :param twitter_consumer_secret: The OAuth 1.0a consumer secret of the Twitter application used + for sign-in. + This setting is required for enabling Twitter Sign-In. + Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in. + :type twitter_consumer_secret: str + :param twitter_consumer_secret_setting_name: The app setting name that contains the OAuth 1.0a + consumer secret of the Twitter + application used for sign-in. + :type twitter_consumer_secret_setting_name: str + :param microsoft_account_client_id: The OAuth 2.0 client ID that was created for the app used + for authentication. + This setting is required for enabling Microsoft Account authentication. + Microsoft Account OAuth documentation: https://dev.onedrive.com/auth/msa_oauth.htm. + :type microsoft_account_client_id: str + :param microsoft_account_client_secret: The OAuth 2.0 client secret that was created for the + app used for authentication. + This setting is required for enabling Microsoft Account authentication. + Microsoft Account OAuth documentation: https://dev.onedrive.com/auth/msa_oauth.htm. + :type microsoft_account_client_secret: str + :param microsoft_account_client_secret_setting_name: The app setting name containing the OAuth + 2.0 client secret that was created for the + app used for authentication. + :type microsoft_account_client_secret_setting_name: str + :param microsoft_account_o_auth_scopes: The OAuth 2.0 scopes that will be requested as part of + Microsoft Account authentication. + This setting is optional. If not specified, "wl.basic" is used as the default scope. + Microsoft Account Scopes and permissions documentation: + https://msdn.microsoft.com/en-us/library/dn631845.aspx. + :type microsoft_account_o_auth_scopes: list[str] + :param is_auth_from_file: "true" if the auth config settings should be read from a file, + "false" otherwise. + :type is_auth_from_file: str + :param auth_file_path: The path of the config file containing auth settings. + If the path is relative, base will the site's root directory. + :type auth_file_path: str + :param config_version: The ConfigVersion of the Authentication / Authorization feature in use + for the current app. + The setting in this value can control the behavior of the control plane for Authentication / + Authorization. + :type config_version: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'runtime_version': {'key': 'properties.runtimeVersion', 'type': 'str'}, + 'unauthenticated_client_action': {'key': 'properties.unauthenticatedClientAction', 'type': 'str'}, + 'token_store_enabled': {'key': 'properties.tokenStoreEnabled', 'type': 'bool'}, + 'allowed_external_redirect_urls': {'key': 'properties.allowedExternalRedirectUrls', 'type': '[str]'}, + 'default_provider': {'key': 'properties.defaultProvider', 'type': 'str'}, + 'token_refresh_extension_hours': {'key': 'properties.tokenRefreshExtensionHours', 'type': 'float'}, + 'client_id': {'key': 'properties.clientId', 'type': 'str'}, + 'client_secret': {'key': 'properties.clientSecret', 'type': 'str'}, + 'client_secret_setting_name': {'key': 'properties.clientSecretSettingName', 'type': 'str'}, + 'client_secret_certificate_thumbprint': {'key': 'properties.clientSecretCertificateThumbprint', 'type': 'str'}, + 'issuer': {'key': 'properties.issuer', 'type': 'str'}, + 'validate_issuer': {'key': 'properties.validateIssuer', 'type': 'bool'}, + 'allowed_audiences': {'key': 'properties.allowedAudiences', 'type': '[str]'}, + 'additional_login_params': {'key': 'properties.additionalLoginParams', 'type': '[str]'}, + 'aad_claims_authorization': {'key': 'properties.aadClaimsAuthorization', 'type': 'str'}, + 'google_client_id': {'key': 'properties.googleClientId', 'type': 'str'}, + 'google_client_secret': {'key': 'properties.googleClientSecret', 'type': 'str'}, + 'google_client_secret_setting_name': {'key': 'properties.googleClientSecretSettingName', 'type': 'str'}, + 'google_o_auth_scopes': {'key': 'properties.googleOAuthScopes', 'type': '[str]'}, + 'facebook_app_id': {'key': 'properties.facebookAppId', 'type': 'str'}, + 'facebook_app_secret': {'key': 'properties.facebookAppSecret', 'type': 'str'}, + 'facebook_app_secret_setting_name': {'key': 'properties.facebookAppSecretSettingName', 'type': 'str'}, + 'facebook_o_auth_scopes': {'key': 'properties.facebookOAuthScopes', 'type': '[str]'}, + 'git_hub_client_id': {'key': 'properties.gitHubClientId', 'type': 'str'}, + 'git_hub_client_secret': {'key': 'properties.gitHubClientSecret', 'type': 'str'}, + 'git_hub_client_secret_setting_name': {'key': 'properties.gitHubClientSecretSettingName', 'type': 'str'}, + 'git_hub_o_auth_scopes': {'key': 'properties.gitHubOAuthScopes', 'type': '[str]'}, + 'twitter_consumer_key': {'key': 'properties.twitterConsumerKey', 'type': 'str'}, + 'twitter_consumer_secret': {'key': 'properties.twitterConsumerSecret', 'type': 'str'}, + 'twitter_consumer_secret_setting_name': {'key': 'properties.twitterConsumerSecretSettingName', 'type': 'str'}, + 'microsoft_account_client_id': {'key': 'properties.microsoftAccountClientId', 'type': 'str'}, + 'microsoft_account_client_secret': {'key': 'properties.microsoftAccountClientSecret', 'type': 'str'}, + 'microsoft_account_client_secret_setting_name': {'key': 'properties.microsoftAccountClientSecretSettingName', 'type': 'str'}, + 'microsoft_account_o_auth_scopes': {'key': 'properties.microsoftAccountOAuthScopes', 'type': '[str]'}, + 'is_auth_from_file': {'key': 'properties.isAuthFromFile', 'type': 'str'}, + 'auth_file_path': {'key': 'properties.authFilePath', 'type': 'str'}, + 'config_version': {'key': 'properties.configVersion', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SiteAuthSettings, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.runtime_version = kwargs.get('runtime_version', None) + self.unauthenticated_client_action = kwargs.get('unauthenticated_client_action', None) + self.token_store_enabled = kwargs.get('token_store_enabled', None) + self.allowed_external_redirect_urls = kwargs.get('allowed_external_redirect_urls', None) + self.default_provider = kwargs.get('default_provider', None) + self.token_refresh_extension_hours = kwargs.get('token_refresh_extension_hours', None) + self.client_id = kwargs.get('client_id', None) + self.client_secret = kwargs.get('client_secret', None) + self.client_secret_setting_name = kwargs.get('client_secret_setting_name', None) + self.client_secret_certificate_thumbprint = kwargs.get('client_secret_certificate_thumbprint', None) + self.issuer = kwargs.get('issuer', None) + self.validate_issuer = kwargs.get('validate_issuer', None) + self.allowed_audiences = kwargs.get('allowed_audiences', None) + self.additional_login_params = kwargs.get('additional_login_params', None) + self.aad_claims_authorization = kwargs.get('aad_claims_authorization', None) + self.google_client_id = kwargs.get('google_client_id', None) + self.google_client_secret = kwargs.get('google_client_secret', None) + self.google_client_secret_setting_name = kwargs.get('google_client_secret_setting_name', None) + self.google_o_auth_scopes = kwargs.get('google_o_auth_scopes', None) + self.facebook_app_id = kwargs.get('facebook_app_id', None) + self.facebook_app_secret = kwargs.get('facebook_app_secret', None) + self.facebook_app_secret_setting_name = kwargs.get('facebook_app_secret_setting_name', None) + self.facebook_o_auth_scopes = kwargs.get('facebook_o_auth_scopes', None) + self.git_hub_client_id = kwargs.get('git_hub_client_id', None) + self.git_hub_client_secret = kwargs.get('git_hub_client_secret', None) + self.git_hub_client_secret_setting_name = kwargs.get('git_hub_client_secret_setting_name', None) + self.git_hub_o_auth_scopes = kwargs.get('git_hub_o_auth_scopes', None) + self.twitter_consumer_key = kwargs.get('twitter_consumer_key', None) + self.twitter_consumer_secret = kwargs.get('twitter_consumer_secret', None) + self.twitter_consumer_secret_setting_name = kwargs.get('twitter_consumer_secret_setting_name', None) + self.microsoft_account_client_id = kwargs.get('microsoft_account_client_id', None) + self.microsoft_account_client_secret = kwargs.get('microsoft_account_client_secret', None) + self.microsoft_account_client_secret_setting_name = kwargs.get('microsoft_account_client_secret_setting_name', None) + self.microsoft_account_o_auth_scopes = kwargs.get('microsoft_account_o_auth_scopes', None) + self.is_auth_from_file = kwargs.get('is_auth_from_file', None) + self.auth_file_path = kwargs.get('auth_file_path', None) + self.config_version = kwargs.get('config_version', None) + + +class SiteAuthSettingsV2(ProxyOnlyResource): + """Configuration settings for the Azure App Service Authentication / Authorization V2 feature. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param platform: The configuration settings of the platform of App Service + Authentication/Authorization. + :type platform: ~azure.mgmt.web.v2021_02_01.models.AuthPlatform + :param global_validation: The configuration settings that determines the validation flow of + users using App Service Authentication/Authorization. + :type global_validation: ~azure.mgmt.web.v2021_02_01.models.GlobalValidation + :param identity_providers: The configuration settings of each of the identity providers used to + configure App Service Authentication/Authorization. + :type identity_providers: ~azure.mgmt.web.v2021_02_01.models.IdentityProviders + :param login: The configuration settings of the login flow of users using App Service + Authentication/Authorization. + :type login: ~azure.mgmt.web.v2021_02_01.models.Login + :param http_settings: The configuration settings of the HTTP requests for authentication and + authorization requests made against App Service Authentication/Authorization. + :type http_settings: ~azure.mgmt.web.v2021_02_01.models.HttpSettings + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'platform': {'key': 'properties.platform', 'type': 'AuthPlatform'}, + 'global_validation': {'key': 'properties.globalValidation', 'type': 'GlobalValidation'}, + 'identity_providers': {'key': 'properties.identityProviders', 'type': 'IdentityProviders'}, + 'login': {'key': 'properties.login', 'type': 'Login'}, + 'http_settings': {'key': 'properties.httpSettings', 'type': 'HttpSettings'}, + } + + def __init__( + self, + **kwargs + ): + super(SiteAuthSettingsV2, self).__init__(**kwargs) + self.platform = kwargs.get('platform', None) + self.global_validation = kwargs.get('global_validation', None) + self.identity_providers = kwargs.get('identity_providers', None) + self.login = kwargs.get('login', None) + self.http_settings = kwargs.get('http_settings', None) + + +class SiteCloneability(msrest.serialization.Model): + """Represents whether or not an app is cloneable. + + :param result: Name of app. Possible values include: "Cloneable", "PartiallyCloneable", + "NotCloneable". + :type result: str or ~azure.mgmt.web.v2021_02_01.models.CloneAbilityResult + :param blocking_features: List of features enabled on app that prevent cloning. + :type blocking_features: list[~azure.mgmt.web.v2021_02_01.models.SiteCloneabilityCriterion] + :param unsupported_features: List of features enabled on app that are non-blocking but cannot + be cloned. The app can still be cloned + but the features in this list will not be set up on cloned app. + :type unsupported_features: list[~azure.mgmt.web.v2021_02_01.models.SiteCloneabilityCriterion] + :param blocking_characteristics: List of blocking application characteristics. + :type blocking_characteristics: + list[~azure.mgmt.web.v2021_02_01.models.SiteCloneabilityCriterion] + """ + + _attribute_map = { + 'result': {'key': 'result', 'type': 'str'}, + 'blocking_features': {'key': 'blockingFeatures', 'type': '[SiteCloneabilityCriterion]'}, + 'unsupported_features': {'key': 'unsupportedFeatures', 'type': '[SiteCloneabilityCriterion]'}, + 'blocking_characteristics': {'key': 'blockingCharacteristics', 'type': '[SiteCloneabilityCriterion]'}, + } + + def __init__( + self, + **kwargs + ): + super(SiteCloneability, self).__init__(**kwargs) + self.result = kwargs.get('result', None) + self.blocking_features = kwargs.get('blocking_features', None) + self.unsupported_features = kwargs.get('unsupported_features', None) + self.blocking_characteristics = kwargs.get('blocking_characteristics', None) + + +class SiteCloneabilityCriterion(msrest.serialization.Model): + """An app cloneability criterion. + + :param name: Name of criterion. + :type name: str + :param description: Description of criterion. + :type description: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SiteCloneabilityCriterion, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.description = kwargs.get('description', None) + + +class SiteConfig(msrest.serialization.Model): + """Configuration of an App Service app. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param number_of_workers: Number of workers. + :type number_of_workers: int + :param default_documents: Default documents. + :type default_documents: list[str] + :param net_framework_version: .NET Framework version. + :type net_framework_version: str + :param php_version: Version of PHP. + :type php_version: str + :param python_version: Version of Python. + :type python_version: str + :param node_version: Version of Node.js. + :type node_version: str + :param power_shell_version: Version of PowerShell. + :type power_shell_version: str + :param linux_fx_version: Linux App Framework and version. + :type linux_fx_version: str + :param windows_fx_version: Xenon App Framework and version. + :type windows_fx_version: str + :param request_tracing_enabled: :code:`true` if request tracing is enabled; + otherwise, :code:`false`. + :type request_tracing_enabled: bool + :param request_tracing_expiration_time: Request tracing expiration time. + :type request_tracing_expiration_time: ~datetime.datetime + :param remote_debugging_enabled: :code:`true` if remote debugging is enabled; + otherwise, :code:`false`. + :type remote_debugging_enabled: bool + :param remote_debugging_version: Remote debugging version. + :type remote_debugging_version: str + :param http_logging_enabled: :code:`true` if HTTP logging is enabled; otherwise, + :code:`false`. + :type http_logging_enabled: bool + :param acr_use_managed_identity_creds: Flag to use Managed Identity Creds for ACR pull. + :type acr_use_managed_identity_creds: bool + :param acr_user_managed_identity_id: If using user managed identity, the user managed identity + ClientId. + :type acr_user_managed_identity_id: str + :param logs_directory_size_limit: HTTP logs directory size limit. + :type logs_directory_size_limit: int + :param detailed_error_logging_enabled: :code:`true` if detailed error logging is + enabled; otherwise, :code:`false`. + :type detailed_error_logging_enabled: bool + :param publishing_username: Publishing user name. + :type publishing_username: str + :param app_settings: Application settings. + :type app_settings: list[~azure.mgmt.web.v2021_02_01.models.NameValuePair] + :param connection_strings: Connection strings. + :type connection_strings: list[~azure.mgmt.web.v2021_02_01.models.ConnStringInfo] + :ivar machine_key: Site MachineKey. + :vartype machine_key: ~azure.mgmt.web.v2021_02_01.models.SiteMachineKey + :param handler_mappings: Handler mappings. + :type handler_mappings: list[~azure.mgmt.web.v2021_02_01.models.HandlerMapping] + :param document_root: Document root. + :type document_root: str + :param scm_type: SCM type. Possible values include: "None", "Dropbox", "Tfs", "LocalGit", + "GitHub", "CodePlexGit", "CodePlexHg", "BitbucketGit", "BitbucketHg", "ExternalGit", + "ExternalHg", "OneDrive", "VSO", "VSTSRM". + :type scm_type: str or ~azure.mgmt.web.v2021_02_01.models.ScmType + :param use32_bit_worker_process: :code:`true` to use 32-bit worker process; + otherwise, :code:`false`. + :type use32_bit_worker_process: bool + :param web_sockets_enabled: :code:`true` if WebSocket is enabled; otherwise, + :code:`false`. + :type web_sockets_enabled: bool + :param always_on: :code:`true` if Always On is enabled; otherwise, + :code:`false`. + :type always_on: bool + :param java_version: Java version. + :type java_version: str + :param java_container: Java container. + :type java_container: str + :param java_container_version: Java container version. + :type java_container_version: str + :param app_command_line: App command line to launch. + :type app_command_line: str + :param managed_pipeline_mode: Managed pipeline mode. Possible values include: "Integrated", + "Classic". + :type managed_pipeline_mode: str or ~azure.mgmt.web.v2021_02_01.models.ManagedPipelineMode + :param virtual_applications: Virtual applications. + :type virtual_applications: list[~azure.mgmt.web.v2021_02_01.models.VirtualApplication] + :param load_balancing: Site load balancing. Possible values include: "WeightedRoundRobin", + "LeastRequests", "LeastResponseTime", "WeightedTotalTraffic", "RequestHash", + "PerSiteRoundRobin". + :type load_balancing: str or ~azure.mgmt.web.v2021_02_01.models.SiteLoadBalancing + :param experiments: This is work around for polymorphic types. + :type experiments: ~azure.mgmt.web.v2021_02_01.models.Experiments + :param limits: Site limits. + :type limits: ~azure.mgmt.web.v2021_02_01.models.SiteLimits + :param auto_heal_enabled: :code:`true` if Auto Heal is enabled; otherwise, + :code:`false`. + :type auto_heal_enabled: bool + :param auto_heal_rules: Auto Heal rules. + :type auto_heal_rules: ~azure.mgmt.web.v2021_02_01.models.AutoHealRules + :param tracing_options: Tracing options. + :type tracing_options: str + :param vnet_name: Virtual Network name. + :type vnet_name: str + :param vnet_route_all_enabled: Virtual Network Route All enabled. This causes all outbound + traffic to have Virtual Network Security Groups and User Defined Routes applied. + :type vnet_route_all_enabled: bool + :param vnet_private_ports_count: The number of private ports assigned to this app. These will + be assigned dynamically on runtime. + :type vnet_private_ports_count: int + :param cors: Cross-Origin Resource Sharing (CORS) settings. + :type cors: ~azure.mgmt.web.v2021_02_01.models.CorsSettings + :param push: Push endpoint settings. + :type push: ~azure.mgmt.web.v2021_02_01.models.PushSettings + :param api_definition: Information about the formal API definition for the app. + :type api_definition: ~azure.mgmt.web.v2021_02_01.models.ApiDefinitionInfo + :param api_management_config: Azure API management settings linked to the app. + :type api_management_config: ~azure.mgmt.web.v2021_02_01.models.ApiManagementConfig + :param auto_swap_slot_name: Auto-swap slot name. + :type auto_swap_slot_name: str + :param local_my_sql_enabled: :code:`true` to enable local MySQL; otherwise, + :code:`false`. + :type local_my_sql_enabled: bool + :param managed_service_identity_id: Managed Service Identity Id. + :type managed_service_identity_id: int + :param x_managed_service_identity_id: Explicit Managed Service Identity Id. + :type x_managed_service_identity_id: int + :param key_vault_reference_identity: Identity to use for Key Vault Reference authentication. + :type key_vault_reference_identity: str + :param ip_security_restrictions: IP security restrictions for main. + :type ip_security_restrictions: list[~azure.mgmt.web.v2021_02_01.models.IpSecurityRestriction] + :param scm_ip_security_restrictions: IP security restrictions for scm. + :type scm_ip_security_restrictions: + list[~azure.mgmt.web.v2021_02_01.models.IpSecurityRestriction] + :param scm_ip_security_restrictions_use_main: IP security restrictions for scm to use main. + :type scm_ip_security_restrictions_use_main: bool + :param http20_enabled: Http20Enabled: configures a web site to allow clients to connect over + http2.0. + :type http20_enabled: bool + :param min_tls_version: MinTlsVersion: configures the minimum version of TLS required for SSL + requests. Possible values include: "1.0", "1.1", "1.2". + :type min_tls_version: str or ~azure.mgmt.web.v2021_02_01.models.SupportedTlsVersions + :param scm_min_tls_version: ScmMinTlsVersion: configures the minimum version of TLS required + for SSL requests for SCM site. Possible values include: "1.0", "1.1", "1.2". + :type scm_min_tls_version: str or ~azure.mgmt.web.v2021_02_01.models.SupportedTlsVersions + :param ftps_state: State of FTP / FTPS service. Possible values include: "AllAllowed", + "FtpsOnly", "Disabled". + :type ftps_state: str or ~azure.mgmt.web.v2021_02_01.models.FtpsState + :param pre_warmed_instance_count: Number of preWarmed instances. + This setting only applies to the Consumption and Elastic Plans. + :type pre_warmed_instance_count: int + :param function_app_scale_limit: Maximum number of workers that a site can scale out to. + This setting only applies to the Consumption and Elastic Premium Plans. + :type function_app_scale_limit: int + :param health_check_path: Health check path. + :type health_check_path: str + :param functions_runtime_scale_monitoring_enabled: Gets or sets a value indicating whether + functions runtime scale monitoring is enabled. When enabled, + the ScaleController will not monitor event sources directly, but will instead call to the + runtime to get scale status. + :type functions_runtime_scale_monitoring_enabled: bool + :param website_time_zone: Sets the time zone a site uses for generating timestamps. Compatible + with Linux and Windows App Service. Setting the WEBSITE_TIME_ZONE app setting takes precedence + over this config. For Linux, expects tz database values https://www.iana.org/time-zones (for a + quick reference see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). For Windows, + expects one of the time zones listed under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows + NT\CurrentVersion\Time Zones. + :type website_time_zone: str + :param minimum_elastic_instance_count: Number of minimum instance count for a site + This setting only applies to the Elastic Plans. + :type minimum_elastic_instance_count: int + :param azure_storage_accounts: List of Azure Storage Accounts. + :type azure_storage_accounts: dict[str, + ~azure.mgmt.web.v2021_02_01.models.AzureStorageInfoValue] + :param public_network_access: Property to allow or block all public traffic. + :type public_network_access: str + """ + + _validation = { + 'machine_key': {'readonly': True}, + 'pre_warmed_instance_count': {'maximum': 10, 'minimum': 0}, + 'function_app_scale_limit': {'minimum': 0}, + 'minimum_elastic_instance_count': {'maximum': 20, 'minimum': 0}, + } + + _attribute_map = { + 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, + 'default_documents': {'key': 'defaultDocuments', 'type': '[str]'}, + 'net_framework_version': {'key': 'netFrameworkVersion', 'type': 'str'}, + 'php_version': {'key': 'phpVersion', 'type': 'str'}, + 'python_version': {'key': 'pythonVersion', 'type': 'str'}, + 'node_version': {'key': 'nodeVersion', 'type': 'str'}, + 'power_shell_version': {'key': 'powerShellVersion', 'type': 'str'}, + 'linux_fx_version': {'key': 'linuxFxVersion', 'type': 'str'}, + 'windows_fx_version': {'key': 'windowsFxVersion', 'type': 'str'}, + 'request_tracing_enabled': {'key': 'requestTracingEnabled', 'type': 'bool'}, + 'request_tracing_expiration_time': {'key': 'requestTracingExpirationTime', 'type': 'iso-8601'}, + 'remote_debugging_enabled': {'key': 'remoteDebuggingEnabled', 'type': 'bool'}, + 'remote_debugging_version': {'key': 'remoteDebuggingVersion', 'type': 'str'}, + 'http_logging_enabled': {'key': 'httpLoggingEnabled', 'type': 'bool'}, + 'acr_use_managed_identity_creds': {'key': 'acrUseManagedIdentityCreds', 'type': 'bool'}, + 'acr_user_managed_identity_id': {'key': 'acrUserManagedIdentityID', 'type': 'str'}, + 'logs_directory_size_limit': {'key': 'logsDirectorySizeLimit', 'type': 'int'}, + 'detailed_error_logging_enabled': {'key': 'detailedErrorLoggingEnabled', 'type': 'bool'}, + 'publishing_username': {'key': 'publishingUsername', 'type': 'str'}, + 'app_settings': {'key': 'appSettings', 'type': '[NameValuePair]'}, + 'connection_strings': {'key': 'connectionStrings', 'type': '[ConnStringInfo]'}, + 'machine_key': {'key': 'machineKey', 'type': 'SiteMachineKey'}, + 'handler_mappings': {'key': 'handlerMappings', 'type': '[HandlerMapping]'}, + 'document_root': {'key': 'documentRoot', 'type': 'str'}, + 'scm_type': {'key': 'scmType', 'type': 'str'}, + 'use32_bit_worker_process': {'key': 'use32BitWorkerProcess', 'type': 'bool'}, + 'web_sockets_enabled': {'key': 'webSocketsEnabled', 'type': 'bool'}, + 'always_on': {'key': 'alwaysOn', 'type': 'bool'}, + 'java_version': {'key': 'javaVersion', 'type': 'str'}, + 'java_container': {'key': 'javaContainer', 'type': 'str'}, + 'java_container_version': {'key': 'javaContainerVersion', 'type': 'str'}, + 'app_command_line': {'key': 'appCommandLine', 'type': 'str'}, + 'managed_pipeline_mode': {'key': 'managedPipelineMode', 'type': 'str'}, + 'virtual_applications': {'key': 'virtualApplications', 'type': '[VirtualApplication]'}, + 'load_balancing': {'key': 'loadBalancing', 'type': 'str'}, + 'experiments': {'key': 'experiments', 'type': 'Experiments'}, + 'limits': {'key': 'limits', 'type': 'SiteLimits'}, + 'auto_heal_enabled': {'key': 'autoHealEnabled', 'type': 'bool'}, + 'auto_heal_rules': {'key': 'autoHealRules', 'type': 'AutoHealRules'}, + 'tracing_options': {'key': 'tracingOptions', 'type': 'str'}, + 'vnet_name': {'key': 'vnetName', 'type': 'str'}, + 'vnet_route_all_enabled': {'key': 'vnetRouteAllEnabled', 'type': 'bool'}, + 'vnet_private_ports_count': {'key': 'vnetPrivatePortsCount', 'type': 'int'}, + 'cors': {'key': 'cors', 'type': 'CorsSettings'}, + 'push': {'key': 'push', 'type': 'PushSettings'}, + 'api_definition': {'key': 'apiDefinition', 'type': 'ApiDefinitionInfo'}, + 'api_management_config': {'key': 'apiManagementConfig', 'type': 'ApiManagementConfig'}, + 'auto_swap_slot_name': {'key': 'autoSwapSlotName', 'type': 'str'}, + 'local_my_sql_enabled': {'key': 'localMySqlEnabled', 'type': 'bool'}, + 'managed_service_identity_id': {'key': 'managedServiceIdentityId', 'type': 'int'}, + 'x_managed_service_identity_id': {'key': 'xManagedServiceIdentityId', 'type': 'int'}, + 'key_vault_reference_identity': {'key': 'keyVaultReferenceIdentity', 'type': 'str'}, + 'ip_security_restrictions': {'key': 'ipSecurityRestrictions', 'type': '[IpSecurityRestriction]'}, + 'scm_ip_security_restrictions': {'key': 'scmIpSecurityRestrictions', 'type': '[IpSecurityRestriction]'}, + 'scm_ip_security_restrictions_use_main': {'key': 'scmIpSecurityRestrictionsUseMain', 'type': 'bool'}, + 'http20_enabled': {'key': 'http20Enabled', 'type': 'bool'}, + 'min_tls_version': {'key': 'minTlsVersion', 'type': 'str'}, + 'scm_min_tls_version': {'key': 'scmMinTlsVersion', 'type': 'str'}, + 'ftps_state': {'key': 'ftpsState', 'type': 'str'}, + 'pre_warmed_instance_count': {'key': 'preWarmedInstanceCount', 'type': 'int'}, + 'function_app_scale_limit': {'key': 'functionAppScaleLimit', 'type': 'int'}, + 'health_check_path': {'key': 'healthCheckPath', 'type': 'str'}, + 'functions_runtime_scale_monitoring_enabled': {'key': 'functionsRuntimeScaleMonitoringEnabled', 'type': 'bool'}, + 'website_time_zone': {'key': 'websiteTimeZone', 'type': 'str'}, + 'minimum_elastic_instance_count': {'key': 'minimumElasticInstanceCount', 'type': 'int'}, + 'azure_storage_accounts': {'key': 'azureStorageAccounts', 'type': '{AzureStorageInfoValue}'}, + 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SiteConfig, self).__init__(**kwargs) + self.number_of_workers = kwargs.get('number_of_workers', None) + self.default_documents = kwargs.get('default_documents', None) + self.net_framework_version = kwargs.get('net_framework_version', "v4.6") + self.php_version = kwargs.get('php_version', None) + self.python_version = kwargs.get('python_version', None) + self.node_version = kwargs.get('node_version', None) + self.power_shell_version = kwargs.get('power_shell_version', None) + self.linux_fx_version = kwargs.get('linux_fx_version', None) + self.windows_fx_version = kwargs.get('windows_fx_version', None) + self.request_tracing_enabled = kwargs.get('request_tracing_enabled', None) + self.request_tracing_expiration_time = kwargs.get('request_tracing_expiration_time', None) + self.remote_debugging_enabled = kwargs.get('remote_debugging_enabled', None) + self.remote_debugging_version = kwargs.get('remote_debugging_version', None) + self.http_logging_enabled = kwargs.get('http_logging_enabled', None) + self.acr_use_managed_identity_creds = kwargs.get('acr_use_managed_identity_creds', None) + self.acr_user_managed_identity_id = kwargs.get('acr_user_managed_identity_id', None) + self.logs_directory_size_limit = kwargs.get('logs_directory_size_limit', None) + self.detailed_error_logging_enabled = kwargs.get('detailed_error_logging_enabled', None) + self.publishing_username = kwargs.get('publishing_username', None) + self.app_settings = kwargs.get('app_settings', None) + self.connection_strings = kwargs.get('connection_strings', None) + self.machine_key = None + self.handler_mappings = kwargs.get('handler_mappings', None) + self.document_root = kwargs.get('document_root', None) + self.scm_type = kwargs.get('scm_type', None) + self.use32_bit_worker_process = kwargs.get('use32_bit_worker_process', None) + self.web_sockets_enabled = kwargs.get('web_sockets_enabled', None) + self.always_on = kwargs.get('always_on', None) + self.java_version = kwargs.get('java_version', None) + self.java_container = kwargs.get('java_container', None) + self.java_container_version = kwargs.get('java_container_version', None) + self.app_command_line = kwargs.get('app_command_line', None) + self.managed_pipeline_mode = kwargs.get('managed_pipeline_mode', None) + self.virtual_applications = kwargs.get('virtual_applications', None) + self.load_balancing = kwargs.get('load_balancing', None) + self.experiments = kwargs.get('experiments', None) + self.limits = kwargs.get('limits', None) + self.auto_heal_enabled = kwargs.get('auto_heal_enabled', None) + self.auto_heal_rules = kwargs.get('auto_heal_rules', None) + self.tracing_options = kwargs.get('tracing_options', None) + self.vnet_name = kwargs.get('vnet_name', None) + self.vnet_route_all_enabled = kwargs.get('vnet_route_all_enabled', None) + self.vnet_private_ports_count = kwargs.get('vnet_private_ports_count', None) + self.cors = kwargs.get('cors', None) + self.push = kwargs.get('push', None) + self.api_definition = kwargs.get('api_definition', None) + self.api_management_config = kwargs.get('api_management_config', None) + self.auto_swap_slot_name = kwargs.get('auto_swap_slot_name', None) + self.local_my_sql_enabled = kwargs.get('local_my_sql_enabled', False) + self.managed_service_identity_id = kwargs.get('managed_service_identity_id', None) + self.x_managed_service_identity_id = kwargs.get('x_managed_service_identity_id', None) + self.key_vault_reference_identity = kwargs.get('key_vault_reference_identity', None) + self.ip_security_restrictions = kwargs.get('ip_security_restrictions', None) + self.scm_ip_security_restrictions = kwargs.get('scm_ip_security_restrictions', None) + self.scm_ip_security_restrictions_use_main = kwargs.get('scm_ip_security_restrictions_use_main', None) + self.http20_enabled = kwargs.get('http20_enabled', True) + self.min_tls_version = kwargs.get('min_tls_version', None) + self.scm_min_tls_version = kwargs.get('scm_min_tls_version', None) + self.ftps_state = kwargs.get('ftps_state', None) + self.pre_warmed_instance_count = kwargs.get('pre_warmed_instance_count', None) + self.function_app_scale_limit = kwargs.get('function_app_scale_limit', None) + self.health_check_path = kwargs.get('health_check_path', None) + self.functions_runtime_scale_monitoring_enabled = kwargs.get('functions_runtime_scale_monitoring_enabled', None) + self.website_time_zone = kwargs.get('website_time_zone', None) + self.minimum_elastic_instance_count = kwargs.get('minimum_elastic_instance_count', None) + self.azure_storage_accounts = kwargs.get('azure_storage_accounts', None) + self.public_network_access = kwargs.get('public_network_access', None) + + +class SiteConfigPropertiesDictionary(msrest.serialization.Model): + """Site config properties dictionary. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar use32_bit_worker_process: :code:`true` if use32BitWorkerProcess should be + set to true for the stack; otherwise, :code:`false`. + :vartype use32_bit_worker_process: bool + :ivar linux_fx_version: LinuxFxVersion configuration setting. + :vartype linux_fx_version: str + :ivar java_version: JavaVersion configuration setting. + :vartype java_version: str + :ivar power_shell_version: PowerShellVersion configuration setting. + :vartype power_shell_version: str + """ + + _validation = { + 'use32_bit_worker_process': {'readonly': True}, + 'linux_fx_version': {'readonly': True}, + 'java_version': {'readonly': True}, + 'power_shell_version': {'readonly': True}, + } + + _attribute_map = { + 'use32_bit_worker_process': {'key': 'use32BitWorkerProcess', 'type': 'bool'}, + 'linux_fx_version': {'key': 'linuxFxVersion', 'type': 'str'}, + 'java_version': {'key': 'javaVersion', 'type': 'str'}, + 'power_shell_version': {'key': 'powerShellVersion', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SiteConfigPropertiesDictionary, self).__init__(**kwargs) + self.use32_bit_worker_process = None + self.linux_fx_version = None + self.java_version = None + self.power_shell_version = None + + +class SiteConfigResource(ProxyOnlyResource): + """Web app configuration ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param number_of_workers: Number of workers. + :type number_of_workers: int + :param default_documents: Default documents. + :type default_documents: list[str] + :param net_framework_version: .NET Framework version. + :type net_framework_version: str + :param php_version: Version of PHP. + :type php_version: str + :param python_version: Version of Python. + :type python_version: str + :param node_version: Version of Node.js. + :type node_version: str + :param power_shell_version: Version of PowerShell. + :type power_shell_version: str + :param linux_fx_version: Linux App Framework and version. + :type linux_fx_version: str + :param windows_fx_version: Xenon App Framework and version. + :type windows_fx_version: str + :param request_tracing_enabled: :code:`true` if request tracing is enabled; + otherwise, :code:`false`. + :type request_tracing_enabled: bool + :param request_tracing_expiration_time: Request tracing expiration time. + :type request_tracing_expiration_time: ~datetime.datetime + :param remote_debugging_enabled: :code:`true` if remote debugging is enabled; + otherwise, :code:`false`. + :type remote_debugging_enabled: bool + :param remote_debugging_version: Remote debugging version. + :type remote_debugging_version: str + :param http_logging_enabled: :code:`true` if HTTP logging is enabled; otherwise, + :code:`false`. + :type http_logging_enabled: bool + :param acr_use_managed_identity_creds: Flag to use Managed Identity Creds for ACR pull. + :type acr_use_managed_identity_creds: bool + :param acr_user_managed_identity_id: If using user managed identity, the user managed identity + ClientId. + :type acr_user_managed_identity_id: str + :param logs_directory_size_limit: HTTP logs directory size limit. + :type logs_directory_size_limit: int + :param detailed_error_logging_enabled: :code:`true` if detailed error logging is + enabled; otherwise, :code:`false`. + :type detailed_error_logging_enabled: bool + :param publishing_username: Publishing user name. + :type publishing_username: str + :param app_settings: Application settings. + :type app_settings: list[~azure.mgmt.web.v2021_02_01.models.NameValuePair] + :param connection_strings: Connection strings. + :type connection_strings: list[~azure.mgmt.web.v2021_02_01.models.ConnStringInfo] + :ivar machine_key: Site MachineKey. + :vartype machine_key: ~azure.mgmt.web.v2021_02_01.models.SiteMachineKey + :param handler_mappings: Handler mappings. + :type handler_mappings: list[~azure.mgmt.web.v2021_02_01.models.HandlerMapping] + :param document_root: Document root. + :type document_root: str + :param scm_type: SCM type. Possible values include: "None", "Dropbox", "Tfs", "LocalGit", + "GitHub", "CodePlexGit", "CodePlexHg", "BitbucketGit", "BitbucketHg", "ExternalGit", + "ExternalHg", "OneDrive", "VSO", "VSTSRM". + :type scm_type: str or ~azure.mgmt.web.v2021_02_01.models.ScmType + :param use32_bit_worker_process: :code:`true` to use 32-bit worker process; + otherwise, :code:`false`. + :type use32_bit_worker_process: bool + :param web_sockets_enabled: :code:`true` if WebSocket is enabled; otherwise, + :code:`false`. + :type web_sockets_enabled: bool + :param always_on: :code:`true` if Always On is enabled; otherwise, + :code:`false`. + :type always_on: bool + :param java_version: Java version. + :type java_version: str + :param java_container: Java container. + :type java_container: str + :param java_container_version: Java container version. + :type java_container_version: str + :param app_command_line: App command line to launch. + :type app_command_line: str + :param managed_pipeline_mode: Managed pipeline mode. Possible values include: "Integrated", + "Classic". + :type managed_pipeline_mode: str or ~azure.mgmt.web.v2021_02_01.models.ManagedPipelineMode + :param virtual_applications: Virtual applications. + :type virtual_applications: list[~azure.mgmt.web.v2021_02_01.models.VirtualApplication] + :param load_balancing: Site load balancing. Possible values include: "WeightedRoundRobin", + "LeastRequests", "LeastResponseTime", "WeightedTotalTraffic", "RequestHash", + "PerSiteRoundRobin". + :type load_balancing: str or ~azure.mgmt.web.v2021_02_01.models.SiteLoadBalancing + :param experiments: This is work around for polymorphic types. + :type experiments: ~azure.mgmt.web.v2021_02_01.models.Experiments + :param limits: Site limits. + :type limits: ~azure.mgmt.web.v2021_02_01.models.SiteLimits + :param auto_heal_enabled: :code:`true` if Auto Heal is enabled; otherwise, + :code:`false`. + :type auto_heal_enabled: bool + :param auto_heal_rules: Auto Heal rules. + :type auto_heal_rules: ~azure.mgmt.web.v2021_02_01.models.AutoHealRules + :param tracing_options: Tracing options. + :type tracing_options: str + :param vnet_name: Virtual Network name. + :type vnet_name: str + :param vnet_route_all_enabled: Virtual Network Route All enabled. This causes all outbound + traffic to have Virtual Network Security Groups and User Defined Routes applied. + :type vnet_route_all_enabled: bool + :param vnet_private_ports_count: The number of private ports assigned to this app. These will + be assigned dynamically on runtime. + :type vnet_private_ports_count: int + :param cors: Cross-Origin Resource Sharing (CORS) settings. + :type cors: ~azure.mgmt.web.v2021_02_01.models.CorsSettings + :param push: Push endpoint settings. + :type push: ~azure.mgmt.web.v2021_02_01.models.PushSettings + :param api_definition: Information about the formal API definition for the app. + :type api_definition: ~azure.mgmt.web.v2021_02_01.models.ApiDefinitionInfo + :param api_management_config: Azure API management settings linked to the app. + :type api_management_config: ~azure.mgmt.web.v2021_02_01.models.ApiManagementConfig + :param auto_swap_slot_name: Auto-swap slot name. + :type auto_swap_slot_name: str + :param local_my_sql_enabled: :code:`true` to enable local MySQL; otherwise, + :code:`false`. + :type local_my_sql_enabled: bool + :param managed_service_identity_id: Managed Service Identity Id. + :type managed_service_identity_id: int + :param x_managed_service_identity_id: Explicit Managed Service Identity Id. + :type x_managed_service_identity_id: int + :param key_vault_reference_identity: Identity to use for Key Vault Reference authentication. + :type key_vault_reference_identity: str + :param ip_security_restrictions: IP security restrictions for main. + :type ip_security_restrictions: list[~azure.mgmt.web.v2021_02_01.models.IpSecurityRestriction] + :param scm_ip_security_restrictions: IP security restrictions for scm. + :type scm_ip_security_restrictions: + list[~azure.mgmt.web.v2021_02_01.models.IpSecurityRestriction] + :param scm_ip_security_restrictions_use_main: IP security restrictions for scm to use main. + :type scm_ip_security_restrictions_use_main: bool + :param http20_enabled: Http20Enabled: configures a web site to allow clients to connect over + http2.0. + :type http20_enabled: bool + :param min_tls_version: MinTlsVersion: configures the minimum version of TLS required for SSL + requests. Possible values include: "1.0", "1.1", "1.2". + :type min_tls_version: str or ~azure.mgmt.web.v2021_02_01.models.SupportedTlsVersions + :param scm_min_tls_version: ScmMinTlsVersion: configures the minimum version of TLS required + for SSL requests for SCM site. Possible values include: "1.0", "1.1", "1.2". + :type scm_min_tls_version: str or ~azure.mgmt.web.v2021_02_01.models.SupportedTlsVersions + :param ftps_state: State of FTP / FTPS service. Possible values include: "AllAllowed", + "FtpsOnly", "Disabled". + :type ftps_state: str or ~azure.mgmt.web.v2021_02_01.models.FtpsState + :param pre_warmed_instance_count: Number of preWarmed instances. + This setting only applies to the Consumption and Elastic Plans. + :type pre_warmed_instance_count: int + :param function_app_scale_limit: Maximum number of workers that a site can scale out to. + This setting only applies to the Consumption and Elastic Premium Plans. + :type function_app_scale_limit: int + :param health_check_path: Health check path. + :type health_check_path: str + :param functions_runtime_scale_monitoring_enabled: Gets or sets a value indicating whether + functions runtime scale monitoring is enabled. When enabled, + the ScaleController will not monitor event sources directly, but will instead call to the + runtime to get scale status. + :type functions_runtime_scale_monitoring_enabled: bool + :param website_time_zone: Sets the time zone a site uses for generating timestamps. Compatible + with Linux and Windows App Service. Setting the WEBSITE_TIME_ZONE app setting takes precedence + over this config. For Linux, expects tz database values https://www.iana.org/time-zones (for a + quick reference see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). For Windows, + expects one of the time zones listed under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows + NT\CurrentVersion\Time Zones. + :type website_time_zone: str + :param minimum_elastic_instance_count: Number of minimum instance count for a site + This setting only applies to the Elastic Plans. + :type minimum_elastic_instance_count: int + :param azure_storage_accounts: List of Azure Storage Accounts. + :type azure_storage_accounts: dict[str, + ~azure.mgmt.web.v2021_02_01.models.AzureStorageInfoValue] + :param public_network_access: Property to allow or block all public traffic. + :type public_network_access: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'machine_key': {'readonly': True}, + 'pre_warmed_instance_count': {'maximum': 10, 'minimum': 0}, + 'function_app_scale_limit': {'minimum': 0}, + 'minimum_elastic_instance_count': {'maximum': 20, 'minimum': 0}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'number_of_workers': {'key': 'properties.numberOfWorkers', 'type': 'int'}, + 'default_documents': {'key': 'properties.defaultDocuments', 'type': '[str]'}, + 'net_framework_version': {'key': 'properties.netFrameworkVersion', 'type': 'str'}, + 'php_version': {'key': 'properties.phpVersion', 'type': 'str'}, + 'python_version': {'key': 'properties.pythonVersion', 'type': 'str'}, + 'node_version': {'key': 'properties.nodeVersion', 'type': 'str'}, + 'power_shell_version': {'key': 'properties.powerShellVersion', 'type': 'str'}, + 'linux_fx_version': {'key': 'properties.linuxFxVersion', 'type': 'str'}, + 'windows_fx_version': {'key': 'properties.windowsFxVersion', 'type': 'str'}, + 'request_tracing_enabled': {'key': 'properties.requestTracingEnabled', 'type': 'bool'}, + 'request_tracing_expiration_time': {'key': 'properties.requestTracingExpirationTime', 'type': 'iso-8601'}, + 'remote_debugging_enabled': {'key': 'properties.remoteDebuggingEnabled', 'type': 'bool'}, + 'remote_debugging_version': {'key': 'properties.remoteDebuggingVersion', 'type': 'str'}, + 'http_logging_enabled': {'key': 'properties.httpLoggingEnabled', 'type': 'bool'}, + 'acr_use_managed_identity_creds': {'key': 'properties.acrUseManagedIdentityCreds', 'type': 'bool'}, + 'acr_user_managed_identity_id': {'key': 'properties.acrUserManagedIdentityID', 'type': 'str'}, + 'logs_directory_size_limit': {'key': 'properties.logsDirectorySizeLimit', 'type': 'int'}, + 'detailed_error_logging_enabled': {'key': 'properties.detailedErrorLoggingEnabled', 'type': 'bool'}, + 'publishing_username': {'key': 'properties.publishingUsername', 'type': 'str'}, + 'app_settings': {'key': 'properties.appSettings', 'type': '[NameValuePair]'}, + 'connection_strings': {'key': 'properties.connectionStrings', 'type': '[ConnStringInfo]'}, + 'machine_key': {'key': 'properties.machineKey', 'type': 'SiteMachineKey'}, + 'handler_mappings': {'key': 'properties.handlerMappings', 'type': '[HandlerMapping]'}, + 'document_root': {'key': 'properties.documentRoot', 'type': 'str'}, + 'scm_type': {'key': 'properties.scmType', 'type': 'str'}, + 'use32_bit_worker_process': {'key': 'properties.use32BitWorkerProcess', 'type': 'bool'}, + 'web_sockets_enabled': {'key': 'properties.webSocketsEnabled', 'type': 'bool'}, + 'always_on': {'key': 'properties.alwaysOn', 'type': 'bool'}, + 'java_version': {'key': 'properties.javaVersion', 'type': 'str'}, + 'java_container': {'key': 'properties.javaContainer', 'type': 'str'}, + 'java_container_version': {'key': 'properties.javaContainerVersion', 'type': 'str'}, + 'app_command_line': {'key': 'properties.appCommandLine', 'type': 'str'}, + 'managed_pipeline_mode': {'key': 'properties.managedPipelineMode', 'type': 'str'}, + 'virtual_applications': {'key': 'properties.virtualApplications', 'type': '[VirtualApplication]'}, + 'load_balancing': {'key': 'properties.loadBalancing', 'type': 'str'}, + 'experiments': {'key': 'properties.experiments', 'type': 'Experiments'}, + 'limits': {'key': 'properties.limits', 'type': 'SiteLimits'}, + 'auto_heal_enabled': {'key': 'properties.autoHealEnabled', 'type': 'bool'}, + 'auto_heal_rules': {'key': 'properties.autoHealRules', 'type': 'AutoHealRules'}, + 'tracing_options': {'key': 'properties.tracingOptions', 'type': 'str'}, + 'vnet_name': {'key': 'properties.vnetName', 'type': 'str'}, + 'vnet_route_all_enabled': {'key': 'properties.vnetRouteAllEnabled', 'type': 'bool'}, + 'vnet_private_ports_count': {'key': 'properties.vnetPrivatePortsCount', 'type': 'int'}, + 'cors': {'key': 'properties.cors', 'type': 'CorsSettings'}, + 'push': {'key': 'properties.push', 'type': 'PushSettings'}, + 'api_definition': {'key': 'properties.apiDefinition', 'type': 'ApiDefinitionInfo'}, + 'api_management_config': {'key': 'properties.apiManagementConfig', 'type': 'ApiManagementConfig'}, + 'auto_swap_slot_name': {'key': 'properties.autoSwapSlotName', 'type': 'str'}, + 'local_my_sql_enabled': {'key': 'properties.localMySqlEnabled', 'type': 'bool'}, + 'managed_service_identity_id': {'key': 'properties.managedServiceIdentityId', 'type': 'int'}, + 'x_managed_service_identity_id': {'key': 'properties.xManagedServiceIdentityId', 'type': 'int'}, + 'key_vault_reference_identity': {'key': 'properties.keyVaultReferenceIdentity', 'type': 'str'}, + 'ip_security_restrictions': {'key': 'properties.ipSecurityRestrictions', 'type': '[IpSecurityRestriction]'}, + 'scm_ip_security_restrictions': {'key': 'properties.scmIpSecurityRestrictions', 'type': '[IpSecurityRestriction]'}, + 'scm_ip_security_restrictions_use_main': {'key': 'properties.scmIpSecurityRestrictionsUseMain', 'type': 'bool'}, + 'http20_enabled': {'key': 'properties.http20Enabled', 'type': 'bool'}, + 'min_tls_version': {'key': 'properties.minTlsVersion', 'type': 'str'}, + 'scm_min_tls_version': {'key': 'properties.scmMinTlsVersion', 'type': 'str'}, + 'ftps_state': {'key': 'properties.ftpsState', 'type': 'str'}, + 'pre_warmed_instance_count': {'key': 'properties.preWarmedInstanceCount', 'type': 'int'}, + 'function_app_scale_limit': {'key': 'properties.functionAppScaleLimit', 'type': 'int'}, + 'health_check_path': {'key': 'properties.healthCheckPath', 'type': 'str'}, + 'functions_runtime_scale_monitoring_enabled': {'key': 'properties.functionsRuntimeScaleMonitoringEnabled', 'type': 'bool'}, + 'website_time_zone': {'key': 'properties.websiteTimeZone', 'type': 'str'}, + 'minimum_elastic_instance_count': {'key': 'properties.minimumElasticInstanceCount', 'type': 'int'}, + 'azure_storage_accounts': {'key': 'properties.azureStorageAccounts', 'type': '{AzureStorageInfoValue}'}, + 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SiteConfigResource, self).__init__(**kwargs) + self.number_of_workers = kwargs.get('number_of_workers', None) + self.default_documents = kwargs.get('default_documents', None) + self.net_framework_version = kwargs.get('net_framework_version', "v4.6") + self.php_version = kwargs.get('php_version', None) + self.python_version = kwargs.get('python_version', None) + self.node_version = kwargs.get('node_version', None) + self.power_shell_version = kwargs.get('power_shell_version', None) + self.linux_fx_version = kwargs.get('linux_fx_version', None) + self.windows_fx_version = kwargs.get('windows_fx_version', None) + self.request_tracing_enabled = kwargs.get('request_tracing_enabled', None) + self.request_tracing_expiration_time = kwargs.get('request_tracing_expiration_time', None) + self.remote_debugging_enabled = kwargs.get('remote_debugging_enabled', None) + self.remote_debugging_version = kwargs.get('remote_debugging_version', None) + self.http_logging_enabled = kwargs.get('http_logging_enabled', None) + self.acr_use_managed_identity_creds = kwargs.get('acr_use_managed_identity_creds', None) + self.acr_user_managed_identity_id = kwargs.get('acr_user_managed_identity_id', None) + self.logs_directory_size_limit = kwargs.get('logs_directory_size_limit', None) + self.detailed_error_logging_enabled = kwargs.get('detailed_error_logging_enabled', None) + self.publishing_username = kwargs.get('publishing_username', None) + self.app_settings = kwargs.get('app_settings', None) + self.connection_strings = kwargs.get('connection_strings', None) + self.machine_key = None + self.handler_mappings = kwargs.get('handler_mappings', None) + self.document_root = kwargs.get('document_root', None) + self.scm_type = kwargs.get('scm_type', None) + self.use32_bit_worker_process = kwargs.get('use32_bit_worker_process', None) + self.web_sockets_enabled = kwargs.get('web_sockets_enabled', None) + self.always_on = kwargs.get('always_on', None) + self.java_version = kwargs.get('java_version', None) + self.java_container = kwargs.get('java_container', None) + self.java_container_version = kwargs.get('java_container_version', None) + self.app_command_line = kwargs.get('app_command_line', None) + self.managed_pipeline_mode = kwargs.get('managed_pipeline_mode', None) + self.virtual_applications = kwargs.get('virtual_applications', None) + self.load_balancing = kwargs.get('load_balancing', None) + self.experiments = kwargs.get('experiments', None) + self.limits = kwargs.get('limits', None) + self.auto_heal_enabled = kwargs.get('auto_heal_enabled', None) + self.auto_heal_rules = kwargs.get('auto_heal_rules', None) + self.tracing_options = kwargs.get('tracing_options', None) + self.vnet_name = kwargs.get('vnet_name', None) + self.vnet_route_all_enabled = kwargs.get('vnet_route_all_enabled', None) + self.vnet_private_ports_count = kwargs.get('vnet_private_ports_count', None) + self.cors = kwargs.get('cors', None) + self.push = kwargs.get('push', None) + self.api_definition = kwargs.get('api_definition', None) + self.api_management_config = kwargs.get('api_management_config', None) + self.auto_swap_slot_name = kwargs.get('auto_swap_slot_name', None) + self.local_my_sql_enabled = kwargs.get('local_my_sql_enabled', False) + self.managed_service_identity_id = kwargs.get('managed_service_identity_id', None) + self.x_managed_service_identity_id = kwargs.get('x_managed_service_identity_id', None) + self.key_vault_reference_identity = kwargs.get('key_vault_reference_identity', None) + self.ip_security_restrictions = kwargs.get('ip_security_restrictions', None) + self.scm_ip_security_restrictions = kwargs.get('scm_ip_security_restrictions', None) + self.scm_ip_security_restrictions_use_main = kwargs.get('scm_ip_security_restrictions_use_main', None) + self.http20_enabled = kwargs.get('http20_enabled', True) + self.min_tls_version = kwargs.get('min_tls_version', None) + self.scm_min_tls_version = kwargs.get('scm_min_tls_version', None) + self.ftps_state = kwargs.get('ftps_state', None) + self.pre_warmed_instance_count = kwargs.get('pre_warmed_instance_count', None) + self.function_app_scale_limit = kwargs.get('function_app_scale_limit', None) + self.health_check_path = kwargs.get('health_check_path', None) + self.functions_runtime_scale_monitoring_enabled = kwargs.get('functions_runtime_scale_monitoring_enabled', None) + self.website_time_zone = kwargs.get('website_time_zone', None) + self.minimum_elastic_instance_count = kwargs.get('minimum_elastic_instance_count', None) + self.azure_storage_accounts = kwargs.get('azure_storage_accounts', None) + self.public_network_access = kwargs.get('public_network_access', None) + + +class SiteConfigResourceCollection(msrest.serialization.Model): + """Collection of site configurations. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.SiteConfigResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SiteConfigResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SiteConfigResourceCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class SiteConfigurationSnapshotInfo(ProxyOnlyResource): + """A snapshot of a web app configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar time: The time the snapshot was taken. + :vartype time: ~datetime.datetime + :ivar snapshot_id: The id of the snapshot. + :vartype snapshot_id: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'time': {'readonly': True}, + 'snapshot_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'time': {'key': 'properties.time', 'type': 'iso-8601'}, + 'snapshot_id': {'key': 'properties.snapshotId', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(SiteConfigurationSnapshotInfo, self).__init__(**kwargs) + self.time = None + self.snapshot_id = None + + +class SiteConfigurationSnapshotInfoCollection(msrest.serialization.Model): + """Collection of metadata for the app configuration snapshots that can be restored. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.SiteConfigurationSnapshotInfo] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SiteConfigurationSnapshotInfo]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SiteConfigurationSnapshotInfoCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class SiteExtensionInfo(ProxyOnlyResource): + """Site Extension Information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param extension_id: Site extension ID. + :type extension_id: str + :param title: + :type title: str + :param extension_type: Site extension type. Possible values include: "Gallery", "WebRoot". + :type extension_type: str or ~azure.mgmt.web.v2021_02_01.models.SiteExtensionType + :param summary: Summary description. + :type summary: str + :param description: Detailed description. + :type description: str + :param version: Version information. + :type version: str + :param extension_url: Extension URL. + :type extension_url: str + :param project_url: Project URL. + :type project_url: str + :param icon_url: Icon URL. + :type icon_url: str + :param license_url: License URL. + :type license_url: str + :param feed_url: Feed URL. + :type feed_url: str + :param authors: List of authors. + :type authors: list[str] + :param installer_command_line_params: Installer command line parameters. + :type installer_command_line_params: str + :param published_date_time: Published timestamp. + :type published_date_time: ~datetime.datetime + :param download_count: Count of downloads. + :type download_count: int + :param local_is_latest_version: :code:`true` if the local version is the latest + version; :code:`false` otherwise. + :type local_is_latest_version: bool + :param local_path: Local path. + :type local_path: str + :param installed_date_time: Installed timestamp. + :type installed_date_time: ~datetime.datetime + :param provisioning_state: Provisioning state. + :type provisioning_state: str + :param comment: Site Extension comment. + :type comment: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'extension_id': {'key': 'properties.extension_id', 'type': 'str'}, + 'title': {'key': 'properties.title', 'type': 'str'}, + 'extension_type': {'key': 'properties.extension_type', 'type': 'str'}, + 'summary': {'key': 'properties.summary', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'extension_url': {'key': 'properties.extension_url', 'type': 'str'}, + 'project_url': {'key': 'properties.project_url', 'type': 'str'}, + 'icon_url': {'key': 'properties.icon_url', 'type': 'str'}, + 'license_url': {'key': 'properties.license_url', 'type': 'str'}, + 'feed_url': {'key': 'properties.feed_url', 'type': 'str'}, + 'authors': {'key': 'properties.authors', 'type': '[str]'}, + 'installer_command_line_params': {'key': 'properties.installer_command_line_params', 'type': 'str'}, + 'published_date_time': {'key': 'properties.published_date_time', 'type': 'iso-8601'}, + 'download_count': {'key': 'properties.download_count', 'type': 'int'}, + 'local_is_latest_version': {'key': 'properties.local_is_latest_version', 'type': 'bool'}, + 'local_path': {'key': 'properties.local_path', 'type': 'str'}, + 'installed_date_time': {'key': 'properties.installed_date_time', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'comment': {'key': 'properties.comment', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SiteExtensionInfo, self).__init__(**kwargs) + self.extension_id = kwargs.get('extension_id', None) + self.title = kwargs.get('title', None) + self.extension_type = kwargs.get('extension_type', None) + self.summary = kwargs.get('summary', None) + self.description = kwargs.get('description', None) + self.version = kwargs.get('version', None) + self.extension_url = kwargs.get('extension_url', None) + self.project_url = kwargs.get('project_url', None) + self.icon_url = kwargs.get('icon_url', None) + self.license_url = kwargs.get('license_url', None) + self.feed_url = kwargs.get('feed_url', None) + self.authors = kwargs.get('authors', None) + self.installer_command_line_params = kwargs.get('installer_command_line_params', None) + self.published_date_time = kwargs.get('published_date_time', None) + self.download_count = kwargs.get('download_count', None) + self.local_is_latest_version = kwargs.get('local_is_latest_version', None) + self.local_path = kwargs.get('local_path', None) + self.installed_date_time = kwargs.get('installed_date_time', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.comment = kwargs.get('comment', None) + + +class SiteExtensionInfoCollection(msrest.serialization.Model): + """Collection of Kudu site extension information elements. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.SiteExtensionInfo] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SiteExtensionInfo]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SiteExtensionInfoCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class SiteLimits(msrest.serialization.Model): + """Metric limits set on an app. + + :param max_percentage_cpu: Maximum allowed CPU usage percentage. + :type max_percentage_cpu: float + :param max_memory_in_mb: Maximum allowed memory usage in MB. + :type max_memory_in_mb: long + :param max_disk_size_in_mb: Maximum allowed disk size usage in MB. + :type max_disk_size_in_mb: long + """ + + _attribute_map = { + 'max_percentage_cpu': {'key': 'maxPercentageCpu', 'type': 'float'}, + 'max_memory_in_mb': {'key': 'maxMemoryInMb', 'type': 'long'}, + 'max_disk_size_in_mb': {'key': 'maxDiskSizeInMb', 'type': 'long'}, + } + + def __init__( + self, + **kwargs + ): + super(SiteLimits, self).__init__(**kwargs) + self.max_percentage_cpu = kwargs.get('max_percentage_cpu', None) + self.max_memory_in_mb = kwargs.get('max_memory_in_mb', None) + self.max_disk_size_in_mb = kwargs.get('max_disk_size_in_mb', None) + + +class SiteLogsConfig(ProxyOnlyResource): + """Configuration of App Service site logs. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param application_logs: Application logs configuration. + :type application_logs: ~azure.mgmt.web.v2021_02_01.models.ApplicationLogsConfig + :param http_logs: HTTP logs configuration. + :type http_logs: ~azure.mgmt.web.v2021_02_01.models.HttpLogsConfig + :param failed_requests_tracing: Failed requests tracing configuration. + :type failed_requests_tracing: ~azure.mgmt.web.v2021_02_01.models.EnabledConfig + :param detailed_error_messages: Detailed error messages configuration. + :type detailed_error_messages: ~azure.mgmt.web.v2021_02_01.models.EnabledConfig + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'application_logs': {'key': 'properties.applicationLogs', 'type': 'ApplicationLogsConfig'}, + 'http_logs': {'key': 'properties.httpLogs', 'type': 'HttpLogsConfig'}, + 'failed_requests_tracing': {'key': 'properties.failedRequestsTracing', 'type': 'EnabledConfig'}, + 'detailed_error_messages': {'key': 'properties.detailedErrorMessages', 'type': 'EnabledConfig'}, + } + + def __init__( + self, + **kwargs + ): + super(SiteLogsConfig, self).__init__(**kwargs) + self.application_logs = kwargs.get('application_logs', None) + self.http_logs = kwargs.get('http_logs', None) + self.failed_requests_tracing = kwargs.get('failed_requests_tracing', None) + self.detailed_error_messages = kwargs.get('detailed_error_messages', None) + + +class SiteMachineKey(msrest.serialization.Model): + """MachineKey of an app. + + :param validation: MachineKey validation. + :type validation: str + :param validation_key: Validation key. + :type validation_key: str + :param decryption: Algorithm used for decryption. + :type decryption: str + :param decryption_key: Decryption key. + :type decryption_key: str + """ + + _attribute_map = { + 'validation': {'key': 'validation', 'type': 'str'}, + 'validation_key': {'key': 'validationKey', 'type': 'str'}, + 'decryption': {'key': 'decryption', 'type': 'str'}, + 'decryption_key': {'key': 'decryptionKey', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SiteMachineKey, self).__init__(**kwargs) + self.validation = kwargs.get('validation', None) + self.validation_key = kwargs.get('validation_key', None) + self.decryption = kwargs.get('decryption', None) + self.decryption_key = kwargs.get('decryption_key', None) + + +class SitePatchResource(ProxyOnlyResource): + """ARM resource for a site. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param identity: Managed service identity. + :type identity: ~azure.mgmt.web.v2021_02_01.models.ManagedServiceIdentity + :ivar state: Current state of the app. + :vartype state: str + :ivar host_names: Hostnames associated with the app. + :vartype host_names: list[str] + :ivar repository_site_name: Name of the repository site. + :vartype repository_site_name: str + :ivar usage_state: State indicating whether the app has exceeded its quota usage. Read-only. + Possible values include: "Normal", "Exceeded". + :vartype usage_state: str or ~azure.mgmt.web.v2021_02_01.models.UsageState + :param enabled: :code:`true` if the app is enabled; otherwise, + :code:`false`. Setting this value to false disables the app (takes the app + offline). + :type enabled: bool + :ivar enabled_host_names: Enabled hostnames for the app.Hostnames need to be assigned (see + HostNames) AND enabled. Otherwise, + the app is not served on those hostnames. + :vartype enabled_host_names: list[str] + :ivar availability_state: Management information availability state for the app. Possible + values include: "Normal", "Limited", "DisasterRecoveryMode". + :vartype availability_state: str or ~azure.mgmt.web.v2021_02_01.models.SiteAvailabilityState + :param host_name_ssl_states: Hostname SSL states are used to manage the SSL bindings for app's + hostnames. + :type host_name_ssl_states: list[~azure.mgmt.web.v2021_02_01.models.HostNameSslState] + :param server_farm_id: Resource ID of the associated App Service plan, formatted as: + "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + :type server_farm_id: str + :param reserved: :code:`true` if reserved; otherwise, :code:`false`. + :type reserved: bool + :param is_xenon: Obsolete: Hyper-V sandbox. + :type is_xenon: bool + :param hyper_v: Hyper-V sandbox. + :type hyper_v: bool + :ivar last_modified_time_utc: Last time the app was modified, in UTC. Read-only. + :vartype last_modified_time_utc: ~datetime.datetime + :param site_config: Configuration of the app. + :type site_config: ~azure.mgmt.web.v2021_02_01.models.SiteConfig + :ivar traffic_manager_host_names: Azure Traffic Manager hostnames associated with the app. + Read-only. + :vartype traffic_manager_host_names: list[str] + :param scm_site_also_stopped: :code:`true` to stop SCM (KUDU) site when the app is + stopped; otherwise, :code:`false`. The default is :code:`false`. + :type scm_site_also_stopped: bool + :ivar target_swap_slot: Specifies which deployment slot this app will swap into. Read-only. + :vartype target_swap_slot: str + :param hosting_environment_profile: App Service Environment to use for the app. + :type hosting_environment_profile: ~azure.mgmt.web.v2021_02_01.models.HostingEnvironmentProfile + :param client_affinity_enabled: :code:`true` to enable client affinity; + :code:`false` to stop sending session affinity cookies, which route client + requests in the same session to the same instance. Default is :code:`true`. + :type client_affinity_enabled: bool + :param client_cert_enabled: :code:`true` to enable client certificate + authentication (TLS mutual authentication); otherwise, :code:`false`. Default is + :code:`false`. + :type client_cert_enabled: bool + :param client_cert_mode: This composes with ClientCertEnabled setting. + + + * ClientCertEnabled: false means ClientCert is ignored. + * ClientCertEnabled: true and ClientCertMode: Required means ClientCert is required. + * ClientCertEnabled: true and ClientCertMode: Optional means ClientCert is optional or + accepted. Possible values include: "Required", "Optional", "OptionalInteractiveUser". + :type client_cert_mode: str or ~azure.mgmt.web.v2021_02_01.models.ClientCertMode + :param client_cert_exclusion_paths: client certificate authentication comma-separated exclusion + paths. + :type client_cert_exclusion_paths: str + :param host_names_disabled: :code:`true` to disable the public hostnames of the + app; otherwise, :code:`false`. + If :code:`true`, the app is only accessible via API management process. + :type host_names_disabled: bool + :param custom_domain_verification_id: Unique identifier that verifies the custom domains + assigned to the app. Customer will add this id to a txt record for verification. + :type custom_domain_verification_id: str + :ivar outbound_ip_addresses: List of IP addresses that the app uses for outbound connections + (e.g. database access). Includes VIPs from tenants that site can be hosted with current + settings. Read-only. + :vartype outbound_ip_addresses: str + :ivar possible_outbound_ip_addresses: List of IP addresses that the app uses for outbound + connections (e.g. database access). Includes VIPs from all tenants except dataComponent. + Read-only. + :vartype possible_outbound_ip_addresses: str + :param container_size: Size of the function container. + :type container_size: int + :param daily_memory_time_quota: Maximum allowed daily memory-time quota (applicable on dynamic + apps only). + :type daily_memory_time_quota: int + :ivar suspended_till: App suspended till in case memory-time quota is exceeded. + :vartype suspended_till: ~datetime.datetime + :ivar max_number_of_workers: Maximum number of workers. + This only applies to Functions container. + :vartype max_number_of_workers: int + :param cloning_info: If specified during app creation, the app is cloned from a source app. + :type cloning_info: ~azure.mgmt.web.v2021_02_01.models.CloningInfo + :ivar resource_group: Name of the resource group the app belongs to. Read-only. + :vartype resource_group: str + :ivar is_default_container: :code:`true` if the app is a default container; + otherwise, :code:`false`. + :vartype is_default_container: bool + :ivar default_host_name: Default hostname of the app. Read-only. + :vartype default_host_name: str + :ivar slot_swap_status: Status of the last deployment slot swap operation. + :vartype slot_swap_status: ~azure.mgmt.web.v2021_02_01.models.SlotSwapStatus + :param https_only: HttpsOnly: configures a web site to accept only https requests. Issues + redirect for + http requests. + :type https_only: bool + :param redundancy_mode: Site redundancy mode. Possible values include: "None", "Manual", + "Failover", "ActiveActive", "GeoRedundant". + :type redundancy_mode: str or ~azure.mgmt.web.v2021_02_01.models.RedundancyMode + :ivar in_progress_operation_id: Specifies an operation id if this site has a pending operation. + :vartype in_progress_operation_id: str + :param storage_account_required: Checks if Customer provided storage account is required. + :type storage_account_required: bool + :param key_vault_reference_identity: Identity to use for Key Vault Reference authentication. + :type key_vault_reference_identity: str + :param virtual_network_subnet_id: Azure Resource Manager ID of the Virtual network and subnet + to be joined by Regional VNET Integration. + This must be of the form + /subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + :type virtual_network_subnet_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'state': {'readonly': True}, + 'host_names': {'readonly': True}, + 'repository_site_name': {'readonly': True}, + 'usage_state': {'readonly': True}, + 'enabled_host_names': {'readonly': True}, + 'availability_state': {'readonly': True}, + 'last_modified_time_utc': {'readonly': True}, + 'traffic_manager_host_names': {'readonly': True}, + 'target_swap_slot': {'readonly': True}, + 'outbound_ip_addresses': {'readonly': True}, + 'possible_outbound_ip_addresses': {'readonly': True}, + 'suspended_till': {'readonly': True}, + 'max_number_of_workers': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'is_default_container': {'readonly': True}, + 'default_host_name': {'readonly': True}, + 'slot_swap_status': {'readonly': True}, + 'in_progress_operation_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'host_names': {'key': 'properties.hostNames', 'type': '[str]'}, + 'repository_site_name': {'key': 'properties.repositorySiteName', 'type': 'str'}, + 'usage_state': {'key': 'properties.usageState', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'enabled_host_names': {'key': 'properties.enabledHostNames', 'type': '[str]'}, + 'availability_state': {'key': 'properties.availabilityState', 'type': 'str'}, + 'host_name_ssl_states': {'key': 'properties.hostNameSslStates', 'type': '[HostNameSslState]'}, + 'server_farm_id': {'key': 'properties.serverFarmId', 'type': 'str'}, + 'reserved': {'key': 'properties.reserved', 'type': 'bool'}, + 'is_xenon': {'key': 'properties.isXenon', 'type': 'bool'}, + 'hyper_v': {'key': 'properties.hyperV', 'type': 'bool'}, + 'last_modified_time_utc': {'key': 'properties.lastModifiedTimeUtc', 'type': 'iso-8601'}, + 'site_config': {'key': 'properties.siteConfig', 'type': 'SiteConfig'}, + 'traffic_manager_host_names': {'key': 'properties.trafficManagerHostNames', 'type': '[str]'}, + 'scm_site_also_stopped': {'key': 'properties.scmSiteAlsoStopped', 'type': 'bool'}, + 'target_swap_slot': {'key': 'properties.targetSwapSlot', 'type': 'str'}, + 'hosting_environment_profile': {'key': 'properties.hostingEnvironmentProfile', 'type': 'HostingEnvironmentProfile'}, + 'client_affinity_enabled': {'key': 'properties.clientAffinityEnabled', 'type': 'bool'}, + 'client_cert_enabled': {'key': 'properties.clientCertEnabled', 'type': 'bool'}, + 'client_cert_mode': {'key': 'properties.clientCertMode', 'type': 'str'}, + 'client_cert_exclusion_paths': {'key': 'properties.clientCertExclusionPaths', 'type': 'str'}, + 'host_names_disabled': {'key': 'properties.hostNamesDisabled', 'type': 'bool'}, + 'custom_domain_verification_id': {'key': 'properties.customDomainVerificationId', 'type': 'str'}, + 'outbound_ip_addresses': {'key': 'properties.outboundIpAddresses', 'type': 'str'}, + 'possible_outbound_ip_addresses': {'key': 'properties.possibleOutboundIpAddresses', 'type': 'str'}, + 'container_size': {'key': 'properties.containerSize', 'type': 'int'}, + 'daily_memory_time_quota': {'key': 'properties.dailyMemoryTimeQuota', 'type': 'int'}, + 'suspended_till': {'key': 'properties.suspendedTill', 'type': 'iso-8601'}, + 'max_number_of_workers': {'key': 'properties.maxNumberOfWorkers', 'type': 'int'}, + 'cloning_info': {'key': 'properties.cloningInfo', 'type': 'CloningInfo'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'is_default_container': {'key': 'properties.isDefaultContainer', 'type': 'bool'}, + 'default_host_name': {'key': 'properties.defaultHostName', 'type': 'str'}, + 'slot_swap_status': {'key': 'properties.slotSwapStatus', 'type': 'SlotSwapStatus'}, + 'https_only': {'key': 'properties.httpsOnly', 'type': 'bool'}, + 'redundancy_mode': {'key': 'properties.redundancyMode', 'type': 'str'}, + 'in_progress_operation_id': {'key': 'properties.inProgressOperationId', 'type': 'str'}, + 'storage_account_required': {'key': 'properties.storageAccountRequired', 'type': 'bool'}, + 'key_vault_reference_identity': {'key': 'properties.keyVaultReferenceIdentity', 'type': 'str'}, + 'virtual_network_subnet_id': {'key': 'properties.virtualNetworkSubnetId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SitePatchResource, self).__init__(**kwargs) + self.identity = kwargs.get('identity', None) + self.state = None + self.host_names = None + self.repository_site_name = None + self.usage_state = None + self.enabled = kwargs.get('enabled', None) + self.enabled_host_names = None + self.availability_state = None + self.host_name_ssl_states = kwargs.get('host_name_ssl_states', None) + self.server_farm_id = kwargs.get('server_farm_id', None) + self.reserved = kwargs.get('reserved', False) + self.is_xenon = kwargs.get('is_xenon', False) + self.hyper_v = kwargs.get('hyper_v', False) + self.last_modified_time_utc = None + self.site_config = kwargs.get('site_config', None) + self.traffic_manager_host_names = None + self.scm_site_also_stopped = kwargs.get('scm_site_also_stopped', False) + self.target_swap_slot = None + self.hosting_environment_profile = kwargs.get('hosting_environment_profile', None) + self.client_affinity_enabled = kwargs.get('client_affinity_enabled', None) + self.client_cert_enabled = kwargs.get('client_cert_enabled', None) + self.client_cert_mode = kwargs.get('client_cert_mode', None) + self.client_cert_exclusion_paths = kwargs.get('client_cert_exclusion_paths', None) + self.host_names_disabled = kwargs.get('host_names_disabled', None) + self.custom_domain_verification_id = kwargs.get('custom_domain_verification_id', None) + self.outbound_ip_addresses = None + self.possible_outbound_ip_addresses = None + self.container_size = kwargs.get('container_size', None) + self.daily_memory_time_quota = kwargs.get('daily_memory_time_quota', None) + self.suspended_till = None + self.max_number_of_workers = None + self.cloning_info = kwargs.get('cloning_info', None) + self.resource_group = None + self.is_default_container = None + self.default_host_name = None + self.slot_swap_status = None + self.https_only = kwargs.get('https_only', None) + self.redundancy_mode = kwargs.get('redundancy_mode', None) + self.in_progress_operation_id = None + self.storage_account_required = kwargs.get('storage_account_required', None) + self.key_vault_reference_identity = kwargs.get('key_vault_reference_identity', None) + self.virtual_network_subnet_id = kwargs.get('virtual_network_subnet_id', None) + + +class SitePhpErrorLogFlag(ProxyOnlyResource): + """Used for getting PHP error logging flag. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param local_log_errors: Local log_errors setting. + :type local_log_errors: str + :param master_log_errors: Master log_errors setting. + :type master_log_errors: str + :param local_log_errors_max_length: Local log_errors_max_len setting. + :type local_log_errors_max_length: str + :param master_log_errors_max_length: Master log_errors_max_len setting. + :type master_log_errors_max_length: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'local_log_errors': {'key': 'properties.localLogErrors', 'type': 'str'}, + 'master_log_errors': {'key': 'properties.masterLogErrors', 'type': 'str'}, + 'local_log_errors_max_length': {'key': 'properties.localLogErrorsMaxLength', 'type': 'str'}, + 'master_log_errors_max_length': {'key': 'properties.masterLogErrorsMaxLength', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SitePhpErrorLogFlag, self).__init__(**kwargs) + self.local_log_errors = kwargs.get('local_log_errors', None) + self.master_log_errors = kwargs.get('master_log_errors', None) + self.local_log_errors_max_length = kwargs.get('local_log_errors_max_length', None) + self.master_log_errors_max_length = kwargs.get('master_log_errors_max_length', None) + + +class SiteSeal(msrest.serialization.Model): + """Site seal. + + All required parameters must be populated in order to send to Azure. + + :param html: Required. HTML snippet. + :type html: str + """ + + _validation = { + 'html': {'required': True}, + } + + _attribute_map = { + 'html': {'key': 'html', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SiteSeal, self).__init__(**kwargs) + self.html = kwargs['html'] + + +class SiteSealRequest(msrest.serialization.Model): + """Site seal request. + + :param light_theme: If :code:`true` use the light color theme for site seal; + otherwise, use the default color theme. + :type light_theme: bool + :param locale: Locale of site seal. + :type locale: str + """ + + _attribute_map = { + 'light_theme': {'key': 'lightTheme', 'type': 'bool'}, + 'locale': {'key': 'locale', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SiteSealRequest, self).__init__(**kwargs) + self.light_theme = kwargs.get('light_theme', None) + self.locale = kwargs.get('locale', None) + + +class SiteSourceControl(ProxyOnlyResource): + """Source control configuration for an app. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param repo_url: Repository or source control URL. + :type repo_url: str + :param branch: Name of branch to use for deployment. + :type branch: str + :param is_manual_integration: :code:`true` to limit to manual integration; + :code:`false` to enable continuous integration (which configures webhooks into + online repos like GitHub). + :type is_manual_integration: bool + :param is_git_hub_action: :code:`true` if this is deployed via GitHub action. + :type is_git_hub_action: bool + :param deployment_rollback_enabled: :code:`true` to enable deployment rollback; + otherwise, :code:`false`. + :type deployment_rollback_enabled: bool + :param is_mercurial: :code:`true` for a Mercurial repository; + :code:`false` for a Git repository. + :type is_mercurial: bool + :param git_hub_action_configuration: If GitHub Action is selected, than the associated + configuration. + :type git_hub_action_configuration: + ~azure.mgmt.web.v2021_02_01.models.GitHubActionConfiguration + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'repo_url': {'key': 'properties.repoUrl', 'type': 'str'}, + 'branch': {'key': 'properties.branch', 'type': 'str'}, + 'is_manual_integration': {'key': 'properties.isManualIntegration', 'type': 'bool'}, + 'is_git_hub_action': {'key': 'properties.isGitHubAction', 'type': 'bool'}, + 'deployment_rollback_enabled': {'key': 'properties.deploymentRollbackEnabled', 'type': 'bool'}, + 'is_mercurial': {'key': 'properties.isMercurial', 'type': 'bool'}, + 'git_hub_action_configuration': {'key': 'properties.gitHubActionConfiguration', 'type': 'GitHubActionConfiguration'}, + } + + def __init__( + self, + **kwargs + ): + super(SiteSourceControl, self).__init__(**kwargs) + self.repo_url = kwargs.get('repo_url', None) + self.branch = kwargs.get('branch', None) + self.is_manual_integration = kwargs.get('is_manual_integration', None) + self.is_git_hub_action = kwargs.get('is_git_hub_action', None) + self.deployment_rollback_enabled = kwargs.get('deployment_rollback_enabled', None) + self.is_mercurial = kwargs.get('is_mercurial', None) + self.git_hub_action_configuration = kwargs.get('git_hub_action_configuration', None) + + +class SkuCapacity(msrest.serialization.Model): + """Description of the App Service plan scale options. + + :param minimum: Minimum number of workers for this App Service plan SKU. + :type minimum: int + :param maximum: Maximum number of workers for this App Service plan SKU. + :type maximum: int + :param elastic_maximum: Maximum number of Elastic workers for this App Service plan SKU. + :type elastic_maximum: int + :param default: Default number of workers for this App Service plan SKU. + :type default: int + :param scale_type: Available scale configurations for an App Service plan. + :type scale_type: str + """ + + _attribute_map = { + 'minimum': {'key': 'minimum', 'type': 'int'}, + 'maximum': {'key': 'maximum', 'type': 'int'}, + 'elastic_maximum': {'key': 'elasticMaximum', 'type': 'int'}, + 'default': {'key': 'default', 'type': 'int'}, + 'scale_type': {'key': 'scaleType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuCapacity, self).__init__(**kwargs) + self.minimum = kwargs.get('minimum', None) + self.maximum = kwargs.get('maximum', None) + self.elastic_maximum = kwargs.get('elastic_maximum', None) + self.default = kwargs.get('default', None) + self.scale_type = kwargs.get('scale_type', None) + + +class SkuDescription(msrest.serialization.Model): + """Description of a SKU for a scalable resource. + + :param name: Name of the resource SKU. + :type name: str + :param tier: Service tier of the resource SKU. + :type tier: str + :param size: Size specifier of the resource SKU. + :type size: str + :param family: Family code of the resource SKU. + :type family: str + :param capacity: Current number of instances assigned to the resource. + :type capacity: int + :param sku_capacity: Min, max, and default scale values of the SKU. + :type sku_capacity: ~azure.mgmt.web.v2021_02_01.models.SkuCapacity + :param locations: Locations of the SKU. + :type locations: list[str] + :param capabilities: Capabilities of the SKU, e.g., is traffic manager enabled?. + :type capabilities: list[~azure.mgmt.web.v2021_02_01.models.Capability] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + 'sku_capacity': {'key': 'skuCapacity', 'type': 'SkuCapacity'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[Capability]'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuDescription, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.size = kwargs.get('size', None) + self.family = kwargs.get('family', None) + self.capacity = kwargs.get('capacity', None) + self.sku_capacity = kwargs.get('sku_capacity', None) + self.locations = kwargs.get('locations', None) + self.capabilities = kwargs.get('capabilities', None) + + +class SkuInfo(msrest.serialization.Model): + """SKU discovery information. + + :param resource_type: Resource type that this SKU applies to. + :type resource_type: str + :param sku: Name and tier of the SKU. + :type sku: ~azure.mgmt.web.v2021_02_01.models.SkuDescription + :param capacity: Min, max, and default scale values of the SKU. + :type capacity: ~azure.mgmt.web.v2021_02_01.models.SkuCapacity + """ + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'SkuDescription'}, + 'capacity': {'key': 'capacity', 'type': 'SkuCapacity'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuInfo, self).__init__(**kwargs) + self.resource_type = kwargs.get('resource_type', None) + self.sku = kwargs.get('sku', None) + self.capacity = kwargs.get('capacity', None) + + +class SkuInfoCollection(msrest.serialization.Model): + """Collection of SKU information. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.SkuInfo] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SkuInfo]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuInfoCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class SkuInfos(msrest.serialization.Model): + """Collection of SKU information. + + :param resource_type: Resource type that this SKU applies to. + :type resource_type: str + :param skus: List of SKUs the subscription is able to use. + :type skus: list[~azure.mgmt.web.v2021_02_01.models.GlobalCsmSkuDescription] + """ + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'skus': {'key': 'skus', 'type': '[GlobalCsmSkuDescription]'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuInfos, self).__init__(**kwargs) + self.resource_type = kwargs.get('resource_type', None) + self.skus = kwargs.get('skus', None) + + +class SlotConfigNamesResource(ProxyOnlyResource): + """Slot Config names azure resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param connection_string_names: List of connection string names. + :type connection_string_names: list[str] + :param app_setting_names: List of application settings names. + :type app_setting_names: list[str] + :param azure_storage_config_names: List of external Azure storage account identifiers. + :type azure_storage_config_names: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'connection_string_names': {'key': 'properties.connectionStringNames', 'type': '[str]'}, + 'app_setting_names': {'key': 'properties.appSettingNames', 'type': '[str]'}, + 'azure_storage_config_names': {'key': 'properties.azureStorageConfigNames', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(SlotConfigNamesResource, self).__init__(**kwargs) + self.connection_string_names = kwargs.get('connection_string_names', None) + self.app_setting_names = kwargs.get('app_setting_names', None) + self.azure_storage_config_names = kwargs.get('azure_storage_config_names', None) + + +class SlotDifference(ProxyOnlyResource): + """A setting difference between two deployment slots of an app. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar level: Level of the difference: Information, Warning or Error. + :vartype level: str + :ivar setting_type: The type of the setting: General, AppSetting or ConnectionString. + :vartype setting_type: str + :ivar diff_rule: Rule that describes how to process the setting difference during a slot swap. + :vartype diff_rule: str + :ivar setting_name: Name of the setting. + :vartype setting_name: str + :ivar value_in_current_slot: Value of the setting in the current slot. + :vartype value_in_current_slot: str + :ivar value_in_target_slot: Value of the setting in the target slot. + :vartype value_in_target_slot: str + :ivar description: Description of the setting difference. + :vartype description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'level': {'readonly': True}, + 'setting_type': {'readonly': True}, + 'diff_rule': {'readonly': True}, + 'setting_name': {'readonly': True}, + 'value_in_current_slot': {'readonly': True}, + 'value_in_target_slot': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'level': {'key': 'properties.level', 'type': 'str'}, + 'setting_type': {'key': 'properties.settingType', 'type': 'str'}, + 'diff_rule': {'key': 'properties.diffRule', 'type': 'str'}, + 'setting_name': {'key': 'properties.settingName', 'type': 'str'}, + 'value_in_current_slot': {'key': 'properties.valueInCurrentSlot', 'type': 'str'}, + 'value_in_target_slot': {'key': 'properties.valueInTargetSlot', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SlotDifference, self).__init__(**kwargs) + self.level = None + self.setting_type = None + self.diff_rule = None + self.setting_name = None + self.value_in_current_slot = None + self.value_in_target_slot = None + self.description = None + + +class SlotDifferenceCollection(msrest.serialization.Model): + """Collection of slot differences. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.SlotDifference] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SlotDifference]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SlotDifferenceCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class SlotSwapStatus(msrest.serialization.Model): + """The status of the last successful slot swap operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar timestamp_utc: The time the last successful slot swap completed. + :vartype timestamp_utc: ~datetime.datetime + :ivar source_slot_name: The source slot of the last swap operation. + :vartype source_slot_name: str + :ivar destination_slot_name: The destination slot of the last swap operation. + :vartype destination_slot_name: str + """ + + _validation = { + 'timestamp_utc': {'readonly': True}, + 'source_slot_name': {'readonly': True}, + 'destination_slot_name': {'readonly': True}, + } + + _attribute_map = { + 'timestamp_utc': {'key': 'timestampUtc', 'type': 'iso-8601'}, + 'source_slot_name': {'key': 'sourceSlotName', 'type': 'str'}, + 'destination_slot_name': {'key': 'destinationSlotName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SlotSwapStatus, self).__init__(**kwargs) + self.timestamp_utc = None + self.source_slot_name = None + self.destination_slot_name = None + + +class SlowRequestsBasedTrigger(msrest.serialization.Model): + """Trigger based on request execution time. + + :param time_taken: Time taken. + :type time_taken: str + :param path: Request Path. + :type path: str + :param count: Request Count. + :type count: int + :param time_interval: Time interval. + :type time_interval: str + """ + + _attribute_map = { + 'time_taken': {'key': 'timeTaken', 'type': 'str'}, + 'path': {'key': 'path', 'type': 'str'}, + 'count': {'key': 'count', 'type': 'int'}, + 'time_interval': {'key': 'timeInterval', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SlowRequestsBasedTrigger, self).__init__(**kwargs) + self.time_taken = kwargs.get('time_taken', None) + self.path = kwargs.get('path', None) + self.count = kwargs.get('count', None) + self.time_interval = kwargs.get('time_interval', None) + + +class Snapshot(ProxyOnlyResource): + """A snapshot of an app. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar time: The time the snapshot was taken. + :vartype time: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'time': {'key': 'properties.time', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Snapshot, self).__init__(**kwargs) + self.time = None + + +class SnapshotCollection(msrest.serialization.Model): + """Collection of snapshots which can be used to revert an app to a previous time. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.Snapshot] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Snapshot]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SnapshotCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class SnapshotRecoverySource(msrest.serialization.Model): + """Specifies the web app that snapshot contents will be retrieved from. + + :param location: Geographical location of the source web app, e.g. SouthEastAsia, + SouthCentralUS. + :type location: str + :param id: ARM resource ID of the source app. + /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + for production slots and + /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + for other slots. + :type id: str + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SnapshotRecoverySource, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.id = kwargs.get('id', None) + + +class SnapshotRestoreRequest(ProxyOnlyResource): + """Details about app recovery operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param snapshot_time: Point in time in which the app restore should be done, formatted as a + DateTime string. + :type snapshot_time: str + :param recovery_source: Optional. Specifies the web app that snapshot contents will be + retrieved from. + If empty, the targeted web app will be used as the source. + :type recovery_source: ~azure.mgmt.web.v2021_02_01.models.SnapshotRecoverySource + :param overwrite: If :code:`true` the restore operation can overwrite source app; + otherwise, :code:`false`. + :type overwrite: bool + :param recover_configuration: If true, site configuration, in addition to content, will be + reverted. + :type recover_configuration: bool + :param ignore_conflicting_host_names: If true, custom hostname conflicts will be ignored when + recovering to a target web app. + This setting is only necessary when RecoverConfiguration is enabled. + :type ignore_conflicting_host_names: bool + :param use_dr_secondary: If true, the snapshot is retrieved from DRSecondary endpoint. + :type use_dr_secondary: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'snapshot_time': {'key': 'properties.snapshotTime', 'type': 'str'}, + 'recovery_source': {'key': 'properties.recoverySource', 'type': 'SnapshotRecoverySource'}, + 'overwrite': {'key': 'properties.overwrite', 'type': 'bool'}, + 'recover_configuration': {'key': 'properties.recoverConfiguration', 'type': 'bool'}, + 'ignore_conflicting_host_names': {'key': 'properties.ignoreConflictingHostNames', 'type': 'bool'}, + 'use_dr_secondary': {'key': 'properties.useDRSecondary', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(SnapshotRestoreRequest, self).__init__(**kwargs) + self.snapshot_time = kwargs.get('snapshot_time', None) + self.recovery_source = kwargs.get('recovery_source', None) + self.overwrite = kwargs.get('overwrite', None) + self.recover_configuration = kwargs.get('recover_configuration', None) + self.ignore_conflicting_host_names = kwargs.get('ignore_conflicting_host_names', None) + self.use_dr_secondary = kwargs.get('use_dr_secondary', None) + + +class Solution(msrest.serialization.Model): + """Class Representing Solution for problems detected. + + :param id: Solution Id. + :type id: float + :param display_name: Display Name of the solution. + :type display_name: str + :param order: Order of the solution. + :type order: float + :param description: Description of the solution. + :type description: str + :param type: Type of Solution. Possible values include: "QuickSolution", "DeepInvestigation", + "BestPractices". + :type type: str or ~azure.mgmt.web.v2021_02_01.models.SolutionType + :param data: Solution Data. + :type data: list[list[~azure.mgmt.web.v2021_02_01.models.NameValuePair]] + :param metadata: Solution Metadata. + :type metadata: list[list[~azure.mgmt.web.v2021_02_01.models.NameValuePair]] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'float'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'order': {'key': 'order', 'type': 'float'}, + 'description': {'key': 'description', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'data': {'key': 'data', 'type': '[[NameValuePair]]'}, + 'metadata': {'key': 'metadata', 'type': '[[NameValuePair]]'}, + } + + def __init__( + self, + **kwargs + ): + super(Solution, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.display_name = kwargs.get('display_name', None) + self.order = kwargs.get('order', None) + self.description = kwargs.get('description', None) + self.type = kwargs.get('type', None) + self.data = kwargs.get('data', None) + self.metadata = kwargs.get('metadata', None) + + +class SourceControl(ProxyOnlyResource): + """The source control OAuth token. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param token: OAuth access token. + :type token: str + :param token_secret: OAuth access token secret. + :type token_secret: str + :param refresh_token: OAuth refresh token. + :type refresh_token: str + :param expiration_time: OAuth token expiration. + :type expiration_time: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'token': {'key': 'properties.token', 'type': 'str'}, + 'token_secret': {'key': 'properties.tokenSecret', 'type': 'str'}, + 'refresh_token': {'key': 'properties.refreshToken', 'type': 'str'}, + 'expiration_time': {'key': 'properties.expirationTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(SourceControl, self).__init__(**kwargs) + self.token = kwargs.get('token', None) + self.token_secret = kwargs.get('token_secret', None) + self.refresh_token = kwargs.get('refresh_token', None) + self.expiration_time = kwargs.get('expiration_time', None) + + +class SourceControlCollection(msrest.serialization.Model): + """Collection of source controls. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.SourceControl] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SourceControl]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SourceControlCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class StackMajorVersion(msrest.serialization.Model): + """Application stack major version. + + :param display_version: Application stack major version (display only). + :type display_version: str + :param runtime_version: Application stack major version (runtime only). + :type runtime_version: str + :param is_default: :code:`true` if this is the default major version; otherwise, + :code:`false`. + :type is_default: bool + :param minor_versions: Minor versions associated with the major version. + :type minor_versions: list[~azure.mgmt.web.v2021_02_01.models.StackMinorVersion] + :param application_insights: :code:`true` if this supports Application Insights; + otherwise, :code:`false`. + :type application_insights: bool + :param is_preview: :code:`true` if this stack is in Preview, otherwise + :code:`false`. + :type is_preview: bool + :param is_deprecated: :code:`true` if this stack has been deprecated, otherwise + :code:`false`. + :type is_deprecated: bool + :param is_hidden: :code:`true` if this stack should be hidden for new customers on + portal, otherwise :code:`false`. + :type is_hidden: bool + :param app_settings_dictionary: :code:` + + ` + Example: All the function apps need AppSetting: "FUNCTIONS_WORKER_RUNTIME" to be set stack + name. + :type app_settings_dictionary: dict[str, any] + :param site_config_properties_dictionary: :code:` + + ` + Example: All Linux Function Apps, need Use32BitWorkerProcess to be set to 0. + :type site_config_properties_dictionary: dict[str, any] + """ + + _attribute_map = { + 'display_version': {'key': 'displayVersion', 'type': 'str'}, + 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, + 'is_default': {'key': 'isDefault', 'type': 'bool'}, + 'minor_versions': {'key': 'minorVersions', 'type': '[StackMinorVersion]'}, + 'application_insights': {'key': 'applicationInsights', 'type': 'bool'}, + 'is_preview': {'key': 'isPreview', 'type': 'bool'}, + 'is_deprecated': {'key': 'isDeprecated', 'type': 'bool'}, + 'is_hidden': {'key': 'isHidden', 'type': 'bool'}, + 'app_settings_dictionary': {'key': 'appSettingsDictionary', 'type': '{object}'}, + 'site_config_properties_dictionary': {'key': 'siteConfigPropertiesDictionary', 'type': '{object}'}, + } + + def __init__( + self, + **kwargs + ): + super(StackMajorVersion, self).__init__(**kwargs) + self.display_version = kwargs.get('display_version', None) + self.runtime_version = kwargs.get('runtime_version', None) + self.is_default = kwargs.get('is_default', None) + self.minor_versions = kwargs.get('minor_versions', None) + self.application_insights = kwargs.get('application_insights', None) + self.is_preview = kwargs.get('is_preview', None) + self.is_deprecated = kwargs.get('is_deprecated', None) + self.is_hidden = kwargs.get('is_hidden', None) + self.app_settings_dictionary = kwargs.get('app_settings_dictionary', None) + self.site_config_properties_dictionary = kwargs.get('site_config_properties_dictionary', None) + + +class StackMinorVersion(msrest.serialization.Model): + """Application stack minor version. + + :param display_version: Application stack minor version (display only). + :type display_version: str + :param runtime_version: Application stack minor version (runtime only). + :type runtime_version: str + :param is_default: :code:`true` if this is the default minor version; otherwise, + :code:`false`. + :type is_default: bool + :param is_remote_debugging_enabled: :code:`true` if this supports Remote + Debugging, otherwise :code:`false`. + :type is_remote_debugging_enabled: bool + """ + + _attribute_map = { + 'display_version': {'key': 'displayVersion', 'type': 'str'}, + 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, + 'is_default': {'key': 'isDefault', 'type': 'bool'}, + 'is_remote_debugging_enabled': {'key': 'isRemoteDebuggingEnabled', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(StackMinorVersion, self).__init__(**kwargs) + self.display_version = kwargs.get('display_version', None) + self.runtime_version = kwargs.get('runtime_version', None) + self.is_default = kwargs.get('is_default', None) + self.is_remote_debugging_enabled = kwargs.get('is_remote_debugging_enabled', None) + + +class StampCapacity(msrest.serialization.Model): + """Stamp capacity information. + + :param name: Name of the stamp. + :type name: str + :param available_capacity: Available capacity (# of machines, bytes of storage etc...). + :type available_capacity: long + :param total_capacity: Total capacity (# of machines, bytes of storage etc...). + :type total_capacity: long + :param unit: Name of the unit. + :type unit: str + :param compute_mode: Shared/dedicated workers. Possible values include: "Shared", "Dedicated", + "Dynamic". + :type compute_mode: str or ~azure.mgmt.web.v2021_02_01.models.ComputeModeOptions + :param worker_size: Size of the machines. Possible values include: "Small", "Medium", "Large", + "D1", "D2", "D3", "SmallV3", "MediumV3", "LargeV3", "NestedSmall", "NestedSmallLinux", + "Default". + :type worker_size: str or ~azure.mgmt.web.v2021_02_01.models.WorkerSizeOptions + :param worker_size_id: Size ID of machines: + 0 - Small + 1 - Medium + 2 - Large. + :type worker_size_id: int + :param exclude_from_capacity_allocation: If :code:`true`, it includes basic apps. + Basic apps are not used for capacity allocation. + :type exclude_from_capacity_allocation: bool + :param is_applicable_for_all_compute_modes: :code:`true` if capacity is applicable + for all apps; otherwise, :code:`false`. + :type is_applicable_for_all_compute_modes: bool + :param site_mode: Shared or Dedicated. + :type site_mode: str + :param is_linux: Is this a linux stamp capacity. + :type is_linux: bool + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'available_capacity': {'key': 'availableCapacity', 'type': 'long'}, + 'total_capacity': {'key': 'totalCapacity', 'type': 'long'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'compute_mode': {'key': 'computeMode', 'type': 'str'}, + 'worker_size': {'key': 'workerSize', 'type': 'str'}, + 'worker_size_id': {'key': 'workerSizeId', 'type': 'int'}, + 'exclude_from_capacity_allocation': {'key': 'excludeFromCapacityAllocation', 'type': 'bool'}, + 'is_applicable_for_all_compute_modes': {'key': 'isApplicableForAllComputeModes', 'type': 'bool'}, + 'site_mode': {'key': 'siteMode', 'type': 'str'}, + 'is_linux': {'key': 'isLinux', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(StampCapacity, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.available_capacity = kwargs.get('available_capacity', None) + self.total_capacity = kwargs.get('total_capacity', None) + self.unit = kwargs.get('unit', None) + self.compute_mode = kwargs.get('compute_mode', None) + self.worker_size = kwargs.get('worker_size', None) + self.worker_size_id = kwargs.get('worker_size_id', None) + self.exclude_from_capacity_allocation = kwargs.get('exclude_from_capacity_allocation', None) + self.is_applicable_for_all_compute_modes = kwargs.get('is_applicable_for_all_compute_modes', None) + self.site_mode = kwargs.get('site_mode', None) + self.is_linux = kwargs.get('is_linux', None) + + +class StampCapacityCollection(msrest.serialization.Model): + """Collection of stamp capacities. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.StampCapacity] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[StampCapacity]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StampCapacityCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class StaticSiteARMResource(Resource): + """Static Site ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param sku: Description of a SKU for a scalable resource. + :type sku: ~azure.mgmt.web.v2021_02_01.models.SkuDescription + :param identity: Managed service identity. + :type identity: ~azure.mgmt.web.v2021_02_01.models.ManagedServiceIdentity + :ivar default_hostname: The default autogenerated hostname for the static site. + :vartype default_hostname: str + :param repository_url: URL for the repository of the static site. + :type repository_url: str + :param branch: The target branch in the repository. + :type branch: str + :ivar custom_domains: The custom domains associated with this static site. + :vartype custom_domains: list[str] + :param repository_token: A user's github repository token. This is used to setup the Github + Actions workflow file and API secrets. + :type repository_token: str + :param build_properties: Build properties to configure on the repository. + :type build_properties: ~azure.mgmt.web.v2021_02_01.models.StaticSiteBuildProperties + :ivar private_endpoint_connections: Private endpoint connections. + :vartype private_endpoint_connections: + list[~azure.mgmt.web.v2021_02_01.models.ResponseMessageEnvelopeRemotePrivateEndpointConnection] + :param staging_environment_policy: State indicating whether staging environments are allowed or + not allowed for a static web app. Possible values include: "Enabled", "Disabled". + :type staging_environment_policy: str or + ~azure.mgmt.web.v2021_02_01.models.StagingEnvironmentPolicy + :param allow_config_file_updates: :code:`false` if config file is locked for this + static web app; otherwise, :code:`true`. + :type allow_config_file_updates: bool + :param template_properties: Template options for generating a new repository. + :type template_properties: ~azure.mgmt.web.v2021_02_01.models.StaticSiteTemplateOptions + :ivar content_distribution_endpoint: The content distribution endpoint for the static site. + :vartype content_distribution_endpoint: str + :ivar key_vault_reference_identity: Identity to use for Key Vault Reference authentication. + :vartype key_vault_reference_identity: str + :ivar user_provided_function_apps: User provided function apps registered with the static site. + :vartype user_provided_function_apps: + list[~azure.mgmt.web.v2021_02_01.models.StaticSiteUserProvidedFunctionApp] + :ivar provider: The provider that submitted the last deployment to the primary environment of + the static site. + :vartype provider: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'default_hostname': {'readonly': True}, + 'custom_domains': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, + 'content_distribution_endpoint': {'readonly': True}, + 'key_vault_reference_identity': {'readonly': True}, + 'user_provided_function_apps': {'readonly': True}, + 'provider': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'SkuDescription'}, + 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, + 'default_hostname': {'key': 'properties.defaultHostname', 'type': 'str'}, + 'repository_url': {'key': 'properties.repositoryUrl', 'type': 'str'}, + 'branch': {'key': 'properties.branch', 'type': 'str'}, + 'custom_domains': {'key': 'properties.customDomains', 'type': '[str]'}, + 'repository_token': {'key': 'properties.repositoryToken', 'type': 'str'}, + 'build_properties': {'key': 'properties.buildProperties', 'type': 'StaticSiteBuildProperties'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[ResponseMessageEnvelopeRemotePrivateEndpointConnection]'}, + 'staging_environment_policy': {'key': 'properties.stagingEnvironmentPolicy', 'type': 'str'}, + 'allow_config_file_updates': {'key': 'properties.allowConfigFileUpdates', 'type': 'bool'}, + 'template_properties': {'key': 'properties.templateProperties', 'type': 'StaticSiteTemplateOptions'}, + 'content_distribution_endpoint': {'key': 'properties.contentDistributionEndpoint', 'type': 'str'}, + 'key_vault_reference_identity': {'key': 'properties.keyVaultReferenceIdentity', 'type': 'str'}, + 'user_provided_function_apps': {'key': 'properties.userProvidedFunctionApps', 'type': '[StaticSiteUserProvidedFunctionApp]'}, + 'provider': {'key': 'properties.provider', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StaticSiteARMResource, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.identity = kwargs.get('identity', None) + self.default_hostname = None + self.repository_url = kwargs.get('repository_url', None) + self.branch = kwargs.get('branch', None) + self.custom_domains = None + self.repository_token = kwargs.get('repository_token', None) + self.build_properties = kwargs.get('build_properties', None) + self.private_endpoint_connections = None + self.staging_environment_policy = kwargs.get('staging_environment_policy', None) + self.allow_config_file_updates = kwargs.get('allow_config_file_updates', None) + self.template_properties = kwargs.get('template_properties', None) + self.content_distribution_endpoint = None + self.key_vault_reference_identity = None + self.user_provided_function_apps = None + self.provider = None + + +class StaticSiteBuildARMResource(ProxyOnlyResource): + """Static Site Build ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar build_id: An identifier for the static site build. + :vartype build_id: str + :ivar source_branch: The source branch. + :vartype source_branch: str + :ivar pull_request_title: The title of a pull request that a static site build is related to. + :vartype pull_request_title: str + :ivar hostname: The hostname for a static site build. + :vartype hostname: str + :ivar created_time_utc: When this build was created. + :vartype created_time_utc: ~datetime.datetime + :ivar last_updated_on: When this build was updated. + :vartype last_updated_on: ~datetime.datetime + :ivar status: The status of the static site build. Possible values include: + "WaitingForDeployment", "Uploading", "Deploying", "Ready", "Failed", "Deleting", "Detached". + :vartype status: str or ~azure.mgmt.web.v2021_02_01.models.BuildStatus + :ivar user_provided_function_apps: User provided function apps registered with the static site + build. + :vartype user_provided_function_apps: + list[~azure.mgmt.web.v2021_02_01.models.StaticSiteUserProvidedFunctionApp] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'build_id': {'readonly': True}, + 'source_branch': {'readonly': True}, + 'pull_request_title': {'readonly': True}, + 'hostname': {'readonly': True}, + 'created_time_utc': {'readonly': True}, + 'last_updated_on': {'readonly': True}, + 'status': {'readonly': True}, + 'user_provided_function_apps': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'build_id': {'key': 'properties.buildId', 'type': 'str'}, + 'source_branch': {'key': 'properties.sourceBranch', 'type': 'str'}, + 'pull_request_title': {'key': 'properties.pullRequestTitle', 'type': 'str'}, + 'hostname': {'key': 'properties.hostname', 'type': 'str'}, + 'created_time_utc': {'key': 'properties.createdTimeUtc', 'type': 'iso-8601'}, + 'last_updated_on': {'key': 'properties.lastUpdatedOn', 'type': 'iso-8601'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'user_provided_function_apps': {'key': 'properties.userProvidedFunctionApps', 'type': '[StaticSiteUserProvidedFunctionApp]'}, + } + + def __init__( + self, + **kwargs + ): + super(StaticSiteBuildARMResource, self).__init__(**kwargs) + self.build_id = None + self.source_branch = None + self.pull_request_title = None + self.hostname = None + self.created_time_utc = None + self.last_updated_on = None + self.status = None + self.user_provided_function_apps = None + + +class StaticSiteBuildCollection(msrest.serialization.Model): + """Collection of static site builds. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.StaticSiteBuildARMResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[StaticSiteBuildARMResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StaticSiteBuildCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class StaticSiteBuildProperties(msrest.serialization.Model): + """Build properties for the static site. + + :param app_location: The path to the app code within the repository. + :type app_location: str + :param api_location: The path to the api code within the repository. + :type api_location: str + :param app_artifact_location: Deprecated: The path of the app artifacts after building + (deprecated in favor of OutputLocation). + :type app_artifact_location: str + :param output_location: The output path of the app after building. + :type output_location: str + :param app_build_command: A custom command to run during deployment of the static content + application. + :type app_build_command: str + :param api_build_command: A custom command to run during deployment of the Azure Functions API + application. + :type api_build_command: str + :param skip_github_action_workflow_generation: Skip Github Action workflow generation. + :type skip_github_action_workflow_generation: bool + :param github_action_secret_name_override: Github Action secret name override. + :type github_action_secret_name_override: str + """ + + _attribute_map = { + 'app_location': {'key': 'appLocation', 'type': 'str'}, + 'api_location': {'key': 'apiLocation', 'type': 'str'}, + 'app_artifact_location': {'key': 'appArtifactLocation', 'type': 'str'}, + 'output_location': {'key': 'outputLocation', 'type': 'str'}, + 'app_build_command': {'key': 'appBuildCommand', 'type': 'str'}, + 'api_build_command': {'key': 'apiBuildCommand', 'type': 'str'}, + 'skip_github_action_workflow_generation': {'key': 'skipGithubActionWorkflowGeneration', 'type': 'bool'}, + 'github_action_secret_name_override': {'key': 'githubActionSecretNameOverride', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StaticSiteBuildProperties, self).__init__(**kwargs) + self.app_location = kwargs.get('app_location', None) + self.api_location = kwargs.get('api_location', None) + self.app_artifact_location = kwargs.get('app_artifact_location', None) + self.output_location = kwargs.get('output_location', None) + self.app_build_command = kwargs.get('app_build_command', None) + self.api_build_command = kwargs.get('api_build_command', None) + self.skip_github_action_workflow_generation = kwargs.get('skip_github_action_workflow_generation', None) + self.github_action_secret_name_override = kwargs.get('github_action_secret_name_override', None) + + +class StaticSiteCollection(msrest.serialization.Model): + """Collection of static sites. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.StaticSiteARMResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[StaticSiteARMResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StaticSiteCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class StaticSiteCustomDomainOverviewARMResource(ProxyOnlyResource): + """Static Site Custom Domain Overview ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar domain_name: The domain name for the static site custom domain. + :vartype domain_name: str + :ivar created_on: The date and time on which the custom domain was created for the static site. + :vartype created_on: ~datetime.datetime + :ivar status: The status of the custom domain. Possible values include: + "RetrievingValidationToken", "Validating", "Adding", "Ready", "Failed", "Deleting". + :vartype status: str or ~azure.mgmt.web.v2021_02_01.models.CustomDomainStatus + :ivar validation_token: The TXT record validation token. + :vartype validation_token: str + :ivar error_message: + :vartype error_message: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'domain_name': {'readonly': True}, + 'created_on': {'readonly': True}, + 'status': {'readonly': True}, + 'validation_token': {'readonly': True}, + 'error_message': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'domain_name': {'key': 'properties.domainName', 'type': 'str'}, + 'created_on': {'key': 'properties.createdOn', 'type': 'iso-8601'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'validation_token': {'key': 'properties.validationToken', 'type': 'str'}, + 'error_message': {'key': 'properties.errorMessage', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StaticSiteCustomDomainOverviewARMResource, self).__init__(**kwargs) + self.domain_name = None + self.created_on = None + self.status = None + self.validation_token = None + self.error_message = None + + +class StaticSiteCustomDomainOverviewCollection(msrest.serialization.Model): + """Collection of static site custom domains. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.StaticSiteCustomDomainOverviewARMResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[StaticSiteCustomDomainOverviewARMResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StaticSiteCustomDomainOverviewCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class StaticSiteCustomDomainRequestPropertiesARMResource(ProxyOnlyResource): + """Static Site Custom Domain Request Properties ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param validation_method: Validation method for adding a custom domain. + :type validation_method: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'validation_method': {'key': 'properties.validationMethod', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StaticSiteCustomDomainRequestPropertiesARMResource, self).__init__(**kwargs) + self.validation_method = kwargs.get('validation_method', "cname-delegation") + + +class StaticSiteFunctionOverviewARMResource(ProxyOnlyResource): + """Static Site Function Overview ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar function_name: The name for the function. + :vartype function_name: str + :ivar trigger_type: The trigger type of the function. Possible values include: "HttpTrigger", + "Unknown". + :vartype trigger_type: str or ~azure.mgmt.web.v2021_02_01.models.TriggerTypes + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'function_name': {'readonly': True}, + 'trigger_type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'function_name': {'key': 'properties.functionName', 'type': 'str'}, + 'trigger_type': {'key': 'properties.triggerType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StaticSiteFunctionOverviewARMResource, self).__init__(**kwargs) + self.function_name = None + self.trigger_type = None + + +class StaticSiteFunctionOverviewCollection(msrest.serialization.Model): + """Collection of static site functions. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.StaticSiteFunctionOverviewARMResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[StaticSiteFunctionOverviewARMResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StaticSiteFunctionOverviewCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class StaticSitePatchResource(ProxyOnlyResource): + """ARM resource for a static site when patching. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar default_hostname: The default autogenerated hostname for the static site. + :vartype default_hostname: str + :param repository_url: URL for the repository of the static site. + :type repository_url: str + :param branch: The target branch in the repository. + :type branch: str + :ivar custom_domains: The custom domains associated with this static site. + :vartype custom_domains: list[str] + :param repository_token: A user's github repository token. This is used to setup the Github + Actions workflow file and API secrets. + :type repository_token: str + :param build_properties: Build properties to configure on the repository. + :type build_properties: ~azure.mgmt.web.v2021_02_01.models.StaticSiteBuildProperties + :ivar private_endpoint_connections: Private endpoint connections. + :vartype private_endpoint_connections: + list[~azure.mgmt.web.v2021_02_01.models.ResponseMessageEnvelopeRemotePrivateEndpointConnection] + :param staging_environment_policy: State indicating whether staging environments are allowed or + not allowed for a static web app. Possible values include: "Enabled", "Disabled". + :type staging_environment_policy: str or + ~azure.mgmt.web.v2021_02_01.models.StagingEnvironmentPolicy + :param allow_config_file_updates: :code:`false` if config file is locked for this + static web app; otherwise, :code:`true`. + :type allow_config_file_updates: bool + :param template_properties: Template options for generating a new repository. + :type template_properties: ~azure.mgmt.web.v2021_02_01.models.StaticSiteTemplateOptions + :ivar content_distribution_endpoint: The content distribution endpoint for the static site. + :vartype content_distribution_endpoint: str + :ivar key_vault_reference_identity: Identity to use for Key Vault Reference authentication. + :vartype key_vault_reference_identity: str + :ivar user_provided_function_apps: User provided function apps registered with the static site. + :vartype user_provided_function_apps: + list[~azure.mgmt.web.v2021_02_01.models.StaticSiteUserProvidedFunctionApp] + :ivar provider: The provider that submitted the last deployment to the primary environment of + the static site. + :vartype provider: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'default_hostname': {'readonly': True}, + 'custom_domains': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, + 'content_distribution_endpoint': {'readonly': True}, + 'key_vault_reference_identity': {'readonly': True}, + 'user_provided_function_apps': {'readonly': True}, + 'provider': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'default_hostname': {'key': 'properties.defaultHostname', 'type': 'str'}, + 'repository_url': {'key': 'properties.repositoryUrl', 'type': 'str'}, + 'branch': {'key': 'properties.branch', 'type': 'str'}, + 'custom_domains': {'key': 'properties.customDomains', 'type': '[str]'}, + 'repository_token': {'key': 'properties.repositoryToken', 'type': 'str'}, + 'build_properties': {'key': 'properties.buildProperties', 'type': 'StaticSiteBuildProperties'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[ResponseMessageEnvelopeRemotePrivateEndpointConnection]'}, + 'staging_environment_policy': {'key': 'properties.stagingEnvironmentPolicy', 'type': 'str'}, + 'allow_config_file_updates': {'key': 'properties.allowConfigFileUpdates', 'type': 'bool'}, + 'template_properties': {'key': 'properties.templateProperties', 'type': 'StaticSiteTemplateOptions'}, + 'content_distribution_endpoint': {'key': 'properties.contentDistributionEndpoint', 'type': 'str'}, + 'key_vault_reference_identity': {'key': 'properties.keyVaultReferenceIdentity', 'type': 'str'}, + 'user_provided_function_apps': {'key': 'properties.userProvidedFunctionApps', 'type': '[StaticSiteUserProvidedFunctionApp]'}, + 'provider': {'key': 'properties.provider', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StaticSitePatchResource, self).__init__(**kwargs) + self.default_hostname = None + self.repository_url = kwargs.get('repository_url', None) + self.branch = kwargs.get('branch', None) + self.custom_domains = None + self.repository_token = kwargs.get('repository_token', None) + self.build_properties = kwargs.get('build_properties', None) + self.private_endpoint_connections = None + self.staging_environment_policy = kwargs.get('staging_environment_policy', None) + self.allow_config_file_updates = kwargs.get('allow_config_file_updates', None) + self.template_properties = kwargs.get('template_properties', None) + self.content_distribution_endpoint = None + self.key_vault_reference_identity = None + self.user_provided_function_apps = None + self.provider = None + + +class StaticSiteResetPropertiesARMResource(ProxyOnlyResource): + """Static Site Reset Properties ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param repository_token: The token which proves admin privileges to the repository. + :type repository_token: str + :param should_update_repository: Determines whether the repository should be updated with the + new properties. + :type should_update_repository: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'repository_token': {'key': 'properties.repositoryToken', 'type': 'str'}, + 'should_update_repository': {'key': 'properties.shouldUpdateRepository', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(StaticSiteResetPropertiesARMResource, self).__init__(**kwargs) + self.repository_token = kwargs.get('repository_token', None) + self.should_update_repository = kwargs.get('should_update_repository', None) + + +class StaticSitesWorkflowPreview(ProxyOnlyResource): + """Preview for the Static Site Workflow to be generated. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar path: The path for the workflow file to be generated. + :vartype path: str + :ivar contents: The contents for the workflow file to be generated. + :vartype contents: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'path': {'readonly': True}, + 'contents': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'path': {'key': 'properties.path', 'type': 'str'}, + 'contents': {'key': 'properties.contents', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StaticSitesWorkflowPreview, self).__init__(**kwargs) + self.path = None + self.contents = None + + +class StaticSitesWorkflowPreviewRequest(ProxyOnlyResource): + """Request entity for previewing the Static Site workflow. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param repository_url: URL for the repository of the static site. + :type repository_url: str + :param branch: The target branch in the repository. + :type branch: str + :param build_properties: Build properties to configure on the repository. + :type build_properties: ~azure.mgmt.web.v2021_02_01.models.StaticSiteBuildProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'repository_url': {'key': 'properties.repositoryUrl', 'type': 'str'}, + 'branch': {'key': 'properties.branch', 'type': 'str'}, + 'build_properties': {'key': 'properties.buildProperties', 'type': 'StaticSiteBuildProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(StaticSitesWorkflowPreviewRequest, self).__init__(**kwargs) + self.repository_url = kwargs.get('repository_url', None) + self.branch = kwargs.get('branch', None) + self.build_properties = kwargs.get('build_properties', None) + + +class StaticSiteTemplateOptions(msrest.serialization.Model): + """Template Options for the static site. + + :param template_repository_url: URL of the template repository. The newly generated repository + will be based on this one. + :type template_repository_url: str + :param owner: Owner of the newly generated repository. + :type owner: str + :param repository_name: Name of the newly generated repository. + :type repository_name: str + :param description: Description of the newly generated repository. + :type description: str + :param is_private: Whether or not the newly generated repository is a private repository. + Defaults to false (i.e. public). + :type is_private: bool + """ + + _attribute_map = { + 'template_repository_url': {'key': 'templateRepositoryUrl', 'type': 'str'}, + 'owner': {'key': 'owner', 'type': 'str'}, + 'repository_name': {'key': 'repositoryName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'is_private': {'key': 'isPrivate', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(StaticSiteTemplateOptions, self).__init__(**kwargs) + self.template_repository_url = kwargs.get('template_repository_url', None) + self.owner = kwargs.get('owner', None) + self.repository_name = kwargs.get('repository_name', None) + self.description = kwargs.get('description', None) + self.is_private = kwargs.get('is_private', None) + + +class StaticSiteUserARMResource(ProxyOnlyResource): + """Static Site User ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar provider: The identity provider for the static site user. + :vartype provider: str + :ivar user_id: The user id for the static site user. + :vartype user_id: str + :ivar display_name: The display name for the static site user. + :vartype display_name: str + :param roles: The roles for the static site user, in free-form string format. + :type roles: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provider': {'readonly': True}, + 'user_id': {'readonly': True}, + 'display_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'provider': {'key': 'properties.provider', 'type': 'str'}, + 'user_id': {'key': 'properties.userId', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'roles': {'key': 'properties.roles', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StaticSiteUserARMResource, self).__init__(**kwargs) + self.provider = None + self.user_id = None + self.display_name = None + self.roles = kwargs.get('roles', None) + + +class StaticSiteUserCollection(msrest.serialization.Model): + """Collection of static site custom users. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.StaticSiteUserARMResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[StaticSiteUserARMResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StaticSiteUserCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class StaticSiteUserInvitationRequestResource(ProxyOnlyResource): + """Static sites user roles invitation resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param domain: The domain name for the static site custom domain. + :type domain: str + :param provider: The identity provider for the static site user. + :type provider: str + :param user_details: The user id for the static site user. + :type user_details: str + :param roles: The roles for the static site user, in free-form string format. + :type roles: str + :param num_hours_to_expiration: The number of hours the sas token stays valid. + :type num_hours_to_expiration: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'domain': {'key': 'properties.domain', 'type': 'str'}, + 'provider': {'key': 'properties.provider', 'type': 'str'}, + 'user_details': {'key': 'properties.userDetails', 'type': 'str'}, + 'roles': {'key': 'properties.roles', 'type': 'str'}, + 'num_hours_to_expiration': {'key': 'properties.numHoursToExpiration', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(StaticSiteUserInvitationRequestResource, self).__init__(**kwargs) + self.domain = kwargs.get('domain', None) + self.provider = kwargs.get('provider', None) + self.user_details = kwargs.get('user_details', None) + self.roles = kwargs.get('roles', None) + self.num_hours_to_expiration = kwargs.get('num_hours_to_expiration', None) + + +class StaticSiteUserInvitationResponseResource(ProxyOnlyResource): + """Static sites user roles invitation link resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar expires_on: The expiration time of the invitation. + :vartype expires_on: ~datetime.datetime + :ivar invitation_url: The url for the invitation link. + :vartype invitation_url: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'expires_on': {'readonly': True}, + 'invitation_url': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'expires_on': {'key': 'properties.expiresOn', 'type': 'iso-8601'}, + 'invitation_url': {'key': 'properties.invitationUrl', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StaticSiteUserInvitationResponseResource, self).__init__(**kwargs) + self.expires_on = None + self.invitation_url = None + + +class StaticSiteUserProvidedFunctionApp(ProxyOnlyResource): + """A static site user provided function. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param function_app_resource_id: The resource id of the function app registered with the static + site. + :type function_app_resource_id: str + :param function_app_region: The region of the function app registered with the static site. + :type function_app_region: str + :ivar created_on: The date and time on which the function app was registered with the static + site. + :vartype created_on: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'created_on': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'function_app_resource_id': {'key': 'properties.functionAppResourceId', 'type': 'str'}, + 'function_app_region': {'key': 'properties.functionAppRegion', 'type': 'str'}, + 'created_on': {'key': 'properties.createdOn', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(StaticSiteUserProvidedFunctionApp, self).__init__(**kwargs) + self.function_app_resource_id = kwargs.get('function_app_resource_id', None) + self.function_app_region = kwargs.get('function_app_region', None) + self.created_on = None + + +class StaticSiteUserProvidedFunctionAppARMResource(ProxyOnlyResource): + """Static Site User Provided Function App ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param function_app_resource_id: The resource id of the function app registered with the static + site. + :type function_app_resource_id: str + :param function_app_region: The region of the function app registered with the static site. + :type function_app_region: str + :ivar created_on: The date and time on which the function app was registered with the static + site. + :vartype created_on: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'created_on': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'function_app_resource_id': {'key': 'properties.functionAppResourceId', 'type': 'str'}, + 'function_app_region': {'key': 'properties.functionAppRegion', 'type': 'str'}, + 'created_on': {'key': 'properties.createdOn', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(StaticSiteUserProvidedFunctionAppARMResource, self).__init__(**kwargs) + self.function_app_resource_id = kwargs.get('function_app_resource_id', None) + self.function_app_region = kwargs.get('function_app_region', None) + self.created_on = None + + +class StaticSiteUserProvidedFunctionAppsCollection(msrest.serialization.Model): + """Collection of static site user provided function apps. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: + list[~azure.mgmt.web.v2021_02_01.models.StaticSiteUserProvidedFunctionAppARMResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[StaticSiteUserProvidedFunctionAppARMResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StaticSiteUserProvidedFunctionAppsCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class StaticSiteZipDeploymentARMResource(ProxyOnlyResource): + """Static site zip deployment ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param app_zip_url: URL for the zipped app content. + :type app_zip_url: str + :param api_zip_url: URL for the zipped api content. + :type api_zip_url: str + :param deployment_title: A title to label the deployment. + :type deployment_title: str + :param provider: The provider submitting this deployment. + :type provider: str + :param function_language: The language of the api content, if it exists. + :type function_language: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'app_zip_url': {'key': 'properties.appZipUrl', 'type': 'str'}, + 'api_zip_url': {'key': 'properties.apiZipUrl', 'type': 'str'}, + 'deployment_title': {'key': 'properties.deploymentTitle', 'type': 'str'}, + 'provider': {'key': 'properties.provider', 'type': 'str'}, + 'function_language': {'key': 'properties.functionLanguage', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StaticSiteZipDeploymentARMResource, self).__init__(**kwargs) + self.app_zip_url = kwargs.get('app_zip_url', None) + self.api_zip_url = kwargs.get('api_zip_url', None) + self.deployment_title = kwargs.get('deployment_title', None) + self.provider = kwargs.get('provider', None) + self.function_language = kwargs.get('function_language', None) + + +class Status(msrest.serialization.Model): + """Identify the status of the most severe insight generated by the detector. + + :param message: Descriptive message. + :type message: str + :param status_id: Level of the most severe insight generated by the detector. Possible values + include: "Critical", "Warning", "Info", "Success", "None". + :type status_id: str or ~azure.mgmt.web.v2021_02_01.models.InsightStatus + """ + + _attribute_map = { + 'message': {'key': 'message', 'type': 'str'}, + 'status_id': {'key': 'statusId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Status, self).__init__(**kwargs) + self.message = kwargs.get('message', None) + self.status_id = kwargs.get('status_id', None) + + +class StatusCodesBasedTrigger(msrest.serialization.Model): + """Trigger based on status code. + + :param status: HTTP status code. + :type status: int + :param sub_status: Request Sub Status. + :type sub_status: int + :param win32_status: Win32 error code. + :type win32_status: int + :param count: Request Count. + :type count: int + :param time_interval: Time interval. + :type time_interval: str + :param path: Request Path. + :type path: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'int'}, + 'sub_status': {'key': 'subStatus', 'type': 'int'}, + 'win32_status': {'key': 'win32Status', 'type': 'int'}, + 'count': {'key': 'count', 'type': 'int'}, + 'time_interval': {'key': 'timeInterval', 'type': 'str'}, + 'path': {'key': 'path', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StatusCodesBasedTrigger, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.sub_status = kwargs.get('sub_status', None) + self.win32_status = kwargs.get('win32_status', None) + self.count = kwargs.get('count', None) + self.time_interval = kwargs.get('time_interval', None) + self.path = kwargs.get('path', None) + + +class StatusCodesRangeBasedTrigger(msrest.serialization.Model): + """Trigger based on range of status codes. + + :param status_codes: HTTP status code. + :type status_codes: str + :param path: + :type path: str + :param count: Request Count. + :type count: int + :param time_interval: Time interval. + :type time_interval: str + """ + + _attribute_map = { + 'status_codes': {'key': 'statusCodes', 'type': 'str'}, + 'path': {'key': 'path', 'type': 'str'}, + 'count': {'key': 'count', 'type': 'int'}, + 'time_interval': {'key': 'timeInterval', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StatusCodesRangeBasedTrigger, self).__init__(**kwargs) + self.status_codes = kwargs.get('status_codes', None) + self.path = kwargs.get('path', None) + self.count = kwargs.get('count', None) + self.time_interval = kwargs.get('time_interval', None) + + +class StorageMigrationOptions(ProxyOnlyResource): + """Options for app content migration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param azurefiles_connection_string: AzureFiles connection string. + :type azurefiles_connection_string: str + :param azurefiles_share: AzureFiles share. + :type azurefiles_share: str + :param switch_site_after_migration: :code:`true`if the app should be switched + over; otherwise, :code:`false`. + :type switch_site_after_migration: bool + :param block_write_access_to_site: :code:`true` if the app should be read only + during copy operation; otherwise, :code:`false`. + :type block_write_access_to_site: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'azurefiles_connection_string': {'key': 'properties.azurefilesConnectionString', 'type': 'str'}, + 'azurefiles_share': {'key': 'properties.azurefilesShare', 'type': 'str'}, + 'switch_site_after_migration': {'key': 'properties.switchSiteAfterMigration', 'type': 'bool'}, + 'block_write_access_to_site': {'key': 'properties.blockWriteAccessToSite', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageMigrationOptions, self).__init__(**kwargs) + self.azurefiles_connection_string = kwargs.get('azurefiles_connection_string', None) + self.azurefiles_share = kwargs.get('azurefiles_share', None) + self.switch_site_after_migration = kwargs.get('switch_site_after_migration', False) + self.block_write_access_to_site = kwargs.get('block_write_access_to_site', False) + + +class StorageMigrationResponse(ProxyOnlyResource): + """Response for a migration of app content request. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar operation_id: When server starts the migration process, it will return an operation ID + identifying that particular migration operation. + :vartype operation_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'operation_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'operation_id': {'key': 'properties.operationId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageMigrationResponse, self).__init__(**kwargs) + self.operation_id = None + + +class StringDictionary(ProxyOnlyResource): + """String dictionary resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param properties: Settings. + :type properties: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(StringDictionary, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class StringList(ProxyOnlyResource): + """String list resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param properties: List of string resources. + :type properties: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(StringList, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class SupportTopic(msrest.serialization.Model): + """Defines a unique Support Topic. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Support Topic Id. + :vartype id: str + :ivar pes_id: Unique resource Id. + :vartype pes_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'pes_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'pes_id': {'key': 'pesId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SupportTopic, self).__init__(**kwargs) + self.id = None + self.pes_id = None + + +class SwiftVirtualNetwork(ProxyOnlyResource): + """Swift Virtual Network Contract. This is used to enable the new Swift way of doing virtual network integration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param subnet_resource_id: The Virtual Network subnet's resource ID. This is the subnet that + this Web App will join. This subnet must have a delegation to Microsoft.Web/serverFarms defined + first. + :type subnet_resource_id: str + :param swift_supported: A flag that specifies if the scale unit this Web App is on supports + Swift integration. + :type swift_supported: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'subnet_resource_id': {'key': 'properties.subnetResourceId', 'type': 'str'}, + 'swift_supported': {'key': 'properties.swiftSupported', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(SwiftVirtualNetwork, self).__init__(**kwargs) + self.subnet_resource_id = kwargs.get('subnet_resource_id', None) + self.swift_supported = kwargs.get('swift_supported', None) + + +class TldLegalAgreement(msrest.serialization.Model): + """Legal agreement for a top level domain. + + All required parameters must be populated in order to send to Azure. + + :param agreement_key: Required. Unique identifier for the agreement. + :type agreement_key: str + :param title: Required. Agreement title. + :type title: str + :param content: Required. Agreement details. + :type content: str + :param url: URL where a copy of the agreement details is hosted. + :type url: str + """ + + _validation = { + 'agreement_key': {'required': True}, + 'title': {'required': True}, + 'content': {'required': True}, + } + + _attribute_map = { + 'agreement_key': {'key': 'agreementKey', 'type': 'str'}, + 'title': {'key': 'title', 'type': 'str'}, + 'content': {'key': 'content', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TldLegalAgreement, self).__init__(**kwargs) + self.agreement_key = kwargs['agreement_key'] + self.title = kwargs['title'] + self.content = kwargs['content'] + self.url = kwargs.get('url', None) + + +class TldLegalAgreementCollection(msrest.serialization.Model): + """Collection of top-level domain legal agreements. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.TldLegalAgreement] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[TldLegalAgreement]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TldLegalAgreementCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class TokenStore(msrest.serialization.Model): + """The configuration settings of the token store. + + :param enabled: :code:`true` to durably store platform-specific security tokens + that are obtained during login flows; otherwise, :code:`false`. + The default is :code:`false`. + :type enabled: bool + :param token_refresh_extension_hours: The number of hours after session token expiration that a + session token can be used to + call the token refresh API. The default is 72 hours. + :type token_refresh_extension_hours: float + :param file_system: The configuration settings of the storage of the tokens if a file system is + used. + :type file_system: ~azure.mgmt.web.v2021_02_01.models.FileSystemTokenStore + :param azure_blob_storage: The configuration settings of the storage of the tokens if blob + storage is used. + :type azure_blob_storage: ~azure.mgmt.web.v2021_02_01.models.BlobStorageTokenStore + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'token_refresh_extension_hours': {'key': 'tokenRefreshExtensionHours', 'type': 'float'}, + 'file_system': {'key': 'fileSystem', 'type': 'FileSystemTokenStore'}, + 'azure_blob_storage': {'key': 'azureBlobStorage', 'type': 'BlobStorageTokenStore'}, + } + + def __init__( + self, + **kwargs + ): + super(TokenStore, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.token_refresh_extension_hours = kwargs.get('token_refresh_extension_hours', None) + self.file_system = kwargs.get('file_system', None) + self.azure_blob_storage = kwargs.get('azure_blob_storage', None) + + +class TopLevelDomain(ProxyOnlyResource): + """A top level domain object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param privacy: If :code:`true`, then the top level domain supports domain + privacy; otherwise, :code:`false`. + :type privacy: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'privacy': {'key': 'properties.privacy', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(TopLevelDomain, self).__init__(**kwargs) + self.privacy = kwargs.get('privacy', None) + + +class TopLevelDomainAgreementOption(msrest.serialization.Model): + """Options for retrieving the list of top level domain legal agreements. + + :param include_privacy: If :code:`true`, then the list of agreements will include + agreements for domain privacy as well; otherwise, :code:`false`. + :type include_privacy: bool + :param for_transfer: If :code:`true`, then the list of agreements will include + agreements for domain transfer as well; otherwise, :code:`false`. + :type for_transfer: bool + """ + + _attribute_map = { + 'include_privacy': {'key': 'includePrivacy', 'type': 'bool'}, + 'for_transfer': {'key': 'forTransfer', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(TopLevelDomainAgreementOption, self).__init__(**kwargs) + self.include_privacy = kwargs.get('include_privacy', None) + self.for_transfer = kwargs.get('for_transfer', None) + + +class TopLevelDomainCollection(msrest.serialization.Model): + """Collection of Top-level domains. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.TopLevelDomain] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[TopLevelDomain]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TopLevelDomainCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class TriggeredJobHistory(ProxyOnlyResource): + """Triggered Web Job History. List of Triggered Web Job Run Information elements. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param runs: List of triggered web job runs. + :type runs: list[~azure.mgmt.web.v2021_02_01.models.TriggeredJobRun] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'runs': {'key': 'properties.runs', 'type': '[TriggeredJobRun]'}, + } + + def __init__( + self, + **kwargs + ): + super(TriggeredJobHistory, self).__init__(**kwargs) + self.runs = kwargs.get('runs', None) + + +class TriggeredJobHistoryCollection(msrest.serialization.Model): + """Collection of Kudu continuous web job information elements. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.TriggeredJobHistory] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[TriggeredJobHistory]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TriggeredJobHistoryCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class TriggeredJobRun(msrest.serialization.Model): + """Triggered Web Job Run Information. + + :param web_job_id: Job ID. + :type web_job_id: str + :param web_job_name: Job name. + :type web_job_name: str + :param status: Job status. Possible values include: "Success", "Failed", "Error". + :type status: str or ~azure.mgmt.web.v2021_02_01.models.TriggeredWebJobStatus + :param start_time: Start time. + :type start_time: ~datetime.datetime + :param end_time: End time. + :type end_time: ~datetime.datetime + :param duration: Job duration. + :type duration: str + :param output_url: Output URL. + :type output_url: str + :param error_url: Error URL. + :type error_url: str + :param url: Job URL. + :type url: str + :param job_name: Job name. + :type job_name: str + :param trigger: Job trigger. + :type trigger: str + """ + + _attribute_map = { + 'web_job_id': {'key': 'web_job_id', 'type': 'str'}, + 'web_job_name': {'key': 'web_job_name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'start_time': {'key': 'start_time', 'type': 'iso-8601'}, + 'end_time': {'key': 'end_time', 'type': 'iso-8601'}, + 'duration': {'key': 'duration', 'type': 'str'}, + 'output_url': {'key': 'output_url', 'type': 'str'}, + 'error_url': {'key': 'error_url', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'job_name': {'key': 'job_name', 'type': 'str'}, + 'trigger': {'key': 'trigger', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TriggeredJobRun, self).__init__(**kwargs) + self.web_job_id = kwargs.get('web_job_id', None) + self.web_job_name = kwargs.get('web_job_name', None) + self.status = kwargs.get('status', None) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.duration = kwargs.get('duration', None) + self.output_url = kwargs.get('output_url', None) + self.error_url = kwargs.get('error_url', None) + self.url = kwargs.get('url', None) + self.job_name = kwargs.get('job_name', None) + self.trigger = kwargs.get('trigger', None) + + +class TriggeredWebJob(ProxyOnlyResource): + """Triggered Web Job Information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param latest_run: Latest job run information. + :type latest_run: ~azure.mgmt.web.v2021_02_01.models.TriggeredJobRun + :param history_url: History URL. + :type history_url: str + :param scheduler_logs_url: Scheduler Logs URL. + :type scheduler_logs_url: str + :param run_command: Run command. + :type run_command: str + :param url: Job URL. + :type url: str + :param extra_info_url: Extra Info URL. + :type extra_info_url: str + :param web_job_type: Job type. Possible values include: "Continuous", "Triggered". + :type web_job_type: str or ~azure.mgmt.web.v2021_02_01.models.WebJobType + :param error: Error information. + :type error: str + :param using_sdk: Using SDK?. + :type using_sdk: bool + :param settings: Job settings. + :type settings: dict[str, any] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'latest_run': {'key': 'properties.latest_run', 'type': 'TriggeredJobRun'}, + 'history_url': {'key': 'properties.history_url', 'type': 'str'}, + 'scheduler_logs_url': {'key': 'properties.scheduler_logs_url', 'type': 'str'}, + 'run_command': {'key': 'properties.run_command', 'type': 'str'}, + 'url': {'key': 'properties.url', 'type': 'str'}, + 'extra_info_url': {'key': 'properties.extra_info_url', 'type': 'str'}, + 'web_job_type': {'key': 'properties.web_job_type', 'type': 'str'}, + 'error': {'key': 'properties.error', 'type': 'str'}, + 'using_sdk': {'key': 'properties.using_sdk', 'type': 'bool'}, + 'settings': {'key': 'properties.settings', 'type': '{object}'}, + } + + def __init__( + self, + **kwargs + ): + super(TriggeredWebJob, self).__init__(**kwargs) + self.latest_run = kwargs.get('latest_run', None) + self.history_url = kwargs.get('history_url', None) + self.scheduler_logs_url = kwargs.get('scheduler_logs_url', None) + self.run_command = kwargs.get('run_command', None) + self.url = kwargs.get('url', None) + self.extra_info_url = kwargs.get('extra_info_url', None) + self.web_job_type = kwargs.get('web_job_type', None) + self.error = kwargs.get('error', None) + self.using_sdk = kwargs.get('using_sdk', None) + self.settings = kwargs.get('settings', None) + + +class TriggeredWebJobCollection(msrest.serialization.Model): + """Collection of Kudu continuous web job information elements. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.TriggeredWebJob] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[TriggeredWebJob]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TriggeredWebJobCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class Twitter(msrest.serialization.Model): + """The configuration settings of the Twitter provider. + + :param enabled: :code:`false` if the Twitter provider should not be enabled + despite the set registration; otherwise, :code:`true`. + :type enabled: bool + :param registration: The configuration settings of the app registration for the Twitter + provider. + :type registration: ~azure.mgmt.web.v2021_02_01.models.TwitterRegistration + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'TwitterRegistration'}, + } + + def __init__( + self, + **kwargs + ): + super(Twitter, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.registration = kwargs.get('registration', None) + + +class TwitterRegistration(msrest.serialization.Model): + """The configuration settings of the app registration for the Twitter provider. + + :param consumer_key: The OAuth 1.0a consumer key of the Twitter application used for sign-in. + This setting is required for enabling Twitter Sign-In. + Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in. + :type consumer_key: str + :param consumer_secret_setting_name: The app setting name that contains the OAuth 1.0a consumer + secret of the Twitter + application used for sign-in. + :type consumer_secret_setting_name: str + """ + + _attribute_map = { + 'consumer_key': {'key': 'consumerKey', 'type': 'str'}, + 'consumer_secret_setting_name': {'key': 'consumerSecretSettingName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TwitterRegistration, self).__init__(**kwargs) + self.consumer_key = kwargs.get('consumer_key', None) + self.consumer_secret_setting_name = kwargs.get('consumer_secret_setting_name', None) + + +class Usage(ProxyOnlyResource): + """Usage of the quota resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar display_name: Friendly name shown in the UI. + :vartype display_name: str + :ivar resource_name: Name of the quota resource. + :vartype resource_name: str + :ivar unit: Units of measurement for the quota resource. + :vartype unit: str + :ivar current_value: The current value of the resource counter. + :vartype current_value: long + :ivar limit: The resource limit. + :vartype limit: long + :ivar next_reset_time: Next reset time for the resource counter. + :vartype next_reset_time: ~datetime.datetime + :ivar compute_mode: Compute mode used for this usage. Possible values include: "Shared", + "Dedicated", "Dynamic". + :vartype compute_mode: str or ~azure.mgmt.web.v2021_02_01.models.ComputeModeOptions + :ivar site_mode: Site mode used for this usage. + :vartype site_mode: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'display_name': {'readonly': True}, + 'resource_name': {'readonly': True}, + 'unit': {'readonly': True}, + 'current_value': {'readonly': True}, + 'limit': {'readonly': True}, + 'next_reset_time': {'readonly': True}, + 'compute_mode': {'readonly': True}, + 'site_mode': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'resource_name': {'key': 'properties.resourceName', 'type': 'str'}, + 'unit': {'key': 'properties.unit', 'type': 'str'}, + 'current_value': {'key': 'properties.currentValue', 'type': 'long'}, + 'limit': {'key': 'properties.limit', 'type': 'long'}, + 'next_reset_time': {'key': 'properties.nextResetTime', 'type': 'iso-8601'}, + 'compute_mode': {'key': 'properties.computeMode', 'type': 'str'}, + 'site_mode': {'key': 'properties.siteMode', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Usage, self).__init__(**kwargs) + self.display_name = None + self.resource_name = None + self.unit = None + self.current_value = None + self.limit = None + self.next_reset_time = None + self.compute_mode = None + self.site_mode = None + + +class UsageCollection(msrest.serialization.Model): + """Collection of usages. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.Usage] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Usage]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UsageCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class User(ProxyOnlyResource): + """User credentials used for publishing activity. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param publishing_user_name: Username used for publishing. + :type publishing_user_name: str + :param publishing_password: Password used for publishing. + :type publishing_password: str + :param publishing_password_hash: Password hash used for publishing. + :type publishing_password_hash: str + :param publishing_password_hash_salt: Password hash salt used for publishing. + :type publishing_password_hash_salt: str + :param scm_uri: Url of SCM site. + :type scm_uri: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'publishing_user_name': {'key': 'properties.publishingUserName', 'type': 'str'}, + 'publishing_password': {'key': 'properties.publishingPassword', 'type': 'str'}, + 'publishing_password_hash': {'key': 'properties.publishingPasswordHash', 'type': 'str'}, + 'publishing_password_hash_salt': {'key': 'properties.publishingPasswordHashSalt', 'type': 'str'}, + 'scm_uri': {'key': 'properties.scmUri', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(User, self).__init__(**kwargs) + self.publishing_user_name = kwargs.get('publishing_user_name', None) + self.publishing_password = kwargs.get('publishing_password', None) + self.publishing_password_hash = kwargs.get('publishing_password_hash', None) + self.publishing_password_hash_salt = kwargs.get('publishing_password_hash_salt', None) + self.scm_uri = kwargs.get('scm_uri', None) + + +class UserAssignedIdentity(msrest.serialization.Model): + """User Assigned identity. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: Principal Id of user assigned identity. + :vartype principal_id: str + :ivar client_id: Client Id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UserAssignedIdentity, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + +class ValidateRequest(msrest.serialization.Model): + """Resource validation request content. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Resource name to verify. + :type name: str + :param type: Required. Resource type used for verification. Possible values include: + "ServerFarm", "Site", "Microsoft.Web/hostingEnvironments". + :type type: str or ~azure.mgmt.web.v2021_02_01.models.ValidateResourceTypes + :param location: Required. Expected location of the resource. + :type location: str + :param server_farm_id: ARM resource ID of an App Service plan that would host the app. + :type server_farm_id: str + :param sku_name: Name of the target SKU for the App Service plan. + :type sku_name: str + :param need_linux_workers: :code:`true` if App Service plan is for Linux workers; + otherwise, :code:`false`. + :type need_linux_workers: bool + :param is_spot: :code:`true` if App Service plan is for Spot instances; otherwise, + :code:`false`. + :type is_spot: bool + :param capacity: Target capacity of the App Service plan (number of VMs). + :type capacity: int + :param hosting_environment: Name of App Service Environment where app or App Service plan + should be created. + :type hosting_environment: str + :param is_xenon: :code:`true` if App Service plan is running as a windows + container. + :type is_xenon: bool + :param container_registry_base_url: Base URL of the container registry. + :type container_registry_base_url: str + :param container_registry_username: Username for to access the container registry. + :type container_registry_username: str + :param container_registry_password: Password for to access the container registry. + :type container_registry_password: str + :param container_image_repository: Repository name (image name). + :type container_image_repository: str + :param container_image_tag: Image tag. + :type container_image_tag: str + :param container_image_platform: Platform (windows or linux). + :type container_image_platform: str + :param app_service_environment: App Service Environment Properties. + :type app_service_environment: ~azure.mgmt.web.v2021_02_01.models.AppServiceEnvironment + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + 'location': {'required': True}, + 'capacity': {'minimum': 1}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'server_farm_id': {'key': 'properties.serverFarmId', 'type': 'str'}, + 'sku_name': {'key': 'properties.skuName', 'type': 'str'}, + 'need_linux_workers': {'key': 'properties.needLinuxWorkers', 'type': 'bool'}, + 'is_spot': {'key': 'properties.isSpot', 'type': 'bool'}, + 'capacity': {'key': 'properties.capacity', 'type': 'int'}, + 'hosting_environment': {'key': 'properties.hostingEnvironment', 'type': 'str'}, + 'is_xenon': {'key': 'properties.isXenon', 'type': 'bool'}, + 'container_registry_base_url': {'key': 'properties.containerRegistryBaseUrl', 'type': 'str'}, + 'container_registry_username': {'key': 'properties.containerRegistryUsername', 'type': 'str'}, + 'container_registry_password': {'key': 'properties.containerRegistryPassword', 'type': 'str'}, + 'container_image_repository': {'key': 'properties.containerImageRepository', 'type': 'str'}, + 'container_image_tag': {'key': 'properties.containerImageTag', 'type': 'str'}, + 'container_image_platform': {'key': 'properties.containerImagePlatform', 'type': 'str'}, + 'app_service_environment': {'key': 'properties.appServiceEnvironment', 'type': 'AppServiceEnvironment'}, + } + + def __init__( + self, + **kwargs + ): + super(ValidateRequest, self).__init__(**kwargs) + self.name = kwargs['name'] + self.type = kwargs['type'] + self.location = kwargs['location'] + self.server_farm_id = kwargs.get('server_farm_id', None) + self.sku_name = kwargs.get('sku_name', None) + self.need_linux_workers = kwargs.get('need_linux_workers', None) + self.is_spot = kwargs.get('is_spot', None) + self.capacity = kwargs.get('capacity', None) + self.hosting_environment = kwargs.get('hosting_environment', None) + self.is_xenon = kwargs.get('is_xenon', None) + self.container_registry_base_url = kwargs.get('container_registry_base_url', None) + self.container_registry_username = kwargs.get('container_registry_username', None) + self.container_registry_password = kwargs.get('container_registry_password', None) + self.container_image_repository = kwargs.get('container_image_repository', None) + self.container_image_tag = kwargs.get('container_image_tag', None) + self.container_image_platform = kwargs.get('container_image_platform', None) + self.app_service_environment = kwargs.get('app_service_environment', None) + + +class ValidateResponse(msrest.serialization.Model): + """Describes the result of resource validation. + + :param status: Result of validation. + :type status: str + :param error: Error details for the case when validation fails. + :type error: ~azure.mgmt.web.v2021_02_01.models.ValidateResponseError + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'ValidateResponseError'}, + } + + def __init__( + self, + **kwargs + ): + super(ValidateResponse, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.error = kwargs.get('error', None) + + +class ValidateResponseError(msrest.serialization.Model): + """Error details for when validation fails. + + :param code: Validation error code. + :type code: str + :param message: Validation error message. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ValidateResponseError, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + + +class VirtualApplication(msrest.serialization.Model): + """Virtual application in an app. + + :param virtual_path: Virtual path. + :type virtual_path: str + :param physical_path: Physical path. + :type physical_path: str + :param preload_enabled: :code:`true` if preloading is enabled; otherwise, + :code:`false`. + :type preload_enabled: bool + :param virtual_directories: Virtual directories for virtual application. + :type virtual_directories: list[~azure.mgmt.web.v2021_02_01.models.VirtualDirectory] + """ + + _attribute_map = { + 'virtual_path': {'key': 'virtualPath', 'type': 'str'}, + 'physical_path': {'key': 'physicalPath', 'type': 'str'}, + 'preload_enabled': {'key': 'preloadEnabled', 'type': 'bool'}, + 'virtual_directories': {'key': 'virtualDirectories', 'type': '[VirtualDirectory]'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualApplication, self).__init__(**kwargs) + self.virtual_path = kwargs.get('virtual_path', None) + self.physical_path = kwargs.get('physical_path', None) + self.preload_enabled = kwargs.get('preload_enabled', None) + self.virtual_directories = kwargs.get('virtual_directories', None) + + +class VirtualDirectory(msrest.serialization.Model): + """Directory for virtual application. + + :param virtual_path: Path to virtual application. + :type virtual_path: str + :param physical_path: Physical path. + :type physical_path: str + """ + + _attribute_map = { + 'virtual_path': {'key': 'virtualPath', 'type': 'str'}, + 'physical_path': {'key': 'physicalPath', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualDirectory, self).__init__(**kwargs) + self.virtual_path = kwargs.get('virtual_path', None) + self.physical_path = kwargs.get('physical_path', None) + + +class VirtualIPMapping(msrest.serialization.Model): + """Virtual IP mapping. + + :param virtual_ip: Virtual IP address. + :type virtual_ip: str + :param internal_http_port: Internal HTTP port. + :type internal_http_port: int + :param internal_https_port: Internal HTTPS port. + :type internal_https_port: int + :param in_use: Is virtual IP mapping in use. + :type in_use: bool + :param service_name: name of the service that virtual IP is assigned to. + :type service_name: str + """ + + _attribute_map = { + 'virtual_ip': {'key': 'virtualIP', 'type': 'str'}, + 'internal_http_port': {'key': 'internalHttpPort', 'type': 'int'}, + 'internal_https_port': {'key': 'internalHttpsPort', 'type': 'int'}, + 'in_use': {'key': 'inUse', 'type': 'bool'}, + 'service_name': {'key': 'serviceName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualIPMapping, self).__init__(**kwargs) + self.virtual_ip = kwargs.get('virtual_ip', None) + self.internal_http_port = kwargs.get('internal_http_port', None) + self.internal_https_port = kwargs.get('internal_https_port', None) + self.in_use = kwargs.get('in_use', None) + self.service_name = kwargs.get('service_name', None) + + +class VirtualNetworkProfile(msrest.serialization.Model): + """Specification for using a Virtual Network. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. Resource id of the Virtual Network. + :type id: str + :ivar name: Name of the Virtual Network (read-only). + :vartype name: str + :ivar type: Resource type of the Virtual Network (read-only). + :vartype type: str + :param subnet: Subnet within the Virtual Network. + :type subnet: str + """ + + _validation = { + 'id': {'required': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'subnet': {'key': 'subnet', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualNetworkProfile, self).__init__(**kwargs) + self.id = kwargs['id'] + self.name = None + self.type = None + self.subnet = kwargs.get('subnet', None) + + +class VnetGateway(ProxyOnlyResource): + """The Virtual Network gateway contract. This is used to give the Virtual Network gateway access to the VPN package. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param vnet_name: The Virtual Network name. + :type vnet_name: str + :param vpn_package_uri: The URI where the VPN package can be downloaded. + :type vpn_package_uri: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'vnet_name': {'key': 'properties.vnetName', 'type': 'str'}, + 'vpn_package_uri': {'key': 'properties.vpnPackageUri', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VnetGateway, self).__init__(**kwargs) + self.vnet_name = kwargs.get('vnet_name', None) + self.vpn_package_uri = kwargs.get('vpn_package_uri', None) + + +class VnetInfo(msrest.serialization.Model): + """Virtual Network information contract. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param vnet_resource_id: The Virtual Network's resource ID. + :type vnet_resource_id: str + :ivar cert_thumbprint: The client certificate thumbprint. + :vartype cert_thumbprint: str + :param cert_blob: A certificate file (.cer) blob containing the public key of the private key + used to authenticate a + Point-To-Site VPN connection. + :type cert_blob: str + :ivar routes: The routes that this Virtual Network connection uses. + :vartype routes: list[~azure.mgmt.web.v2021_02_01.models.VnetRoute] + :ivar resync_required: :code:`true` if a resync is required; otherwise, + :code:`false`. + :vartype resync_required: bool + :param dns_servers: DNS servers to be used by this Virtual Network. This should be a + comma-separated list of IP addresses. + :type dns_servers: str + :param is_swift: Flag that is used to denote if this is VNET injection. + :type is_swift: bool + """ + + _validation = { + 'cert_thumbprint': {'readonly': True}, + 'routes': {'readonly': True}, + 'resync_required': {'readonly': True}, + } + + _attribute_map = { + 'vnet_resource_id': {'key': 'vnetResourceId', 'type': 'str'}, + 'cert_thumbprint': {'key': 'certThumbprint', 'type': 'str'}, + 'cert_blob': {'key': 'certBlob', 'type': 'str'}, + 'routes': {'key': 'routes', 'type': '[VnetRoute]'}, + 'resync_required': {'key': 'resyncRequired', 'type': 'bool'}, + 'dns_servers': {'key': 'dnsServers', 'type': 'str'}, + 'is_swift': {'key': 'isSwift', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(VnetInfo, self).__init__(**kwargs) + self.vnet_resource_id = kwargs.get('vnet_resource_id', None) + self.cert_thumbprint = None + self.cert_blob = kwargs.get('cert_blob', None) + self.routes = None + self.resync_required = None + self.dns_servers = kwargs.get('dns_servers', None) + self.is_swift = kwargs.get('is_swift', None) + + +class VnetInfoResource(ProxyOnlyResource): + """Virtual Network information ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param vnet_resource_id: The Virtual Network's resource ID. + :type vnet_resource_id: str + :ivar cert_thumbprint: The client certificate thumbprint. + :vartype cert_thumbprint: str + :param cert_blob: A certificate file (.cer) blob containing the public key of the private key + used to authenticate a + Point-To-Site VPN connection. + :type cert_blob: str + :ivar routes: The routes that this Virtual Network connection uses. + :vartype routes: list[~azure.mgmt.web.v2021_02_01.models.VnetRoute] + :ivar resync_required: :code:`true` if a resync is required; otherwise, + :code:`false`. + :vartype resync_required: bool + :param dns_servers: DNS servers to be used by this Virtual Network. This should be a + comma-separated list of IP addresses. + :type dns_servers: str + :param is_swift: Flag that is used to denote if this is VNET injection. + :type is_swift: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'cert_thumbprint': {'readonly': True}, + 'routes': {'readonly': True}, + 'resync_required': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'vnet_resource_id': {'key': 'properties.vnetResourceId', 'type': 'str'}, + 'cert_thumbprint': {'key': 'properties.certThumbprint', 'type': 'str'}, + 'cert_blob': {'key': 'properties.certBlob', 'type': 'str'}, + 'routes': {'key': 'properties.routes', 'type': '[VnetRoute]'}, + 'resync_required': {'key': 'properties.resyncRequired', 'type': 'bool'}, + 'dns_servers': {'key': 'properties.dnsServers', 'type': 'str'}, + 'is_swift': {'key': 'properties.isSwift', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(VnetInfoResource, self).__init__(**kwargs) + self.vnet_resource_id = kwargs.get('vnet_resource_id', None) + self.cert_thumbprint = None + self.cert_blob = kwargs.get('cert_blob', None) + self.routes = None + self.resync_required = None + self.dns_servers = kwargs.get('dns_servers', None) + self.is_swift = kwargs.get('is_swift', None) + + +class VnetParameters(ProxyOnlyResource): + """The required set of inputs to validate a VNET. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param vnet_resource_group: The Resource Group of the VNET to be validated. + :type vnet_resource_group: str + :param vnet_name: The name of the VNET to be validated. + :type vnet_name: str + :param vnet_subnet_name: The subnet name to be validated. + :type vnet_subnet_name: str + :param subnet_resource_id: The ARM Resource ID of the subnet to validate. + :type subnet_resource_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'vnet_resource_group': {'key': 'properties.vnetResourceGroup', 'type': 'str'}, + 'vnet_name': {'key': 'properties.vnetName', 'type': 'str'}, + 'vnet_subnet_name': {'key': 'properties.vnetSubnetName', 'type': 'str'}, + 'subnet_resource_id': {'key': 'properties.subnetResourceId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VnetParameters, self).__init__(**kwargs) + self.vnet_resource_group = kwargs.get('vnet_resource_group', None) + self.vnet_name = kwargs.get('vnet_name', None) + self.vnet_subnet_name = kwargs.get('vnet_subnet_name', None) + self.subnet_resource_id = kwargs.get('subnet_resource_id', None) + + +class VnetRoute(ProxyOnlyResource): + """Virtual Network route contract used to pass routing information for a Virtual Network. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param start_address: The starting address for this route. This may also include a CIDR + notation, in which case the end address must not be specified. + :type start_address: str + :param end_address: The ending address for this route. If the start address is specified in + CIDR notation, this must be omitted. + :type end_address: str + :param route_type: The type of route this is: + DEFAULT - By default, every app has routes to the local address ranges specified by RFC1918 + INHERITED - Routes inherited from the real Virtual Network routes + STATIC - Static route set on the app only + + These values will be used for syncing an app's routes with those from a Virtual Network. + Possible values include: "DEFAULT", "INHERITED", "STATIC". + :type route_type: str or ~azure.mgmt.web.v2021_02_01.models.RouteType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'start_address': {'key': 'properties.startAddress', 'type': 'str'}, + 'end_address': {'key': 'properties.endAddress', 'type': 'str'}, + 'route_type': {'key': 'properties.routeType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VnetRoute, self).__init__(**kwargs) + self.start_address = kwargs.get('start_address', None) + self.end_address = kwargs.get('end_address', None) + self.route_type = kwargs.get('route_type', None) + + +class VnetValidationFailureDetails(ProxyOnlyResource): + """A class that describes the reason for a validation failure. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param message: Text describing the validation outcome. + :type message: str + :param failed: A flag describing whether or not validation failed. + :type failed: bool + :param failed_tests: A list of tests that failed in the validation. + :type failed_tests: list[~azure.mgmt.web.v2021_02_01.models.VnetValidationTestFailure] + :param warnings: A list of warnings generated during validation. + :type warnings: list[~azure.mgmt.web.v2021_02_01.models.VnetValidationTestFailure] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'message': {'key': 'properties.message', 'type': 'str'}, + 'failed': {'key': 'properties.failed', 'type': 'bool'}, + 'failed_tests': {'key': 'properties.failedTests', 'type': '[VnetValidationTestFailure]'}, + 'warnings': {'key': 'properties.warnings', 'type': '[VnetValidationTestFailure]'}, + } + + def __init__( + self, + **kwargs + ): + super(VnetValidationFailureDetails, self).__init__(**kwargs) + self.message = kwargs.get('message', None) + self.failed = kwargs.get('failed', None) + self.failed_tests = kwargs.get('failed_tests', None) + self.warnings = kwargs.get('warnings', None) + + +class VnetValidationTestFailure(ProxyOnlyResource): + """A class that describes a test that failed during NSG and UDR validation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param test_name: The name of the test that failed. + :type test_name: str + :param details: The details of what caused the failure, e.g. the blocking rule name, etc. + :type details: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'test_name': {'key': 'properties.testName', 'type': 'str'}, + 'details': {'key': 'properties.details', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VnetValidationTestFailure, self).__init__(**kwargs) + self.test_name = kwargs.get('test_name', None) + self.details = kwargs.get('details', None) + + +class WebAppCollection(msrest.serialization.Model): + """Collection of App Service apps. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.Site] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Site]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(WebAppCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class WebAppInstanceStatusCollection(msrest.serialization.Model): + """Collection of app instances. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.WebSiteInstanceStatus] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[WebSiteInstanceStatus]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(WebAppInstanceStatusCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class WebAppMajorVersion(msrest.serialization.Model): + """Web App stack major version. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar display_text: Web App stack major version (display only). + :vartype display_text: str + :ivar value: Web App stack major version name. + :vartype value: str + :ivar minor_versions: Minor versions associated with the major version. + :vartype minor_versions: list[~azure.mgmt.web.v2021_02_01.models.WebAppMinorVersion] + """ + + _validation = { + 'display_text': {'readonly': True}, + 'value': {'readonly': True}, + 'minor_versions': {'readonly': True}, + } + + _attribute_map = { + 'display_text': {'key': 'displayText', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'minor_versions': {'key': 'minorVersions', 'type': '[WebAppMinorVersion]'}, + } + + def __init__( + self, + **kwargs + ): + super(WebAppMajorVersion, self).__init__(**kwargs) + self.display_text = None + self.value = None + self.minor_versions = None + + +class WebAppMinorVersion(msrest.serialization.Model): + """Web App stack minor version. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar display_text: Web App stack minor version (display only). + :vartype display_text: str + :ivar value: Web App stack major version name. + :vartype value: str + :ivar stack_settings: Settings associated with the minor version. + :vartype stack_settings: ~azure.mgmt.web.v2021_02_01.models.WebAppRuntimes + """ + + _validation = { + 'display_text': {'readonly': True}, + 'value': {'readonly': True}, + 'stack_settings': {'readonly': True}, + } + + _attribute_map = { + 'display_text': {'key': 'displayText', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'stack_settings': {'key': 'stackSettings', 'type': 'WebAppRuntimes'}, + } + + def __init__( + self, + **kwargs + ): + super(WebAppMinorVersion, self).__init__(**kwargs) + self.display_text = None + self.value = None + self.stack_settings = None + + +class WebAppRuntimes(msrest.serialization.Model): + """Web App stack runtimes. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar linux_runtime_settings: Linux-specific settings associated with the minor version. + :vartype linux_runtime_settings: ~azure.mgmt.web.v2021_02_01.models.WebAppRuntimeSettings + :ivar windows_runtime_settings: Windows-specific settings associated with the minor version. + :vartype windows_runtime_settings: ~azure.mgmt.web.v2021_02_01.models.WebAppRuntimeSettings + :ivar linux_container_settings: Linux-specific settings associated with the Java container + minor version. + :vartype linux_container_settings: + ~azure.mgmt.web.v2021_02_01.models.LinuxJavaContainerSettings + :ivar windows_container_settings: Windows-specific settings associated with the Java container + minor version. + :vartype windows_container_settings: + ~azure.mgmt.web.v2021_02_01.models.WindowsJavaContainerSettings + """ + + _validation = { + 'linux_runtime_settings': {'readonly': True}, + 'windows_runtime_settings': {'readonly': True}, + 'linux_container_settings': {'readonly': True}, + 'windows_container_settings': {'readonly': True}, + } + + _attribute_map = { + 'linux_runtime_settings': {'key': 'linuxRuntimeSettings', 'type': 'WebAppRuntimeSettings'}, + 'windows_runtime_settings': {'key': 'windowsRuntimeSettings', 'type': 'WebAppRuntimeSettings'}, + 'linux_container_settings': {'key': 'linuxContainerSettings', 'type': 'LinuxJavaContainerSettings'}, + 'windows_container_settings': {'key': 'windowsContainerSettings', 'type': 'WindowsJavaContainerSettings'}, + } + + def __init__( + self, + **kwargs + ): + super(WebAppRuntimes, self).__init__(**kwargs) + self.linux_runtime_settings = None + self.windows_runtime_settings = None + self.linux_container_settings = None + self.windows_container_settings = None + + +class WebAppRuntimeSettings(msrest.serialization.Model): + """Web App runtime settings. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar runtime_version: Web App stack minor version (runtime only). + :vartype runtime_version: str + :ivar remote_debugging_supported: :code:`true` if remote debugging is supported + for the stack; otherwise, :code:`false`. + :vartype remote_debugging_supported: bool + :ivar app_insights_settings: Application Insights settings associated with the minor version. + :vartype app_insights_settings: + ~azure.mgmt.web.v2021_02_01.models.AppInsightsWebAppStackSettings + :ivar git_hub_action_settings: GitHub Actions settings associated with the minor version. + :vartype git_hub_action_settings: + ~azure.mgmt.web.v2021_02_01.models.GitHubActionWebAppStackSettings + :ivar is_preview: :code:`true` if the stack is in preview; otherwise, + :code:`false`. + :vartype is_preview: bool + :ivar is_deprecated: :code:`true` if the stack is deprecated; otherwise, + :code:`false`. + :vartype is_deprecated: bool + :ivar is_hidden: :code:`true` if the stack should be hidden; otherwise, + :code:`false`. + :vartype is_hidden: bool + :ivar end_of_life_date: End-of-life date for the minor version. + :vartype end_of_life_date: ~datetime.datetime + :ivar is_auto_update: :code:`true` if the stack version is auto-updated; + otherwise, :code:`false`. + :vartype is_auto_update: bool + :ivar is_early_access: :code:`true` if the minor version is early-access; + otherwise, :code:`false`. + :vartype is_early_access: bool + """ + + _validation = { + 'runtime_version': {'readonly': True}, + 'remote_debugging_supported': {'readonly': True}, + 'app_insights_settings': {'readonly': True}, + 'git_hub_action_settings': {'readonly': True}, + 'is_preview': {'readonly': True}, + 'is_deprecated': {'readonly': True}, + 'is_hidden': {'readonly': True}, + 'end_of_life_date': {'readonly': True}, + 'is_auto_update': {'readonly': True}, + 'is_early_access': {'readonly': True}, + } + + _attribute_map = { + 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, + 'remote_debugging_supported': {'key': 'remoteDebuggingSupported', 'type': 'bool'}, + 'app_insights_settings': {'key': 'appInsightsSettings', 'type': 'AppInsightsWebAppStackSettings'}, + 'git_hub_action_settings': {'key': 'gitHubActionSettings', 'type': 'GitHubActionWebAppStackSettings'}, + 'is_preview': {'key': 'isPreview', 'type': 'bool'}, + 'is_deprecated': {'key': 'isDeprecated', 'type': 'bool'}, + 'is_hidden': {'key': 'isHidden', 'type': 'bool'}, + 'end_of_life_date': {'key': 'endOfLifeDate', 'type': 'iso-8601'}, + 'is_auto_update': {'key': 'isAutoUpdate', 'type': 'bool'}, + 'is_early_access': {'key': 'isEarlyAccess', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(WebAppRuntimeSettings, self).__init__(**kwargs) + self.runtime_version = None + self.remote_debugging_supported = None + self.app_insights_settings = None + self.git_hub_action_settings = None + self.is_preview = None + self.is_deprecated = None + self.is_hidden = None + self.end_of_life_date = None + self.is_auto_update = None + self.is_early_access = None + + +class WebAppStack(ProxyOnlyResource): + """Web App stack. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Web App stack location. + :vartype location: str + :ivar display_text: Web App stack (display only). + :vartype display_text: str + :ivar value: Web App stack name. + :vartype value: str + :ivar major_versions: List of major versions available. + :vartype major_versions: list[~azure.mgmt.web.v2021_02_01.models.WebAppMajorVersion] + :ivar preferred_os: Web App stack preferred OS. Possible values include: "Windows", "Linux". + :vartype preferred_os: str or ~azure.mgmt.web.v2021_02_01.models.StackPreferredOs + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'readonly': True}, + 'display_text': {'readonly': True}, + 'value': {'readonly': True}, + 'major_versions': {'readonly': True}, + 'preferred_os': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'display_text': {'key': 'properties.displayText', 'type': 'str'}, + 'value': {'key': 'properties.value', 'type': 'str'}, + 'major_versions': {'key': 'properties.majorVersions', 'type': '[WebAppMajorVersion]'}, + 'preferred_os': {'key': 'properties.preferredOs', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(WebAppStack, self).__init__(**kwargs) + self.location = None + self.display_text = None + self.value = None + self.major_versions = None + self.preferred_os = None + + +class WebAppStackCollection(msrest.serialization.Model): + """Collection of Web app Stacks. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.WebAppStack] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[WebAppStack]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(WebAppStackCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class WebJob(ProxyOnlyResource): + """Web Job Information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param run_command: Run command. + :type run_command: str + :param url: Job URL. + :type url: str + :param extra_info_url: Extra Info URL. + :type extra_info_url: str + :param web_job_type: Job type. Possible values include: "Continuous", "Triggered". + :type web_job_type: str or ~azure.mgmt.web.v2021_02_01.models.WebJobType + :param error: Error information. + :type error: str + :param using_sdk: Using SDK?. + :type using_sdk: bool + :param settings: Job settings. + :type settings: dict[str, any] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'run_command': {'key': 'properties.run_command', 'type': 'str'}, + 'url': {'key': 'properties.url', 'type': 'str'}, + 'extra_info_url': {'key': 'properties.extra_info_url', 'type': 'str'}, + 'web_job_type': {'key': 'properties.web_job_type', 'type': 'str'}, + 'error': {'key': 'properties.error', 'type': 'str'}, + 'using_sdk': {'key': 'properties.using_sdk', 'type': 'bool'}, + 'settings': {'key': 'properties.settings', 'type': '{object}'}, + } + + def __init__( + self, + **kwargs + ): + super(WebJob, self).__init__(**kwargs) + self.run_command = kwargs.get('run_command', None) + self.url = kwargs.get('url', None) + self.extra_info_url = kwargs.get('extra_info_url', None) + self.web_job_type = kwargs.get('web_job_type', None) + self.error = kwargs.get('error', None) + self.using_sdk = kwargs.get('using_sdk', None) + self.settings = kwargs.get('settings', None) + + +class WebJobCollection(msrest.serialization.Model): + """Collection of Kudu web job information elements. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.WebJob] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[WebJob]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(WebJobCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class WebSiteInstanceStatus(ProxyOnlyResource): + """WebSiteInstanceStatus. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param state: Possible values include: "READY", "STOPPED", "UNKNOWN". + :type state: str or ~azure.mgmt.web.v2021_02_01.models.SiteRuntimeState + :param status_url: Link to the GetStatusApi in Kudu. + :type status_url: str + :param detector_url: Link to the Diagnose and Solve Portal. + :type detector_url: str + :param console_url: Link to the console to web app instance. + :type console_url: str + :param health_check_url: Link to the console to web app instance. + :type health_check_url: str + :param containers: Dictionary of :code:``. + :type containers: dict[str, ~azure.mgmt.web.v2021_02_01.models.ContainerInfo] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'status_url': {'key': 'properties.statusUrl', 'type': 'str'}, + 'detector_url': {'key': 'properties.detectorUrl', 'type': 'str'}, + 'console_url': {'key': 'properties.consoleUrl', 'type': 'str'}, + 'health_check_url': {'key': 'properties.healthCheckUrl', 'type': 'str'}, + 'containers': {'key': 'properties.containers', 'type': '{ContainerInfo}'}, + } + + def __init__( + self, + **kwargs + ): + super(WebSiteInstanceStatus, self).__init__(**kwargs) + self.state = kwargs.get('state', None) + self.status_url = kwargs.get('status_url', None) + self.detector_url = kwargs.get('detector_url', None) + self.console_url = kwargs.get('console_url', None) + self.health_check_url = kwargs.get('health_check_url', None) + self.containers = kwargs.get('containers', None) + + +class WindowsJavaContainerSettings(msrest.serialization.Model): + """Windows Java Container settings. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar java_container: Java container (runtime only). + :vartype java_container: str + :ivar java_container_version: Java container version (runtime only). + :vartype java_container_version: str + :ivar is_preview: :code:`true` if the stack is in preview; otherwise, + :code:`false`. + :vartype is_preview: bool + :ivar is_deprecated: :code:`true` if the stack is deprecated; otherwise, + :code:`false`. + :vartype is_deprecated: bool + :ivar is_hidden: :code:`true` if the stack should be hidden; otherwise, + :code:`false`. + :vartype is_hidden: bool + :ivar end_of_life_date: End-of-life date for the minor version. + :vartype end_of_life_date: ~datetime.datetime + :ivar is_auto_update: :code:`true` if the stack version is auto-updated; + otherwise, :code:`false`. + :vartype is_auto_update: bool + :ivar is_early_access: :code:`true` if the minor version is early-access; + otherwise, :code:`false`. + :vartype is_early_access: bool + """ + + _validation = { + 'java_container': {'readonly': True}, + 'java_container_version': {'readonly': True}, + 'is_preview': {'readonly': True}, + 'is_deprecated': {'readonly': True}, + 'is_hidden': {'readonly': True}, + 'end_of_life_date': {'readonly': True}, + 'is_auto_update': {'readonly': True}, + 'is_early_access': {'readonly': True}, + } + + _attribute_map = { + 'java_container': {'key': 'javaContainer', 'type': 'str'}, + 'java_container_version': {'key': 'javaContainerVersion', 'type': 'str'}, + 'is_preview': {'key': 'isPreview', 'type': 'bool'}, + 'is_deprecated': {'key': 'isDeprecated', 'type': 'bool'}, + 'is_hidden': {'key': 'isHidden', 'type': 'bool'}, + 'end_of_life_date': {'key': 'endOfLifeDate', 'type': 'iso-8601'}, + 'is_auto_update': {'key': 'isAutoUpdate', 'type': 'bool'}, + 'is_early_access': {'key': 'isEarlyAccess', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(WindowsJavaContainerSettings, self).__init__(**kwargs) + self.java_container = None + self.java_container_version = None + self.is_preview = None + self.is_deprecated = None + self.is_hidden = None + self.end_of_life_date = None + self.is_auto_update = None + self.is_early_access = None + + +class WorkerPoolCollection(msrest.serialization.Model): + """Collection of worker pools. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.WorkerPoolResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[WorkerPoolResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkerPoolCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class WorkerPoolResource(ProxyOnlyResource): + """Worker pool of an App Service Environment ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param sku: Description of a SKU for a scalable resource. + :type sku: ~azure.mgmt.web.v2021_02_01.models.SkuDescription + :param worker_size_id: Worker size ID for referencing this worker pool. + :type worker_size_id: int + :param compute_mode: Shared or dedicated app hosting. Possible values include: "Shared", + "Dedicated", "Dynamic". + :type compute_mode: str or ~azure.mgmt.web.v2021_02_01.models.ComputeModeOptions + :param worker_size: VM size of the worker pool instances. + :type worker_size: str + :param worker_count: Number of instances in the worker pool. + :type worker_count: int + :ivar instance_names: Names of all instances in the worker pool (read only). + :vartype instance_names: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'instance_names': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'SkuDescription'}, + 'worker_size_id': {'key': 'properties.workerSizeId', 'type': 'int'}, + 'compute_mode': {'key': 'properties.computeMode', 'type': 'str'}, + 'worker_size': {'key': 'properties.workerSize', 'type': 'str'}, + 'worker_count': {'key': 'properties.workerCount', 'type': 'int'}, + 'instance_names': {'key': 'properties.instanceNames', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkerPoolResource, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.worker_size_id = kwargs.get('worker_size_id', None) + self.compute_mode = kwargs.get('compute_mode', None) + self.worker_size = kwargs.get('worker_size', None) + self.worker_count = kwargs.get('worker_count', None) + self.instance_names = None diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/models/_models_py3.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/models/_models_py3.py new file mode 100644 index 000000000000..fbe0e6281a87 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/models/_models_py3.py @@ -0,0 +1,20944 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +import datetime +from typing import Any, Dict, List, Optional, Union + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + +from ._web_site_management_client_enums import * + + +class AbnormalTimePeriod(msrest.serialization.Model): + """Class representing Abnormal Time Period identified in diagnosis. + + :param start_time: Start time of the downtime. + :type start_time: ~datetime.datetime + :param end_time: End time of the downtime. + :type end_time: ~datetime.datetime + :param events: List of Possible Cause of downtime. + :type events: list[~azure.mgmt.web.v2021_02_01.models.DetectorAbnormalTimePeriod] + :param solutions: List of proposed solutions. + :type solutions: list[~azure.mgmt.web.v2021_02_01.models.Solution] + """ + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'events': {'key': 'events', 'type': '[DetectorAbnormalTimePeriod]'}, + 'solutions': {'key': 'solutions', 'type': '[Solution]'}, + } + + def __init__( + self, + *, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + events: Optional[List["DetectorAbnormalTimePeriod"]] = None, + solutions: Optional[List["Solution"]] = None, + **kwargs + ): + super(AbnormalTimePeriod, self).__init__(**kwargs) + self.start_time = start_time + self.end_time = end_time + self.events = events + self.solutions = solutions + + +class Address(msrest.serialization.Model): + """Address information for domain registration. + + All required parameters must be populated in order to send to Azure. + + :param address1: Required. First line of an Address. + :type address1: str + :param address2: The second line of the Address. Optional. + :type address2: str + :param city: Required. The city for the address. + :type city: str + :param country: Required. The country for the address. + :type country: str + :param postal_code: Required. The postal code for the address. + :type postal_code: str + :param state: Required. The state or province for the address. + :type state: str + """ + + _validation = { + 'address1': {'required': True}, + 'city': {'required': True}, + 'country': {'required': True}, + 'postal_code': {'required': True}, + 'state': {'required': True}, + } + + _attribute_map = { + 'address1': {'key': 'address1', 'type': 'str'}, + 'address2': {'key': 'address2', 'type': 'str'}, + 'city': {'key': 'city', 'type': 'str'}, + 'country': {'key': 'country', 'type': 'str'}, + 'postal_code': {'key': 'postalCode', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__( + self, + *, + address1: str, + city: str, + country: str, + postal_code: str, + state: str, + address2: Optional[str] = None, + **kwargs + ): + super(Address, self).__init__(**kwargs) + self.address1 = address1 + self.address2 = address2 + self.city = city + self.country = country + self.postal_code = postal_code + self.state = state + + +class ProxyOnlyResource(msrest.serialization.Model): + """Azure proxy only resource. This resource is not tracked by Azure Resource Manager. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(ProxyOnlyResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.kind = kind + self.type = None + + +class AddressResponse(ProxyOnlyResource): + """Describes main public IP address and any extra virtual IPs. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param service_ip_address: Main public virtual IP. + :type service_ip_address: str + :param internal_ip_address: Virtual Network internal IP address of the App Service Environment + if it is in internal load-balancing mode. + :type internal_ip_address: str + :param outbound_ip_addresses: IP addresses appearing on outbound connections. + :type outbound_ip_addresses: list[str] + :param vip_mappings: Additional virtual IPs. + :type vip_mappings: list[~azure.mgmt.web.v2021_02_01.models.VirtualIPMapping] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'service_ip_address': {'key': 'properties.serviceIpAddress', 'type': 'str'}, + 'internal_ip_address': {'key': 'properties.internalIpAddress', 'type': 'str'}, + 'outbound_ip_addresses': {'key': 'properties.outboundIpAddresses', 'type': '[str]'}, + 'vip_mappings': {'key': 'properties.vipMappings', 'type': '[VirtualIPMapping]'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + service_ip_address: Optional[str] = None, + internal_ip_address: Optional[str] = None, + outbound_ip_addresses: Optional[List[str]] = None, + vip_mappings: Optional[List["VirtualIPMapping"]] = None, + **kwargs + ): + super(AddressResponse, self).__init__(kind=kind, **kwargs) + self.service_ip_address = service_ip_address + self.internal_ip_address = internal_ip_address + self.outbound_ip_addresses = outbound_ip_addresses + self.vip_mappings = vip_mappings + + +class AllowedAudiencesValidation(msrest.serialization.Model): + """The configuration settings of the Allowed Audiences validation flow. + + :param allowed_audiences: The configuration settings of the allowed list of audiences from + which to validate the JWT token. + :type allowed_audiences: list[str] + """ + + _attribute_map = { + 'allowed_audiences': {'key': 'allowedAudiences', 'type': '[str]'}, + } + + def __init__( + self, + *, + allowed_audiences: Optional[List[str]] = None, + **kwargs + ): + super(AllowedAudiencesValidation, self).__init__(**kwargs) + self.allowed_audiences = allowed_audiences + + +class AllowedPrincipals(msrest.serialization.Model): + """The configuration settings of the Azure Active Directory allowed principals. + + :param groups: The list of the allowed groups. + :type groups: list[str] + :param identities: The list of the allowed identities. + :type identities: list[str] + """ + + _attribute_map = { + 'groups': {'key': 'groups', 'type': '[str]'}, + 'identities': {'key': 'identities', 'type': '[str]'}, + } + + def __init__( + self, + *, + groups: Optional[List[str]] = None, + identities: Optional[List[str]] = None, + **kwargs + ): + super(AllowedPrincipals, self).__init__(**kwargs) + self.groups = groups + self.identities = identities + + +class AnalysisData(msrest.serialization.Model): + """Class Representing Detector Evidence used for analysis. + + :param source: Name of the Detector. + :type source: str + :param detector_definition: Detector Definition. + :type detector_definition: ~azure.mgmt.web.v2021_02_01.models.DetectorDefinition + :param metrics: Source Metrics. + :type metrics: list[~azure.mgmt.web.v2021_02_01.models.DiagnosticMetricSet] + :param data: Additional Source Data. + :type data: list[list[~azure.mgmt.web.v2021_02_01.models.NameValuePair]] + :param detector_meta_data: Detector Meta Data. + :type detector_meta_data: ~azure.mgmt.web.v2021_02_01.models.ResponseMetaData + """ + + _attribute_map = { + 'source': {'key': 'source', 'type': 'str'}, + 'detector_definition': {'key': 'detectorDefinition', 'type': 'DetectorDefinition'}, + 'metrics': {'key': 'metrics', 'type': '[DiagnosticMetricSet]'}, + 'data': {'key': 'data', 'type': '[[NameValuePair]]'}, + 'detector_meta_data': {'key': 'detectorMetaData', 'type': 'ResponseMetaData'}, + } + + def __init__( + self, + *, + source: Optional[str] = None, + detector_definition: Optional["DetectorDefinition"] = None, + metrics: Optional[List["DiagnosticMetricSet"]] = None, + data: Optional[List[List["NameValuePair"]]] = None, + detector_meta_data: Optional["ResponseMetaData"] = None, + **kwargs + ): + super(AnalysisData, self).__init__(**kwargs) + self.source = source + self.detector_definition = detector_definition + self.metrics = metrics + self.data = data + self.detector_meta_data = detector_meta_data + + +class AnalysisDefinition(ProxyOnlyResource): + """Definition of Analysis. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar description: Description of the Analysis. + :vartype description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(AnalysisDefinition, self).__init__(kind=kind, **kwargs) + self.description = None + + +class ApiDefinitionInfo(msrest.serialization.Model): + """Information about the formal API definition for the app. + + :param url: The URL of the API definition. + :type url: str + """ + + _attribute_map = { + 'url': {'key': 'url', 'type': 'str'}, + } + + def __init__( + self, + *, + url: Optional[str] = None, + **kwargs + ): + super(ApiDefinitionInfo, self).__init__(**kwargs) + self.url = url + + +class ApiKVReference(ProxyOnlyResource): + """Description of site key vault references. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param reference: + :type reference: str + :param status: Possible values include: "Initialized", "Resolved", "InvalidSyntax", + "MSINotEnabled", "VaultNotFound", "SecretNotFound", "SecretVersionNotFound", + "AccessToKeyVaultDenied", "OtherReasons", "FetchTimedOut", "UnauthorizedClient". + :type status: str or ~azure.mgmt.web.v2021_02_01.models.ResolveStatus + :param vault_name: + :type vault_name: str + :param secret_name: + :type secret_name: str + :param secret_version: + :type secret_version: str + :param identity_type: Managed service identity. + :type identity_type: ~azure.mgmt.web.v2021_02_01.models.ManagedServiceIdentity + :param details: + :type details: str + :param source: The only acceptable values to pass in are None and "KeyVault". The default + value is None. + :type source: str + :param active_version: + :type active_version: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'reference': {'key': 'properties.reference', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'vault_name': {'key': 'properties.vaultName', 'type': 'str'}, + 'secret_name': {'key': 'properties.secretName', 'type': 'str'}, + 'secret_version': {'key': 'properties.secretVersion', 'type': 'str'}, + 'identity_type': {'key': 'properties.identityType', 'type': 'ManagedServiceIdentity'}, + 'details': {'key': 'properties.details', 'type': 'str'}, + 'source': {'key': 'properties.source', 'type': 'str'}, + 'active_version': {'key': 'properties.activeVersion', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + reference: Optional[str] = None, + status: Optional[Union[str, "ResolveStatus"]] = None, + vault_name: Optional[str] = None, + secret_name: Optional[str] = None, + secret_version: Optional[str] = None, + identity_type: Optional["ManagedServiceIdentity"] = None, + details: Optional[str] = None, + source: Optional[str] = None, + active_version: Optional[str] = None, + **kwargs + ): + super(ApiKVReference, self).__init__(kind=kind, **kwargs) + self.reference = reference + self.status = status + self.vault_name = vault_name + self.secret_name = secret_name + self.secret_version = secret_version + self.identity_type = identity_type + self.details = details + self.source = source + self.active_version = active_version + + +class ApiKVReferenceCollection(msrest.serialization.Model): + """ApiKVReferenceCollection. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.ApiKVReference] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ApiKVReference]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["ApiKVReference"], + **kwargs + ): + super(ApiKVReferenceCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class ApiManagementConfig(msrest.serialization.Model): + """Azure API management (APIM) configuration linked to the app. + + :param id: APIM-Api Identifier. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + **kwargs + ): + super(ApiManagementConfig, self).__init__(**kwargs) + self.id = id + + +class AppInsightsWebAppStackSettings(msrest.serialization.Model): + """App Insights Web App stack settings. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar is_supported: :code:`true` if remote Application Insights is supported for + the stack; otherwise, :code:`false`. + :vartype is_supported: bool + :ivar is_default_off: :code:`true` if Application Insights is disabled by default + for the stack; otherwise, :code:`false`. + :vartype is_default_off: bool + """ + + _validation = { + 'is_supported': {'readonly': True}, + 'is_default_off': {'readonly': True}, + } + + _attribute_map = { + 'is_supported': {'key': 'isSupported', 'type': 'bool'}, + 'is_default_off': {'key': 'isDefaultOff', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(AppInsightsWebAppStackSettings, self).__init__(**kwargs) + self.is_supported = None + self.is_default_off = None + + +class Apple(msrest.serialization.Model): + """The configuration settings of the Apple provider. + + :param enabled: :code:`false` if the Apple provider should not be enabled despite + the set registration; otherwise, :code:`true`. + :type enabled: bool + :param registration: The configuration settings of the Apple registration. + :type registration: ~azure.mgmt.web.v2021_02_01.models.AppleRegistration + :param login: The configuration settings of the login flow. + :type login: ~azure.mgmt.web.v2021_02_01.models.LoginScopes + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'AppleRegistration'}, + 'login': {'key': 'login', 'type': 'LoginScopes'}, + } + + def __init__( + self, + *, + enabled: Optional[bool] = None, + registration: Optional["AppleRegistration"] = None, + login: Optional["LoginScopes"] = None, + **kwargs + ): + super(Apple, self).__init__(**kwargs) + self.enabled = enabled + self.registration = registration + self.login = login + + +class AppleRegistration(msrest.serialization.Model): + """The configuration settings of the registration for the Apple provider. + + :param client_id: The Client ID of the app used for login. + :type client_id: str + :param client_secret_setting_name: The app setting name that contains the client secret. + :type client_secret_setting_name: str + """ + + _attribute_map = { + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'client_secret_setting_name': {'key': 'clientSecretSettingName', 'type': 'str'}, + } + + def __init__( + self, + *, + client_id: Optional[str] = None, + client_secret_setting_name: Optional[str] = None, + **kwargs + ): + super(AppleRegistration, self).__init__(**kwargs) + self.client_id = client_id + self.client_secret_setting_name = client_secret_setting_name + + +class ApplicationLogsConfig(msrest.serialization.Model): + """Application logs configuration. + + :param file_system: Application logs to file system configuration. + :type file_system: ~azure.mgmt.web.v2021_02_01.models.FileSystemApplicationLogsConfig + :param azure_table_storage: Application logs to azure table storage configuration. + :type azure_table_storage: + ~azure.mgmt.web.v2021_02_01.models.AzureTableStorageApplicationLogsConfig + :param azure_blob_storage: Application logs to blob storage configuration. + :type azure_blob_storage: + ~azure.mgmt.web.v2021_02_01.models.AzureBlobStorageApplicationLogsConfig + """ + + _attribute_map = { + 'file_system': {'key': 'fileSystem', 'type': 'FileSystemApplicationLogsConfig'}, + 'azure_table_storage': {'key': 'azureTableStorage', 'type': 'AzureTableStorageApplicationLogsConfig'}, + 'azure_blob_storage': {'key': 'azureBlobStorage', 'type': 'AzureBlobStorageApplicationLogsConfig'}, + } + + def __init__( + self, + *, + file_system: Optional["FileSystemApplicationLogsConfig"] = None, + azure_table_storage: Optional["AzureTableStorageApplicationLogsConfig"] = None, + azure_blob_storage: Optional["AzureBlobStorageApplicationLogsConfig"] = None, + **kwargs + ): + super(ApplicationLogsConfig, self).__init__(**kwargs) + self.file_system = file_system + self.azure_table_storage = azure_table_storage + self.azure_blob_storage = azure_blob_storage + + +class ApplicationStack(msrest.serialization.Model): + """Application stack. + + :param name: Application stack name. + :type name: str + :param display: Application stack display name. + :type display: str + :param dependency: Application stack dependency. + :type dependency: str + :param major_versions: List of major versions available. + :type major_versions: list[~azure.mgmt.web.v2021_02_01.models.StackMajorVersion] + :param frameworks: List of frameworks associated with application stack. + :type frameworks: list[~azure.mgmt.web.v2021_02_01.models.ApplicationStack] + :param is_deprecated: :code:`true` if this is the stack is deprecated; otherwise, + :code:`false`. + :type is_deprecated: list[~azure.mgmt.web.v2021_02_01.models.ApplicationStack] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'str'}, + 'dependency': {'key': 'dependency', 'type': 'str'}, + 'major_versions': {'key': 'majorVersions', 'type': '[StackMajorVersion]'}, + 'frameworks': {'key': 'frameworks', 'type': '[ApplicationStack]'}, + 'is_deprecated': {'key': 'isDeprecated', 'type': '[ApplicationStack]'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display: Optional[str] = None, + dependency: Optional[str] = None, + major_versions: Optional[List["StackMajorVersion"]] = None, + frameworks: Optional[List["ApplicationStack"]] = None, + is_deprecated: Optional[List["ApplicationStack"]] = None, + **kwargs + ): + super(ApplicationStack, self).__init__(**kwargs) + self.name = name + self.display = display + self.dependency = dependency + self.major_versions = major_versions + self.frameworks = frameworks + self.is_deprecated = is_deprecated + + +class ApplicationStackCollection(msrest.serialization.Model): + """Collection of Application Stacks. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.ApplicationStackResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ApplicationStackResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["ApplicationStackResource"], + **kwargs + ): + super(ApplicationStackCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class ApplicationStackResource(ProxyOnlyResource): + """ARM resource for a ApplicationStack. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param name_properties_name: Application stack name. + :type name_properties_name: str + :param display: Application stack display name. + :type display: str + :param dependency: Application stack dependency. + :type dependency: str + :param major_versions: List of major versions available. + :type major_versions: list[~azure.mgmt.web.v2021_02_01.models.StackMajorVersion] + :param frameworks: List of frameworks associated with application stack. + :type frameworks: list[~azure.mgmt.web.v2021_02_01.models.ApplicationStack] + :param is_deprecated: :code:`true` if this is the stack is deprecated; otherwise, + :code:`false`. + :type is_deprecated: list[~azure.mgmt.web.v2021_02_01.models.ApplicationStack] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name_properties_name': {'key': 'properties.name', 'type': 'str'}, + 'display': {'key': 'properties.display', 'type': 'str'}, + 'dependency': {'key': 'properties.dependency', 'type': 'str'}, + 'major_versions': {'key': 'properties.majorVersions', 'type': '[StackMajorVersion]'}, + 'frameworks': {'key': 'properties.frameworks', 'type': '[ApplicationStack]'}, + 'is_deprecated': {'key': 'properties.isDeprecated', 'type': '[ApplicationStack]'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + name_properties_name: Optional[str] = None, + display: Optional[str] = None, + dependency: Optional[str] = None, + major_versions: Optional[List["StackMajorVersion"]] = None, + frameworks: Optional[List["ApplicationStack"]] = None, + is_deprecated: Optional[List["ApplicationStack"]] = None, + **kwargs + ): + super(ApplicationStackResource, self).__init__(kind=kind, **kwargs) + self.name_properties_name = name_properties_name + self.display = display + self.dependency = dependency + self.major_versions = major_versions + self.frameworks = frameworks + self.is_deprecated = is_deprecated + + +class AppLogsConfiguration(msrest.serialization.Model): + """AppLogsConfiguration. + + :param destination: + :type destination: str + :param log_analytics_configuration: + :type log_analytics_configuration: ~azure.mgmt.web.v2021_02_01.models.LogAnalyticsConfiguration + """ + + _attribute_map = { + 'destination': {'key': 'destination', 'type': 'str'}, + 'log_analytics_configuration': {'key': 'logAnalyticsConfiguration', 'type': 'LogAnalyticsConfiguration'}, + } + + def __init__( + self, + *, + destination: Optional[str] = None, + log_analytics_configuration: Optional["LogAnalyticsConfiguration"] = None, + **kwargs + ): + super(AppLogsConfiguration, self).__init__(**kwargs) + self.destination = destination + self.log_analytics_configuration = log_analytics_configuration + + +class AppRegistration(msrest.serialization.Model): + """The configuration settings of the app registration for providers that have app ids and app secrets. + + :param app_id: The App ID of the app used for login. + :type app_id: str + :param app_secret_setting_name: The app setting name that contains the app secret. + :type app_secret_setting_name: str + """ + + _attribute_map = { + 'app_id': {'key': 'appId', 'type': 'str'}, + 'app_secret_setting_name': {'key': 'appSecretSettingName', 'type': 'str'}, + } + + def __init__( + self, + *, + app_id: Optional[str] = None, + app_secret_setting_name: Optional[str] = None, + **kwargs + ): + super(AppRegistration, self).__init__(**kwargs) + self.app_id = app_id + self.app_secret_setting_name = app_secret_setting_name + + +class AppServiceCertificate(msrest.serialization.Model): + """Key Vault container for a certificate that is purchased through Azure. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param key_vault_id: Key Vault resource Id. + :type key_vault_id: str + :param key_vault_secret_name: Key Vault secret name. + :type key_vault_secret_name: str + :ivar provisioning_state: Status of the Key Vault secret. Possible values include: + "Initialized", "WaitingOnCertificateOrder", "Succeeded", "CertificateOrderFailed", + "OperationNotPermittedOnKeyVault", "AzureServiceUnauthorizedToAccessKeyVault", + "KeyVaultDoesNotExist", "KeyVaultSecretDoesNotExist", "UnknownError", "ExternalPrivateKey", + "Unknown". + :vartype provisioning_state: str or ~azure.mgmt.web.v2021_02_01.models.KeyVaultSecretStatus + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'key_vault_id': {'key': 'keyVaultId', 'type': 'str'}, + 'key_vault_secret_name': {'key': 'keyVaultSecretName', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + key_vault_id: Optional[str] = None, + key_vault_secret_name: Optional[str] = None, + **kwargs + ): + super(AppServiceCertificate, self).__init__(**kwargs) + self.key_vault_id = key_vault_id + self.key_vault_secret_name = key_vault_secret_name + self.provisioning_state = None + + +class AppServiceCertificateCollection(msrest.serialization.Model): + """Collection of certificate order certificates. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.AppServiceCertificateResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AppServiceCertificateResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["AppServiceCertificateResource"], + **kwargs + ): + super(AppServiceCertificateCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class Resource(msrest.serialization.Model): + """Azure resource. This resource is tracked in Azure Resource Manager. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + *, + location: str, + kind: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.kind = kind + self.location = location + self.type = None + self.tags = tags + + +class AppServiceCertificateOrder(Resource): + """SSL certificate purchase order. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param certificates: State of the Key Vault secret. + :type certificates: dict[str, ~azure.mgmt.web.v2021_02_01.models.AppServiceCertificate] + :param distinguished_name: Certificate distinguished name. + :type distinguished_name: str + :ivar domain_verification_token: Domain verification token. + :vartype domain_verification_token: str + :param validity_in_years: Duration in years (must be 1). + :type validity_in_years: int + :param key_size: Certificate key size. + :type key_size: int + :param product_type: Certificate product type. Possible values include: + "StandardDomainValidatedSsl", "StandardDomainValidatedWildCardSsl". + :type product_type: str or ~azure.mgmt.web.v2021_02_01.models.CertificateProductType + :param auto_renew: :code:`true` if the certificate should be automatically renewed + when it expires; otherwise, :code:`false`. + :type auto_renew: bool + :ivar provisioning_state: Status of certificate order. Possible values include: "Succeeded", + "Failed", "Canceled", "InProgress", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.web.v2021_02_01.models.ProvisioningState + :ivar status: Current order status. Possible values include: "Pendingissuance", "Issued", + "Revoked", "Canceled", "Denied", "Pendingrevocation", "PendingRekey", "Unused", "Expired", + "NotSubmitted". + :vartype status: str or ~azure.mgmt.web.v2021_02_01.models.CertificateOrderStatus + :ivar signed_certificate: Signed certificate. + :vartype signed_certificate: ~azure.mgmt.web.v2021_02_01.models.CertificateDetails + :param csr: Last CSR that was created for this order. + :type csr: str + :ivar intermediate: Intermediate certificate. + :vartype intermediate: ~azure.mgmt.web.v2021_02_01.models.CertificateDetails + :ivar root: Root certificate. + :vartype root: ~azure.mgmt.web.v2021_02_01.models.CertificateDetails + :ivar serial_number: Current serial number of the certificate. + :vartype serial_number: str + :ivar last_certificate_issuance_time: Certificate last issuance time. + :vartype last_certificate_issuance_time: ~datetime.datetime + :ivar expiration_time: Certificate expiration time. + :vartype expiration_time: ~datetime.datetime + :ivar is_private_key_external: :code:`true` if private key is external; otherwise, + :code:`false`. + :vartype is_private_key_external: bool + :ivar app_service_certificate_not_renewable_reasons: Reasons why App Service Certificate is not + renewable at the current moment. + :vartype app_service_certificate_not_renewable_reasons: list[str or + ~azure.mgmt.web.v2021_02_01.models.AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem] + :ivar next_auto_renewal_time_stamp: Time stamp when the certificate would be auto renewed next. + :vartype next_auto_renewal_time_stamp: ~datetime.datetime + :ivar contact: Contact info. + :vartype contact: ~azure.mgmt.web.v2021_02_01.models.CertificateOrderContact + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'domain_verification_token': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + 'signed_certificate': {'readonly': True}, + 'intermediate': {'readonly': True}, + 'root': {'readonly': True}, + 'serial_number': {'readonly': True}, + 'last_certificate_issuance_time': {'readonly': True}, + 'expiration_time': {'readonly': True}, + 'is_private_key_external': {'readonly': True}, + 'app_service_certificate_not_renewable_reasons': {'readonly': True}, + 'next_auto_renewal_time_stamp': {'readonly': True}, + 'contact': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'certificates': {'key': 'properties.certificates', 'type': '{AppServiceCertificate}'}, + 'distinguished_name': {'key': 'properties.distinguishedName', 'type': 'str'}, + 'domain_verification_token': {'key': 'properties.domainVerificationToken', 'type': 'str'}, + 'validity_in_years': {'key': 'properties.validityInYears', 'type': 'int'}, + 'key_size': {'key': 'properties.keySize', 'type': 'int'}, + 'product_type': {'key': 'properties.productType', 'type': 'str'}, + 'auto_renew': {'key': 'properties.autoRenew', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'signed_certificate': {'key': 'properties.signedCertificate', 'type': 'CertificateDetails'}, + 'csr': {'key': 'properties.csr', 'type': 'str'}, + 'intermediate': {'key': 'properties.intermediate', 'type': 'CertificateDetails'}, + 'root': {'key': 'properties.root', 'type': 'CertificateDetails'}, + 'serial_number': {'key': 'properties.serialNumber', 'type': 'str'}, + 'last_certificate_issuance_time': {'key': 'properties.lastCertificateIssuanceTime', 'type': 'iso-8601'}, + 'expiration_time': {'key': 'properties.expirationTime', 'type': 'iso-8601'}, + 'is_private_key_external': {'key': 'properties.isPrivateKeyExternal', 'type': 'bool'}, + 'app_service_certificate_not_renewable_reasons': {'key': 'properties.appServiceCertificateNotRenewableReasons', 'type': '[str]'}, + 'next_auto_renewal_time_stamp': {'key': 'properties.nextAutoRenewalTimeStamp', 'type': 'iso-8601'}, + 'contact': {'key': 'properties.contact', 'type': 'CertificateOrderContact'}, + } + + def __init__( + self, + *, + location: str, + kind: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + certificates: Optional[Dict[str, "AppServiceCertificate"]] = None, + distinguished_name: Optional[str] = None, + validity_in_years: Optional[int] = 1, + key_size: Optional[int] = 2048, + product_type: Optional[Union[str, "CertificateProductType"]] = None, + auto_renew: Optional[bool] = True, + csr: Optional[str] = None, + **kwargs + ): + super(AppServiceCertificateOrder, self).__init__(kind=kind, location=location, tags=tags, **kwargs) + self.certificates = certificates + self.distinguished_name = distinguished_name + self.domain_verification_token = None + self.validity_in_years = validity_in_years + self.key_size = key_size + self.product_type = product_type + self.auto_renew = auto_renew + self.provisioning_state = None + self.status = None + self.signed_certificate = None + self.csr = csr + self.intermediate = None + self.root = None + self.serial_number = None + self.last_certificate_issuance_time = None + self.expiration_time = None + self.is_private_key_external = None + self.app_service_certificate_not_renewable_reasons = None + self.next_auto_renewal_time_stamp = None + self.contact = None + + +class AppServiceCertificateOrderCollection(msrest.serialization.Model): + """Collection of certificate orders. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.AppServiceCertificateOrder] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AppServiceCertificateOrder]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["AppServiceCertificateOrder"], + **kwargs + ): + super(AppServiceCertificateOrderCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class AppServiceCertificateOrderPatchResource(ProxyOnlyResource): + """ARM resource for a certificate order that is purchased through Azure. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param certificates: State of the Key Vault secret. + :type certificates: dict[str, ~azure.mgmt.web.v2021_02_01.models.AppServiceCertificate] + :param distinguished_name: Certificate distinguished name. + :type distinguished_name: str + :ivar domain_verification_token: Domain verification token. + :vartype domain_verification_token: str + :param validity_in_years: Duration in years (must be 1). + :type validity_in_years: int + :param key_size: Certificate key size. + :type key_size: int + :param product_type: Certificate product type. Possible values include: + "StandardDomainValidatedSsl", "StandardDomainValidatedWildCardSsl". + :type product_type: str or ~azure.mgmt.web.v2021_02_01.models.CertificateProductType + :param auto_renew: :code:`true` if the certificate should be automatically renewed + when it expires; otherwise, :code:`false`. + :type auto_renew: bool + :ivar provisioning_state: Status of certificate order. Possible values include: "Succeeded", + "Failed", "Canceled", "InProgress", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.web.v2021_02_01.models.ProvisioningState + :ivar status: Current order status. Possible values include: "Pendingissuance", "Issued", + "Revoked", "Canceled", "Denied", "Pendingrevocation", "PendingRekey", "Unused", "Expired", + "NotSubmitted". + :vartype status: str or ~azure.mgmt.web.v2021_02_01.models.CertificateOrderStatus + :ivar signed_certificate: Signed certificate. + :vartype signed_certificate: ~azure.mgmt.web.v2021_02_01.models.CertificateDetails + :param csr: Last CSR that was created for this order. + :type csr: str + :ivar intermediate: Intermediate certificate. + :vartype intermediate: ~azure.mgmt.web.v2021_02_01.models.CertificateDetails + :ivar root: Root certificate. + :vartype root: ~azure.mgmt.web.v2021_02_01.models.CertificateDetails + :ivar serial_number: Current serial number of the certificate. + :vartype serial_number: str + :ivar last_certificate_issuance_time: Certificate last issuance time. + :vartype last_certificate_issuance_time: ~datetime.datetime + :ivar expiration_time: Certificate expiration time. + :vartype expiration_time: ~datetime.datetime + :ivar is_private_key_external: :code:`true` if private key is external; otherwise, + :code:`false`. + :vartype is_private_key_external: bool + :ivar app_service_certificate_not_renewable_reasons: Reasons why App Service Certificate is not + renewable at the current moment. + :vartype app_service_certificate_not_renewable_reasons: list[str or + ~azure.mgmt.web.v2021_02_01.models.AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem] + :ivar next_auto_renewal_time_stamp: Time stamp when the certificate would be auto renewed next. + :vartype next_auto_renewal_time_stamp: ~datetime.datetime + :ivar contact: Contact info. + :vartype contact: ~azure.mgmt.web.v2021_02_01.models.CertificateOrderContact + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'domain_verification_token': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + 'signed_certificate': {'readonly': True}, + 'intermediate': {'readonly': True}, + 'root': {'readonly': True}, + 'serial_number': {'readonly': True}, + 'last_certificate_issuance_time': {'readonly': True}, + 'expiration_time': {'readonly': True}, + 'is_private_key_external': {'readonly': True}, + 'app_service_certificate_not_renewable_reasons': {'readonly': True}, + 'next_auto_renewal_time_stamp': {'readonly': True}, + 'contact': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'certificates': {'key': 'properties.certificates', 'type': '{AppServiceCertificate}'}, + 'distinguished_name': {'key': 'properties.distinguishedName', 'type': 'str'}, + 'domain_verification_token': {'key': 'properties.domainVerificationToken', 'type': 'str'}, + 'validity_in_years': {'key': 'properties.validityInYears', 'type': 'int'}, + 'key_size': {'key': 'properties.keySize', 'type': 'int'}, + 'product_type': {'key': 'properties.productType', 'type': 'str'}, + 'auto_renew': {'key': 'properties.autoRenew', 'type': 'bool'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'signed_certificate': {'key': 'properties.signedCertificate', 'type': 'CertificateDetails'}, + 'csr': {'key': 'properties.csr', 'type': 'str'}, + 'intermediate': {'key': 'properties.intermediate', 'type': 'CertificateDetails'}, + 'root': {'key': 'properties.root', 'type': 'CertificateDetails'}, + 'serial_number': {'key': 'properties.serialNumber', 'type': 'str'}, + 'last_certificate_issuance_time': {'key': 'properties.lastCertificateIssuanceTime', 'type': 'iso-8601'}, + 'expiration_time': {'key': 'properties.expirationTime', 'type': 'iso-8601'}, + 'is_private_key_external': {'key': 'properties.isPrivateKeyExternal', 'type': 'bool'}, + 'app_service_certificate_not_renewable_reasons': {'key': 'properties.appServiceCertificateNotRenewableReasons', 'type': '[str]'}, + 'next_auto_renewal_time_stamp': {'key': 'properties.nextAutoRenewalTimeStamp', 'type': 'iso-8601'}, + 'contact': {'key': 'properties.contact', 'type': 'CertificateOrderContact'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + certificates: Optional[Dict[str, "AppServiceCertificate"]] = None, + distinguished_name: Optional[str] = None, + validity_in_years: Optional[int] = 1, + key_size: Optional[int] = 2048, + product_type: Optional[Union[str, "CertificateProductType"]] = None, + auto_renew: Optional[bool] = True, + csr: Optional[str] = None, + **kwargs + ): + super(AppServiceCertificateOrderPatchResource, self).__init__(kind=kind, **kwargs) + self.certificates = certificates + self.distinguished_name = distinguished_name + self.domain_verification_token = None + self.validity_in_years = validity_in_years + self.key_size = key_size + self.product_type = product_type + self.auto_renew = auto_renew + self.provisioning_state = None + self.status = None + self.signed_certificate = None + self.csr = csr + self.intermediate = None + self.root = None + self.serial_number = None + self.last_certificate_issuance_time = None + self.expiration_time = None + self.is_private_key_external = None + self.app_service_certificate_not_renewable_reasons = None + self.next_auto_renewal_time_stamp = None + self.contact = None + + +class AppServiceCertificatePatchResource(ProxyOnlyResource): + """Key Vault container ARM resource for a certificate that is purchased through Azure. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param key_vault_id: Key Vault resource Id. + :type key_vault_id: str + :param key_vault_secret_name: Key Vault secret name. + :type key_vault_secret_name: str + :ivar provisioning_state: Status of the Key Vault secret. Possible values include: + "Initialized", "WaitingOnCertificateOrder", "Succeeded", "CertificateOrderFailed", + "OperationNotPermittedOnKeyVault", "AzureServiceUnauthorizedToAccessKeyVault", + "KeyVaultDoesNotExist", "KeyVaultSecretDoesNotExist", "UnknownError", "ExternalPrivateKey", + "Unknown". + :vartype provisioning_state: str or ~azure.mgmt.web.v2021_02_01.models.KeyVaultSecretStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'key_vault_id': {'key': 'properties.keyVaultId', 'type': 'str'}, + 'key_vault_secret_name': {'key': 'properties.keyVaultSecretName', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + key_vault_id: Optional[str] = None, + key_vault_secret_name: Optional[str] = None, + **kwargs + ): + super(AppServiceCertificatePatchResource, self).__init__(kind=kind, **kwargs) + self.key_vault_id = key_vault_id + self.key_vault_secret_name = key_vault_secret_name + self.provisioning_state = None + + +class AppServiceCertificateResource(Resource): + """Key Vault container ARM resource for a certificate that is purchased through Azure. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param key_vault_id: Key Vault resource Id. + :type key_vault_id: str + :param key_vault_secret_name: Key Vault secret name. + :type key_vault_secret_name: str + :ivar provisioning_state: Status of the Key Vault secret. Possible values include: + "Initialized", "WaitingOnCertificateOrder", "Succeeded", "CertificateOrderFailed", + "OperationNotPermittedOnKeyVault", "AzureServiceUnauthorizedToAccessKeyVault", + "KeyVaultDoesNotExist", "KeyVaultSecretDoesNotExist", "UnknownError", "ExternalPrivateKey", + "Unknown". + :vartype provisioning_state: str or ~azure.mgmt.web.v2021_02_01.models.KeyVaultSecretStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'key_vault_id': {'key': 'properties.keyVaultId', 'type': 'str'}, + 'key_vault_secret_name': {'key': 'properties.keyVaultSecretName', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + kind: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + key_vault_id: Optional[str] = None, + key_vault_secret_name: Optional[str] = None, + **kwargs + ): + super(AppServiceCertificateResource, self).__init__(kind=kind, location=location, tags=tags, **kwargs) + self.key_vault_id = key_vault_id + self.key_vault_secret_name = key_vault_secret_name + self.provisioning_state = None + + +class AppServiceEnvironment(msrest.serialization.Model): + """Description of an App Service Environment. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar provisioning_state: Provisioning state of the App Service Environment. Possible values + include: "Succeeded", "Failed", "Canceled", "InProgress", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.web.v2021_02_01.models.ProvisioningState + :ivar status: Current status of the App Service Environment. Possible values include: + "Preparing", "Ready", "Scaling", "Deleting". + :vartype status: str or ~azure.mgmt.web.v2021_02_01.models.HostingEnvironmentStatus + :param virtual_network: Required. Description of the Virtual Network. + :type virtual_network: ~azure.mgmt.web.v2021_02_01.models.VirtualNetworkProfile + :param internal_load_balancing_mode: Specifies which endpoints to serve internally in the + Virtual Network for the App Service Environment. Possible values include: "None", "Web", + "Publishing", "Web, Publishing". + :type internal_load_balancing_mode: str or ~azure.mgmt.web.v2021_02_01.models.LoadBalancingMode + :param multi_size: Front-end VM size, e.g. "Medium", "Large". + :type multi_size: str + :ivar multi_role_count: Number of front-end instances. + :vartype multi_role_count: int + :param ipssl_address_count: Number of IP SSL addresses reserved for the App Service + Environment. + :type ipssl_address_count: int + :param dns_suffix: DNS suffix of the App Service Environment. + :type dns_suffix: str + :ivar maximum_number_of_machines: Maximum number of VMs in the App Service Environment. + :vartype maximum_number_of_machines: int + :param front_end_scale_factor: Scale factor for front-ends. + :type front_end_scale_factor: int + :ivar suspended: :code:`true` if the App Service Environment is suspended; + otherwise, :code:`false`. The environment can be suspended, e.g. when the + management endpoint is no longer available + (most likely because NSG blocked the incoming traffic). + :vartype suspended: bool + :param cluster_settings: Custom settings for changing the behavior of the App Service + Environment. + :type cluster_settings: list[~azure.mgmt.web.v2021_02_01.models.NameValuePair] + :param user_whitelisted_ip_ranges: User added ip ranges to whitelist on ASE db. + :type user_whitelisted_ip_ranges: list[str] + :ivar has_linux_workers: Flag that displays whether an ASE has linux workers or not. + :vartype has_linux_workers: bool + :param dedicated_host_count: Dedicated Host Count. + :type dedicated_host_count: int + :param zone_redundant: Whether or not this App Service Environment is zone-redundant. + :type zone_redundant: bool + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + 'virtual_network': {'required': True}, + 'multi_role_count': {'readonly': True}, + 'maximum_number_of_machines': {'readonly': True}, + 'suspended': {'readonly': True}, + 'has_linux_workers': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'virtual_network': {'key': 'virtualNetwork', 'type': 'VirtualNetworkProfile'}, + 'internal_load_balancing_mode': {'key': 'internalLoadBalancingMode', 'type': 'str'}, + 'multi_size': {'key': 'multiSize', 'type': 'str'}, + 'multi_role_count': {'key': 'multiRoleCount', 'type': 'int'}, + 'ipssl_address_count': {'key': 'ipsslAddressCount', 'type': 'int'}, + 'dns_suffix': {'key': 'dnsSuffix', 'type': 'str'}, + 'maximum_number_of_machines': {'key': 'maximumNumberOfMachines', 'type': 'int'}, + 'front_end_scale_factor': {'key': 'frontEndScaleFactor', 'type': 'int'}, + 'suspended': {'key': 'suspended', 'type': 'bool'}, + 'cluster_settings': {'key': 'clusterSettings', 'type': '[NameValuePair]'}, + 'user_whitelisted_ip_ranges': {'key': 'userWhitelistedIpRanges', 'type': '[str]'}, + 'has_linux_workers': {'key': 'hasLinuxWorkers', 'type': 'bool'}, + 'dedicated_host_count': {'key': 'dedicatedHostCount', 'type': 'int'}, + 'zone_redundant': {'key': 'zoneRedundant', 'type': 'bool'}, + } + + def __init__( + self, + *, + virtual_network: "VirtualNetworkProfile", + internal_load_balancing_mode: Optional[Union[str, "LoadBalancingMode"]] = None, + multi_size: Optional[str] = None, + ipssl_address_count: Optional[int] = None, + dns_suffix: Optional[str] = None, + front_end_scale_factor: Optional[int] = None, + cluster_settings: Optional[List["NameValuePair"]] = None, + user_whitelisted_ip_ranges: Optional[List[str]] = None, + dedicated_host_count: Optional[int] = None, + zone_redundant: Optional[bool] = None, + **kwargs + ): + super(AppServiceEnvironment, self).__init__(**kwargs) + self.provisioning_state = None + self.status = None + self.virtual_network = virtual_network + self.internal_load_balancing_mode = internal_load_balancing_mode + self.multi_size = multi_size + self.multi_role_count = None + self.ipssl_address_count = ipssl_address_count + self.dns_suffix = dns_suffix + self.maximum_number_of_machines = None + self.front_end_scale_factor = front_end_scale_factor + self.suspended = None + self.cluster_settings = cluster_settings + self.user_whitelisted_ip_ranges = user_whitelisted_ip_ranges + self.has_linux_workers = None + self.dedicated_host_count = dedicated_host_count + self.zone_redundant = zone_redundant + + +class AppServiceEnvironmentCollection(msrest.serialization.Model): + """Collection of App Service Environments. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.AppServiceEnvironmentResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AppServiceEnvironmentResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["AppServiceEnvironmentResource"], + **kwargs + ): + super(AppServiceEnvironmentCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class AppServiceEnvironmentPatchResource(ProxyOnlyResource): + """ARM resource for a app service environment. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar provisioning_state: Provisioning state of the App Service Environment. Possible values + include: "Succeeded", "Failed", "Canceled", "InProgress", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.web.v2021_02_01.models.ProvisioningState + :ivar status: Current status of the App Service Environment. Possible values include: + "Preparing", "Ready", "Scaling", "Deleting". + :vartype status: str or ~azure.mgmt.web.v2021_02_01.models.HostingEnvironmentStatus + :param virtual_network: Description of the Virtual Network. + :type virtual_network: ~azure.mgmt.web.v2021_02_01.models.VirtualNetworkProfile + :param internal_load_balancing_mode: Specifies which endpoints to serve internally in the + Virtual Network for the App Service Environment. Possible values include: "None", "Web", + "Publishing", "Web, Publishing". + :type internal_load_balancing_mode: str or ~azure.mgmt.web.v2021_02_01.models.LoadBalancingMode + :param multi_size: Front-end VM size, e.g. "Medium", "Large". + :type multi_size: str + :ivar multi_role_count: Number of front-end instances. + :vartype multi_role_count: int + :param ipssl_address_count: Number of IP SSL addresses reserved for the App Service + Environment. + :type ipssl_address_count: int + :param dns_suffix: DNS suffix of the App Service Environment. + :type dns_suffix: str + :ivar maximum_number_of_machines: Maximum number of VMs in the App Service Environment. + :vartype maximum_number_of_machines: int + :param front_end_scale_factor: Scale factor for front-ends. + :type front_end_scale_factor: int + :ivar suspended: :code:`true` if the App Service Environment is suspended; + otherwise, :code:`false`. The environment can be suspended, e.g. when the + management endpoint is no longer available + (most likely because NSG blocked the incoming traffic). + :vartype suspended: bool + :param cluster_settings: Custom settings for changing the behavior of the App Service + Environment. + :type cluster_settings: list[~azure.mgmt.web.v2021_02_01.models.NameValuePair] + :param user_whitelisted_ip_ranges: User added ip ranges to whitelist on ASE db. + :type user_whitelisted_ip_ranges: list[str] + :ivar has_linux_workers: Flag that displays whether an ASE has linux workers or not. + :vartype has_linux_workers: bool + :param dedicated_host_count: Dedicated Host Count. + :type dedicated_host_count: int + :param zone_redundant: Whether or not this App Service Environment is zone-redundant. + :type zone_redundant: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + 'multi_role_count': {'readonly': True}, + 'maximum_number_of_machines': {'readonly': True}, + 'suspended': {'readonly': True}, + 'has_linux_workers': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'virtual_network': {'key': 'properties.virtualNetwork', 'type': 'VirtualNetworkProfile'}, + 'internal_load_balancing_mode': {'key': 'properties.internalLoadBalancingMode', 'type': 'str'}, + 'multi_size': {'key': 'properties.multiSize', 'type': 'str'}, + 'multi_role_count': {'key': 'properties.multiRoleCount', 'type': 'int'}, + 'ipssl_address_count': {'key': 'properties.ipsslAddressCount', 'type': 'int'}, + 'dns_suffix': {'key': 'properties.dnsSuffix', 'type': 'str'}, + 'maximum_number_of_machines': {'key': 'properties.maximumNumberOfMachines', 'type': 'int'}, + 'front_end_scale_factor': {'key': 'properties.frontEndScaleFactor', 'type': 'int'}, + 'suspended': {'key': 'properties.suspended', 'type': 'bool'}, + 'cluster_settings': {'key': 'properties.clusterSettings', 'type': '[NameValuePair]'}, + 'user_whitelisted_ip_ranges': {'key': 'properties.userWhitelistedIpRanges', 'type': '[str]'}, + 'has_linux_workers': {'key': 'properties.hasLinuxWorkers', 'type': 'bool'}, + 'dedicated_host_count': {'key': 'properties.dedicatedHostCount', 'type': 'int'}, + 'zone_redundant': {'key': 'properties.zoneRedundant', 'type': 'bool'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + virtual_network: Optional["VirtualNetworkProfile"] = None, + internal_load_balancing_mode: Optional[Union[str, "LoadBalancingMode"]] = None, + multi_size: Optional[str] = None, + ipssl_address_count: Optional[int] = None, + dns_suffix: Optional[str] = None, + front_end_scale_factor: Optional[int] = None, + cluster_settings: Optional[List["NameValuePair"]] = None, + user_whitelisted_ip_ranges: Optional[List[str]] = None, + dedicated_host_count: Optional[int] = None, + zone_redundant: Optional[bool] = None, + **kwargs + ): + super(AppServiceEnvironmentPatchResource, self).__init__(kind=kind, **kwargs) + self.provisioning_state = None + self.status = None + self.virtual_network = virtual_network + self.internal_load_balancing_mode = internal_load_balancing_mode + self.multi_size = multi_size + self.multi_role_count = None + self.ipssl_address_count = ipssl_address_count + self.dns_suffix = dns_suffix + self.maximum_number_of_machines = None + self.front_end_scale_factor = front_end_scale_factor + self.suspended = None + self.cluster_settings = cluster_settings + self.user_whitelisted_ip_ranges = user_whitelisted_ip_ranges + self.has_linux_workers = None + self.dedicated_host_count = dedicated_host_count + self.zone_redundant = zone_redundant + + +class AppServiceEnvironmentResource(Resource): + """App Service Environment ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar provisioning_state: Provisioning state of the App Service Environment. Possible values + include: "Succeeded", "Failed", "Canceled", "InProgress", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.web.v2021_02_01.models.ProvisioningState + :ivar status: Current status of the App Service Environment. Possible values include: + "Preparing", "Ready", "Scaling", "Deleting". + :vartype status: str or ~azure.mgmt.web.v2021_02_01.models.HostingEnvironmentStatus + :param virtual_network: Description of the Virtual Network. + :type virtual_network: ~azure.mgmt.web.v2021_02_01.models.VirtualNetworkProfile + :param internal_load_balancing_mode: Specifies which endpoints to serve internally in the + Virtual Network for the App Service Environment. Possible values include: "None", "Web", + "Publishing", "Web, Publishing". + :type internal_load_balancing_mode: str or ~azure.mgmt.web.v2021_02_01.models.LoadBalancingMode + :param multi_size: Front-end VM size, e.g. "Medium", "Large". + :type multi_size: str + :ivar multi_role_count: Number of front-end instances. + :vartype multi_role_count: int + :param ipssl_address_count: Number of IP SSL addresses reserved for the App Service + Environment. + :type ipssl_address_count: int + :param dns_suffix: DNS suffix of the App Service Environment. + :type dns_suffix: str + :ivar maximum_number_of_machines: Maximum number of VMs in the App Service Environment. + :vartype maximum_number_of_machines: int + :param front_end_scale_factor: Scale factor for front-ends. + :type front_end_scale_factor: int + :ivar suspended: :code:`true` if the App Service Environment is suspended; + otherwise, :code:`false`. The environment can be suspended, e.g. when the + management endpoint is no longer available + (most likely because NSG blocked the incoming traffic). + :vartype suspended: bool + :param cluster_settings: Custom settings for changing the behavior of the App Service + Environment. + :type cluster_settings: list[~azure.mgmt.web.v2021_02_01.models.NameValuePair] + :param user_whitelisted_ip_ranges: User added ip ranges to whitelist on ASE db. + :type user_whitelisted_ip_ranges: list[str] + :ivar has_linux_workers: Flag that displays whether an ASE has linux workers or not. + :vartype has_linux_workers: bool + :param dedicated_host_count: Dedicated Host Count. + :type dedicated_host_count: int + :param zone_redundant: Whether or not this App Service Environment is zone-redundant. + :type zone_redundant: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + 'multi_role_count': {'readonly': True}, + 'maximum_number_of_machines': {'readonly': True}, + 'suspended': {'readonly': True}, + 'has_linux_workers': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'virtual_network': {'key': 'properties.virtualNetwork', 'type': 'VirtualNetworkProfile'}, + 'internal_load_balancing_mode': {'key': 'properties.internalLoadBalancingMode', 'type': 'str'}, + 'multi_size': {'key': 'properties.multiSize', 'type': 'str'}, + 'multi_role_count': {'key': 'properties.multiRoleCount', 'type': 'int'}, + 'ipssl_address_count': {'key': 'properties.ipsslAddressCount', 'type': 'int'}, + 'dns_suffix': {'key': 'properties.dnsSuffix', 'type': 'str'}, + 'maximum_number_of_machines': {'key': 'properties.maximumNumberOfMachines', 'type': 'int'}, + 'front_end_scale_factor': {'key': 'properties.frontEndScaleFactor', 'type': 'int'}, + 'suspended': {'key': 'properties.suspended', 'type': 'bool'}, + 'cluster_settings': {'key': 'properties.clusterSettings', 'type': '[NameValuePair]'}, + 'user_whitelisted_ip_ranges': {'key': 'properties.userWhitelistedIpRanges', 'type': '[str]'}, + 'has_linux_workers': {'key': 'properties.hasLinuxWorkers', 'type': 'bool'}, + 'dedicated_host_count': {'key': 'properties.dedicatedHostCount', 'type': 'int'}, + 'zone_redundant': {'key': 'properties.zoneRedundant', 'type': 'bool'}, + } + + def __init__( + self, + *, + location: str, + kind: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + virtual_network: Optional["VirtualNetworkProfile"] = None, + internal_load_balancing_mode: Optional[Union[str, "LoadBalancingMode"]] = None, + multi_size: Optional[str] = None, + ipssl_address_count: Optional[int] = None, + dns_suffix: Optional[str] = None, + front_end_scale_factor: Optional[int] = None, + cluster_settings: Optional[List["NameValuePair"]] = None, + user_whitelisted_ip_ranges: Optional[List[str]] = None, + dedicated_host_count: Optional[int] = None, + zone_redundant: Optional[bool] = None, + **kwargs + ): + super(AppServiceEnvironmentResource, self).__init__(kind=kind, location=location, tags=tags, **kwargs) + self.provisioning_state = None + self.status = None + self.virtual_network = virtual_network + self.internal_load_balancing_mode = internal_load_balancing_mode + self.multi_size = multi_size + self.multi_role_count = None + self.ipssl_address_count = ipssl_address_count + self.dns_suffix = dns_suffix + self.maximum_number_of_machines = None + self.front_end_scale_factor = front_end_scale_factor + self.suspended = None + self.cluster_settings = cluster_settings + self.user_whitelisted_ip_ranges = user_whitelisted_ip_ranges + self.has_linux_workers = None + self.dedicated_host_count = dedicated_host_count + self.zone_redundant = zone_redundant + + +class AppserviceGithubToken(msrest.serialization.Model): + """Github access token for Appservice CLI github integration. + + :param access_token: Github access token for Appservice CLI github integration. + :type access_token: str + :param scope: Scope of the github access token. + :type scope: str + :param token_type: token type. + :type token_type: str + :param got_token: True if valid github token received, False otherwise. + :type got_token: bool + :param error_message: Error message if unable to get token. + :type error_message: str + """ + + _attribute_map = { + 'access_token': {'key': 'accessToken', 'type': 'str'}, + 'scope': {'key': 'scope', 'type': 'str'}, + 'token_type': {'key': 'tokenType', 'type': 'str'}, + 'got_token': {'key': 'gotToken', 'type': 'bool'}, + 'error_message': {'key': 'errorMessage', 'type': 'str'}, + } + + def __init__( + self, + *, + access_token: Optional[str] = None, + scope: Optional[str] = None, + token_type: Optional[str] = None, + got_token: Optional[bool] = None, + error_message: Optional[str] = None, + **kwargs + ): + super(AppserviceGithubToken, self).__init__(**kwargs) + self.access_token = access_token + self.scope = scope + self.token_type = token_type + self.got_token = got_token + self.error_message = error_message + + +class AppserviceGithubTokenRequest(msrest.serialization.Model): + """Appservice Github token request content. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. Code string to exchange for Github Access token. + :type code: str + :param state: Required. State string used for verification. + :type state: str + """ + + _validation = { + 'code': {'required': True}, + 'state': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__( + self, + *, + code: str, + state: str, + **kwargs + ): + super(AppserviceGithubTokenRequest, self).__init__(**kwargs) + self.code = code + self.state = state + + +class AppServicePlan(Resource): + """App Service plan. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param sku: Description of a SKU for a scalable resource. + :type sku: ~azure.mgmt.web.v2021_02_01.models.SkuDescription + :param extended_location: Extended Location. + :type extended_location: ~azure.mgmt.web.v2021_02_01.models.ExtendedLocation + :param worker_tier_name: Target worker tier assigned to the App Service plan. + :type worker_tier_name: str + :ivar status: App Service plan status. Possible values include: "Ready", "Pending", "Creating". + :vartype status: str or ~azure.mgmt.web.v2021_02_01.models.StatusOptions + :ivar subscription: App Service plan subscription. + :vartype subscription: str + :param hosting_environment_profile: Specification for the App Service Environment to use for + the App Service plan. + :type hosting_environment_profile: ~azure.mgmt.web.v2021_02_01.models.HostingEnvironmentProfile + :ivar maximum_number_of_workers: Maximum number of instances that can be assigned to this App + Service plan. + :vartype maximum_number_of_workers: int + :ivar geo_region: Geographical location for the App Service plan. + :vartype geo_region: str + :param per_site_scaling: If :code:`true`, apps assigned to this App Service plan + can be scaled independently. + If :code:`false`, apps assigned to this App Service plan will scale to all + instances of the plan. + :type per_site_scaling: bool + :param elastic_scale_enabled: ServerFarm supports ElasticScale. Apps in this plan will scale as + if the ServerFarm was ElasticPremium sku. + :type elastic_scale_enabled: bool + :param maximum_elastic_worker_count: Maximum number of total workers allowed for this + ElasticScaleEnabled App Service Plan. + :type maximum_elastic_worker_count: int + :ivar number_of_sites: Number of apps assigned to this App Service plan. + :vartype number_of_sites: int + :param is_spot: If :code:`true`, this App Service Plan owns spot instances. + :type is_spot: bool + :param spot_expiration_time: The time when the server farm expires. Valid only if it is a spot + server farm. + :type spot_expiration_time: ~datetime.datetime + :param free_offer_expiration_time: The time when the server farm free offer expires. + :type free_offer_expiration_time: ~datetime.datetime + :ivar resource_group: Resource group of the App Service plan. + :vartype resource_group: str + :param reserved: If Linux app service plan :code:`true`, + :code:`false` otherwise. + :type reserved: bool + :param is_xenon: Obsolete: If Hyper-V container app service plan :code:`true`, + :code:`false` otherwise. + :type is_xenon: bool + :param hyper_v: If Hyper-V container app service plan :code:`true`, + :code:`false` otherwise. + :type hyper_v: bool + :param target_worker_count: Scaling worker count. + :type target_worker_count: int + :param target_worker_size_id: Scaling worker size ID. + :type target_worker_size_id: int + :ivar provisioning_state: Provisioning state of the App Service Plan. Possible values include: + "Succeeded", "Failed", "Canceled", "InProgress", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.web.v2021_02_01.models.ProvisioningState + :param kube_environment_profile: Specification for the Kubernetes Environment to use for the + App Service plan. + :type kube_environment_profile: ~azure.mgmt.web.v2021_02_01.models.KubeEnvironmentProfile + :param zone_redundant: If :code:`true`, this App Service Plan will perform + availability zone balancing. + If :code:`false`, this App Service Plan will not perform availability zone + balancing. + :type zone_redundant: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'status': {'readonly': True}, + 'subscription': {'readonly': True}, + 'maximum_number_of_workers': {'readonly': True}, + 'geo_region': {'readonly': True}, + 'number_of_sites': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'SkuDescription'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'worker_tier_name': {'key': 'properties.workerTierName', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'subscription': {'key': 'properties.subscription', 'type': 'str'}, + 'hosting_environment_profile': {'key': 'properties.hostingEnvironmentProfile', 'type': 'HostingEnvironmentProfile'}, + 'maximum_number_of_workers': {'key': 'properties.maximumNumberOfWorkers', 'type': 'int'}, + 'geo_region': {'key': 'properties.geoRegion', 'type': 'str'}, + 'per_site_scaling': {'key': 'properties.perSiteScaling', 'type': 'bool'}, + 'elastic_scale_enabled': {'key': 'properties.elasticScaleEnabled', 'type': 'bool'}, + 'maximum_elastic_worker_count': {'key': 'properties.maximumElasticWorkerCount', 'type': 'int'}, + 'number_of_sites': {'key': 'properties.numberOfSites', 'type': 'int'}, + 'is_spot': {'key': 'properties.isSpot', 'type': 'bool'}, + 'spot_expiration_time': {'key': 'properties.spotExpirationTime', 'type': 'iso-8601'}, + 'free_offer_expiration_time': {'key': 'properties.freeOfferExpirationTime', 'type': 'iso-8601'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'reserved': {'key': 'properties.reserved', 'type': 'bool'}, + 'is_xenon': {'key': 'properties.isXenon', 'type': 'bool'}, + 'hyper_v': {'key': 'properties.hyperV', 'type': 'bool'}, + 'target_worker_count': {'key': 'properties.targetWorkerCount', 'type': 'int'}, + 'target_worker_size_id': {'key': 'properties.targetWorkerSizeId', 'type': 'int'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'kube_environment_profile': {'key': 'properties.kubeEnvironmentProfile', 'type': 'KubeEnvironmentProfile'}, + 'zone_redundant': {'key': 'properties.zoneRedundant', 'type': 'bool'}, + } + + def __init__( + self, + *, + location: str, + kind: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + sku: Optional["SkuDescription"] = None, + extended_location: Optional["ExtendedLocation"] = None, + worker_tier_name: Optional[str] = None, + hosting_environment_profile: Optional["HostingEnvironmentProfile"] = None, + per_site_scaling: Optional[bool] = False, + elastic_scale_enabled: Optional[bool] = None, + maximum_elastic_worker_count: Optional[int] = None, + is_spot: Optional[bool] = None, + spot_expiration_time: Optional[datetime.datetime] = None, + free_offer_expiration_time: Optional[datetime.datetime] = None, + reserved: Optional[bool] = False, + is_xenon: Optional[bool] = False, + hyper_v: Optional[bool] = False, + target_worker_count: Optional[int] = None, + target_worker_size_id: Optional[int] = None, + kube_environment_profile: Optional["KubeEnvironmentProfile"] = None, + zone_redundant: Optional[bool] = False, + **kwargs + ): + super(AppServicePlan, self).__init__(kind=kind, location=location, tags=tags, **kwargs) + self.sku = sku + self.extended_location = extended_location + self.worker_tier_name = worker_tier_name + self.status = None + self.subscription = None + self.hosting_environment_profile = hosting_environment_profile + self.maximum_number_of_workers = None + self.geo_region = None + self.per_site_scaling = per_site_scaling + self.elastic_scale_enabled = elastic_scale_enabled + self.maximum_elastic_worker_count = maximum_elastic_worker_count + self.number_of_sites = None + self.is_spot = is_spot + self.spot_expiration_time = spot_expiration_time + self.free_offer_expiration_time = free_offer_expiration_time + self.resource_group = None + self.reserved = reserved + self.is_xenon = is_xenon + self.hyper_v = hyper_v + self.target_worker_count = target_worker_count + self.target_worker_size_id = target_worker_size_id + self.provisioning_state = None + self.kube_environment_profile = kube_environment_profile + self.zone_redundant = zone_redundant + + +class AppServicePlanCollection(msrest.serialization.Model): + """Collection of App Service plans. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.AppServicePlan] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AppServicePlan]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["AppServicePlan"], + **kwargs + ): + super(AppServicePlanCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class AppServicePlanPatchResource(ProxyOnlyResource): + """ARM resource for a app service plan. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param worker_tier_name: Target worker tier assigned to the App Service plan. + :type worker_tier_name: str + :ivar status: App Service plan status. Possible values include: "Ready", "Pending", "Creating". + :vartype status: str or ~azure.mgmt.web.v2021_02_01.models.StatusOptions + :ivar subscription: App Service plan subscription. + :vartype subscription: str + :param hosting_environment_profile: Specification for the App Service Environment to use for + the App Service plan. + :type hosting_environment_profile: ~azure.mgmt.web.v2021_02_01.models.HostingEnvironmentProfile + :ivar maximum_number_of_workers: Maximum number of instances that can be assigned to this App + Service plan. + :vartype maximum_number_of_workers: int + :ivar geo_region: Geographical location for the App Service plan. + :vartype geo_region: str + :param per_site_scaling: If :code:`true`, apps assigned to this App Service plan + can be scaled independently. + If :code:`false`, apps assigned to this App Service plan will scale to all + instances of the plan. + :type per_site_scaling: bool + :param elastic_scale_enabled: ServerFarm supports ElasticScale. Apps in this plan will scale as + if the ServerFarm was ElasticPremium sku. + :type elastic_scale_enabled: bool + :param maximum_elastic_worker_count: Maximum number of total workers allowed for this + ElasticScaleEnabled App Service Plan. + :type maximum_elastic_worker_count: int + :ivar number_of_sites: Number of apps assigned to this App Service plan. + :vartype number_of_sites: int + :param is_spot: If :code:`true`, this App Service Plan owns spot instances. + :type is_spot: bool + :param spot_expiration_time: The time when the server farm expires. Valid only if it is a spot + server farm. + :type spot_expiration_time: ~datetime.datetime + :param free_offer_expiration_time: The time when the server farm free offer expires. + :type free_offer_expiration_time: ~datetime.datetime + :ivar resource_group: Resource group of the App Service plan. + :vartype resource_group: str + :param reserved: If Linux app service plan :code:`true`, + :code:`false` otherwise. + :type reserved: bool + :param is_xenon: Obsolete: If Hyper-V container app service plan :code:`true`, + :code:`false` otherwise. + :type is_xenon: bool + :param hyper_v: If Hyper-V container app service plan :code:`true`, + :code:`false` otherwise. + :type hyper_v: bool + :param target_worker_count: Scaling worker count. + :type target_worker_count: int + :param target_worker_size_id: Scaling worker size ID. + :type target_worker_size_id: int + :ivar provisioning_state: Provisioning state of the App Service Plan. Possible values include: + "Succeeded", "Failed", "Canceled", "InProgress", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.web.v2021_02_01.models.ProvisioningState + :param kube_environment_profile: Specification for the Kubernetes Environment to use for the + App Service plan. + :type kube_environment_profile: ~azure.mgmt.web.v2021_02_01.models.KubeEnvironmentProfile + :param zone_redundant: If :code:`true`, this App Service Plan will perform + availability zone balancing. + If :code:`false`, this App Service Plan will not perform availability zone + balancing. + :type zone_redundant: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'status': {'readonly': True}, + 'subscription': {'readonly': True}, + 'maximum_number_of_workers': {'readonly': True}, + 'geo_region': {'readonly': True}, + 'number_of_sites': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'worker_tier_name': {'key': 'properties.workerTierName', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'subscription': {'key': 'properties.subscription', 'type': 'str'}, + 'hosting_environment_profile': {'key': 'properties.hostingEnvironmentProfile', 'type': 'HostingEnvironmentProfile'}, + 'maximum_number_of_workers': {'key': 'properties.maximumNumberOfWorkers', 'type': 'int'}, + 'geo_region': {'key': 'properties.geoRegion', 'type': 'str'}, + 'per_site_scaling': {'key': 'properties.perSiteScaling', 'type': 'bool'}, + 'elastic_scale_enabled': {'key': 'properties.elasticScaleEnabled', 'type': 'bool'}, + 'maximum_elastic_worker_count': {'key': 'properties.maximumElasticWorkerCount', 'type': 'int'}, + 'number_of_sites': {'key': 'properties.numberOfSites', 'type': 'int'}, + 'is_spot': {'key': 'properties.isSpot', 'type': 'bool'}, + 'spot_expiration_time': {'key': 'properties.spotExpirationTime', 'type': 'iso-8601'}, + 'free_offer_expiration_time': {'key': 'properties.freeOfferExpirationTime', 'type': 'iso-8601'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'reserved': {'key': 'properties.reserved', 'type': 'bool'}, + 'is_xenon': {'key': 'properties.isXenon', 'type': 'bool'}, + 'hyper_v': {'key': 'properties.hyperV', 'type': 'bool'}, + 'target_worker_count': {'key': 'properties.targetWorkerCount', 'type': 'int'}, + 'target_worker_size_id': {'key': 'properties.targetWorkerSizeId', 'type': 'int'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'kube_environment_profile': {'key': 'properties.kubeEnvironmentProfile', 'type': 'KubeEnvironmentProfile'}, + 'zone_redundant': {'key': 'properties.zoneRedundant', 'type': 'bool'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + worker_tier_name: Optional[str] = None, + hosting_environment_profile: Optional["HostingEnvironmentProfile"] = None, + per_site_scaling: Optional[bool] = False, + elastic_scale_enabled: Optional[bool] = None, + maximum_elastic_worker_count: Optional[int] = None, + is_spot: Optional[bool] = None, + spot_expiration_time: Optional[datetime.datetime] = None, + free_offer_expiration_time: Optional[datetime.datetime] = None, + reserved: Optional[bool] = False, + is_xenon: Optional[bool] = False, + hyper_v: Optional[bool] = False, + target_worker_count: Optional[int] = None, + target_worker_size_id: Optional[int] = None, + kube_environment_profile: Optional["KubeEnvironmentProfile"] = None, + zone_redundant: Optional[bool] = False, + **kwargs + ): + super(AppServicePlanPatchResource, self).__init__(kind=kind, **kwargs) + self.worker_tier_name = worker_tier_name + self.status = None + self.subscription = None + self.hosting_environment_profile = hosting_environment_profile + self.maximum_number_of_workers = None + self.geo_region = None + self.per_site_scaling = per_site_scaling + self.elastic_scale_enabled = elastic_scale_enabled + self.maximum_elastic_worker_count = maximum_elastic_worker_count + self.number_of_sites = None + self.is_spot = is_spot + self.spot_expiration_time = spot_expiration_time + self.free_offer_expiration_time = free_offer_expiration_time + self.resource_group = None + self.reserved = reserved + self.is_xenon = is_xenon + self.hyper_v = hyper_v + self.target_worker_count = target_worker_count + self.target_worker_size_id = target_worker_size_id + self.provisioning_state = None + self.kube_environment_profile = kube_environment_profile + self.zone_redundant = zone_redundant + + +class ArcConfiguration(msrest.serialization.Model): + """ArcConfiguration. + + :param artifacts_storage_type: Possible values include: "LocalNode", "NetworkFileSystem". + :type artifacts_storage_type: str or ~azure.mgmt.web.v2021_02_01.models.StorageType + :param artifact_storage_class_name: + :type artifact_storage_class_name: str + :param artifact_storage_mount_path: + :type artifact_storage_mount_path: str + :param artifact_storage_node_name: + :type artifact_storage_node_name: str + :param artifact_storage_access_mode: + :type artifact_storage_access_mode: str + :param front_end_service_configuration: + :type front_end_service_configuration: ~azure.mgmt.web.v2021_02_01.models.FrontEndConfiguration + :param kube_config: + :type kube_config: str + """ + + _attribute_map = { + 'artifacts_storage_type': {'key': 'artifactsStorageType', 'type': 'str'}, + 'artifact_storage_class_name': {'key': 'artifactStorageClassName', 'type': 'str'}, + 'artifact_storage_mount_path': {'key': 'artifactStorageMountPath', 'type': 'str'}, + 'artifact_storage_node_name': {'key': 'artifactStorageNodeName', 'type': 'str'}, + 'artifact_storage_access_mode': {'key': 'artifactStorageAccessMode', 'type': 'str'}, + 'front_end_service_configuration': {'key': 'frontEndServiceConfiguration', 'type': 'FrontEndConfiguration'}, + 'kube_config': {'key': 'kubeConfig', 'type': 'str'}, + } + + def __init__( + self, + *, + artifacts_storage_type: Optional[Union[str, "StorageType"]] = None, + artifact_storage_class_name: Optional[str] = None, + artifact_storage_mount_path: Optional[str] = None, + artifact_storage_node_name: Optional[str] = None, + artifact_storage_access_mode: Optional[str] = None, + front_end_service_configuration: Optional["FrontEndConfiguration"] = None, + kube_config: Optional[str] = None, + **kwargs + ): + super(ArcConfiguration, self).__init__(**kwargs) + self.artifacts_storage_type = artifacts_storage_type + self.artifact_storage_class_name = artifact_storage_class_name + self.artifact_storage_mount_path = artifact_storage_mount_path + self.artifact_storage_node_name = artifact_storage_node_name + self.artifact_storage_access_mode = artifact_storage_access_mode + self.front_end_service_configuration = front_end_service_configuration + self.kube_config = kube_config + + +class ArmIdWrapper(msrest.serialization.Model): + """A wrapper for an ARM resource id. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ArmIdWrapper, self).__init__(**kwargs) + self.id = None + + +class ArmPlan(msrest.serialization.Model): + """The plan object in Azure Resource Manager, represents a marketplace plan. + + :param name: The name. + :type name: str + :param publisher: The publisher. + :type publisher: str + :param product: The product. + :type product: str + :param promotion_code: The promotion code. + :type promotion_code: str + :param version: Version of product. + :type version: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'product': {'key': 'product', 'type': 'str'}, + 'promotion_code': {'key': 'promotionCode', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + publisher: Optional[str] = None, + product: Optional[str] = None, + promotion_code: Optional[str] = None, + version: Optional[str] = None, + **kwargs + ): + super(ArmPlan, self).__init__(**kwargs) + self.name = name + self.publisher = publisher + self.product = product + self.promotion_code = promotion_code + self.version = version + + +class AseV3NetworkingConfiguration(ProxyOnlyResource): + """Full view of networking configuration for an ASE. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar windows_outbound_ip_addresses: + :vartype windows_outbound_ip_addresses: list[str] + :ivar linux_outbound_ip_addresses: + :vartype linux_outbound_ip_addresses: list[str] + :ivar external_inbound_ip_addresses: + :vartype external_inbound_ip_addresses: list[str] + :ivar internal_inbound_ip_addresses: + :vartype internal_inbound_ip_addresses: list[str] + :param allow_new_private_endpoint_connections: Property to enable and disable new private + endpoint connection creation on ASE. + :type allow_new_private_endpoint_connections: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'windows_outbound_ip_addresses': {'readonly': True}, + 'linux_outbound_ip_addresses': {'readonly': True}, + 'external_inbound_ip_addresses': {'readonly': True}, + 'internal_inbound_ip_addresses': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'windows_outbound_ip_addresses': {'key': 'properties.windowsOutboundIpAddresses', 'type': '[str]'}, + 'linux_outbound_ip_addresses': {'key': 'properties.linuxOutboundIpAddresses', 'type': '[str]'}, + 'external_inbound_ip_addresses': {'key': 'properties.externalInboundIpAddresses', 'type': '[str]'}, + 'internal_inbound_ip_addresses': {'key': 'properties.internalInboundIpAddresses', 'type': '[str]'}, + 'allow_new_private_endpoint_connections': {'key': 'properties.allowNewPrivateEndpointConnections', 'type': 'bool'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + allow_new_private_endpoint_connections: Optional[bool] = None, + **kwargs + ): + super(AseV3NetworkingConfiguration, self).__init__(kind=kind, **kwargs) + self.windows_outbound_ip_addresses = None + self.linux_outbound_ip_addresses = None + self.external_inbound_ip_addresses = None + self.internal_inbound_ip_addresses = None + self.allow_new_private_endpoint_connections = allow_new_private_endpoint_connections + + +class AuthPlatform(msrest.serialization.Model): + """The configuration settings of the platform of App Service Authentication/Authorization. + + :param enabled: :code:`true` if the Authentication / Authorization feature is + enabled for the current app; otherwise, :code:`false`. + :type enabled: bool + :param runtime_version: The RuntimeVersion of the Authentication / Authorization feature in use + for the current app. + The setting in this value can control the behavior of certain features in the Authentication / + Authorization module. + :type runtime_version: str + :param config_file_path: The path of the config file containing auth settings if they come from + a file. + If the path is relative, base will the site's root directory. + :type config_file_path: str + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, + 'config_file_path': {'key': 'configFilePath', 'type': 'str'}, + } + + def __init__( + self, + *, + enabled: Optional[bool] = None, + runtime_version: Optional[str] = None, + config_file_path: Optional[str] = None, + **kwargs + ): + super(AuthPlatform, self).__init__(**kwargs) + self.enabled = enabled + self.runtime_version = runtime_version + self.config_file_path = config_file_path + + +class AutoHealActions(msrest.serialization.Model): + """Actions which to take by the auto-heal module when a rule is triggered. + + :param action_type: Predefined action to be taken. Possible values include: "Recycle", + "LogEvent", "CustomAction". + :type action_type: str or ~azure.mgmt.web.v2021_02_01.models.AutoHealActionType + :param custom_action: Custom action to be taken. + :type custom_action: ~azure.mgmt.web.v2021_02_01.models.AutoHealCustomAction + :param min_process_execution_time: Minimum time the process must execute + before taking the action. + :type min_process_execution_time: str + """ + + _attribute_map = { + 'action_type': {'key': 'actionType', 'type': 'str'}, + 'custom_action': {'key': 'customAction', 'type': 'AutoHealCustomAction'}, + 'min_process_execution_time': {'key': 'minProcessExecutionTime', 'type': 'str'}, + } + + def __init__( + self, + *, + action_type: Optional[Union[str, "AutoHealActionType"]] = None, + custom_action: Optional["AutoHealCustomAction"] = None, + min_process_execution_time: Optional[str] = None, + **kwargs + ): + super(AutoHealActions, self).__init__(**kwargs) + self.action_type = action_type + self.custom_action = custom_action + self.min_process_execution_time = min_process_execution_time + + +class AutoHealCustomAction(msrest.serialization.Model): + """Custom action to be executed +when an auto heal rule is triggered. + + :param exe: Executable to be run. + :type exe: str + :param parameters: Parameters for the executable. + :type parameters: str + """ + + _attribute_map = { + 'exe': {'key': 'exe', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'str'}, + } + + def __init__( + self, + *, + exe: Optional[str] = None, + parameters: Optional[str] = None, + **kwargs + ): + super(AutoHealCustomAction, self).__init__(**kwargs) + self.exe = exe + self.parameters = parameters + + +class AutoHealRules(msrest.serialization.Model): + """Rules that can be defined for auto-heal. + + :param triggers: Conditions that describe when to execute the auto-heal actions. + :type triggers: ~azure.mgmt.web.v2021_02_01.models.AutoHealTriggers + :param actions: Actions to be executed when a rule is triggered. + :type actions: ~azure.mgmt.web.v2021_02_01.models.AutoHealActions + """ + + _attribute_map = { + 'triggers': {'key': 'triggers', 'type': 'AutoHealTriggers'}, + 'actions': {'key': 'actions', 'type': 'AutoHealActions'}, + } + + def __init__( + self, + *, + triggers: Optional["AutoHealTriggers"] = None, + actions: Optional["AutoHealActions"] = None, + **kwargs + ): + super(AutoHealRules, self).__init__(**kwargs) + self.triggers = triggers + self.actions = actions + + +class AutoHealTriggers(msrest.serialization.Model): + """Triggers for auto-heal. + + :param requests: A rule based on total requests. + :type requests: ~azure.mgmt.web.v2021_02_01.models.RequestsBasedTrigger + :param private_bytes_in_kb: A rule based on private bytes. + :type private_bytes_in_kb: int + :param status_codes: A rule based on status codes. + :type status_codes: list[~azure.mgmt.web.v2021_02_01.models.StatusCodesBasedTrigger] + :param slow_requests: A rule based on request execution time. + :type slow_requests: ~azure.mgmt.web.v2021_02_01.models.SlowRequestsBasedTrigger + :param slow_requests_with_path: A rule based on multiple Slow Requests Rule with path. + :type slow_requests_with_path: + list[~azure.mgmt.web.v2021_02_01.models.SlowRequestsBasedTrigger] + :param status_codes_range: A rule based on status codes ranges. + :type status_codes_range: list[~azure.mgmt.web.v2021_02_01.models.StatusCodesRangeBasedTrigger] + """ + + _attribute_map = { + 'requests': {'key': 'requests', 'type': 'RequestsBasedTrigger'}, + 'private_bytes_in_kb': {'key': 'privateBytesInKB', 'type': 'int'}, + 'status_codes': {'key': 'statusCodes', 'type': '[StatusCodesBasedTrigger]'}, + 'slow_requests': {'key': 'slowRequests', 'type': 'SlowRequestsBasedTrigger'}, + 'slow_requests_with_path': {'key': 'slowRequestsWithPath', 'type': '[SlowRequestsBasedTrigger]'}, + 'status_codes_range': {'key': 'statusCodesRange', 'type': '[StatusCodesRangeBasedTrigger]'}, + } + + def __init__( + self, + *, + requests: Optional["RequestsBasedTrigger"] = None, + private_bytes_in_kb: Optional[int] = None, + status_codes: Optional[List["StatusCodesBasedTrigger"]] = None, + slow_requests: Optional["SlowRequestsBasedTrigger"] = None, + slow_requests_with_path: Optional[List["SlowRequestsBasedTrigger"]] = None, + status_codes_range: Optional[List["StatusCodesRangeBasedTrigger"]] = None, + **kwargs + ): + super(AutoHealTriggers, self).__init__(**kwargs) + self.requests = requests + self.private_bytes_in_kb = private_bytes_in_kb + self.status_codes = status_codes + self.slow_requests = slow_requests + self.slow_requests_with_path = slow_requests_with_path + self.status_codes_range = status_codes_range + + +class AzureActiveDirectory(msrest.serialization.Model): + """The configuration settings of the Azure Active directory provider. + + :param enabled: :code:`false` if the Azure Active Directory provider should not be + enabled despite the set registration; otherwise, :code:`true`. + :type enabled: bool + :param registration: The configuration settings of the Azure Active Directory app registration. + :type registration: ~azure.mgmt.web.v2021_02_01.models.AzureActiveDirectoryRegistration + :param login: The configuration settings of the Azure Active Directory login flow. + :type login: ~azure.mgmt.web.v2021_02_01.models.AzureActiveDirectoryLogin + :param validation: The configuration settings of the Azure Active Directory token validation + flow. + :type validation: ~azure.mgmt.web.v2021_02_01.models.AzureActiveDirectoryValidation + :param is_auto_provisioned: Gets a value indicating whether the Azure AD configuration was + auto-provisioned using 1st party tooling. + This is an internal flag primarily intended to support the Azure Management Portal. Users + should not + read or write to this property. + :type is_auto_provisioned: bool + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'AzureActiveDirectoryRegistration'}, + 'login': {'key': 'login', 'type': 'AzureActiveDirectoryLogin'}, + 'validation': {'key': 'validation', 'type': 'AzureActiveDirectoryValidation'}, + 'is_auto_provisioned': {'key': 'isAutoProvisioned', 'type': 'bool'}, + } + + def __init__( + self, + *, + enabled: Optional[bool] = None, + registration: Optional["AzureActiveDirectoryRegistration"] = None, + login: Optional["AzureActiveDirectoryLogin"] = None, + validation: Optional["AzureActiveDirectoryValidation"] = None, + is_auto_provisioned: Optional[bool] = None, + **kwargs + ): + super(AzureActiveDirectory, self).__init__(**kwargs) + self.enabled = enabled + self.registration = registration + self.login = login + self.validation = validation + self.is_auto_provisioned = is_auto_provisioned + + +class AzureActiveDirectoryLogin(msrest.serialization.Model): + """The configuration settings of the Azure Active Directory login flow. + + :param login_parameters: Login parameters to send to the OpenID Connect authorization endpoint + when + a user logs in. Each parameter must be in the form "key=value". + :type login_parameters: list[str] + :param disable_www_authenticate: :code:`true` if the www-authenticate provider + should be omitted from the request; otherwise, :code:`false`. + :type disable_www_authenticate: bool + """ + + _attribute_map = { + 'login_parameters': {'key': 'loginParameters', 'type': '[str]'}, + 'disable_www_authenticate': {'key': 'disableWWWAuthenticate', 'type': 'bool'}, + } + + def __init__( + self, + *, + login_parameters: Optional[List[str]] = None, + disable_www_authenticate: Optional[bool] = None, + **kwargs + ): + super(AzureActiveDirectoryLogin, self).__init__(**kwargs) + self.login_parameters = login_parameters + self.disable_www_authenticate = disable_www_authenticate + + +class AzureActiveDirectoryRegistration(msrest.serialization.Model): + """The configuration settings of the Azure Active Directory app registration. + + :param open_id_issuer: The OpenID Connect Issuer URI that represents the entity which issues + access tokens for this application. + When using Azure Active Directory, this value is the URI of the directory tenant, e.g. + https://login.microsoftonline.com/v2.0/{tenant-guid}/. + This URI is a case-sensitive identifier for the token issuer. + More information on OpenID Connect Discovery: + http://openid.net/specs/openid-connect-discovery-1_0.html. + :type open_id_issuer: str + :param client_id: The Client ID of this relying party application, known as the client_id. + This setting is required for enabling OpenID Connection authentication with Azure Active + Directory or + other 3rd party OpenID Connect providers. + More information on OpenID Connect: http://openid.net/specs/openid-connect-core-1_0.html. + :type client_id: str + :param client_secret_setting_name: The app setting name that contains the client secret of the + relying party application. + :type client_secret_setting_name: str + :param client_secret_certificate_thumbprint: An alternative to the client secret, that is the + thumbprint of a certificate used for signing purposes. This property acts as + a replacement for the Client Secret. It is also optional. + :type client_secret_certificate_thumbprint: str + :param client_secret_certificate_subject_alternative_name: An alternative to the client secret + thumbprint, that is the subject alternative name of a certificate used for signing purposes. + This property acts as + a replacement for the Client Secret Certificate Thumbprint. It is also optional. + :type client_secret_certificate_subject_alternative_name: str + :param client_secret_certificate_issuer: An alternative to the client secret thumbprint, that + is the issuer of a certificate used for signing purposes. This property acts as + a replacement for the Client Secret Certificate Thumbprint. It is also optional. + :type client_secret_certificate_issuer: str + """ + + _attribute_map = { + 'open_id_issuer': {'key': 'openIdIssuer', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'client_secret_setting_name': {'key': 'clientSecretSettingName', 'type': 'str'}, + 'client_secret_certificate_thumbprint': {'key': 'clientSecretCertificateThumbprint', 'type': 'str'}, + 'client_secret_certificate_subject_alternative_name': {'key': 'clientSecretCertificateSubjectAlternativeName', 'type': 'str'}, + 'client_secret_certificate_issuer': {'key': 'clientSecretCertificateIssuer', 'type': 'str'}, + } + + def __init__( + self, + *, + open_id_issuer: Optional[str] = None, + client_id: Optional[str] = None, + client_secret_setting_name: Optional[str] = None, + client_secret_certificate_thumbprint: Optional[str] = None, + client_secret_certificate_subject_alternative_name: Optional[str] = None, + client_secret_certificate_issuer: Optional[str] = None, + **kwargs + ): + super(AzureActiveDirectoryRegistration, self).__init__(**kwargs) + self.open_id_issuer = open_id_issuer + self.client_id = client_id + self.client_secret_setting_name = client_secret_setting_name + self.client_secret_certificate_thumbprint = client_secret_certificate_thumbprint + self.client_secret_certificate_subject_alternative_name = client_secret_certificate_subject_alternative_name + self.client_secret_certificate_issuer = client_secret_certificate_issuer + + +class AzureActiveDirectoryValidation(msrest.serialization.Model): + """The configuration settings of the Azure Active Directory token validation flow. + + :param jwt_claim_checks: The configuration settings of the checks that should be made while + validating the JWT Claims. + :type jwt_claim_checks: ~azure.mgmt.web.v2021_02_01.models.JwtClaimChecks + :param allowed_audiences: The list of audiences that can make successful + authentication/authorization requests. + :type allowed_audiences: list[str] + :param default_authorization_policy: The configuration settings of the default authorization + policy. + :type default_authorization_policy: + ~azure.mgmt.web.v2021_02_01.models.DefaultAuthorizationPolicy + """ + + _attribute_map = { + 'jwt_claim_checks': {'key': 'jwtClaimChecks', 'type': 'JwtClaimChecks'}, + 'allowed_audiences': {'key': 'allowedAudiences', 'type': '[str]'}, + 'default_authorization_policy': {'key': 'defaultAuthorizationPolicy', 'type': 'DefaultAuthorizationPolicy'}, + } + + def __init__( + self, + *, + jwt_claim_checks: Optional["JwtClaimChecks"] = None, + allowed_audiences: Optional[List[str]] = None, + default_authorization_policy: Optional["DefaultAuthorizationPolicy"] = None, + **kwargs + ): + super(AzureActiveDirectoryValidation, self).__init__(**kwargs) + self.jwt_claim_checks = jwt_claim_checks + self.allowed_audiences = allowed_audiences + self.default_authorization_policy = default_authorization_policy + + +class AzureBlobStorageApplicationLogsConfig(msrest.serialization.Model): + """Application logs azure blob storage configuration. + + :param level: Log level. Possible values include: "Off", "Verbose", "Information", "Warning", + "Error". + :type level: str or ~azure.mgmt.web.v2021_02_01.models.LogLevel + :param sas_url: SAS url to a azure blob container with read/write/list/delete permissions. + :type sas_url: str + :param retention_in_days: Retention in days. + Remove blobs older than X days. + 0 or lower means no retention. + :type retention_in_days: int + """ + + _attribute_map = { + 'level': {'key': 'level', 'type': 'str'}, + 'sas_url': {'key': 'sasUrl', 'type': 'str'}, + 'retention_in_days': {'key': 'retentionInDays', 'type': 'int'}, + } + + def __init__( + self, + *, + level: Optional[Union[str, "LogLevel"]] = None, + sas_url: Optional[str] = None, + retention_in_days: Optional[int] = None, + **kwargs + ): + super(AzureBlobStorageApplicationLogsConfig, self).__init__(**kwargs) + self.level = level + self.sas_url = sas_url + self.retention_in_days = retention_in_days + + +class AzureBlobStorageHttpLogsConfig(msrest.serialization.Model): + """Http logs to azure blob storage configuration. + + :param sas_url: SAS url to a azure blob container with read/write/list/delete permissions. + :type sas_url: str + :param retention_in_days: Retention in days. + Remove blobs older than X days. + 0 or lower means no retention. + :type retention_in_days: int + :param enabled: True if configuration is enabled, false if it is disabled and null if + configuration is not set. + :type enabled: bool + """ + + _attribute_map = { + 'sas_url': {'key': 'sasUrl', 'type': 'str'}, + 'retention_in_days': {'key': 'retentionInDays', 'type': 'int'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__( + self, + *, + sas_url: Optional[str] = None, + retention_in_days: Optional[int] = None, + enabled: Optional[bool] = None, + **kwargs + ): + super(AzureBlobStorageHttpLogsConfig, self).__init__(**kwargs) + self.sas_url = sas_url + self.retention_in_days = retention_in_days + self.enabled = enabled + + +class AzureStaticWebApps(msrest.serialization.Model): + """The configuration settings of the Azure Static Web Apps provider. + + :param enabled: :code:`false` if the Azure Static Web Apps provider should not be + enabled despite the set registration; otherwise, :code:`true`. + :type enabled: bool + :param registration: The configuration settings of the Azure Static Web Apps registration. + :type registration: ~azure.mgmt.web.v2021_02_01.models.AzureStaticWebAppsRegistration + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'AzureStaticWebAppsRegistration'}, + } + + def __init__( + self, + *, + enabled: Optional[bool] = None, + registration: Optional["AzureStaticWebAppsRegistration"] = None, + **kwargs + ): + super(AzureStaticWebApps, self).__init__(**kwargs) + self.enabled = enabled + self.registration = registration + + +class AzureStaticWebAppsRegistration(msrest.serialization.Model): + """The configuration settings of the registration for the Azure Static Web Apps provider. + + :param client_id: The Client ID of the app used for login. + :type client_id: str + """ + + _attribute_map = { + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + *, + client_id: Optional[str] = None, + **kwargs + ): + super(AzureStaticWebAppsRegistration, self).__init__(**kwargs) + self.client_id = client_id + + +class AzureStorageInfoValue(msrest.serialization.Model): + """Azure Files or Blob Storage access information value for dictionary storage. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param type: Type of storage. Possible values include: "AzureFiles", "AzureBlob". + :type type: str or ~azure.mgmt.web.v2021_02_01.models.AzureStorageType + :param account_name: Name of the storage account. + :type account_name: str + :param share_name: Name of the file share (container name, for Blob storage). + :type share_name: str + :param access_key: Access key for the storage account. + :type access_key: str + :param mount_path: Path to mount the storage within the site's runtime environment. + :type mount_path: str + :ivar state: State of the storage account. Possible values include: "Ok", "InvalidCredentials", + "InvalidShare", "NotValidated". + :vartype state: str or ~azure.mgmt.web.v2021_02_01.models.AzureStorageState + """ + + _validation = { + 'state': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'account_name': {'key': 'accountName', 'type': 'str'}, + 'share_name': {'key': 'shareName', 'type': 'str'}, + 'access_key': {'key': 'accessKey', 'type': 'str'}, + 'mount_path': {'key': 'mountPath', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "AzureStorageType"]] = None, + account_name: Optional[str] = None, + share_name: Optional[str] = None, + access_key: Optional[str] = None, + mount_path: Optional[str] = None, + **kwargs + ): + super(AzureStorageInfoValue, self).__init__(**kwargs) + self.type = type + self.account_name = account_name + self.share_name = share_name + self.access_key = access_key + self.mount_path = mount_path + self.state = None + + +class AzureStoragePropertyDictionaryResource(ProxyOnlyResource): + """AzureStorageInfo dictionary resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param properties: Azure storage accounts. + :type properties: dict[str, ~azure.mgmt.web.v2021_02_01.models.AzureStorageInfoValue] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': '{AzureStorageInfoValue}'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + properties: Optional[Dict[str, "AzureStorageInfoValue"]] = None, + **kwargs + ): + super(AzureStoragePropertyDictionaryResource, self).__init__(kind=kind, **kwargs) + self.properties = properties + + +class AzureTableStorageApplicationLogsConfig(msrest.serialization.Model): + """Application logs to Azure table storage configuration. + + All required parameters must be populated in order to send to Azure. + + :param level: Log level. Possible values include: "Off", "Verbose", "Information", "Warning", + "Error". + :type level: str or ~azure.mgmt.web.v2021_02_01.models.LogLevel + :param sas_url: Required. SAS URL to an Azure table with add/query/delete permissions. + :type sas_url: str + """ + + _validation = { + 'sas_url': {'required': True}, + } + + _attribute_map = { + 'level': {'key': 'level', 'type': 'str'}, + 'sas_url': {'key': 'sasUrl', 'type': 'str'}, + } + + def __init__( + self, + *, + sas_url: str, + level: Optional[Union[str, "LogLevel"]] = None, + **kwargs + ): + super(AzureTableStorageApplicationLogsConfig, self).__init__(**kwargs) + self.level = level + self.sas_url = sas_url + + +class BackupItem(ProxyOnlyResource): + """Backup description. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar backup_id: Id of the backup. + :vartype backup_id: int + :ivar storage_account_url: SAS URL for the storage account container which contains this + backup. + :vartype storage_account_url: str + :ivar blob_name: Name of the blob which contains data for this backup. + :vartype blob_name: str + :ivar name_properties_name: Name of this backup. + :vartype name_properties_name: str + :ivar status: Backup status. Possible values include: "InProgress", "Failed", "Succeeded", + "TimedOut", "Created", "Skipped", "PartiallySucceeded", "DeleteInProgress", "DeleteFailed", + "Deleted". + :vartype status: str or ~azure.mgmt.web.v2021_02_01.models.BackupItemStatus + :ivar size_in_bytes: Size of the backup in bytes. + :vartype size_in_bytes: long + :ivar created: Timestamp of the backup creation. + :vartype created: ~datetime.datetime + :ivar log: Details regarding this backup. Might contain an error message. + :vartype log: str + :ivar databases: List of databases included in the backup. + :vartype databases: list[~azure.mgmt.web.v2021_02_01.models.DatabaseBackupSetting] + :ivar scheduled: True if this backup has been created due to a schedule being triggered. + :vartype scheduled: bool + :ivar last_restore_time_stamp: Timestamp of a last restore operation which used this backup. + :vartype last_restore_time_stamp: ~datetime.datetime + :ivar finished_time_stamp: Timestamp when this backup finished. + :vartype finished_time_stamp: ~datetime.datetime + :ivar correlation_id: Unique correlation identifier. Please use this along with the timestamp + while communicating with Azure support. + :vartype correlation_id: str + :ivar website_size_in_bytes: Size of the original web app which has been backed up. + :vartype website_size_in_bytes: long + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'backup_id': {'readonly': True}, + 'storage_account_url': {'readonly': True}, + 'blob_name': {'readonly': True}, + 'name_properties_name': {'readonly': True}, + 'status': {'readonly': True}, + 'size_in_bytes': {'readonly': True}, + 'created': {'readonly': True}, + 'log': {'readonly': True}, + 'databases': {'readonly': True}, + 'scheduled': {'readonly': True}, + 'last_restore_time_stamp': {'readonly': True}, + 'finished_time_stamp': {'readonly': True}, + 'correlation_id': {'readonly': True}, + 'website_size_in_bytes': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'backup_id': {'key': 'properties.id', 'type': 'int'}, + 'storage_account_url': {'key': 'properties.storageAccountUrl', 'type': 'str'}, + 'blob_name': {'key': 'properties.blobName', 'type': 'str'}, + 'name_properties_name': {'key': 'properties.name', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'size_in_bytes': {'key': 'properties.sizeInBytes', 'type': 'long'}, + 'created': {'key': 'properties.created', 'type': 'iso-8601'}, + 'log': {'key': 'properties.log', 'type': 'str'}, + 'databases': {'key': 'properties.databases', 'type': '[DatabaseBackupSetting]'}, + 'scheduled': {'key': 'properties.scheduled', 'type': 'bool'}, + 'last_restore_time_stamp': {'key': 'properties.lastRestoreTimeStamp', 'type': 'iso-8601'}, + 'finished_time_stamp': {'key': 'properties.finishedTimeStamp', 'type': 'iso-8601'}, + 'correlation_id': {'key': 'properties.correlationId', 'type': 'str'}, + 'website_size_in_bytes': {'key': 'properties.websiteSizeInBytes', 'type': 'long'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(BackupItem, self).__init__(kind=kind, **kwargs) + self.backup_id = None + self.storage_account_url = None + self.blob_name = None + self.name_properties_name = None + self.status = None + self.size_in_bytes = None + self.created = None + self.log = None + self.databases = None + self.scheduled = None + self.last_restore_time_stamp = None + self.finished_time_stamp = None + self.correlation_id = None + self.website_size_in_bytes = None + + +class BackupItemCollection(msrest.serialization.Model): + """Collection of backup items. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.BackupItem] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BackupItem]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["BackupItem"], + **kwargs + ): + super(BackupItemCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class BackupRequest(ProxyOnlyResource): + """Description of a backup which will be performed. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param backup_name: Name of the backup. + :type backup_name: str + :param enabled: True if the backup schedule is enabled (must be included in that case), false + if the backup schedule should be disabled. + :type enabled: bool + :param storage_account_url: SAS URL to the container. + :type storage_account_url: str + :param backup_schedule: Schedule for the backup if it is executed periodically. + :type backup_schedule: ~azure.mgmt.web.v2021_02_01.models.BackupSchedule + :param databases: Databases included in the backup. + :type databases: list[~azure.mgmt.web.v2021_02_01.models.DatabaseBackupSetting] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'backup_name': {'key': 'properties.backupName', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'storage_account_url': {'key': 'properties.storageAccountUrl', 'type': 'str'}, + 'backup_schedule': {'key': 'properties.backupSchedule', 'type': 'BackupSchedule'}, + 'databases': {'key': 'properties.databases', 'type': '[DatabaseBackupSetting]'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + backup_name: Optional[str] = None, + enabled: Optional[bool] = None, + storage_account_url: Optional[str] = None, + backup_schedule: Optional["BackupSchedule"] = None, + databases: Optional[List["DatabaseBackupSetting"]] = None, + **kwargs + ): + super(BackupRequest, self).__init__(kind=kind, **kwargs) + self.backup_name = backup_name + self.enabled = enabled + self.storage_account_url = storage_account_url + self.backup_schedule = backup_schedule + self.databases = databases + + +class BackupSchedule(msrest.serialization.Model): + """Description of a backup schedule. Describes how often should be the backup performed and what should be the retention policy. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param frequency_interval: Required. How often the backup should be executed (e.g. for weekly + backup, this should be set to 7 and FrequencyUnit should be set to Day). + :type frequency_interval: int + :param frequency_unit: Required. The unit of time for how often the backup should be executed + (e.g. for weekly backup, this should be set to Day and FrequencyInterval should be set to 7). + Possible values include: "Day", "Hour". Default value: "Day". + :type frequency_unit: str or ~azure.mgmt.web.v2021_02_01.models.FrequencyUnit + :param keep_at_least_one_backup: Required. True if the retention policy should always keep at + least one backup in the storage account, regardless how old it is; false otherwise. + :type keep_at_least_one_backup: bool + :param retention_period_in_days: Required. After how many days backups should be deleted. + :type retention_period_in_days: int + :param start_time: When the schedule should start working. + :type start_time: ~datetime.datetime + :ivar last_execution_time: Last time when this schedule was triggered. + :vartype last_execution_time: ~datetime.datetime + """ + + _validation = { + 'frequency_interval': {'required': True}, + 'frequency_unit': {'required': True}, + 'keep_at_least_one_backup': {'required': True}, + 'retention_period_in_days': {'required': True}, + 'last_execution_time': {'readonly': True}, + } + + _attribute_map = { + 'frequency_interval': {'key': 'frequencyInterval', 'type': 'int'}, + 'frequency_unit': {'key': 'frequencyUnit', 'type': 'str'}, + 'keep_at_least_one_backup': {'key': 'keepAtLeastOneBackup', 'type': 'bool'}, + 'retention_period_in_days': {'key': 'retentionPeriodInDays', 'type': 'int'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'last_execution_time': {'key': 'lastExecutionTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + frequency_interval: int = 7, + frequency_unit: Union[str, "FrequencyUnit"] = "Day", + keep_at_least_one_backup: bool = True, + retention_period_in_days: int = 30, + start_time: Optional[datetime.datetime] = None, + **kwargs + ): + super(BackupSchedule, self).__init__(**kwargs) + self.frequency_interval = frequency_interval + self.frequency_unit = frequency_unit + self.keep_at_least_one_backup = keep_at_least_one_backup + self.retention_period_in_days = retention_period_in_days + self.start_time = start_time + self.last_execution_time = None + + +class BillingMeter(ProxyOnlyResource): + """App Service billing entity that contains information about meter which the Azure billing system utilizes to charge users for services. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param meter_id: Meter GUID onboarded in Commerce. + :type meter_id: str + :param billing_location: Azure Location of billable resource. + :type billing_location: str + :param short_name: Short Name from App Service Azure pricing Page. + :type short_name: str + :param friendly_name: Friendly name of the meter. + :type friendly_name: str + :param resource_type: App Service ResourceType meter used for. + :type resource_type: str + :param os_type: App Service OS type meter used for. + :type os_type: str + :param multiplier: Meter Multiplier. + :type multiplier: float + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'meter_id': {'key': 'properties.meterId', 'type': 'str'}, + 'billing_location': {'key': 'properties.billingLocation', 'type': 'str'}, + 'short_name': {'key': 'properties.shortName', 'type': 'str'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'resource_type': {'key': 'properties.resourceType', 'type': 'str'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'multiplier': {'key': 'properties.multiplier', 'type': 'float'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + meter_id: Optional[str] = None, + billing_location: Optional[str] = None, + short_name: Optional[str] = None, + friendly_name: Optional[str] = None, + resource_type: Optional[str] = None, + os_type: Optional[str] = None, + multiplier: Optional[float] = None, + **kwargs + ): + super(BillingMeter, self).__init__(kind=kind, **kwargs) + self.meter_id = meter_id + self.billing_location = billing_location + self.short_name = short_name + self.friendly_name = friendly_name + self.resource_type = resource_type + self.os_type = os_type + self.multiplier = multiplier + + +class BillingMeterCollection(msrest.serialization.Model): + """Collection of Billing Meters. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.BillingMeter] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BillingMeter]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["BillingMeter"], + **kwargs + ): + super(BillingMeterCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class BlobStorageTokenStore(msrest.serialization.Model): + """The configuration settings of the storage of the tokens if blob storage is used. + + :param sas_url_setting_name: The name of the app setting containing the SAS URL of the blob + storage containing the tokens. + :type sas_url_setting_name: str + """ + + _attribute_map = { + 'sas_url_setting_name': {'key': 'sasUrlSettingName', 'type': 'str'}, + } + + def __init__( + self, + *, + sas_url_setting_name: Optional[str] = None, + **kwargs + ): + super(BlobStorageTokenStore, self).__init__(**kwargs) + self.sas_url_setting_name = sas_url_setting_name + + +class Capability(msrest.serialization.Model): + """Describes the capabilities/features allowed for a specific SKU. + + :param name: Name of the SKU capability. + :type name: str + :param value: Value of the SKU capability. + :type value: str + :param reason: Reason of the SKU capability. + :type reason: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'reason': {'key': 'reason', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + value: Optional[str] = None, + reason: Optional[str] = None, + **kwargs + ): + super(Capability, self).__init__(**kwargs) + self.name = name + self.value = value + self.reason = reason + + +class Certificate(Resource): + """SSL certificate for an app. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param password: Certificate password. + :type password: str + :ivar friendly_name: Friendly name of the certificate. + :vartype friendly_name: str + :ivar subject_name: Subject name of the certificate. + :vartype subject_name: str + :param host_names: Host names the certificate applies to. + :type host_names: list[str] + :param pfx_blob: Pfx blob. + :type pfx_blob: bytearray + :ivar site_name: App name. + :vartype site_name: str + :ivar self_link: Self link. + :vartype self_link: str + :ivar issuer: Certificate issuer. + :vartype issuer: str + :ivar issue_date: Certificate issue Date. + :vartype issue_date: ~datetime.datetime + :ivar expiration_date: Certificate expiration date. + :vartype expiration_date: ~datetime.datetime + :ivar thumbprint: Certificate thumbprint. + :vartype thumbprint: str + :ivar valid: Is the certificate valid?. + :vartype valid: bool + :ivar cer_blob: Raw bytes of .cer file. + :vartype cer_blob: bytearray + :ivar public_key_hash: Public key hash. + :vartype public_key_hash: str + :ivar hosting_environment_profile: Specification for the App Service Environment to use for the + certificate. + :vartype hosting_environment_profile: + ~azure.mgmt.web.v2021_02_01.models.HostingEnvironmentProfile + :param key_vault_id: Key Vault Csm resource Id. + :type key_vault_id: str + :param key_vault_secret_name: Key Vault secret name. + :type key_vault_secret_name: str + :ivar key_vault_secret_status: Status of the Key Vault secret. Possible values include: + "Initialized", "WaitingOnCertificateOrder", "Succeeded", "CertificateOrderFailed", + "OperationNotPermittedOnKeyVault", "AzureServiceUnauthorizedToAccessKeyVault", + "KeyVaultDoesNotExist", "KeyVaultSecretDoesNotExist", "UnknownError", "ExternalPrivateKey", + "Unknown". + :vartype key_vault_secret_status: str or + ~azure.mgmt.web.v2021_02_01.models.KeyVaultSecretStatus + :param server_farm_id: Resource ID of the associated App Service plan, formatted as: + "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + :type server_farm_id: str + :param canonical_name: CNAME of the certificate to be issued via free certificate. + :type canonical_name: str + :param domain_validation_method: Method of domain validation for free cert. + :type domain_validation_method: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'friendly_name': {'readonly': True}, + 'subject_name': {'readonly': True}, + 'site_name': {'readonly': True}, + 'self_link': {'readonly': True}, + 'issuer': {'readonly': True}, + 'issue_date': {'readonly': True}, + 'expiration_date': {'readonly': True}, + 'thumbprint': {'readonly': True}, + 'valid': {'readonly': True}, + 'cer_blob': {'readonly': True}, + 'public_key_hash': {'readonly': True}, + 'hosting_environment_profile': {'readonly': True}, + 'key_vault_secret_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'password': {'key': 'properties.password', 'type': 'str'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'subject_name': {'key': 'properties.subjectName', 'type': 'str'}, + 'host_names': {'key': 'properties.hostNames', 'type': '[str]'}, + 'pfx_blob': {'key': 'properties.pfxBlob', 'type': 'bytearray'}, + 'site_name': {'key': 'properties.siteName', 'type': 'str'}, + 'self_link': {'key': 'properties.selfLink', 'type': 'str'}, + 'issuer': {'key': 'properties.issuer', 'type': 'str'}, + 'issue_date': {'key': 'properties.issueDate', 'type': 'iso-8601'}, + 'expiration_date': {'key': 'properties.expirationDate', 'type': 'iso-8601'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + 'valid': {'key': 'properties.valid', 'type': 'bool'}, + 'cer_blob': {'key': 'properties.cerBlob', 'type': 'bytearray'}, + 'public_key_hash': {'key': 'properties.publicKeyHash', 'type': 'str'}, + 'hosting_environment_profile': {'key': 'properties.hostingEnvironmentProfile', 'type': 'HostingEnvironmentProfile'}, + 'key_vault_id': {'key': 'properties.keyVaultId', 'type': 'str'}, + 'key_vault_secret_name': {'key': 'properties.keyVaultSecretName', 'type': 'str'}, + 'key_vault_secret_status': {'key': 'properties.keyVaultSecretStatus', 'type': 'str'}, + 'server_farm_id': {'key': 'properties.serverFarmId', 'type': 'str'}, + 'canonical_name': {'key': 'properties.canonicalName', 'type': 'str'}, + 'domain_validation_method': {'key': 'properties.domainValidationMethod', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + kind: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + password: Optional[str] = None, + host_names: Optional[List[str]] = None, + pfx_blob: Optional[bytearray] = None, + key_vault_id: Optional[str] = None, + key_vault_secret_name: Optional[str] = None, + server_farm_id: Optional[str] = None, + canonical_name: Optional[str] = None, + domain_validation_method: Optional[str] = None, + **kwargs + ): + super(Certificate, self).__init__(kind=kind, location=location, tags=tags, **kwargs) + self.password = password + self.friendly_name = None + self.subject_name = None + self.host_names = host_names + self.pfx_blob = pfx_blob + self.site_name = None + self.self_link = None + self.issuer = None + self.issue_date = None + self.expiration_date = None + self.thumbprint = None + self.valid = None + self.cer_blob = None + self.public_key_hash = None + self.hosting_environment_profile = None + self.key_vault_id = key_vault_id + self.key_vault_secret_name = key_vault_secret_name + self.key_vault_secret_status = None + self.server_farm_id = server_farm_id + self.canonical_name = canonical_name + self.domain_validation_method = domain_validation_method + + +class CertificateCollection(msrest.serialization.Model): + """Collection of certificates. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.Certificate] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Certificate]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["Certificate"], + **kwargs + ): + super(CertificateCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class CertificateDetails(msrest.serialization.Model): + """SSL certificate details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar version: Certificate Version. + :vartype version: int + :ivar serial_number: Certificate Serial Number. + :vartype serial_number: str + :ivar thumbprint: Certificate Thumbprint. + :vartype thumbprint: str + :ivar subject: Certificate Subject. + :vartype subject: str + :ivar not_before: Date Certificate is valid from. + :vartype not_before: ~datetime.datetime + :ivar not_after: Date Certificate is valid to. + :vartype not_after: ~datetime.datetime + :ivar signature_algorithm: Certificate Signature algorithm. + :vartype signature_algorithm: str + :ivar issuer: Certificate Issuer. + :vartype issuer: str + :ivar raw_data: Raw certificate data. + :vartype raw_data: str + """ + + _validation = { + 'version': {'readonly': True}, + 'serial_number': {'readonly': True}, + 'thumbprint': {'readonly': True}, + 'subject': {'readonly': True}, + 'not_before': {'readonly': True}, + 'not_after': {'readonly': True}, + 'signature_algorithm': {'readonly': True}, + 'issuer': {'readonly': True}, + 'raw_data': {'readonly': True}, + } + + _attribute_map = { + 'version': {'key': 'version', 'type': 'int'}, + 'serial_number': {'key': 'serialNumber', 'type': 'str'}, + 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + 'subject': {'key': 'subject', 'type': 'str'}, + 'not_before': {'key': 'notBefore', 'type': 'iso-8601'}, + 'not_after': {'key': 'notAfter', 'type': 'iso-8601'}, + 'signature_algorithm': {'key': 'signatureAlgorithm', 'type': 'str'}, + 'issuer': {'key': 'issuer', 'type': 'str'}, + 'raw_data': {'key': 'rawData', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CertificateDetails, self).__init__(**kwargs) + self.version = None + self.serial_number = None + self.thumbprint = None + self.subject = None + self.not_before = None + self.not_after = None + self.signature_algorithm = None + self.issuer = None + self.raw_data = None + + +class CertificateEmail(ProxyOnlyResource): + """SSL certificate email. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param email_id: Email id. + :type email_id: str + :param time_stamp: Time stamp. + :type time_stamp: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'email_id': {'key': 'properties.emailId', 'type': 'str'}, + 'time_stamp': {'key': 'properties.timeStamp', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + email_id: Optional[str] = None, + time_stamp: Optional[datetime.datetime] = None, + **kwargs + ): + super(CertificateEmail, self).__init__(kind=kind, **kwargs) + self.email_id = email_id + self.time_stamp = time_stamp + + +class CertificateOrderAction(ProxyOnlyResource): + """Certificate order action. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar action_type: Action type. Possible values include: "CertificateIssued", + "CertificateOrderCanceled", "CertificateOrderCreated", "CertificateRevoked", + "DomainValidationComplete", "FraudDetected", "OrgNameChange", "OrgValidationComplete", + "SanDrop", "FraudCleared", "CertificateExpired", "CertificateExpirationWarning", + "FraudDocumentationRequired", "Unknown". + :vartype action_type: str or ~azure.mgmt.web.v2021_02_01.models.CertificateOrderActionType + :ivar created_at: Time at which the certificate action was performed. + :vartype created_at: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'action_type': {'readonly': True}, + 'created_at': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'action_type': {'key': 'properties.actionType', 'type': 'str'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(CertificateOrderAction, self).__init__(kind=kind, **kwargs) + self.action_type = None + self.created_at = None + + +class CertificateOrderContact(msrest.serialization.Model): + """CertificateOrderContact. + + :param email: + :type email: str + :param name_first: + :type name_first: str + :param name_last: + :type name_last: str + :param phone: + :type phone: str + """ + + _attribute_map = { + 'email': {'key': 'email', 'type': 'str'}, + 'name_first': {'key': 'nameFirst', 'type': 'str'}, + 'name_last': {'key': 'nameLast', 'type': 'str'}, + 'phone': {'key': 'phone', 'type': 'str'}, + } + + def __init__( + self, + *, + email: Optional[str] = None, + name_first: Optional[str] = None, + name_last: Optional[str] = None, + phone: Optional[str] = None, + **kwargs + ): + super(CertificateOrderContact, self).__init__(**kwargs) + self.email = email + self.name_first = name_first + self.name_last = name_last + self.phone = phone + + +class CertificatePatchResource(ProxyOnlyResource): + """ARM resource for a certificate. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param password: Certificate password. + :type password: str + :ivar friendly_name: Friendly name of the certificate. + :vartype friendly_name: str + :ivar subject_name: Subject name of the certificate. + :vartype subject_name: str + :param host_names: Host names the certificate applies to. + :type host_names: list[str] + :param pfx_blob: Pfx blob. + :type pfx_blob: bytearray + :ivar site_name: App name. + :vartype site_name: str + :ivar self_link: Self link. + :vartype self_link: str + :ivar issuer: Certificate issuer. + :vartype issuer: str + :ivar issue_date: Certificate issue Date. + :vartype issue_date: ~datetime.datetime + :ivar expiration_date: Certificate expiration date. + :vartype expiration_date: ~datetime.datetime + :ivar thumbprint: Certificate thumbprint. + :vartype thumbprint: str + :ivar valid: Is the certificate valid?. + :vartype valid: bool + :ivar cer_blob: Raw bytes of .cer file. + :vartype cer_blob: bytearray + :ivar public_key_hash: Public key hash. + :vartype public_key_hash: str + :ivar hosting_environment_profile: Specification for the App Service Environment to use for the + certificate. + :vartype hosting_environment_profile: + ~azure.mgmt.web.v2021_02_01.models.HostingEnvironmentProfile + :param key_vault_id: Key Vault Csm resource Id. + :type key_vault_id: str + :param key_vault_secret_name: Key Vault secret name. + :type key_vault_secret_name: str + :ivar key_vault_secret_status: Status of the Key Vault secret. Possible values include: + "Initialized", "WaitingOnCertificateOrder", "Succeeded", "CertificateOrderFailed", + "OperationNotPermittedOnKeyVault", "AzureServiceUnauthorizedToAccessKeyVault", + "KeyVaultDoesNotExist", "KeyVaultSecretDoesNotExist", "UnknownError", "ExternalPrivateKey", + "Unknown". + :vartype key_vault_secret_status: str or + ~azure.mgmt.web.v2021_02_01.models.KeyVaultSecretStatus + :param server_farm_id: Resource ID of the associated App Service plan, formatted as: + "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + :type server_farm_id: str + :param canonical_name: CNAME of the certificate to be issued via free certificate. + :type canonical_name: str + :param domain_validation_method: Method of domain validation for free cert. + :type domain_validation_method: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'friendly_name': {'readonly': True}, + 'subject_name': {'readonly': True}, + 'site_name': {'readonly': True}, + 'self_link': {'readonly': True}, + 'issuer': {'readonly': True}, + 'issue_date': {'readonly': True}, + 'expiration_date': {'readonly': True}, + 'thumbprint': {'readonly': True}, + 'valid': {'readonly': True}, + 'cer_blob': {'readonly': True}, + 'public_key_hash': {'readonly': True}, + 'hosting_environment_profile': {'readonly': True}, + 'key_vault_secret_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'password': {'key': 'properties.password', 'type': 'str'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'subject_name': {'key': 'properties.subjectName', 'type': 'str'}, + 'host_names': {'key': 'properties.hostNames', 'type': '[str]'}, + 'pfx_blob': {'key': 'properties.pfxBlob', 'type': 'bytearray'}, + 'site_name': {'key': 'properties.siteName', 'type': 'str'}, + 'self_link': {'key': 'properties.selfLink', 'type': 'str'}, + 'issuer': {'key': 'properties.issuer', 'type': 'str'}, + 'issue_date': {'key': 'properties.issueDate', 'type': 'iso-8601'}, + 'expiration_date': {'key': 'properties.expirationDate', 'type': 'iso-8601'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + 'valid': {'key': 'properties.valid', 'type': 'bool'}, + 'cer_blob': {'key': 'properties.cerBlob', 'type': 'bytearray'}, + 'public_key_hash': {'key': 'properties.publicKeyHash', 'type': 'str'}, + 'hosting_environment_profile': {'key': 'properties.hostingEnvironmentProfile', 'type': 'HostingEnvironmentProfile'}, + 'key_vault_id': {'key': 'properties.keyVaultId', 'type': 'str'}, + 'key_vault_secret_name': {'key': 'properties.keyVaultSecretName', 'type': 'str'}, + 'key_vault_secret_status': {'key': 'properties.keyVaultSecretStatus', 'type': 'str'}, + 'server_farm_id': {'key': 'properties.serverFarmId', 'type': 'str'}, + 'canonical_name': {'key': 'properties.canonicalName', 'type': 'str'}, + 'domain_validation_method': {'key': 'properties.domainValidationMethod', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + password: Optional[str] = None, + host_names: Optional[List[str]] = None, + pfx_blob: Optional[bytearray] = None, + key_vault_id: Optional[str] = None, + key_vault_secret_name: Optional[str] = None, + server_farm_id: Optional[str] = None, + canonical_name: Optional[str] = None, + domain_validation_method: Optional[str] = None, + **kwargs + ): + super(CertificatePatchResource, self).__init__(kind=kind, **kwargs) + self.password = password + self.friendly_name = None + self.subject_name = None + self.host_names = host_names + self.pfx_blob = pfx_blob + self.site_name = None + self.self_link = None + self.issuer = None + self.issue_date = None + self.expiration_date = None + self.thumbprint = None + self.valid = None + self.cer_blob = None + self.public_key_hash = None + self.hosting_environment_profile = None + self.key_vault_id = key_vault_id + self.key_vault_secret_name = key_vault_secret_name + self.key_vault_secret_status = None + self.server_farm_id = server_farm_id + self.canonical_name = canonical_name + self.domain_validation_method = domain_validation_method + + +class ClientRegistration(msrest.serialization.Model): + """The configuration settings of the app registration for providers that have client ids and client secrets. + + :param client_id: The Client ID of the app used for login. + :type client_id: str + :param client_secret_setting_name: The app setting name that contains the client secret. + :type client_secret_setting_name: str + """ + + _attribute_map = { + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'client_secret_setting_name': {'key': 'clientSecretSettingName', 'type': 'str'}, + } + + def __init__( + self, + *, + client_id: Optional[str] = None, + client_secret_setting_name: Optional[str] = None, + **kwargs + ): + super(ClientRegistration, self).__init__(**kwargs) + self.client_id = client_id + self.client_secret_setting_name = client_secret_setting_name + + +class CloningInfo(msrest.serialization.Model): + """Information needed for cloning operation. + + All required parameters must be populated in order to send to Azure. + + :param correlation_id: Correlation ID of cloning operation. This ID ties multiple cloning + operations + together to use the same snapshot. + :type correlation_id: str + :param overwrite: :code:`true` to overwrite destination app; otherwise, + :code:`false`. + :type overwrite: bool + :param clone_custom_host_names: :code:`true` to clone custom hostnames from source + app; otherwise, :code:`false`. + :type clone_custom_host_names: bool + :param clone_source_control: :code:`true` to clone source control from source app; + otherwise, :code:`false`. + :type clone_source_control: bool + :param source_web_app_id: Required. ARM resource ID of the source app. App resource ID is of + the form + /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + for production slots and + /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + for other slots. + :type source_web_app_id: str + :param source_web_app_location: Location of source app ex: West US or North Europe. + :type source_web_app_location: str + :param hosting_environment: App Service Environment. + :type hosting_environment: str + :param app_settings_overrides: Application setting overrides for cloned app. If specified, + these settings override the settings cloned + from source app. Otherwise, application settings from source app are retained. + :type app_settings_overrides: dict[str, str] + :param configure_load_balancing: :code:`true` to configure load balancing for + source and destination app. + :type configure_load_balancing: bool + :param traffic_manager_profile_id: ARM resource ID of the Traffic Manager profile to use, if it + exists. Traffic Manager resource ID is of the form + /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. + :type traffic_manager_profile_id: str + :param traffic_manager_profile_name: Name of Traffic Manager profile to create. This is only + needed if Traffic Manager profile does not already exist. + :type traffic_manager_profile_name: str + """ + + _validation = { + 'source_web_app_id': {'required': True}, + } + + _attribute_map = { + 'correlation_id': {'key': 'correlationId', 'type': 'str'}, + 'overwrite': {'key': 'overwrite', 'type': 'bool'}, + 'clone_custom_host_names': {'key': 'cloneCustomHostNames', 'type': 'bool'}, + 'clone_source_control': {'key': 'cloneSourceControl', 'type': 'bool'}, + 'source_web_app_id': {'key': 'sourceWebAppId', 'type': 'str'}, + 'source_web_app_location': {'key': 'sourceWebAppLocation', 'type': 'str'}, + 'hosting_environment': {'key': 'hostingEnvironment', 'type': 'str'}, + 'app_settings_overrides': {'key': 'appSettingsOverrides', 'type': '{str}'}, + 'configure_load_balancing': {'key': 'configureLoadBalancing', 'type': 'bool'}, + 'traffic_manager_profile_id': {'key': 'trafficManagerProfileId', 'type': 'str'}, + 'traffic_manager_profile_name': {'key': 'trafficManagerProfileName', 'type': 'str'}, + } + + def __init__( + self, + *, + source_web_app_id: str, + correlation_id: Optional[str] = None, + overwrite: Optional[bool] = None, + clone_custom_host_names: Optional[bool] = None, + clone_source_control: Optional[bool] = None, + source_web_app_location: Optional[str] = None, + hosting_environment: Optional[str] = None, + app_settings_overrides: Optional[Dict[str, str]] = None, + configure_load_balancing: Optional[bool] = None, + traffic_manager_profile_id: Optional[str] = None, + traffic_manager_profile_name: Optional[str] = None, + **kwargs + ): + super(CloningInfo, self).__init__(**kwargs) + self.correlation_id = correlation_id + self.overwrite = overwrite + self.clone_custom_host_names = clone_custom_host_names + self.clone_source_control = clone_source_control + self.source_web_app_id = source_web_app_id + self.source_web_app_location = source_web_app_location + self.hosting_environment = hosting_environment + self.app_settings_overrides = app_settings_overrides + self.configure_load_balancing = configure_load_balancing + self.traffic_manager_profile_id = traffic_manager_profile_id + self.traffic_manager_profile_name = traffic_manager_profile_name + + +class ConnectionStringDictionary(ProxyOnlyResource): + """String dictionary resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param properties: Connection strings. + :type properties: dict[str, ~azure.mgmt.web.v2021_02_01.models.ConnStringValueTypePair] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': '{ConnStringValueTypePair}'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + properties: Optional[Dict[str, "ConnStringValueTypePair"]] = None, + **kwargs + ): + super(ConnectionStringDictionary, self).__init__(kind=kind, **kwargs) + self.properties = properties + + +class ConnStringInfo(msrest.serialization.Model): + """Database connection string information. + + :param name: Name of connection string. + :type name: str + :param connection_string: Connection string value. + :type connection_string: str + :param type: Type of database. Possible values include: "MySql", "SQLServer", "SQLAzure", + "Custom", "NotificationHub", "ServiceBus", "EventHub", "ApiHub", "DocDb", "RedisCache", + "PostgreSQL". + :type type: str or ~azure.mgmt.web.v2021_02_01.models.ConnectionStringType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'connection_string': {'key': 'connectionString', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + connection_string: Optional[str] = None, + type: Optional[Union[str, "ConnectionStringType"]] = None, + **kwargs + ): + super(ConnStringInfo, self).__init__(**kwargs) + self.name = name + self.connection_string = connection_string + self.type = type + + +class ConnStringValueTypePair(msrest.serialization.Model): + """Database connection string value to type pair. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Value of pair. + :type value: str + :param type: Required. Type of database. Possible values include: "MySql", "SQLServer", + "SQLAzure", "Custom", "NotificationHub", "ServiceBus", "EventHub", "ApiHub", "DocDb", + "RedisCache", "PostgreSQL". + :type type: str or ~azure.mgmt.web.v2021_02_01.models.ConnectionStringType + """ + + _validation = { + 'value': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + value: str, + type: Union[str, "ConnectionStringType"], + **kwargs + ): + super(ConnStringValueTypePair, self).__init__(**kwargs) + self.value = value + self.type = type + + +class Contact(msrest.serialization.Model): + """Contact information for domain registration. If 'Domain Privacy' option is not selected then the contact information is made publicly available through the Whois +directories as per ICANN requirements. + + All required parameters must be populated in order to send to Azure. + + :param address_mailing: Mailing address. + :type address_mailing: ~azure.mgmt.web.v2021_02_01.models.Address + :param email: Required. Email address. + :type email: str + :param fax: Fax number. + :type fax: str + :param job_title: Job title. + :type job_title: str + :param name_first: Required. First name. + :type name_first: str + :param name_last: Required. Last name. + :type name_last: str + :param name_middle: Middle name. + :type name_middle: str + :param organization: Organization contact belongs to. + :type organization: str + :param phone: Required. Phone number. + :type phone: str + """ + + _validation = { + 'email': {'required': True}, + 'name_first': {'required': True}, + 'name_last': {'required': True}, + 'phone': {'required': True}, + } + + _attribute_map = { + 'address_mailing': {'key': 'addressMailing', 'type': 'Address'}, + 'email': {'key': 'email', 'type': 'str'}, + 'fax': {'key': 'fax', 'type': 'str'}, + 'job_title': {'key': 'jobTitle', 'type': 'str'}, + 'name_first': {'key': 'nameFirst', 'type': 'str'}, + 'name_last': {'key': 'nameLast', 'type': 'str'}, + 'name_middle': {'key': 'nameMiddle', 'type': 'str'}, + 'organization': {'key': 'organization', 'type': 'str'}, + 'phone': {'key': 'phone', 'type': 'str'}, + } + + def __init__( + self, + *, + email: str, + name_first: str, + name_last: str, + phone: str, + address_mailing: Optional["Address"] = None, + fax: Optional[str] = None, + job_title: Optional[str] = None, + name_middle: Optional[str] = None, + organization: Optional[str] = None, + **kwargs + ): + super(Contact, self).__init__(**kwargs) + self.address_mailing = address_mailing + self.email = email + self.fax = fax + self.job_title = job_title + self.name_first = name_first + self.name_last = name_last + self.name_middle = name_middle + self.organization = organization + self.phone = phone + + +class ContainerCpuStatistics(msrest.serialization.Model): + """ContainerCpuStatistics. + + :param cpu_usage: + :type cpu_usage: ~azure.mgmt.web.v2021_02_01.models.ContainerCpuUsage + :param system_cpu_usage: + :type system_cpu_usage: long + :param online_cpu_count: + :type online_cpu_count: int + :param throttling_data: + :type throttling_data: ~azure.mgmt.web.v2021_02_01.models.ContainerThrottlingData + """ + + _attribute_map = { + 'cpu_usage': {'key': 'cpuUsage', 'type': 'ContainerCpuUsage'}, + 'system_cpu_usage': {'key': 'systemCpuUsage', 'type': 'long'}, + 'online_cpu_count': {'key': 'onlineCpuCount', 'type': 'int'}, + 'throttling_data': {'key': 'throttlingData', 'type': 'ContainerThrottlingData'}, + } + + def __init__( + self, + *, + cpu_usage: Optional["ContainerCpuUsage"] = None, + system_cpu_usage: Optional[int] = None, + online_cpu_count: Optional[int] = None, + throttling_data: Optional["ContainerThrottlingData"] = None, + **kwargs + ): + super(ContainerCpuStatistics, self).__init__(**kwargs) + self.cpu_usage = cpu_usage + self.system_cpu_usage = system_cpu_usage + self.online_cpu_count = online_cpu_count + self.throttling_data = throttling_data + + +class ContainerCpuUsage(msrest.serialization.Model): + """ContainerCpuUsage. + + :param total_usage: + :type total_usage: long + :param per_cpu_usage: + :type per_cpu_usage: list[long] + :param kernel_mode_usage: + :type kernel_mode_usage: long + :param user_mode_usage: + :type user_mode_usage: long + """ + + _attribute_map = { + 'total_usage': {'key': 'totalUsage', 'type': 'long'}, + 'per_cpu_usage': {'key': 'perCpuUsage', 'type': '[long]'}, + 'kernel_mode_usage': {'key': 'kernelModeUsage', 'type': 'long'}, + 'user_mode_usage': {'key': 'userModeUsage', 'type': 'long'}, + } + + def __init__( + self, + *, + total_usage: Optional[int] = None, + per_cpu_usage: Optional[List[int]] = None, + kernel_mode_usage: Optional[int] = None, + user_mode_usage: Optional[int] = None, + **kwargs + ): + super(ContainerCpuUsage, self).__init__(**kwargs) + self.total_usage = total_usage + self.per_cpu_usage = per_cpu_usage + self.kernel_mode_usage = kernel_mode_usage + self.user_mode_usage = user_mode_usage + + +class ContainerInfo(msrest.serialization.Model): + """ContainerInfo. + + :param current_time_stamp: + :type current_time_stamp: ~datetime.datetime + :param previous_time_stamp: + :type previous_time_stamp: ~datetime.datetime + :param current_cpu_stats: + :type current_cpu_stats: ~azure.mgmt.web.v2021_02_01.models.ContainerCpuStatistics + :param previous_cpu_stats: + :type previous_cpu_stats: ~azure.mgmt.web.v2021_02_01.models.ContainerCpuStatistics + :param memory_stats: + :type memory_stats: ~azure.mgmt.web.v2021_02_01.models.ContainerMemoryStatistics + :param name: + :type name: str + :param id: + :type id: str + :param eth0: + :type eth0: ~azure.mgmt.web.v2021_02_01.models.ContainerNetworkInterfaceStatistics + """ + + _attribute_map = { + 'current_time_stamp': {'key': 'currentTimeStamp', 'type': 'iso-8601'}, + 'previous_time_stamp': {'key': 'previousTimeStamp', 'type': 'iso-8601'}, + 'current_cpu_stats': {'key': 'currentCpuStats', 'type': 'ContainerCpuStatistics'}, + 'previous_cpu_stats': {'key': 'previousCpuStats', 'type': 'ContainerCpuStatistics'}, + 'memory_stats': {'key': 'memoryStats', 'type': 'ContainerMemoryStatistics'}, + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'eth0': {'key': 'eth0', 'type': 'ContainerNetworkInterfaceStatistics'}, + } + + def __init__( + self, + *, + current_time_stamp: Optional[datetime.datetime] = None, + previous_time_stamp: Optional[datetime.datetime] = None, + current_cpu_stats: Optional["ContainerCpuStatistics"] = None, + previous_cpu_stats: Optional["ContainerCpuStatistics"] = None, + memory_stats: Optional["ContainerMemoryStatistics"] = None, + name: Optional[str] = None, + id: Optional[str] = None, + eth0: Optional["ContainerNetworkInterfaceStatistics"] = None, + **kwargs + ): + super(ContainerInfo, self).__init__(**kwargs) + self.current_time_stamp = current_time_stamp + self.previous_time_stamp = previous_time_stamp + self.current_cpu_stats = current_cpu_stats + self.previous_cpu_stats = previous_cpu_stats + self.memory_stats = memory_stats + self.name = name + self.id = id + self.eth0 = eth0 + + +class ContainerMemoryStatistics(msrest.serialization.Model): + """ContainerMemoryStatistics. + + :param usage: + :type usage: long + :param max_usage: + :type max_usage: long + :param limit: + :type limit: long + """ + + _attribute_map = { + 'usage': {'key': 'usage', 'type': 'long'}, + 'max_usage': {'key': 'maxUsage', 'type': 'long'}, + 'limit': {'key': 'limit', 'type': 'long'}, + } + + def __init__( + self, + *, + usage: Optional[int] = None, + max_usage: Optional[int] = None, + limit: Optional[int] = None, + **kwargs + ): + super(ContainerMemoryStatistics, self).__init__(**kwargs) + self.usage = usage + self.max_usage = max_usage + self.limit = limit + + +class ContainerNetworkInterfaceStatistics(msrest.serialization.Model): + """ContainerNetworkInterfaceStatistics. + + :param rx_bytes: + :type rx_bytes: long + :param rx_packets: + :type rx_packets: long + :param rx_errors: + :type rx_errors: long + :param rx_dropped: + :type rx_dropped: long + :param tx_bytes: + :type tx_bytes: long + :param tx_packets: + :type tx_packets: long + :param tx_errors: + :type tx_errors: long + :param tx_dropped: + :type tx_dropped: long + """ + + _attribute_map = { + 'rx_bytes': {'key': 'rxBytes', 'type': 'long'}, + 'rx_packets': {'key': 'rxPackets', 'type': 'long'}, + 'rx_errors': {'key': 'rxErrors', 'type': 'long'}, + 'rx_dropped': {'key': 'rxDropped', 'type': 'long'}, + 'tx_bytes': {'key': 'txBytes', 'type': 'long'}, + 'tx_packets': {'key': 'txPackets', 'type': 'long'}, + 'tx_errors': {'key': 'txErrors', 'type': 'long'}, + 'tx_dropped': {'key': 'txDropped', 'type': 'long'}, + } + + def __init__( + self, + *, + rx_bytes: Optional[int] = None, + rx_packets: Optional[int] = None, + rx_errors: Optional[int] = None, + rx_dropped: Optional[int] = None, + tx_bytes: Optional[int] = None, + tx_packets: Optional[int] = None, + tx_errors: Optional[int] = None, + tx_dropped: Optional[int] = None, + **kwargs + ): + super(ContainerNetworkInterfaceStatistics, self).__init__(**kwargs) + self.rx_bytes = rx_bytes + self.rx_packets = rx_packets + self.rx_errors = rx_errors + self.rx_dropped = rx_dropped + self.tx_bytes = tx_bytes + self.tx_packets = tx_packets + self.tx_errors = tx_errors + self.tx_dropped = tx_dropped + + +class ContainerThrottlingData(msrest.serialization.Model): + """ContainerThrottlingData. + + :param periods: + :type periods: int + :param throttled_periods: + :type throttled_periods: int + :param throttled_time: + :type throttled_time: int + """ + + _attribute_map = { + 'periods': {'key': 'periods', 'type': 'int'}, + 'throttled_periods': {'key': 'throttledPeriods', 'type': 'int'}, + 'throttled_time': {'key': 'throttledTime', 'type': 'int'}, + } + + def __init__( + self, + *, + periods: Optional[int] = None, + throttled_periods: Optional[int] = None, + throttled_time: Optional[int] = None, + **kwargs + ): + super(ContainerThrottlingData, self).__init__(**kwargs) + self.periods = periods + self.throttled_periods = throttled_periods + self.throttled_time = throttled_time + + +class ContinuousWebJob(ProxyOnlyResource): + """Continuous Web Job Information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param status: Job status. Possible values include: "Initializing", "Starting", "Running", + "PendingRestart", "Stopped". + :type status: str or ~azure.mgmt.web.v2021_02_01.models.ContinuousWebJobStatus + :param detailed_status: Detailed status. + :type detailed_status: str + :param log_url: Log URL. + :type log_url: str + :param run_command: Run command. + :type run_command: str + :param url: Job URL. + :type url: str + :param extra_info_url: Extra Info URL. + :type extra_info_url: str + :param web_job_type: Job type. Possible values include: "Continuous", "Triggered". + :type web_job_type: str or ~azure.mgmt.web.v2021_02_01.models.WebJobType + :param error: Error information. + :type error: str + :param using_sdk: Using SDK?. + :type using_sdk: bool + :param settings: Job settings. + :type settings: dict[str, any] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'detailed_status': {'key': 'properties.detailed_status', 'type': 'str'}, + 'log_url': {'key': 'properties.log_url', 'type': 'str'}, + 'run_command': {'key': 'properties.run_command', 'type': 'str'}, + 'url': {'key': 'properties.url', 'type': 'str'}, + 'extra_info_url': {'key': 'properties.extra_info_url', 'type': 'str'}, + 'web_job_type': {'key': 'properties.web_job_type', 'type': 'str'}, + 'error': {'key': 'properties.error', 'type': 'str'}, + 'using_sdk': {'key': 'properties.using_sdk', 'type': 'bool'}, + 'settings': {'key': 'properties.settings', 'type': '{object}'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + status: Optional[Union[str, "ContinuousWebJobStatus"]] = None, + detailed_status: Optional[str] = None, + log_url: Optional[str] = None, + run_command: Optional[str] = None, + url: Optional[str] = None, + extra_info_url: Optional[str] = None, + web_job_type: Optional[Union[str, "WebJobType"]] = None, + error: Optional[str] = None, + using_sdk: Optional[bool] = None, + settings: Optional[Dict[str, Any]] = None, + **kwargs + ): + super(ContinuousWebJob, self).__init__(kind=kind, **kwargs) + self.status = status + self.detailed_status = detailed_status + self.log_url = log_url + self.run_command = run_command + self.url = url + self.extra_info_url = extra_info_url + self.web_job_type = web_job_type + self.error = error + self.using_sdk = using_sdk + self.settings = settings + + +class ContinuousWebJobCollection(msrest.serialization.Model): + """Collection of Kudu continuous web job information elements. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.ContinuousWebJob] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ContinuousWebJob]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["ContinuousWebJob"], + **kwargs + ): + super(ContinuousWebJobCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class CookieExpiration(msrest.serialization.Model): + """The configuration settings of the session cookie's expiration. + + :param convention: The convention used when determining the session cookie's expiration. + Possible values include: "FixedTime", "IdentityProviderDerived". + :type convention: str or ~azure.mgmt.web.v2021_02_01.models.CookieExpirationConvention + :param time_to_expiration: The time after the request is made when the session cookie should + expire. + :type time_to_expiration: str + """ + + _attribute_map = { + 'convention': {'key': 'convention', 'type': 'str'}, + 'time_to_expiration': {'key': 'timeToExpiration', 'type': 'str'}, + } + + def __init__( + self, + *, + convention: Optional[Union[str, "CookieExpirationConvention"]] = None, + time_to_expiration: Optional[str] = None, + **kwargs + ): + super(CookieExpiration, self).__init__(**kwargs) + self.convention = convention + self.time_to_expiration = time_to_expiration + + +class CorsSettings(msrest.serialization.Model): + """Cross-Origin Resource Sharing (CORS) settings for the app. + + :param allowed_origins: Gets or sets the list of origins that should be allowed to make + cross-origin + calls (for example: http://example.com:12345). Use "*" to allow all. + :type allowed_origins: list[str] + :param support_credentials: Gets or sets whether CORS requests with credentials are allowed. + See + https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + for more details. + :type support_credentials: bool + """ + + _attribute_map = { + 'allowed_origins': {'key': 'allowedOrigins', 'type': '[str]'}, + 'support_credentials': {'key': 'supportCredentials', 'type': 'bool'}, + } + + def __init__( + self, + *, + allowed_origins: Optional[List[str]] = None, + support_credentials: Optional[bool] = None, + **kwargs + ): + super(CorsSettings, self).__init__(**kwargs) + self.allowed_origins = allowed_origins + self.support_credentials = support_credentials + + +class CsmMoveResourceEnvelope(msrest.serialization.Model): + """Object with a list of the resources that need to be moved and the resource group they should be moved to. + + :param target_resource_group: + :type target_resource_group: str + :param resources: + :type resources: list[str] + """ + + _validation = { + 'target_resource_group': {'max_length': 90, 'min_length': 1, 'pattern': r' ^[-\w\._\(\)]+[^\.]$'}, + } + + _attribute_map = { + 'target_resource_group': {'key': 'targetResourceGroup', 'type': 'str'}, + 'resources': {'key': 'resources', 'type': '[str]'}, + } + + def __init__( + self, + *, + target_resource_group: Optional[str] = None, + resources: Optional[List[str]] = None, + **kwargs + ): + super(CsmMoveResourceEnvelope, self).__init__(**kwargs) + self.target_resource_group = target_resource_group + self.resources = resources + + +class CsmOperationCollection(msrest.serialization.Model): + """Collection of Azure resource manager operation metadata. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.CsmOperationDescription] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[CsmOperationDescription]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["CsmOperationDescription"], + **kwargs + ): + super(CsmOperationCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class CsmOperationDescription(msrest.serialization.Model): + """Description of an operation available for Microsoft.Web resource provider. + + :param name: + :type name: str + :param is_data_action: + :type is_data_action: bool + :param display: Meta data about operation used for display in portal. + :type display: ~azure.mgmt.web.v2021_02_01.models.CsmOperationDisplay + :param origin: + :type origin: str + :param properties: Properties available for a Microsoft.Web resource provider operation. + :type properties: ~azure.mgmt.web.v2021_02_01.models.CsmOperationDescriptionProperties + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'display': {'key': 'display', 'type': 'CsmOperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'CsmOperationDescriptionProperties'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + is_data_action: Optional[bool] = None, + display: Optional["CsmOperationDisplay"] = None, + origin: Optional[str] = None, + properties: Optional["CsmOperationDescriptionProperties"] = None, + **kwargs + ): + super(CsmOperationDescription, self).__init__(**kwargs) + self.name = name + self.is_data_action = is_data_action + self.display = display + self.origin = origin + self.properties = properties + + +class CsmOperationDescriptionProperties(msrest.serialization.Model): + """Properties available for a Microsoft.Web resource provider operation. + + :param service_specification: Resource metrics service provided by Microsoft.Insights resource + provider. + :type service_specification: ~azure.mgmt.web.v2021_02_01.models.ServiceSpecification + """ + + _attribute_map = { + 'service_specification': {'key': 'serviceSpecification', 'type': 'ServiceSpecification'}, + } + + def __init__( + self, + *, + service_specification: Optional["ServiceSpecification"] = None, + **kwargs + ): + super(CsmOperationDescriptionProperties, self).__init__(**kwargs) + self.service_specification = service_specification + + +class CsmOperationDisplay(msrest.serialization.Model): + """Meta data about operation used for display in portal. + + :param provider: + :type provider: str + :param resource: + :type resource: str + :param operation: + :type operation: str + :param description: + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + *, + provider: Optional[str] = None, + resource: Optional[str] = None, + operation: Optional[str] = None, + description: Optional[str] = None, + **kwargs + ): + super(CsmOperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description + + +class CsmPublishingCredentialsPoliciesEntity(ProxyOnlyResource): + """Publishing Credentials Policies parameters. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param allow: :code:`true` to allow access to a publishing method; otherwise, + :code:`false`. + :type allow: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'allow': {'key': 'properties.allow', 'type': 'bool'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + allow: Optional[bool] = None, + **kwargs + ): + super(CsmPublishingCredentialsPoliciesEntity, self).__init__(kind=kind, **kwargs) + self.allow = allow + + +class CsmPublishingProfileOptions(msrest.serialization.Model): + """Publishing options for requested profile. + + :param format: Name of the format. Valid values are: + FileZilla3 + WebDeploy -- default + Ftp. Possible values include: "FileZilla3", "WebDeploy", "Ftp". + :type format: str or ~azure.mgmt.web.v2021_02_01.models.PublishingProfileFormat + :param include_disaster_recovery_endpoints: Include the DisasterRecover endpoint if true. + :type include_disaster_recovery_endpoints: bool + """ + + _attribute_map = { + 'format': {'key': 'format', 'type': 'str'}, + 'include_disaster_recovery_endpoints': {'key': 'includeDisasterRecoveryEndpoints', 'type': 'bool'}, + } + + def __init__( + self, + *, + format: Optional[Union[str, "PublishingProfileFormat"]] = None, + include_disaster_recovery_endpoints: Optional[bool] = None, + **kwargs + ): + super(CsmPublishingProfileOptions, self).__init__(**kwargs) + self.format = format + self.include_disaster_recovery_endpoints = include_disaster_recovery_endpoints + + +class CsmSlotEntity(msrest.serialization.Model): + """Deployment slot parameters. + + All required parameters must be populated in order to send to Azure. + + :param target_slot: Required. Destination deployment slot during swap operation. + :type target_slot: str + :param preserve_vnet: Required. :code:`true` to preserve Virtual Network to the + slot during swap; otherwise, :code:`false`. + :type preserve_vnet: bool + """ + + _validation = { + 'target_slot': {'required': True}, + 'preserve_vnet': {'required': True}, + } + + _attribute_map = { + 'target_slot': {'key': 'targetSlot', 'type': 'str'}, + 'preserve_vnet': {'key': 'preserveVnet', 'type': 'bool'}, + } + + def __init__( + self, + *, + target_slot: str, + preserve_vnet: bool, + **kwargs + ): + super(CsmSlotEntity, self).__init__(**kwargs) + self.target_slot = target_slot + self.preserve_vnet = preserve_vnet + + +class CsmUsageQuota(msrest.serialization.Model): + """Usage of the quota resource. + + :param unit: Units of measurement for the quota resource. + :type unit: str + :param next_reset_time: Next reset time for the resource counter. + :type next_reset_time: ~datetime.datetime + :param current_value: The current value of the resource counter. + :type current_value: long + :param limit: The resource limit. + :type limit: long + :param name: Quota name. + :type name: ~azure.mgmt.web.v2021_02_01.models.LocalizableString + """ + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'str'}, + 'next_reset_time': {'key': 'nextResetTime', 'type': 'iso-8601'}, + 'current_value': {'key': 'currentValue', 'type': 'long'}, + 'limit': {'key': 'limit', 'type': 'long'}, + 'name': {'key': 'name', 'type': 'LocalizableString'}, + } + + def __init__( + self, + *, + unit: Optional[str] = None, + next_reset_time: Optional[datetime.datetime] = None, + current_value: Optional[int] = None, + limit: Optional[int] = None, + name: Optional["LocalizableString"] = None, + **kwargs + ): + super(CsmUsageQuota, self).__init__(**kwargs) + self.unit = unit + self.next_reset_time = next_reset_time + self.current_value = current_value + self.limit = limit + self.name = name + + +class CsmUsageQuotaCollection(msrest.serialization.Model): + """Collection of CSM usage quotas. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.CsmUsageQuota] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[CsmUsageQuota]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["CsmUsageQuota"], + **kwargs + ): + super(CsmUsageQuotaCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class CustomHostnameAnalysisResult(ProxyOnlyResource): + """Custom domain analysis. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar is_hostname_already_verified: :code:`true` if hostname is already verified; + otherwise, :code:`false`. + :vartype is_hostname_already_verified: bool + :ivar custom_domain_verification_test: DNS verification test result. Possible values include: + "Passed", "Failed", "Skipped". + :vartype custom_domain_verification_test: str or + ~azure.mgmt.web.v2021_02_01.models.DnsVerificationTestResult + :ivar custom_domain_verification_failure_info: Raw failure information if DNS verification + fails. + :vartype custom_domain_verification_failure_info: + ~azure.mgmt.web.v2021_02_01.models.ErrorEntity + :ivar has_conflict_on_scale_unit: :code:`true` if there is a conflict on a scale + unit; otherwise, :code:`false`. + :vartype has_conflict_on_scale_unit: bool + :ivar has_conflict_across_subscription: :code:`true` if there is a conflict across + subscriptions; otherwise, :code:`false`. + :vartype has_conflict_across_subscription: bool + :ivar conflicting_app_resource_id: Name of the conflicting app on scale unit if it's within the + same subscription. + :vartype conflicting_app_resource_id: str + :param c_name_records: CName records controller can see for this hostname. + :type c_name_records: list[str] + :param txt_records: TXT records controller can see for this hostname. + :type txt_records: list[str] + :param a_records: A records controller can see for this hostname. + :type a_records: list[str] + :param alternate_c_name_records: Alternate CName records controller can see for this hostname. + :type alternate_c_name_records: list[str] + :param alternate_txt_records: Alternate TXT records controller can see for this hostname. + :type alternate_txt_records: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'is_hostname_already_verified': {'readonly': True}, + 'custom_domain_verification_test': {'readonly': True}, + 'custom_domain_verification_failure_info': {'readonly': True}, + 'has_conflict_on_scale_unit': {'readonly': True}, + 'has_conflict_across_subscription': {'readonly': True}, + 'conflicting_app_resource_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'is_hostname_already_verified': {'key': 'properties.isHostnameAlreadyVerified', 'type': 'bool'}, + 'custom_domain_verification_test': {'key': 'properties.customDomainVerificationTest', 'type': 'str'}, + 'custom_domain_verification_failure_info': {'key': 'properties.customDomainVerificationFailureInfo', 'type': 'ErrorEntity'}, + 'has_conflict_on_scale_unit': {'key': 'properties.hasConflictOnScaleUnit', 'type': 'bool'}, + 'has_conflict_across_subscription': {'key': 'properties.hasConflictAcrossSubscription', 'type': 'bool'}, + 'conflicting_app_resource_id': {'key': 'properties.conflictingAppResourceId', 'type': 'str'}, + 'c_name_records': {'key': 'properties.cNameRecords', 'type': '[str]'}, + 'txt_records': {'key': 'properties.txtRecords', 'type': '[str]'}, + 'a_records': {'key': 'properties.aRecords', 'type': '[str]'}, + 'alternate_c_name_records': {'key': 'properties.alternateCNameRecords', 'type': '[str]'}, + 'alternate_txt_records': {'key': 'properties.alternateTxtRecords', 'type': '[str]'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + c_name_records: Optional[List[str]] = None, + txt_records: Optional[List[str]] = None, + a_records: Optional[List[str]] = None, + alternate_c_name_records: Optional[List[str]] = None, + alternate_txt_records: Optional[List[str]] = None, + **kwargs + ): + super(CustomHostnameAnalysisResult, self).__init__(kind=kind, **kwargs) + self.is_hostname_already_verified = None + self.custom_domain_verification_test = None + self.custom_domain_verification_failure_info = None + self.has_conflict_on_scale_unit = None + self.has_conflict_across_subscription = None + self.conflicting_app_resource_id = None + self.c_name_records = c_name_records + self.txt_records = txt_records + self.a_records = a_records + self.alternate_c_name_records = alternate_c_name_records + self.alternate_txt_records = alternate_txt_records + + +class CustomOpenIdConnectProvider(msrest.serialization.Model): + """The configuration settings of the custom Open ID Connect provider. + + :param enabled: :code:`false` if the custom Open ID provider provider should not + be enabled; otherwise, :code:`true`. + :type enabled: bool + :param registration: The configuration settings of the app registration for the custom Open ID + Connect provider. + :type registration: ~azure.mgmt.web.v2021_02_01.models.OpenIdConnectRegistration + :param login: The configuration settings of the login flow of the custom Open ID Connect + provider. + :type login: ~azure.mgmt.web.v2021_02_01.models.OpenIdConnectLogin + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'OpenIdConnectRegistration'}, + 'login': {'key': 'login', 'type': 'OpenIdConnectLogin'}, + } + + def __init__( + self, + *, + enabled: Optional[bool] = None, + registration: Optional["OpenIdConnectRegistration"] = None, + login: Optional["OpenIdConnectLogin"] = None, + **kwargs + ): + super(CustomOpenIdConnectProvider, self).__init__(**kwargs) + self.enabled = enabled + self.registration = registration + self.login = login + + +class DatabaseBackupSetting(msrest.serialization.Model): + """Database backup settings. + + All required parameters must be populated in order to send to Azure. + + :param database_type: Required. Database type (e.g. SqlAzure / MySql). Possible values include: + "SqlAzure", "MySql", "LocalMySql", "PostgreSql". + :type database_type: str or ~azure.mgmt.web.v2021_02_01.models.DatabaseType + :param name: + :type name: str + :param connection_string_name: Contains a connection string name that is linked to the + SiteConfig.ConnectionStrings. + This is used during restore with overwrite connection strings options. + :type connection_string_name: str + :param connection_string: Contains a connection string to a database which is being backed up + or restored. If the restore should happen to a new database, the database name inside is the + new one. + :type connection_string: str + """ + + _validation = { + 'database_type': {'required': True}, + } + + _attribute_map = { + 'database_type': {'key': 'databaseType', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'connection_string_name': {'key': 'connectionStringName', 'type': 'str'}, + 'connection_string': {'key': 'connectionString', 'type': 'str'}, + } + + def __init__( + self, + *, + database_type: Union[str, "DatabaseType"], + name: Optional[str] = None, + connection_string_name: Optional[str] = None, + connection_string: Optional[str] = None, + **kwargs + ): + super(DatabaseBackupSetting, self).__init__(**kwargs) + self.database_type = database_type + self.name = name + self.connection_string_name = connection_string_name + self.connection_string = connection_string + + +class DataProviderMetadata(msrest.serialization.Model): + """Additional configuration for a data providers. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param provider_name: + :type provider_name: str + :ivar property_bag: Settings for the data provider. + :vartype property_bag: list[~azure.mgmt.web.v2021_02_01.models.KeyValuePairStringObject] + """ + + _validation = { + 'property_bag': {'readonly': True}, + } + + _attribute_map = { + 'provider_name': {'key': 'providerName', 'type': 'str'}, + 'property_bag': {'key': 'propertyBag', 'type': '[KeyValuePairStringObject]'}, + } + + def __init__( + self, + *, + provider_name: Optional[str] = None, + **kwargs + ): + super(DataProviderMetadata, self).__init__(**kwargs) + self.provider_name = provider_name + self.property_bag = None + + +class DataSource(msrest.serialization.Model): + """Class representing data source used by the detectors. + + :param instructions: Instructions if any for the data source. + :type instructions: list[str] + :param data_source_uri: Datasource Uri Links. + :type data_source_uri: list[~azure.mgmt.web.v2021_02_01.models.NameValuePair] + """ + + _attribute_map = { + 'instructions': {'key': 'instructions', 'type': '[str]'}, + 'data_source_uri': {'key': 'dataSourceUri', 'type': '[NameValuePair]'}, + } + + def __init__( + self, + *, + instructions: Optional[List[str]] = None, + data_source_uri: Optional[List["NameValuePair"]] = None, + **kwargs + ): + super(DataSource, self).__init__(**kwargs) + self.instructions = instructions + self.data_source_uri = data_source_uri + + +class DataTableResponseColumn(msrest.serialization.Model): + """Column definition. + + :param column_name: Name of the column. + :type column_name: str + :param data_type: Data type which looks like 'String' or 'Int32'. + :type data_type: str + :param column_type: Column Type. + :type column_type: str + """ + + _attribute_map = { + 'column_name': {'key': 'columnName', 'type': 'str'}, + 'data_type': {'key': 'dataType', 'type': 'str'}, + 'column_type': {'key': 'columnType', 'type': 'str'}, + } + + def __init__( + self, + *, + column_name: Optional[str] = None, + data_type: Optional[str] = None, + column_type: Optional[str] = None, + **kwargs + ): + super(DataTableResponseColumn, self).__init__(**kwargs) + self.column_name = column_name + self.data_type = data_type + self.column_type = column_type + + +class DataTableResponseObject(msrest.serialization.Model): + """Data Table which defines columns and raw row values. + + :param table_name: Name of the table. + :type table_name: str + :param columns: List of columns with data types. + :type columns: list[~azure.mgmt.web.v2021_02_01.models.DataTableResponseColumn] + :param rows: Raw row values. + :type rows: list[list[str]] + """ + + _attribute_map = { + 'table_name': {'key': 'tableName', 'type': 'str'}, + 'columns': {'key': 'columns', 'type': '[DataTableResponseColumn]'}, + 'rows': {'key': 'rows', 'type': '[[str]]'}, + } + + def __init__( + self, + *, + table_name: Optional[str] = None, + columns: Optional[List["DataTableResponseColumn"]] = None, + rows: Optional[List[List[str]]] = None, + **kwargs + ): + super(DataTableResponseObject, self).__init__(**kwargs) + self.table_name = table_name + self.columns = columns + self.rows = rows + + +class DefaultAuthorizationPolicy(msrest.serialization.Model): + """The configuration settings of the Azure Active Directory default authorization policy. + + :param allowed_principals: The configuration settings of the Azure Active Directory allowed + principals. + :type allowed_principals: ~azure.mgmt.web.v2021_02_01.models.AllowedPrincipals + :param allowed_applications: The configuration settings of the Azure Active Directory allowed + applications. + :type allowed_applications: list[str] + """ + + _attribute_map = { + 'allowed_principals': {'key': 'allowedPrincipals', 'type': 'AllowedPrincipals'}, + 'allowed_applications': {'key': 'allowedApplications', 'type': '[str]'}, + } + + def __init__( + self, + *, + allowed_principals: Optional["AllowedPrincipals"] = None, + allowed_applications: Optional[List[str]] = None, + **kwargs + ): + super(DefaultAuthorizationPolicy, self).__init__(**kwargs) + self.allowed_principals = allowed_principals + self.allowed_applications = allowed_applications + + +class DefaultErrorResponse(msrest.serialization.Model): + """App Service error response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar error: Error model. + :vartype error: ~azure.mgmt.web.v2021_02_01.models.DefaultErrorResponseError + """ + + _validation = { + 'error': {'readonly': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'DefaultErrorResponseError'}, + } + + def __init__( + self, + **kwargs + ): + super(DefaultErrorResponse, self).__init__(**kwargs) + self.error = None + + +class DefaultErrorResponseError(msrest.serialization.Model): + """Error model. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Standardized string to programmatically identify the error. + :vartype code: str + :ivar message: Detailed error description and debugging information. + :vartype message: str + :ivar target: Detailed error description and debugging information. + :vartype target: str + :param details: + :type details: list[~azure.mgmt.web.v2021_02_01.models.DefaultErrorResponseErrorDetailsItem] + :ivar innererror: More information to debug error. + :vartype innererror: str + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'innererror': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[DefaultErrorResponseErrorDetailsItem]'}, + 'innererror': {'key': 'innererror', 'type': 'str'}, + } + + def __init__( + self, + *, + details: Optional[List["DefaultErrorResponseErrorDetailsItem"]] = None, + **kwargs + ): + super(DefaultErrorResponseError, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = details + self.innererror = None + + +class DefaultErrorResponseErrorDetailsItem(msrest.serialization.Model): + """Detailed errors. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Standardized string to programmatically identify the error. + :vartype code: str + :ivar message: Detailed error description and debugging information. + :vartype message: str + :ivar target: Detailed error description and debugging information. + :vartype target: str + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DefaultErrorResponseErrorDetailsItem, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + + +class DeletedAppRestoreRequest(ProxyOnlyResource): + """Details about restoring a deleted app. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param deleted_site_id: ARM resource ID of the deleted app. Example: + /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId}. + :type deleted_site_id: str + :param recover_configuration: If true, deleted site configuration, in addition to content, will + be restored. + :type recover_configuration: bool + :param snapshot_time: Point in time to restore the deleted app from, formatted as a DateTime + string. + If unspecified, default value is the time that the app was deleted. + :type snapshot_time: str + :param use_dr_secondary: If true, the snapshot is retrieved from DRSecondary endpoint. + :type use_dr_secondary: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'deleted_site_id': {'key': 'properties.deletedSiteId', 'type': 'str'}, + 'recover_configuration': {'key': 'properties.recoverConfiguration', 'type': 'bool'}, + 'snapshot_time': {'key': 'properties.snapshotTime', 'type': 'str'}, + 'use_dr_secondary': {'key': 'properties.useDRSecondary', 'type': 'bool'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + deleted_site_id: Optional[str] = None, + recover_configuration: Optional[bool] = None, + snapshot_time: Optional[str] = None, + use_dr_secondary: Optional[bool] = None, + **kwargs + ): + super(DeletedAppRestoreRequest, self).__init__(kind=kind, **kwargs) + self.deleted_site_id = deleted_site_id + self.recover_configuration = recover_configuration + self.snapshot_time = snapshot_time + self.use_dr_secondary = use_dr_secondary + + +class DeletedSite(ProxyOnlyResource): + """A deleted app. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar deleted_site_id: Numeric id for the deleted site. + :vartype deleted_site_id: int + :ivar deleted_timestamp: Time in UTC when the app was deleted. + :vartype deleted_timestamp: str + :ivar subscription: Subscription containing the deleted site. + :vartype subscription: str + :ivar resource_group: ResourceGroup that contained the deleted site. + :vartype resource_group: str + :ivar deleted_site_name: Name of the deleted site. + :vartype deleted_site_name: str + :ivar slot: Slot of the deleted site. + :vartype slot: str + :ivar kind_properties_kind: Kind of site that was deleted. + :vartype kind_properties_kind: str + :ivar geo_region_name: Geo Region of the deleted site. + :vartype geo_region_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'deleted_site_id': {'readonly': True}, + 'deleted_timestamp': {'readonly': True}, + 'subscription': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'deleted_site_name': {'readonly': True}, + 'slot': {'readonly': True}, + 'kind_properties_kind': {'readonly': True}, + 'geo_region_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'deleted_site_id': {'key': 'properties.deletedSiteId', 'type': 'int'}, + 'deleted_timestamp': {'key': 'properties.deletedTimestamp', 'type': 'str'}, + 'subscription': {'key': 'properties.subscription', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'deleted_site_name': {'key': 'properties.deletedSiteName', 'type': 'str'}, + 'slot': {'key': 'properties.slot', 'type': 'str'}, + 'kind_properties_kind': {'key': 'properties.kind', 'type': 'str'}, + 'geo_region_name': {'key': 'properties.geoRegionName', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(DeletedSite, self).__init__(kind=kind, **kwargs) + self.deleted_site_id = None + self.deleted_timestamp = None + self.subscription = None + self.resource_group = None + self.deleted_site_name = None + self.slot = None + self.kind_properties_kind = None + self.geo_region_name = None + + +class DeletedWebAppCollection(msrest.serialization.Model): + """Collection of deleted apps. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.DeletedSite] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DeletedSite]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["DeletedSite"], + **kwargs + ): + super(DeletedWebAppCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class Deployment(ProxyOnlyResource): + """User credentials used for publishing activity. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param status: Deployment status. + :type status: int + :param message: Details about deployment status. + :type message: str + :param author: Who authored the deployment. + :type author: str + :param deployer: Who performed the deployment. + :type deployer: str + :param author_email: Author email. + :type author_email: str + :param start_time: Start time. + :type start_time: ~datetime.datetime + :param end_time: End time. + :type end_time: ~datetime.datetime + :param active: True if deployment is currently active, false if completed and null if not + started. + :type active: bool + :param details: Details on deployment. + :type details: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'int'}, + 'message': {'key': 'properties.message', 'type': 'str'}, + 'author': {'key': 'properties.author', 'type': 'str'}, + 'deployer': {'key': 'properties.deployer', 'type': 'str'}, + 'author_email': {'key': 'properties.author_email', 'type': 'str'}, + 'start_time': {'key': 'properties.start_time', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.end_time', 'type': 'iso-8601'}, + 'active': {'key': 'properties.active', 'type': 'bool'}, + 'details': {'key': 'properties.details', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + status: Optional[int] = None, + message: Optional[str] = None, + author: Optional[str] = None, + deployer: Optional[str] = None, + author_email: Optional[str] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + active: Optional[bool] = None, + details: Optional[str] = None, + **kwargs + ): + super(Deployment, self).__init__(kind=kind, **kwargs) + self.status = status + self.message = message + self.author = author + self.deployer = deployer + self.author_email = author_email + self.start_time = start_time + self.end_time = end_time + self.active = active + self.details = details + + +class DeploymentCollection(msrest.serialization.Model): + """Collection of app deployments. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.Deployment] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Deployment]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["Deployment"], + **kwargs + ): + super(DeploymentCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class DeploymentLocations(msrest.serialization.Model): + """List of available locations (regions or App Service Environments) for +deployment of App Service resources. + + :param locations: Available regions. + :type locations: list[~azure.mgmt.web.v2021_02_01.models.GeoRegion] + :param hosting_environments: Available App Service Environments with full descriptions of the + environments. + :type hosting_environments: list[~azure.mgmt.web.v2021_02_01.models.AppServiceEnvironment] + :param hosting_environment_deployment_infos: Available App Service Environments with basic + information. + :type hosting_environment_deployment_infos: + list[~azure.mgmt.web.v2021_02_01.models.HostingEnvironmentDeploymentInfo] + """ + + _attribute_map = { + 'locations': {'key': 'locations', 'type': '[GeoRegion]'}, + 'hosting_environments': {'key': 'hostingEnvironments', 'type': '[AppServiceEnvironment]'}, + 'hosting_environment_deployment_infos': {'key': 'hostingEnvironmentDeploymentInfos', 'type': '[HostingEnvironmentDeploymentInfo]'}, + } + + def __init__( + self, + *, + locations: Optional[List["GeoRegion"]] = None, + hosting_environments: Optional[List["AppServiceEnvironment"]] = None, + hosting_environment_deployment_infos: Optional[List["HostingEnvironmentDeploymentInfo"]] = None, + **kwargs + ): + super(DeploymentLocations, self).__init__(**kwargs) + self.locations = locations + self.hosting_environments = hosting_environments + self.hosting_environment_deployment_infos = hosting_environment_deployment_infos + + +class DetectorAbnormalTimePeriod(msrest.serialization.Model): + """Class representing Abnormal Time Period detected. + + :param start_time: Start time of the correlated event. + :type start_time: ~datetime.datetime + :param end_time: End time of the correlated event. + :type end_time: ~datetime.datetime + :param message: Message describing the event. + :type message: str + :param source: Represents the name of the Detector. + :type source: str + :param priority: Represents the rank of the Detector. + :type priority: float + :param meta_data: Downtime metadata. + :type meta_data: list[list[~azure.mgmt.web.v2021_02_01.models.NameValuePair]] + :param type: Represents the type of the Detector. Possible values include: "ServiceIncident", + "AppDeployment", "AppCrash", "RuntimeIssueDetected", "AseDeployment", "UserIssue", + "PlatformIssue", "Other". + :type type: str or ~azure.mgmt.web.v2021_02_01.models.IssueType + :param solutions: List of proposed solutions. + :type solutions: list[~azure.mgmt.web.v2021_02_01.models.Solution] + """ + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'message': {'key': 'message', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'str'}, + 'priority': {'key': 'priority', 'type': 'float'}, + 'meta_data': {'key': 'metaData', 'type': '[[NameValuePair]]'}, + 'type': {'key': 'type', 'type': 'str'}, + 'solutions': {'key': 'solutions', 'type': '[Solution]'}, + } + + def __init__( + self, + *, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + message: Optional[str] = None, + source: Optional[str] = None, + priority: Optional[float] = None, + meta_data: Optional[List[List["NameValuePair"]]] = None, + type: Optional[Union[str, "IssueType"]] = None, + solutions: Optional[List["Solution"]] = None, + **kwargs + ): + super(DetectorAbnormalTimePeriod, self).__init__(**kwargs) + self.start_time = start_time + self.end_time = end_time + self.message = message + self.source = source + self.priority = priority + self.meta_data = meta_data + self.type = type + self.solutions = solutions + + +class DetectorDefinition(msrest.serialization.Model): + """Class representing detector definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar display_name: Display name of the detector. + :vartype display_name: str + :ivar description: Description of the detector. + :vartype description: str + :ivar rank: Detector Rank. + :vartype rank: float + :ivar is_enabled: Flag representing whether detector is enabled or not. + :vartype is_enabled: bool + """ + + _validation = { + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'rank': {'readonly': True}, + 'is_enabled': {'readonly': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'rank': {'key': 'rank', 'type': 'float'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(DetectorDefinition, self).__init__(**kwargs) + self.display_name = None + self.description = None + self.rank = None + self.is_enabled = None + + +class DetectorDefinitionResource(ProxyOnlyResource): + """ARM resource for a detector definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar display_name: Display name of the detector. + :vartype display_name: str + :ivar description: Description of the detector. + :vartype description: str + :ivar rank: Detector Rank. + :vartype rank: float + :ivar is_enabled: Flag representing whether detector is enabled or not. + :vartype is_enabled: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'rank': {'readonly': True}, + 'is_enabled': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'rank': {'key': 'properties.rank', 'type': 'float'}, + 'is_enabled': {'key': 'properties.isEnabled', 'type': 'bool'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(DetectorDefinitionResource, self).__init__(kind=kind, **kwargs) + self.display_name = None + self.description = None + self.rank = None + self.is_enabled = None + + +class DetectorInfo(msrest.serialization.Model): + """Definition of Detector. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Id of detector. + :vartype id: str + :ivar name: Name of detector. + :vartype name: str + :ivar description: Short description of the detector and its purpose. + :vartype description: str + :ivar author: Author of the detector. + :vartype author: str + :ivar category: Problem category. This serves for organizing group for detectors. + :vartype category: str + :ivar support_topic_list: List of Support Topics for which this detector is enabled. + :vartype support_topic_list: list[~azure.mgmt.web.v2021_02_01.models.SupportTopic] + :ivar analysis_type: Analysis Types for which this detector should apply to. + :vartype analysis_type: list[str] + :ivar type: Whether this detector is an Analysis Detector or not. Possible values include: + "Detector", "Analysis", "CategoryOverview". + :vartype type: str or ~azure.mgmt.web.v2021_02_01.models.DetectorType + :ivar score: Defines score of a detector to power ML based matching. + :vartype score: float + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'description': {'readonly': True}, + 'author': {'readonly': True}, + 'category': {'readonly': True}, + 'support_topic_list': {'readonly': True}, + 'analysis_type': {'readonly': True}, + 'type': {'readonly': True}, + 'score': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'author': {'key': 'author', 'type': 'str'}, + 'category': {'key': 'category', 'type': 'str'}, + 'support_topic_list': {'key': 'supportTopicList', 'type': '[SupportTopic]'}, + 'analysis_type': {'key': 'analysisType', 'type': '[str]'}, + 'type': {'key': 'type', 'type': 'str'}, + 'score': {'key': 'score', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(DetectorInfo, self).__init__(**kwargs) + self.id = None + self.name = None + self.description = None + self.author = None + self.category = None + self.support_topic_list = None + self.analysis_type = None + self.type = None + self.score = None + + +class DetectorResponse(ProxyOnlyResource): + """Class representing Response from Detector. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param metadata: metadata for the detector. + :type metadata: ~azure.mgmt.web.v2021_02_01.models.DetectorInfo + :param dataset: Data Set. + :type dataset: list[~azure.mgmt.web.v2021_02_01.models.DiagnosticData] + :param status: Indicates status of the most severe insight. + :type status: ~azure.mgmt.web.v2021_02_01.models.Status + :param data_providers_metadata: Additional configuration for different data providers to be + used by the UI. + :type data_providers_metadata: list[~azure.mgmt.web.v2021_02_01.models.DataProviderMetadata] + :param suggested_utterances: Suggested utterances where the detector can be applicable. + :type suggested_utterances: ~azure.mgmt.web.v2021_02_01.models.QueryUtterancesResults + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': 'DetectorInfo'}, + 'dataset': {'key': 'properties.dataset', 'type': '[DiagnosticData]'}, + 'status': {'key': 'properties.status', 'type': 'Status'}, + 'data_providers_metadata': {'key': 'properties.dataProvidersMetadata', 'type': '[DataProviderMetadata]'}, + 'suggested_utterances': {'key': 'properties.suggestedUtterances', 'type': 'QueryUtterancesResults'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + metadata: Optional["DetectorInfo"] = None, + dataset: Optional[List["DiagnosticData"]] = None, + status: Optional["Status"] = None, + data_providers_metadata: Optional[List["DataProviderMetadata"]] = None, + suggested_utterances: Optional["QueryUtterancesResults"] = None, + **kwargs + ): + super(DetectorResponse, self).__init__(kind=kind, **kwargs) + self.metadata = metadata + self.dataset = dataset + self.status = status + self.data_providers_metadata = data_providers_metadata + self.suggested_utterances = suggested_utterances + + +class DetectorResponseCollection(msrest.serialization.Model): + """Collection of detector responses. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.DetectorResponse] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DetectorResponse]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["DetectorResponse"], + **kwargs + ): + super(DetectorResponseCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class DiagnosticAnalysis(ProxyOnlyResource): + """Class representing a diagnostic analysis done on an application. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param start_time: Start time of the period. + :type start_time: ~datetime.datetime + :param end_time: End time of the period. + :type end_time: ~datetime.datetime + :param abnormal_time_periods: List of time periods. + :type abnormal_time_periods: list[~azure.mgmt.web.v2021_02_01.models.AbnormalTimePeriod] + :param payload: Data by each detector. + :type payload: list[~azure.mgmt.web.v2021_02_01.models.AnalysisData] + :param non_correlated_detectors: Data by each detector for detectors that did not corelate. + :type non_correlated_detectors: list[~azure.mgmt.web.v2021_02_01.models.DetectorDefinition] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'abnormal_time_periods': {'key': 'properties.abnormalTimePeriods', 'type': '[AbnormalTimePeriod]'}, + 'payload': {'key': 'properties.payload', 'type': '[AnalysisData]'}, + 'non_correlated_detectors': {'key': 'properties.nonCorrelatedDetectors', 'type': '[DetectorDefinition]'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + abnormal_time_periods: Optional[List["AbnormalTimePeriod"]] = None, + payload: Optional[List["AnalysisData"]] = None, + non_correlated_detectors: Optional[List["DetectorDefinition"]] = None, + **kwargs + ): + super(DiagnosticAnalysis, self).__init__(kind=kind, **kwargs) + self.start_time = start_time + self.end_time = end_time + self.abnormal_time_periods = abnormal_time_periods + self.payload = payload + self.non_correlated_detectors = non_correlated_detectors + + +class DiagnosticAnalysisCollection(msrest.serialization.Model): + """Collection of Diagnostic Analyses. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.AnalysisDefinition] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AnalysisDefinition]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["AnalysisDefinition"], + **kwargs + ): + super(DiagnosticAnalysisCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class DiagnosticCategory(ProxyOnlyResource): + """Class representing detector definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar description: Description of the diagnostic category. + :vartype description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(DiagnosticCategory, self).__init__(kind=kind, **kwargs) + self.description = None + + +class DiagnosticCategoryCollection(msrest.serialization.Model): + """Collection of Diagnostic Categories. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.DiagnosticCategory] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DiagnosticCategory]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["DiagnosticCategory"], + **kwargs + ): + super(DiagnosticCategoryCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class DiagnosticData(msrest.serialization.Model): + """Set of data with rendering instructions. + + :param table: Data in table form. + :type table: ~azure.mgmt.web.v2021_02_01.models.DataTableResponseObject + :param rendering_properties: Properties that describe how the table should be rendered. + :type rendering_properties: ~azure.mgmt.web.v2021_02_01.models.Rendering + """ + + _attribute_map = { + 'table': {'key': 'table', 'type': 'DataTableResponseObject'}, + 'rendering_properties': {'key': 'renderingProperties', 'type': 'Rendering'}, + } + + def __init__( + self, + *, + table: Optional["DataTableResponseObject"] = None, + rendering_properties: Optional["Rendering"] = None, + **kwargs + ): + super(DiagnosticData, self).__init__(**kwargs) + self.table = table + self.rendering_properties = rendering_properties + + +class DiagnosticDetectorCollection(msrest.serialization.Model): + """Collection of Diagnostic Detectors. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.DetectorDefinitionResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DetectorDefinitionResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["DetectorDefinitionResource"], + **kwargs + ): + super(DiagnosticDetectorCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class DiagnosticDetectorResponse(ProxyOnlyResource): + """Class representing Response from Diagnostic Detectors. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param start_time: Start time of the period. + :type start_time: ~datetime.datetime + :param end_time: End time of the period. + :type end_time: ~datetime.datetime + :param issue_detected: Flag representing Issue was detected. + :type issue_detected: bool + :param detector_definition: Detector's definition. + :type detector_definition: ~azure.mgmt.web.v2021_02_01.models.DetectorDefinition + :param metrics: Metrics provided by the detector. + :type metrics: list[~azure.mgmt.web.v2021_02_01.models.DiagnosticMetricSet] + :param abnormal_time_periods: List of Correlated events found by the detector. + :type abnormal_time_periods: + list[~azure.mgmt.web.v2021_02_01.models.DetectorAbnormalTimePeriod] + :param data: Additional Data that detector wants to send. + :type data: list[list[~azure.mgmt.web.v2021_02_01.models.NameValuePair]] + :param response_meta_data: Meta Data. + :type response_meta_data: ~azure.mgmt.web.v2021_02_01.models.ResponseMetaData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'issue_detected': {'key': 'properties.issueDetected', 'type': 'bool'}, + 'detector_definition': {'key': 'properties.detectorDefinition', 'type': 'DetectorDefinition'}, + 'metrics': {'key': 'properties.metrics', 'type': '[DiagnosticMetricSet]'}, + 'abnormal_time_periods': {'key': 'properties.abnormalTimePeriods', 'type': '[DetectorAbnormalTimePeriod]'}, + 'data': {'key': 'properties.data', 'type': '[[NameValuePair]]'}, + 'response_meta_data': {'key': 'properties.responseMetaData', 'type': 'ResponseMetaData'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + issue_detected: Optional[bool] = None, + detector_definition: Optional["DetectorDefinition"] = None, + metrics: Optional[List["DiagnosticMetricSet"]] = None, + abnormal_time_periods: Optional[List["DetectorAbnormalTimePeriod"]] = None, + data: Optional[List[List["NameValuePair"]]] = None, + response_meta_data: Optional["ResponseMetaData"] = None, + **kwargs + ): + super(DiagnosticDetectorResponse, self).__init__(kind=kind, **kwargs) + self.start_time = start_time + self.end_time = end_time + self.issue_detected = issue_detected + self.detector_definition = detector_definition + self.metrics = metrics + self.abnormal_time_periods = abnormal_time_periods + self.data = data + self.response_meta_data = response_meta_data + + +class DiagnosticMetricSample(msrest.serialization.Model): + """Class representing Diagnostic Metric. + + :param timestamp: Time at which metric is measured. + :type timestamp: ~datetime.datetime + :param role_instance: Role Instance. Null if this counter is not per instance + This is returned and should be whichever instance name we desire to be returned + i.e. CPU and Memory return RDWORKERNAME (LargeDed..._IN_0) + where RDWORKERNAME is Machine name below and RoleInstance name in parenthesis. + :type role_instance: str + :param total: Total value of the metric. If multiple measurements are made this will have sum + of all. + :type total: float + :param maximum: Maximum of the metric sampled during the time period. + :type maximum: float + :param minimum: Minimum of the metric sampled during the time period. + :type minimum: float + :param is_aggregated: Whether the values are aggregates across all workers or not. + :type is_aggregated: bool + """ + + _attribute_map = { + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'role_instance': {'key': 'roleInstance', 'type': 'str'}, + 'total': {'key': 'total', 'type': 'float'}, + 'maximum': {'key': 'maximum', 'type': 'float'}, + 'minimum': {'key': 'minimum', 'type': 'float'}, + 'is_aggregated': {'key': 'isAggregated', 'type': 'bool'}, + } + + def __init__( + self, + *, + timestamp: Optional[datetime.datetime] = None, + role_instance: Optional[str] = None, + total: Optional[float] = None, + maximum: Optional[float] = None, + minimum: Optional[float] = None, + is_aggregated: Optional[bool] = None, + **kwargs + ): + super(DiagnosticMetricSample, self).__init__(**kwargs) + self.timestamp = timestamp + self.role_instance = role_instance + self.total = total + self.maximum = maximum + self.minimum = minimum + self.is_aggregated = is_aggregated + + +class DiagnosticMetricSet(msrest.serialization.Model): + """Class representing Diagnostic Metric information. + + :param name: Name of the metric. + :type name: str + :param unit: Metric's unit. + :type unit: str + :param start_time: Start time of the period. + :type start_time: ~datetime.datetime + :param end_time: End time of the period. + :type end_time: ~datetime.datetime + :param time_grain: Presented time grain. Supported grains at the moment are PT1M, PT1H, P1D. + :type time_grain: str + :param values: Collection of metric values for the selected period based on the + {Microsoft.Web.Hosting.Administration.DiagnosticMetricSet.TimeGrain}. + :type values: list[~azure.mgmt.web.v2021_02_01.models.DiagnosticMetricSample] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'time_grain': {'key': 'timeGrain', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[DiagnosticMetricSample]'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + unit: Optional[str] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + time_grain: Optional[str] = None, + values: Optional[List["DiagnosticMetricSample"]] = None, + **kwargs + ): + super(DiagnosticMetricSet, self).__init__(**kwargs) + self.name = name + self.unit = unit + self.start_time = start_time + self.end_time = end_time + self.time_grain = time_grain + self.values = values + + +class Dimension(msrest.serialization.Model): + """Dimension of a resource metric. For e.g. instance specific HTTP requests for a web app, +where instance name is dimension of the metric HTTP request. + + :param name: + :type name: str + :param display_name: + :type display_name: str + :param internal_name: + :type internal_name: str + :param to_be_exported_for_shoebox: + :type to_be_exported_for_shoebox: bool + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'internal_name': {'key': 'internalName', 'type': 'str'}, + 'to_be_exported_for_shoebox': {'key': 'toBeExportedForShoebox', 'type': 'bool'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display_name: Optional[str] = None, + internal_name: Optional[str] = None, + to_be_exported_for_shoebox: Optional[bool] = None, + **kwargs + ): + super(Dimension, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.internal_name = internal_name + self.to_be_exported_for_shoebox = to_be_exported_for_shoebox + + +class Domain(Resource): + """Information about a domain. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param contact_admin: Administrative contact. + :type contact_admin: ~azure.mgmt.web.v2021_02_01.models.Contact + :param contact_billing: Billing contact. + :type contact_billing: ~azure.mgmt.web.v2021_02_01.models.Contact + :param contact_registrant: Registrant contact. + :type contact_registrant: ~azure.mgmt.web.v2021_02_01.models.Contact + :param contact_tech: Technical contact. + :type contact_tech: ~azure.mgmt.web.v2021_02_01.models.Contact + :ivar registration_status: Domain registration status. Possible values include: "Active", + "Awaiting", "Cancelled", "Confiscated", "Disabled", "Excluded", "Expired", "Failed", "Held", + "Locked", "Parked", "Pending", "Reserved", "Reverted", "Suspended", "Transferred", "Unknown", + "Unlocked", "Unparked", "Updated", "JsonConverterFailed". + :vartype registration_status: str or ~azure.mgmt.web.v2021_02_01.models.DomainStatus + :ivar provisioning_state: Domain provisioning state. Possible values include: "Succeeded", + "Failed", "Canceled", "InProgress", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.web.v2021_02_01.models.ProvisioningState + :ivar name_servers: Name servers. + :vartype name_servers: list[str] + :param privacy: :code:`true` if domain privacy is enabled for this domain; + otherwise, :code:`false`. + :type privacy: bool + :ivar created_time: Domain creation timestamp. + :vartype created_time: ~datetime.datetime + :ivar expiration_time: Domain expiration timestamp. + :vartype expiration_time: ~datetime.datetime + :ivar last_renewed_time: Timestamp when the domain was renewed last time. + :vartype last_renewed_time: ~datetime.datetime + :param auto_renew: :code:`true` if the domain should be automatically renewed; + otherwise, :code:`false`. + :type auto_renew: bool + :ivar ready_for_dns_record_management: :code:`true` if Azure can assign this + domain to App Service apps; otherwise, :code:`false`. This value will be + :code:`true` if domain registration status is active and + it is hosted on name servers Azure has programmatic access to. + :vartype ready_for_dns_record_management: bool + :ivar managed_host_names: All hostnames derived from the domain and assigned to Azure + resources. + :vartype managed_host_names: list[~azure.mgmt.web.v2021_02_01.models.HostName] + :param consent: Legal agreement consent. + :type consent: ~azure.mgmt.web.v2021_02_01.models.DomainPurchaseConsent + :ivar domain_not_renewable_reasons: Reasons why domain is not renewable. + :vartype domain_not_renewable_reasons: list[str or + ~azure.mgmt.web.v2021_02_01.models.DomainPropertiesDomainNotRenewableReasonsItem] + :param dns_type: Current DNS type. Possible values include: "AzureDns", + "DefaultDomainRegistrarDns". + :type dns_type: str or ~azure.mgmt.web.v2021_02_01.models.DnsType + :param dns_zone_id: Azure DNS Zone to use. + :type dns_zone_id: str + :param target_dns_type: Target DNS type (would be used for migration). Possible values include: + "AzureDns", "DefaultDomainRegistrarDns". + :type target_dns_type: str or ~azure.mgmt.web.v2021_02_01.models.DnsType + :param auth_code: + :type auth_code: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'registration_status': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'name_servers': {'readonly': True}, + 'created_time': {'readonly': True}, + 'expiration_time': {'readonly': True}, + 'last_renewed_time': {'readonly': True}, + 'ready_for_dns_record_management': {'readonly': True}, + 'managed_host_names': {'readonly': True}, + 'domain_not_renewable_reasons': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'contact_admin': {'key': 'properties.contactAdmin', 'type': 'Contact'}, + 'contact_billing': {'key': 'properties.contactBilling', 'type': 'Contact'}, + 'contact_registrant': {'key': 'properties.contactRegistrant', 'type': 'Contact'}, + 'contact_tech': {'key': 'properties.contactTech', 'type': 'Contact'}, + 'registration_status': {'key': 'properties.registrationStatus', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name_servers': {'key': 'properties.nameServers', 'type': '[str]'}, + 'privacy': {'key': 'properties.privacy', 'type': 'bool'}, + 'created_time': {'key': 'properties.createdTime', 'type': 'iso-8601'}, + 'expiration_time': {'key': 'properties.expirationTime', 'type': 'iso-8601'}, + 'last_renewed_time': {'key': 'properties.lastRenewedTime', 'type': 'iso-8601'}, + 'auto_renew': {'key': 'properties.autoRenew', 'type': 'bool'}, + 'ready_for_dns_record_management': {'key': 'properties.readyForDnsRecordManagement', 'type': 'bool'}, + 'managed_host_names': {'key': 'properties.managedHostNames', 'type': '[HostName]'}, + 'consent': {'key': 'properties.consent', 'type': 'DomainPurchaseConsent'}, + 'domain_not_renewable_reasons': {'key': 'properties.domainNotRenewableReasons', 'type': '[str]'}, + 'dns_type': {'key': 'properties.dnsType', 'type': 'str'}, + 'dns_zone_id': {'key': 'properties.dnsZoneId', 'type': 'str'}, + 'target_dns_type': {'key': 'properties.targetDnsType', 'type': 'str'}, + 'auth_code': {'key': 'properties.authCode', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + kind: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + contact_admin: Optional["Contact"] = None, + contact_billing: Optional["Contact"] = None, + contact_registrant: Optional["Contact"] = None, + contact_tech: Optional["Contact"] = None, + privacy: Optional[bool] = None, + auto_renew: Optional[bool] = True, + consent: Optional["DomainPurchaseConsent"] = None, + dns_type: Optional[Union[str, "DnsType"]] = None, + dns_zone_id: Optional[str] = None, + target_dns_type: Optional[Union[str, "DnsType"]] = None, + auth_code: Optional[str] = None, + **kwargs + ): + super(Domain, self).__init__(kind=kind, location=location, tags=tags, **kwargs) + self.contact_admin = contact_admin + self.contact_billing = contact_billing + self.contact_registrant = contact_registrant + self.contact_tech = contact_tech + self.registration_status = None + self.provisioning_state = None + self.name_servers = None + self.privacy = privacy + self.created_time = None + self.expiration_time = None + self.last_renewed_time = None + self.auto_renew = auto_renew + self.ready_for_dns_record_management = None + self.managed_host_names = None + self.consent = consent + self.domain_not_renewable_reasons = None + self.dns_type = dns_type + self.dns_zone_id = dns_zone_id + self.target_dns_type = target_dns_type + self.auth_code = auth_code + + +class DomainAvailabilityCheckResult(msrest.serialization.Model): + """Domain availability check result. + + :param name: Name of the domain. + :type name: str + :param available: :code:`true` if domain can be purchased using CreateDomain API; + otherwise, :code:`false`. + :type available: bool + :param domain_type: Valid values are Regular domain: Azure will charge the full price of domain + registration, SoftDeleted: Purchasing this domain will simply restore it and this operation + will not cost anything. Possible values include: "Regular", "SoftDeleted". + :type domain_type: str or ~azure.mgmt.web.v2021_02_01.models.DomainType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'available': {'key': 'available', 'type': 'bool'}, + 'domain_type': {'key': 'domainType', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + available: Optional[bool] = None, + domain_type: Optional[Union[str, "DomainType"]] = None, + **kwargs + ): + super(DomainAvailabilityCheckResult, self).__init__(**kwargs) + self.name = name + self.available = available + self.domain_type = domain_type + + +class DomainCollection(msrest.serialization.Model): + """Collection of domains. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.Domain] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Domain]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["Domain"], + **kwargs + ): + super(DomainCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class DomainControlCenterSsoRequest(msrest.serialization.Model): + """Single sign-on request information for domain management. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar url: URL where the single sign-on request is to be made. + :vartype url: str + :ivar post_parameter_key: Post parameter key. + :vartype post_parameter_key: str + :ivar post_parameter_value: Post parameter value. Client should use + 'application/x-www-form-urlencoded' encoding for this value. + :vartype post_parameter_value: str + """ + + _validation = { + 'url': {'readonly': True}, + 'post_parameter_key': {'readonly': True}, + 'post_parameter_value': {'readonly': True}, + } + + _attribute_map = { + 'url': {'key': 'url', 'type': 'str'}, + 'post_parameter_key': {'key': 'postParameterKey', 'type': 'str'}, + 'post_parameter_value': {'key': 'postParameterValue', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DomainControlCenterSsoRequest, self).__init__(**kwargs) + self.url = None + self.post_parameter_key = None + self.post_parameter_value = None + + +class DomainOwnershipIdentifier(ProxyOnlyResource): + """Domain ownership Identifier. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param ownership_id: Ownership Id. + :type ownership_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'ownership_id': {'key': 'properties.ownershipId', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + ownership_id: Optional[str] = None, + **kwargs + ): + super(DomainOwnershipIdentifier, self).__init__(kind=kind, **kwargs) + self.ownership_id = ownership_id + + +class DomainOwnershipIdentifierCollection(msrest.serialization.Model): + """Collection of domain ownership identifiers. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.DomainOwnershipIdentifier] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DomainOwnershipIdentifier]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["DomainOwnershipIdentifier"], + **kwargs + ): + super(DomainOwnershipIdentifierCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class DomainPatchResource(ProxyOnlyResource): + """ARM resource for a domain. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param contact_admin: Administrative contact. + :type contact_admin: ~azure.mgmt.web.v2021_02_01.models.Contact + :param contact_billing: Billing contact. + :type contact_billing: ~azure.mgmt.web.v2021_02_01.models.Contact + :param contact_registrant: Registrant contact. + :type contact_registrant: ~azure.mgmt.web.v2021_02_01.models.Contact + :param contact_tech: Technical contact. + :type contact_tech: ~azure.mgmt.web.v2021_02_01.models.Contact + :ivar registration_status: Domain registration status. Possible values include: "Active", + "Awaiting", "Cancelled", "Confiscated", "Disabled", "Excluded", "Expired", "Failed", "Held", + "Locked", "Parked", "Pending", "Reserved", "Reverted", "Suspended", "Transferred", "Unknown", + "Unlocked", "Unparked", "Updated", "JsonConverterFailed". + :vartype registration_status: str or ~azure.mgmt.web.v2021_02_01.models.DomainStatus + :ivar provisioning_state: Domain provisioning state. Possible values include: "Succeeded", + "Failed", "Canceled", "InProgress", "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.web.v2021_02_01.models.ProvisioningState + :ivar name_servers: Name servers. + :vartype name_servers: list[str] + :param privacy: :code:`true` if domain privacy is enabled for this domain; + otherwise, :code:`false`. + :type privacy: bool + :ivar created_time: Domain creation timestamp. + :vartype created_time: ~datetime.datetime + :ivar expiration_time: Domain expiration timestamp. + :vartype expiration_time: ~datetime.datetime + :ivar last_renewed_time: Timestamp when the domain was renewed last time. + :vartype last_renewed_time: ~datetime.datetime + :param auto_renew: :code:`true` if the domain should be automatically renewed; + otherwise, :code:`false`. + :type auto_renew: bool + :ivar ready_for_dns_record_management: :code:`true` if Azure can assign this + domain to App Service apps; otherwise, :code:`false`. This value will be + :code:`true` if domain registration status is active and + it is hosted on name servers Azure has programmatic access to. + :vartype ready_for_dns_record_management: bool + :ivar managed_host_names: All hostnames derived from the domain and assigned to Azure + resources. + :vartype managed_host_names: list[~azure.mgmt.web.v2021_02_01.models.HostName] + :param consent: Legal agreement consent. + :type consent: ~azure.mgmt.web.v2021_02_01.models.DomainPurchaseConsent + :ivar domain_not_renewable_reasons: Reasons why domain is not renewable. + :vartype domain_not_renewable_reasons: list[str or + ~azure.mgmt.web.v2021_02_01.models.DomainPatchResourcePropertiesDomainNotRenewableReasonsItem] + :param dns_type: Current DNS type. Possible values include: "AzureDns", + "DefaultDomainRegistrarDns". + :type dns_type: str or ~azure.mgmt.web.v2021_02_01.models.DnsType + :param dns_zone_id: Azure DNS Zone to use. + :type dns_zone_id: str + :param target_dns_type: Target DNS type (would be used for migration). Possible values include: + "AzureDns", "DefaultDomainRegistrarDns". + :type target_dns_type: str or ~azure.mgmt.web.v2021_02_01.models.DnsType + :param auth_code: + :type auth_code: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'registration_status': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'name_servers': {'readonly': True}, + 'created_time': {'readonly': True}, + 'expiration_time': {'readonly': True}, + 'last_renewed_time': {'readonly': True}, + 'ready_for_dns_record_management': {'readonly': True}, + 'managed_host_names': {'readonly': True}, + 'domain_not_renewable_reasons': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'contact_admin': {'key': 'properties.contactAdmin', 'type': 'Contact'}, + 'contact_billing': {'key': 'properties.contactBilling', 'type': 'Contact'}, + 'contact_registrant': {'key': 'properties.contactRegistrant', 'type': 'Contact'}, + 'contact_tech': {'key': 'properties.contactTech', 'type': 'Contact'}, + 'registration_status': {'key': 'properties.registrationStatus', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name_servers': {'key': 'properties.nameServers', 'type': '[str]'}, + 'privacy': {'key': 'properties.privacy', 'type': 'bool'}, + 'created_time': {'key': 'properties.createdTime', 'type': 'iso-8601'}, + 'expiration_time': {'key': 'properties.expirationTime', 'type': 'iso-8601'}, + 'last_renewed_time': {'key': 'properties.lastRenewedTime', 'type': 'iso-8601'}, + 'auto_renew': {'key': 'properties.autoRenew', 'type': 'bool'}, + 'ready_for_dns_record_management': {'key': 'properties.readyForDnsRecordManagement', 'type': 'bool'}, + 'managed_host_names': {'key': 'properties.managedHostNames', 'type': '[HostName]'}, + 'consent': {'key': 'properties.consent', 'type': 'DomainPurchaseConsent'}, + 'domain_not_renewable_reasons': {'key': 'properties.domainNotRenewableReasons', 'type': '[str]'}, + 'dns_type': {'key': 'properties.dnsType', 'type': 'str'}, + 'dns_zone_id': {'key': 'properties.dnsZoneId', 'type': 'str'}, + 'target_dns_type': {'key': 'properties.targetDnsType', 'type': 'str'}, + 'auth_code': {'key': 'properties.authCode', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + contact_admin: Optional["Contact"] = None, + contact_billing: Optional["Contact"] = None, + contact_registrant: Optional["Contact"] = None, + contact_tech: Optional["Contact"] = None, + privacy: Optional[bool] = None, + auto_renew: Optional[bool] = True, + consent: Optional["DomainPurchaseConsent"] = None, + dns_type: Optional[Union[str, "DnsType"]] = None, + dns_zone_id: Optional[str] = None, + target_dns_type: Optional[Union[str, "DnsType"]] = None, + auth_code: Optional[str] = None, + **kwargs + ): + super(DomainPatchResource, self).__init__(kind=kind, **kwargs) + self.contact_admin = contact_admin + self.contact_billing = contact_billing + self.contact_registrant = contact_registrant + self.contact_tech = contact_tech + self.registration_status = None + self.provisioning_state = None + self.name_servers = None + self.privacy = privacy + self.created_time = None + self.expiration_time = None + self.last_renewed_time = None + self.auto_renew = auto_renew + self.ready_for_dns_record_management = None + self.managed_host_names = None + self.consent = consent + self.domain_not_renewable_reasons = None + self.dns_type = dns_type + self.dns_zone_id = dns_zone_id + self.target_dns_type = target_dns_type + self.auth_code = auth_code + + +class DomainPurchaseConsent(msrest.serialization.Model): + """Domain purchase consent object, representing acceptance of applicable legal agreements. + + :param agreement_keys: List of applicable legal agreement keys. This list can be retrieved + using ListLegalAgreements API under :code:`TopLevelDomain` resource. + :type agreement_keys: list[str] + :param agreed_by: Client IP address. + :type agreed_by: str + :param agreed_at: Timestamp when the agreements were accepted. + :type agreed_at: ~datetime.datetime + """ + + _attribute_map = { + 'agreement_keys': {'key': 'agreementKeys', 'type': '[str]'}, + 'agreed_by': {'key': 'agreedBy', 'type': 'str'}, + 'agreed_at': {'key': 'agreedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + agreement_keys: Optional[List[str]] = None, + agreed_by: Optional[str] = None, + agreed_at: Optional[datetime.datetime] = None, + **kwargs + ): + super(DomainPurchaseConsent, self).__init__(**kwargs) + self.agreement_keys = agreement_keys + self.agreed_by = agreed_by + self.agreed_at = agreed_at + + +class DomainRecommendationSearchParameters(msrest.serialization.Model): + """Domain recommendation search parameters. + + :param keywords: Keywords to be used for generating domain recommendations. + :type keywords: str + :param max_domain_recommendations: Maximum number of recommendations. + :type max_domain_recommendations: int + """ + + _attribute_map = { + 'keywords': {'key': 'keywords', 'type': 'str'}, + 'max_domain_recommendations': {'key': 'maxDomainRecommendations', 'type': 'int'}, + } + + def __init__( + self, + *, + keywords: Optional[str] = None, + max_domain_recommendations: Optional[int] = None, + **kwargs + ): + super(DomainRecommendationSearchParameters, self).__init__(**kwargs) + self.keywords = keywords + self.max_domain_recommendations = max_domain_recommendations + + +class EnabledConfig(msrest.serialization.Model): + """Enabled configuration. + + :param enabled: True if configuration is enabled, false if it is disabled and null if + configuration is not set. + :type enabled: bool + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__( + self, + *, + enabled: Optional[bool] = None, + **kwargs + ): + super(EnabledConfig, self).__init__(**kwargs) + self.enabled = enabled + + +class EndpointDependency(msrest.serialization.Model): + """A domain name that a service is reached at, including details of the current connection status. + + :param domain_name: The domain name of the dependency. + :type domain_name: str + :param endpoint_details: The IP Addresses and Ports used when connecting to DomainName. + :type endpoint_details: list[~azure.mgmt.web.v2021_02_01.models.EndpointDetail] + """ + + _attribute_map = { + 'domain_name': {'key': 'domainName', 'type': 'str'}, + 'endpoint_details': {'key': 'endpointDetails', 'type': '[EndpointDetail]'}, + } + + def __init__( + self, + *, + domain_name: Optional[str] = None, + endpoint_details: Optional[List["EndpointDetail"]] = None, + **kwargs + ): + super(EndpointDependency, self).__init__(**kwargs) + self.domain_name = domain_name + self.endpoint_details = endpoint_details + + +class EndpointDetail(msrest.serialization.Model): + """Current TCP connectivity information from the App Service Environment to a single endpoint. + + :param ip_address: An IP Address that Domain Name currently resolves to. + :type ip_address: str + :param port: The port an endpoint is connected to. + :type port: int + :param latency: The time in milliseconds it takes for a TCP connection to be created from the + App Service Environment to this IpAddress at this Port. + :type latency: float + :param is_accessible: Whether it is possible to create a TCP connection from the App Service + Environment to this IpAddress at this Port. + :type is_accessible: bool + """ + + _attribute_map = { + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + 'latency': {'key': 'latency', 'type': 'float'}, + 'is_accessible': {'key': 'isAccessible', 'type': 'bool'}, + } + + def __init__( + self, + *, + ip_address: Optional[str] = None, + port: Optional[int] = None, + latency: Optional[float] = None, + is_accessible: Optional[bool] = None, + **kwargs + ): + super(EndpointDetail, self).__init__(**kwargs) + self.ip_address = ip_address + self.port = port + self.latency = latency + self.is_accessible = is_accessible + + +class ErrorEntity(msrest.serialization.Model): + """Body of the error response returned from the API. + + :param extended_code: Type of error. + :type extended_code: str + :param message_template: Message template. + :type message_template: str + :param parameters: Parameters for the template. + :type parameters: list[str] + :param inner_errors: Inner errors. + :type inner_errors: list[~azure.mgmt.web.v2021_02_01.models.ErrorEntity] + :param details: Error Details. + :type details: list[~azure.mgmt.web.v2021_02_01.models.ErrorEntity] + :param target: The error target. + :type target: str + :param code: Basic error code. + :type code: str + :param message: Any details of the error. + :type message: str + """ + + _attribute_map = { + 'extended_code': {'key': 'extendedCode', 'type': 'str'}, + 'message_template': {'key': 'messageTemplate', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': '[str]'}, + 'inner_errors': {'key': 'innerErrors', 'type': '[ErrorEntity]'}, + 'details': {'key': 'details', 'type': '[ErrorEntity]'}, + 'target': {'key': 'target', 'type': 'str'}, + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + *, + extended_code: Optional[str] = None, + message_template: Optional[str] = None, + parameters: Optional[List[str]] = None, + inner_errors: Optional[List["ErrorEntity"]] = None, + details: Optional[List["ErrorEntity"]] = None, + target: Optional[str] = None, + code: Optional[str] = None, + message: Optional[str] = None, + **kwargs + ): + super(ErrorEntity, self).__init__(**kwargs) + self.extended_code = extended_code + self.message_template = message_template + self.parameters = parameters + self.inner_errors = inner_errors + self.details = details + self.target = target + self.code = code + self.message = message + + +class Experiments(msrest.serialization.Model): + """Routing rules in production experiments. + + :param ramp_up_rules: List of ramp-up rules. + :type ramp_up_rules: list[~azure.mgmt.web.v2021_02_01.models.RampUpRule] + """ + + _attribute_map = { + 'ramp_up_rules': {'key': 'rampUpRules', 'type': '[RampUpRule]'}, + } + + def __init__( + self, + *, + ramp_up_rules: Optional[List["RampUpRule"]] = None, + **kwargs + ): + super(Experiments, self).__init__(**kwargs) + self.ramp_up_rules = ramp_up_rules + + +class ExtendedLocation(msrest.serialization.Model): + """Extended Location. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param name: Name of extended location. + :type name: str + :ivar type: Type of extended location. + :vartype type: str + """ + + _validation = { + 'type': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + **kwargs + ): + super(ExtendedLocation, self).__init__(**kwargs) + self.name = name + self.type = None + + +class Facebook(msrest.serialization.Model): + """The configuration settings of the Facebook provider. + + :param enabled: :code:`false` if the Facebook provider should not be enabled + despite the set registration; otherwise, :code:`true`. + :type enabled: bool + :param registration: The configuration settings of the app registration for the Facebook + provider. + :type registration: ~azure.mgmt.web.v2021_02_01.models.AppRegistration + :param graph_api_version: The version of the Facebook api to be used while logging in. + :type graph_api_version: str + :param login: The configuration settings of the login flow. + :type login: ~azure.mgmt.web.v2021_02_01.models.LoginScopes + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'AppRegistration'}, + 'graph_api_version': {'key': 'graphApiVersion', 'type': 'str'}, + 'login': {'key': 'login', 'type': 'LoginScopes'}, + } + + def __init__( + self, + *, + enabled: Optional[bool] = None, + registration: Optional["AppRegistration"] = None, + graph_api_version: Optional[str] = None, + login: Optional["LoginScopes"] = None, + **kwargs + ): + super(Facebook, self).__init__(**kwargs) + self.enabled = enabled + self.registration = registration + self.graph_api_version = graph_api_version + self.login = login + + +class FileSystemApplicationLogsConfig(msrest.serialization.Model): + """Application logs to file system configuration. + + :param level: Log level. Possible values include: "Off", "Verbose", "Information", "Warning", + "Error". + :type level: str or ~azure.mgmt.web.v2021_02_01.models.LogLevel + """ + + _attribute_map = { + 'level': {'key': 'level', 'type': 'str'}, + } + + def __init__( + self, + *, + level: Optional[Union[str, "LogLevel"]] = None, + **kwargs + ): + super(FileSystemApplicationLogsConfig, self).__init__(**kwargs) + self.level = level + + +class FileSystemHttpLogsConfig(msrest.serialization.Model): + """Http logs to file system configuration. + + :param retention_in_mb: Maximum size in megabytes that http log files can use. + When reached old log files will be removed to make space for new ones. + Value can range between 25 and 100. + :type retention_in_mb: int + :param retention_in_days: Retention in days. + Remove files older than X days. + 0 or lower means no retention. + :type retention_in_days: int + :param enabled: True if configuration is enabled, false if it is disabled and null if + configuration is not set. + :type enabled: bool + """ + + _validation = { + 'retention_in_mb': {'maximum': 100, 'minimum': 25}, + } + + _attribute_map = { + 'retention_in_mb': {'key': 'retentionInMb', 'type': 'int'}, + 'retention_in_days': {'key': 'retentionInDays', 'type': 'int'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__( + self, + *, + retention_in_mb: Optional[int] = None, + retention_in_days: Optional[int] = None, + enabled: Optional[bool] = None, + **kwargs + ): + super(FileSystemHttpLogsConfig, self).__init__(**kwargs) + self.retention_in_mb = retention_in_mb + self.retention_in_days = retention_in_days + self.enabled = enabled + + +class FileSystemTokenStore(msrest.serialization.Model): + """The configuration settings of the storage of the tokens if a file system is used. + + :param directory: The directory in which the tokens will be stored. + :type directory: str + """ + + _attribute_map = { + 'directory': {'key': 'directory', 'type': 'str'}, + } + + def __init__( + self, + *, + directory: Optional[str] = None, + **kwargs + ): + super(FileSystemTokenStore, self).__init__(**kwargs) + self.directory = directory + + +class ForwardProxy(msrest.serialization.Model): + """The configuration settings of a forward proxy used to make the requests. + + :param convention: The convention used to determine the url of the request made. Possible + values include: "NoProxy", "Standard", "Custom". + :type convention: str or ~azure.mgmt.web.v2021_02_01.models.ForwardProxyConvention + :param custom_host_header_name: The name of the header containing the host of the request. + :type custom_host_header_name: str + :param custom_proto_header_name: The name of the header containing the scheme of the request. + :type custom_proto_header_name: str + """ + + _attribute_map = { + 'convention': {'key': 'convention', 'type': 'str'}, + 'custom_host_header_name': {'key': 'customHostHeaderName', 'type': 'str'}, + 'custom_proto_header_name': {'key': 'customProtoHeaderName', 'type': 'str'}, + } + + def __init__( + self, + *, + convention: Optional[Union[str, "ForwardProxyConvention"]] = None, + custom_host_header_name: Optional[str] = None, + custom_proto_header_name: Optional[str] = None, + **kwargs + ): + super(ForwardProxy, self).__init__(**kwargs) + self.convention = convention + self.custom_host_header_name = custom_host_header_name + self.custom_proto_header_name = custom_proto_header_name + + +class FrontEndConfiguration(msrest.serialization.Model): + """FrontEndConfiguration. + + :param kind: Possible values include: "NodePort", "LoadBalancer". + :type kind: str or ~azure.mgmt.web.v2021_02_01.models.FrontEndServiceType + """ + + _attribute_map = { + 'kind': {'key': 'kind', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[Union[str, "FrontEndServiceType"]] = None, + **kwargs + ): + super(FrontEndConfiguration, self).__init__(**kwargs) + self.kind = kind + + +class FunctionAppMajorVersion(msrest.serialization.Model): + """Function App stack major version. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar display_text: Function App stack major version (display only). + :vartype display_text: str + :ivar value: Function App stack major version name. + :vartype value: str + :ivar minor_versions: Minor versions associated with the major version. + :vartype minor_versions: list[~azure.mgmt.web.v2021_02_01.models.FunctionAppMinorVersion] + """ + + _validation = { + 'display_text': {'readonly': True}, + 'value': {'readonly': True}, + 'minor_versions': {'readonly': True}, + } + + _attribute_map = { + 'display_text': {'key': 'displayText', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'minor_versions': {'key': 'minorVersions', 'type': '[FunctionAppMinorVersion]'}, + } + + def __init__( + self, + **kwargs + ): + super(FunctionAppMajorVersion, self).__init__(**kwargs) + self.display_text = None + self.value = None + self.minor_versions = None + + +class FunctionAppMinorVersion(msrest.serialization.Model): + """Function App stack minor version. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar display_text: Function App stack (display only). + :vartype display_text: str + :ivar value: Function App stack name. + :vartype value: str + :ivar stack_settings: Settings associated with the minor version. + :vartype stack_settings: ~azure.mgmt.web.v2021_02_01.models.FunctionAppRuntimes + """ + + _validation = { + 'display_text': {'readonly': True}, + 'value': {'readonly': True}, + 'stack_settings': {'readonly': True}, + } + + _attribute_map = { + 'display_text': {'key': 'displayText', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'stack_settings': {'key': 'stackSettings', 'type': 'FunctionAppRuntimes'}, + } + + def __init__( + self, + **kwargs + ): + super(FunctionAppMinorVersion, self).__init__(**kwargs) + self.display_text = None + self.value = None + self.stack_settings = None + + +class FunctionAppRuntimes(msrest.serialization.Model): + """Function App stack runtimes. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar linux_runtime_settings: Linux-specific settings associated with the minor version. + :vartype linux_runtime_settings: ~azure.mgmt.web.v2021_02_01.models.FunctionAppRuntimeSettings + :ivar windows_runtime_settings: Windows-specific settings associated with the minor version. + :vartype windows_runtime_settings: + ~azure.mgmt.web.v2021_02_01.models.FunctionAppRuntimeSettings + """ + + _validation = { + 'linux_runtime_settings': {'readonly': True}, + 'windows_runtime_settings': {'readonly': True}, + } + + _attribute_map = { + 'linux_runtime_settings': {'key': 'linuxRuntimeSettings', 'type': 'FunctionAppRuntimeSettings'}, + 'windows_runtime_settings': {'key': 'windowsRuntimeSettings', 'type': 'FunctionAppRuntimeSettings'}, + } + + def __init__( + self, + **kwargs + ): + super(FunctionAppRuntimes, self).__init__(**kwargs) + self.linux_runtime_settings = None + self.windows_runtime_settings = None + + +class FunctionAppRuntimeSettings(msrest.serialization.Model): + """Function App runtime settings. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar runtime_version: Function App stack minor version (runtime only). + :vartype runtime_version: str + :ivar remote_debugging_supported: :code:`true` if remote debugging is supported + for the stack; otherwise, :code:`false`. + :vartype remote_debugging_supported: bool + :ivar app_insights_settings: Application Insights settings associated with the minor version. + :vartype app_insights_settings: + ~azure.mgmt.web.v2021_02_01.models.AppInsightsWebAppStackSettings + :ivar git_hub_action_settings: GitHub Actions settings associated with the minor version. + :vartype git_hub_action_settings: + ~azure.mgmt.web.v2021_02_01.models.GitHubActionWebAppStackSettings + :ivar app_settings_dictionary: Application settings associated with the minor version. + :vartype app_settings_dictionary: dict[str, str] + :ivar site_config_properties_dictionary: Configuration settings associated with the minor + version. + :vartype site_config_properties_dictionary: + ~azure.mgmt.web.v2021_02_01.models.SiteConfigPropertiesDictionary + :ivar supported_functions_extension_versions: List of supported Functions extension versions. + :vartype supported_functions_extension_versions: list[str] + :ivar is_preview: :code:`true` if the stack is in preview; otherwise, + :code:`false`. + :vartype is_preview: bool + :ivar is_deprecated: :code:`true` if the stack is deprecated; otherwise, + :code:`false`. + :vartype is_deprecated: bool + :ivar is_hidden: :code:`true` if the stack should be hidden; otherwise, + :code:`false`. + :vartype is_hidden: bool + :ivar end_of_life_date: End-of-life date for the minor version. + :vartype end_of_life_date: ~datetime.datetime + :ivar is_auto_update: :code:`true` if the stack version is auto-updated; + otherwise, :code:`false`. + :vartype is_auto_update: bool + :ivar is_early_access: :code:`true` if the minor version is early-access; + otherwise, :code:`false`. + :vartype is_early_access: bool + :ivar is_default: :code:`true` if the minor version the default; otherwise, + :code:`false`. + :vartype is_default: bool + """ + + _validation = { + 'runtime_version': {'readonly': True}, + 'remote_debugging_supported': {'readonly': True}, + 'app_insights_settings': {'readonly': True}, + 'git_hub_action_settings': {'readonly': True}, + 'app_settings_dictionary': {'readonly': True}, + 'site_config_properties_dictionary': {'readonly': True}, + 'supported_functions_extension_versions': {'readonly': True}, + 'is_preview': {'readonly': True}, + 'is_deprecated': {'readonly': True}, + 'is_hidden': {'readonly': True}, + 'end_of_life_date': {'readonly': True}, + 'is_auto_update': {'readonly': True}, + 'is_early_access': {'readonly': True}, + 'is_default': {'readonly': True}, + } + + _attribute_map = { + 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, + 'remote_debugging_supported': {'key': 'remoteDebuggingSupported', 'type': 'bool'}, + 'app_insights_settings': {'key': 'appInsightsSettings', 'type': 'AppInsightsWebAppStackSettings'}, + 'git_hub_action_settings': {'key': 'gitHubActionSettings', 'type': 'GitHubActionWebAppStackSettings'}, + 'app_settings_dictionary': {'key': 'appSettingsDictionary', 'type': '{str}'}, + 'site_config_properties_dictionary': {'key': 'siteConfigPropertiesDictionary', 'type': 'SiteConfigPropertiesDictionary'}, + 'supported_functions_extension_versions': {'key': 'supportedFunctionsExtensionVersions', 'type': '[str]'}, + 'is_preview': {'key': 'isPreview', 'type': 'bool'}, + 'is_deprecated': {'key': 'isDeprecated', 'type': 'bool'}, + 'is_hidden': {'key': 'isHidden', 'type': 'bool'}, + 'end_of_life_date': {'key': 'endOfLifeDate', 'type': 'iso-8601'}, + 'is_auto_update': {'key': 'isAutoUpdate', 'type': 'bool'}, + 'is_early_access': {'key': 'isEarlyAccess', 'type': 'bool'}, + 'is_default': {'key': 'isDefault', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(FunctionAppRuntimeSettings, self).__init__(**kwargs) + self.runtime_version = None + self.remote_debugging_supported = None + self.app_insights_settings = None + self.git_hub_action_settings = None + self.app_settings_dictionary = None + self.site_config_properties_dictionary = None + self.supported_functions_extension_versions = None + self.is_preview = None + self.is_deprecated = None + self.is_hidden = None + self.end_of_life_date = None + self.is_auto_update = None + self.is_early_access = None + self.is_default = None + + +class FunctionAppStack(ProxyOnlyResource): + """Function App Stack. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Function App stack location. + :vartype location: str + :ivar display_text: Function App stack (display only). + :vartype display_text: str + :ivar value: Function App stack name. + :vartype value: str + :ivar major_versions: List of major versions available. + :vartype major_versions: list[~azure.mgmt.web.v2021_02_01.models.FunctionAppMajorVersion] + :ivar preferred_os: Function App stack preferred OS. Possible values include: "Windows", + "Linux". + :vartype preferred_os: str or ~azure.mgmt.web.v2021_02_01.models.StackPreferredOs + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'readonly': True}, + 'display_text': {'readonly': True}, + 'value': {'readonly': True}, + 'major_versions': {'readonly': True}, + 'preferred_os': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'display_text': {'key': 'properties.displayText', 'type': 'str'}, + 'value': {'key': 'properties.value', 'type': 'str'}, + 'major_versions': {'key': 'properties.majorVersions', 'type': '[FunctionAppMajorVersion]'}, + 'preferred_os': {'key': 'properties.preferredOs', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(FunctionAppStack, self).__init__(kind=kind, **kwargs) + self.location = None + self.display_text = None + self.value = None + self.major_versions = None + self.preferred_os = None + + +class FunctionAppStackCollection(msrest.serialization.Model): + """Collection of Function app Stacks. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.FunctionAppStack] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[FunctionAppStack]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["FunctionAppStack"], + **kwargs + ): + super(FunctionAppStackCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class FunctionEnvelope(ProxyOnlyResource): + """Function information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param function_app_id: Function App ID. + :type function_app_id: str + :param script_root_path_href: Script root path URI. + :type script_root_path_href: str + :param script_href: Script URI. + :type script_href: str + :param config_href: Config URI. + :type config_href: str + :param test_data_href: Test data URI. + :type test_data_href: str + :param secrets_file_href: Secrets file URI. + :type secrets_file_href: str + :param href: Function URI. + :type href: str + :param config: Config information. + :type config: any + :param files: File list. + :type files: dict[str, str] + :param test_data: Test data used when testing via the Azure Portal. + :type test_data: str + :param invoke_url_template: The invocation URL. + :type invoke_url_template: str + :param language: The function language. + :type language: str + :param is_disabled: Gets or sets a value indicating whether the function is disabled. + :type is_disabled: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'function_app_id': {'key': 'properties.function_app_id', 'type': 'str'}, + 'script_root_path_href': {'key': 'properties.script_root_path_href', 'type': 'str'}, + 'script_href': {'key': 'properties.script_href', 'type': 'str'}, + 'config_href': {'key': 'properties.config_href', 'type': 'str'}, + 'test_data_href': {'key': 'properties.test_data_href', 'type': 'str'}, + 'secrets_file_href': {'key': 'properties.secrets_file_href', 'type': 'str'}, + 'href': {'key': 'properties.href', 'type': 'str'}, + 'config': {'key': 'properties.config', 'type': 'object'}, + 'files': {'key': 'properties.files', 'type': '{str}'}, + 'test_data': {'key': 'properties.test_data', 'type': 'str'}, + 'invoke_url_template': {'key': 'properties.invoke_url_template', 'type': 'str'}, + 'language': {'key': 'properties.language', 'type': 'str'}, + 'is_disabled': {'key': 'properties.isDisabled', 'type': 'bool'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + function_app_id: Optional[str] = None, + script_root_path_href: Optional[str] = None, + script_href: Optional[str] = None, + config_href: Optional[str] = None, + test_data_href: Optional[str] = None, + secrets_file_href: Optional[str] = None, + href: Optional[str] = None, + config: Optional[Any] = None, + files: Optional[Dict[str, str]] = None, + test_data: Optional[str] = None, + invoke_url_template: Optional[str] = None, + language: Optional[str] = None, + is_disabled: Optional[bool] = None, + **kwargs + ): + super(FunctionEnvelope, self).__init__(kind=kind, **kwargs) + self.function_app_id = function_app_id + self.script_root_path_href = script_root_path_href + self.script_href = script_href + self.config_href = config_href + self.test_data_href = test_data_href + self.secrets_file_href = secrets_file_href + self.href = href + self.config = config + self.files = files + self.test_data = test_data + self.invoke_url_template = invoke_url_template + self.language = language + self.is_disabled = is_disabled + + +class FunctionEnvelopeCollection(msrest.serialization.Model): + """Collection of Kudu function information elements. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.FunctionEnvelope] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[FunctionEnvelope]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["FunctionEnvelope"], + **kwargs + ): + super(FunctionEnvelopeCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class FunctionSecrets(msrest.serialization.Model): + """Function secrets. + + :param key: Secret key. + :type key: str + :param trigger_url: Trigger URL. + :type trigger_url: str + """ + + _attribute_map = { + 'key': {'key': 'key', 'type': 'str'}, + 'trigger_url': {'key': 'trigger_url', 'type': 'str'}, + } + + def __init__( + self, + *, + key: Optional[str] = None, + trigger_url: Optional[str] = None, + **kwargs + ): + super(FunctionSecrets, self).__init__(**kwargs) + self.key = key + self.trigger_url = trigger_url + + +class GeoRegion(ProxyOnlyResource): + """Geographical region. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar description: Region description. + :vartype description: str + :ivar display_name: Display name for region. + :vartype display_name: str + :ivar org_domain: Display name for region. + :vartype org_domain: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'description': {'readonly': True}, + 'display_name': {'readonly': True}, + 'org_domain': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'org_domain': {'key': 'properties.orgDomain', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(GeoRegion, self).__init__(kind=kind, **kwargs) + self.description = None + self.display_name = None + self.org_domain = None + + +class GeoRegionCollection(msrest.serialization.Model): + """Collection of geographical regions. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.GeoRegion] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[GeoRegion]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["GeoRegion"], + **kwargs + ): + super(GeoRegionCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class GitHub(msrest.serialization.Model): + """The configuration settings of the GitHub provider. + + :param enabled: :code:`false` if the GitHub provider should not be enabled despite + the set registration; otherwise, :code:`true`. + :type enabled: bool + :param registration: The configuration settings of the app registration for the GitHub + provider. + :type registration: ~azure.mgmt.web.v2021_02_01.models.ClientRegistration + :param login: The configuration settings of the login flow. + :type login: ~azure.mgmt.web.v2021_02_01.models.LoginScopes + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'ClientRegistration'}, + 'login': {'key': 'login', 'type': 'LoginScopes'}, + } + + def __init__( + self, + *, + enabled: Optional[bool] = None, + registration: Optional["ClientRegistration"] = None, + login: Optional["LoginScopes"] = None, + **kwargs + ): + super(GitHub, self).__init__(**kwargs) + self.enabled = enabled + self.registration = registration + self.login = login + + +class GitHubActionCodeConfiguration(msrest.serialization.Model): + """The GitHub action code configuration. + + :param runtime_stack: Runtime stack is used to determine the workflow file content for code + base apps. + :type runtime_stack: str + :param runtime_version: Runtime version is used to determine what build version to set in the + workflow file. + :type runtime_version: str + """ + + _attribute_map = { + 'runtime_stack': {'key': 'runtimeStack', 'type': 'str'}, + 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, + } + + def __init__( + self, + *, + runtime_stack: Optional[str] = None, + runtime_version: Optional[str] = None, + **kwargs + ): + super(GitHubActionCodeConfiguration, self).__init__(**kwargs) + self.runtime_stack = runtime_stack + self.runtime_version = runtime_version + + +class GitHubActionConfiguration(msrest.serialization.Model): + """The GitHub action configuration. + + :param code_configuration: GitHub Action code configuration. + :type code_configuration: ~azure.mgmt.web.v2021_02_01.models.GitHubActionCodeConfiguration + :param container_configuration: GitHub Action container configuration. + :type container_configuration: + ~azure.mgmt.web.v2021_02_01.models.GitHubActionContainerConfiguration + :param is_linux: This will help determine the workflow configuration to select. + :type is_linux: bool + :param generate_workflow_file: Workflow option to determine whether the workflow file should be + generated and written to the repository. + :type generate_workflow_file: bool + """ + + _attribute_map = { + 'code_configuration': {'key': 'codeConfiguration', 'type': 'GitHubActionCodeConfiguration'}, + 'container_configuration': {'key': 'containerConfiguration', 'type': 'GitHubActionContainerConfiguration'}, + 'is_linux': {'key': 'isLinux', 'type': 'bool'}, + 'generate_workflow_file': {'key': 'generateWorkflowFile', 'type': 'bool'}, + } + + def __init__( + self, + *, + code_configuration: Optional["GitHubActionCodeConfiguration"] = None, + container_configuration: Optional["GitHubActionContainerConfiguration"] = None, + is_linux: Optional[bool] = None, + generate_workflow_file: Optional[bool] = None, + **kwargs + ): + super(GitHubActionConfiguration, self).__init__(**kwargs) + self.code_configuration = code_configuration + self.container_configuration = container_configuration + self.is_linux = is_linux + self.generate_workflow_file = generate_workflow_file + + +class GitHubActionContainerConfiguration(msrest.serialization.Model): + """The GitHub action container configuration. + + :param server_url: The server URL for the container registry where the build will be hosted. + :type server_url: str + :param image_name: The image name for the build. + :type image_name: str + :param username: The username used to upload the image to the container registry. + :type username: str + :param password: The password used to upload the image to the container registry. + :type password: str + """ + + _attribute_map = { + 'server_url': {'key': 'serverUrl', 'type': 'str'}, + 'image_name': {'key': 'imageName', 'type': 'str'}, + 'username': {'key': 'username', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + } + + def __init__( + self, + *, + server_url: Optional[str] = None, + image_name: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + **kwargs + ): + super(GitHubActionContainerConfiguration, self).__init__(**kwargs) + self.server_url = server_url + self.image_name = image_name + self.username = username + self.password = password + + +class GitHubActionWebAppStackSettings(msrest.serialization.Model): + """GitHub Actions Web App stack settings. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar is_supported: :code:`true` if GitHub Actions is supported for the stack; + otherwise, :code:`false`. + :vartype is_supported: bool + :ivar supported_version: The minor version that is supported for GitHub Actions. + :vartype supported_version: str + """ + + _validation = { + 'is_supported': {'readonly': True}, + 'supported_version': {'readonly': True}, + } + + _attribute_map = { + 'is_supported': {'key': 'isSupported', 'type': 'bool'}, + 'supported_version': {'key': 'supportedVersion', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GitHubActionWebAppStackSettings, self).__init__(**kwargs) + self.is_supported = None + self.supported_version = None + + +class GlobalCsmSkuDescription(msrest.serialization.Model): + """A Global SKU Description. + + :param name: Name of the resource SKU. + :type name: str + :param tier: Service Tier of the resource SKU. + :type tier: str + :param size: Size specifier of the resource SKU. + :type size: str + :param family: Family code of the resource SKU. + :type family: str + :param capacity: Min, max, and default scale values of the SKU. + :type capacity: ~azure.mgmt.web.v2021_02_01.models.SkuCapacity + :param locations: Locations of the SKU. + :type locations: list[str] + :param capabilities: Capabilities of the SKU, e.g., is traffic manager enabled?. + :type capabilities: list[~azure.mgmt.web.v2021_02_01.models.Capability] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'SkuCapacity'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[Capability]'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + tier: Optional[str] = None, + size: Optional[str] = None, + family: Optional[str] = None, + capacity: Optional["SkuCapacity"] = None, + locations: Optional[List[str]] = None, + capabilities: Optional[List["Capability"]] = None, + **kwargs + ): + super(GlobalCsmSkuDescription, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.size = size + self.family = family + self.capacity = capacity + self.locations = locations + self.capabilities = capabilities + + +class GlobalValidation(msrest.serialization.Model): + """The configuration settings that determines the validation flow of users using App Service Authentication/Authorization. + + :param require_authentication: :code:`true` if the authentication flow is required + any request is made; otherwise, :code:`false`. + :type require_authentication: bool + :param unauthenticated_client_action: The action to take when an unauthenticated client + attempts to access the app. Possible values include: "RedirectToLoginPage", "AllowAnonymous", + "Return401", "Return403". + :type unauthenticated_client_action: str or + ~azure.mgmt.web.v2021_02_01.models.UnauthenticatedClientActionV2 + :param redirect_to_provider: The default authentication provider to use when multiple providers + are configured. + This setting is only needed if multiple providers are configured and the unauthenticated + client + action is set to "RedirectToLoginPage". + :type redirect_to_provider: str + :param excluded_paths: The paths for which unauthenticated flow would not be redirected to the + login page. + :type excluded_paths: list[str] + """ + + _attribute_map = { + 'require_authentication': {'key': 'requireAuthentication', 'type': 'bool'}, + 'unauthenticated_client_action': {'key': 'unauthenticatedClientAction', 'type': 'str'}, + 'redirect_to_provider': {'key': 'redirectToProvider', 'type': 'str'}, + 'excluded_paths': {'key': 'excludedPaths', 'type': '[str]'}, + } + + def __init__( + self, + *, + require_authentication: Optional[bool] = None, + unauthenticated_client_action: Optional[Union[str, "UnauthenticatedClientActionV2"]] = None, + redirect_to_provider: Optional[str] = None, + excluded_paths: Optional[List[str]] = None, + **kwargs + ): + super(GlobalValidation, self).__init__(**kwargs) + self.require_authentication = require_authentication + self.unauthenticated_client_action = unauthenticated_client_action + self.redirect_to_provider = redirect_to_provider + self.excluded_paths = excluded_paths + + +class Google(msrest.serialization.Model): + """The configuration settings of the Google provider. + + :param enabled: :code:`false` if the Google provider should not be enabled despite + the set registration; otherwise, :code:`true`. + :type enabled: bool + :param registration: The configuration settings of the app registration for the Google + provider. + :type registration: ~azure.mgmt.web.v2021_02_01.models.ClientRegistration + :param login: The configuration settings of the login flow. + :type login: ~azure.mgmt.web.v2021_02_01.models.LoginScopes + :param validation: The configuration settings of the Azure Active Directory token validation + flow. + :type validation: ~azure.mgmt.web.v2021_02_01.models.AllowedAudiencesValidation + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'ClientRegistration'}, + 'login': {'key': 'login', 'type': 'LoginScopes'}, + 'validation': {'key': 'validation', 'type': 'AllowedAudiencesValidation'}, + } + + def __init__( + self, + *, + enabled: Optional[bool] = None, + registration: Optional["ClientRegistration"] = None, + login: Optional["LoginScopes"] = None, + validation: Optional["AllowedAudiencesValidation"] = None, + **kwargs + ): + super(Google, self).__init__(**kwargs) + self.enabled = enabled + self.registration = registration + self.login = login + self.validation = validation + + +class HandlerMapping(msrest.serialization.Model): + """The IIS handler mappings used to define which handler processes HTTP requests with certain extension. +For example, it is used to configure php-cgi.exe process to handle all HTTP requests with *.php extension. + + :param extension: Requests with this extension will be handled using the specified FastCGI + application. + :type extension: str + :param script_processor: The absolute path to the FastCGI application. + :type script_processor: str + :param arguments: Command-line arguments to be passed to the script processor. + :type arguments: str + """ + + _attribute_map = { + 'extension': {'key': 'extension', 'type': 'str'}, + 'script_processor': {'key': 'scriptProcessor', 'type': 'str'}, + 'arguments': {'key': 'arguments', 'type': 'str'}, + } + + def __init__( + self, + *, + extension: Optional[str] = None, + script_processor: Optional[str] = None, + arguments: Optional[str] = None, + **kwargs + ): + super(HandlerMapping, self).__init__(**kwargs) + self.extension = extension + self.script_processor = script_processor + self.arguments = arguments + + +class HostingEnvironmentDeploymentInfo(msrest.serialization.Model): + """Information needed to create resources on an App Service Environment. + + :param name: Name of the App Service Environment. + :type name: str + :param location: Location of the App Service Environment. + :type location: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + location: Optional[str] = None, + **kwargs + ): + super(HostingEnvironmentDeploymentInfo, self).__init__(**kwargs) + self.name = name + self.location = location + + +class HostingEnvironmentDiagnostics(msrest.serialization.Model): + """Diagnostics for an App Service Environment. + + :param name: Name/identifier of the diagnostics. + :type name: str + :param diagnostics_output: Diagnostics output. + :type diagnostics_output: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'diagnostics_output': {'key': 'diagnosticsOutput', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + diagnostics_output: Optional[str] = None, + **kwargs + ): + super(HostingEnvironmentDiagnostics, self).__init__(**kwargs) + self.name = name + self.diagnostics_output = diagnostics_output + + +class HostingEnvironmentProfile(msrest.serialization.Model): + """Specification for an App Service Environment to use for this resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID of the App Service Environment. + :type id: str + :ivar name: Name of the App Service Environment. + :vartype name: str + :ivar type: Resource type of the App Service Environment. + :vartype type: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + **kwargs + ): + super(HostingEnvironmentProfile, self).__init__(**kwargs) + self.id = id + self.name = None + self.type = None + + +class HostKeys(msrest.serialization.Model): + """Functions host level keys. + + :param master_key: Secret key. + :type master_key: str + :param function_keys: Host level function keys. + :type function_keys: dict[str, str] + :param system_keys: System keys. + :type system_keys: dict[str, str] + """ + + _attribute_map = { + 'master_key': {'key': 'masterKey', 'type': 'str'}, + 'function_keys': {'key': 'functionKeys', 'type': '{str}'}, + 'system_keys': {'key': 'systemKeys', 'type': '{str}'}, + } + + def __init__( + self, + *, + master_key: Optional[str] = None, + function_keys: Optional[Dict[str, str]] = None, + system_keys: Optional[Dict[str, str]] = None, + **kwargs + ): + super(HostKeys, self).__init__(**kwargs) + self.master_key = master_key + self.function_keys = function_keys + self.system_keys = system_keys + + +class HostName(msrest.serialization.Model): + """Details of a hostname derived from a domain. + + :param name: Name of the hostname. + :type name: str + :param site_names: List of apps the hostname is assigned to. This list will have more than one + app only if the hostname is pointing to a Traffic Manager. + :type site_names: list[str] + :param azure_resource_name: Name of the Azure resource the hostname is assigned to. If it is + assigned to a Traffic Manager then it will be the Traffic Manager name otherwise it will be the + app name. + :type azure_resource_name: str + :param azure_resource_type: Type of the Azure resource the hostname is assigned to. Possible + values include: "Website", "TrafficManager". + :type azure_resource_type: str or ~azure.mgmt.web.v2021_02_01.models.AzureResourceType + :param custom_host_name_dns_record_type: Type of the DNS record. Possible values include: + "CName", "A". + :type custom_host_name_dns_record_type: str or + ~azure.mgmt.web.v2021_02_01.models.CustomHostNameDnsRecordType + :param host_name_type: Type of the hostname. Possible values include: "Verified", "Managed". + :type host_name_type: str or ~azure.mgmt.web.v2021_02_01.models.HostNameType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'site_names': {'key': 'siteNames', 'type': '[str]'}, + 'azure_resource_name': {'key': 'azureResourceName', 'type': 'str'}, + 'azure_resource_type': {'key': 'azureResourceType', 'type': 'str'}, + 'custom_host_name_dns_record_type': {'key': 'customHostNameDnsRecordType', 'type': 'str'}, + 'host_name_type': {'key': 'hostNameType', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + site_names: Optional[List[str]] = None, + azure_resource_name: Optional[str] = None, + azure_resource_type: Optional[Union[str, "AzureResourceType"]] = None, + custom_host_name_dns_record_type: Optional[Union[str, "CustomHostNameDnsRecordType"]] = None, + host_name_type: Optional[Union[str, "HostNameType"]] = None, + **kwargs + ): + super(HostName, self).__init__(**kwargs) + self.name = name + self.site_names = site_names + self.azure_resource_name = azure_resource_name + self.azure_resource_type = azure_resource_type + self.custom_host_name_dns_record_type = custom_host_name_dns_record_type + self.host_name_type = host_name_type + + +class HostNameBinding(ProxyOnlyResource): + """A hostname binding object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param site_name: App Service app name. + :type site_name: str + :param domain_id: Fully qualified ARM domain resource URI. + :type domain_id: str + :param azure_resource_name: Azure resource name. + :type azure_resource_name: str + :param azure_resource_type: Azure resource type. Possible values include: "Website", + "TrafficManager". + :type azure_resource_type: str or ~azure.mgmt.web.v2021_02_01.models.AzureResourceType + :param custom_host_name_dns_record_type: Custom DNS record type. Possible values include: + "CName", "A". + :type custom_host_name_dns_record_type: str or + ~azure.mgmt.web.v2021_02_01.models.CustomHostNameDnsRecordType + :param host_name_type: Hostname type. Possible values include: "Verified", "Managed". + :type host_name_type: str or ~azure.mgmt.web.v2021_02_01.models.HostNameType + :param ssl_state: SSL type. Possible values include: "Disabled", "SniEnabled", + "IpBasedEnabled". + :type ssl_state: str or ~azure.mgmt.web.v2021_02_01.models.SslState + :param thumbprint: SSL certificate thumbprint. + :type thumbprint: str + :ivar virtual_ip: Virtual IP address assigned to the hostname if IP based SSL is enabled. + :vartype virtual_ip: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'virtual_ip': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'site_name': {'key': 'properties.siteName', 'type': 'str'}, + 'domain_id': {'key': 'properties.domainId', 'type': 'str'}, + 'azure_resource_name': {'key': 'properties.azureResourceName', 'type': 'str'}, + 'azure_resource_type': {'key': 'properties.azureResourceType', 'type': 'str'}, + 'custom_host_name_dns_record_type': {'key': 'properties.customHostNameDnsRecordType', 'type': 'str'}, + 'host_name_type': {'key': 'properties.hostNameType', 'type': 'str'}, + 'ssl_state': {'key': 'properties.sslState', 'type': 'str'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + 'virtual_ip': {'key': 'properties.virtualIP', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + site_name: Optional[str] = None, + domain_id: Optional[str] = None, + azure_resource_name: Optional[str] = None, + azure_resource_type: Optional[Union[str, "AzureResourceType"]] = None, + custom_host_name_dns_record_type: Optional[Union[str, "CustomHostNameDnsRecordType"]] = None, + host_name_type: Optional[Union[str, "HostNameType"]] = None, + ssl_state: Optional[Union[str, "SslState"]] = None, + thumbprint: Optional[str] = None, + **kwargs + ): + super(HostNameBinding, self).__init__(kind=kind, **kwargs) + self.site_name = site_name + self.domain_id = domain_id + self.azure_resource_name = azure_resource_name + self.azure_resource_type = azure_resource_type + self.custom_host_name_dns_record_type = custom_host_name_dns_record_type + self.host_name_type = host_name_type + self.ssl_state = ssl_state + self.thumbprint = thumbprint + self.virtual_ip = None + + +class HostNameBindingCollection(msrest.serialization.Model): + """Collection of hostname bindings. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.HostNameBinding] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[HostNameBinding]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["HostNameBinding"], + **kwargs + ): + super(HostNameBindingCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class HostNameSslState(msrest.serialization.Model): + """SSL-enabled hostname. + + :param name: Hostname. + :type name: str + :param ssl_state: SSL type. Possible values include: "Disabled", "SniEnabled", + "IpBasedEnabled". + :type ssl_state: str or ~azure.mgmt.web.v2021_02_01.models.SslState + :param virtual_ip: Virtual IP address assigned to the hostname if IP based SSL is enabled. + :type virtual_ip: str + :param thumbprint: SSL certificate thumbprint. + :type thumbprint: str + :param to_update: Set to :code:`true` to update existing hostname. + :type to_update: bool + :param host_type: Indicates whether the hostname is a standard or repository hostname. Possible + values include: "Standard", "Repository". + :type host_type: str or ~azure.mgmt.web.v2021_02_01.models.HostType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'ssl_state': {'key': 'sslState', 'type': 'str'}, + 'virtual_ip': {'key': 'virtualIP', 'type': 'str'}, + 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + 'to_update': {'key': 'toUpdate', 'type': 'bool'}, + 'host_type': {'key': 'hostType', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + ssl_state: Optional[Union[str, "SslState"]] = None, + virtual_ip: Optional[str] = None, + thumbprint: Optional[str] = None, + to_update: Optional[bool] = None, + host_type: Optional[Union[str, "HostType"]] = None, + **kwargs + ): + super(HostNameSslState, self).__init__(**kwargs) + self.name = name + self.ssl_state = ssl_state + self.virtual_ip = virtual_ip + self.thumbprint = thumbprint + self.to_update = to_update + self.host_type = host_type + + +class HttpLogsConfig(msrest.serialization.Model): + """Http logs configuration. + + :param file_system: Http logs to file system configuration. + :type file_system: ~azure.mgmt.web.v2021_02_01.models.FileSystemHttpLogsConfig + :param azure_blob_storage: Http logs to azure blob storage configuration. + :type azure_blob_storage: ~azure.mgmt.web.v2021_02_01.models.AzureBlobStorageHttpLogsConfig + """ + + _attribute_map = { + 'file_system': {'key': 'fileSystem', 'type': 'FileSystemHttpLogsConfig'}, + 'azure_blob_storage': {'key': 'azureBlobStorage', 'type': 'AzureBlobStorageHttpLogsConfig'}, + } + + def __init__( + self, + *, + file_system: Optional["FileSystemHttpLogsConfig"] = None, + azure_blob_storage: Optional["AzureBlobStorageHttpLogsConfig"] = None, + **kwargs + ): + super(HttpLogsConfig, self).__init__(**kwargs) + self.file_system = file_system + self.azure_blob_storage = azure_blob_storage + + +class HttpSettings(msrest.serialization.Model): + """The configuration settings of the HTTP requests for authentication and authorization requests made against App Service Authentication/Authorization. + + :param require_https: :code:`false` if the authentication/authorization responses + not having the HTTPS scheme are permissible; otherwise, :code:`true`. + :type require_https: bool + :param routes: The configuration settings of the paths HTTP requests. + :type routes: ~azure.mgmt.web.v2021_02_01.models.HttpSettingsRoutes + :param forward_proxy: The configuration settings of a forward proxy used to make the requests. + :type forward_proxy: ~azure.mgmt.web.v2021_02_01.models.ForwardProxy + """ + + _attribute_map = { + 'require_https': {'key': 'requireHttps', 'type': 'bool'}, + 'routes': {'key': 'routes', 'type': 'HttpSettingsRoutes'}, + 'forward_proxy': {'key': 'forwardProxy', 'type': 'ForwardProxy'}, + } + + def __init__( + self, + *, + require_https: Optional[bool] = None, + routes: Optional["HttpSettingsRoutes"] = None, + forward_proxy: Optional["ForwardProxy"] = None, + **kwargs + ): + super(HttpSettings, self).__init__(**kwargs) + self.require_https = require_https + self.routes = routes + self.forward_proxy = forward_proxy + + +class HttpSettingsRoutes(msrest.serialization.Model): + """The configuration settings of the paths HTTP requests. + + :param api_prefix: The prefix that should precede all the authentication/authorization paths. + :type api_prefix: str + """ + + _attribute_map = { + 'api_prefix': {'key': 'apiPrefix', 'type': 'str'}, + } + + def __init__( + self, + *, + api_prefix: Optional[str] = None, + **kwargs + ): + super(HttpSettingsRoutes, self).__init__(**kwargs) + self.api_prefix = api_prefix + + +class HybridConnection(ProxyOnlyResource): + """Hybrid Connection contract. This is used to configure a Hybrid Connection. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param service_bus_namespace: The name of the Service Bus namespace. + :type service_bus_namespace: str + :param relay_name: The name of the Service Bus relay. + :type relay_name: str + :param relay_arm_uri: The ARM URI to the Service Bus relay. + :type relay_arm_uri: str + :param hostname: The hostname of the endpoint. + :type hostname: str + :param port: The port of the endpoint. + :type port: int + :param send_key_name: The name of the Service Bus key which has Send permissions. This is used + to authenticate to Service Bus. + :type send_key_name: str + :param send_key_value: The value of the Service Bus key. This is used to authenticate to + Service Bus. In ARM this key will not be returned + normally, use the POST /listKeys API instead. + :type send_key_value: str + :param service_bus_suffix: The suffix for the service bus endpoint. By default this is + .servicebus.windows.net. + :type service_bus_suffix: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'service_bus_namespace': {'key': 'properties.serviceBusNamespace', 'type': 'str'}, + 'relay_name': {'key': 'properties.relayName', 'type': 'str'}, + 'relay_arm_uri': {'key': 'properties.relayArmUri', 'type': 'str'}, + 'hostname': {'key': 'properties.hostname', 'type': 'str'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + 'send_key_name': {'key': 'properties.sendKeyName', 'type': 'str'}, + 'send_key_value': {'key': 'properties.sendKeyValue', 'type': 'str'}, + 'service_bus_suffix': {'key': 'properties.serviceBusSuffix', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + service_bus_namespace: Optional[str] = None, + relay_name: Optional[str] = None, + relay_arm_uri: Optional[str] = None, + hostname: Optional[str] = None, + port: Optional[int] = None, + send_key_name: Optional[str] = None, + send_key_value: Optional[str] = None, + service_bus_suffix: Optional[str] = None, + **kwargs + ): + super(HybridConnection, self).__init__(kind=kind, **kwargs) + self.service_bus_namespace = service_bus_namespace + self.relay_name = relay_name + self.relay_arm_uri = relay_arm_uri + self.hostname = hostname + self.port = port + self.send_key_name = send_key_name + self.send_key_value = send_key_value + self.service_bus_suffix = service_bus_suffix + + +class HybridConnectionCollection(msrest.serialization.Model): + """Collection of hostname bindings. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.HybridConnection] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[HybridConnection]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["HybridConnection"], + **kwargs + ): + super(HybridConnectionCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class HybridConnectionKey(ProxyOnlyResource): + """Hybrid Connection key contract. This has the send key name and value for a Hybrid Connection. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar send_key_name: The name of the send key. + :vartype send_key_name: str + :ivar send_key_value: The value of the send key. + :vartype send_key_value: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'send_key_name': {'readonly': True}, + 'send_key_value': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'send_key_name': {'key': 'properties.sendKeyName', 'type': 'str'}, + 'send_key_value': {'key': 'properties.sendKeyValue', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(HybridConnectionKey, self).__init__(kind=kind, **kwargs) + self.send_key_name = None + self.send_key_value = None + + +class HybridConnectionLimits(ProxyOnlyResource): + """Hybrid Connection limits contract. This is used to return the plan limits of Hybrid Connections. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar current: The current number of Hybrid Connections. + :vartype current: int + :ivar maximum: The maximum number of Hybrid Connections allowed. + :vartype maximum: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'current': {'readonly': True}, + 'maximum': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'current': {'key': 'properties.current', 'type': 'int'}, + 'maximum': {'key': 'properties.maximum', 'type': 'int'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(HybridConnectionLimits, self).__init__(kind=kind, **kwargs) + self.current = None + self.maximum = None + + +class Identifier(ProxyOnlyResource): + """A domain specific resource identifier. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param value: String representation of the identity. + :type value: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'value': {'key': 'properties.id', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + value: Optional[str] = None, + **kwargs + ): + super(Identifier, self).__init__(kind=kind, **kwargs) + self.value = value + + +class IdentifierCollection(msrest.serialization.Model): + """Collection of identifiers. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.Identifier] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Identifier]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["Identifier"], + **kwargs + ): + super(IdentifierCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class IdentityProviders(msrest.serialization.Model): + """The configuration settings of each of the identity providers used to configure App Service Authentication/Authorization. + + :param azure_active_directory: The configuration settings of the Azure Active directory + provider. + :type azure_active_directory: ~azure.mgmt.web.v2021_02_01.models.AzureActiveDirectory + :param facebook: The configuration settings of the Facebook provider. + :type facebook: ~azure.mgmt.web.v2021_02_01.models.Facebook + :param git_hub: The configuration settings of the GitHub provider. + :type git_hub: ~azure.mgmt.web.v2021_02_01.models.GitHub + :param google: The configuration settings of the Google provider. + :type google: ~azure.mgmt.web.v2021_02_01.models.Google + :param legacy_microsoft_account: The configuration settings of the legacy Microsoft Account + provider. + :type legacy_microsoft_account: ~azure.mgmt.web.v2021_02_01.models.LegacyMicrosoftAccount + :param twitter: The configuration settings of the Twitter provider. + :type twitter: ~azure.mgmt.web.v2021_02_01.models.Twitter + :param apple: The configuration settings of the Apple provider. + :type apple: ~azure.mgmt.web.v2021_02_01.models.Apple + :param azure_static_web_apps: The configuration settings of the Azure Static Web Apps provider. + :type azure_static_web_apps: ~azure.mgmt.web.v2021_02_01.models.AzureStaticWebApps + :param custom_open_id_connect_providers: The map of the name of the alias of each custom Open + ID Connect provider to the + configuration settings of the custom Open ID Connect provider. + :type custom_open_id_connect_providers: dict[str, + ~azure.mgmt.web.v2021_02_01.models.CustomOpenIdConnectProvider] + """ + + _attribute_map = { + 'azure_active_directory': {'key': 'azureActiveDirectory', 'type': 'AzureActiveDirectory'}, + 'facebook': {'key': 'facebook', 'type': 'Facebook'}, + 'git_hub': {'key': 'gitHub', 'type': 'GitHub'}, + 'google': {'key': 'google', 'type': 'Google'}, + 'legacy_microsoft_account': {'key': 'legacyMicrosoftAccount', 'type': 'LegacyMicrosoftAccount'}, + 'twitter': {'key': 'twitter', 'type': 'Twitter'}, + 'apple': {'key': 'apple', 'type': 'Apple'}, + 'azure_static_web_apps': {'key': 'azureStaticWebApps', 'type': 'AzureStaticWebApps'}, + 'custom_open_id_connect_providers': {'key': 'customOpenIdConnectProviders', 'type': '{CustomOpenIdConnectProvider}'}, + } + + def __init__( + self, + *, + azure_active_directory: Optional["AzureActiveDirectory"] = None, + facebook: Optional["Facebook"] = None, + git_hub: Optional["GitHub"] = None, + google: Optional["Google"] = None, + legacy_microsoft_account: Optional["LegacyMicrosoftAccount"] = None, + twitter: Optional["Twitter"] = None, + apple: Optional["Apple"] = None, + azure_static_web_apps: Optional["AzureStaticWebApps"] = None, + custom_open_id_connect_providers: Optional[Dict[str, "CustomOpenIdConnectProvider"]] = None, + **kwargs + ): + super(IdentityProviders, self).__init__(**kwargs) + self.azure_active_directory = azure_active_directory + self.facebook = facebook + self.git_hub = git_hub + self.google = google + self.legacy_microsoft_account = legacy_microsoft_account + self.twitter = twitter + self.apple = apple + self.azure_static_web_apps = azure_static_web_apps + self.custom_open_id_connect_providers = custom_open_id_connect_providers + + +class InboundEnvironmentEndpoint(msrest.serialization.Model): + """The IP Addresses and Ports that require inbound network access to and within the subnet of the App Service Environment. + + :param description: Short text describing the purpose of the network traffic. + :type description: str + :param endpoints: The IP addresses that network traffic will originate from in cidr notation. + :type endpoints: list[str] + :param ports: The ports that network traffic will arrive to the App Service Environment at. + :type ports: list[str] + """ + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'endpoints': {'key': 'endpoints', 'type': '[str]'}, + 'ports': {'key': 'ports', 'type': '[str]'}, + } + + def __init__( + self, + *, + description: Optional[str] = None, + endpoints: Optional[List[str]] = None, + ports: Optional[List[str]] = None, + **kwargs + ): + super(InboundEnvironmentEndpoint, self).__init__(**kwargs) + self.description = description + self.endpoints = endpoints + self.ports = ports + + +class InboundEnvironmentEndpointCollection(msrest.serialization.Model): + """Collection of Inbound Environment Endpoints. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.InboundEnvironmentEndpoint] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[InboundEnvironmentEndpoint]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["InboundEnvironmentEndpoint"], + **kwargs + ): + super(InboundEnvironmentEndpointCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class IpSecurityRestriction(msrest.serialization.Model): + """IP security restriction on an app. + + :param ip_address: IP address the security restriction is valid for. + It can be in form of pure ipv4 address (required SubnetMask property) or + CIDR notation such as ipv4/mask (leading bit match). For CIDR, + SubnetMask property must not be specified. + :type ip_address: str + :param subnet_mask: Subnet mask for the range of IP addresses the restriction is valid for. + :type subnet_mask: str + :param vnet_subnet_resource_id: Virtual network resource id. + :type vnet_subnet_resource_id: str + :param vnet_traffic_tag: (internal) Vnet traffic tag. + :type vnet_traffic_tag: int + :param subnet_traffic_tag: (internal) Subnet traffic tag. + :type subnet_traffic_tag: int + :param action: Allow or Deny access for this IP range. + :type action: str + :param tag: Defines what this IP filter will be used for. This is to support IP filtering on + proxies. Possible values include: "Default", "XffProxy", "ServiceTag". + :type tag: str or ~azure.mgmt.web.v2021_02_01.models.IpFilterTag + :param priority: Priority of IP restriction rule. + :type priority: int + :param name: IP restriction rule name. + :type name: str + :param description: IP restriction rule description. + :type description: str + :param headers: IP restriction rule headers. + X-Forwarded-Host + (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Host#Examples). + The matching logic is .. + + + * If the property is null or empty (default), all hosts(or lack of) are allowed. + * A value is compared using ordinal-ignore-case (excluding port number). + * Subdomain wildcards are permitted but don't match the root domain. For example, + *.contoso.com matches the subdomain foo.contoso.com + but not the root domain contoso.com or multi-level foo.bar.contoso.com + * Unicode host names are allowed but are converted to Punycode for matching. + + X-Forwarded-For + (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For#Examples). + The matching logic is .. + + + * If the property is null or empty (default), any forwarded-for chains (or lack of) are + allowed. + * If any address (excluding port number) in the chain (comma separated) matches the CIDR + defined by the property. + + X-Azure-FDID and X-FD-HealthProbe. + The matching logic is exact match. + :type headers: dict[str, list[str]] + """ + + _attribute_map = { + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'subnet_mask': {'key': 'subnetMask', 'type': 'str'}, + 'vnet_subnet_resource_id': {'key': 'vnetSubnetResourceId', 'type': 'str'}, + 'vnet_traffic_tag': {'key': 'vnetTrafficTag', 'type': 'int'}, + 'subnet_traffic_tag': {'key': 'subnetTrafficTag', 'type': 'int'}, + 'action': {'key': 'action', 'type': 'str'}, + 'tag': {'key': 'tag', 'type': 'str'}, + 'priority': {'key': 'priority', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'headers': {'key': 'headers', 'type': '{[str]}'}, + } + + def __init__( + self, + *, + ip_address: Optional[str] = None, + subnet_mask: Optional[str] = None, + vnet_subnet_resource_id: Optional[str] = None, + vnet_traffic_tag: Optional[int] = None, + subnet_traffic_tag: Optional[int] = None, + action: Optional[str] = None, + tag: Optional[Union[str, "IpFilterTag"]] = None, + priority: Optional[int] = None, + name: Optional[str] = None, + description: Optional[str] = None, + headers: Optional[Dict[str, List[str]]] = None, + **kwargs + ): + super(IpSecurityRestriction, self).__init__(**kwargs) + self.ip_address = ip_address + self.subnet_mask = subnet_mask + self.vnet_subnet_resource_id = vnet_subnet_resource_id + self.vnet_traffic_tag = vnet_traffic_tag + self.subnet_traffic_tag = subnet_traffic_tag + self.action = action + self.tag = tag + self.priority = priority + self.name = name + self.description = description + self.headers = headers + + +class JwtClaimChecks(msrest.serialization.Model): + """The configuration settings of the checks that should be made while validating the JWT Claims. + + :param allowed_groups: The list of the allowed groups. + :type allowed_groups: list[str] + :param allowed_client_applications: The list of the allowed client applications. + :type allowed_client_applications: list[str] + """ + + _attribute_map = { + 'allowed_groups': {'key': 'allowedGroups', 'type': '[str]'}, + 'allowed_client_applications': {'key': 'allowedClientApplications', 'type': '[str]'}, + } + + def __init__( + self, + *, + allowed_groups: Optional[List[str]] = None, + allowed_client_applications: Optional[List[str]] = None, + **kwargs + ): + super(JwtClaimChecks, self).__init__(**kwargs) + self.allowed_groups = allowed_groups + self.allowed_client_applications = allowed_client_applications + + +class KeyInfo(msrest.serialization.Model): + """Function key info. + + :param name: Key name. + :type name: str + :param value: Key value. + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + value: Optional[str] = None, + **kwargs + ): + super(KeyInfo, self).__init__(**kwargs) + self.name = name + self.value = value + + +class KeyValuePairStringObject(msrest.serialization.Model): + """KeyValuePairStringObject. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar key: + :vartype key: str + :ivar value: Any object. + :vartype value: any + """ + + _validation = { + 'key': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'key': {'key': 'key', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(KeyValuePairStringObject, self).__init__(**kwargs) + self.key = None + self.value = None + + +class KubeEnvironment(Resource): + """A Kubernetes cluster specialized for web workloads by Azure App Service. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param extended_location: Extended Location. + :type extended_location: ~azure.mgmt.web.v2021_02_01.models.ExtendedLocation + :ivar provisioning_state: Provisioning state of the Kubernetes Environment. Possible values + include: "Succeeded", "Failed", "Canceled", "Waiting", "InitializationInProgress", + "InfrastructureSetupInProgress", "InfrastructureSetupComplete", "ScheduledForDelete", + "UpgradeRequested", "UpgradeFailed". + :vartype provisioning_state: str or + ~azure.mgmt.web.v2021_02_01.models.KubeEnvironmentProvisioningState + :ivar deployment_errors: Any errors that occurred during deployment or deployment validation. + :vartype deployment_errors: str + :param internal_load_balancer_enabled: Only visible within Vnet/Subnet. + :type internal_load_balancer_enabled: bool + :ivar default_domain: Default Domain Name for the cluster. + :vartype default_domain: str + :param static_ip: Static IP of the KubeEnvironment. + :type static_ip: str + :param arc_configuration: Cluster configuration which determines the ARC cluster + components types. Eg: Choosing between BuildService kind, + FrontEnd Service ArtifactsStorageType etc. + :type arc_configuration: ~azure.mgmt.web.v2021_02_01.models.ArcConfiguration + :param app_logs_configuration: Cluster configuration which enables the log daemon to export + app logs to a destination. Currently only "log-analytics" is + supported. + :type app_logs_configuration: ~azure.mgmt.web.v2021_02_01.models.AppLogsConfiguration + :param aks_resource_id: + :type aks_resource_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'deployment_errors': {'readonly': True}, + 'default_domain': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'deployment_errors': {'key': 'properties.deploymentErrors', 'type': 'str'}, + 'internal_load_balancer_enabled': {'key': 'properties.internalLoadBalancerEnabled', 'type': 'bool'}, + 'default_domain': {'key': 'properties.defaultDomain', 'type': 'str'}, + 'static_ip': {'key': 'properties.staticIp', 'type': 'str'}, + 'arc_configuration': {'key': 'properties.arcConfiguration', 'type': 'ArcConfiguration'}, + 'app_logs_configuration': {'key': 'properties.appLogsConfiguration', 'type': 'AppLogsConfiguration'}, + 'aks_resource_id': {'key': 'properties.aksResourceID', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + kind: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + extended_location: Optional["ExtendedLocation"] = None, + internal_load_balancer_enabled: Optional[bool] = None, + static_ip: Optional[str] = None, + arc_configuration: Optional["ArcConfiguration"] = None, + app_logs_configuration: Optional["AppLogsConfiguration"] = None, + aks_resource_id: Optional[str] = None, + **kwargs + ): + super(KubeEnvironment, self).__init__(kind=kind, location=location, tags=tags, **kwargs) + self.extended_location = extended_location + self.provisioning_state = None + self.deployment_errors = None + self.internal_load_balancer_enabled = internal_load_balancer_enabled + self.default_domain = None + self.static_ip = static_ip + self.arc_configuration = arc_configuration + self.app_logs_configuration = app_logs_configuration + self.aks_resource_id = aks_resource_id + + +class KubeEnvironmentCollection(msrest.serialization.Model): + """Collection of Kubernetes Environments. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.KubeEnvironment] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[KubeEnvironment]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["KubeEnvironment"], + **kwargs + ): + super(KubeEnvironmentCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class KubeEnvironmentPatchResource(ProxyOnlyResource): + """ARM resource for a KubeEnvironment when patching. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar provisioning_state: Provisioning state of the Kubernetes Environment. Possible values + include: "Succeeded", "Failed", "Canceled", "Waiting", "InitializationInProgress", + "InfrastructureSetupInProgress", "InfrastructureSetupComplete", "ScheduledForDelete", + "UpgradeRequested", "UpgradeFailed". + :vartype provisioning_state: str or + ~azure.mgmt.web.v2021_02_01.models.KubeEnvironmentProvisioningState + :ivar deployment_errors: Any errors that occurred during deployment or deployment validation. + :vartype deployment_errors: str + :param internal_load_balancer_enabled: Only visible within Vnet/Subnet. + :type internal_load_balancer_enabled: bool + :ivar default_domain: Default Domain Name for the cluster. + :vartype default_domain: str + :param static_ip: Static IP of the KubeEnvironment. + :type static_ip: str + :param arc_configuration: Cluster configuration which determines the ARC cluster + components types. Eg: Choosing between BuildService kind, + FrontEnd Service ArtifactsStorageType etc. + :type arc_configuration: ~azure.mgmt.web.v2021_02_01.models.ArcConfiguration + :param app_logs_configuration: Cluster configuration which enables the log daemon to export + app logs to a destination. Currently only "log-analytics" is + supported. + :type app_logs_configuration: ~azure.mgmt.web.v2021_02_01.models.AppLogsConfiguration + :param aks_resource_id: + :type aks_resource_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'deployment_errors': {'readonly': True}, + 'default_domain': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'deployment_errors': {'key': 'properties.deploymentErrors', 'type': 'str'}, + 'internal_load_balancer_enabled': {'key': 'properties.internalLoadBalancerEnabled', 'type': 'bool'}, + 'default_domain': {'key': 'properties.defaultDomain', 'type': 'str'}, + 'static_ip': {'key': 'properties.staticIp', 'type': 'str'}, + 'arc_configuration': {'key': 'properties.arcConfiguration', 'type': 'ArcConfiguration'}, + 'app_logs_configuration': {'key': 'properties.appLogsConfiguration', 'type': 'AppLogsConfiguration'}, + 'aks_resource_id': {'key': 'properties.aksResourceID', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + internal_load_balancer_enabled: Optional[bool] = None, + static_ip: Optional[str] = None, + arc_configuration: Optional["ArcConfiguration"] = None, + app_logs_configuration: Optional["AppLogsConfiguration"] = None, + aks_resource_id: Optional[str] = None, + **kwargs + ): + super(KubeEnvironmentPatchResource, self).__init__(kind=kind, **kwargs) + self.provisioning_state = None + self.deployment_errors = None + self.internal_load_balancer_enabled = internal_load_balancer_enabled + self.default_domain = None + self.static_ip = static_ip + self.arc_configuration = arc_configuration + self.app_logs_configuration = app_logs_configuration + self.aks_resource_id = aks_resource_id + + +class KubeEnvironmentProfile(msrest.serialization.Model): + """Specification for a Kubernetes Environment to use for this resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: Resource ID of the Kubernetes Environment. + :type id: str + :ivar name: Name of the Kubernetes Environment. + :vartype name: str + :ivar type: Resource type of the Kubernetes Environment. + :vartype type: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + **kwargs + ): + super(KubeEnvironmentProfile, self).__init__(**kwargs) + self.id = id + self.name = None + self.type = None + + +class LegacyMicrosoftAccount(msrest.serialization.Model): + """The configuration settings of the legacy Microsoft Account provider. + + :param enabled: :code:`false` if the legacy Microsoft Account provider should not + be enabled despite the set registration; otherwise, :code:`true`. + :type enabled: bool + :param registration: The configuration settings of the app registration for the legacy + Microsoft Account provider. + :type registration: ~azure.mgmt.web.v2021_02_01.models.ClientRegistration + :param login: The configuration settings of the login flow. + :type login: ~azure.mgmt.web.v2021_02_01.models.LoginScopes + :param validation: The configuration settings of the legacy Microsoft Account provider token + validation flow. + :type validation: ~azure.mgmt.web.v2021_02_01.models.AllowedAudiencesValidation + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'ClientRegistration'}, + 'login': {'key': 'login', 'type': 'LoginScopes'}, + 'validation': {'key': 'validation', 'type': 'AllowedAudiencesValidation'}, + } + + def __init__( + self, + *, + enabled: Optional[bool] = None, + registration: Optional["ClientRegistration"] = None, + login: Optional["LoginScopes"] = None, + validation: Optional["AllowedAudiencesValidation"] = None, + **kwargs + ): + super(LegacyMicrosoftAccount, self).__init__(**kwargs) + self.enabled = enabled + self.registration = registration + self.login = login + self.validation = validation + + +class LinuxJavaContainerSettings(msrest.serialization.Model): + """Linux Java Container settings. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar java11_runtime: Java 11 version (runtime only). + :vartype java11_runtime: str + :ivar java8_runtime: Java 8 version (runtime only). + :vartype java8_runtime: str + :ivar is_preview: :code:`true` if the stack is in preview; otherwise, + :code:`false`. + :vartype is_preview: bool + :ivar is_deprecated: :code:`true` if the stack is deprecated; otherwise, + :code:`false`. + :vartype is_deprecated: bool + :ivar is_hidden: :code:`true` if the stack should be hidden; otherwise, + :code:`false`. + :vartype is_hidden: bool + :ivar end_of_life_date: End-of-life date for the minor version. + :vartype end_of_life_date: ~datetime.datetime + :ivar is_auto_update: :code:`true` if the stack version is auto-updated; + otherwise, :code:`false`. + :vartype is_auto_update: bool + :ivar is_early_access: :code:`true` if the minor version is early-access; + otherwise, :code:`false`. + :vartype is_early_access: bool + """ + + _validation = { + 'java11_runtime': {'readonly': True}, + 'java8_runtime': {'readonly': True}, + 'is_preview': {'readonly': True}, + 'is_deprecated': {'readonly': True}, + 'is_hidden': {'readonly': True}, + 'end_of_life_date': {'readonly': True}, + 'is_auto_update': {'readonly': True}, + 'is_early_access': {'readonly': True}, + } + + _attribute_map = { + 'java11_runtime': {'key': 'java11Runtime', 'type': 'str'}, + 'java8_runtime': {'key': 'java8Runtime', 'type': 'str'}, + 'is_preview': {'key': 'isPreview', 'type': 'bool'}, + 'is_deprecated': {'key': 'isDeprecated', 'type': 'bool'}, + 'is_hidden': {'key': 'isHidden', 'type': 'bool'}, + 'end_of_life_date': {'key': 'endOfLifeDate', 'type': 'iso-8601'}, + 'is_auto_update': {'key': 'isAutoUpdate', 'type': 'bool'}, + 'is_early_access': {'key': 'isEarlyAccess', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(LinuxJavaContainerSettings, self).__init__(**kwargs) + self.java11_runtime = None + self.java8_runtime = None + self.is_preview = None + self.is_deprecated = None + self.is_hidden = None + self.end_of_life_date = None + self.is_auto_update = None + self.is_early_access = None + + +class LocalizableString(msrest.serialization.Model): + """Localizable string object containing the name and a localized value. + + :param value: Non-localized name. + :type value: str + :param localized_value: Localized name. + :type localized_value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[str] = None, + localized_value: Optional[str] = None, + **kwargs + ): + super(LocalizableString, self).__init__(**kwargs) + self.value = value + self.localized_value = localized_value + + +class LogAnalyticsConfiguration(msrest.serialization.Model): + """LogAnalyticsConfiguration. + + :param customer_id: + :type customer_id: str + :param shared_key: + :type shared_key: str + """ + + _attribute_map = { + 'customer_id': {'key': 'customerId', 'type': 'str'}, + 'shared_key': {'key': 'sharedKey', 'type': 'str'}, + } + + def __init__( + self, + *, + customer_id: Optional[str] = None, + shared_key: Optional[str] = None, + **kwargs + ): + super(LogAnalyticsConfiguration, self).__init__(**kwargs) + self.customer_id = customer_id + self.shared_key = shared_key + + +class Login(msrest.serialization.Model): + """The configuration settings of the login flow of users using App Service Authentication/Authorization. + + :param routes: The routes that specify the endpoints used for login and logout requests. + :type routes: ~azure.mgmt.web.v2021_02_01.models.LoginRoutes + :param token_store: The configuration settings of the token store. + :type token_store: ~azure.mgmt.web.v2021_02_01.models.TokenStore + :param preserve_url_fragments_for_logins: :code:`true` if the fragments from the + request are preserved after the login request is made; otherwise, :code:`false`. + :type preserve_url_fragments_for_logins: bool + :param allowed_external_redirect_urls: External URLs that can be redirected to as part of + logging in or logging out of the app. Note that the query string part of the URL is ignored. + This is an advanced setting typically only needed by Windows Store application backends. + Note that URLs within the current domain are always implicitly allowed. + :type allowed_external_redirect_urls: list[str] + :param cookie_expiration: The configuration settings of the session cookie's expiration. + :type cookie_expiration: ~azure.mgmt.web.v2021_02_01.models.CookieExpiration + :param nonce: The configuration settings of the nonce used in the login flow. + :type nonce: ~azure.mgmt.web.v2021_02_01.models.Nonce + """ + + _attribute_map = { + 'routes': {'key': 'routes', 'type': 'LoginRoutes'}, + 'token_store': {'key': 'tokenStore', 'type': 'TokenStore'}, + 'preserve_url_fragments_for_logins': {'key': 'preserveUrlFragmentsForLogins', 'type': 'bool'}, + 'allowed_external_redirect_urls': {'key': 'allowedExternalRedirectUrls', 'type': '[str]'}, + 'cookie_expiration': {'key': 'cookieExpiration', 'type': 'CookieExpiration'}, + 'nonce': {'key': 'nonce', 'type': 'Nonce'}, + } + + def __init__( + self, + *, + routes: Optional["LoginRoutes"] = None, + token_store: Optional["TokenStore"] = None, + preserve_url_fragments_for_logins: Optional[bool] = None, + allowed_external_redirect_urls: Optional[List[str]] = None, + cookie_expiration: Optional["CookieExpiration"] = None, + nonce: Optional["Nonce"] = None, + **kwargs + ): + super(Login, self).__init__(**kwargs) + self.routes = routes + self.token_store = token_store + self.preserve_url_fragments_for_logins = preserve_url_fragments_for_logins + self.allowed_external_redirect_urls = allowed_external_redirect_urls + self.cookie_expiration = cookie_expiration + self.nonce = nonce + + +class LoginRoutes(msrest.serialization.Model): + """The routes that specify the endpoints used for login and logout requests. + + :param logout_endpoint: The endpoint at which a logout request should be made. + :type logout_endpoint: str + """ + + _attribute_map = { + 'logout_endpoint': {'key': 'logoutEndpoint', 'type': 'str'}, + } + + def __init__( + self, + *, + logout_endpoint: Optional[str] = None, + **kwargs + ): + super(LoginRoutes, self).__init__(**kwargs) + self.logout_endpoint = logout_endpoint + + +class LoginScopes(msrest.serialization.Model): + """The configuration settings of the login flow, including the scopes that should be requested. + + :param scopes: A list of the scopes that should be requested while authenticating. + :type scopes: list[str] + """ + + _attribute_map = { + 'scopes': {'key': 'scopes', 'type': '[str]'}, + } + + def __init__( + self, + *, + scopes: Optional[List[str]] = None, + **kwargs + ): + super(LoginScopes, self).__init__(**kwargs) + self.scopes = scopes + + +class LogSpecification(msrest.serialization.Model): + """Log Definition of a single resource metric. + + :param name: + :type name: str + :param display_name: + :type display_name: str + :param blob_duration: + :type blob_duration: str + :param log_filter_pattern: + :type log_filter_pattern: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, + 'log_filter_pattern': {'key': 'logFilterPattern', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display_name: Optional[str] = None, + blob_duration: Optional[str] = None, + log_filter_pattern: Optional[str] = None, + **kwargs + ): + super(LogSpecification, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.blob_duration = blob_duration + self.log_filter_pattern = log_filter_pattern + + +class ManagedServiceIdentity(msrest.serialization.Model): + """Managed service identity. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param type: Type of managed service identity. Possible values include: "SystemAssigned", + "UserAssigned", "SystemAssigned, UserAssigned", "None". + :type type: str or ~azure.mgmt.web.v2021_02_01.models.ManagedServiceIdentityType + :ivar tenant_id: Tenant of managed service identity. + :vartype tenant_id: str + :ivar principal_id: Principal Id of managed service identity. + :vartype principal_id: str + :param user_assigned_identities: The list of user assigned identities associated with the + resource. The user identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + :type user_assigned_identities: dict[str, + ~azure.mgmt.web.v2021_02_01.models.UserAssignedIdentity] + """ + + _validation = { + 'tenant_id': {'readonly': True}, + 'principal_id': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "ManagedServiceIdentityType"]] = None, + user_assigned_identities: Optional[Dict[str, "UserAssignedIdentity"]] = None, + **kwargs + ): + super(ManagedServiceIdentity, self).__init__(**kwargs) + self.type = type + self.tenant_id = None + self.principal_id = None + self.user_assigned_identities = user_assigned_identities + + +class MetricAvailability(msrest.serialization.Model): + """Retention policy of a resource metric. + + :param time_grain: + :type time_grain: str + :param blob_duration: + :type blob_duration: str + """ + + _attribute_map = { + 'time_grain': {'key': 'timeGrain', 'type': 'str'}, + 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, + } + + def __init__( + self, + *, + time_grain: Optional[str] = None, + blob_duration: Optional[str] = None, + **kwargs + ): + super(MetricAvailability, self).__init__(**kwargs) + self.time_grain = time_grain + self.blob_duration = blob_duration + + +class MetricSpecification(msrest.serialization.Model): + """Definition of a single resource metric. + + :param name: + :type name: str + :param display_name: + :type display_name: str + :param display_description: + :type display_description: str + :param unit: + :type unit: str + :param aggregation_type: + :type aggregation_type: str + :param supports_instance_level_aggregation: + :type supports_instance_level_aggregation: bool + :param enable_regional_mdm_account: + :type enable_regional_mdm_account: bool + :param source_mdm_account: + :type source_mdm_account: str + :param source_mdm_namespace: + :type source_mdm_namespace: str + :param metric_filter_pattern: + :type metric_filter_pattern: str + :param fill_gap_with_zero: + :type fill_gap_with_zero: bool + :param is_internal: + :type is_internal: bool + :param dimensions: + :type dimensions: list[~azure.mgmt.web.v2021_02_01.models.Dimension] + :param category: + :type category: str + :param availabilities: + :type availabilities: list[~azure.mgmt.web.v2021_02_01.models.MetricAvailability] + :param supported_time_grain_types: + :type supported_time_grain_types: list[str] + :param supported_aggregation_types: + :type supported_aggregation_types: list[str] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'supports_instance_level_aggregation': {'key': 'supportsInstanceLevelAggregation', 'type': 'bool'}, + 'enable_regional_mdm_account': {'key': 'enableRegionalMdmAccount', 'type': 'bool'}, + 'source_mdm_account': {'key': 'sourceMdmAccount', 'type': 'str'}, + 'source_mdm_namespace': {'key': 'sourceMdmNamespace', 'type': 'str'}, + 'metric_filter_pattern': {'key': 'metricFilterPattern', 'type': 'str'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'is_internal': {'key': 'isInternal', 'type': 'bool'}, + 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, + 'category': {'key': 'category', 'type': 'str'}, + 'availabilities': {'key': 'availabilities', 'type': '[MetricAvailability]'}, + 'supported_time_grain_types': {'key': 'supportedTimeGrainTypes', 'type': '[str]'}, + 'supported_aggregation_types': {'key': 'supportedAggregationTypes', 'type': '[str]'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display_name: Optional[str] = None, + display_description: Optional[str] = None, + unit: Optional[str] = None, + aggregation_type: Optional[str] = None, + supports_instance_level_aggregation: Optional[bool] = None, + enable_regional_mdm_account: Optional[bool] = None, + source_mdm_account: Optional[str] = None, + source_mdm_namespace: Optional[str] = None, + metric_filter_pattern: Optional[str] = None, + fill_gap_with_zero: Optional[bool] = None, + is_internal: Optional[bool] = None, + dimensions: Optional[List["Dimension"]] = None, + category: Optional[str] = None, + availabilities: Optional[List["MetricAvailability"]] = None, + supported_time_grain_types: Optional[List[str]] = None, + supported_aggregation_types: Optional[List[str]] = None, + **kwargs + ): + super(MetricSpecification, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.display_description = display_description + self.unit = unit + self.aggregation_type = aggregation_type + self.supports_instance_level_aggregation = supports_instance_level_aggregation + self.enable_regional_mdm_account = enable_regional_mdm_account + self.source_mdm_account = source_mdm_account + self.source_mdm_namespace = source_mdm_namespace + self.metric_filter_pattern = metric_filter_pattern + self.fill_gap_with_zero = fill_gap_with_zero + self.is_internal = is_internal + self.dimensions = dimensions + self.category = category + self.availabilities = availabilities + self.supported_time_grain_types = supported_time_grain_types + self.supported_aggregation_types = supported_aggregation_types + + +class MigrateMySqlRequest(ProxyOnlyResource): + """MySQL migration request. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param connection_string: Connection string to the remote MySQL database. + :type connection_string: str + :param migration_type: The type of migration operation to be done. Possible values include: + "LocalToRemote", "RemoteToLocal". + :type migration_type: str or ~azure.mgmt.web.v2021_02_01.models.MySqlMigrationType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'connection_string': {'key': 'properties.connectionString', 'type': 'str'}, + 'migration_type': {'key': 'properties.migrationType', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + connection_string: Optional[str] = None, + migration_type: Optional[Union[str, "MySqlMigrationType"]] = None, + **kwargs + ): + super(MigrateMySqlRequest, self).__init__(kind=kind, **kwargs) + self.connection_string = connection_string + self.migration_type = migration_type + + +class MigrateMySqlStatus(ProxyOnlyResource): + """MySQL migration status. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar migration_operation_status: Status of the migration task. Possible values include: + "InProgress", "Failed", "Succeeded", "TimedOut", "Created". + :vartype migration_operation_status: str or ~azure.mgmt.web.v2021_02_01.models.OperationStatus + :ivar operation_id: Operation ID for the migration task. + :vartype operation_id: str + :ivar local_my_sql_enabled: True if the web app has in app MySql enabled. + :vartype local_my_sql_enabled: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'migration_operation_status': {'readonly': True}, + 'operation_id': {'readonly': True}, + 'local_my_sql_enabled': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'migration_operation_status': {'key': 'properties.migrationOperationStatus', 'type': 'str'}, + 'operation_id': {'key': 'properties.operationId', 'type': 'str'}, + 'local_my_sql_enabled': {'key': 'properties.localMySqlEnabled', 'type': 'bool'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(MigrateMySqlStatus, self).__init__(kind=kind, **kwargs) + self.migration_operation_status = None + self.operation_id = None + self.local_my_sql_enabled = None + + +class MSDeploy(ProxyOnlyResource): + """MSDeploy ARM PUT information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param package_uri: Package URI. + :type package_uri: str + :param connection_string: SQL Connection String. + :type connection_string: str + :param db_type: Database Type. + :type db_type: str + :param set_parameters_xml_file_uri: URI of MSDeploy Parameters file. Must not be set if + SetParameters is used. + :type set_parameters_xml_file_uri: str + :param set_parameters: MSDeploy Parameters. Must not be set if SetParametersXmlFileUri is used. + :type set_parameters: dict[str, str] + :param skip_app_data: Controls whether the MSDeploy operation skips the App_Data directory. + If set to :code:`true`, the existing App_Data directory on the destination + will not be deleted, and any App_Data directory in the source will be ignored. + Setting is :code:`false` by default. + :type skip_app_data: bool + :param app_offline: Sets the AppOffline rule while the MSDeploy operation executes. + Setting is :code:`false` by default. + :type app_offline: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'package_uri': {'key': 'properties.packageUri', 'type': 'str'}, + 'connection_string': {'key': 'properties.connectionString', 'type': 'str'}, + 'db_type': {'key': 'properties.dbType', 'type': 'str'}, + 'set_parameters_xml_file_uri': {'key': 'properties.setParametersXmlFileUri', 'type': 'str'}, + 'set_parameters': {'key': 'properties.setParameters', 'type': '{str}'}, + 'skip_app_data': {'key': 'properties.skipAppData', 'type': 'bool'}, + 'app_offline': {'key': 'properties.appOffline', 'type': 'bool'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + package_uri: Optional[str] = None, + connection_string: Optional[str] = None, + db_type: Optional[str] = None, + set_parameters_xml_file_uri: Optional[str] = None, + set_parameters: Optional[Dict[str, str]] = None, + skip_app_data: Optional[bool] = None, + app_offline: Optional[bool] = None, + **kwargs + ): + super(MSDeploy, self).__init__(kind=kind, **kwargs) + self.package_uri = package_uri + self.connection_string = connection_string + self.db_type = db_type + self.set_parameters_xml_file_uri = set_parameters_xml_file_uri + self.set_parameters = set_parameters + self.skip_app_data = skip_app_data + self.app_offline = app_offline + + +class MSDeployLog(ProxyOnlyResource): + """MSDeploy log. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar entries: List of log entry messages. + :vartype entries: list[~azure.mgmt.web.v2021_02_01.models.MSDeployLogEntry] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'entries': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'entries': {'key': 'properties.entries', 'type': '[MSDeployLogEntry]'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(MSDeployLog, self).__init__(kind=kind, **kwargs) + self.entries = None + + +class MSDeployLogEntry(msrest.serialization.Model): + """MSDeploy log entry. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar time: Timestamp of log entry. + :vartype time: ~datetime.datetime + :ivar type: Log entry type. Possible values include: "Message", "Warning", "Error". + :vartype type: str or ~azure.mgmt.web.v2021_02_01.models.MSDeployLogEntryType + :ivar message: Log entry message. + :vartype message: str + """ + + _validation = { + 'time': {'readonly': True}, + 'type': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'time': {'key': 'time', 'type': 'iso-8601'}, + 'type': {'key': 'type', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MSDeployLogEntry, self).__init__(**kwargs) + self.time = None + self.type = None + self.message = None + + +class MSDeployStatus(ProxyOnlyResource): + """MSDeploy ARM response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar deployer: Username of deployer. + :vartype deployer: str + :ivar provisioning_state: Provisioning state. Possible values include: "accepted", "running", + "succeeded", "failed", "canceled". + :vartype provisioning_state: str or + ~azure.mgmt.web.v2021_02_01.models.MSDeployProvisioningState + :ivar start_time: Start time of deploy operation. + :vartype start_time: ~datetime.datetime + :ivar end_time: End time of deploy operation. + :vartype end_time: ~datetime.datetime + :ivar complete: Whether the deployment operation has completed. + :vartype complete: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'deployer': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'complete': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'deployer': {'key': 'properties.deployer', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'complete': {'key': 'properties.complete', 'type': 'bool'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(MSDeployStatus, self).__init__(kind=kind, **kwargs) + self.deployer = None + self.provisioning_state = None + self.start_time = None + self.end_time = None + self.complete = None + + +class NameIdentifier(msrest.serialization.Model): + """Identifies an object. + + :param name: Name of the object. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + **kwargs + ): + super(NameIdentifier, self).__init__(**kwargs) + self.name = name + + +class NameIdentifierCollection(msrest.serialization.Model): + """Collection of domain name identifiers. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.NameIdentifier] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[NameIdentifier]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["NameIdentifier"], + **kwargs + ): + super(NameIdentifierCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class NameValuePair(msrest.serialization.Model): + """Name value pair. + + :param name: Pair name. + :type name: str + :param value: Pair value. + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + value: Optional[str] = None, + **kwargs + ): + super(NameValuePair, self).__init__(**kwargs) + self.name = name + self.value = value + + +class NetworkFeatures(ProxyOnlyResource): + """Full view of network features for an app (presently VNET integration and Hybrid Connections). + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar virtual_network_name: The Virtual Network name. + :vartype virtual_network_name: str + :ivar virtual_network_connection: The Virtual Network summary view. + :vartype virtual_network_connection: ~azure.mgmt.web.v2021_02_01.models.VnetInfo + :ivar hybrid_connections: The Hybrid Connections summary view. + :vartype hybrid_connections: + list[~azure.mgmt.web.v2021_02_01.models.RelayServiceConnectionEntity] + :ivar hybrid_connections_v2: The Hybrid Connection V2 (Service Bus) view. + :vartype hybrid_connections_v2: list[~azure.mgmt.web.v2021_02_01.models.HybridConnection] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'virtual_network_name': {'readonly': True}, + 'virtual_network_connection': {'readonly': True}, + 'hybrid_connections': {'readonly': True}, + 'hybrid_connections_v2': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'virtual_network_name': {'key': 'properties.virtualNetworkName', 'type': 'str'}, + 'virtual_network_connection': {'key': 'properties.virtualNetworkConnection', 'type': 'VnetInfo'}, + 'hybrid_connections': {'key': 'properties.hybridConnections', 'type': '[RelayServiceConnectionEntity]'}, + 'hybrid_connections_v2': {'key': 'properties.hybridConnectionsV2', 'type': '[HybridConnection]'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(NetworkFeatures, self).__init__(kind=kind, **kwargs) + self.virtual_network_name = None + self.virtual_network_connection = None + self.hybrid_connections = None + self.hybrid_connections_v2 = None + + +class NetworkTrace(msrest.serialization.Model): + """Network trace. + + :param path: Local file path for the captured network trace file. + :type path: str + :param status: Current status of the network trace operation, same as Operation.Status + (InProgress/Succeeded/Failed). + :type status: str + :param message: Detailed message of a network trace operation, e.g. error message in case of + failure. + :type message: str + """ + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + *, + path: Optional[str] = None, + status: Optional[str] = None, + message: Optional[str] = None, + **kwargs + ): + super(NetworkTrace, self).__init__(**kwargs) + self.path = path + self.status = status + self.message = message + + +class Nonce(msrest.serialization.Model): + """The configuration settings of the nonce used in the login flow. + + :param validate_nonce: :code:`false` if the nonce should not be validated while + completing the login flow; otherwise, :code:`true`. + :type validate_nonce: bool + :param nonce_expiration_interval: The time after the request is made when the nonce should + expire. + :type nonce_expiration_interval: str + """ + + _attribute_map = { + 'validate_nonce': {'key': 'validateNonce', 'type': 'bool'}, + 'nonce_expiration_interval': {'key': 'nonceExpirationInterval', 'type': 'str'}, + } + + def __init__( + self, + *, + validate_nonce: Optional[bool] = None, + nonce_expiration_interval: Optional[str] = None, + **kwargs + ): + super(Nonce, self).__init__(**kwargs) + self.validate_nonce = validate_nonce + self.nonce_expiration_interval = nonce_expiration_interval + + +class OpenIdConnectClientCredential(msrest.serialization.Model): + """The authentication client credentials of the custom Open ID Connect provider. + + :param method: The method that should be used to authenticate the user. The only acceptable + values to pass in are None and "ClientSecretPost". The default value is None. + :type method: str + :param client_secret_setting_name: The app setting that contains the client secret for the + custom Open ID Connect provider. + :type client_secret_setting_name: str + """ + + _attribute_map = { + 'method': {'key': 'method', 'type': 'str'}, + 'client_secret_setting_name': {'key': 'clientSecretSettingName', 'type': 'str'}, + } + + def __init__( + self, + *, + method: Optional[str] = None, + client_secret_setting_name: Optional[str] = None, + **kwargs + ): + super(OpenIdConnectClientCredential, self).__init__(**kwargs) + self.method = method + self.client_secret_setting_name = client_secret_setting_name + + +class OpenIdConnectConfig(msrest.serialization.Model): + """The configuration settings of the endpoints used for the custom Open ID Connect provider. + + :param authorization_endpoint: The endpoint to be used to make an authorization request. + :type authorization_endpoint: str + :param token_endpoint: The endpoint to be used to request a token. + :type token_endpoint: str + :param issuer: The endpoint that issues the token. + :type issuer: str + :param certification_uri: The endpoint that provides the keys necessary to validate the token. + :type certification_uri: str + :param well_known_open_id_configuration: The endpoint that contains all the configuration + endpoints for the provider. + :type well_known_open_id_configuration: str + """ + + _attribute_map = { + 'authorization_endpoint': {'key': 'authorizationEndpoint', 'type': 'str'}, + 'token_endpoint': {'key': 'tokenEndpoint', 'type': 'str'}, + 'issuer': {'key': 'issuer', 'type': 'str'}, + 'certification_uri': {'key': 'certificationUri', 'type': 'str'}, + 'well_known_open_id_configuration': {'key': 'wellKnownOpenIdConfiguration', 'type': 'str'}, + } + + def __init__( + self, + *, + authorization_endpoint: Optional[str] = None, + token_endpoint: Optional[str] = None, + issuer: Optional[str] = None, + certification_uri: Optional[str] = None, + well_known_open_id_configuration: Optional[str] = None, + **kwargs + ): + super(OpenIdConnectConfig, self).__init__(**kwargs) + self.authorization_endpoint = authorization_endpoint + self.token_endpoint = token_endpoint + self.issuer = issuer + self.certification_uri = certification_uri + self.well_known_open_id_configuration = well_known_open_id_configuration + + +class OpenIdConnectLogin(msrest.serialization.Model): + """The configuration settings of the login flow of the custom Open ID Connect provider. + + :param name_claim_type: The name of the claim that contains the users name. + :type name_claim_type: str + :param scopes: A list of the scopes that should be requested while authenticating. + :type scopes: list[str] + """ + + _attribute_map = { + 'name_claim_type': {'key': 'nameClaimType', 'type': 'str'}, + 'scopes': {'key': 'scopes', 'type': '[str]'}, + } + + def __init__( + self, + *, + name_claim_type: Optional[str] = None, + scopes: Optional[List[str]] = None, + **kwargs + ): + super(OpenIdConnectLogin, self).__init__(**kwargs) + self.name_claim_type = name_claim_type + self.scopes = scopes + + +class OpenIdConnectRegistration(msrest.serialization.Model): + """The configuration settings of the app registration for the custom Open ID Connect provider. + + :param client_id: The client id of the custom Open ID Connect provider. + :type client_id: str + :param client_credential: The authentication credentials of the custom Open ID Connect + provider. + :type client_credential: ~azure.mgmt.web.v2021_02_01.models.OpenIdConnectClientCredential + :param open_id_connect_configuration: The configuration settings of the endpoints used for the + custom Open ID Connect provider. + :type open_id_connect_configuration: ~azure.mgmt.web.v2021_02_01.models.OpenIdConnectConfig + """ + + _attribute_map = { + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'client_credential': {'key': 'clientCredential', 'type': 'OpenIdConnectClientCredential'}, + 'open_id_connect_configuration': {'key': 'openIdConnectConfiguration', 'type': 'OpenIdConnectConfig'}, + } + + def __init__( + self, + *, + client_id: Optional[str] = None, + client_credential: Optional["OpenIdConnectClientCredential"] = None, + open_id_connect_configuration: Optional["OpenIdConnectConfig"] = None, + **kwargs + ): + super(OpenIdConnectRegistration, self).__init__(**kwargs) + self.client_id = client_id + self.client_credential = client_credential + self.open_id_connect_configuration = open_id_connect_configuration + + +class Operation(msrest.serialization.Model): + """An operation on a resource. + + :param id: Operation ID. + :type id: str + :param name: Operation name. + :type name: str + :param status: The current status of the operation. Possible values include: "InProgress", + "Failed", "Succeeded", "TimedOut", "Created". + :type status: str or ~azure.mgmt.web.v2021_02_01.models.OperationStatus + :param errors: Any errors associate with the operation. + :type errors: list[~azure.mgmt.web.v2021_02_01.models.ErrorEntity] + :param created_time: Time when operation has started. + :type created_time: ~datetime.datetime + :param modified_time: Time when operation has been updated. + :type modified_time: ~datetime.datetime + :param expiration_time: Time when operation will expire. + :type expiration_time: ~datetime.datetime + :param geo_master_operation_id: Applicable only for stamp operation ids. + :type geo_master_operation_id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'errors': {'key': 'errors', 'type': '[ErrorEntity]'}, + 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, + 'modified_time': {'key': 'modifiedTime', 'type': 'iso-8601'}, + 'expiration_time': {'key': 'expirationTime', 'type': 'iso-8601'}, + 'geo_master_operation_id': {'key': 'geoMasterOperationId', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + status: Optional[Union[str, "OperationStatus"]] = None, + errors: Optional[List["ErrorEntity"]] = None, + created_time: Optional[datetime.datetime] = None, + modified_time: Optional[datetime.datetime] = None, + expiration_time: Optional[datetime.datetime] = None, + geo_master_operation_id: Optional[str] = None, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.id = id + self.name = name + self.status = status + self.errors = errors + self.created_time = created_time + self.modified_time = modified_time + self.expiration_time = expiration_time + self.geo_master_operation_id = geo_master_operation_id + + +class OutboundEnvironmentEndpoint(msrest.serialization.Model): + """Endpoints accessed for a common purpose that the App Service Environment requires outbound network access to. + + :param category: The type of service accessed by the App Service Environment, e.g., Azure + Storage, Azure SQL Database, and Azure Active Directory. + :type category: str + :param endpoints: The endpoints that the App Service Environment reaches the service at. + :type endpoints: list[~azure.mgmt.web.v2021_02_01.models.EndpointDependency] + """ + + _attribute_map = { + 'category': {'key': 'category', 'type': 'str'}, + 'endpoints': {'key': 'endpoints', 'type': '[EndpointDependency]'}, + } + + def __init__( + self, + *, + category: Optional[str] = None, + endpoints: Optional[List["EndpointDependency"]] = None, + **kwargs + ): + super(OutboundEnvironmentEndpoint, self).__init__(**kwargs) + self.category = category + self.endpoints = endpoints + + +class OutboundEnvironmentEndpointCollection(msrest.serialization.Model): + """Collection of Outbound Environment Endpoints. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.OutboundEnvironmentEndpoint] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[OutboundEnvironmentEndpoint]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["OutboundEnvironmentEndpoint"], + **kwargs + ): + super(OutboundEnvironmentEndpointCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class PerfMonCounterCollection(msrest.serialization.Model): + """Collection of performance monitor counters. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.PerfMonResponse] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PerfMonResponse]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["PerfMonResponse"], + **kwargs + ): + super(PerfMonCounterCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class PerfMonResponse(msrest.serialization.Model): + """Performance monitor API response. + + :param code: The response code. + :type code: str + :param message: The message. + :type message: str + :param data: The performance monitor counters. + :type data: ~azure.mgmt.web.v2021_02_01.models.PerfMonSet + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'data': {'key': 'data', 'type': 'PerfMonSet'}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + data: Optional["PerfMonSet"] = None, + **kwargs + ): + super(PerfMonResponse, self).__init__(**kwargs) + self.code = code + self.message = message + self.data = data + + +class PerfMonSample(msrest.serialization.Model): + """Performance monitor sample in a set. + + :param time: Point in time for which counter was measured. + :type time: ~datetime.datetime + :param instance_name: Name of the server on which the measurement is made. + :type instance_name: str + :param value: Value of counter at a certain time. + :type value: float + """ + + _attribute_map = { + 'time': {'key': 'time', 'type': 'iso-8601'}, + 'instance_name': {'key': 'instanceName', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'float'}, + } + + def __init__( + self, + *, + time: Optional[datetime.datetime] = None, + instance_name: Optional[str] = None, + value: Optional[float] = None, + **kwargs + ): + super(PerfMonSample, self).__init__(**kwargs) + self.time = time + self.instance_name = instance_name + self.value = value + + +class PerfMonSet(msrest.serialization.Model): + """Metric information. + + :param name: Unique key name of the counter. + :type name: str + :param start_time: Start time of the period. + :type start_time: ~datetime.datetime + :param end_time: End time of the period. + :type end_time: ~datetime.datetime + :param time_grain: Presented time grain. + :type time_grain: str + :param values: Collection of workers that are active during this time. + :type values: list[~azure.mgmt.web.v2021_02_01.models.PerfMonSample] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'time_grain': {'key': 'timeGrain', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[PerfMonSample]'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + time_grain: Optional[str] = None, + values: Optional[List["PerfMonSample"]] = None, + **kwargs + ): + super(PerfMonSet, self).__init__(**kwargs) + self.name = name + self.start_time = start_time + self.end_time = end_time + self.time_grain = time_grain + self.values = values + + +class PremierAddOn(Resource): + """Premier add-on. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param sku: Premier add on SKU. + :type sku: str + :param product: Premier add on Product. + :type product: str + :param vendor: Premier add on Vendor. + :type vendor: str + :param marketplace_publisher: Premier add on Marketplace publisher. + :type marketplace_publisher: str + :param marketplace_offer: Premier add on Marketplace offer. + :type marketplace_offer: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'properties.sku', 'type': 'str'}, + 'product': {'key': 'properties.product', 'type': 'str'}, + 'vendor': {'key': 'properties.vendor', 'type': 'str'}, + 'marketplace_publisher': {'key': 'properties.marketplacePublisher', 'type': 'str'}, + 'marketplace_offer': {'key': 'properties.marketplaceOffer', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + kind: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + sku: Optional[str] = None, + product: Optional[str] = None, + vendor: Optional[str] = None, + marketplace_publisher: Optional[str] = None, + marketplace_offer: Optional[str] = None, + **kwargs + ): + super(PremierAddOn, self).__init__(kind=kind, location=location, tags=tags, **kwargs) + self.sku = sku + self.product = product + self.vendor = vendor + self.marketplace_publisher = marketplace_publisher + self.marketplace_offer = marketplace_offer + + +class PremierAddOnOffer(ProxyOnlyResource): + """Premier add-on offer. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param sku: Premier add on SKU. + :type sku: str + :param product: Premier add on offer Product. + :type product: str + :param vendor: Premier add on offer Vendor. + :type vendor: str + :param promo_code_required: :code:`true` if promotion code is required; otherwise, + :code:`false`. + :type promo_code_required: bool + :param quota: Premier add on offer Quota. + :type quota: int + :param web_hosting_plan_restrictions: App Service plans this offer is restricted to. Possible + values include: "None", "Free", "Shared", "Basic", "Standard", "Premium". + :type web_hosting_plan_restrictions: str or + ~azure.mgmt.web.v2021_02_01.models.AppServicePlanRestrictions + :param privacy_policy_url: Privacy policy URL. + :type privacy_policy_url: str + :param legal_terms_url: Legal terms URL. + :type legal_terms_url: str + :param marketplace_publisher: Marketplace publisher. + :type marketplace_publisher: str + :param marketplace_offer: Marketplace offer. + :type marketplace_offer: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'sku': {'key': 'properties.sku', 'type': 'str'}, + 'product': {'key': 'properties.product', 'type': 'str'}, + 'vendor': {'key': 'properties.vendor', 'type': 'str'}, + 'promo_code_required': {'key': 'properties.promoCodeRequired', 'type': 'bool'}, + 'quota': {'key': 'properties.quota', 'type': 'int'}, + 'web_hosting_plan_restrictions': {'key': 'properties.webHostingPlanRestrictions', 'type': 'str'}, + 'privacy_policy_url': {'key': 'properties.privacyPolicyUrl', 'type': 'str'}, + 'legal_terms_url': {'key': 'properties.legalTermsUrl', 'type': 'str'}, + 'marketplace_publisher': {'key': 'properties.marketplacePublisher', 'type': 'str'}, + 'marketplace_offer': {'key': 'properties.marketplaceOffer', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + sku: Optional[str] = None, + product: Optional[str] = None, + vendor: Optional[str] = None, + promo_code_required: Optional[bool] = None, + quota: Optional[int] = None, + web_hosting_plan_restrictions: Optional[Union[str, "AppServicePlanRestrictions"]] = None, + privacy_policy_url: Optional[str] = None, + legal_terms_url: Optional[str] = None, + marketplace_publisher: Optional[str] = None, + marketplace_offer: Optional[str] = None, + **kwargs + ): + super(PremierAddOnOffer, self).__init__(kind=kind, **kwargs) + self.sku = sku + self.product = product + self.vendor = vendor + self.promo_code_required = promo_code_required + self.quota = quota + self.web_hosting_plan_restrictions = web_hosting_plan_restrictions + self.privacy_policy_url = privacy_policy_url + self.legal_terms_url = legal_terms_url + self.marketplace_publisher = marketplace_publisher + self.marketplace_offer = marketplace_offer + + +class PremierAddOnOfferCollection(msrest.serialization.Model): + """Collection of premier add-on offers. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.PremierAddOnOffer] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PremierAddOnOffer]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["PremierAddOnOffer"], + **kwargs + ): + super(PremierAddOnOfferCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class PremierAddOnPatchResource(ProxyOnlyResource): + """ARM resource for a PremierAddOn. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param sku: Premier add on SKU. + :type sku: str + :param product: Premier add on Product. + :type product: str + :param vendor: Premier add on Vendor. + :type vendor: str + :param marketplace_publisher: Premier add on Marketplace publisher. + :type marketplace_publisher: str + :param marketplace_offer: Premier add on Marketplace offer. + :type marketplace_offer: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'sku': {'key': 'properties.sku', 'type': 'str'}, + 'product': {'key': 'properties.product', 'type': 'str'}, + 'vendor': {'key': 'properties.vendor', 'type': 'str'}, + 'marketplace_publisher': {'key': 'properties.marketplacePublisher', 'type': 'str'}, + 'marketplace_offer': {'key': 'properties.marketplaceOffer', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + sku: Optional[str] = None, + product: Optional[str] = None, + vendor: Optional[str] = None, + marketplace_publisher: Optional[str] = None, + marketplace_offer: Optional[str] = None, + **kwargs + ): + super(PremierAddOnPatchResource, self).__init__(kind=kind, **kwargs) + self.sku = sku + self.product = product + self.vendor = vendor + self.marketplace_publisher = marketplace_publisher + self.marketplace_offer = marketplace_offer + + +class PrivateAccess(ProxyOnlyResource): + """Description of the parameters of Private Access for a Web Site. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param enabled: Whether private access is enabled or not. + :type enabled: bool + :param virtual_networks: The Virtual Networks (and subnets) allowed to access the site + privately. + :type virtual_networks: list[~azure.mgmt.web.v2021_02_01.models.PrivateAccessVirtualNetwork] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'virtual_networks': {'key': 'properties.virtualNetworks', 'type': '[PrivateAccessVirtualNetwork]'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + enabled: Optional[bool] = None, + virtual_networks: Optional[List["PrivateAccessVirtualNetwork"]] = None, + **kwargs + ): + super(PrivateAccess, self).__init__(kind=kind, **kwargs) + self.enabled = enabled + self.virtual_networks = virtual_networks + + +class PrivateAccessSubnet(msrest.serialization.Model): + """Description of a Virtual Network subnet that is useable for private site access. + + :param name: The name of the subnet. + :type name: str + :param key: The key (ID) of the subnet. + :type key: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'key': {'key': 'key', 'type': 'int'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + key: Optional[int] = None, + **kwargs + ): + super(PrivateAccessSubnet, self).__init__(**kwargs) + self.name = name + self.key = key + + +class PrivateAccessVirtualNetwork(msrest.serialization.Model): + """Description of a Virtual Network that is useable for private site access. + + :param name: The name of the Virtual Network. + :type name: str + :param key: The key (ID) of the Virtual Network. + :type key: int + :param resource_id: The ARM uri of the Virtual Network. + :type resource_id: str + :param subnets: A List of subnets that access is allowed to on this Virtual Network. An empty + array (but not null) is interpreted to mean that all subnets are allowed within this Virtual + Network. + :type subnets: list[~azure.mgmt.web.v2021_02_01.models.PrivateAccessSubnet] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'key': {'key': 'key', 'type': 'int'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'subnets': {'key': 'subnets', 'type': '[PrivateAccessSubnet]'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + key: Optional[int] = None, + resource_id: Optional[str] = None, + subnets: Optional[List["PrivateAccessSubnet"]] = None, + **kwargs + ): + super(PrivateAccessVirtualNetwork, self).__init__(**kwargs) + self.name = name + self.key = key + self.resource_id = resource_id + self.subnets = subnets + + +class PrivateEndpointConnectionCollection(msrest.serialization.Model): + """PrivateEndpointConnectionCollection. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: + list[~azure.mgmt.web.v2021_02_01.models.RemotePrivateEndpointConnectionARMResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[RemotePrivateEndpointConnectionARMResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["RemotePrivateEndpointConnectionARMResource"], + **kwargs + ): + super(PrivateEndpointConnectionCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class PrivateLinkConnectionApprovalRequestResource(ProxyOnlyResource): + """Private Endpoint Connection Approval ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param private_link_service_connection_state: The state of a private link connection. + :type private_link_service_connection_state: + ~azure.mgmt.web.v2021_02_01.models.PrivateLinkConnectionState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkConnectionState'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + private_link_service_connection_state: Optional["PrivateLinkConnectionState"] = None, + **kwargs + ): + super(PrivateLinkConnectionApprovalRequestResource, self).__init__(kind=kind, **kwargs) + self.private_link_service_connection_state = private_link_service_connection_state + + +class PrivateLinkConnectionState(msrest.serialization.Model): + """The state of a private link connection. + + :param status: Status of a private link connection. + :type status: str + :param description: Description of a private link connection. + :type description: str + :param actions_required: ActionsRequired for a private link connection. + :type actions_required: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + } + + def __init__( + self, + *, + status: Optional[str] = None, + description: Optional[str] = None, + actions_required: Optional[str] = None, + **kwargs + ): + super(PrivateLinkConnectionState, self).__init__(**kwargs) + self.status = status + self.description = description + self.actions_required = actions_required + + +class PrivateLinkResource(msrest.serialization.Model): + """A private link resource. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. + :type id: str + :param name: Required. Name of a private link resource. + :type name: str + :param type: Required. + :type type: str + :param properties: Required. Properties of a private link resource. + :type properties: ~azure.mgmt.web.v2021_02_01.models.PrivateLinkResourceProperties + """ + + _validation = { + 'id': {'required': True}, + 'name': {'required': True}, + 'type': {'required': True}, + 'properties': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'PrivateLinkResourceProperties'}, + } + + def __init__( + self, + *, + id: str, + name: str, + type: str, + properties: "PrivateLinkResourceProperties", + **kwargs + ): + super(PrivateLinkResource, self).__init__(**kwargs) + self.id = id + self.name = name + self.type = type + self.properties = properties + + +class PrivateLinkResourceProperties(msrest.serialization.Model): + """Properties of a private link resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar group_id: GroupId of a private link resource. + :vartype group_id: str + :ivar required_members: RequiredMembers of a private link resource. + :vartype required_members: list[str] + :ivar required_zone_names: RequiredZoneNames of a private link resource. + :vartype required_zone_names: list[str] + """ + + _validation = { + 'group_id': {'readonly': True}, + 'required_members': {'readonly': True}, + 'required_zone_names': {'readonly': True}, + } + + _attribute_map = { + 'group_id': {'key': 'groupId', 'type': 'str'}, + 'required_members': {'key': 'requiredMembers', 'type': '[str]'}, + 'required_zone_names': {'key': 'requiredZoneNames', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkResourceProperties, self).__init__(**kwargs) + self.group_id = None + self.required_members = None + self.required_zone_names = None + + +class PrivateLinkResourcesWrapper(msrest.serialization.Model): + """Wrapper for a collection of private link resources. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. + :type value: list[~azure.mgmt.web.v2021_02_01.models.PrivateLinkResource] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + } + + def __init__( + self, + *, + value: List["PrivateLinkResource"], + **kwargs + ): + super(PrivateLinkResourcesWrapper, self).__init__(**kwargs) + self.value = value + + +class ProcessInfo(ProxyOnlyResource): + """Process Information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar identifier: ARM Identifier for deployment. + :vartype identifier: int + :param deployment_name: Deployment name. + :type deployment_name: str + :param href: HRef URI. + :type href: str + :param minidump: Minidump URI. + :type minidump: str + :param is_profile_running: Is profile running?. + :type is_profile_running: bool + :param is_iis_profile_running: Is the IIS Profile running?. + :type is_iis_profile_running: bool + :param iis_profile_timeout_in_seconds: IIS Profile timeout (seconds). + :type iis_profile_timeout_in_seconds: float + :param parent: Parent process. + :type parent: str + :param children: Child process list. + :type children: list[str] + :param threads: Thread list. + :type threads: list[~azure.mgmt.web.v2021_02_01.models.ProcessThreadInfo] + :param open_file_handles: List of open files. + :type open_file_handles: list[str] + :param modules: List of modules. + :type modules: list[~azure.mgmt.web.v2021_02_01.models.ProcessModuleInfo] + :param file_name: File name of this process. + :type file_name: str + :param command_line: Command line. + :type command_line: str + :param user_name: User name. + :type user_name: str + :param handle_count: Handle count. + :type handle_count: int + :param module_count: Module count. + :type module_count: int + :param thread_count: Thread count. + :type thread_count: int + :param start_time: Start time. + :type start_time: ~datetime.datetime + :param total_cpu_time: Total CPU time. + :type total_cpu_time: str + :param user_cpu_time: User CPU time. + :type user_cpu_time: str + :param privileged_cpu_time: Privileged CPU time. + :type privileged_cpu_time: str + :param working_set: Working set. + :type working_set: long + :param peak_working_set: Peak working set. + :type peak_working_set: long + :param private_memory: Private memory size. + :type private_memory: long + :param virtual_memory: Virtual memory size. + :type virtual_memory: long + :param peak_virtual_memory: Peak virtual memory usage. + :type peak_virtual_memory: long + :param paged_system_memory: Paged system memory. + :type paged_system_memory: long + :param non_paged_system_memory: Non-paged system memory. + :type non_paged_system_memory: long + :param paged_memory: Paged memory. + :type paged_memory: long + :param peak_paged_memory: Peak paged memory. + :type peak_paged_memory: long + :param time_stamp: Time stamp. + :type time_stamp: ~datetime.datetime + :param environment_variables: List of environment variables. + :type environment_variables: dict[str, str] + :param is_scm_site: Is this the SCM site?. + :type is_scm_site: bool + :param is_webjob: Is this a Web Job?. + :type is_webjob: bool + :param description: Description of process. + :type description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'identifier': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'identifier': {'key': 'properties.identifier', 'type': 'int'}, + 'deployment_name': {'key': 'properties.deployment_name', 'type': 'str'}, + 'href': {'key': 'properties.href', 'type': 'str'}, + 'minidump': {'key': 'properties.minidump', 'type': 'str'}, + 'is_profile_running': {'key': 'properties.is_profile_running', 'type': 'bool'}, + 'is_iis_profile_running': {'key': 'properties.is_iis_profile_running', 'type': 'bool'}, + 'iis_profile_timeout_in_seconds': {'key': 'properties.iis_profile_timeout_in_seconds', 'type': 'float'}, + 'parent': {'key': 'properties.parent', 'type': 'str'}, + 'children': {'key': 'properties.children', 'type': '[str]'}, + 'threads': {'key': 'properties.threads', 'type': '[ProcessThreadInfo]'}, + 'open_file_handles': {'key': 'properties.open_file_handles', 'type': '[str]'}, + 'modules': {'key': 'properties.modules', 'type': '[ProcessModuleInfo]'}, + 'file_name': {'key': 'properties.file_name', 'type': 'str'}, + 'command_line': {'key': 'properties.command_line', 'type': 'str'}, + 'user_name': {'key': 'properties.user_name', 'type': 'str'}, + 'handle_count': {'key': 'properties.handle_count', 'type': 'int'}, + 'module_count': {'key': 'properties.module_count', 'type': 'int'}, + 'thread_count': {'key': 'properties.thread_count', 'type': 'int'}, + 'start_time': {'key': 'properties.start_time', 'type': 'iso-8601'}, + 'total_cpu_time': {'key': 'properties.total_cpu_time', 'type': 'str'}, + 'user_cpu_time': {'key': 'properties.user_cpu_time', 'type': 'str'}, + 'privileged_cpu_time': {'key': 'properties.privileged_cpu_time', 'type': 'str'}, + 'working_set': {'key': 'properties.working_set', 'type': 'long'}, + 'peak_working_set': {'key': 'properties.peak_working_set', 'type': 'long'}, + 'private_memory': {'key': 'properties.private_memory', 'type': 'long'}, + 'virtual_memory': {'key': 'properties.virtual_memory', 'type': 'long'}, + 'peak_virtual_memory': {'key': 'properties.peak_virtual_memory', 'type': 'long'}, + 'paged_system_memory': {'key': 'properties.paged_system_memory', 'type': 'long'}, + 'non_paged_system_memory': {'key': 'properties.non_paged_system_memory', 'type': 'long'}, + 'paged_memory': {'key': 'properties.paged_memory', 'type': 'long'}, + 'peak_paged_memory': {'key': 'properties.peak_paged_memory', 'type': 'long'}, + 'time_stamp': {'key': 'properties.time_stamp', 'type': 'iso-8601'}, + 'environment_variables': {'key': 'properties.environment_variables', 'type': '{str}'}, + 'is_scm_site': {'key': 'properties.is_scm_site', 'type': 'bool'}, + 'is_webjob': {'key': 'properties.is_webjob', 'type': 'bool'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + deployment_name: Optional[str] = None, + href: Optional[str] = None, + minidump: Optional[str] = None, + is_profile_running: Optional[bool] = None, + is_iis_profile_running: Optional[bool] = None, + iis_profile_timeout_in_seconds: Optional[float] = None, + parent: Optional[str] = None, + children: Optional[List[str]] = None, + threads: Optional[List["ProcessThreadInfo"]] = None, + open_file_handles: Optional[List[str]] = None, + modules: Optional[List["ProcessModuleInfo"]] = None, + file_name: Optional[str] = None, + command_line: Optional[str] = None, + user_name: Optional[str] = None, + handle_count: Optional[int] = None, + module_count: Optional[int] = None, + thread_count: Optional[int] = None, + start_time: Optional[datetime.datetime] = None, + total_cpu_time: Optional[str] = None, + user_cpu_time: Optional[str] = None, + privileged_cpu_time: Optional[str] = None, + working_set: Optional[int] = None, + peak_working_set: Optional[int] = None, + private_memory: Optional[int] = None, + virtual_memory: Optional[int] = None, + peak_virtual_memory: Optional[int] = None, + paged_system_memory: Optional[int] = None, + non_paged_system_memory: Optional[int] = None, + paged_memory: Optional[int] = None, + peak_paged_memory: Optional[int] = None, + time_stamp: Optional[datetime.datetime] = None, + environment_variables: Optional[Dict[str, str]] = None, + is_scm_site: Optional[bool] = None, + is_webjob: Optional[bool] = None, + description: Optional[str] = None, + **kwargs + ): + super(ProcessInfo, self).__init__(kind=kind, **kwargs) + self.identifier = None + self.deployment_name = deployment_name + self.href = href + self.minidump = minidump + self.is_profile_running = is_profile_running + self.is_iis_profile_running = is_iis_profile_running + self.iis_profile_timeout_in_seconds = iis_profile_timeout_in_seconds + self.parent = parent + self.children = children + self.threads = threads + self.open_file_handles = open_file_handles + self.modules = modules + self.file_name = file_name + self.command_line = command_line + self.user_name = user_name + self.handle_count = handle_count + self.module_count = module_count + self.thread_count = thread_count + self.start_time = start_time + self.total_cpu_time = total_cpu_time + self.user_cpu_time = user_cpu_time + self.privileged_cpu_time = privileged_cpu_time + self.working_set = working_set + self.peak_working_set = peak_working_set + self.private_memory = private_memory + self.virtual_memory = virtual_memory + self.peak_virtual_memory = peak_virtual_memory + self.paged_system_memory = paged_system_memory + self.non_paged_system_memory = non_paged_system_memory + self.paged_memory = paged_memory + self.peak_paged_memory = peak_paged_memory + self.time_stamp = time_stamp + self.environment_variables = environment_variables + self.is_scm_site = is_scm_site + self.is_webjob = is_webjob + self.description = description + + +class ProcessInfoCollection(msrest.serialization.Model): + """Collection of Kudu process information elements. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.ProcessInfo] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ProcessInfo]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["ProcessInfo"], + **kwargs + ): + super(ProcessInfoCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class ProcessModuleInfo(ProxyOnlyResource): + """Process Module Information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param base_address: Base address. Used as module identifier in ARM resource URI. + :type base_address: str + :param file_name: File name. + :type file_name: str + :param href: HRef URI. + :type href: str + :param file_path: File path. + :type file_path: str + :param module_memory_size: Module memory size. + :type module_memory_size: int + :param file_version: File version. + :type file_version: str + :param file_description: File description. + :type file_description: str + :param product: Product name. + :type product: str + :param product_version: Product version. + :type product_version: str + :param is_debug: Is debug?. + :type is_debug: bool + :param language: Module language (locale). + :type language: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'base_address': {'key': 'properties.base_address', 'type': 'str'}, + 'file_name': {'key': 'properties.file_name', 'type': 'str'}, + 'href': {'key': 'properties.href', 'type': 'str'}, + 'file_path': {'key': 'properties.file_path', 'type': 'str'}, + 'module_memory_size': {'key': 'properties.module_memory_size', 'type': 'int'}, + 'file_version': {'key': 'properties.file_version', 'type': 'str'}, + 'file_description': {'key': 'properties.file_description', 'type': 'str'}, + 'product': {'key': 'properties.product', 'type': 'str'}, + 'product_version': {'key': 'properties.product_version', 'type': 'str'}, + 'is_debug': {'key': 'properties.is_debug', 'type': 'bool'}, + 'language': {'key': 'properties.language', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + base_address: Optional[str] = None, + file_name: Optional[str] = None, + href: Optional[str] = None, + file_path: Optional[str] = None, + module_memory_size: Optional[int] = None, + file_version: Optional[str] = None, + file_description: Optional[str] = None, + product: Optional[str] = None, + product_version: Optional[str] = None, + is_debug: Optional[bool] = None, + language: Optional[str] = None, + **kwargs + ): + super(ProcessModuleInfo, self).__init__(kind=kind, **kwargs) + self.base_address = base_address + self.file_name = file_name + self.href = href + self.file_path = file_path + self.module_memory_size = module_memory_size + self.file_version = file_version + self.file_description = file_description + self.product = product + self.product_version = product_version + self.is_debug = is_debug + self.language = language + + +class ProcessModuleInfoCollection(msrest.serialization.Model): + """Collection of Kudu thread information elements. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.ProcessModuleInfo] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ProcessModuleInfo]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["ProcessModuleInfo"], + **kwargs + ): + super(ProcessModuleInfoCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class ProcessThreadInfo(ProxyOnlyResource): + """Process Thread Information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar identifier: Site extension ID. + :vartype identifier: int + :param href: HRef URI. + :type href: str + :param process: Process URI. + :type process: str + :param start_address: Start address. + :type start_address: str + :param current_priority: Current thread priority. + :type current_priority: int + :param priority_level: Thread priority level. + :type priority_level: str + :param base_priority: Base priority. + :type base_priority: int + :param start_time: Start time. + :type start_time: ~datetime.datetime + :param total_processor_time: Total processor time. + :type total_processor_time: str + :param user_processor_time: User processor time. + :type user_processor_time: str + :param state: Thread state. + :type state: str + :param wait_reason: Wait reason. + :type wait_reason: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'identifier': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'identifier': {'key': 'properties.identifier', 'type': 'int'}, + 'href': {'key': 'properties.href', 'type': 'str'}, + 'process': {'key': 'properties.process', 'type': 'str'}, + 'start_address': {'key': 'properties.start_address', 'type': 'str'}, + 'current_priority': {'key': 'properties.current_priority', 'type': 'int'}, + 'priority_level': {'key': 'properties.priority_level', 'type': 'str'}, + 'base_priority': {'key': 'properties.base_priority', 'type': 'int'}, + 'start_time': {'key': 'properties.start_time', 'type': 'iso-8601'}, + 'total_processor_time': {'key': 'properties.total_processor_time', 'type': 'str'}, + 'user_processor_time': {'key': 'properties.user_processor_time', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'wait_reason': {'key': 'properties.wait_reason', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + href: Optional[str] = None, + process: Optional[str] = None, + start_address: Optional[str] = None, + current_priority: Optional[int] = None, + priority_level: Optional[str] = None, + base_priority: Optional[int] = None, + start_time: Optional[datetime.datetime] = None, + total_processor_time: Optional[str] = None, + user_processor_time: Optional[str] = None, + state: Optional[str] = None, + wait_reason: Optional[str] = None, + **kwargs + ): + super(ProcessThreadInfo, self).__init__(kind=kind, **kwargs) + self.identifier = None + self.href = href + self.process = process + self.start_address = start_address + self.current_priority = current_priority + self.priority_level = priority_level + self.base_priority = base_priority + self.start_time = start_time + self.total_processor_time = total_processor_time + self.user_processor_time = user_processor_time + self.state = state + self.wait_reason = wait_reason + + +class ProcessThreadInfoCollection(msrest.serialization.Model): + """Collection of Kudu thread information elements. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.ProcessThreadInfo] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ProcessThreadInfo]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["ProcessThreadInfo"], + **kwargs + ): + super(ProcessThreadInfoCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class PublicCertificate(ProxyOnlyResource): + """Public certificate object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param blob: Public Certificate byte array. + :type blob: bytearray + :param public_certificate_location: Public Certificate Location. Possible values include: + "CurrentUserMy", "LocalMachineMy", "Unknown". + :type public_certificate_location: str or + ~azure.mgmt.web.v2021_02_01.models.PublicCertificateLocation + :ivar thumbprint: Certificate Thumbprint. + :vartype thumbprint: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'thumbprint': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'blob': {'key': 'properties.blob', 'type': 'bytearray'}, + 'public_certificate_location': {'key': 'properties.publicCertificateLocation', 'type': 'str'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + blob: Optional[bytearray] = None, + public_certificate_location: Optional[Union[str, "PublicCertificateLocation"]] = None, + **kwargs + ): + super(PublicCertificate, self).__init__(kind=kind, **kwargs) + self.blob = blob + self.public_certificate_location = public_certificate_location + self.thumbprint = None + + +class PublicCertificateCollection(msrest.serialization.Model): + """Collection of public certificates. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.PublicCertificate] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PublicCertificate]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["PublicCertificate"], + **kwargs + ): + super(PublicCertificateCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class PublishingCredentialsPoliciesCollection(msrest.serialization.Model): + """Publishing Credentials Policies entity collection ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.CsmPublishingCredentialsPoliciesEntity] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[CsmPublishingCredentialsPoliciesEntity]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["CsmPublishingCredentialsPoliciesEntity"], + **kwargs + ): + super(PublishingCredentialsPoliciesCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class PushSettings(ProxyOnlyResource): + """Push settings for the App. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param is_push_enabled: Gets or sets a flag indicating whether the Push endpoint is enabled. + :type is_push_enabled: bool + :param tag_whitelist_json: Gets or sets a JSON string containing a list of tags that are + whitelisted for use by the push registration endpoint. + :type tag_whitelist_json: str + :param tags_requiring_auth: Gets or sets a JSON string containing a list of tags that require + user authentication to be used in the push registration endpoint. + Tags can consist of alphanumeric characters and the following: + '_', '@', '#', '.', ':', '-'. + Validation should be performed at the PushRequestHandler. + :type tags_requiring_auth: str + :param dynamic_tags_json: Gets or sets a JSON string containing a list of dynamic tags that + will be evaluated from user claims in the push registration endpoint. + :type dynamic_tags_json: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'is_push_enabled': {'key': 'properties.isPushEnabled', 'type': 'bool'}, + 'tag_whitelist_json': {'key': 'properties.tagWhitelistJson', 'type': 'str'}, + 'tags_requiring_auth': {'key': 'properties.tagsRequiringAuth', 'type': 'str'}, + 'dynamic_tags_json': {'key': 'properties.dynamicTagsJson', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + is_push_enabled: Optional[bool] = None, + tag_whitelist_json: Optional[str] = None, + tags_requiring_auth: Optional[str] = None, + dynamic_tags_json: Optional[str] = None, + **kwargs + ): + super(PushSettings, self).__init__(kind=kind, **kwargs) + self.is_push_enabled = is_push_enabled + self.tag_whitelist_json = tag_whitelist_json + self.tags_requiring_auth = tags_requiring_auth + self.dynamic_tags_json = dynamic_tags_json + + +class QueryUtterancesResult(msrest.serialization.Model): + """Result for utterances query. + + :param sample_utterance: A sample utterance. + :type sample_utterance: ~azure.mgmt.web.v2021_02_01.models.SampleUtterance + :param score: Score of a sample utterance. + :type score: float + """ + + _attribute_map = { + 'sample_utterance': {'key': 'sampleUtterance', 'type': 'SampleUtterance'}, + 'score': {'key': 'score', 'type': 'float'}, + } + + def __init__( + self, + *, + sample_utterance: Optional["SampleUtterance"] = None, + score: Optional[float] = None, + **kwargs + ): + super(QueryUtterancesResult, self).__init__(**kwargs) + self.sample_utterance = sample_utterance + self.score = score + + +class QueryUtterancesResults(msrest.serialization.Model): + """Suggested utterances where the detector can be applicable. + + :param query: Search Query. + :type query: str + :param results: Array of utterance results for search query. + :type results: list[~azure.mgmt.web.v2021_02_01.models.QueryUtterancesResult] + """ + + _attribute_map = { + 'query': {'key': 'query', 'type': 'str'}, + 'results': {'key': 'results', 'type': '[QueryUtterancesResult]'}, + } + + def __init__( + self, + *, + query: Optional[str] = None, + results: Optional[List["QueryUtterancesResult"]] = None, + **kwargs + ): + super(QueryUtterancesResults, self).__init__(**kwargs) + self.query = query + self.results = results + + +class RampUpRule(msrest.serialization.Model): + """Routing rules for ramp up testing. This rule allows to redirect static traffic % to a slot or to gradually change routing % based on performance. + + :param action_host_name: Hostname of a slot to which the traffic will be redirected if decided + to. E.g. myapp-stage.azurewebsites.net. + :type action_host_name: str + :param reroute_percentage: Percentage of the traffic which will be redirected to + :code:`ActionHostName`. + :type reroute_percentage: float + :param change_step: In auto ramp up scenario this is the step to add/remove from + :code:`ReroutePercentage` until it reaches + \n:code:`MinReroutePercentage` or + :code:`MaxReroutePercentage`. Site metrics are checked every N minutes specified + in :code:`ChangeIntervalInMinutes`.\nCustom decision algorithm + can be provided in TiPCallback site extension which URL can be specified in + :code:`ChangeDecisionCallbackUrl`. + :type change_step: float + :param change_interval_in_minutes: Specifies interval in minutes to reevaluate + ReroutePercentage. + :type change_interval_in_minutes: int + :param min_reroute_percentage: Specifies lower boundary above which ReroutePercentage will + stay. + :type min_reroute_percentage: float + :param max_reroute_percentage: Specifies upper boundary below which ReroutePercentage will + stay. + :type max_reroute_percentage: float + :param change_decision_callback_url: Custom decision algorithm can be provided in TiPCallback + site extension which URL can be specified. See TiPCallback site extension for the scaffold and + contracts. + https://www.siteextensions.net/packages/TiPCallback/. + :type change_decision_callback_url: str + :param name: Name of the routing rule. The recommended name would be to point to the slot which + will receive the traffic in the experiment. + :type name: str + """ + + _attribute_map = { + 'action_host_name': {'key': 'actionHostName', 'type': 'str'}, + 'reroute_percentage': {'key': 'reroutePercentage', 'type': 'float'}, + 'change_step': {'key': 'changeStep', 'type': 'float'}, + 'change_interval_in_minutes': {'key': 'changeIntervalInMinutes', 'type': 'int'}, + 'min_reroute_percentage': {'key': 'minReroutePercentage', 'type': 'float'}, + 'max_reroute_percentage': {'key': 'maxReroutePercentage', 'type': 'float'}, + 'change_decision_callback_url': {'key': 'changeDecisionCallbackUrl', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + *, + action_host_name: Optional[str] = None, + reroute_percentage: Optional[float] = None, + change_step: Optional[float] = None, + change_interval_in_minutes: Optional[int] = None, + min_reroute_percentage: Optional[float] = None, + max_reroute_percentage: Optional[float] = None, + change_decision_callback_url: Optional[str] = None, + name: Optional[str] = None, + **kwargs + ): + super(RampUpRule, self).__init__(**kwargs) + self.action_host_name = action_host_name + self.reroute_percentage = reroute_percentage + self.change_step = change_step + self.change_interval_in_minutes = change_interval_in_minutes + self.min_reroute_percentage = min_reroute_percentage + self.max_reroute_percentage = max_reroute_percentage + self.change_decision_callback_url = change_decision_callback_url + self.name = name + + +class Recommendation(ProxyOnlyResource): + """Represents a recommendation result generated by the recommendation engine. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param creation_time: Timestamp when this instance was created. + :type creation_time: ~datetime.datetime + :param recommendation_id: A GUID value that each recommendation object is associated with. + :type recommendation_id: str + :param resource_id: Full ARM resource ID string that this recommendation object is associated + with. + :type resource_id: str + :param resource_scope: Name of a resource type this recommendation applies, e.g. Subscription, + ServerFarm, Site. Possible values include: "ServerFarm", "Subscription", "WebSite". + :type resource_scope: str or ~azure.mgmt.web.v2021_02_01.models.ResourceScopeType + :param rule_name: Unique name of the rule. + :type rule_name: str + :param display_name: UI friendly name of the rule (may not be unique). + :type display_name: str + :param message: Recommendation text. + :type message: str + :param level: Level indicating how critical this recommendation can impact. Possible values + include: "Critical", "Warning", "Information", "NonUrgentSuggestion". + :type level: str or ~azure.mgmt.web.v2021_02_01.models.NotificationLevel + :param channels: List of channels that this recommendation can apply. Possible values include: + "Notification", "Api", "Email", "Webhook", "All". + :type channels: str or ~azure.mgmt.web.v2021_02_01.models.Channels + :ivar category_tags: The list of category tags that this recommendation belongs to. + :vartype category_tags: list[str] + :param action_name: Name of action recommended by this object. + :type action_name: str + :param enabled: True if this recommendation is still valid (i.e. "actionable"). False if it is + invalid. + :type enabled: int + :param states: The list of states of this recommendation. If it's null then it should be + considered "Active". + :type states: list[str] + :param start_time: The beginning time in UTC of a range that the recommendation refers to. + :type start_time: ~datetime.datetime + :param end_time: The end time in UTC of a range that the recommendation refers to. + :type end_time: ~datetime.datetime + :param next_notification_time: When to notify this recommendation next in UTC. Null means that + this will never be notified anymore. + :type next_notification_time: ~datetime.datetime + :param notification_expiration_time: Date and time in UTC when this notification expires. + :type notification_expiration_time: ~datetime.datetime + :param notified_time: Last timestamp in UTC this instance was actually notified. Null means + that this recommendation hasn't been notified yet. + :type notified_time: ~datetime.datetime + :param score: A metric value measured by the rule. + :type score: float + :param is_dynamic: True if this is associated with a dynamically added rule. + :type is_dynamic: bool + :param extension_name: Extension name of the portal if exists. + :type extension_name: str + :param blade_name: Deep link to a blade on the portal. + :type blade_name: str + :param forward_link: Forward link to an external document associated with the rule. + :type forward_link: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'category_tags': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'recommendation_id': {'key': 'properties.recommendationId', 'type': 'str'}, + 'resource_id': {'key': 'properties.resourceId', 'type': 'str'}, + 'resource_scope': {'key': 'properties.resourceScope', 'type': 'str'}, + 'rule_name': {'key': 'properties.ruleName', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'message': {'key': 'properties.message', 'type': 'str'}, + 'level': {'key': 'properties.level', 'type': 'str'}, + 'channels': {'key': 'properties.channels', 'type': 'str'}, + 'category_tags': {'key': 'properties.categoryTags', 'type': '[str]'}, + 'action_name': {'key': 'properties.actionName', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'int'}, + 'states': {'key': 'properties.states', 'type': '[str]'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'next_notification_time': {'key': 'properties.nextNotificationTime', 'type': 'iso-8601'}, + 'notification_expiration_time': {'key': 'properties.notificationExpirationTime', 'type': 'iso-8601'}, + 'notified_time': {'key': 'properties.notifiedTime', 'type': 'iso-8601'}, + 'score': {'key': 'properties.score', 'type': 'float'}, + 'is_dynamic': {'key': 'properties.isDynamic', 'type': 'bool'}, + 'extension_name': {'key': 'properties.extensionName', 'type': 'str'}, + 'blade_name': {'key': 'properties.bladeName', 'type': 'str'}, + 'forward_link': {'key': 'properties.forwardLink', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + creation_time: Optional[datetime.datetime] = None, + recommendation_id: Optional[str] = None, + resource_id: Optional[str] = None, + resource_scope: Optional[Union[str, "ResourceScopeType"]] = None, + rule_name: Optional[str] = None, + display_name: Optional[str] = None, + message: Optional[str] = None, + level: Optional[Union[str, "NotificationLevel"]] = None, + channels: Optional[Union[str, "Channels"]] = None, + action_name: Optional[str] = None, + enabled: Optional[int] = None, + states: Optional[List[str]] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + next_notification_time: Optional[datetime.datetime] = None, + notification_expiration_time: Optional[datetime.datetime] = None, + notified_time: Optional[datetime.datetime] = None, + score: Optional[float] = None, + is_dynamic: Optional[bool] = None, + extension_name: Optional[str] = None, + blade_name: Optional[str] = None, + forward_link: Optional[str] = None, + **kwargs + ): + super(Recommendation, self).__init__(kind=kind, **kwargs) + self.creation_time = creation_time + self.recommendation_id = recommendation_id + self.resource_id = resource_id + self.resource_scope = resource_scope + self.rule_name = rule_name + self.display_name = display_name + self.message = message + self.level = level + self.channels = channels + self.category_tags = None + self.action_name = action_name + self.enabled = enabled + self.states = states + self.start_time = start_time + self.end_time = end_time + self.next_notification_time = next_notification_time + self.notification_expiration_time = notification_expiration_time + self.notified_time = notified_time + self.score = score + self.is_dynamic = is_dynamic + self.extension_name = extension_name + self.blade_name = blade_name + self.forward_link = forward_link + + +class RecommendationCollection(msrest.serialization.Model): + """Collection of recommendations. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.Recommendation] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Recommendation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["Recommendation"], + **kwargs + ): + super(RecommendationCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class RecommendationRule(ProxyOnlyResource): + """Represents a recommendation rule that the recommendation engine can perform. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param recommendation_name: Unique name of the rule. + :type recommendation_name: str + :param display_name: UI friendly name of the rule. + :type display_name: str + :param message: Localized name of the rule (Good for UI). + :type message: str + :param recommendation_id: Recommendation ID of an associated recommendation object tied to the + rule, if exists. + If such an object doesn't exist, it is set to null. + :type recommendation_id: str + :param description: Localized detailed description of the rule. + :type description: str + :param action_name: Name of action that is recommended by this rule in string. + :type action_name: str + :param level: Level of impact indicating how critical this rule is. Possible values include: + "Critical", "Warning", "Information", "NonUrgentSuggestion". + :type level: str or ~azure.mgmt.web.v2021_02_01.models.NotificationLevel + :param channels: List of available channels that this rule applies. Possible values include: + "Notification", "Api", "Email", "Webhook", "All". + :type channels: str or ~azure.mgmt.web.v2021_02_01.models.Channels + :ivar category_tags: The list of category tags that this recommendation rule belongs to. + :vartype category_tags: list[str] + :param is_dynamic: True if this is associated with a dynamically added rule. + :type is_dynamic: bool + :param extension_name: Extension name of the portal if exists. Applicable to dynamic rule only. + :type extension_name: str + :param blade_name: Deep link to a blade on the portal. Applicable to dynamic rule only. + :type blade_name: str + :param forward_link: Forward link to an external document associated with the rule. Applicable + to dynamic rule only. + :type forward_link: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'category_tags': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'recommendation_name': {'key': 'properties.recommendationName', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'message': {'key': 'properties.message', 'type': 'str'}, + 'recommendation_id': {'key': 'properties.recommendationId', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'action_name': {'key': 'properties.actionName', 'type': 'str'}, + 'level': {'key': 'properties.level', 'type': 'str'}, + 'channels': {'key': 'properties.channels', 'type': 'str'}, + 'category_tags': {'key': 'properties.categoryTags', 'type': '[str]'}, + 'is_dynamic': {'key': 'properties.isDynamic', 'type': 'bool'}, + 'extension_name': {'key': 'properties.extensionName', 'type': 'str'}, + 'blade_name': {'key': 'properties.bladeName', 'type': 'str'}, + 'forward_link': {'key': 'properties.forwardLink', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + recommendation_name: Optional[str] = None, + display_name: Optional[str] = None, + message: Optional[str] = None, + recommendation_id: Optional[str] = None, + description: Optional[str] = None, + action_name: Optional[str] = None, + level: Optional[Union[str, "NotificationLevel"]] = None, + channels: Optional[Union[str, "Channels"]] = None, + is_dynamic: Optional[bool] = None, + extension_name: Optional[str] = None, + blade_name: Optional[str] = None, + forward_link: Optional[str] = None, + **kwargs + ): + super(RecommendationRule, self).__init__(kind=kind, **kwargs) + self.recommendation_name = recommendation_name + self.display_name = display_name + self.message = message + self.recommendation_id = recommendation_id + self.description = description + self.action_name = action_name + self.level = level + self.channels = channels + self.category_tags = None + self.is_dynamic = is_dynamic + self.extension_name = extension_name + self.blade_name = blade_name + self.forward_link = forward_link + + +class ReissueCertificateOrderRequest(ProxyOnlyResource): + """Class representing certificate reissue request. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param key_size: Certificate Key Size. + :type key_size: int + :param delay_existing_revoke_in_hours: Delay in hours to revoke existing certificate after the + new certificate is issued. + :type delay_existing_revoke_in_hours: int + :param csr: Csr to be used for re-key operation. + :type csr: str + :param is_private_key_external: Should we change the ASC type (from managed private key to + external private key and vice versa). + :type is_private_key_external: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'key_size': {'key': 'properties.keySize', 'type': 'int'}, + 'delay_existing_revoke_in_hours': {'key': 'properties.delayExistingRevokeInHours', 'type': 'int'}, + 'csr': {'key': 'properties.csr', 'type': 'str'}, + 'is_private_key_external': {'key': 'properties.isPrivateKeyExternal', 'type': 'bool'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + key_size: Optional[int] = None, + delay_existing_revoke_in_hours: Optional[int] = None, + csr: Optional[str] = None, + is_private_key_external: Optional[bool] = None, + **kwargs + ): + super(ReissueCertificateOrderRequest, self).__init__(kind=kind, **kwargs) + self.key_size = key_size + self.delay_existing_revoke_in_hours = delay_existing_revoke_in_hours + self.csr = csr + self.is_private_key_external = is_private_key_external + + +class RelayServiceConnectionEntity(ProxyOnlyResource): + """Hybrid Connection for an App Service app. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param entity_name: + :type entity_name: str + :param entity_connection_string: + :type entity_connection_string: str + :param resource_type: + :type resource_type: str + :param resource_connection_string: + :type resource_connection_string: str + :param hostname: + :type hostname: str + :param port: + :type port: int + :param biztalk_uri: + :type biztalk_uri: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'entity_name': {'key': 'properties.entityName', 'type': 'str'}, + 'entity_connection_string': {'key': 'properties.entityConnectionString', 'type': 'str'}, + 'resource_type': {'key': 'properties.resourceType', 'type': 'str'}, + 'resource_connection_string': {'key': 'properties.resourceConnectionString', 'type': 'str'}, + 'hostname': {'key': 'properties.hostname', 'type': 'str'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + 'biztalk_uri': {'key': 'properties.biztalkUri', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + entity_name: Optional[str] = None, + entity_connection_string: Optional[str] = None, + resource_type: Optional[str] = None, + resource_connection_string: Optional[str] = None, + hostname: Optional[str] = None, + port: Optional[int] = None, + biztalk_uri: Optional[str] = None, + **kwargs + ): + super(RelayServiceConnectionEntity, self).__init__(kind=kind, **kwargs) + self.entity_name = entity_name + self.entity_connection_string = entity_connection_string + self.resource_type = resource_type + self.resource_connection_string = resource_connection_string + self.hostname = hostname + self.port = port + self.biztalk_uri = biztalk_uri + + +class RemotePrivateEndpointConnection(ProxyOnlyResource): + """A remote private endpoint connection. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar provisioning_state: + :vartype provisioning_state: str + :param private_endpoint: PrivateEndpoint of a remote private endpoint connection. + :type private_endpoint: ~azure.mgmt.web.v2021_02_01.models.ArmIdWrapper + :param private_link_service_connection_state: The state of a private link connection. + :type private_link_service_connection_state: + ~azure.mgmt.web.v2021_02_01.models.PrivateLinkConnectionState + :param ip_addresses: Private IPAddresses mapped to the remote private endpoint. + :type ip_addresses: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'ArmIdWrapper'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkConnectionState'}, + 'ip_addresses': {'key': 'properties.ipAddresses', 'type': '[str]'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + private_endpoint: Optional["ArmIdWrapper"] = None, + private_link_service_connection_state: Optional["PrivateLinkConnectionState"] = None, + ip_addresses: Optional[List[str]] = None, + **kwargs + ): + super(RemotePrivateEndpointConnection, self).__init__(kind=kind, **kwargs) + self.provisioning_state = None + self.private_endpoint = private_endpoint + self.private_link_service_connection_state = private_link_service_connection_state + self.ip_addresses = ip_addresses + + +class RemotePrivateEndpointConnectionARMResource(ProxyOnlyResource): + """Remote Private Endpoint Connection ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar provisioning_state: + :vartype provisioning_state: str + :param private_endpoint: PrivateEndpoint of a remote private endpoint connection. + :type private_endpoint: ~azure.mgmt.web.v2021_02_01.models.ArmIdWrapper + :param private_link_service_connection_state: The state of a private link connection. + :type private_link_service_connection_state: + ~azure.mgmt.web.v2021_02_01.models.PrivateLinkConnectionState + :param ip_addresses: Private IPAddresses mapped to the remote private endpoint. + :type ip_addresses: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'ArmIdWrapper'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkConnectionState'}, + 'ip_addresses': {'key': 'properties.ipAddresses', 'type': '[str]'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + private_endpoint: Optional["ArmIdWrapper"] = None, + private_link_service_connection_state: Optional["PrivateLinkConnectionState"] = None, + ip_addresses: Optional[List[str]] = None, + **kwargs + ): + super(RemotePrivateEndpointConnectionARMResource, self).__init__(kind=kind, **kwargs) + self.provisioning_state = None + self.private_endpoint = private_endpoint + self.private_link_service_connection_state = private_link_service_connection_state + self.ip_addresses = ip_addresses + + +class Rendering(msrest.serialization.Model): + """Instructions for rendering the data. + + :param type: Rendering Type. Possible values include: "NoGraph", "Table", "TimeSeries", + "TimeSeriesPerInstance", "PieChart", "DataSummary", "Email", "Insights", "DynamicInsight", + "Markdown", "Detector", "DropDown", "Card", "Solution", "Guage", "Form", "ChangeSets", + "ChangeAnalysisOnboarding", "ChangesView", "AppInsight", "DependencyGraph", "DownTime", + "SummaryCard", "SearchComponent", "AppInsightEnablement". + :type type: str or ~azure.mgmt.web.v2021_02_01.models.RenderingType + :param title: Title of data. + :type title: str + :param description: Description of the data that will help it be interpreted. + :type description: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'title': {'key': 'title', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "RenderingType"]] = None, + title: Optional[str] = None, + description: Optional[str] = None, + **kwargs + ): + super(Rendering, self).__init__(**kwargs) + self.type = type + self.title = title + self.description = description + + +class RenewCertificateOrderRequest(ProxyOnlyResource): + """Class representing certificate renew request. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param key_size: Certificate Key Size. + :type key_size: int + :param csr: Csr to be used for re-key operation. + :type csr: str + :param is_private_key_external: Should we change the ASC type (from managed private key to + external private key and vice versa). + :type is_private_key_external: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'key_size': {'key': 'properties.keySize', 'type': 'int'}, + 'csr': {'key': 'properties.csr', 'type': 'str'}, + 'is_private_key_external': {'key': 'properties.isPrivateKeyExternal', 'type': 'bool'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + key_size: Optional[int] = None, + csr: Optional[str] = None, + is_private_key_external: Optional[bool] = None, + **kwargs + ): + super(RenewCertificateOrderRequest, self).__init__(kind=kind, **kwargs) + self.key_size = key_size + self.csr = csr + self.is_private_key_external = is_private_key_external + + +class RequestsBasedTrigger(msrest.serialization.Model): + """Trigger based on total requests. + + :param count: Request Count. + :type count: int + :param time_interval: Time interval. + :type time_interval: str + """ + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + 'time_interval': {'key': 'timeInterval', 'type': 'str'}, + } + + def __init__( + self, + *, + count: Optional[int] = None, + time_interval: Optional[str] = None, + **kwargs + ): + super(RequestsBasedTrigger, self).__init__(**kwargs) + self.count = count + self.time_interval = time_interval + + +class ResourceCollection(msrest.serialization.Model): + """Collection of resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[str] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[str]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List[str], + **kwargs + ): + super(ResourceCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class ResourceHealthMetadata(ProxyOnlyResource): + """Used for getting ResourceHealthCheck settings. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param category: The category that the resource matches in the RHC Policy File. + :type category: str + :param signal_availability: Is there a health signal for the resource. + :type signal_availability: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'category': {'key': 'properties.category', 'type': 'str'}, + 'signal_availability': {'key': 'properties.signalAvailability', 'type': 'bool'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + category: Optional[str] = None, + signal_availability: Optional[bool] = None, + **kwargs + ): + super(ResourceHealthMetadata, self).__init__(kind=kind, **kwargs) + self.category = category + self.signal_availability = signal_availability + + +class ResourceHealthMetadataCollection(msrest.serialization.Model): + """Collection of resource health metadata. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.ResourceHealthMetadata] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ResourceHealthMetadata]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["ResourceHealthMetadata"], + **kwargs + ): + super(ResourceHealthMetadataCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class ResourceMetricAvailability(msrest.serialization.Model): + """Metrics availability and retention. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar time_grain: Time grain . + :vartype time_grain: str + :ivar retention: Retention period for the current time grain. + :vartype retention: str + """ + + _validation = { + 'time_grain': {'readonly': True}, + 'retention': {'readonly': True}, + } + + _attribute_map = { + 'time_grain': {'key': 'timeGrain', 'type': 'str'}, + 'retention': {'key': 'retention', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceMetricAvailability, self).__init__(**kwargs) + self.time_grain = None + self.retention = None + + +class ResourceMetricDefinition(ProxyOnlyResource): + """Metadata for the metrics. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar unit: Unit of the metric. + :vartype unit: str + :ivar primary_aggregation_type: Primary aggregation type. + :vartype primary_aggregation_type: str + :ivar metric_availabilities: List of time grains supported for the metric together with + retention period. + :vartype metric_availabilities: + list[~azure.mgmt.web.v2021_02_01.models.ResourceMetricAvailability] + :ivar resource_uri: Resource URI. + :vartype resource_uri: str + :ivar properties: Resource metric definition properties. + :vartype properties: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'unit': {'readonly': True}, + 'primary_aggregation_type': {'readonly': True}, + 'metric_availabilities': {'readonly': True}, + 'resource_uri': {'readonly': True}, + 'properties': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'unit': {'key': 'properties.unit', 'type': 'str'}, + 'primary_aggregation_type': {'key': 'properties.primaryAggregationType', 'type': 'str'}, + 'metric_availabilities': {'key': 'properties.metricAvailabilities', 'type': '[ResourceMetricAvailability]'}, + 'resource_uri': {'key': 'properties.resourceUri', 'type': 'str'}, + 'properties': {'key': 'properties.properties', 'type': '{str}'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(ResourceMetricDefinition, self).__init__(kind=kind, **kwargs) + self.unit = None + self.primary_aggregation_type = None + self.metric_availabilities = None + self.resource_uri = None + self.properties = None + + +class ResourceMetricDefinitionCollection(msrest.serialization.Model): + """Collection of metric definitions. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.ResourceMetricDefinition] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ResourceMetricDefinition]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["ResourceMetricDefinition"], + **kwargs + ): + super(ResourceMetricDefinitionCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class ResourceNameAvailability(msrest.serialization.Model): + """Information regarding availability of a resource name. + + :param name_available: :code:`true` indicates name is valid and available. + :code:`false` indicates the name is invalid, unavailable, or both. + :type name_available: bool + :param reason: :code:`Invalid` indicates the name provided does not match Azure + App Service naming requirements. :code:`AlreadyExists` indicates that the name is + already in use and is therefore unavailable. Possible values include: "Invalid", + "AlreadyExists". + :type reason: str or ~azure.mgmt.web.v2021_02_01.models.InAvailabilityReasonType + :param message: If reason == invalid, provide the user with the reason why the given name is + invalid, and provide the resource naming requirements so that the user can select a valid name. + If reason == AlreadyExists, explain that resource name is already in use, and direct them to + select a different name. + :type message: str + """ + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + *, + name_available: Optional[bool] = None, + reason: Optional[Union[str, "InAvailabilityReasonType"]] = None, + message: Optional[str] = None, + **kwargs + ): + super(ResourceNameAvailability, self).__init__(**kwargs) + self.name_available = name_available + self.reason = reason + self.message = message + + +class ResourceNameAvailabilityRequest(msrest.serialization.Model): + """Resource name availability request content. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Resource name to verify. + :type name: str + :param type: Required. Resource type used for verification. Possible values include: "Site", + "Slot", "HostingEnvironment", "PublishingUser", "Microsoft.Web/sites", + "Microsoft.Web/sites/slots", "Microsoft.Web/hostingEnvironments", + "Microsoft.Web/publishingUsers". + :type type: str or ~azure.mgmt.web.v2021_02_01.models.CheckNameResourceTypes + :param is_fqdn: Is fully qualified domain name. + :type is_fqdn: bool + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'is_fqdn': {'key': 'isFqdn', 'type': 'bool'}, + } + + def __init__( + self, + *, + name: str, + type: Union[str, "CheckNameResourceTypes"], + is_fqdn: Optional[bool] = None, + **kwargs + ): + super(ResourceNameAvailabilityRequest, self).__init__(**kwargs) + self.name = name + self.type = type + self.is_fqdn = is_fqdn + + +class ResponseMessageEnvelopeRemotePrivateEndpointConnection(msrest.serialization.Model): + """Message envelope that contains the common Azure resource manager properties and the resource provider specific content. + + :param id: Resource Id. Typically ID is populated only for responses to GET requests. Caller is + responsible for passing in this + value for GET requests only. + For example: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupId}/providers/Microsoft.Web/sites/{sitename}. + :type id: str + :param name: Name of resource. + :type name: str + :param type: Type of resource e.g "Microsoft.Web/sites". + :type type: str + :param location: Geographical region resource belongs to e.g. SouthCentralUS, SouthEastAsia. + :type location: str + :param tags: A set of tags. Tags associated with resource. + :type tags: dict[str, str] + :param plan: Azure resource manager plan. + :type plan: ~azure.mgmt.web.v2021_02_01.models.ArmPlan + :param properties: Resource specific properties. + :type properties: ~azure.mgmt.web.v2021_02_01.models.RemotePrivateEndpointConnection + :param sku: SKU description of the resource. + :type sku: ~azure.mgmt.web.v2021_02_01.models.SkuDescription + :param status: Azure-AsyncOperation Status info. + :type status: str + :param error: Azure-AsyncOperation Error info. + :type error: ~azure.mgmt.web.v2021_02_01.models.ErrorEntity + :param identity: MSI resource. + :type identity: ~azure.mgmt.web.v2021_02_01.models.ManagedServiceIdentity + :param zones: Logical Availability Zones the service is hosted in. + :type zones: list[str] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'plan': {'key': 'plan', 'type': 'ArmPlan'}, + 'properties': {'key': 'properties', 'type': 'RemotePrivateEndpointConnection'}, + 'sku': {'key': 'sku', 'type': 'SkuDescription'}, + 'status': {'key': 'status', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'ErrorEntity'}, + 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + type: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + plan: Optional["ArmPlan"] = None, + properties: Optional["RemotePrivateEndpointConnection"] = None, + sku: Optional["SkuDescription"] = None, + status: Optional[str] = None, + error: Optional["ErrorEntity"] = None, + identity: Optional["ManagedServiceIdentity"] = None, + zones: Optional[List[str]] = None, + **kwargs + ): + super(ResponseMessageEnvelopeRemotePrivateEndpointConnection, self).__init__(**kwargs) + self.id = id + self.name = name + self.type = type + self.location = location + self.tags = tags + self.plan = plan + self.properties = properties + self.sku = sku + self.status = status + self.error = error + self.identity = identity + self.zones = zones + + +class ResponseMetaData(msrest.serialization.Model): + """ResponseMetaData. + + :param data_source: Source of the Data. + :type data_source: ~azure.mgmt.web.v2021_02_01.models.DataSource + """ + + _attribute_map = { + 'data_source': {'key': 'dataSource', 'type': 'DataSource'}, + } + + def __init__( + self, + *, + data_source: Optional["DataSource"] = None, + **kwargs + ): + super(ResponseMetaData, self).__init__(**kwargs) + self.data_source = data_source + + +class RestoreRequest(ProxyOnlyResource): + """Description of a restore request. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param storage_account_url: SAS URL to the container. + :type storage_account_url: str + :param blob_name: Name of a blob which contains the backup. + :type blob_name: str + :param overwrite: :code:`true` if the restore operation can overwrite target app; + otherwise, :code:`false`. :code:`true` is needed if trying to restore + over an existing app. + :type overwrite: bool + :param site_name: Name of an app. + :type site_name: str + :param databases: Collection of databases which should be restored. This list has to match the + list of databases included in the backup. + :type databases: list[~azure.mgmt.web.v2021_02_01.models.DatabaseBackupSetting] + :param ignore_conflicting_host_names: Changes a logic when restoring an app with custom + domains. :code:`true` to remove custom domains automatically. If + :code:`false`, custom domains are added to + the app's object when it is being restored, but that might fail due to conflicts during the + operation. + :type ignore_conflicting_host_names: bool + :param ignore_databases: Ignore the databases and only restore the site content. + :type ignore_databases: bool + :param app_service_plan: Specify app service plan that will own restored site. + :type app_service_plan: str + :param operation_type: Operation type. Possible values include: "Default", "Clone", + "Relocation", "Snapshot", "CloudFS". Default value: "Default". + :type operation_type: str or ~azure.mgmt.web.v2021_02_01.models.BackupRestoreOperationType + :param adjust_connection_strings: :code:`true` if SiteConfig.ConnectionStrings + should be set in new app; otherwise, :code:`false`. + :type adjust_connection_strings: bool + :param hosting_environment: App Service Environment name, if needed (only when restoring an app + to an App Service Environment). + :type hosting_environment: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'storage_account_url': {'key': 'properties.storageAccountUrl', 'type': 'str'}, + 'blob_name': {'key': 'properties.blobName', 'type': 'str'}, + 'overwrite': {'key': 'properties.overwrite', 'type': 'bool'}, + 'site_name': {'key': 'properties.siteName', 'type': 'str'}, + 'databases': {'key': 'properties.databases', 'type': '[DatabaseBackupSetting]'}, + 'ignore_conflicting_host_names': {'key': 'properties.ignoreConflictingHostNames', 'type': 'bool'}, + 'ignore_databases': {'key': 'properties.ignoreDatabases', 'type': 'bool'}, + 'app_service_plan': {'key': 'properties.appServicePlan', 'type': 'str'}, + 'operation_type': {'key': 'properties.operationType', 'type': 'str'}, + 'adjust_connection_strings': {'key': 'properties.adjustConnectionStrings', 'type': 'bool'}, + 'hosting_environment': {'key': 'properties.hostingEnvironment', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + storage_account_url: Optional[str] = None, + blob_name: Optional[str] = None, + overwrite: Optional[bool] = None, + site_name: Optional[str] = None, + databases: Optional[List["DatabaseBackupSetting"]] = None, + ignore_conflicting_host_names: Optional[bool] = False, + ignore_databases: Optional[bool] = False, + app_service_plan: Optional[str] = None, + operation_type: Optional[Union[str, "BackupRestoreOperationType"]] = "Default", + adjust_connection_strings: Optional[bool] = None, + hosting_environment: Optional[str] = None, + **kwargs + ): + super(RestoreRequest, self).__init__(kind=kind, **kwargs) + self.storage_account_url = storage_account_url + self.blob_name = blob_name + self.overwrite = overwrite + self.site_name = site_name + self.databases = databases + self.ignore_conflicting_host_names = ignore_conflicting_host_names + self.ignore_databases = ignore_databases + self.app_service_plan = app_service_plan + self.operation_type = operation_type + self.adjust_connection_strings = adjust_connection_strings + self.hosting_environment = hosting_environment + + +class SampleUtterance(msrest.serialization.Model): + """Sample utterance. + + :param text: Text attribute of sample utterance. + :type text: str + :param links: Links attribute of sample utterance. + :type links: list[str] + :param qid: Question id of sample utterance (for stackoverflow questions titles). + :type qid: str + """ + + _attribute_map = { + 'text': {'key': 'text', 'type': 'str'}, + 'links': {'key': 'links', 'type': '[str]'}, + 'qid': {'key': 'qid', 'type': 'str'}, + } + + def __init__( + self, + *, + text: Optional[str] = None, + links: Optional[List[str]] = None, + qid: Optional[str] = None, + **kwargs + ): + super(SampleUtterance, self).__init__(**kwargs) + self.text = text + self.links = links + self.qid = qid + + +class ServiceSpecification(msrest.serialization.Model): + """Resource metrics service provided by Microsoft.Insights resource provider. + + :param metric_specifications: + :type metric_specifications: list[~azure.mgmt.web.v2021_02_01.models.MetricSpecification] + :param log_specifications: + :type log_specifications: list[~azure.mgmt.web.v2021_02_01.models.LogSpecification] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + 'log_specifications': {'key': 'logSpecifications', 'type': '[LogSpecification]'}, + } + + def __init__( + self, + *, + metric_specifications: Optional[List["MetricSpecification"]] = None, + log_specifications: Optional[List["LogSpecification"]] = None, + **kwargs + ): + super(ServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = metric_specifications + self.log_specifications = log_specifications + + +class Site(Resource): + """A web app, a mobile app backend, or an API app. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param identity: Managed service identity. + :type identity: ~azure.mgmt.web.v2021_02_01.models.ManagedServiceIdentity + :param extended_location: Extended Location. + :type extended_location: ~azure.mgmt.web.v2021_02_01.models.ExtendedLocation + :ivar state: Current state of the app. + :vartype state: str + :ivar host_names: Hostnames associated with the app. + :vartype host_names: list[str] + :ivar repository_site_name: Name of the repository site. + :vartype repository_site_name: str + :ivar usage_state: State indicating whether the app has exceeded its quota usage. Read-only. + Possible values include: "Normal", "Exceeded". + :vartype usage_state: str or ~azure.mgmt.web.v2021_02_01.models.UsageState + :param enabled: :code:`true` if the app is enabled; otherwise, + :code:`false`. Setting this value to false disables the app (takes the app + offline). + :type enabled: bool + :ivar enabled_host_names: Enabled hostnames for the app.Hostnames need to be assigned (see + HostNames) AND enabled. Otherwise, + the app is not served on those hostnames. + :vartype enabled_host_names: list[str] + :ivar availability_state: Management information availability state for the app. Possible + values include: "Normal", "Limited", "DisasterRecoveryMode". + :vartype availability_state: str or ~azure.mgmt.web.v2021_02_01.models.SiteAvailabilityState + :param host_name_ssl_states: Hostname SSL states are used to manage the SSL bindings for app's + hostnames. + :type host_name_ssl_states: list[~azure.mgmt.web.v2021_02_01.models.HostNameSslState] + :param server_farm_id: Resource ID of the associated App Service plan, formatted as: + "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + :type server_farm_id: str + :param reserved: :code:`true` if reserved; otherwise, :code:`false`. + :type reserved: bool + :param is_xenon: Obsolete: Hyper-V sandbox. + :type is_xenon: bool + :param hyper_v: Hyper-V sandbox. + :type hyper_v: bool + :ivar last_modified_time_utc: Last time the app was modified, in UTC. Read-only. + :vartype last_modified_time_utc: ~datetime.datetime + :param site_config: Configuration of the app. + :type site_config: ~azure.mgmt.web.v2021_02_01.models.SiteConfig + :ivar traffic_manager_host_names: Azure Traffic Manager hostnames associated with the app. + Read-only. + :vartype traffic_manager_host_names: list[str] + :param scm_site_also_stopped: :code:`true` to stop SCM (KUDU) site when the app is + stopped; otherwise, :code:`false`. The default is :code:`false`. + :type scm_site_also_stopped: bool + :ivar target_swap_slot: Specifies which deployment slot this app will swap into. Read-only. + :vartype target_swap_slot: str + :param hosting_environment_profile: App Service Environment to use for the app. + :type hosting_environment_profile: ~azure.mgmt.web.v2021_02_01.models.HostingEnvironmentProfile + :param client_affinity_enabled: :code:`true` to enable client affinity; + :code:`false` to stop sending session affinity cookies, which route client + requests in the same session to the same instance. Default is :code:`true`. + :type client_affinity_enabled: bool + :param client_cert_enabled: :code:`true` to enable client certificate + authentication (TLS mutual authentication); otherwise, :code:`false`. Default is + :code:`false`. + :type client_cert_enabled: bool + :param client_cert_mode: This composes with ClientCertEnabled setting. + + + * ClientCertEnabled: false means ClientCert is ignored. + * ClientCertEnabled: true and ClientCertMode: Required means ClientCert is required. + * ClientCertEnabled: true and ClientCertMode: Optional means ClientCert is optional or + accepted. Possible values include: "Required", "Optional", "OptionalInteractiveUser". + :type client_cert_mode: str or ~azure.mgmt.web.v2021_02_01.models.ClientCertMode + :param client_cert_exclusion_paths: client certificate authentication comma-separated exclusion + paths. + :type client_cert_exclusion_paths: str + :param host_names_disabled: :code:`true` to disable the public hostnames of the + app; otherwise, :code:`false`. + If :code:`true`, the app is only accessible via API management process. + :type host_names_disabled: bool + :param custom_domain_verification_id: Unique identifier that verifies the custom domains + assigned to the app. Customer will add this id to a txt record for verification. + :type custom_domain_verification_id: str + :ivar outbound_ip_addresses: List of IP addresses that the app uses for outbound connections + (e.g. database access). Includes VIPs from tenants that site can be hosted with current + settings. Read-only. + :vartype outbound_ip_addresses: str + :ivar possible_outbound_ip_addresses: List of IP addresses that the app uses for outbound + connections (e.g. database access). Includes VIPs from all tenants except dataComponent. + Read-only. + :vartype possible_outbound_ip_addresses: str + :param container_size: Size of the function container. + :type container_size: int + :param daily_memory_time_quota: Maximum allowed daily memory-time quota (applicable on dynamic + apps only). + :type daily_memory_time_quota: int + :ivar suspended_till: App suspended till in case memory-time quota is exceeded. + :vartype suspended_till: ~datetime.datetime + :ivar max_number_of_workers: Maximum number of workers. + This only applies to Functions container. + :vartype max_number_of_workers: int + :param cloning_info: If specified during app creation, the app is cloned from a source app. + :type cloning_info: ~azure.mgmt.web.v2021_02_01.models.CloningInfo + :ivar resource_group: Name of the resource group the app belongs to. Read-only. + :vartype resource_group: str + :ivar is_default_container: :code:`true` if the app is a default container; + otherwise, :code:`false`. + :vartype is_default_container: bool + :ivar default_host_name: Default hostname of the app. Read-only. + :vartype default_host_name: str + :ivar slot_swap_status: Status of the last deployment slot swap operation. + :vartype slot_swap_status: ~azure.mgmt.web.v2021_02_01.models.SlotSwapStatus + :param https_only: HttpsOnly: configures a web site to accept only https requests. Issues + redirect for + http requests. + :type https_only: bool + :param redundancy_mode: Site redundancy mode. Possible values include: "None", "Manual", + "Failover", "ActiveActive", "GeoRedundant". + :type redundancy_mode: str or ~azure.mgmt.web.v2021_02_01.models.RedundancyMode + :ivar in_progress_operation_id: Specifies an operation id if this site has a pending operation. + :vartype in_progress_operation_id: str + :param storage_account_required: Checks if Customer provided storage account is required. + :type storage_account_required: bool + :param key_vault_reference_identity: Identity to use for Key Vault Reference authentication. + :type key_vault_reference_identity: str + :param virtual_network_subnet_id: Azure Resource Manager ID of the Virtual network and subnet + to be joined by Regional VNET Integration. + This must be of the form + /subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + :type virtual_network_subnet_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'state': {'readonly': True}, + 'host_names': {'readonly': True}, + 'repository_site_name': {'readonly': True}, + 'usage_state': {'readonly': True}, + 'enabled_host_names': {'readonly': True}, + 'availability_state': {'readonly': True}, + 'last_modified_time_utc': {'readonly': True}, + 'traffic_manager_host_names': {'readonly': True}, + 'target_swap_slot': {'readonly': True}, + 'outbound_ip_addresses': {'readonly': True}, + 'possible_outbound_ip_addresses': {'readonly': True}, + 'suspended_till': {'readonly': True}, + 'max_number_of_workers': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'is_default_container': {'readonly': True}, + 'default_host_name': {'readonly': True}, + 'slot_swap_status': {'readonly': True}, + 'in_progress_operation_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'host_names': {'key': 'properties.hostNames', 'type': '[str]'}, + 'repository_site_name': {'key': 'properties.repositorySiteName', 'type': 'str'}, + 'usage_state': {'key': 'properties.usageState', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'enabled_host_names': {'key': 'properties.enabledHostNames', 'type': '[str]'}, + 'availability_state': {'key': 'properties.availabilityState', 'type': 'str'}, + 'host_name_ssl_states': {'key': 'properties.hostNameSslStates', 'type': '[HostNameSslState]'}, + 'server_farm_id': {'key': 'properties.serverFarmId', 'type': 'str'}, + 'reserved': {'key': 'properties.reserved', 'type': 'bool'}, + 'is_xenon': {'key': 'properties.isXenon', 'type': 'bool'}, + 'hyper_v': {'key': 'properties.hyperV', 'type': 'bool'}, + 'last_modified_time_utc': {'key': 'properties.lastModifiedTimeUtc', 'type': 'iso-8601'}, + 'site_config': {'key': 'properties.siteConfig', 'type': 'SiteConfig'}, + 'traffic_manager_host_names': {'key': 'properties.trafficManagerHostNames', 'type': '[str]'}, + 'scm_site_also_stopped': {'key': 'properties.scmSiteAlsoStopped', 'type': 'bool'}, + 'target_swap_slot': {'key': 'properties.targetSwapSlot', 'type': 'str'}, + 'hosting_environment_profile': {'key': 'properties.hostingEnvironmentProfile', 'type': 'HostingEnvironmentProfile'}, + 'client_affinity_enabled': {'key': 'properties.clientAffinityEnabled', 'type': 'bool'}, + 'client_cert_enabled': {'key': 'properties.clientCertEnabled', 'type': 'bool'}, + 'client_cert_mode': {'key': 'properties.clientCertMode', 'type': 'str'}, + 'client_cert_exclusion_paths': {'key': 'properties.clientCertExclusionPaths', 'type': 'str'}, + 'host_names_disabled': {'key': 'properties.hostNamesDisabled', 'type': 'bool'}, + 'custom_domain_verification_id': {'key': 'properties.customDomainVerificationId', 'type': 'str'}, + 'outbound_ip_addresses': {'key': 'properties.outboundIpAddresses', 'type': 'str'}, + 'possible_outbound_ip_addresses': {'key': 'properties.possibleOutboundIpAddresses', 'type': 'str'}, + 'container_size': {'key': 'properties.containerSize', 'type': 'int'}, + 'daily_memory_time_quota': {'key': 'properties.dailyMemoryTimeQuota', 'type': 'int'}, + 'suspended_till': {'key': 'properties.suspendedTill', 'type': 'iso-8601'}, + 'max_number_of_workers': {'key': 'properties.maxNumberOfWorkers', 'type': 'int'}, + 'cloning_info': {'key': 'properties.cloningInfo', 'type': 'CloningInfo'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'is_default_container': {'key': 'properties.isDefaultContainer', 'type': 'bool'}, + 'default_host_name': {'key': 'properties.defaultHostName', 'type': 'str'}, + 'slot_swap_status': {'key': 'properties.slotSwapStatus', 'type': 'SlotSwapStatus'}, + 'https_only': {'key': 'properties.httpsOnly', 'type': 'bool'}, + 'redundancy_mode': {'key': 'properties.redundancyMode', 'type': 'str'}, + 'in_progress_operation_id': {'key': 'properties.inProgressOperationId', 'type': 'str'}, + 'storage_account_required': {'key': 'properties.storageAccountRequired', 'type': 'bool'}, + 'key_vault_reference_identity': {'key': 'properties.keyVaultReferenceIdentity', 'type': 'str'}, + 'virtual_network_subnet_id': {'key': 'properties.virtualNetworkSubnetId', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + kind: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + identity: Optional["ManagedServiceIdentity"] = None, + extended_location: Optional["ExtendedLocation"] = None, + enabled: Optional[bool] = None, + host_name_ssl_states: Optional[List["HostNameSslState"]] = None, + server_farm_id: Optional[str] = None, + reserved: Optional[bool] = False, + is_xenon: Optional[bool] = False, + hyper_v: Optional[bool] = False, + site_config: Optional["SiteConfig"] = None, + scm_site_also_stopped: Optional[bool] = False, + hosting_environment_profile: Optional["HostingEnvironmentProfile"] = None, + client_affinity_enabled: Optional[bool] = None, + client_cert_enabled: Optional[bool] = None, + client_cert_mode: Optional[Union[str, "ClientCertMode"]] = None, + client_cert_exclusion_paths: Optional[str] = None, + host_names_disabled: Optional[bool] = None, + custom_domain_verification_id: Optional[str] = None, + container_size: Optional[int] = None, + daily_memory_time_quota: Optional[int] = None, + cloning_info: Optional["CloningInfo"] = None, + https_only: Optional[bool] = None, + redundancy_mode: Optional[Union[str, "RedundancyMode"]] = None, + storage_account_required: Optional[bool] = None, + key_vault_reference_identity: Optional[str] = None, + virtual_network_subnet_id: Optional[str] = None, + **kwargs + ): + super(Site, self).__init__(kind=kind, location=location, tags=tags, **kwargs) + self.identity = identity + self.extended_location = extended_location + self.state = None + self.host_names = None + self.repository_site_name = None + self.usage_state = None + self.enabled = enabled + self.enabled_host_names = None + self.availability_state = None + self.host_name_ssl_states = host_name_ssl_states + self.server_farm_id = server_farm_id + self.reserved = reserved + self.is_xenon = is_xenon + self.hyper_v = hyper_v + self.last_modified_time_utc = None + self.site_config = site_config + self.traffic_manager_host_names = None + self.scm_site_also_stopped = scm_site_also_stopped + self.target_swap_slot = None + self.hosting_environment_profile = hosting_environment_profile + self.client_affinity_enabled = client_affinity_enabled + self.client_cert_enabled = client_cert_enabled + self.client_cert_mode = client_cert_mode + self.client_cert_exclusion_paths = client_cert_exclusion_paths + self.host_names_disabled = host_names_disabled + self.custom_domain_verification_id = custom_domain_verification_id + self.outbound_ip_addresses = None + self.possible_outbound_ip_addresses = None + self.container_size = container_size + self.daily_memory_time_quota = daily_memory_time_quota + self.suspended_till = None + self.max_number_of_workers = None + self.cloning_info = cloning_info + self.resource_group = None + self.is_default_container = None + self.default_host_name = None + self.slot_swap_status = None + self.https_only = https_only + self.redundancy_mode = redundancy_mode + self.in_progress_operation_id = None + self.storage_account_required = storage_account_required + self.key_vault_reference_identity = key_vault_reference_identity + self.virtual_network_subnet_id = virtual_network_subnet_id + + +class SiteAuthSettings(ProxyOnlyResource): + """Configuration settings for the Azure App Service Authentication / Authorization feature. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param enabled: :code:`true` if the Authentication / Authorization feature is + enabled for the current app; otherwise, :code:`false`. + :type enabled: bool + :param runtime_version: The RuntimeVersion of the Authentication / Authorization feature in use + for the current app. + The setting in this value can control the behavior of certain features in the Authentication / + Authorization module. + :type runtime_version: str + :param unauthenticated_client_action: The action to take when an unauthenticated client + attempts to access the app. Possible values include: "RedirectToLoginPage", "AllowAnonymous". + :type unauthenticated_client_action: str or + ~azure.mgmt.web.v2021_02_01.models.UnauthenticatedClientAction + :param token_store_enabled: :code:`true` to durably store platform-specific + security tokens that are obtained during login flows; otherwise, :code:`false`. + The default is :code:`false`. + :type token_store_enabled: bool + :param allowed_external_redirect_urls: External URLs that can be redirected to as part of + logging in or logging out of the app. Note that the query string part of the URL is ignored. + This is an advanced setting typically only needed by Windows Store application backends. + Note that URLs within the current domain are always implicitly allowed. + :type allowed_external_redirect_urls: list[str] + :param default_provider: The default authentication provider to use when multiple providers are + configured. + This setting is only needed if multiple providers are configured and the unauthenticated + client + action is set to "RedirectToLoginPage". Possible values include: "AzureActiveDirectory", + "Facebook", "Google", "MicrosoftAccount", "Twitter", "Github". + :type default_provider: str or ~azure.mgmt.web.v2021_02_01.models.BuiltInAuthenticationProvider + :param token_refresh_extension_hours: The number of hours after session token expiration that a + session token can be used to + call the token refresh API. The default is 72 hours. + :type token_refresh_extension_hours: float + :param client_id: The Client ID of this relying party application, known as the client_id. + This setting is required for enabling OpenID Connection authentication with Azure Active + Directory or + other 3rd party OpenID Connect providers. + More information on OpenID Connect: http://openid.net/specs/openid-connect-core-1_0.html. + :type client_id: str + :param client_secret: The Client Secret of this relying party application (in Azure Active + Directory, this is also referred to as the Key). + This setting is optional. If no client secret is configured, the OpenID Connect implicit auth + flow is used to authenticate end users. + Otherwise, the OpenID Connect Authorization Code Flow is used to authenticate end users. + More information on OpenID Connect: http://openid.net/specs/openid-connect-core-1_0.html. + :type client_secret: str + :param client_secret_setting_name: The app setting name that contains the client secret of the + relying party application. + :type client_secret_setting_name: str + :param client_secret_certificate_thumbprint: An alternative to the client secret, that is the + thumbprint of a certificate used for signing purposes. This property acts as + a replacement for the Client Secret. It is also optional. + :type client_secret_certificate_thumbprint: str + :param issuer: The OpenID Connect Issuer URI that represents the entity which issues access + tokens for this application. + When using Azure Active Directory, this value is the URI of the directory tenant, e.g. + https://sts.windows.net/{tenant-guid}/. + This URI is a case-sensitive identifier for the token issuer. + More information on OpenID Connect Discovery: + http://openid.net/specs/openid-connect-discovery-1_0.html. + :type issuer: str + :param validate_issuer: Gets a value indicating whether the issuer should be a valid HTTPS url + and be validated as such. + :type validate_issuer: bool + :param allowed_audiences: Allowed audience values to consider when validating JWTs issued by + Azure Active Directory. Note that the :code:`ClientID` value is always considered + an + allowed audience, regardless of this setting. + :type allowed_audiences: list[str] + :param additional_login_params: Login parameters to send to the OpenID Connect authorization + endpoint when + a user logs in. Each parameter must be in the form "key=value". + :type additional_login_params: list[str] + :param aad_claims_authorization: Gets a JSON string containing the Azure AD Acl settings. + :type aad_claims_authorization: str + :param google_client_id: The OpenID Connect Client ID for the Google web application. + This setting is required for enabling Google Sign-In. + Google Sign-In documentation: https://developers.google.com/identity/sign-in/web/. + :type google_client_id: str + :param google_client_secret: The client secret associated with the Google web application. + This setting is required for enabling Google Sign-In. + Google Sign-In documentation: https://developers.google.com/identity/sign-in/web/. + :type google_client_secret: str + :param google_client_secret_setting_name: The app setting name that contains the client secret + associated with + the Google web application. + :type google_client_secret_setting_name: str + :param google_o_auth_scopes: The OAuth 2.0 scopes that will be requested as part of Google + Sign-In authentication. + This setting is optional. If not specified, "openid", "profile", and "email" are used as + default scopes. + Google Sign-In documentation: https://developers.google.com/identity/sign-in/web/. + :type google_o_auth_scopes: list[str] + :param facebook_app_id: The App ID of the Facebook app used for login. + This setting is required for enabling Facebook Login. + Facebook Login documentation: https://developers.facebook.com/docs/facebook-login. + :type facebook_app_id: str + :param facebook_app_secret: The App Secret of the Facebook app used for Facebook Login. + This setting is required for enabling Facebook Login. + Facebook Login documentation: https://developers.facebook.com/docs/facebook-login. + :type facebook_app_secret: str + :param facebook_app_secret_setting_name: The app setting name that contains the app secret used + for Facebook Login. + :type facebook_app_secret_setting_name: str + :param facebook_o_auth_scopes: The OAuth 2.0 scopes that will be requested as part of Facebook + Login authentication. + This setting is optional. + Facebook Login documentation: https://developers.facebook.com/docs/facebook-login. + :type facebook_o_auth_scopes: list[str] + :param git_hub_client_id: The Client Id of the GitHub app used for login. + This setting is required for enabling Github login. + :type git_hub_client_id: str + :param git_hub_client_secret: The Client Secret of the GitHub app used for Github Login. + This setting is required for enabling Github login. + :type git_hub_client_secret: str + :param git_hub_client_secret_setting_name: The app setting name that contains the client secret + of the Github + app used for GitHub Login. + :type git_hub_client_secret_setting_name: str + :param git_hub_o_auth_scopes: The OAuth 2.0 scopes that will be requested as part of GitHub + Login authentication. + This setting is optional. + :type git_hub_o_auth_scopes: list[str] + :param twitter_consumer_key: The OAuth 1.0a consumer key of the Twitter application used for + sign-in. + This setting is required for enabling Twitter Sign-In. + Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in. + :type twitter_consumer_key: str + :param twitter_consumer_secret: The OAuth 1.0a consumer secret of the Twitter application used + for sign-in. + This setting is required for enabling Twitter Sign-In. + Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in. + :type twitter_consumer_secret: str + :param twitter_consumer_secret_setting_name: The app setting name that contains the OAuth 1.0a + consumer secret of the Twitter + application used for sign-in. + :type twitter_consumer_secret_setting_name: str + :param microsoft_account_client_id: The OAuth 2.0 client ID that was created for the app used + for authentication. + This setting is required for enabling Microsoft Account authentication. + Microsoft Account OAuth documentation: https://dev.onedrive.com/auth/msa_oauth.htm. + :type microsoft_account_client_id: str + :param microsoft_account_client_secret: The OAuth 2.0 client secret that was created for the + app used for authentication. + This setting is required for enabling Microsoft Account authentication. + Microsoft Account OAuth documentation: https://dev.onedrive.com/auth/msa_oauth.htm. + :type microsoft_account_client_secret: str + :param microsoft_account_client_secret_setting_name: The app setting name containing the OAuth + 2.0 client secret that was created for the + app used for authentication. + :type microsoft_account_client_secret_setting_name: str + :param microsoft_account_o_auth_scopes: The OAuth 2.0 scopes that will be requested as part of + Microsoft Account authentication. + This setting is optional. If not specified, "wl.basic" is used as the default scope. + Microsoft Account Scopes and permissions documentation: + https://msdn.microsoft.com/en-us/library/dn631845.aspx. + :type microsoft_account_o_auth_scopes: list[str] + :param is_auth_from_file: "true" if the auth config settings should be read from a file, + "false" otherwise. + :type is_auth_from_file: str + :param auth_file_path: The path of the config file containing auth settings. + If the path is relative, base will the site's root directory. + :type auth_file_path: str + :param config_version: The ConfigVersion of the Authentication / Authorization feature in use + for the current app. + The setting in this value can control the behavior of the control plane for Authentication / + Authorization. + :type config_version: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'runtime_version': {'key': 'properties.runtimeVersion', 'type': 'str'}, + 'unauthenticated_client_action': {'key': 'properties.unauthenticatedClientAction', 'type': 'str'}, + 'token_store_enabled': {'key': 'properties.tokenStoreEnabled', 'type': 'bool'}, + 'allowed_external_redirect_urls': {'key': 'properties.allowedExternalRedirectUrls', 'type': '[str]'}, + 'default_provider': {'key': 'properties.defaultProvider', 'type': 'str'}, + 'token_refresh_extension_hours': {'key': 'properties.tokenRefreshExtensionHours', 'type': 'float'}, + 'client_id': {'key': 'properties.clientId', 'type': 'str'}, + 'client_secret': {'key': 'properties.clientSecret', 'type': 'str'}, + 'client_secret_setting_name': {'key': 'properties.clientSecretSettingName', 'type': 'str'}, + 'client_secret_certificate_thumbprint': {'key': 'properties.clientSecretCertificateThumbprint', 'type': 'str'}, + 'issuer': {'key': 'properties.issuer', 'type': 'str'}, + 'validate_issuer': {'key': 'properties.validateIssuer', 'type': 'bool'}, + 'allowed_audiences': {'key': 'properties.allowedAudiences', 'type': '[str]'}, + 'additional_login_params': {'key': 'properties.additionalLoginParams', 'type': '[str]'}, + 'aad_claims_authorization': {'key': 'properties.aadClaimsAuthorization', 'type': 'str'}, + 'google_client_id': {'key': 'properties.googleClientId', 'type': 'str'}, + 'google_client_secret': {'key': 'properties.googleClientSecret', 'type': 'str'}, + 'google_client_secret_setting_name': {'key': 'properties.googleClientSecretSettingName', 'type': 'str'}, + 'google_o_auth_scopes': {'key': 'properties.googleOAuthScopes', 'type': '[str]'}, + 'facebook_app_id': {'key': 'properties.facebookAppId', 'type': 'str'}, + 'facebook_app_secret': {'key': 'properties.facebookAppSecret', 'type': 'str'}, + 'facebook_app_secret_setting_name': {'key': 'properties.facebookAppSecretSettingName', 'type': 'str'}, + 'facebook_o_auth_scopes': {'key': 'properties.facebookOAuthScopes', 'type': '[str]'}, + 'git_hub_client_id': {'key': 'properties.gitHubClientId', 'type': 'str'}, + 'git_hub_client_secret': {'key': 'properties.gitHubClientSecret', 'type': 'str'}, + 'git_hub_client_secret_setting_name': {'key': 'properties.gitHubClientSecretSettingName', 'type': 'str'}, + 'git_hub_o_auth_scopes': {'key': 'properties.gitHubOAuthScopes', 'type': '[str]'}, + 'twitter_consumer_key': {'key': 'properties.twitterConsumerKey', 'type': 'str'}, + 'twitter_consumer_secret': {'key': 'properties.twitterConsumerSecret', 'type': 'str'}, + 'twitter_consumer_secret_setting_name': {'key': 'properties.twitterConsumerSecretSettingName', 'type': 'str'}, + 'microsoft_account_client_id': {'key': 'properties.microsoftAccountClientId', 'type': 'str'}, + 'microsoft_account_client_secret': {'key': 'properties.microsoftAccountClientSecret', 'type': 'str'}, + 'microsoft_account_client_secret_setting_name': {'key': 'properties.microsoftAccountClientSecretSettingName', 'type': 'str'}, + 'microsoft_account_o_auth_scopes': {'key': 'properties.microsoftAccountOAuthScopes', 'type': '[str]'}, + 'is_auth_from_file': {'key': 'properties.isAuthFromFile', 'type': 'str'}, + 'auth_file_path': {'key': 'properties.authFilePath', 'type': 'str'}, + 'config_version': {'key': 'properties.configVersion', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + enabled: Optional[bool] = None, + runtime_version: Optional[str] = None, + unauthenticated_client_action: Optional[Union[str, "UnauthenticatedClientAction"]] = None, + token_store_enabled: Optional[bool] = None, + allowed_external_redirect_urls: Optional[List[str]] = None, + default_provider: Optional[Union[str, "BuiltInAuthenticationProvider"]] = None, + token_refresh_extension_hours: Optional[float] = None, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + client_secret_setting_name: Optional[str] = None, + client_secret_certificate_thumbprint: Optional[str] = None, + issuer: Optional[str] = None, + validate_issuer: Optional[bool] = None, + allowed_audiences: Optional[List[str]] = None, + additional_login_params: Optional[List[str]] = None, + aad_claims_authorization: Optional[str] = None, + google_client_id: Optional[str] = None, + google_client_secret: Optional[str] = None, + google_client_secret_setting_name: Optional[str] = None, + google_o_auth_scopes: Optional[List[str]] = None, + facebook_app_id: Optional[str] = None, + facebook_app_secret: Optional[str] = None, + facebook_app_secret_setting_name: Optional[str] = None, + facebook_o_auth_scopes: Optional[List[str]] = None, + git_hub_client_id: Optional[str] = None, + git_hub_client_secret: Optional[str] = None, + git_hub_client_secret_setting_name: Optional[str] = None, + git_hub_o_auth_scopes: Optional[List[str]] = None, + twitter_consumer_key: Optional[str] = None, + twitter_consumer_secret: Optional[str] = None, + twitter_consumer_secret_setting_name: Optional[str] = None, + microsoft_account_client_id: Optional[str] = None, + microsoft_account_client_secret: Optional[str] = None, + microsoft_account_client_secret_setting_name: Optional[str] = None, + microsoft_account_o_auth_scopes: Optional[List[str]] = None, + is_auth_from_file: Optional[str] = None, + auth_file_path: Optional[str] = None, + config_version: Optional[str] = None, + **kwargs + ): + super(SiteAuthSettings, self).__init__(kind=kind, **kwargs) + self.enabled = enabled + self.runtime_version = runtime_version + self.unauthenticated_client_action = unauthenticated_client_action + self.token_store_enabled = token_store_enabled + self.allowed_external_redirect_urls = allowed_external_redirect_urls + self.default_provider = default_provider + self.token_refresh_extension_hours = token_refresh_extension_hours + self.client_id = client_id + self.client_secret = client_secret + self.client_secret_setting_name = client_secret_setting_name + self.client_secret_certificate_thumbprint = client_secret_certificate_thumbprint + self.issuer = issuer + self.validate_issuer = validate_issuer + self.allowed_audiences = allowed_audiences + self.additional_login_params = additional_login_params + self.aad_claims_authorization = aad_claims_authorization + self.google_client_id = google_client_id + self.google_client_secret = google_client_secret + self.google_client_secret_setting_name = google_client_secret_setting_name + self.google_o_auth_scopes = google_o_auth_scopes + self.facebook_app_id = facebook_app_id + self.facebook_app_secret = facebook_app_secret + self.facebook_app_secret_setting_name = facebook_app_secret_setting_name + self.facebook_o_auth_scopes = facebook_o_auth_scopes + self.git_hub_client_id = git_hub_client_id + self.git_hub_client_secret = git_hub_client_secret + self.git_hub_client_secret_setting_name = git_hub_client_secret_setting_name + self.git_hub_o_auth_scopes = git_hub_o_auth_scopes + self.twitter_consumer_key = twitter_consumer_key + self.twitter_consumer_secret = twitter_consumer_secret + self.twitter_consumer_secret_setting_name = twitter_consumer_secret_setting_name + self.microsoft_account_client_id = microsoft_account_client_id + self.microsoft_account_client_secret = microsoft_account_client_secret + self.microsoft_account_client_secret_setting_name = microsoft_account_client_secret_setting_name + self.microsoft_account_o_auth_scopes = microsoft_account_o_auth_scopes + self.is_auth_from_file = is_auth_from_file + self.auth_file_path = auth_file_path + self.config_version = config_version + + +class SiteAuthSettingsV2(ProxyOnlyResource): + """Configuration settings for the Azure App Service Authentication / Authorization V2 feature. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param platform: The configuration settings of the platform of App Service + Authentication/Authorization. + :type platform: ~azure.mgmt.web.v2021_02_01.models.AuthPlatform + :param global_validation: The configuration settings that determines the validation flow of + users using App Service Authentication/Authorization. + :type global_validation: ~azure.mgmt.web.v2021_02_01.models.GlobalValidation + :param identity_providers: The configuration settings of each of the identity providers used to + configure App Service Authentication/Authorization. + :type identity_providers: ~azure.mgmt.web.v2021_02_01.models.IdentityProviders + :param login: The configuration settings of the login flow of users using App Service + Authentication/Authorization. + :type login: ~azure.mgmt.web.v2021_02_01.models.Login + :param http_settings: The configuration settings of the HTTP requests for authentication and + authorization requests made against App Service Authentication/Authorization. + :type http_settings: ~azure.mgmt.web.v2021_02_01.models.HttpSettings + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'platform': {'key': 'properties.platform', 'type': 'AuthPlatform'}, + 'global_validation': {'key': 'properties.globalValidation', 'type': 'GlobalValidation'}, + 'identity_providers': {'key': 'properties.identityProviders', 'type': 'IdentityProviders'}, + 'login': {'key': 'properties.login', 'type': 'Login'}, + 'http_settings': {'key': 'properties.httpSettings', 'type': 'HttpSettings'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + platform: Optional["AuthPlatform"] = None, + global_validation: Optional["GlobalValidation"] = None, + identity_providers: Optional["IdentityProviders"] = None, + login: Optional["Login"] = None, + http_settings: Optional["HttpSettings"] = None, + **kwargs + ): + super(SiteAuthSettingsV2, self).__init__(kind=kind, **kwargs) + self.platform = platform + self.global_validation = global_validation + self.identity_providers = identity_providers + self.login = login + self.http_settings = http_settings + + +class SiteCloneability(msrest.serialization.Model): + """Represents whether or not an app is cloneable. + + :param result: Name of app. Possible values include: "Cloneable", "PartiallyCloneable", + "NotCloneable". + :type result: str or ~azure.mgmt.web.v2021_02_01.models.CloneAbilityResult + :param blocking_features: List of features enabled on app that prevent cloning. + :type blocking_features: list[~azure.mgmt.web.v2021_02_01.models.SiteCloneabilityCriterion] + :param unsupported_features: List of features enabled on app that are non-blocking but cannot + be cloned. The app can still be cloned + but the features in this list will not be set up on cloned app. + :type unsupported_features: list[~azure.mgmt.web.v2021_02_01.models.SiteCloneabilityCriterion] + :param blocking_characteristics: List of blocking application characteristics. + :type blocking_characteristics: + list[~azure.mgmt.web.v2021_02_01.models.SiteCloneabilityCriterion] + """ + + _attribute_map = { + 'result': {'key': 'result', 'type': 'str'}, + 'blocking_features': {'key': 'blockingFeatures', 'type': '[SiteCloneabilityCriterion]'}, + 'unsupported_features': {'key': 'unsupportedFeatures', 'type': '[SiteCloneabilityCriterion]'}, + 'blocking_characteristics': {'key': 'blockingCharacteristics', 'type': '[SiteCloneabilityCriterion]'}, + } + + def __init__( + self, + *, + result: Optional[Union[str, "CloneAbilityResult"]] = None, + blocking_features: Optional[List["SiteCloneabilityCriterion"]] = None, + unsupported_features: Optional[List["SiteCloneabilityCriterion"]] = None, + blocking_characteristics: Optional[List["SiteCloneabilityCriterion"]] = None, + **kwargs + ): + super(SiteCloneability, self).__init__(**kwargs) + self.result = result + self.blocking_features = blocking_features + self.unsupported_features = unsupported_features + self.blocking_characteristics = blocking_characteristics + + +class SiteCloneabilityCriterion(msrest.serialization.Model): + """An app cloneability criterion. + + :param name: Name of criterion. + :type name: str + :param description: Description of criterion. + :type description: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + description: Optional[str] = None, + **kwargs + ): + super(SiteCloneabilityCriterion, self).__init__(**kwargs) + self.name = name + self.description = description + + +class SiteConfig(msrest.serialization.Model): + """Configuration of an App Service app. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param number_of_workers: Number of workers. + :type number_of_workers: int + :param default_documents: Default documents. + :type default_documents: list[str] + :param net_framework_version: .NET Framework version. + :type net_framework_version: str + :param php_version: Version of PHP. + :type php_version: str + :param python_version: Version of Python. + :type python_version: str + :param node_version: Version of Node.js. + :type node_version: str + :param power_shell_version: Version of PowerShell. + :type power_shell_version: str + :param linux_fx_version: Linux App Framework and version. + :type linux_fx_version: str + :param windows_fx_version: Xenon App Framework and version. + :type windows_fx_version: str + :param request_tracing_enabled: :code:`true` if request tracing is enabled; + otherwise, :code:`false`. + :type request_tracing_enabled: bool + :param request_tracing_expiration_time: Request tracing expiration time. + :type request_tracing_expiration_time: ~datetime.datetime + :param remote_debugging_enabled: :code:`true` if remote debugging is enabled; + otherwise, :code:`false`. + :type remote_debugging_enabled: bool + :param remote_debugging_version: Remote debugging version. + :type remote_debugging_version: str + :param http_logging_enabled: :code:`true` if HTTP logging is enabled; otherwise, + :code:`false`. + :type http_logging_enabled: bool + :param acr_use_managed_identity_creds: Flag to use Managed Identity Creds for ACR pull. + :type acr_use_managed_identity_creds: bool + :param acr_user_managed_identity_id: If using user managed identity, the user managed identity + ClientId. + :type acr_user_managed_identity_id: str + :param logs_directory_size_limit: HTTP logs directory size limit. + :type logs_directory_size_limit: int + :param detailed_error_logging_enabled: :code:`true` if detailed error logging is + enabled; otherwise, :code:`false`. + :type detailed_error_logging_enabled: bool + :param publishing_username: Publishing user name. + :type publishing_username: str + :param app_settings: Application settings. + :type app_settings: list[~azure.mgmt.web.v2021_02_01.models.NameValuePair] + :param connection_strings: Connection strings. + :type connection_strings: list[~azure.mgmt.web.v2021_02_01.models.ConnStringInfo] + :ivar machine_key: Site MachineKey. + :vartype machine_key: ~azure.mgmt.web.v2021_02_01.models.SiteMachineKey + :param handler_mappings: Handler mappings. + :type handler_mappings: list[~azure.mgmt.web.v2021_02_01.models.HandlerMapping] + :param document_root: Document root. + :type document_root: str + :param scm_type: SCM type. Possible values include: "None", "Dropbox", "Tfs", "LocalGit", + "GitHub", "CodePlexGit", "CodePlexHg", "BitbucketGit", "BitbucketHg", "ExternalGit", + "ExternalHg", "OneDrive", "VSO", "VSTSRM". + :type scm_type: str or ~azure.mgmt.web.v2021_02_01.models.ScmType + :param use32_bit_worker_process: :code:`true` to use 32-bit worker process; + otherwise, :code:`false`. + :type use32_bit_worker_process: bool + :param web_sockets_enabled: :code:`true` if WebSocket is enabled; otherwise, + :code:`false`. + :type web_sockets_enabled: bool + :param always_on: :code:`true` if Always On is enabled; otherwise, + :code:`false`. + :type always_on: bool + :param java_version: Java version. + :type java_version: str + :param java_container: Java container. + :type java_container: str + :param java_container_version: Java container version. + :type java_container_version: str + :param app_command_line: App command line to launch. + :type app_command_line: str + :param managed_pipeline_mode: Managed pipeline mode. Possible values include: "Integrated", + "Classic". + :type managed_pipeline_mode: str or ~azure.mgmt.web.v2021_02_01.models.ManagedPipelineMode + :param virtual_applications: Virtual applications. + :type virtual_applications: list[~azure.mgmt.web.v2021_02_01.models.VirtualApplication] + :param load_balancing: Site load balancing. Possible values include: "WeightedRoundRobin", + "LeastRequests", "LeastResponseTime", "WeightedTotalTraffic", "RequestHash", + "PerSiteRoundRobin". + :type load_balancing: str or ~azure.mgmt.web.v2021_02_01.models.SiteLoadBalancing + :param experiments: This is work around for polymorphic types. + :type experiments: ~azure.mgmt.web.v2021_02_01.models.Experiments + :param limits: Site limits. + :type limits: ~azure.mgmt.web.v2021_02_01.models.SiteLimits + :param auto_heal_enabled: :code:`true` if Auto Heal is enabled; otherwise, + :code:`false`. + :type auto_heal_enabled: bool + :param auto_heal_rules: Auto Heal rules. + :type auto_heal_rules: ~azure.mgmt.web.v2021_02_01.models.AutoHealRules + :param tracing_options: Tracing options. + :type tracing_options: str + :param vnet_name: Virtual Network name. + :type vnet_name: str + :param vnet_route_all_enabled: Virtual Network Route All enabled. This causes all outbound + traffic to have Virtual Network Security Groups and User Defined Routes applied. + :type vnet_route_all_enabled: bool + :param vnet_private_ports_count: The number of private ports assigned to this app. These will + be assigned dynamically on runtime. + :type vnet_private_ports_count: int + :param cors: Cross-Origin Resource Sharing (CORS) settings. + :type cors: ~azure.mgmt.web.v2021_02_01.models.CorsSettings + :param push: Push endpoint settings. + :type push: ~azure.mgmt.web.v2021_02_01.models.PushSettings + :param api_definition: Information about the formal API definition for the app. + :type api_definition: ~azure.mgmt.web.v2021_02_01.models.ApiDefinitionInfo + :param api_management_config: Azure API management settings linked to the app. + :type api_management_config: ~azure.mgmt.web.v2021_02_01.models.ApiManagementConfig + :param auto_swap_slot_name: Auto-swap slot name. + :type auto_swap_slot_name: str + :param local_my_sql_enabled: :code:`true` to enable local MySQL; otherwise, + :code:`false`. + :type local_my_sql_enabled: bool + :param managed_service_identity_id: Managed Service Identity Id. + :type managed_service_identity_id: int + :param x_managed_service_identity_id: Explicit Managed Service Identity Id. + :type x_managed_service_identity_id: int + :param key_vault_reference_identity: Identity to use for Key Vault Reference authentication. + :type key_vault_reference_identity: str + :param ip_security_restrictions: IP security restrictions for main. + :type ip_security_restrictions: list[~azure.mgmt.web.v2021_02_01.models.IpSecurityRestriction] + :param scm_ip_security_restrictions: IP security restrictions for scm. + :type scm_ip_security_restrictions: + list[~azure.mgmt.web.v2021_02_01.models.IpSecurityRestriction] + :param scm_ip_security_restrictions_use_main: IP security restrictions for scm to use main. + :type scm_ip_security_restrictions_use_main: bool + :param http20_enabled: Http20Enabled: configures a web site to allow clients to connect over + http2.0. + :type http20_enabled: bool + :param min_tls_version: MinTlsVersion: configures the minimum version of TLS required for SSL + requests. Possible values include: "1.0", "1.1", "1.2". + :type min_tls_version: str or ~azure.mgmt.web.v2021_02_01.models.SupportedTlsVersions + :param scm_min_tls_version: ScmMinTlsVersion: configures the minimum version of TLS required + for SSL requests for SCM site. Possible values include: "1.0", "1.1", "1.2". + :type scm_min_tls_version: str or ~azure.mgmt.web.v2021_02_01.models.SupportedTlsVersions + :param ftps_state: State of FTP / FTPS service. Possible values include: "AllAllowed", + "FtpsOnly", "Disabled". + :type ftps_state: str or ~azure.mgmt.web.v2021_02_01.models.FtpsState + :param pre_warmed_instance_count: Number of preWarmed instances. + This setting only applies to the Consumption and Elastic Plans. + :type pre_warmed_instance_count: int + :param function_app_scale_limit: Maximum number of workers that a site can scale out to. + This setting only applies to the Consumption and Elastic Premium Plans. + :type function_app_scale_limit: int + :param health_check_path: Health check path. + :type health_check_path: str + :param functions_runtime_scale_monitoring_enabled: Gets or sets a value indicating whether + functions runtime scale monitoring is enabled. When enabled, + the ScaleController will not monitor event sources directly, but will instead call to the + runtime to get scale status. + :type functions_runtime_scale_monitoring_enabled: bool + :param website_time_zone: Sets the time zone a site uses for generating timestamps. Compatible + with Linux and Windows App Service. Setting the WEBSITE_TIME_ZONE app setting takes precedence + over this config. For Linux, expects tz database values https://www.iana.org/time-zones (for a + quick reference see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). For Windows, + expects one of the time zones listed under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows + NT\CurrentVersion\Time Zones. + :type website_time_zone: str + :param minimum_elastic_instance_count: Number of minimum instance count for a site + This setting only applies to the Elastic Plans. + :type minimum_elastic_instance_count: int + :param azure_storage_accounts: List of Azure Storage Accounts. + :type azure_storage_accounts: dict[str, + ~azure.mgmt.web.v2021_02_01.models.AzureStorageInfoValue] + :param public_network_access: Property to allow or block all public traffic. + :type public_network_access: str + """ + + _validation = { + 'machine_key': {'readonly': True}, + 'pre_warmed_instance_count': {'maximum': 10, 'minimum': 0}, + 'function_app_scale_limit': {'minimum': 0}, + 'minimum_elastic_instance_count': {'maximum': 20, 'minimum': 0}, + } + + _attribute_map = { + 'number_of_workers': {'key': 'numberOfWorkers', 'type': 'int'}, + 'default_documents': {'key': 'defaultDocuments', 'type': '[str]'}, + 'net_framework_version': {'key': 'netFrameworkVersion', 'type': 'str'}, + 'php_version': {'key': 'phpVersion', 'type': 'str'}, + 'python_version': {'key': 'pythonVersion', 'type': 'str'}, + 'node_version': {'key': 'nodeVersion', 'type': 'str'}, + 'power_shell_version': {'key': 'powerShellVersion', 'type': 'str'}, + 'linux_fx_version': {'key': 'linuxFxVersion', 'type': 'str'}, + 'windows_fx_version': {'key': 'windowsFxVersion', 'type': 'str'}, + 'request_tracing_enabled': {'key': 'requestTracingEnabled', 'type': 'bool'}, + 'request_tracing_expiration_time': {'key': 'requestTracingExpirationTime', 'type': 'iso-8601'}, + 'remote_debugging_enabled': {'key': 'remoteDebuggingEnabled', 'type': 'bool'}, + 'remote_debugging_version': {'key': 'remoteDebuggingVersion', 'type': 'str'}, + 'http_logging_enabled': {'key': 'httpLoggingEnabled', 'type': 'bool'}, + 'acr_use_managed_identity_creds': {'key': 'acrUseManagedIdentityCreds', 'type': 'bool'}, + 'acr_user_managed_identity_id': {'key': 'acrUserManagedIdentityID', 'type': 'str'}, + 'logs_directory_size_limit': {'key': 'logsDirectorySizeLimit', 'type': 'int'}, + 'detailed_error_logging_enabled': {'key': 'detailedErrorLoggingEnabled', 'type': 'bool'}, + 'publishing_username': {'key': 'publishingUsername', 'type': 'str'}, + 'app_settings': {'key': 'appSettings', 'type': '[NameValuePair]'}, + 'connection_strings': {'key': 'connectionStrings', 'type': '[ConnStringInfo]'}, + 'machine_key': {'key': 'machineKey', 'type': 'SiteMachineKey'}, + 'handler_mappings': {'key': 'handlerMappings', 'type': '[HandlerMapping]'}, + 'document_root': {'key': 'documentRoot', 'type': 'str'}, + 'scm_type': {'key': 'scmType', 'type': 'str'}, + 'use32_bit_worker_process': {'key': 'use32BitWorkerProcess', 'type': 'bool'}, + 'web_sockets_enabled': {'key': 'webSocketsEnabled', 'type': 'bool'}, + 'always_on': {'key': 'alwaysOn', 'type': 'bool'}, + 'java_version': {'key': 'javaVersion', 'type': 'str'}, + 'java_container': {'key': 'javaContainer', 'type': 'str'}, + 'java_container_version': {'key': 'javaContainerVersion', 'type': 'str'}, + 'app_command_line': {'key': 'appCommandLine', 'type': 'str'}, + 'managed_pipeline_mode': {'key': 'managedPipelineMode', 'type': 'str'}, + 'virtual_applications': {'key': 'virtualApplications', 'type': '[VirtualApplication]'}, + 'load_balancing': {'key': 'loadBalancing', 'type': 'str'}, + 'experiments': {'key': 'experiments', 'type': 'Experiments'}, + 'limits': {'key': 'limits', 'type': 'SiteLimits'}, + 'auto_heal_enabled': {'key': 'autoHealEnabled', 'type': 'bool'}, + 'auto_heal_rules': {'key': 'autoHealRules', 'type': 'AutoHealRules'}, + 'tracing_options': {'key': 'tracingOptions', 'type': 'str'}, + 'vnet_name': {'key': 'vnetName', 'type': 'str'}, + 'vnet_route_all_enabled': {'key': 'vnetRouteAllEnabled', 'type': 'bool'}, + 'vnet_private_ports_count': {'key': 'vnetPrivatePortsCount', 'type': 'int'}, + 'cors': {'key': 'cors', 'type': 'CorsSettings'}, + 'push': {'key': 'push', 'type': 'PushSettings'}, + 'api_definition': {'key': 'apiDefinition', 'type': 'ApiDefinitionInfo'}, + 'api_management_config': {'key': 'apiManagementConfig', 'type': 'ApiManagementConfig'}, + 'auto_swap_slot_name': {'key': 'autoSwapSlotName', 'type': 'str'}, + 'local_my_sql_enabled': {'key': 'localMySqlEnabled', 'type': 'bool'}, + 'managed_service_identity_id': {'key': 'managedServiceIdentityId', 'type': 'int'}, + 'x_managed_service_identity_id': {'key': 'xManagedServiceIdentityId', 'type': 'int'}, + 'key_vault_reference_identity': {'key': 'keyVaultReferenceIdentity', 'type': 'str'}, + 'ip_security_restrictions': {'key': 'ipSecurityRestrictions', 'type': '[IpSecurityRestriction]'}, + 'scm_ip_security_restrictions': {'key': 'scmIpSecurityRestrictions', 'type': '[IpSecurityRestriction]'}, + 'scm_ip_security_restrictions_use_main': {'key': 'scmIpSecurityRestrictionsUseMain', 'type': 'bool'}, + 'http20_enabled': {'key': 'http20Enabled', 'type': 'bool'}, + 'min_tls_version': {'key': 'minTlsVersion', 'type': 'str'}, + 'scm_min_tls_version': {'key': 'scmMinTlsVersion', 'type': 'str'}, + 'ftps_state': {'key': 'ftpsState', 'type': 'str'}, + 'pre_warmed_instance_count': {'key': 'preWarmedInstanceCount', 'type': 'int'}, + 'function_app_scale_limit': {'key': 'functionAppScaleLimit', 'type': 'int'}, + 'health_check_path': {'key': 'healthCheckPath', 'type': 'str'}, + 'functions_runtime_scale_monitoring_enabled': {'key': 'functionsRuntimeScaleMonitoringEnabled', 'type': 'bool'}, + 'website_time_zone': {'key': 'websiteTimeZone', 'type': 'str'}, + 'minimum_elastic_instance_count': {'key': 'minimumElasticInstanceCount', 'type': 'int'}, + 'azure_storage_accounts': {'key': 'azureStorageAccounts', 'type': '{AzureStorageInfoValue}'}, + 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, + } + + def __init__( + self, + *, + number_of_workers: Optional[int] = None, + default_documents: Optional[List[str]] = None, + net_framework_version: Optional[str] = "v4.6", + php_version: Optional[str] = None, + python_version: Optional[str] = None, + node_version: Optional[str] = None, + power_shell_version: Optional[str] = None, + linux_fx_version: Optional[str] = None, + windows_fx_version: Optional[str] = None, + request_tracing_enabled: Optional[bool] = None, + request_tracing_expiration_time: Optional[datetime.datetime] = None, + remote_debugging_enabled: Optional[bool] = None, + remote_debugging_version: Optional[str] = None, + http_logging_enabled: Optional[bool] = None, + acr_use_managed_identity_creds: Optional[bool] = None, + acr_user_managed_identity_id: Optional[str] = None, + logs_directory_size_limit: Optional[int] = None, + detailed_error_logging_enabled: Optional[bool] = None, + publishing_username: Optional[str] = None, + app_settings: Optional[List["NameValuePair"]] = None, + connection_strings: Optional[List["ConnStringInfo"]] = None, + handler_mappings: Optional[List["HandlerMapping"]] = None, + document_root: Optional[str] = None, + scm_type: Optional[Union[str, "ScmType"]] = None, + use32_bit_worker_process: Optional[bool] = None, + web_sockets_enabled: Optional[bool] = None, + always_on: Optional[bool] = None, + java_version: Optional[str] = None, + java_container: Optional[str] = None, + java_container_version: Optional[str] = None, + app_command_line: Optional[str] = None, + managed_pipeline_mode: Optional[Union[str, "ManagedPipelineMode"]] = None, + virtual_applications: Optional[List["VirtualApplication"]] = None, + load_balancing: Optional[Union[str, "SiteLoadBalancing"]] = None, + experiments: Optional["Experiments"] = None, + limits: Optional["SiteLimits"] = None, + auto_heal_enabled: Optional[bool] = None, + auto_heal_rules: Optional["AutoHealRules"] = None, + tracing_options: Optional[str] = None, + vnet_name: Optional[str] = None, + vnet_route_all_enabled: Optional[bool] = None, + vnet_private_ports_count: Optional[int] = None, + cors: Optional["CorsSettings"] = None, + push: Optional["PushSettings"] = None, + api_definition: Optional["ApiDefinitionInfo"] = None, + api_management_config: Optional["ApiManagementConfig"] = None, + auto_swap_slot_name: Optional[str] = None, + local_my_sql_enabled: Optional[bool] = False, + managed_service_identity_id: Optional[int] = None, + x_managed_service_identity_id: Optional[int] = None, + key_vault_reference_identity: Optional[str] = None, + ip_security_restrictions: Optional[List["IpSecurityRestriction"]] = None, + scm_ip_security_restrictions: Optional[List["IpSecurityRestriction"]] = None, + scm_ip_security_restrictions_use_main: Optional[bool] = None, + http20_enabled: Optional[bool] = True, + min_tls_version: Optional[Union[str, "SupportedTlsVersions"]] = None, + scm_min_tls_version: Optional[Union[str, "SupportedTlsVersions"]] = None, + ftps_state: Optional[Union[str, "FtpsState"]] = None, + pre_warmed_instance_count: Optional[int] = None, + function_app_scale_limit: Optional[int] = None, + health_check_path: Optional[str] = None, + functions_runtime_scale_monitoring_enabled: Optional[bool] = None, + website_time_zone: Optional[str] = None, + minimum_elastic_instance_count: Optional[int] = None, + azure_storage_accounts: Optional[Dict[str, "AzureStorageInfoValue"]] = None, + public_network_access: Optional[str] = None, + **kwargs + ): + super(SiteConfig, self).__init__(**kwargs) + self.number_of_workers = number_of_workers + self.default_documents = default_documents + self.net_framework_version = net_framework_version + self.php_version = php_version + self.python_version = python_version + self.node_version = node_version + self.power_shell_version = power_shell_version + self.linux_fx_version = linux_fx_version + self.windows_fx_version = windows_fx_version + self.request_tracing_enabled = request_tracing_enabled + self.request_tracing_expiration_time = request_tracing_expiration_time + self.remote_debugging_enabled = remote_debugging_enabled + self.remote_debugging_version = remote_debugging_version + self.http_logging_enabled = http_logging_enabled + self.acr_use_managed_identity_creds = acr_use_managed_identity_creds + self.acr_user_managed_identity_id = acr_user_managed_identity_id + self.logs_directory_size_limit = logs_directory_size_limit + self.detailed_error_logging_enabled = detailed_error_logging_enabled + self.publishing_username = publishing_username + self.app_settings = app_settings + self.connection_strings = connection_strings + self.machine_key = None + self.handler_mappings = handler_mappings + self.document_root = document_root + self.scm_type = scm_type + self.use32_bit_worker_process = use32_bit_worker_process + self.web_sockets_enabled = web_sockets_enabled + self.always_on = always_on + self.java_version = java_version + self.java_container = java_container + self.java_container_version = java_container_version + self.app_command_line = app_command_line + self.managed_pipeline_mode = managed_pipeline_mode + self.virtual_applications = virtual_applications + self.load_balancing = load_balancing + self.experiments = experiments + self.limits = limits + self.auto_heal_enabled = auto_heal_enabled + self.auto_heal_rules = auto_heal_rules + self.tracing_options = tracing_options + self.vnet_name = vnet_name + self.vnet_route_all_enabled = vnet_route_all_enabled + self.vnet_private_ports_count = vnet_private_ports_count + self.cors = cors + self.push = push + self.api_definition = api_definition + self.api_management_config = api_management_config + self.auto_swap_slot_name = auto_swap_slot_name + self.local_my_sql_enabled = local_my_sql_enabled + self.managed_service_identity_id = managed_service_identity_id + self.x_managed_service_identity_id = x_managed_service_identity_id + self.key_vault_reference_identity = key_vault_reference_identity + self.ip_security_restrictions = ip_security_restrictions + self.scm_ip_security_restrictions = scm_ip_security_restrictions + self.scm_ip_security_restrictions_use_main = scm_ip_security_restrictions_use_main + self.http20_enabled = http20_enabled + self.min_tls_version = min_tls_version + self.scm_min_tls_version = scm_min_tls_version + self.ftps_state = ftps_state + self.pre_warmed_instance_count = pre_warmed_instance_count + self.function_app_scale_limit = function_app_scale_limit + self.health_check_path = health_check_path + self.functions_runtime_scale_monitoring_enabled = functions_runtime_scale_monitoring_enabled + self.website_time_zone = website_time_zone + self.minimum_elastic_instance_count = minimum_elastic_instance_count + self.azure_storage_accounts = azure_storage_accounts + self.public_network_access = public_network_access + + +class SiteConfigPropertiesDictionary(msrest.serialization.Model): + """Site config properties dictionary. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar use32_bit_worker_process: :code:`true` if use32BitWorkerProcess should be + set to true for the stack; otherwise, :code:`false`. + :vartype use32_bit_worker_process: bool + :ivar linux_fx_version: LinuxFxVersion configuration setting. + :vartype linux_fx_version: str + :ivar java_version: JavaVersion configuration setting. + :vartype java_version: str + :ivar power_shell_version: PowerShellVersion configuration setting. + :vartype power_shell_version: str + """ + + _validation = { + 'use32_bit_worker_process': {'readonly': True}, + 'linux_fx_version': {'readonly': True}, + 'java_version': {'readonly': True}, + 'power_shell_version': {'readonly': True}, + } + + _attribute_map = { + 'use32_bit_worker_process': {'key': 'use32BitWorkerProcess', 'type': 'bool'}, + 'linux_fx_version': {'key': 'linuxFxVersion', 'type': 'str'}, + 'java_version': {'key': 'javaVersion', 'type': 'str'}, + 'power_shell_version': {'key': 'powerShellVersion', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SiteConfigPropertiesDictionary, self).__init__(**kwargs) + self.use32_bit_worker_process = None + self.linux_fx_version = None + self.java_version = None + self.power_shell_version = None + + +class SiteConfigResource(ProxyOnlyResource): + """Web app configuration ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param number_of_workers: Number of workers. + :type number_of_workers: int + :param default_documents: Default documents. + :type default_documents: list[str] + :param net_framework_version: .NET Framework version. + :type net_framework_version: str + :param php_version: Version of PHP. + :type php_version: str + :param python_version: Version of Python. + :type python_version: str + :param node_version: Version of Node.js. + :type node_version: str + :param power_shell_version: Version of PowerShell. + :type power_shell_version: str + :param linux_fx_version: Linux App Framework and version. + :type linux_fx_version: str + :param windows_fx_version: Xenon App Framework and version. + :type windows_fx_version: str + :param request_tracing_enabled: :code:`true` if request tracing is enabled; + otherwise, :code:`false`. + :type request_tracing_enabled: bool + :param request_tracing_expiration_time: Request tracing expiration time. + :type request_tracing_expiration_time: ~datetime.datetime + :param remote_debugging_enabled: :code:`true` if remote debugging is enabled; + otherwise, :code:`false`. + :type remote_debugging_enabled: bool + :param remote_debugging_version: Remote debugging version. + :type remote_debugging_version: str + :param http_logging_enabled: :code:`true` if HTTP logging is enabled; otherwise, + :code:`false`. + :type http_logging_enabled: bool + :param acr_use_managed_identity_creds: Flag to use Managed Identity Creds for ACR pull. + :type acr_use_managed_identity_creds: bool + :param acr_user_managed_identity_id: If using user managed identity, the user managed identity + ClientId. + :type acr_user_managed_identity_id: str + :param logs_directory_size_limit: HTTP logs directory size limit. + :type logs_directory_size_limit: int + :param detailed_error_logging_enabled: :code:`true` if detailed error logging is + enabled; otherwise, :code:`false`. + :type detailed_error_logging_enabled: bool + :param publishing_username: Publishing user name. + :type publishing_username: str + :param app_settings: Application settings. + :type app_settings: list[~azure.mgmt.web.v2021_02_01.models.NameValuePair] + :param connection_strings: Connection strings. + :type connection_strings: list[~azure.mgmt.web.v2021_02_01.models.ConnStringInfo] + :ivar machine_key: Site MachineKey. + :vartype machine_key: ~azure.mgmt.web.v2021_02_01.models.SiteMachineKey + :param handler_mappings: Handler mappings. + :type handler_mappings: list[~azure.mgmt.web.v2021_02_01.models.HandlerMapping] + :param document_root: Document root. + :type document_root: str + :param scm_type: SCM type. Possible values include: "None", "Dropbox", "Tfs", "LocalGit", + "GitHub", "CodePlexGit", "CodePlexHg", "BitbucketGit", "BitbucketHg", "ExternalGit", + "ExternalHg", "OneDrive", "VSO", "VSTSRM". + :type scm_type: str or ~azure.mgmt.web.v2021_02_01.models.ScmType + :param use32_bit_worker_process: :code:`true` to use 32-bit worker process; + otherwise, :code:`false`. + :type use32_bit_worker_process: bool + :param web_sockets_enabled: :code:`true` if WebSocket is enabled; otherwise, + :code:`false`. + :type web_sockets_enabled: bool + :param always_on: :code:`true` if Always On is enabled; otherwise, + :code:`false`. + :type always_on: bool + :param java_version: Java version. + :type java_version: str + :param java_container: Java container. + :type java_container: str + :param java_container_version: Java container version. + :type java_container_version: str + :param app_command_line: App command line to launch. + :type app_command_line: str + :param managed_pipeline_mode: Managed pipeline mode. Possible values include: "Integrated", + "Classic". + :type managed_pipeline_mode: str or ~azure.mgmt.web.v2021_02_01.models.ManagedPipelineMode + :param virtual_applications: Virtual applications. + :type virtual_applications: list[~azure.mgmt.web.v2021_02_01.models.VirtualApplication] + :param load_balancing: Site load balancing. Possible values include: "WeightedRoundRobin", + "LeastRequests", "LeastResponseTime", "WeightedTotalTraffic", "RequestHash", + "PerSiteRoundRobin". + :type load_balancing: str or ~azure.mgmt.web.v2021_02_01.models.SiteLoadBalancing + :param experiments: This is work around for polymorphic types. + :type experiments: ~azure.mgmt.web.v2021_02_01.models.Experiments + :param limits: Site limits. + :type limits: ~azure.mgmt.web.v2021_02_01.models.SiteLimits + :param auto_heal_enabled: :code:`true` if Auto Heal is enabled; otherwise, + :code:`false`. + :type auto_heal_enabled: bool + :param auto_heal_rules: Auto Heal rules. + :type auto_heal_rules: ~azure.mgmt.web.v2021_02_01.models.AutoHealRules + :param tracing_options: Tracing options. + :type tracing_options: str + :param vnet_name: Virtual Network name. + :type vnet_name: str + :param vnet_route_all_enabled: Virtual Network Route All enabled. This causes all outbound + traffic to have Virtual Network Security Groups and User Defined Routes applied. + :type vnet_route_all_enabled: bool + :param vnet_private_ports_count: The number of private ports assigned to this app. These will + be assigned dynamically on runtime. + :type vnet_private_ports_count: int + :param cors: Cross-Origin Resource Sharing (CORS) settings. + :type cors: ~azure.mgmt.web.v2021_02_01.models.CorsSettings + :param push: Push endpoint settings. + :type push: ~azure.mgmt.web.v2021_02_01.models.PushSettings + :param api_definition: Information about the formal API definition for the app. + :type api_definition: ~azure.mgmt.web.v2021_02_01.models.ApiDefinitionInfo + :param api_management_config: Azure API management settings linked to the app. + :type api_management_config: ~azure.mgmt.web.v2021_02_01.models.ApiManagementConfig + :param auto_swap_slot_name: Auto-swap slot name. + :type auto_swap_slot_name: str + :param local_my_sql_enabled: :code:`true` to enable local MySQL; otherwise, + :code:`false`. + :type local_my_sql_enabled: bool + :param managed_service_identity_id: Managed Service Identity Id. + :type managed_service_identity_id: int + :param x_managed_service_identity_id: Explicit Managed Service Identity Id. + :type x_managed_service_identity_id: int + :param key_vault_reference_identity: Identity to use for Key Vault Reference authentication. + :type key_vault_reference_identity: str + :param ip_security_restrictions: IP security restrictions for main. + :type ip_security_restrictions: list[~azure.mgmt.web.v2021_02_01.models.IpSecurityRestriction] + :param scm_ip_security_restrictions: IP security restrictions for scm. + :type scm_ip_security_restrictions: + list[~azure.mgmt.web.v2021_02_01.models.IpSecurityRestriction] + :param scm_ip_security_restrictions_use_main: IP security restrictions for scm to use main. + :type scm_ip_security_restrictions_use_main: bool + :param http20_enabled: Http20Enabled: configures a web site to allow clients to connect over + http2.0. + :type http20_enabled: bool + :param min_tls_version: MinTlsVersion: configures the minimum version of TLS required for SSL + requests. Possible values include: "1.0", "1.1", "1.2". + :type min_tls_version: str or ~azure.mgmt.web.v2021_02_01.models.SupportedTlsVersions + :param scm_min_tls_version: ScmMinTlsVersion: configures the minimum version of TLS required + for SSL requests for SCM site. Possible values include: "1.0", "1.1", "1.2". + :type scm_min_tls_version: str or ~azure.mgmt.web.v2021_02_01.models.SupportedTlsVersions + :param ftps_state: State of FTP / FTPS service. Possible values include: "AllAllowed", + "FtpsOnly", "Disabled". + :type ftps_state: str or ~azure.mgmt.web.v2021_02_01.models.FtpsState + :param pre_warmed_instance_count: Number of preWarmed instances. + This setting only applies to the Consumption and Elastic Plans. + :type pre_warmed_instance_count: int + :param function_app_scale_limit: Maximum number of workers that a site can scale out to. + This setting only applies to the Consumption and Elastic Premium Plans. + :type function_app_scale_limit: int + :param health_check_path: Health check path. + :type health_check_path: str + :param functions_runtime_scale_monitoring_enabled: Gets or sets a value indicating whether + functions runtime scale monitoring is enabled. When enabled, + the ScaleController will not monitor event sources directly, but will instead call to the + runtime to get scale status. + :type functions_runtime_scale_monitoring_enabled: bool + :param website_time_zone: Sets the time zone a site uses for generating timestamps. Compatible + with Linux and Windows App Service. Setting the WEBSITE_TIME_ZONE app setting takes precedence + over this config. For Linux, expects tz database values https://www.iana.org/time-zones (for a + quick reference see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). For Windows, + expects one of the time zones listed under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows + NT\CurrentVersion\Time Zones. + :type website_time_zone: str + :param minimum_elastic_instance_count: Number of minimum instance count for a site + This setting only applies to the Elastic Plans. + :type minimum_elastic_instance_count: int + :param azure_storage_accounts: List of Azure Storage Accounts. + :type azure_storage_accounts: dict[str, + ~azure.mgmt.web.v2021_02_01.models.AzureStorageInfoValue] + :param public_network_access: Property to allow or block all public traffic. + :type public_network_access: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'machine_key': {'readonly': True}, + 'pre_warmed_instance_count': {'maximum': 10, 'minimum': 0}, + 'function_app_scale_limit': {'minimum': 0}, + 'minimum_elastic_instance_count': {'maximum': 20, 'minimum': 0}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'number_of_workers': {'key': 'properties.numberOfWorkers', 'type': 'int'}, + 'default_documents': {'key': 'properties.defaultDocuments', 'type': '[str]'}, + 'net_framework_version': {'key': 'properties.netFrameworkVersion', 'type': 'str'}, + 'php_version': {'key': 'properties.phpVersion', 'type': 'str'}, + 'python_version': {'key': 'properties.pythonVersion', 'type': 'str'}, + 'node_version': {'key': 'properties.nodeVersion', 'type': 'str'}, + 'power_shell_version': {'key': 'properties.powerShellVersion', 'type': 'str'}, + 'linux_fx_version': {'key': 'properties.linuxFxVersion', 'type': 'str'}, + 'windows_fx_version': {'key': 'properties.windowsFxVersion', 'type': 'str'}, + 'request_tracing_enabled': {'key': 'properties.requestTracingEnabled', 'type': 'bool'}, + 'request_tracing_expiration_time': {'key': 'properties.requestTracingExpirationTime', 'type': 'iso-8601'}, + 'remote_debugging_enabled': {'key': 'properties.remoteDebuggingEnabled', 'type': 'bool'}, + 'remote_debugging_version': {'key': 'properties.remoteDebuggingVersion', 'type': 'str'}, + 'http_logging_enabled': {'key': 'properties.httpLoggingEnabled', 'type': 'bool'}, + 'acr_use_managed_identity_creds': {'key': 'properties.acrUseManagedIdentityCreds', 'type': 'bool'}, + 'acr_user_managed_identity_id': {'key': 'properties.acrUserManagedIdentityID', 'type': 'str'}, + 'logs_directory_size_limit': {'key': 'properties.logsDirectorySizeLimit', 'type': 'int'}, + 'detailed_error_logging_enabled': {'key': 'properties.detailedErrorLoggingEnabled', 'type': 'bool'}, + 'publishing_username': {'key': 'properties.publishingUsername', 'type': 'str'}, + 'app_settings': {'key': 'properties.appSettings', 'type': '[NameValuePair]'}, + 'connection_strings': {'key': 'properties.connectionStrings', 'type': '[ConnStringInfo]'}, + 'machine_key': {'key': 'properties.machineKey', 'type': 'SiteMachineKey'}, + 'handler_mappings': {'key': 'properties.handlerMappings', 'type': '[HandlerMapping]'}, + 'document_root': {'key': 'properties.documentRoot', 'type': 'str'}, + 'scm_type': {'key': 'properties.scmType', 'type': 'str'}, + 'use32_bit_worker_process': {'key': 'properties.use32BitWorkerProcess', 'type': 'bool'}, + 'web_sockets_enabled': {'key': 'properties.webSocketsEnabled', 'type': 'bool'}, + 'always_on': {'key': 'properties.alwaysOn', 'type': 'bool'}, + 'java_version': {'key': 'properties.javaVersion', 'type': 'str'}, + 'java_container': {'key': 'properties.javaContainer', 'type': 'str'}, + 'java_container_version': {'key': 'properties.javaContainerVersion', 'type': 'str'}, + 'app_command_line': {'key': 'properties.appCommandLine', 'type': 'str'}, + 'managed_pipeline_mode': {'key': 'properties.managedPipelineMode', 'type': 'str'}, + 'virtual_applications': {'key': 'properties.virtualApplications', 'type': '[VirtualApplication]'}, + 'load_balancing': {'key': 'properties.loadBalancing', 'type': 'str'}, + 'experiments': {'key': 'properties.experiments', 'type': 'Experiments'}, + 'limits': {'key': 'properties.limits', 'type': 'SiteLimits'}, + 'auto_heal_enabled': {'key': 'properties.autoHealEnabled', 'type': 'bool'}, + 'auto_heal_rules': {'key': 'properties.autoHealRules', 'type': 'AutoHealRules'}, + 'tracing_options': {'key': 'properties.tracingOptions', 'type': 'str'}, + 'vnet_name': {'key': 'properties.vnetName', 'type': 'str'}, + 'vnet_route_all_enabled': {'key': 'properties.vnetRouteAllEnabled', 'type': 'bool'}, + 'vnet_private_ports_count': {'key': 'properties.vnetPrivatePortsCount', 'type': 'int'}, + 'cors': {'key': 'properties.cors', 'type': 'CorsSettings'}, + 'push': {'key': 'properties.push', 'type': 'PushSettings'}, + 'api_definition': {'key': 'properties.apiDefinition', 'type': 'ApiDefinitionInfo'}, + 'api_management_config': {'key': 'properties.apiManagementConfig', 'type': 'ApiManagementConfig'}, + 'auto_swap_slot_name': {'key': 'properties.autoSwapSlotName', 'type': 'str'}, + 'local_my_sql_enabled': {'key': 'properties.localMySqlEnabled', 'type': 'bool'}, + 'managed_service_identity_id': {'key': 'properties.managedServiceIdentityId', 'type': 'int'}, + 'x_managed_service_identity_id': {'key': 'properties.xManagedServiceIdentityId', 'type': 'int'}, + 'key_vault_reference_identity': {'key': 'properties.keyVaultReferenceIdentity', 'type': 'str'}, + 'ip_security_restrictions': {'key': 'properties.ipSecurityRestrictions', 'type': '[IpSecurityRestriction]'}, + 'scm_ip_security_restrictions': {'key': 'properties.scmIpSecurityRestrictions', 'type': '[IpSecurityRestriction]'}, + 'scm_ip_security_restrictions_use_main': {'key': 'properties.scmIpSecurityRestrictionsUseMain', 'type': 'bool'}, + 'http20_enabled': {'key': 'properties.http20Enabled', 'type': 'bool'}, + 'min_tls_version': {'key': 'properties.minTlsVersion', 'type': 'str'}, + 'scm_min_tls_version': {'key': 'properties.scmMinTlsVersion', 'type': 'str'}, + 'ftps_state': {'key': 'properties.ftpsState', 'type': 'str'}, + 'pre_warmed_instance_count': {'key': 'properties.preWarmedInstanceCount', 'type': 'int'}, + 'function_app_scale_limit': {'key': 'properties.functionAppScaleLimit', 'type': 'int'}, + 'health_check_path': {'key': 'properties.healthCheckPath', 'type': 'str'}, + 'functions_runtime_scale_monitoring_enabled': {'key': 'properties.functionsRuntimeScaleMonitoringEnabled', 'type': 'bool'}, + 'website_time_zone': {'key': 'properties.websiteTimeZone', 'type': 'str'}, + 'minimum_elastic_instance_count': {'key': 'properties.minimumElasticInstanceCount', 'type': 'int'}, + 'azure_storage_accounts': {'key': 'properties.azureStorageAccounts', 'type': '{AzureStorageInfoValue}'}, + 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + number_of_workers: Optional[int] = None, + default_documents: Optional[List[str]] = None, + net_framework_version: Optional[str] = "v4.6", + php_version: Optional[str] = None, + python_version: Optional[str] = None, + node_version: Optional[str] = None, + power_shell_version: Optional[str] = None, + linux_fx_version: Optional[str] = None, + windows_fx_version: Optional[str] = None, + request_tracing_enabled: Optional[bool] = None, + request_tracing_expiration_time: Optional[datetime.datetime] = None, + remote_debugging_enabled: Optional[bool] = None, + remote_debugging_version: Optional[str] = None, + http_logging_enabled: Optional[bool] = None, + acr_use_managed_identity_creds: Optional[bool] = None, + acr_user_managed_identity_id: Optional[str] = None, + logs_directory_size_limit: Optional[int] = None, + detailed_error_logging_enabled: Optional[bool] = None, + publishing_username: Optional[str] = None, + app_settings: Optional[List["NameValuePair"]] = None, + connection_strings: Optional[List["ConnStringInfo"]] = None, + handler_mappings: Optional[List["HandlerMapping"]] = None, + document_root: Optional[str] = None, + scm_type: Optional[Union[str, "ScmType"]] = None, + use32_bit_worker_process: Optional[bool] = None, + web_sockets_enabled: Optional[bool] = None, + always_on: Optional[bool] = None, + java_version: Optional[str] = None, + java_container: Optional[str] = None, + java_container_version: Optional[str] = None, + app_command_line: Optional[str] = None, + managed_pipeline_mode: Optional[Union[str, "ManagedPipelineMode"]] = None, + virtual_applications: Optional[List["VirtualApplication"]] = None, + load_balancing: Optional[Union[str, "SiteLoadBalancing"]] = None, + experiments: Optional["Experiments"] = None, + limits: Optional["SiteLimits"] = None, + auto_heal_enabled: Optional[bool] = None, + auto_heal_rules: Optional["AutoHealRules"] = None, + tracing_options: Optional[str] = None, + vnet_name: Optional[str] = None, + vnet_route_all_enabled: Optional[bool] = None, + vnet_private_ports_count: Optional[int] = None, + cors: Optional["CorsSettings"] = None, + push: Optional["PushSettings"] = None, + api_definition: Optional["ApiDefinitionInfo"] = None, + api_management_config: Optional["ApiManagementConfig"] = None, + auto_swap_slot_name: Optional[str] = None, + local_my_sql_enabled: Optional[bool] = False, + managed_service_identity_id: Optional[int] = None, + x_managed_service_identity_id: Optional[int] = None, + key_vault_reference_identity: Optional[str] = None, + ip_security_restrictions: Optional[List["IpSecurityRestriction"]] = None, + scm_ip_security_restrictions: Optional[List["IpSecurityRestriction"]] = None, + scm_ip_security_restrictions_use_main: Optional[bool] = None, + http20_enabled: Optional[bool] = True, + min_tls_version: Optional[Union[str, "SupportedTlsVersions"]] = None, + scm_min_tls_version: Optional[Union[str, "SupportedTlsVersions"]] = None, + ftps_state: Optional[Union[str, "FtpsState"]] = None, + pre_warmed_instance_count: Optional[int] = None, + function_app_scale_limit: Optional[int] = None, + health_check_path: Optional[str] = None, + functions_runtime_scale_monitoring_enabled: Optional[bool] = None, + website_time_zone: Optional[str] = None, + minimum_elastic_instance_count: Optional[int] = None, + azure_storage_accounts: Optional[Dict[str, "AzureStorageInfoValue"]] = None, + public_network_access: Optional[str] = None, + **kwargs + ): + super(SiteConfigResource, self).__init__(kind=kind, **kwargs) + self.number_of_workers = number_of_workers + self.default_documents = default_documents + self.net_framework_version = net_framework_version + self.php_version = php_version + self.python_version = python_version + self.node_version = node_version + self.power_shell_version = power_shell_version + self.linux_fx_version = linux_fx_version + self.windows_fx_version = windows_fx_version + self.request_tracing_enabled = request_tracing_enabled + self.request_tracing_expiration_time = request_tracing_expiration_time + self.remote_debugging_enabled = remote_debugging_enabled + self.remote_debugging_version = remote_debugging_version + self.http_logging_enabled = http_logging_enabled + self.acr_use_managed_identity_creds = acr_use_managed_identity_creds + self.acr_user_managed_identity_id = acr_user_managed_identity_id + self.logs_directory_size_limit = logs_directory_size_limit + self.detailed_error_logging_enabled = detailed_error_logging_enabled + self.publishing_username = publishing_username + self.app_settings = app_settings + self.connection_strings = connection_strings + self.machine_key = None + self.handler_mappings = handler_mappings + self.document_root = document_root + self.scm_type = scm_type + self.use32_bit_worker_process = use32_bit_worker_process + self.web_sockets_enabled = web_sockets_enabled + self.always_on = always_on + self.java_version = java_version + self.java_container = java_container + self.java_container_version = java_container_version + self.app_command_line = app_command_line + self.managed_pipeline_mode = managed_pipeline_mode + self.virtual_applications = virtual_applications + self.load_balancing = load_balancing + self.experiments = experiments + self.limits = limits + self.auto_heal_enabled = auto_heal_enabled + self.auto_heal_rules = auto_heal_rules + self.tracing_options = tracing_options + self.vnet_name = vnet_name + self.vnet_route_all_enabled = vnet_route_all_enabled + self.vnet_private_ports_count = vnet_private_ports_count + self.cors = cors + self.push = push + self.api_definition = api_definition + self.api_management_config = api_management_config + self.auto_swap_slot_name = auto_swap_slot_name + self.local_my_sql_enabled = local_my_sql_enabled + self.managed_service_identity_id = managed_service_identity_id + self.x_managed_service_identity_id = x_managed_service_identity_id + self.key_vault_reference_identity = key_vault_reference_identity + self.ip_security_restrictions = ip_security_restrictions + self.scm_ip_security_restrictions = scm_ip_security_restrictions + self.scm_ip_security_restrictions_use_main = scm_ip_security_restrictions_use_main + self.http20_enabled = http20_enabled + self.min_tls_version = min_tls_version + self.scm_min_tls_version = scm_min_tls_version + self.ftps_state = ftps_state + self.pre_warmed_instance_count = pre_warmed_instance_count + self.function_app_scale_limit = function_app_scale_limit + self.health_check_path = health_check_path + self.functions_runtime_scale_monitoring_enabled = functions_runtime_scale_monitoring_enabled + self.website_time_zone = website_time_zone + self.minimum_elastic_instance_count = minimum_elastic_instance_count + self.azure_storage_accounts = azure_storage_accounts + self.public_network_access = public_network_access + + +class SiteConfigResourceCollection(msrest.serialization.Model): + """Collection of site configurations. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.SiteConfigResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SiteConfigResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["SiteConfigResource"], + **kwargs + ): + super(SiteConfigResourceCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class SiteConfigurationSnapshotInfo(ProxyOnlyResource): + """A snapshot of a web app configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar time: The time the snapshot was taken. + :vartype time: ~datetime.datetime + :ivar snapshot_id: The id of the snapshot. + :vartype snapshot_id: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'time': {'readonly': True}, + 'snapshot_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'time': {'key': 'properties.time', 'type': 'iso-8601'}, + 'snapshot_id': {'key': 'properties.snapshotId', 'type': 'int'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(SiteConfigurationSnapshotInfo, self).__init__(kind=kind, **kwargs) + self.time = None + self.snapshot_id = None + + +class SiteConfigurationSnapshotInfoCollection(msrest.serialization.Model): + """Collection of metadata for the app configuration snapshots that can be restored. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.SiteConfigurationSnapshotInfo] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SiteConfigurationSnapshotInfo]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["SiteConfigurationSnapshotInfo"], + **kwargs + ): + super(SiteConfigurationSnapshotInfoCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class SiteExtensionInfo(ProxyOnlyResource): + """Site Extension Information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param extension_id: Site extension ID. + :type extension_id: str + :param title: + :type title: str + :param extension_type: Site extension type. Possible values include: "Gallery", "WebRoot". + :type extension_type: str or ~azure.mgmt.web.v2021_02_01.models.SiteExtensionType + :param summary: Summary description. + :type summary: str + :param description: Detailed description. + :type description: str + :param version: Version information. + :type version: str + :param extension_url: Extension URL. + :type extension_url: str + :param project_url: Project URL. + :type project_url: str + :param icon_url: Icon URL. + :type icon_url: str + :param license_url: License URL. + :type license_url: str + :param feed_url: Feed URL. + :type feed_url: str + :param authors: List of authors. + :type authors: list[str] + :param installer_command_line_params: Installer command line parameters. + :type installer_command_line_params: str + :param published_date_time: Published timestamp. + :type published_date_time: ~datetime.datetime + :param download_count: Count of downloads. + :type download_count: int + :param local_is_latest_version: :code:`true` if the local version is the latest + version; :code:`false` otherwise. + :type local_is_latest_version: bool + :param local_path: Local path. + :type local_path: str + :param installed_date_time: Installed timestamp. + :type installed_date_time: ~datetime.datetime + :param provisioning_state: Provisioning state. + :type provisioning_state: str + :param comment: Site Extension comment. + :type comment: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'extension_id': {'key': 'properties.extension_id', 'type': 'str'}, + 'title': {'key': 'properties.title', 'type': 'str'}, + 'extension_type': {'key': 'properties.extension_type', 'type': 'str'}, + 'summary': {'key': 'properties.summary', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'extension_url': {'key': 'properties.extension_url', 'type': 'str'}, + 'project_url': {'key': 'properties.project_url', 'type': 'str'}, + 'icon_url': {'key': 'properties.icon_url', 'type': 'str'}, + 'license_url': {'key': 'properties.license_url', 'type': 'str'}, + 'feed_url': {'key': 'properties.feed_url', 'type': 'str'}, + 'authors': {'key': 'properties.authors', 'type': '[str]'}, + 'installer_command_line_params': {'key': 'properties.installer_command_line_params', 'type': 'str'}, + 'published_date_time': {'key': 'properties.published_date_time', 'type': 'iso-8601'}, + 'download_count': {'key': 'properties.download_count', 'type': 'int'}, + 'local_is_latest_version': {'key': 'properties.local_is_latest_version', 'type': 'bool'}, + 'local_path': {'key': 'properties.local_path', 'type': 'str'}, + 'installed_date_time': {'key': 'properties.installed_date_time', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'comment': {'key': 'properties.comment', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + extension_id: Optional[str] = None, + title: Optional[str] = None, + extension_type: Optional[Union[str, "SiteExtensionType"]] = None, + summary: Optional[str] = None, + description: Optional[str] = None, + version: Optional[str] = None, + extension_url: Optional[str] = None, + project_url: Optional[str] = None, + icon_url: Optional[str] = None, + license_url: Optional[str] = None, + feed_url: Optional[str] = None, + authors: Optional[List[str]] = None, + installer_command_line_params: Optional[str] = None, + published_date_time: Optional[datetime.datetime] = None, + download_count: Optional[int] = None, + local_is_latest_version: Optional[bool] = None, + local_path: Optional[str] = None, + installed_date_time: Optional[datetime.datetime] = None, + provisioning_state: Optional[str] = None, + comment: Optional[str] = None, + **kwargs + ): + super(SiteExtensionInfo, self).__init__(kind=kind, **kwargs) + self.extension_id = extension_id + self.title = title + self.extension_type = extension_type + self.summary = summary + self.description = description + self.version = version + self.extension_url = extension_url + self.project_url = project_url + self.icon_url = icon_url + self.license_url = license_url + self.feed_url = feed_url + self.authors = authors + self.installer_command_line_params = installer_command_line_params + self.published_date_time = published_date_time + self.download_count = download_count + self.local_is_latest_version = local_is_latest_version + self.local_path = local_path + self.installed_date_time = installed_date_time + self.provisioning_state = provisioning_state + self.comment = comment + + +class SiteExtensionInfoCollection(msrest.serialization.Model): + """Collection of Kudu site extension information elements. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.SiteExtensionInfo] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SiteExtensionInfo]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["SiteExtensionInfo"], + **kwargs + ): + super(SiteExtensionInfoCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class SiteLimits(msrest.serialization.Model): + """Metric limits set on an app. + + :param max_percentage_cpu: Maximum allowed CPU usage percentage. + :type max_percentage_cpu: float + :param max_memory_in_mb: Maximum allowed memory usage in MB. + :type max_memory_in_mb: long + :param max_disk_size_in_mb: Maximum allowed disk size usage in MB. + :type max_disk_size_in_mb: long + """ + + _attribute_map = { + 'max_percentage_cpu': {'key': 'maxPercentageCpu', 'type': 'float'}, + 'max_memory_in_mb': {'key': 'maxMemoryInMb', 'type': 'long'}, + 'max_disk_size_in_mb': {'key': 'maxDiskSizeInMb', 'type': 'long'}, + } + + def __init__( + self, + *, + max_percentage_cpu: Optional[float] = None, + max_memory_in_mb: Optional[int] = None, + max_disk_size_in_mb: Optional[int] = None, + **kwargs + ): + super(SiteLimits, self).__init__(**kwargs) + self.max_percentage_cpu = max_percentage_cpu + self.max_memory_in_mb = max_memory_in_mb + self.max_disk_size_in_mb = max_disk_size_in_mb + + +class SiteLogsConfig(ProxyOnlyResource): + """Configuration of App Service site logs. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param application_logs: Application logs configuration. + :type application_logs: ~azure.mgmt.web.v2021_02_01.models.ApplicationLogsConfig + :param http_logs: HTTP logs configuration. + :type http_logs: ~azure.mgmt.web.v2021_02_01.models.HttpLogsConfig + :param failed_requests_tracing: Failed requests tracing configuration. + :type failed_requests_tracing: ~azure.mgmt.web.v2021_02_01.models.EnabledConfig + :param detailed_error_messages: Detailed error messages configuration. + :type detailed_error_messages: ~azure.mgmt.web.v2021_02_01.models.EnabledConfig + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'application_logs': {'key': 'properties.applicationLogs', 'type': 'ApplicationLogsConfig'}, + 'http_logs': {'key': 'properties.httpLogs', 'type': 'HttpLogsConfig'}, + 'failed_requests_tracing': {'key': 'properties.failedRequestsTracing', 'type': 'EnabledConfig'}, + 'detailed_error_messages': {'key': 'properties.detailedErrorMessages', 'type': 'EnabledConfig'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + application_logs: Optional["ApplicationLogsConfig"] = None, + http_logs: Optional["HttpLogsConfig"] = None, + failed_requests_tracing: Optional["EnabledConfig"] = None, + detailed_error_messages: Optional["EnabledConfig"] = None, + **kwargs + ): + super(SiteLogsConfig, self).__init__(kind=kind, **kwargs) + self.application_logs = application_logs + self.http_logs = http_logs + self.failed_requests_tracing = failed_requests_tracing + self.detailed_error_messages = detailed_error_messages + + +class SiteMachineKey(msrest.serialization.Model): + """MachineKey of an app. + + :param validation: MachineKey validation. + :type validation: str + :param validation_key: Validation key. + :type validation_key: str + :param decryption: Algorithm used for decryption. + :type decryption: str + :param decryption_key: Decryption key. + :type decryption_key: str + """ + + _attribute_map = { + 'validation': {'key': 'validation', 'type': 'str'}, + 'validation_key': {'key': 'validationKey', 'type': 'str'}, + 'decryption': {'key': 'decryption', 'type': 'str'}, + 'decryption_key': {'key': 'decryptionKey', 'type': 'str'}, + } + + def __init__( + self, + *, + validation: Optional[str] = None, + validation_key: Optional[str] = None, + decryption: Optional[str] = None, + decryption_key: Optional[str] = None, + **kwargs + ): + super(SiteMachineKey, self).__init__(**kwargs) + self.validation = validation + self.validation_key = validation_key + self.decryption = decryption + self.decryption_key = decryption_key + + +class SitePatchResource(ProxyOnlyResource): + """ARM resource for a site. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param identity: Managed service identity. + :type identity: ~azure.mgmt.web.v2021_02_01.models.ManagedServiceIdentity + :ivar state: Current state of the app. + :vartype state: str + :ivar host_names: Hostnames associated with the app. + :vartype host_names: list[str] + :ivar repository_site_name: Name of the repository site. + :vartype repository_site_name: str + :ivar usage_state: State indicating whether the app has exceeded its quota usage. Read-only. + Possible values include: "Normal", "Exceeded". + :vartype usage_state: str or ~azure.mgmt.web.v2021_02_01.models.UsageState + :param enabled: :code:`true` if the app is enabled; otherwise, + :code:`false`. Setting this value to false disables the app (takes the app + offline). + :type enabled: bool + :ivar enabled_host_names: Enabled hostnames for the app.Hostnames need to be assigned (see + HostNames) AND enabled. Otherwise, + the app is not served on those hostnames. + :vartype enabled_host_names: list[str] + :ivar availability_state: Management information availability state for the app. Possible + values include: "Normal", "Limited", "DisasterRecoveryMode". + :vartype availability_state: str or ~azure.mgmt.web.v2021_02_01.models.SiteAvailabilityState + :param host_name_ssl_states: Hostname SSL states are used to manage the SSL bindings for app's + hostnames. + :type host_name_ssl_states: list[~azure.mgmt.web.v2021_02_01.models.HostNameSslState] + :param server_farm_id: Resource ID of the associated App Service plan, formatted as: + "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + :type server_farm_id: str + :param reserved: :code:`true` if reserved; otherwise, :code:`false`. + :type reserved: bool + :param is_xenon: Obsolete: Hyper-V sandbox. + :type is_xenon: bool + :param hyper_v: Hyper-V sandbox. + :type hyper_v: bool + :ivar last_modified_time_utc: Last time the app was modified, in UTC. Read-only. + :vartype last_modified_time_utc: ~datetime.datetime + :param site_config: Configuration of the app. + :type site_config: ~azure.mgmt.web.v2021_02_01.models.SiteConfig + :ivar traffic_manager_host_names: Azure Traffic Manager hostnames associated with the app. + Read-only. + :vartype traffic_manager_host_names: list[str] + :param scm_site_also_stopped: :code:`true` to stop SCM (KUDU) site when the app is + stopped; otherwise, :code:`false`. The default is :code:`false`. + :type scm_site_also_stopped: bool + :ivar target_swap_slot: Specifies which deployment slot this app will swap into. Read-only. + :vartype target_swap_slot: str + :param hosting_environment_profile: App Service Environment to use for the app. + :type hosting_environment_profile: ~azure.mgmt.web.v2021_02_01.models.HostingEnvironmentProfile + :param client_affinity_enabled: :code:`true` to enable client affinity; + :code:`false` to stop sending session affinity cookies, which route client + requests in the same session to the same instance. Default is :code:`true`. + :type client_affinity_enabled: bool + :param client_cert_enabled: :code:`true` to enable client certificate + authentication (TLS mutual authentication); otherwise, :code:`false`. Default is + :code:`false`. + :type client_cert_enabled: bool + :param client_cert_mode: This composes with ClientCertEnabled setting. + + + * ClientCertEnabled: false means ClientCert is ignored. + * ClientCertEnabled: true and ClientCertMode: Required means ClientCert is required. + * ClientCertEnabled: true and ClientCertMode: Optional means ClientCert is optional or + accepted. Possible values include: "Required", "Optional", "OptionalInteractiveUser". + :type client_cert_mode: str or ~azure.mgmt.web.v2021_02_01.models.ClientCertMode + :param client_cert_exclusion_paths: client certificate authentication comma-separated exclusion + paths. + :type client_cert_exclusion_paths: str + :param host_names_disabled: :code:`true` to disable the public hostnames of the + app; otherwise, :code:`false`. + If :code:`true`, the app is only accessible via API management process. + :type host_names_disabled: bool + :param custom_domain_verification_id: Unique identifier that verifies the custom domains + assigned to the app. Customer will add this id to a txt record for verification. + :type custom_domain_verification_id: str + :ivar outbound_ip_addresses: List of IP addresses that the app uses for outbound connections + (e.g. database access). Includes VIPs from tenants that site can be hosted with current + settings. Read-only. + :vartype outbound_ip_addresses: str + :ivar possible_outbound_ip_addresses: List of IP addresses that the app uses for outbound + connections (e.g. database access). Includes VIPs from all tenants except dataComponent. + Read-only. + :vartype possible_outbound_ip_addresses: str + :param container_size: Size of the function container. + :type container_size: int + :param daily_memory_time_quota: Maximum allowed daily memory-time quota (applicable on dynamic + apps only). + :type daily_memory_time_quota: int + :ivar suspended_till: App suspended till in case memory-time quota is exceeded. + :vartype suspended_till: ~datetime.datetime + :ivar max_number_of_workers: Maximum number of workers. + This only applies to Functions container. + :vartype max_number_of_workers: int + :param cloning_info: If specified during app creation, the app is cloned from a source app. + :type cloning_info: ~azure.mgmt.web.v2021_02_01.models.CloningInfo + :ivar resource_group: Name of the resource group the app belongs to. Read-only. + :vartype resource_group: str + :ivar is_default_container: :code:`true` if the app is a default container; + otherwise, :code:`false`. + :vartype is_default_container: bool + :ivar default_host_name: Default hostname of the app. Read-only. + :vartype default_host_name: str + :ivar slot_swap_status: Status of the last deployment slot swap operation. + :vartype slot_swap_status: ~azure.mgmt.web.v2021_02_01.models.SlotSwapStatus + :param https_only: HttpsOnly: configures a web site to accept only https requests. Issues + redirect for + http requests. + :type https_only: bool + :param redundancy_mode: Site redundancy mode. Possible values include: "None", "Manual", + "Failover", "ActiveActive", "GeoRedundant". + :type redundancy_mode: str or ~azure.mgmt.web.v2021_02_01.models.RedundancyMode + :ivar in_progress_operation_id: Specifies an operation id if this site has a pending operation. + :vartype in_progress_operation_id: str + :param storage_account_required: Checks if Customer provided storage account is required. + :type storage_account_required: bool + :param key_vault_reference_identity: Identity to use for Key Vault Reference authentication. + :type key_vault_reference_identity: str + :param virtual_network_subnet_id: Azure Resource Manager ID of the Virtual network and subnet + to be joined by Regional VNET Integration. + This must be of the form + /subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + :type virtual_network_subnet_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'state': {'readonly': True}, + 'host_names': {'readonly': True}, + 'repository_site_name': {'readonly': True}, + 'usage_state': {'readonly': True}, + 'enabled_host_names': {'readonly': True}, + 'availability_state': {'readonly': True}, + 'last_modified_time_utc': {'readonly': True}, + 'traffic_manager_host_names': {'readonly': True}, + 'target_swap_slot': {'readonly': True}, + 'outbound_ip_addresses': {'readonly': True}, + 'possible_outbound_ip_addresses': {'readonly': True}, + 'suspended_till': {'readonly': True}, + 'max_number_of_workers': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'is_default_container': {'readonly': True}, + 'default_host_name': {'readonly': True}, + 'slot_swap_status': {'readonly': True}, + 'in_progress_operation_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'host_names': {'key': 'properties.hostNames', 'type': '[str]'}, + 'repository_site_name': {'key': 'properties.repositorySiteName', 'type': 'str'}, + 'usage_state': {'key': 'properties.usageState', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'enabled_host_names': {'key': 'properties.enabledHostNames', 'type': '[str]'}, + 'availability_state': {'key': 'properties.availabilityState', 'type': 'str'}, + 'host_name_ssl_states': {'key': 'properties.hostNameSslStates', 'type': '[HostNameSslState]'}, + 'server_farm_id': {'key': 'properties.serverFarmId', 'type': 'str'}, + 'reserved': {'key': 'properties.reserved', 'type': 'bool'}, + 'is_xenon': {'key': 'properties.isXenon', 'type': 'bool'}, + 'hyper_v': {'key': 'properties.hyperV', 'type': 'bool'}, + 'last_modified_time_utc': {'key': 'properties.lastModifiedTimeUtc', 'type': 'iso-8601'}, + 'site_config': {'key': 'properties.siteConfig', 'type': 'SiteConfig'}, + 'traffic_manager_host_names': {'key': 'properties.trafficManagerHostNames', 'type': '[str]'}, + 'scm_site_also_stopped': {'key': 'properties.scmSiteAlsoStopped', 'type': 'bool'}, + 'target_swap_slot': {'key': 'properties.targetSwapSlot', 'type': 'str'}, + 'hosting_environment_profile': {'key': 'properties.hostingEnvironmentProfile', 'type': 'HostingEnvironmentProfile'}, + 'client_affinity_enabled': {'key': 'properties.clientAffinityEnabled', 'type': 'bool'}, + 'client_cert_enabled': {'key': 'properties.clientCertEnabled', 'type': 'bool'}, + 'client_cert_mode': {'key': 'properties.clientCertMode', 'type': 'str'}, + 'client_cert_exclusion_paths': {'key': 'properties.clientCertExclusionPaths', 'type': 'str'}, + 'host_names_disabled': {'key': 'properties.hostNamesDisabled', 'type': 'bool'}, + 'custom_domain_verification_id': {'key': 'properties.customDomainVerificationId', 'type': 'str'}, + 'outbound_ip_addresses': {'key': 'properties.outboundIpAddresses', 'type': 'str'}, + 'possible_outbound_ip_addresses': {'key': 'properties.possibleOutboundIpAddresses', 'type': 'str'}, + 'container_size': {'key': 'properties.containerSize', 'type': 'int'}, + 'daily_memory_time_quota': {'key': 'properties.dailyMemoryTimeQuota', 'type': 'int'}, + 'suspended_till': {'key': 'properties.suspendedTill', 'type': 'iso-8601'}, + 'max_number_of_workers': {'key': 'properties.maxNumberOfWorkers', 'type': 'int'}, + 'cloning_info': {'key': 'properties.cloningInfo', 'type': 'CloningInfo'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'is_default_container': {'key': 'properties.isDefaultContainer', 'type': 'bool'}, + 'default_host_name': {'key': 'properties.defaultHostName', 'type': 'str'}, + 'slot_swap_status': {'key': 'properties.slotSwapStatus', 'type': 'SlotSwapStatus'}, + 'https_only': {'key': 'properties.httpsOnly', 'type': 'bool'}, + 'redundancy_mode': {'key': 'properties.redundancyMode', 'type': 'str'}, + 'in_progress_operation_id': {'key': 'properties.inProgressOperationId', 'type': 'str'}, + 'storage_account_required': {'key': 'properties.storageAccountRequired', 'type': 'bool'}, + 'key_vault_reference_identity': {'key': 'properties.keyVaultReferenceIdentity', 'type': 'str'}, + 'virtual_network_subnet_id': {'key': 'properties.virtualNetworkSubnetId', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + identity: Optional["ManagedServiceIdentity"] = None, + enabled: Optional[bool] = None, + host_name_ssl_states: Optional[List["HostNameSslState"]] = None, + server_farm_id: Optional[str] = None, + reserved: Optional[bool] = False, + is_xenon: Optional[bool] = False, + hyper_v: Optional[bool] = False, + site_config: Optional["SiteConfig"] = None, + scm_site_also_stopped: Optional[bool] = False, + hosting_environment_profile: Optional["HostingEnvironmentProfile"] = None, + client_affinity_enabled: Optional[bool] = None, + client_cert_enabled: Optional[bool] = None, + client_cert_mode: Optional[Union[str, "ClientCertMode"]] = None, + client_cert_exclusion_paths: Optional[str] = None, + host_names_disabled: Optional[bool] = None, + custom_domain_verification_id: Optional[str] = None, + container_size: Optional[int] = None, + daily_memory_time_quota: Optional[int] = None, + cloning_info: Optional["CloningInfo"] = None, + https_only: Optional[bool] = None, + redundancy_mode: Optional[Union[str, "RedundancyMode"]] = None, + storage_account_required: Optional[bool] = None, + key_vault_reference_identity: Optional[str] = None, + virtual_network_subnet_id: Optional[str] = None, + **kwargs + ): + super(SitePatchResource, self).__init__(kind=kind, **kwargs) + self.identity = identity + self.state = None + self.host_names = None + self.repository_site_name = None + self.usage_state = None + self.enabled = enabled + self.enabled_host_names = None + self.availability_state = None + self.host_name_ssl_states = host_name_ssl_states + self.server_farm_id = server_farm_id + self.reserved = reserved + self.is_xenon = is_xenon + self.hyper_v = hyper_v + self.last_modified_time_utc = None + self.site_config = site_config + self.traffic_manager_host_names = None + self.scm_site_also_stopped = scm_site_also_stopped + self.target_swap_slot = None + self.hosting_environment_profile = hosting_environment_profile + self.client_affinity_enabled = client_affinity_enabled + self.client_cert_enabled = client_cert_enabled + self.client_cert_mode = client_cert_mode + self.client_cert_exclusion_paths = client_cert_exclusion_paths + self.host_names_disabled = host_names_disabled + self.custom_domain_verification_id = custom_domain_verification_id + self.outbound_ip_addresses = None + self.possible_outbound_ip_addresses = None + self.container_size = container_size + self.daily_memory_time_quota = daily_memory_time_quota + self.suspended_till = None + self.max_number_of_workers = None + self.cloning_info = cloning_info + self.resource_group = None + self.is_default_container = None + self.default_host_name = None + self.slot_swap_status = None + self.https_only = https_only + self.redundancy_mode = redundancy_mode + self.in_progress_operation_id = None + self.storage_account_required = storage_account_required + self.key_vault_reference_identity = key_vault_reference_identity + self.virtual_network_subnet_id = virtual_network_subnet_id + + +class SitePhpErrorLogFlag(ProxyOnlyResource): + """Used for getting PHP error logging flag. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param local_log_errors: Local log_errors setting. + :type local_log_errors: str + :param master_log_errors: Master log_errors setting. + :type master_log_errors: str + :param local_log_errors_max_length: Local log_errors_max_len setting. + :type local_log_errors_max_length: str + :param master_log_errors_max_length: Master log_errors_max_len setting. + :type master_log_errors_max_length: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'local_log_errors': {'key': 'properties.localLogErrors', 'type': 'str'}, + 'master_log_errors': {'key': 'properties.masterLogErrors', 'type': 'str'}, + 'local_log_errors_max_length': {'key': 'properties.localLogErrorsMaxLength', 'type': 'str'}, + 'master_log_errors_max_length': {'key': 'properties.masterLogErrorsMaxLength', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + local_log_errors: Optional[str] = None, + master_log_errors: Optional[str] = None, + local_log_errors_max_length: Optional[str] = None, + master_log_errors_max_length: Optional[str] = None, + **kwargs + ): + super(SitePhpErrorLogFlag, self).__init__(kind=kind, **kwargs) + self.local_log_errors = local_log_errors + self.master_log_errors = master_log_errors + self.local_log_errors_max_length = local_log_errors_max_length + self.master_log_errors_max_length = master_log_errors_max_length + + +class SiteSeal(msrest.serialization.Model): + """Site seal. + + All required parameters must be populated in order to send to Azure. + + :param html: Required. HTML snippet. + :type html: str + """ + + _validation = { + 'html': {'required': True}, + } + + _attribute_map = { + 'html': {'key': 'html', 'type': 'str'}, + } + + def __init__( + self, + *, + html: str, + **kwargs + ): + super(SiteSeal, self).__init__(**kwargs) + self.html = html + + +class SiteSealRequest(msrest.serialization.Model): + """Site seal request. + + :param light_theme: If :code:`true` use the light color theme for site seal; + otherwise, use the default color theme. + :type light_theme: bool + :param locale: Locale of site seal. + :type locale: str + """ + + _attribute_map = { + 'light_theme': {'key': 'lightTheme', 'type': 'bool'}, + 'locale': {'key': 'locale', 'type': 'str'}, + } + + def __init__( + self, + *, + light_theme: Optional[bool] = None, + locale: Optional[str] = None, + **kwargs + ): + super(SiteSealRequest, self).__init__(**kwargs) + self.light_theme = light_theme + self.locale = locale + + +class SiteSourceControl(ProxyOnlyResource): + """Source control configuration for an app. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param repo_url: Repository or source control URL. + :type repo_url: str + :param branch: Name of branch to use for deployment. + :type branch: str + :param is_manual_integration: :code:`true` to limit to manual integration; + :code:`false` to enable continuous integration (which configures webhooks into + online repos like GitHub). + :type is_manual_integration: bool + :param is_git_hub_action: :code:`true` if this is deployed via GitHub action. + :type is_git_hub_action: bool + :param deployment_rollback_enabled: :code:`true` to enable deployment rollback; + otherwise, :code:`false`. + :type deployment_rollback_enabled: bool + :param is_mercurial: :code:`true` for a Mercurial repository; + :code:`false` for a Git repository. + :type is_mercurial: bool + :param git_hub_action_configuration: If GitHub Action is selected, than the associated + configuration. + :type git_hub_action_configuration: + ~azure.mgmt.web.v2021_02_01.models.GitHubActionConfiguration + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'repo_url': {'key': 'properties.repoUrl', 'type': 'str'}, + 'branch': {'key': 'properties.branch', 'type': 'str'}, + 'is_manual_integration': {'key': 'properties.isManualIntegration', 'type': 'bool'}, + 'is_git_hub_action': {'key': 'properties.isGitHubAction', 'type': 'bool'}, + 'deployment_rollback_enabled': {'key': 'properties.deploymentRollbackEnabled', 'type': 'bool'}, + 'is_mercurial': {'key': 'properties.isMercurial', 'type': 'bool'}, + 'git_hub_action_configuration': {'key': 'properties.gitHubActionConfiguration', 'type': 'GitHubActionConfiguration'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + repo_url: Optional[str] = None, + branch: Optional[str] = None, + is_manual_integration: Optional[bool] = None, + is_git_hub_action: Optional[bool] = None, + deployment_rollback_enabled: Optional[bool] = None, + is_mercurial: Optional[bool] = None, + git_hub_action_configuration: Optional["GitHubActionConfiguration"] = None, + **kwargs + ): + super(SiteSourceControl, self).__init__(kind=kind, **kwargs) + self.repo_url = repo_url + self.branch = branch + self.is_manual_integration = is_manual_integration + self.is_git_hub_action = is_git_hub_action + self.deployment_rollback_enabled = deployment_rollback_enabled + self.is_mercurial = is_mercurial + self.git_hub_action_configuration = git_hub_action_configuration + + +class SkuCapacity(msrest.serialization.Model): + """Description of the App Service plan scale options. + + :param minimum: Minimum number of workers for this App Service plan SKU. + :type minimum: int + :param maximum: Maximum number of workers for this App Service plan SKU. + :type maximum: int + :param elastic_maximum: Maximum number of Elastic workers for this App Service plan SKU. + :type elastic_maximum: int + :param default: Default number of workers for this App Service plan SKU. + :type default: int + :param scale_type: Available scale configurations for an App Service plan. + :type scale_type: str + """ + + _attribute_map = { + 'minimum': {'key': 'minimum', 'type': 'int'}, + 'maximum': {'key': 'maximum', 'type': 'int'}, + 'elastic_maximum': {'key': 'elasticMaximum', 'type': 'int'}, + 'default': {'key': 'default', 'type': 'int'}, + 'scale_type': {'key': 'scaleType', 'type': 'str'}, + } + + def __init__( + self, + *, + minimum: Optional[int] = None, + maximum: Optional[int] = None, + elastic_maximum: Optional[int] = None, + default: Optional[int] = None, + scale_type: Optional[str] = None, + **kwargs + ): + super(SkuCapacity, self).__init__(**kwargs) + self.minimum = minimum + self.maximum = maximum + self.elastic_maximum = elastic_maximum + self.default = default + self.scale_type = scale_type + + +class SkuDescription(msrest.serialization.Model): + """Description of a SKU for a scalable resource. + + :param name: Name of the resource SKU. + :type name: str + :param tier: Service tier of the resource SKU. + :type tier: str + :param size: Size specifier of the resource SKU. + :type size: str + :param family: Family code of the resource SKU. + :type family: str + :param capacity: Current number of instances assigned to the resource. + :type capacity: int + :param sku_capacity: Min, max, and default scale values of the SKU. + :type sku_capacity: ~azure.mgmt.web.v2021_02_01.models.SkuCapacity + :param locations: Locations of the SKU. + :type locations: list[str] + :param capabilities: Capabilities of the SKU, e.g., is traffic manager enabled?. + :type capabilities: list[~azure.mgmt.web.v2021_02_01.models.Capability] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + 'sku_capacity': {'key': 'skuCapacity', 'type': 'SkuCapacity'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[Capability]'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + tier: Optional[str] = None, + size: Optional[str] = None, + family: Optional[str] = None, + capacity: Optional[int] = None, + sku_capacity: Optional["SkuCapacity"] = None, + locations: Optional[List[str]] = None, + capabilities: Optional[List["Capability"]] = None, + **kwargs + ): + super(SkuDescription, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.size = size + self.family = family + self.capacity = capacity + self.sku_capacity = sku_capacity + self.locations = locations + self.capabilities = capabilities + + +class SkuInfo(msrest.serialization.Model): + """SKU discovery information. + + :param resource_type: Resource type that this SKU applies to. + :type resource_type: str + :param sku: Name and tier of the SKU. + :type sku: ~azure.mgmt.web.v2021_02_01.models.SkuDescription + :param capacity: Min, max, and default scale values of the SKU. + :type capacity: ~azure.mgmt.web.v2021_02_01.models.SkuCapacity + """ + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'SkuDescription'}, + 'capacity': {'key': 'capacity', 'type': 'SkuCapacity'}, + } + + def __init__( + self, + *, + resource_type: Optional[str] = None, + sku: Optional["SkuDescription"] = None, + capacity: Optional["SkuCapacity"] = None, + **kwargs + ): + super(SkuInfo, self).__init__(**kwargs) + self.resource_type = resource_type + self.sku = sku + self.capacity = capacity + + +class SkuInfoCollection(msrest.serialization.Model): + """Collection of SKU information. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.SkuInfo] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SkuInfo]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["SkuInfo"], + **kwargs + ): + super(SkuInfoCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class SkuInfos(msrest.serialization.Model): + """Collection of SKU information. + + :param resource_type: Resource type that this SKU applies to. + :type resource_type: str + :param skus: List of SKUs the subscription is able to use. + :type skus: list[~azure.mgmt.web.v2021_02_01.models.GlobalCsmSkuDescription] + """ + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'skus': {'key': 'skus', 'type': '[GlobalCsmSkuDescription]'}, + } + + def __init__( + self, + *, + resource_type: Optional[str] = None, + skus: Optional[List["GlobalCsmSkuDescription"]] = None, + **kwargs + ): + super(SkuInfos, self).__init__(**kwargs) + self.resource_type = resource_type + self.skus = skus + + +class SlotConfigNamesResource(ProxyOnlyResource): + """Slot Config names azure resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param connection_string_names: List of connection string names. + :type connection_string_names: list[str] + :param app_setting_names: List of application settings names. + :type app_setting_names: list[str] + :param azure_storage_config_names: List of external Azure storage account identifiers. + :type azure_storage_config_names: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'connection_string_names': {'key': 'properties.connectionStringNames', 'type': '[str]'}, + 'app_setting_names': {'key': 'properties.appSettingNames', 'type': '[str]'}, + 'azure_storage_config_names': {'key': 'properties.azureStorageConfigNames', 'type': '[str]'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + connection_string_names: Optional[List[str]] = None, + app_setting_names: Optional[List[str]] = None, + azure_storage_config_names: Optional[List[str]] = None, + **kwargs + ): + super(SlotConfigNamesResource, self).__init__(kind=kind, **kwargs) + self.connection_string_names = connection_string_names + self.app_setting_names = app_setting_names + self.azure_storage_config_names = azure_storage_config_names + + +class SlotDifference(ProxyOnlyResource): + """A setting difference between two deployment slots of an app. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar level: Level of the difference: Information, Warning or Error. + :vartype level: str + :ivar setting_type: The type of the setting: General, AppSetting or ConnectionString. + :vartype setting_type: str + :ivar diff_rule: Rule that describes how to process the setting difference during a slot swap. + :vartype diff_rule: str + :ivar setting_name: Name of the setting. + :vartype setting_name: str + :ivar value_in_current_slot: Value of the setting in the current slot. + :vartype value_in_current_slot: str + :ivar value_in_target_slot: Value of the setting in the target slot. + :vartype value_in_target_slot: str + :ivar description: Description of the setting difference. + :vartype description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'level': {'readonly': True}, + 'setting_type': {'readonly': True}, + 'diff_rule': {'readonly': True}, + 'setting_name': {'readonly': True}, + 'value_in_current_slot': {'readonly': True}, + 'value_in_target_slot': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'level': {'key': 'properties.level', 'type': 'str'}, + 'setting_type': {'key': 'properties.settingType', 'type': 'str'}, + 'diff_rule': {'key': 'properties.diffRule', 'type': 'str'}, + 'setting_name': {'key': 'properties.settingName', 'type': 'str'}, + 'value_in_current_slot': {'key': 'properties.valueInCurrentSlot', 'type': 'str'}, + 'value_in_target_slot': {'key': 'properties.valueInTargetSlot', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(SlotDifference, self).__init__(kind=kind, **kwargs) + self.level = None + self.setting_type = None + self.diff_rule = None + self.setting_name = None + self.value_in_current_slot = None + self.value_in_target_slot = None + self.description = None + + +class SlotDifferenceCollection(msrest.serialization.Model): + """Collection of slot differences. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.SlotDifference] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SlotDifference]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["SlotDifference"], + **kwargs + ): + super(SlotDifferenceCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class SlotSwapStatus(msrest.serialization.Model): + """The status of the last successful slot swap operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar timestamp_utc: The time the last successful slot swap completed. + :vartype timestamp_utc: ~datetime.datetime + :ivar source_slot_name: The source slot of the last swap operation. + :vartype source_slot_name: str + :ivar destination_slot_name: The destination slot of the last swap operation. + :vartype destination_slot_name: str + """ + + _validation = { + 'timestamp_utc': {'readonly': True}, + 'source_slot_name': {'readonly': True}, + 'destination_slot_name': {'readonly': True}, + } + + _attribute_map = { + 'timestamp_utc': {'key': 'timestampUtc', 'type': 'iso-8601'}, + 'source_slot_name': {'key': 'sourceSlotName', 'type': 'str'}, + 'destination_slot_name': {'key': 'destinationSlotName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SlotSwapStatus, self).__init__(**kwargs) + self.timestamp_utc = None + self.source_slot_name = None + self.destination_slot_name = None + + +class SlowRequestsBasedTrigger(msrest.serialization.Model): + """Trigger based on request execution time. + + :param time_taken: Time taken. + :type time_taken: str + :param path: Request Path. + :type path: str + :param count: Request Count. + :type count: int + :param time_interval: Time interval. + :type time_interval: str + """ + + _attribute_map = { + 'time_taken': {'key': 'timeTaken', 'type': 'str'}, + 'path': {'key': 'path', 'type': 'str'}, + 'count': {'key': 'count', 'type': 'int'}, + 'time_interval': {'key': 'timeInterval', 'type': 'str'}, + } + + def __init__( + self, + *, + time_taken: Optional[str] = None, + path: Optional[str] = None, + count: Optional[int] = None, + time_interval: Optional[str] = None, + **kwargs + ): + super(SlowRequestsBasedTrigger, self).__init__(**kwargs) + self.time_taken = time_taken + self.path = path + self.count = count + self.time_interval = time_interval + + +class Snapshot(ProxyOnlyResource): + """A snapshot of an app. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar time: The time the snapshot was taken. + :vartype time: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'time': {'key': 'properties.time', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(Snapshot, self).__init__(kind=kind, **kwargs) + self.time = None + + +class SnapshotCollection(msrest.serialization.Model): + """Collection of snapshots which can be used to revert an app to a previous time. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.Snapshot] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Snapshot]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["Snapshot"], + **kwargs + ): + super(SnapshotCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class SnapshotRecoverySource(msrest.serialization.Model): + """Specifies the web app that snapshot contents will be retrieved from. + + :param location: Geographical location of the source web app, e.g. SouthEastAsia, + SouthCentralUS. + :type location: str + :param id: ARM resource ID of the source app. + /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + for production slots and + /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + for other slots. + :type id: str + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + id: Optional[str] = None, + **kwargs + ): + super(SnapshotRecoverySource, self).__init__(**kwargs) + self.location = location + self.id = id + + +class SnapshotRestoreRequest(ProxyOnlyResource): + """Details about app recovery operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param snapshot_time: Point in time in which the app restore should be done, formatted as a + DateTime string. + :type snapshot_time: str + :param recovery_source: Optional. Specifies the web app that snapshot contents will be + retrieved from. + If empty, the targeted web app will be used as the source. + :type recovery_source: ~azure.mgmt.web.v2021_02_01.models.SnapshotRecoverySource + :param overwrite: If :code:`true` the restore operation can overwrite source app; + otherwise, :code:`false`. + :type overwrite: bool + :param recover_configuration: If true, site configuration, in addition to content, will be + reverted. + :type recover_configuration: bool + :param ignore_conflicting_host_names: If true, custom hostname conflicts will be ignored when + recovering to a target web app. + This setting is only necessary when RecoverConfiguration is enabled. + :type ignore_conflicting_host_names: bool + :param use_dr_secondary: If true, the snapshot is retrieved from DRSecondary endpoint. + :type use_dr_secondary: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'snapshot_time': {'key': 'properties.snapshotTime', 'type': 'str'}, + 'recovery_source': {'key': 'properties.recoverySource', 'type': 'SnapshotRecoverySource'}, + 'overwrite': {'key': 'properties.overwrite', 'type': 'bool'}, + 'recover_configuration': {'key': 'properties.recoverConfiguration', 'type': 'bool'}, + 'ignore_conflicting_host_names': {'key': 'properties.ignoreConflictingHostNames', 'type': 'bool'}, + 'use_dr_secondary': {'key': 'properties.useDRSecondary', 'type': 'bool'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + snapshot_time: Optional[str] = None, + recovery_source: Optional["SnapshotRecoverySource"] = None, + overwrite: Optional[bool] = None, + recover_configuration: Optional[bool] = None, + ignore_conflicting_host_names: Optional[bool] = None, + use_dr_secondary: Optional[bool] = None, + **kwargs + ): + super(SnapshotRestoreRequest, self).__init__(kind=kind, **kwargs) + self.snapshot_time = snapshot_time + self.recovery_source = recovery_source + self.overwrite = overwrite + self.recover_configuration = recover_configuration + self.ignore_conflicting_host_names = ignore_conflicting_host_names + self.use_dr_secondary = use_dr_secondary + + +class Solution(msrest.serialization.Model): + """Class Representing Solution for problems detected. + + :param id: Solution Id. + :type id: float + :param display_name: Display Name of the solution. + :type display_name: str + :param order: Order of the solution. + :type order: float + :param description: Description of the solution. + :type description: str + :param type: Type of Solution. Possible values include: "QuickSolution", "DeepInvestigation", + "BestPractices". + :type type: str or ~azure.mgmt.web.v2021_02_01.models.SolutionType + :param data: Solution Data. + :type data: list[list[~azure.mgmt.web.v2021_02_01.models.NameValuePair]] + :param metadata: Solution Metadata. + :type metadata: list[list[~azure.mgmt.web.v2021_02_01.models.NameValuePair]] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'float'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'order': {'key': 'order', 'type': 'float'}, + 'description': {'key': 'description', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'data': {'key': 'data', 'type': '[[NameValuePair]]'}, + 'metadata': {'key': 'metadata', 'type': '[[NameValuePair]]'}, + } + + def __init__( + self, + *, + id: Optional[float] = None, + display_name: Optional[str] = None, + order: Optional[float] = None, + description: Optional[str] = None, + type: Optional[Union[str, "SolutionType"]] = None, + data: Optional[List[List["NameValuePair"]]] = None, + metadata: Optional[List[List["NameValuePair"]]] = None, + **kwargs + ): + super(Solution, self).__init__(**kwargs) + self.id = id + self.display_name = display_name + self.order = order + self.description = description + self.type = type + self.data = data + self.metadata = metadata + + +class SourceControl(ProxyOnlyResource): + """The source control OAuth token. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param token: OAuth access token. + :type token: str + :param token_secret: OAuth access token secret. + :type token_secret: str + :param refresh_token: OAuth refresh token. + :type refresh_token: str + :param expiration_time: OAuth token expiration. + :type expiration_time: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'token': {'key': 'properties.token', 'type': 'str'}, + 'token_secret': {'key': 'properties.tokenSecret', 'type': 'str'}, + 'refresh_token': {'key': 'properties.refreshToken', 'type': 'str'}, + 'expiration_time': {'key': 'properties.expirationTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + token: Optional[str] = None, + token_secret: Optional[str] = None, + refresh_token: Optional[str] = None, + expiration_time: Optional[datetime.datetime] = None, + **kwargs + ): + super(SourceControl, self).__init__(kind=kind, **kwargs) + self.token = token + self.token_secret = token_secret + self.refresh_token = refresh_token + self.expiration_time = expiration_time + + +class SourceControlCollection(msrest.serialization.Model): + """Collection of source controls. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.SourceControl] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SourceControl]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["SourceControl"], + **kwargs + ): + super(SourceControlCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class StackMajorVersion(msrest.serialization.Model): + """Application stack major version. + + :param display_version: Application stack major version (display only). + :type display_version: str + :param runtime_version: Application stack major version (runtime only). + :type runtime_version: str + :param is_default: :code:`true` if this is the default major version; otherwise, + :code:`false`. + :type is_default: bool + :param minor_versions: Minor versions associated with the major version. + :type minor_versions: list[~azure.mgmt.web.v2021_02_01.models.StackMinorVersion] + :param application_insights: :code:`true` if this supports Application Insights; + otherwise, :code:`false`. + :type application_insights: bool + :param is_preview: :code:`true` if this stack is in Preview, otherwise + :code:`false`. + :type is_preview: bool + :param is_deprecated: :code:`true` if this stack has been deprecated, otherwise + :code:`false`. + :type is_deprecated: bool + :param is_hidden: :code:`true` if this stack should be hidden for new customers on + portal, otherwise :code:`false`. + :type is_hidden: bool + :param app_settings_dictionary: :code:` + + ` + Example: All the function apps need AppSetting: "FUNCTIONS_WORKER_RUNTIME" to be set stack + name. + :type app_settings_dictionary: dict[str, any] + :param site_config_properties_dictionary: :code:` + + ` + Example: All Linux Function Apps, need Use32BitWorkerProcess to be set to 0. + :type site_config_properties_dictionary: dict[str, any] + """ + + _attribute_map = { + 'display_version': {'key': 'displayVersion', 'type': 'str'}, + 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, + 'is_default': {'key': 'isDefault', 'type': 'bool'}, + 'minor_versions': {'key': 'minorVersions', 'type': '[StackMinorVersion]'}, + 'application_insights': {'key': 'applicationInsights', 'type': 'bool'}, + 'is_preview': {'key': 'isPreview', 'type': 'bool'}, + 'is_deprecated': {'key': 'isDeprecated', 'type': 'bool'}, + 'is_hidden': {'key': 'isHidden', 'type': 'bool'}, + 'app_settings_dictionary': {'key': 'appSettingsDictionary', 'type': '{object}'}, + 'site_config_properties_dictionary': {'key': 'siteConfigPropertiesDictionary', 'type': '{object}'}, + } + + def __init__( + self, + *, + display_version: Optional[str] = None, + runtime_version: Optional[str] = None, + is_default: Optional[bool] = None, + minor_versions: Optional[List["StackMinorVersion"]] = None, + application_insights: Optional[bool] = None, + is_preview: Optional[bool] = None, + is_deprecated: Optional[bool] = None, + is_hidden: Optional[bool] = None, + app_settings_dictionary: Optional[Dict[str, Any]] = None, + site_config_properties_dictionary: Optional[Dict[str, Any]] = None, + **kwargs + ): + super(StackMajorVersion, self).__init__(**kwargs) + self.display_version = display_version + self.runtime_version = runtime_version + self.is_default = is_default + self.minor_versions = minor_versions + self.application_insights = application_insights + self.is_preview = is_preview + self.is_deprecated = is_deprecated + self.is_hidden = is_hidden + self.app_settings_dictionary = app_settings_dictionary + self.site_config_properties_dictionary = site_config_properties_dictionary + + +class StackMinorVersion(msrest.serialization.Model): + """Application stack minor version. + + :param display_version: Application stack minor version (display only). + :type display_version: str + :param runtime_version: Application stack minor version (runtime only). + :type runtime_version: str + :param is_default: :code:`true` if this is the default minor version; otherwise, + :code:`false`. + :type is_default: bool + :param is_remote_debugging_enabled: :code:`true` if this supports Remote + Debugging, otherwise :code:`false`. + :type is_remote_debugging_enabled: bool + """ + + _attribute_map = { + 'display_version': {'key': 'displayVersion', 'type': 'str'}, + 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, + 'is_default': {'key': 'isDefault', 'type': 'bool'}, + 'is_remote_debugging_enabled': {'key': 'isRemoteDebuggingEnabled', 'type': 'bool'}, + } + + def __init__( + self, + *, + display_version: Optional[str] = None, + runtime_version: Optional[str] = None, + is_default: Optional[bool] = None, + is_remote_debugging_enabled: Optional[bool] = None, + **kwargs + ): + super(StackMinorVersion, self).__init__(**kwargs) + self.display_version = display_version + self.runtime_version = runtime_version + self.is_default = is_default + self.is_remote_debugging_enabled = is_remote_debugging_enabled + + +class StampCapacity(msrest.serialization.Model): + """Stamp capacity information. + + :param name: Name of the stamp. + :type name: str + :param available_capacity: Available capacity (# of machines, bytes of storage etc...). + :type available_capacity: long + :param total_capacity: Total capacity (# of machines, bytes of storage etc...). + :type total_capacity: long + :param unit: Name of the unit. + :type unit: str + :param compute_mode: Shared/dedicated workers. Possible values include: "Shared", "Dedicated", + "Dynamic". + :type compute_mode: str or ~azure.mgmt.web.v2021_02_01.models.ComputeModeOptions + :param worker_size: Size of the machines. Possible values include: "Small", "Medium", "Large", + "D1", "D2", "D3", "SmallV3", "MediumV3", "LargeV3", "NestedSmall", "NestedSmallLinux", + "Default". + :type worker_size: str or ~azure.mgmt.web.v2021_02_01.models.WorkerSizeOptions + :param worker_size_id: Size ID of machines: + 0 - Small + 1 - Medium + 2 - Large. + :type worker_size_id: int + :param exclude_from_capacity_allocation: If :code:`true`, it includes basic apps. + Basic apps are not used for capacity allocation. + :type exclude_from_capacity_allocation: bool + :param is_applicable_for_all_compute_modes: :code:`true` if capacity is applicable + for all apps; otherwise, :code:`false`. + :type is_applicable_for_all_compute_modes: bool + :param site_mode: Shared or Dedicated. + :type site_mode: str + :param is_linux: Is this a linux stamp capacity. + :type is_linux: bool + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'available_capacity': {'key': 'availableCapacity', 'type': 'long'}, + 'total_capacity': {'key': 'totalCapacity', 'type': 'long'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'compute_mode': {'key': 'computeMode', 'type': 'str'}, + 'worker_size': {'key': 'workerSize', 'type': 'str'}, + 'worker_size_id': {'key': 'workerSizeId', 'type': 'int'}, + 'exclude_from_capacity_allocation': {'key': 'excludeFromCapacityAllocation', 'type': 'bool'}, + 'is_applicable_for_all_compute_modes': {'key': 'isApplicableForAllComputeModes', 'type': 'bool'}, + 'site_mode': {'key': 'siteMode', 'type': 'str'}, + 'is_linux': {'key': 'isLinux', 'type': 'bool'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + available_capacity: Optional[int] = None, + total_capacity: Optional[int] = None, + unit: Optional[str] = None, + compute_mode: Optional[Union[str, "ComputeModeOptions"]] = None, + worker_size: Optional[Union[str, "WorkerSizeOptions"]] = None, + worker_size_id: Optional[int] = None, + exclude_from_capacity_allocation: Optional[bool] = None, + is_applicable_for_all_compute_modes: Optional[bool] = None, + site_mode: Optional[str] = None, + is_linux: Optional[bool] = None, + **kwargs + ): + super(StampCapacity, self).__init__(**kwargs) + self.name = name + self.available_capacity = available_capacity + self.total_capacity = total_capacity + self.unit = unit + self.compute_mode = compute_mode + self.worker_size = worker_size + self.worker_size_id = worker_size_id + self.exclude_from_capacity_allocation = exclude_from_capacity_allocation + self.is_applicable_for_all_compute_modes = is_applicable_for_all_compute_modes + self.site_mode = site_mode + self.is_linux = is_linux + + +class StampCapacityCollection(msrest.serialization.Model): + """Collection of stamp capacities. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.StampCapacity] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[StampCapacity]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["StampCapacity"], + **kwargs + ): + super(StampCapacityCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class StaticSiteARMResource(Resource): + """Static Site ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :param location: Required. Resource Location. + :type location: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param sku: Description of a SKU for a scalable resource. + :type sku: ~azure.mgmt.web.v2021_02_01.models.SkuDescription + :param identity: Managed service identity. + :type identity: ~azure.mgmt.web.v2021_02_01.models.ManagedServiceIdentity + :ivar default_hostname: The default autogenerated hostname for the static site. + :vartype default_hostname: str + :param repository_url: URL for the repository of the static site. + :type repository_url: str + :param branch: The target branch in the repository. + :type branch: str + :ivar custom_domains: The custom domains associated with this static site. + :vartype custom_domains: list[str] + :param repository_token: A user's github repository token. This is used to setup the Github + Actions workflow file and API secrets. + :type repository_token: str + :param build_properties: Build properties to configure on the repository. + :type build_properties: ~azure.mgmt.web.v2021_02_01.models.StaticSiteBuildProperties + :ivar private_endpoint_connections: Private endpoint connections. + :vartype private_endpoint_connections: + list[~azure.mgmt.web.v2021_02_01.models.ResponseMessageEnvelopeRemotePrivateEndpointConnection] + :param staging_environment_policy: State indicating whether staging environments are allowed or + not allowed for a static web app. Possible values include: "Enabled", "Disabled". + :type staging_environment_policy: str or + ~azure.mgmt.web.v2021_02_01.models.StagingEnvironmentPolicy + :param allow_config_file_updates: :code:`false` if config file is locked for this + static web app; otherwise, :code:`true`. + :type allow_config_file_updates: bool + :param template_properties: Template options for generating a new repository. + :type template_properties: ~azure.mgmt.web.v2021_02_01.models.StaticSiteTemplateOptions + :ivar content_distribution_endpoint: The content distribution endpoint for the static site. + :vartype content_distribution_endpoint: str + :ivar key_vault_reference_identity: Identity to use for Key Vault Reference authentication. + :vartype key_vault_reference_identity: str + :ivar user_provided_function_apps: User provided function apps registered with the static site. + :vartype user_provided_function_apps: + list[~azure.mgmt.web.v2021_02_01.models.StaticSiteUserProvidedFunctionApp] + :ivar provider: The provider that submitted the last deployment to the primary environment of + the static site. + :vartype provider: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'type': {'readonly': True}, + 'default_hostname': {'readonly': True}, + 'custom_domains': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, + 'content_distribution_endpoint': {'readonly': True}, + 'key_vault_reference_identity': {'readonly': True}, + 'user_provided_function_apps': {'readonly': True}, + 'provider': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'SkuDescription'}, + 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, + 'default_hostname': {'key': 'properties.defaultHostname', 'type': 'str'}, + 'repository_url': {'key': 'properties.repositoryUrl', 'type': 'str'}, + 'branch': {'key': 'properties.branch', 'type': 'str'}, + 'custom_domains': {'key': 'properties.customDomains', 'type': '[str]'}, + 'repository_token': {'key': 'properties.repositoryToken', 'type': 'str'}, + 'build_properties': {'key': 'properties.buildProperties', 'type': 'StaticSiteBuildProperties'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[ResponseMessageEnvelopeRemotePrivateEndpointConnection]'}, + 'staging_environment_policy': {'key': 'properties.stagingEnvironmentPolicy', 'type': 'str'}, + 'allow_config_file_updates': {'key': 'properties.allowConfigFileUpdates', 'type': 'bool'}, + 'template_properties': {'key': 'properties.templateProperties', 'type': 'StaticSiteTemplateOptions'}, + 'content_distribution_endpoint': {'key': 'properties.contentDistributionEndpoint', 'type': 'str'}, + 'key_vault_reference_identity': {'key': 'properties.keyVaultReferenceIdentity', 'type': 'str'}, + 'user_provided_function_apps': {'key': 'properties.userProvidedFunctionApps', 'type': '[StaticSiteUserProvidedFunctionApp]'}, + 'provider': {'key': 'properties.provider', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + kind: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + sku: Optional["SkuDescription"] = None, + identity: Optional["ManagedServiceIdentity"] = None, + repository_url: Optional[str] = None, + branch: Optional[str] = None, + repository_token: Optional[str] = None, + build_properties: Optional["StaticSiteBuildProperties"] = None, + staging_environment_policy: Optional[Union[str, "StagingEnvironmentPolicy"]] = None, + allow_config_file_updates: Optional[bool] = None, + template_properties: Optional["StaticSiteTemplateOptions"] = None, + **kwargs + ): + super(StaticSiteARMResource, self).__init__(kind=kind, location=location, tags=tags, **kwargs) + self.sku = sku + self.identity = identity + self.default_hostname = None + self.repository_url = repository_url + self.branch = branch + self.custom_domains = None + self.repository_token = repository_token + self.build_properties = build_properties + self.private_endpoint_connections = None + self.staging_environment_policy = staging_environment_policy + self.allow_config_file_updates = allow_config_file_updates + self.template_properties = template_properties + self.content_distribution_endpoint = None + self.key_vault_reference_identity = None + self.user_provided_function_apps = None + self.provider = None + + +class StaticSiteBuildARMResource(ProxyOnlyResource): + """Static Site Build ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar build_id: An identifier for the static site build. + :vartype build_id: str + :ivar source_branch: The source branch. + :vartype source_branch: str + :ivar pull_request_title: The title of a pull request that a static site build is related to. + :vartype pull_request_title: str + :ivar hostname: The hostname for a static site build. + :vartype hostname: str + :ivar created_time_utc: When this build was created. + :vartype created_time_utc: ~datetime.datetime + :ivar last_updated_on: When this build was updated. + :vartype last_updated_on: ~datetime.datetime + :ivar status: The status of the static site build. Possible values include: + "WaitingForDeployment", "Uploading", "Deploying", "Ready", "Failed", "Deleting", "Detached". + :vartype status: str or ~azure.mgmt.web.v2021_02_01.models.BuildStatus + :ivar user_provided_function_apps: User provided function apps registered with the static site + build. + :vartype user_provided_function_apps: + list[~azure.mgmt.web.v2021_02_01.models.StaticSiteUserProvidedFunctionApp] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'build_id': {'readonly': True}, + 'source_branch': {'readonly': True}, + 'pull_request_title': {'readonly': True}, + 'hostname': {'readonly': True}, + 'created_time_utc': {'readonly': True}, + 'last_updated_on': {'readonly': True}, + 'status': {'readonly': True}, + 'user_provided_function_apps': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'build_id': {'key': 'properties.buildId', 'type': 'str'}, + 'source_branch': {'key': 'properties.sourceBranch', 'type': 'str'}, + 'pull_request_title': {'key': 'properties.pullRequestTitle', 'type': 'str'}, + 'hostname': {'key': 'properties.hostname', 'type': 'str'}, + 'created_time_utc': {'key': 'properties.createdTimeUtc', 'type': 'iso-8601'}, + 'last_updated_on': {'key': 'properties.lastUpdatedOn', 'type': 'iso-8601'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'user_provided_function_apps': {'key': 'properties.userProvidedFunctionApps', 'type': '[StaticSiteUserProvidedFunctionApp]'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(StaticSiteBuildARMResource, self).__init__(kind=kind, **kwargs) + self.build_id = None + self.source_branch = None + self.pull_request_title = None + self.hostname = None + self.created_time_utc = None + self.last_updated_on = None + self.status = None + self.user_provided_function_apps = None + + +class StaticSiteBuildCollection(msrest.serialization.Model): + """Collection of static site builds. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.StaticSiteBuildARMResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[StaticSiteBuildARMResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["StaticSiteBuildARMResource"], + **kwargs + ): + super(StaticSiteBuildCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class StaticSiteBuildProperties(msrest.serialization.Model): + """Build properties for the static site. + + :param app_location: The path to the app code within the repository. + :type app_location: str + :param api_location: The path to the api code within the repository. + :type api_location: str + :param app_artifact_location: Deprecated: The path of the app artifacts after building + (deprecated in favor of OutputLocation). + :type app_artifact_location: str + :param output_location: The output path of the app after building. + :type output_location: str + :param app_build_command: A custom command to run during deployment of the static content + application. + :type app_build_command: str + :param api_build_command: A custom command to run during deployment of the Azure Functions API + application. + :type api_build_command: str + :param skip_github_action_workflow_generation: Skip Github Action workflow generation. + :type skip_github_action_workflow_generation: bool + :param github_action_secret_name_override: Github Action secret name override. + :type github_action_secret_name_override: str + """ + + _attribute_map = { + 'app_location': {'key': 'appLocation', 'type': 'str'}, + 'api_location': {'key': 'apiLocation', 'type': 'str'}, + 'app_artifact_location': {'key': 'appArtifactLocation', 'type': 'str'}, + 'output_location': {'key': 'outputLocation', 'type': 'str'}, + 'app_build_command': {'key': 'appBuildCommand', 'type': 'str'}, + 'api_build_command': {'key': 'apiBuildCommand', 'type': 'str'}, + 'skip_github_action_workflow_generation': {'key': 'skipGithubActionWorkflowGeneration', 'type': 'bool'}, + 'github_action_secret_name_override': {'key': 'githubActionSecretNameOverride', 'type': 'str'}, + } + + def __init__( + self, + *, + app_location: Optional[str] = None, + api_location: Optional[str] = None, + app_artifact_location: Optional[str] = None, + output_location: Optional[str] = None, + app_build_command: Optional[str] = None, + api_build_command: Optional[str] = None, + skip_github_action_workflow_generation: Optional[bool] = None, + github_action_secret_name_override: Optional[str] = None, + **kwargs + ): + super(StaticSiteBuildProperties, self).__init__(**kwargs) + self.app_location = app_location + self.api_location = api_location + self.app_artifact_location = app_artifact_location + self.output_location = output_location + self.app_build_command = app_build_command + self.api_build_command = api_build_command + self.skip_github_action_workflow_generation = skip_github_action_workflow_generation + self.github_action_secret_name_override = github_action_secret_name_override + + +class StaticSiteCollection(msrest.serialization.Model): + """Collection of static sites. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.StaticSiteARMResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[StaticSiteARMResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["StaticSiteARMResource"], + **kwargs + ): + super(StaticSiteCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class StaticSiteCustomDomainOverviewARMResource(ProxyOnlyResource): + """Static Site Custom Domain Overview ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar domain_name: The domain name for the static site custom domain. + :vartype domain_name: str + :ivar created_on: The date and time on which the custom domain was created for the static site. + :vartype created_on: ~datetime.datetime + :ivar status: The status of the custom domain. Possible values include: + "RetrievingValidationToken", "Validating", "Adding", "Ready", "Failed", "Deleting". + :vartype status: str or ~azure.mgmt.web.v2021_02_01.models.CustomDomainStatus + :ivar validation_token: The TXT record validation token. + :vartype validation_token: str + :ivar error_message: + :vartype error_message: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'domain_name': {'readonly': True}, + 'created_on': {'readonly': True}, + 'status': {'readonly': True}, + 'validation_token': {'readonly': True}, + 'error_message': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'domain_name': {'key': 'properties.domainName', 'type': 'str'}, + 'created_on': {'key': 'properties.createdOn', 'type': 'iso-8601'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'validation_token': {'key': 'properties.validationToken', 'type': 'str'}, + 'error_message': {'key': 'properties.errorMessage', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(StaticSiteCustomDomainOverviewARMResource, self).__init__(kind=kind, **kwargs) + self.domain_name = None + self.created_on = None + self.status = None + self.validation_token = None + self.error_message = None + + +class StaticSiteCustomDomainOverviewCollection(msrest.serialization.Model): + """Collection of static site custom domains. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.StaticSiteCustomDomainOverviewARMResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[StaticSiteCustomDomainOverviewARMResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["StaticSiteCustomDomainOverviewARMResource"], + **kwargs + ): + super(StaticSiteCustomDomainOverviewCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class StaticSiteCustomDomainRequestPropertiesARMResource(ProxyOnlyResource): + """Static Site Custom Domain Request Properties ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param validation_method: Validation method for adding a custom domain. + :type validation_method: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'validation_method': {'key': 'properties.validationMethod', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + validation_method: Optional[str] = "cname-delegation", + **kwargs + ): + super(StaticSiteCustomDomainRequestPropertiesARMResource, self).__init__(kind=kind, **kwargs) + self.validation_method = validation_method + + +class StaticSiteFunctionOverviewARMResource(ProxyOnlyResource): + """Static Site Function Overview ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar function_name: The name for the function. + :vartype function_name: str + :ivar trigger_type: The trigger type of the function. Possible values include: "HttpTrigger", + "Unknown". + :vartype trigger_type: str or ~azure.mgmt.web.v2021_02_01.models.TriggerTypes + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'function_name': {'readonly': True}, + 'trigger_type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'function_name': {'key': 'properties.functionName', 'type': 'str'}, + 'trigger_type': {'key': 'properties.triggerType', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(StaticSiteFunctionOverviewARMResource, self).__init__(kind=kind, **kwargs) + self.function_name = None + self.trigger_type = None + + +class StaticSiteFunctionOverviewCollection(msrest.serialization.Model): + """Collection of static site functions. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.StaticSiteFunctionOverviewARMResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[StaticSiteFunctionOverviewARMResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["StaticSiteFunctionOverviewARMResource"], + **kwargs + ): + super(StaticSiteFunctionOverviewCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class StaticSitePatchResource(ProxyOnlyResource): + """ARM resource for a static site when patching. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar default_hostname: The default autogenerated hostname for the static site. + :vartype default_hostname: str + :param repository_url: URL for the repository of the static site. + :type repository_url: str + :param branch: The target branch in the repository. + :type branch: str + :ivar custom_domains: The custom domains associated with this static site. + :vartype custom_domains: list[str] + :param repository_token: A user's github repository token. This is used to setup the Github + Actions workflow file and API secrets. + :type repository_token: str + :param build_properties: Build properties to configure on the repository. + :type build_properties: ~azure.mgmt.web.v2021_02_01.models.StaticSiteBuildProperties + :ivar private_endpoint_connections: Private endpoint connections. + :vartype private_endpoint_connections: + list[~azure.mgmt.web.v2021_02_01.models.ResponseMessageEnvelopeRemotePrivateEndpointConnection] + :param staging_environment_policy: State indicating whether staging environments are allowed or + not allowed for a static web app. Possible values include: "Enabled", "Disabled". + :type staging_environment_policy: str or + ~azure.mgmt.web.v2021_02_01.models.StagingEnvironmentPolicy + :param allow_config_file_updates: :code:`false` if config file is locked for this + static web app; otherwise, :code:`true`. + :type allow_config_file_updates: bool + :param template_properties: Template options for generating a new repository. + :type template_properties: ~azure.mgmt.web.v2021_02_01.models.StaticSiteTemplateOptions + :ivar content_distribution_endpoint: The content distribution endpoint for the static site. + :vartype content_distribution_endpoint: str + :ivar key_vault_reference_identity: Identity to use for Key Vault Reference authentication. + :vartype key_vault_reference_identity: str + :ivar user_provided_function_apps: User provided function apps registered with the static site. + :vartype user_provided_function_apps: + list[~azure.mgmt.web.v2021_02_01.models.StaticSiteUserProvidedFunctionApp] + :ivar provider: The provider that submitted the last deployment to the primary environment of + the static site. + :vartype provider: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'default_hostname': {'readonly': True}, + 'custom_domains': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, + 'content_distribution_endpoint': {'readonly': True}, + 'key_vault_reference_identity': {'readonly': True}, + 'user_provided_function_apps': {'readonly': True}, + 'provider': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'default_hostname': {'key': 'properties.defaultHostname', 'type': 'str'}, + 'repository_url': {'key': 'properties.repositoryUrl', 'type': 'str'}, + 'branch': {'key': 'properties.branch', 'type': 'str'}, + 'custom_domains': {'key': 'properties.customDomains', 'type': '[str]'}, + 'repository_token': {'key': 'properties.repositoryToken', 'type': 'str'}, + 'build_properties': {'key': 'properties.buildProperties', 'type': 'StaticSiteBuildProperties'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[ResponseMessageEnvelopeRemotePrivateEndpointConnection]'}, + 'staging_environment_policy': {'key': 'properties.stagingEnvironmentPolicy', 'type': 'str'}, + 'allow_config_file_updates': {'key': 'properties.allowConfigFileUpdates', 'type': 'bool'}, + 'template_properties': {'key': 'properties.templateProperties', 'type': 'StaticSiteTemplateOptions'}, + 'content_distribution_endpoint': {'key': 'properties.contentDistributionEndpoint', 'type': 'str'}, + 'key_vault_reference_identity': {'key': 'properties.keyVaultReferenceIdentity', 'type': 'str'}, + 'user_provided_function_apps': {'key': 'properties.userProvidedFunctionApps', 'type': '[StaticSiteUserProvidedFunctionApp]'}, + 'provider': {'key': 'properties.provider', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + repository_url: Optional[str] = None, + branch: Optional[str] = None, + repository_token: Optional[str] = None, + build_properties: Optional["StaticSiteBuildProperties"] = None, + staging_environment_policy: Optional[Union[str, "StagingEnvironmentPolicy"]] = None, + allow_config_file_updates: Optional[bool] = None, + template_properties: Optional["StaticSiteTemplateOptions"] = None, + **kwargs + ): + super(StaticSitePatchResource, self).__init__(kind=kind, **kwargs) + self.default_hostname = None + self.repository_url = repository_url + self.branch = branch + self.custom_domains = None + self.repository_token = repository_token + self.build_properties = build_properties + self.private_endpoint_connections = None + self.staging_environment_policy = staging_environment_policy + self.allow_config_file_updates = allow_config_file_updates + self.template_properties = template_properties + self.content_distribution_endpoint = None + self.key_vault_reference_identity = None + self.user_provided_function_apps = None + self.provider = None + + +class StaticSiteResetPropertiesARMResource(ProxyOnlyResource): + """Static Site Reset Properties ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param repository_token: The token which proves admin privileges to the repository. + :type repository_token: str + :param should_update_repository: Determines whether the repository should be updated with the + new properties. + :type should_update_repository: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'repository_token': {'key': 'properties.repositoryToken', 'type': 'str'}, + 'should_update_repository': {'key': 'properties.shouldUpdateRepository', 'type': 'bool'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + repository_token: Optional[str] = None, + should_update_repository: Optional[bool] = None, + **kwargs + ): + super(StaticSiteResetPropertiesARMResource, self).__init__(kind=kind, **kwargs) + self.repository_token = repository_token + self.should_update_repository = should_update_repository + + +class StaticSitesWorkflowPreview(ProxyOnlyResource): + """Preview for the Static Site Workflow to be generated. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar path: The path for the workflow file to be generated. + :vartype path: str + :ivar contents: The contents for the workflow file to be generated. + :vartype contents: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'path': {'readonly': True}, + 'contents': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'path': {'key': 'properties.path', 'type': 'str'}, + 'contents': {'key': 'properties.contents', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(StaticSitesWorkflowPreview, self).__init__(kind=kind, **kwargs) + self.path = None + self.contents = None + + +class StaticSitesWorkflowPreviewRequest(ProxyOnlyResource): + """Request entity for previewing the Static Site workflow. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param repository_url: URL for the repository of the static site. + :type repository_url: str + :param branch: The target branch in the repository. + :type branch: str + :param build_properties: Build properties to configure on the repository. + :type build_properties: ~azure.mgmt.web.v2021_02_01.models.StaticSiteBuildProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'repository_url': {'key': 'properties.repositoryUrl', 'type': 'str'}, + 'branch': {'key': 'properties.branch', 'type': 'str'}, + 'build_properties': {'key': 'properties.buildProperties', 'type': 'StaticSiteBuildProperties'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + repository_url: Optional[str] = None, + branch: Optional[str] = None, + build_properties: Optional["StaticSiteBuildProperties"] = None, + **kwargs + ): + super(StaticSitesWorkflowPreviewRequest, self).__init__(kind=kind, **kwargs) + self.repository_url = repository_url + self.branch = branch + self.build_properties = build_properties + + +class StaticSiteTemplateOptions(msrest.serialization.Model): + """Template Options for the static site. + + :param template_repository_url: URL of the template repository. The newly generated repository + will be based on this one. + :type template_repository_url: str + :param owner: Owner of the newly generated repository. + :type owner: str + :param repository_name: Name of the newly generated repository. + :type repository_name: str + :param description: Description of the newly generated repository. + :type description: str + :param is_private: Whether or not the newly generated repository is a private repository. + Defaults to false (i.e. public). + :type is_private: bool + """ + + _attribute_map = { + 'template_repository_url': {'key': 'templateRepositoryUrl', 'type': 'str'}, + 'owner': {'key': 'owner', 'type': 'str'}, + 'repository_name': {'key': 'repositoryName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'is_private': {'key': 'isPrivate', 'type': 'bool'}, + } + + def __init__( + self, + *, + template_repository_url: Optional[str] = None, + owner: Optional[str] = None, + repository_name: Optional[str] = None, + description: Optional[str] = None, + is_private: Optional[bool] = None, + **kwargs + ): + super(StaticSiteTemplateOptions, self).__init__(**kwargs) + self.template_repository_url = template_repository_url + self.owner = owner + self.repository_name = repository_name + self.description = description + self.is_private = is_private + + +class StaticSiteUserARMResource(ProxyOnlyResource): + """Static Site User ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar provider: The identity provider for the static site user. + :vartype provider: str + :ivar user_id: The user id for the static site user. + :vartype user_id: str + :ivar display_name: The display name for the static site user. + :vartype display_name: str + :param roles: The roles for the static site user, in free-form string format. + :type roles: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provider': {'readonly': True}, + 'user_id': {'readonly': True}, + 'display_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'provider': {'key': 'properties.provider', 'type': 'str'}, + 'user_id': {'key': 'properties.userId', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'roles': {'key': 'properties.roles', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + roles: Optional[str] = None, + **kwargs + ): + super(StaticSiteUserARMResource, self).__init__(kind=kind, **kwargs) + self.provider = None + self.user_id = None + self.display_name = None + self.roles = roles + + +class StaticSiteUserCollection(msrest.serialization.Model): + """Collection of static site custom users. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.StaticSiteUserARMResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[StaticSiteUserARMResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["StaticSiteUserARMResource"], + **kwargs + ): + super(StaticSiteUserCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class StaticSiteUserInvitationRequestResource(ProxyOnlyResource): + """Static sites user roles invitation resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param domain: The domain name for the static site custom domain. + :type domain: str + :param provider: The identity provider for the static site user. + :type provider: str + :param user_details: The user id for the static site user. + :type user_details: str + :param roles: The roles for the static site user, in free-form string format. + :type roles: str + :param num_hours_to_expiration: The number of hours the sas token stays valid. + :type num_hours_to_expiration: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'domain': {'key': 'properties.domain', 'type': 'str'}, + 'provider': {'key': 'properties.provider', 'type': 'str'}, + 'user_details': {'key': 'properties.userDetails', 'type': 'str'}, + 'roles': {'key': 'properties.roles', 'type': 'str'}, + 'num_hours_to_expiration': {'key': 'properties.numHoursToExpiration', 'type': 'int'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + domain: Optional[str] = None, + provider: Optional[str] = None, + user_details: Optional[str] = None, + roles: Optional[str] = None, + num_hours_to_expiration: Optional[int] = None, + **kwargs + ): + super(StaticSiteUserInvitationRequestResource, self).__init__(kind=kind, **kwargs) + self.domain = domain + self.provider = provider + self.user_details = user_details + self.roles = roles + self.num_hours_to_expiration = num_hours_to_expiration + + +class StaticSiteUserInvitationResponseResource(ProxyOnlyResource): + """Static sites user roles invitation link resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar expires_on: The expiration time of the invitation. + :vartype expires_on: ~datetime.datetime + :ivar invitation_url: The url for the invitation link. + :vartype invitation_url: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'expires_on': {'readonly': True}, + 'invitation_url': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'expires_on': {'key': 'properties.expiresOn', 'type': 'iso-8601'}, + 'invitation_url': {'key': 'properties.invitationUrl', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(StaticSiteUserInvitationResponseResource, self).__init__(kind=kind, **kwargs) + self.expires_on = None + self.invitation_url = None + + +class StaticSiteUserProvidedFunctionApp(ProxyOnlyResource): + """A static site user provided function. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param function_app_resource_id: The resource id of the function app registered with the static + site. + :type function_app_resource_id: str + :param function_app_region: The region of the function app registered with the static site. + :type function_app_region: str + :ivar created_on: The date and time on which the function app was registered with the static + site. + :vartype created_on: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'created_on': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'function_app_resource_id': {'key': 'properties.functionAppResourceId', 'type': 'str'}, + 'function_app_region': {'key': 'properties.functionAppRegion', 'type': 'str'}, + 'created_on': {'key': 'properties.createdOn', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + function_app_resource_id: Optional[str] = None, + function_app_region: Optional[str] = None, + **kwargs + ): + super(StaticSiteUserProvidedFunctionApp, self).__init__(kind=kind, **kwargs) + self.function_app_resource_id = function_app_resource_id + self.function_app_region = function_app_region + self.created_on = None + + +class StaticSiteUserProvidedFunctionAppARMResource(ProxyOnlyResource): + """Static Site User Provided Function App ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param function_app_resource_id: The resource id of the function app registered with the static + site. + :type function_app_resource_id: str + :param function_app_region: The region of the function app registered with the static site. + :type function_app_region: str + :ivar created_on: The date and time on which the function app was registered with the static + site. + :vartype created_on: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'created_on': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'function_app_resource_id': {'key': 'properties.functionAppResourceId', 'type': 'str'}, + 'function_app_region': {'key': 'properties.functionAppRegion', 'type': 'str'}, + 'created_on': {'key': 'properties.createdOn', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + function_app_resource_id: Optional[str] = None, + function_app_region: Optional[str] = None, + **kwargs + ): + super(StaticSiteUserProvidedFunctionAppARMResource, self).__init__(kind=kind, **kwargs) + self.function_app_resource_id = function_app_resource_id + self.function_app_region = function_app_region + self.created_on = None + + +class StaticSiteUserProvidedFunctionAppsCollection(msrest.serialization.Model): + """Collection of static site user provided function apps. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: + list[~azure.mgmt.web.v2021_02_01.models.StaticSiteUserProvidedFunctionAppARMResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[StaticSiteUserProvidedFunctionAppARMResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["StaticSiteUserProvidedFunctionAppARMResource"], + **kwargs + ): + super(StaticSiteUserProvidedFunctionAppsCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class StaticSiteZipDeploymentARMResource(ProxyOnlyResource): + """Static site zip deployment ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param app_zip_url: URL for the zipped app content. + :type app_zip_url: str + :param api_zip_url: URL for the zipped api content. + :type api_zip_url: str + :param deployment_title: A title to label the deployment. + :type deployment_title: str + :param provider: The provider submitting this deployment. + :type provider: str + :param function_language: The language of the api content, if it exists. + :type function_language: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'app_zip_url': {'key': 'properties.appZipUrl', 'type': 'str'}, + 'api_zip_url': {'key': 'properties.apiZipUrl', 'type': 'str'}, + 'deployment_title': {'key': 'properties.deploymentTitle', 'type': 'str'}, + 'provider': {'key': 'properties.provider', 'type': 'str'}, + 'function_language': {'key': 'properties.functionLanguage', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + app_zip_url: Optional[str] = None, + api_zip_url: Optional[str] = None, + deployment_title: Optional[str] = None, + provider: Optional[str] = None, + function_language: Optional[str] = None, + **kwargs + ): + super(StaticSiteZipDeploymentARMResource, self).__init__(kind=kind, **kwargs) + self.app_zip_url = app_zip_url + self.api_zip_url = api_zip_url + self.deployment_title = deployment_title + self.provider = provider + self.function_language = function_language + + +class Status(msrest.serialization.Model): + """Identify the status of the most severe insight generated by the detector. + + :param message: Descriptive message. + :type message: str + :param status_id: Level of the most severe insight generated by the detector. Possible values + include: "Critical", "Warning", "Info", "Success", "None". + :type status_id: str or ~azure.mgmt.web.v2021_02_01.models.InsightStatus + """ + + _attribute_map = { + 'message': {'key': 'message', 'type': 'str'}, + 'status_id': {'key': 'statusId', 'type': 'str'}, + } + + def __init__( + self, + *, + message: Optional[str] = None, + status_id: Optional[Union[str, "InsightStatus"]] = None, + **kwargs + ): + super(Status, self).__init__(**kwargs) + self.message = message + self.status_id = status_id + + +class StatusCodesBasedTrigger(msrest.serialization.Model): + """Trigger based on status code. + + :param status: HTTP status code. + :type status: int + :param sub_status: Request Sub Status. + :type sub_status: int + :param win32_status: Win32 error code. + :type win32_status: int + :param count: Request Count. + :type count: int + :param time_interval: Time interval. + :type time_interval: str + :param path: Request Path. + :type path: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'int'}, + 'sub_status': {'key': 'subStatus', 'type': 'int'}, + 'win32_status': {'key': 'win32Status', 'type': 'int'}, + 'count': {'key': 'count', 'type': 'int'}, + 'time_interval': {'key': 'timeInterval', 'type': 'str'}, + 'path': {'key': 'path', 'type': 'str'}, + } + + def __init__( + self, + *, + status: Optional[int] = None, + sub_status: Optional[int] = None, + win32_status: Optional[int] = None, + count: Optional[int] = None, + time_interval: Optional[str] = None, + path: Optional[str] = None, + **kwargs + ): + super(StatusCodesBasedTrigger, self).__init__(**kwargs) + self.status = status + self.sub_status = sub_status + self.win32_status = win32_status + self.count = count + self.time_interval = time_interval + self.path = path + + +class StatusCodesRangeBasedTrigger(msrest.serialization.Model): + """Trigger based on range of status codes. + + :param status_codes: HTTP status code. + :type status_codes: str + :param path: + :type path: str + :param count: Request Count. + :type count: int + :param time_interval: Time interval. + :type time_interval: str + """ + + _attribute_map = { + 'status_codes': {'key': 'statusCodes', 'type': 'str'}, + 'path': {'key': 'path', 'type': 'str'}, + 'count': {'key': 'count', 'type': 'int'}, + 'time_interval': {'key': 'timeInterval', 'type': 'str'}, + } + + def __init__( + self, + *, + status_codes: Optional[str] = None, + path: Optional[str] = None, + count: Optional[int] = None, + time_interval: Optional[str] = None, + **kwargs + ): + super(StatusCodesRangeBasedTrigger, self).__init__(**kwargs) + self.status_codes = status_codes + self.path = path + self.count = count + self.time_interval = time_interval + + +class StorageMigrationOptions(ProxyOnlyResource): + """Options for app content migration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param azurefiles_connection_string: AzureFiles connection string. + :type azurefiles_connection_string: str + :param azurefiles_share: AzureFiles share. + :type azurefiles_share: str + :param switch_site_after_migration: :code:`true`if the app should be switched + over; otherwise, :code:`false`. + :type switch_site_after_migration: bool + :param block_write_access_to_site: :code:`true` if the app should be read only + during copy operation; otherwise, :code:`false`. + :type block_write_access_to_site: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'azurefiles_connection_string': {'key': 'properties.azurefilesConnectionString', 'type': 'str'}, + 'azurefiles_share': {'key': 'properties.azurefilesShare', 'type': 'str'}, + 'switch_site_after_migration': {'key': 'properties.switchSiteAfterMigration', 'type': 'bool'}, + 'block_write_access_to_site': {'key': 'properties.blockWriteAccessToSite', 'type': 'bool'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + azurefiles_connection_string: Optional[str] = None, + azurefiles_share: Optional[str] = None, + switch_site_after_migration: Optional[bool] = False, + block_write_access_to_site: Optional[bool] = False, + **kwargs + ): + super(StorageMigrationOptions, self).__init__(kind=kind, **kwargs) + self.azurefiles_connection_string = azurefiles_connection_string + self.azurefiles_share = azurefiles_share + self.switch_site_after_migration = switch_site_after_migration + self.block_write_access_to_site = block_write_access_to_site + + +class StorageMigrationResponse(ProxyOnlyResource): + """Response for a migration of app content request. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar operation_id: When server starts the migration process, it will return an operation ID + identifying that particular migration operation. + :vartype operation_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'operation_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'operation_id': {'key': 'properties.operationId', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(StorageMigrationResponse, self).__init__(kind=kind, **kwargs) + self.operation_id = None + + +class StringDictionary(ProxyOnlyResource): + """String dictionary resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param properties: Settings. + :type properties: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': '{str}'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + properties: Optional[Dict[str, str]] = None, + **kwargs + ): + super(StringDictionary, self).__init__(kind=kind, **kwargs) + self.properties = properties + + +class StringList(ProxyOnlyResource): + """String list resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param properties: List of string resources. + :type properties: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': '[str]'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + properties: Optional[List[str]] = None, + **kwargs + ): + super(StringList, self).__init__(kind=kind, **kwargs) + self.properties = properties + + +class SupportTopic(msrest.serialization.Model): + """Defines a unique Support Topic. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Support Topic Id. + :vartype id: str + :ivar pes_id: Unique resource Id. + :vartype pes_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'pes_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'pes_id': {'key': 'pesId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SupportTopic, self).__init__(**kwargs) + self.id = None + self.pes_id = None + + +class SwiftVirtualNetwork(ProxyOnlyResource): + """Swift Virtual Network Contract. This is used to enable the new Swift way of doing virtual network integration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param subnet_resource_id: The Virtual Network subnet's resource ID. This is the subnet that + this Web App will join. This subnet must have a delegation to Microsoft.Web/serverFarms defined + first. + :type subnet_resource_id: str + :param swift_supported: A flag that specifies if the scale unit this Web App is on supports + Swift integration. + :type swift_supported: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'subnet_resource_id': {'key': 'properties.subnetResourceId', 'type': 'str'}, + 'swift_supported': {'key': 'properties.swiftSupported', 'type': 'bool'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + subnet_resource_id: Optional[str] = None, + swift_supported: Optional[bool] = None, + **kwargs + ): + super(SwiftVirtualNetwork, self).__init__(kind=kind, **kwargs) + self.subnet_resource_id = subnet_resource_id + self.swift_supported = swift_supported + + +class TldLegalAgreement(msrest.serialization.Model): + """Legal agreement for a top level domain. + + All required parameters must be populated in order to send to Azure. + + :param agreement_key: Required. Unique identifier for the agreement. + :type agreement_key: str + :param title: Required. Agreement title. + :type title: str + :param content: Required. Agreement details. + :type content: str + :param url: URL where a copy of the agreement details is hosted. + :type url: str + """ + + _validation = { + 'agreement_key': {'required': True}, + 'title': {'required': True}, + 'content': {'required': True}, + } + + _attribute_map = { + 'agreement_key': {'key': 'agreementKey', 'type': 'str'}, + 'title': {'key': 'title', 'type': 'str'}, + 'content': {'key': 'content', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + } + + def __init__( + self, + *, + agreement_key: str, + title: str, + content: str, + url: Optional[str] = None, + **kwargs + ): + super(TldLegalAgreement, self).__init__(**kwargs) + self.agreement_key = agreement_key + self.title = title + self.content = content + self.url = url + + +class TldLegalAgreementCollection(msrest.serialization.Model): + """Collection of top-level domain legal agreements. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.TldLegalAgreement] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[TldLegalAgreement]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["TldLegalAgreement"], + **kwargs + ): + super(TldLegalAgreementCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class TokenStore(msrest.serialization.Model): + """The configuration settings of the token store. + + :param enabled: :code:`true` to durably store platform-specific security tokens + that are obtained during login flows; otherwise, :code:`false`. + The default is :code:`false`. + :type enabled: bool + :param token_refresh_extension_hours: The number of hours after session token expiration that a + session token can be used to + call the token refresh API. The default is 72 hours. + :type token_refresh_extension_hours: float + :param file_system: The configuration settings of the storage of the tokens if a file system is + used. + :type file_system: ~azure.mgmt.web.v2021_02_01.models.FileSystemTokenStore + :param azure_blob_storage: The configuration settings of the storage of the tokens if blob + storage is used. + :type azure_blob_storage: ~azure.mgmt.web.v2021_02_01.models.BlobStorageTokenStore + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'token_refresh_extension_hours': {'key': 'tokenRefreshExtensionHours', 'type': 'float'}, + 'file_system': {'key': 'fileSystem', 'type': 'FileSystemTokenStore'}, + 'azure_blob_storage': {'key': 'azureBlobStorage', 'type': 'BlobStorageTokenStore'}, + } + + def __init__( + self, + *, + enabled: Optional[bool] = None, + token_refresh_extension_hours: Optional[float] = None, + file_system: Optional["FileSystemTokenStore"] = None, + azure_blob_storage: Optional["BlobStorageTokenStore"] = None, + **kwargs + ): + super(TokenStore, self).__init__(**kwargs) + self.enabled = enabled + self.token_refresh_extension_hours = token_refresh_extension_hours + self.file_system = file_system + self.azure_blob_storage = azure_blob_storage + + +class TopLevelDomain(ProxyOnlyResource): + """A top level domain object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param privacy: If :code:`true`, then the top level domain supports domain + privacy; otherwise, :code:`false`. + :type privacy: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'privacy': {'key': 'properties.privacy', 'type': 'bool'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + privacy: Optional[bool] = None, + **kwargs + ): + super(TopLevelDomain, self).__init__(kind=kind, **kwargs) + self.privacy = privacy + + +class TopLevelDomainAgreementOption(msrest.serialization.Model): + """Options for retrieving the list of top level domain legal agreements. + + :param include_privacy: If :code:`true`, then the list of agreements will include + agreements for domain privacy as well; otherwise, :code:`false`. + :type include_privacy: bool + :param for_transfer: If :code:`true`, then the list of agreements will include + agreements for domain transfer as well; otherwise, :code:`false`. + :type for_transfer: bool + """ + + _attribute_map = { + 'include_privacy': {'key': 'includePrivacy', 'type': 'bool'}, + 'for_transfer': {'key': 'forTransfer', 'type': 'bool'}, + } + + def __init__( + self, + *, + include_privacy: Optional[bool] = None, + for_transfer: Optional[bool] = None, + **kwargs + ): + super(TopLevelDomainAgreementOption, self).__init__(**kwargs) + self.include_privacy = include_privacy + self.for_transfer = for_transfer + + +class TopLevelDomainCollection(msrest.serialization.Model): + """Collection of Top-level domains. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.TopLevelDomain] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[TopLevelDomain]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["TopLevelDomain"], + **kwargs + ): + super(TopLevelDomainCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class TriggeredJobHistory(ProxyOnlyResource): + """Triggered Web Job History. List of Triggered Web Job Run Information elements. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param runs: List of triggered web job runs. + :type runs: list[~azure.mgmt.web.v2021_02_01.models.TriggeredJobRun] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'runs': {'key': 'properties.runs', 'type': '[TriggeredJobRun]'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + runs: Optional[List["TriggeredJobRun"]] = None, + **kwargs + ): + super(TriggeredJobHistory, self).__init__(kind=kind, **kwargs) + self.runs = runs + + +class TriggeredJobHistoryCollection(msrest.serialization.Model): + """Collection of Kudu continuous web job information elements. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.TriggeredJobHistory] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[TriggeredJobHistory]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["TriggeredJobHistory"], + **kwargs + ): + super(TriggeredJobHistoryCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class TriggeredJobRun(msrest.serialization.Model): + """Triggered Web Job Run Information. + + :param web_job_id: Job ID. + :type web_job_id: str + :param web_job_name: Job name. + :type web_job_name: str + :param status: Job status. Possible values include: "Success", "Failed", "Error". + :type status: str or ~azure.mgmt.web.v2021_02_01.models.TriggeredWebJobStatus + :param start_time: Start time. + :type start_time: ~datetime.datetime + :param end_time: End time. + :type end_time: ~datetime.datetime + :param duration: Job duration. + :type duration: str + :param output_url: Output URL. + :type output_url: str + :param error_url: Error URL. + :type error_url: str + :param url: Job URL. + :type url: str + :param job_name: Job name. + :type job_name: str + :param trigger: Job trigger. + :type trigger: str + """ + + _attribute_map = { + 'web_job_id': {'key': 'web_job_id', 'type': 'str'}, + 'web_job_name': {'key': 'web_job_name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'start_time': {'key': 'start_time', 'type': 'iso-8601'}, + 'end_time': {'key': 'end_time', 'type': 'iso-8601'}, + 'duration': {'key': 'duration', 'type': 'str'}, + 'output_url': {'key': 'output_url', 'type': 'str'}, + 'error_url': {'key': 'error_url', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'job_name': {'key': 'job_name', 'type': 'str'}, + 'trigger': {'key': 'trigger', 'type': 'str'}, + } + + def __init__( + self, + *, + web_job_id: Optional[str] = None, + web_job_name: Optional[str] = None, + status: Optional[Union[str, "TriggeredWebJobStatus"]] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + duration: Optional[str] = None, + output_url: Optional[str] = None, + error_url: Optional[str] = None, + url: Optional[str] = None, + job_name: Optional[str] = None, + trigger: Optional[str] = None, + **kwargs + ): + super(TriggeredJobRun, self).__init__(**kwargs) + self.web_job_id = web_job_id + self.web_job_name = web_job_name + self.status = status + self.start_time = start_time + self.end_time = end_time + self.duration = duration + self.output_url = output_url + self.error_url = error_url + self.url = url + self.job_name = job_name + self.trigger = trigger + + +class TriggeredWebJob(ProxyOnlyResource): + """Triggered Web Job Information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param latest_run: Latest job run information. + :type latest_run: ~azure.mgmt.web.v2021_02_01.models.TriggeredJobRun + :param history_url: History URL. + :type history_url: str + :param scheduler_logs_url: Scheduler Logs URL. + :type scheduler_logs_url: str + :param run_command: Run command. + :type run_command: str + :param url: Job URL. + :type url: str + :param extra_info_url: Extra Info URL. + :type extra_info_url: str + :param web_job_type: Job type. Possible values include: "Continuous", "Triggered". + :type web_job_type: str or ~azure.mgmt.web.v2021_02_01.models.WebJobType + :param error: Error information. + :type error: str + :param using_sdk: Using SDK?. + :type using_sdk: bool + :param settings: Job settings. + :type settings: dict[str, any] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'latest_run': {'key': 'properties.latest_run', 'type': 'TriggeredJobRun'}, + 'history_url': {'key': 'properties.history_url', 'type': 'str'}, + 'scheduler_logs_url': {'key': 'properties.scheduler_logs_url', 'type': 'str'}, + 'run_command': {'key': 'properties.run_command', 'type': 'str'}, + 'url': {'key': 'properties.url', 'type': 'str'}, + 'extra_info_url': {'key': 'properties.extra_info_url', 'type': 'str'}, + 'web_job_type': {'key': 'properties.web_job_type', 'type': 'str'}, + 'error': {'key': 'properties.error', 'type': 'str'}, + 'using_sdk': {'key': 'properties.using_sdk', 'type': 'bool'}, + 'settings': {'key': 'properties.settings', 'type': '{object}'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + latest_run: Optional["TriggeredJobRun"] = None, + history_url: Optional[str] = None, + scheduler_logs_url: Optional[str] = None, + run_command: Optional[str] = None, + url: Optional[str] = None, + extra_info_url: Optional[str] = None, + web_job_type: Optional[Union[str, "WebJobType"]] = None, + error: Optional[str] = None, + using_sdk: Optional[bool] = None, + settings: Optional[Dict[str, Any]] = None, + **kwargs + ): + super(TriggeredWebJob, self).__init__(kind=kind, **kwargs) + self.latest_run = latest_run + self.history_url = history_url + self.scheduler_logs_url = scheduler_logs_url + self.run_command = run_command + self.url = url + self.extra_info_url = extra_info_url + self.web_job_type = web_job_type + self.error = error + self.using_sdk = using_sdk + self.settings = settings + + +class TriggeredWebJobCollection(msrest.serialization.Model): + """Collection of Kudu continuous web job information elements. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.TriggeredWebJob] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[TriggeredWebJob]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["TriggeredWebJob"], + **kwargs + ): + super(TriggeredWebJobCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class Twitter(msrest.serialization.Model): + """The configuration settings of the Twitter provider. + + :param enabled: :code:`false` if the Twitter provider should not be enabled + despite the set registration; otherwise, :code:`true`. + :type enabled: bool + :param registration: The configuration settings of the app registration for the Twitter + provider. + :type registration: ~azure.mgmt.web.v2021_02_01.models.TwitterRegistration + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'registration': {'key': 'registration', 'type': 'TwitterRegistration'}, + } + + def __init__( + self, + *, + enabled: Optional[bool] = None, + registration: Optional["TwitterRegistration"] = None, + **kwargs + ): + super(Twitter, self).__init__(**kwargs) + self.enabled = enabled + self.registration = registration + + +class TwitterRegistration(msrest.serialization.Model): + """The configuration settings of the app registration for the Twitter provider. + + :param consumer_key: The OAuth 1.0a consumer key of the Twitter application used for sign-in. + This setting is required for enabling Twitter Sign-In. + Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in. + :type consumer_key: str + :param consumer_secret_setting_name: The app setting name that contains the OAuth 1.0a consumer + secret of the Twitter + application used for sign-in. + :type consumer_secret_setting_name: str + """ + + _attribute_map = { + 'consumer_key': {'key': 'consumerKey', 'type': 'str'}, + 'consumer_secret_setting_name': {'key': 'consumerSecretSettingName', 'type': 'str'}, + } + + def __init__( + self, + *, + consumer_key: Optional[str] = None, + consumer_secret_setting_name: Optional[str] = None, + **kwargs + ): + super(TwitterRegistration, self).__init__(**kwargs) + self.consumer_key = consumer_key + self.consumer_secret_setting_name = consumer_secret_setting_name + + +class Usage(ProxyOnlyResource): + """Usage of the quota resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar display_name: Friendly name shown in the UI. + :vartype display_name: str + :ivar resource_name: Name of the quota resource. + :vartype resource_name: str + :ivar unit: Units of measurement for the quota resource. + :vartype unit: str + :ivar current_value: The current value of the resource counter. + :vartype current_value: long + :ivar limit: The resource limit. + :vartype limit: long + :ivar next_reset_time: Next reset time for the resource counter. + :vartype next_reset_time: ~datetime.datetime + :ivar compute_mode: Compute mode used for this usage. Possible values include: "Shared", + "Dedicated", "Dynamic". + :vartype compute_mode: str or ~azure.mgmt.web.v2021_02_01.models.ComputeModeOptions + :ivar site_mode: Site mode used for this usage. + :vartype site_mode: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'display_name': {'readonly': True}, + 'resource_name': {'readonly': True}, + 'unit': {'readonly': True}, + 'current_value': {'readonly': True}, + 'limit': {'readonly': True}, + 'next_reset_time': {'readonly': True}, + 'compute_mode': {'readonly': True}, + 'site_mode': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'resource_name': {'key': 'properties.resourceName', 'type': 'str'}, + 'unit': {'key': 'properties.unit', 'type': 'str'}, + 'current_value': {'key': 'properties.currentValue', 'type': 'long'}, + 'limit': {'key': 'properties.limit', 'type': 'long'}, + 'next_reset_time': {'key': 'properties.nextResetTime', 'type': 'iso-8601'}, + 'compute_mode': {'key': 'properties.computeMode', 'type': 'str'}, + 'site_mode': {'key': 'properties.siteMode', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(Usage, self).__init__(kind=kind, **kwargs) + self.display_name = None + self.resource_name = None + self.unit = None + self.current_value = None + self.limit = None + self.next_reset_time = None + self.compute_mode = None + self.site_mode = None + + +class UsageCollection(msrest.serialization.Model): + """Collection of usages. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.Usage] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Usage]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["Usage"], + **kwargs + ): + super(UsageCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class User(ProxyOnlyResource): + """User credentials used for publishing activity. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param publishing_user_name: Username used for publishing. + :type publishing_user_name: str + :param publishing_password: Password used for publishing. + :type publishing_password: str + :param publishing_password_hash: Password hash used for publishing. + :type publishing_password_hash: str + :param publishing_password_hash_salt: Password hash salt used for publishing. + :type publishing_password_hash_salt: str + :param scm_uri: Url of SCM site. + :type scm_uri: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'publishing_user_name': {'key': 'properties.publishingUserName', 'type': 'str'}, + 'publishing_password': {'key': 'properties.publishingPassword', 'type': 'str'}, + 'publishing_password_hash': {'key': 'properties.publishingPasswordHash', 'type': 'str'}, + 'publishing_password_hash_salt': {'key': 'properties.publishingPasswordHashSalt', 'type': 'str'}, + 'scm_uri': {'key': 'properties.scmUri', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + publishing_user_name: Optional[str] = None, + publishing_password: Optional[str] = None, + publishing_password_hash: Optional[str] = None, + publishing_password_hash_salt: Optional[str] = None, + scm_uri: Optional[str] = None, + **kwargs + ): + super(User, self).__init__(kind=kind, **kwargs) + self.publishing_user_name = publishing_user_name + self.publishing_password = publishing_password + self.publishing_password_hash = publishing_password_hash + self.publishing_password_hash_salt = publishing_password_hash_salt + self.scm_uri = scm_uri + + +class UserAssignedIdentity(msrest.serialization.Model): + """User Assigned identity. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: Principal Id of user assigned identity. + :vartype principal_id: str + :ivar client_id: Client Id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UserAssignedIdentity, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + +class ValidateRequest(msrest.serialization.Model): + """Resource validation request content. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Resource name to verify. + :type name: str + :param type: Required. Resource type used for verification. Possible values include: + "ServerFarm", "Site", "Microsoft.Web/hostingEnvironments". + :type type: str or ~azure.mgmt.web.v2021_02_01.models.ValidateResourceTypes + :param location: Required. Expected location of the resource. + :type location: str + :param server_farm_id: ARM resource ID of an App Service plan that would host the app. + :type server_farm_id: str + :param sku_name: Name of the target SKU for the App Service plan. + :type sku_name: str + :param need_linux_workers: :code:`true` if App Service plan is for Linux workers; + otherwise, :code:`false`. + :type need_linux_workers: bool + :param is_spot: :code:`true` if App Service plan is for Spot instances; otherwise, + :code:`false`. + :type is_spot: bool + :param capacity: Target capacity of the App Service plan (number of VMs). + :type capacity: int + :param hosting_environment: Name of App Service Environment where app or App Service plan + should be created. + :type hosting_environment: str + :param is_xenon: :code:`true` if App Service plan is running as a windows + container. + :type is_xenon: bool + :param container_registry_base_url: Base URL of the container registry. + :type container_registry_base_url: str + :param container_registry_username: Username for to access the container registry. + :type container_registry_username: str + :param container_registry_password: Password for to access the container registry. + :type container_registry_password: str + :param container_image_repository: Repository name (image name). + :type container_image_repository: str + :param container_image_tag: Image tag. + :type container_image_tag: str + :param container_image_platform: Platform (windows or linux). + :type container_image_platform: str + :param app_service_environment: App Service Environment Properties. + :type app_service_environment: ~azure.mgmt.web.v2021_02_01.models.AppServiceEnvironment + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + 'location': {'required': True}, + 'capacity': {'minimum': 1}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'server_farm_id': {'key': 'properties.serverFarmId', 'type': 'str'}, + 'sku_name': {'key': 'properties.skuName', 'type': 'str'}, + 'need_linux_workers': {'key': 'properties.needLinuxWorkers', 'type': 'bool'}, + 'is_spot': {'key': 'properties.isSpot', 'type': 'bool'}, + 'capacity': {'key': 'properties.capacity', 'type': 'int'}, + 'hosting_environment': {'key': 'properties.hostingEnvironment', 'type': 'str'}, + 'is_xenon': {'key': 'properties.isXenon', 'type': 'bool'}, + 'container_registry_base_url': {'key': 'properties.containerRegistryBaseUrl', 'type': 'str'}, + 'container_registry_username': {'key': 'properties.containerRegistryUsername', 'type': 'str'}, + 'container_registry_password': {'key': 'properties.containerRegistryPassword', 'type': 'str'}, + 'container_image_repository': {'key': 'properties.containerImageRepository', 'type': 'str'}, + 'container_image_tag': {'key': 'properties.containerImageTag', 'type': 'str'}, + 'container_image_platform': {'key': 'properties.containerImagePlatform', 'type': 'str'}, + 'app_service_environment': {'key': 'properties.appServiceEnvironment', 'type': 'AppServiceEnvironment'}, + } + + def __init__( + self, + *, + name: str, + type: Union[str, "ValidateResourceTypes"], + location: str, + server_farm_id: Optional[str] = None, + sku_name: Optional[str] = None, + need_linux_workers: Optional[bool] = None, + is_spot: Optional[bool] = None, + capacity: Optional[int] = None, + hosting_environment: Optional[str] = None, + is_xenon: Optional[bool] = None, + container_registry_base_url: Optional[str] = None, + container_registry_username: Optional[str] = None, + container_registry_password: Optional[str] = None, + container_image_repository: Optional[str] = None, + container_image_tag: Optional[str] = None, + container_image_platform: Optional[str] = None, + app_service_environment: Optional["AppServiceEnvironment"] = None, + **kwargs + ): + super(ValidateRequest, self).__init__(**kwargs) + self.name = name + self.type = type + self.location = location + self.server_farm_id = server_farm_id + self.sku_name = sku_name + self.need_linux_workers = need_linux_workers + self.is_spot = is_spot + self.capacity = capacity + self.hosting_environment = hosting_environment + self.is_xenon = is_xenon + self.container_registry_base_url = container_registry_base_url + self.container_registry_username = container_registry_username + self.container_registry_password = container_registry_password + self.container_image_repository = container_image_repository + self.container_image_tag = container_image_tag + self.container_image_platform = container_image_platform + self.app_service_environment = app_service_environment + + +class ValidateResponse(msrest.serialization.Model): + """Describes the result of resource validation. + + :param status: Result of validation. + :type status: str + :param error: Error details for the case when validation fails. + :type error: ~azure.mgmt.web.v2021_02_01.models.ValidateResponseError + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'ValidateResponseError'}, + } + + def __init__( + self, + *, + status: Optional[str] = None, + error: Optional["ValidateResponseError"] = None, + **kwargs + ): + super(ValidateResponse, self).__init__(**kwargs) + self.status = status + self.error = error + + +class ValidateResponseError(msrest.serialization.Model): + """Error details for when validation fails. + + :param code: Validation error code. + :type code: str + :param message: Validation error message. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + **kwargs + ): + super(ValidateResponseError, self).__init__(**kwargs) + self.code = code + self.message = message + + +class VirtualApplication(msrest.serialization.Model): + """Virtual application in an app. + + :param virtual_path: Virtual path. + :type virtual_path: str + :param physical_path: Physical path. + :type physical_path: str + :param preload_enabled: :code:`true` if preloading is enabled; otherwise, + :code:`false`. + :type preload_enabled: bool + :param virtual_directories: Virtual directories for virtual application. + :type virtual_directories: list[~azure.mgmt.web.v2021_02_01.models.VirtualDirectory] + """ + + _attribute_map = { + 'virtual_path': {'key': 'virtualPath', 'type': 'str'}, + 'physical_path': {'key': 'physicalPath', 'type': 'str'}, + 'preload_enabled': {'key': 'preloadEnabled', 'type': 'bool'}, + 'virtual_directories': {'key': 'virtualDirectories', 'type': '[VirtualDirectory]'}, + } + + def __init__( + self, + *, + virtual_path: Optional[str] = None, + physical_path: Optional[str] = None, + preload_enabled: Optional[bool] = None, + virtual_directories: Optional[List["VirtualDirectory"]] = None, + **kwargs + ): + super(VirtualApplication, self).__init__(**kwargs) + self.virtual_path = virtual_path + self.physical_path = physical_path + self.preload_enabled = preload_enabled + self.virtual_directories = virtual_directories + + +class VirtualDirectory(msrest.serialization.Model): + """Directory for virtual application. + + :param virtual_path: Path to virtual application. + :type virtual_path: str + :param physical_path: Physical path. + :type physical_path: str + """ + + _attribute_map = { + 'virtual_path': {'key': 'virtualPath', 'type': 'str'}, + 'physical_path': {'key': 'physicalPath', 'type': 'str'}, + } + + def __init__( + self, + *, + virtual_path: Optional[str] = None, + physical_path: Optional[str] = None, + **kwargs + ): + super(VirtualDirectory, self).__init__(**kwargs) + self.virtual_path = virtual_path + self.physical_path = physical_path + + +class VirtualIPMapping(msrest.serialization.Model): + """Virtual IP mapping. + + :param virtual_ip: Virtual IP address. + :type virtual_ip: str + :param internal_http_port: Internal HTTP port. + :type internal_http_port: int + :param internal_https_port: Internal HTTPS port. + :type internal_https_port: int + :param in_use: Is virtual IP mapping in use. + :type in_use: bool + :param service_name: name of the service that virtual IP is assigned to. + :type service_name: str + """ + + _attribute_map = { + 'virtual_ip': {'key': 'virtualIP', 'type': 'str'}, + 'internal_http_port': {'key': 'internalHttpPort', 'type': 'int'}, + 'internal_https_port': {'key': 'internalHttpsPort', 'type': 'int'}, + 'in_use': {'key': 'inUse', 'type': 'bool'}, + 'service_name': {'key': 'serviceName', 'type': 'str'}, + } + + def __init__( + self, + *, + virtual_ip: Optional[str] = None, + internal_http_port: Optional[int] = None, + internal_https_port: Optional[int] = None, + in_use: Optional[bool] = None, + service_name: Optional[str] = None, + **kwargs + ): + super(VirtualIPMapping, self).__init__(**kwargs) + self.virtual_ip = virtual_ip + self.internal_http_port = internal_http_port + self.internal_https_port = internal_https_port + self.in_use = in_use + self.service_name = service_name + + +class VirtualNetworkProfile(msrest.serialization.Model): + """Specification for using a Virtual Network. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. Resource id of the Virtual Network. + :type id: str + :ivar name: Name of the Virtual Network (read-only). + :vartype name: str + :ivar type: Resource type of the Virtual Network (read-only). + :vartype type: str + :param subnet: Subnet within the Virtual Network. + :type subnet: str + """ + + _validation = { + 'id': {'required': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'subnet': {'key': 'subnet', 'type': 'str'}, + } + + def __init__( + self, + *, + id: str, + subnet: Optional[str] = None, + **kwargs + ): + super(VirtualNetworkProfile, self).__init__(**kwargs) + self.id = id + self.name = None + self.type = None + self.subnet = subnet + + +class VnetGateway(ProxyOnlyResource): + """The Virtual Network gateway contract. This is used to give the Virtual Network gateway access to the VPN package. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param vnet_name: The Virtual Network name. + :type vnet_name: str + :param vpn_package_uri: The URI where the VPN package can be downloaded. + :type vpn_package_uri: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'vnet_name': {'key': 'properties.vnetName', 'type': 'str'}, + 'vpn_package_uri': {'key': 'properties.vpnPackageUri', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + vnet_name: Optional[str] = None, + vpn_package_uri: Optional[str] = None, + **kwargs + ): + super(VnetGateway, self).__init__(kind=kind, **kwargs) + self.vnet_name = vnet_name + self.vpn_package_uri = vpn_package_uri + + +class VnetInfo(msrest.serialization.Model): + """Virtual Network information contract. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param vnet_resource_id: The Virtual Network's resource ID. + :type vnet_resource_id: str + :ivar cert_thumbprint: The client certificate thumbprint. + :vartype cert_thumbprint: str + :param cert_blob: A certificate file (.cer) blob containing the public key of the private key + used to authenticate a + Point-To-Site VPN connection. + :type cert_blob: str + :ivar routes: The routes that this Virtual Network connection uses. + :vartype routes: list[~azure.mgmt.web.v2021_02_01.models.VnetRoute] + :ivar resync_required: :code:`true` if a resync is required; otherwise, + :code:`false`. + :vartype resync_required: bool + :param dns_servers: DNS servers to be used by this Virtual Network. This should be a + comma-separated list of IP addresses. + :type dns_servers: str + :param is_swift: Flag that is used to denote if this is VNET injection. + :type is_swift: bool + """ + + _validation = { + 'cert_thumbprint': {'readonly': True}, + 'routes': {'readonly': True}, + 'resync_required': {'readonly': True}, + } + + _attribute_map = { + 'vnet_resource_id': {'key': 'vnetResourceId', 'type': 'str'}, + 'cert_thumbprint': {'key': 'certThumbprint', 'type': 'str'}, + 'cert_blob': {'key': 'certBlob', 'type': 'str'}, + 'routes': {'key': 'routes', 'type': '[VnetRoute]'}, + 'resync_required': {'key': 'resyncRequired', 'type': 'bool'}, + 'dns_servers': {'key': 'dnsServers', 'type': 'str'}, + 'is_swift': {'key': 'isSwift', 'type': 'bool'}, + } + + def __init__( + self, + *, + vnet_resource_id: Optional[str] = None, + cert_blob: Optional[str] = None, + dns_servers: Optional[str] = None, + is_swift: Optional[bool] = None, + **kwargs + ): + super(VnetInfo, self).__init__(**kwargs) + self.vnet_resource_id = vnet_resource_id + self.cert_thumbprint = None + self.cert_blob = cert_blob + self.routes = None + self.resync_required = None + self.dns_servers = dns_servers + self.is_swift = is_swift + + +class VnetInfoResource(ProxyOnlyResource): + """Virtual Network information ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param vnet_resource_id: The Virtual Network's resource ID. + :type vnet_resource_id: str + :ivar cert_thumbprint: The client certificate thumbprint. + :vartype cert_thumbprint: str + :param cert_blob: A certificate file (.cer) blob containing the public key of the private key + used to authenticate a + Point-To-Site VPN connection. + :type cert_blob: str + :ivar routes: The routes that this Virtual Network connection uses. + :vartype routes: list[~azure.mgmt.web.v2021_02_01.models.VnetRoute] + :ivar resync_required: :code:`true` if a resync is required; otherwise, + :code:`false`. + :vartype resync_required: bool + :param dns_servers: DNS servers to be used by this Virtual Network. This should be a + comma-separated list of IP addresses. + :type dns_servers: str + :param is_swift: Flag that is used to denote if this is VNET injection. + :type is_swift: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'cert_thumbprint': {'readonly': True}, + 'routes': {'readonly': True}, + 'resync_required': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'vnet_resource_id': {'key': 'properties.vnetResourceId', 'type': 'str'}, + 'cert_thumbprint': {'key': 'properties.certThumbprint', 'type': 'str'}, + 'cert_blob': {'key': 'properties.certBlob', 'type': 'str'}, + 'routes': {'key': 'properties.routes', 'type': '[VnetRoute]'}, + 'resync_required': {'key': 'properties.resyncRequired', 'type': 'bool'}, + 'dns_servers': {'key': 'properties.dnsServers', 'type': 'str'}, + 'is_swift': {'key': 'properties.isSwift', 'type': 'bool'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + vnet_resource_id: Optional[str] = None, + cert_blob: Optional[str] = None, + dns_servers: Optional[str] = None, + is_swift: Optional[bool] = None, + **kwargs + ): + super(VnetInfoResource, self).__init__(kind=kind, **kwargs) + self.vnet_resource_id = vnet_resource_id + self.cert_thumbprint = None + self.cert_blob = cert_blob + self.routes = None + self.resync_required = None + self.dns_servers = dns_servers + self.is_swift = is_swift + + +class VnetParameters(ProxyOnlyResource): + """The required set of inputs to validate a VNET. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param vnet_resource_group: The Resource Group of the VNET to be validated. + :type vnet_resource_group: str + :param vnet_name: The name of the VNET to be validated. + :type vnet_name: str + :param vnet_subnet_name: The subnet name to be validated. + :type vnet_subnet_name: str + :param subnet_resource_id: The ARM Resource ID of the subnet to validate. + :type subnet_resource_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'vnet_resource_group': {'key': 'properties.vnetResourceGroup', 'type': 'str'}, + 'vnet_name': {'key': 'properties.vnetName', 'type': 'str'}, + 'vnet_subnet_name': {'key': 'properties.vnetSubnetName', 'type': 'str'}, + 'subnet_resource_id': {'key': 'properties.subnetResourceId', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + vnet_resource_group: Optional[str] = None, + vnet_name: Optional[str] = None, + vnet_subnet_name: Optional[str] = None, + subnet_resource_id: Optional[str] = None, + **kwargs + ): + super(VnetParameters, self).__init__(kind=kind, **kwargs) + self.vnet_resource_group = vnet_resource_group + self.vnet_name = vnet_name + self.vnet_subnet_name = vnet_subnet_name + self.subnet_resource_id = subnet_resource_id + + +class VnetRoute(ProxyOnlyResource): + """Virtual Network route contract used to pass routing information for a Virtual Network. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param start_address: The starting address for this route. This may also include a CIDR + notation, in which case the end address must not be specified. + :type start_address: str + :param end_address: The ending address for this route. If the start address is specified in + CIDR notation, this must be omitted. + :type end_address: str + :param route_type: The type of route this is: + DEFAULT - By default, every app has routes to the local address ranges specified by RFC1918 + INHERITED - Routes inherited from the real Virtual Network routes + STATIC - Static route set on the app only + + These values will be used for syncing an app's routes with those from a Virtual Network. + Possible values include: "DEFAULT", "INHERITED", "STATIC". + :type route_type: str or ~azure.mgmt.web.v2021_02_01.models.RouteType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'start_address': {'key': 'properties.startAddress', 'type': 'str'}, + 'end_address': {'key': 'properties.endAddress', 'type': 'str'}, + 'route_type': {'key': 'properties.routeType', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + start_address: Optional[str] = None, + end_address: Optional[str] = None, + route_type: Optional[Union[str, "RouteType"]] = None, + **kwargs + ): + super(VnetRoute, self).__init__(kind=kind, **kwargs) + self.start_address = start_address + self.end_address = end_address + self.route_type = route_type + + +class VnetValidationFailureDetails(ProxyOnlyResource): + """A class that describes the reason for a validation failure. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param message: Text describing the validation outcome. + :type message: str + :param failed: A flag describing whether or not validation failed. + :type failed: bool + :param failed_tests: A list of tests that failed in the validation. + :type failed_tests: list[~azure.mgmt.web.v2021_02_01.models.VnetValidationTestFailure] + :param warnings: A list of warnings generated during validation. + :type warnings: list[~azure.mgmt.web.v2021_02_01.models.VnetValidationTestFailure] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'message': {'key': 'properties.message', 'type': 'str'}, + 'failed': {'key': 'properties.failed', 'type': 'bool'}, + 'failed_tests': {'key': 'properties.failedTests', 'type': '[VnetValidationTestFailure]'}, + 'warnings': {'key': 'properties.warnings', 'type': '[VnetValidationTestFailure]'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + message: Optional[str] = None, + failed: Optional[bool] = None, + failed_tests: Optional[List["VnetValidationTestFailure"]] = None, + warnings: Optional[List["VnetValidationTestFailure"]] = None, + **kwargs + ): + super(VnetValidationFailureDetails, self).__init__(kind=kind, **kwargs) + self.message = message + self.failed = failed + self.failed_tests = failed_tests + self.warnings = warnings + + +class VnetValidationTestFailure(ProxyOnlyResource): + """A class that describes a test that failed during NSG and UDR validation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param test_name: The name of the test that failed. + :type test_name: str + :param details: The details of what caused the failure, e.g. the blocking rule name, etc. + :type details: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'test_name': {'key': 'properties.testName', 'type': 'str'}, + 'details': {'key': 'properties.details', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + test_name: Optional[str] = None, + details: Optional[str] = None, + **kwargs + ): + super(VnetValidationTestFailure, self).__init__(kind=kind, **kwargs) + self.test_name = test_name + self.details = details + + +class WebAppCollection(msrest.serialization.Model): + """Collection of App Service apps. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.Site] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Site]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["Site"], + **kwargs + ): + super(WebAppCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class WebAppInstanceStatusCollection(msrest.serialization.Model): + """Collection of app instances. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.WebSiteInstanceStatus] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[WebSiteInstanceStatus]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["WebSiteInstanceStatus"], + **kwargs + ): + super(WebAppInstanceStatusCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class WebAppMajorVersion(msrest.serialization.Model): + """Web App stack major version. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar display_text: Web App stack major version (display only). + :vartype display_text: str + :ivar value: Web App stack major version name. + :vartype value: str + :ivar minor_versions: Minor versions associated with the major version. + :vartype minor_versions: list[~azure.mgmt.web.v2021_02_01.models.WebAppMinorVersion] + """ + + _validation = { + 'display_text': {'readonly': True}, + 'value': {'readonly': True}, + 'minor_versions': {'readonly': True}, + } + + _attribute_map = { + 'display_text': {'key': 'displayText', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'minor_versions': {'key': 'minorVersions', 'type': '[WebAppMinorVersion]'}, + } + + def __init__( + self, + **kwargs + ): + super(WebAppMajorVersion, self).__init__(**kwargs) + self.display_text = None + self.value = None + self.minor_versions = None + + +class WebAppMinorVersion(msrest.serialization.Model): + """Web App stack minor version. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar display_text: Web App stack minor version (display only). + :vartype display_text: str + :ivar value: Web App stack major version name. + :vartype value: str + :ivar stack_settings: Settings associated with the minor version. + :vartype stack_settings: ~azure.mgmt.web.v2021_02_01.models.WebAppRuntimes + """ + + _validation = { + 'display_text': {'readonly': True}, + 'value': {'readonly': True}, + 'stack_settings': {'readonly': True}, + } + + _attribute_map = { + 'display_text': {'key': 'displayText', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'stack_settings': {'key': 'stackSettings', 'type': 'WebAppRuntimes'}, + } + + def __init__( + self, + **kwargs + ): + super(WebAppMinorVersion, self).__init__(**kwargs) + self.display_text = None + self.value = None + self.stack_settings = None + + +class WebAppRuntimes(msrest.serialization.Model): + """Web App stack runtimes. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar linux_runtime_settings: Linux-specific settings associated with the minor version. + :vartype linux_runtime_settings: ~azure.mgmt.web.v2021_02_01.models.WebAppRuntimeSettings + :ivar windows_runtime_settings: Windows-specific settings associated with the minor version. + :vartype windows_runtime_settings: ~azure.mgmt.web.v2021_02_01.models.WebAppRuntimeSettings + :ivar linux_container_settings: Linux-specific settings associated with the Java container + minor version. + :vartype linux_container_settings: + ~azure.mgmt.web.v2021_02_01.models.LinuxJavaContainerSettings + :ivar windows_container_settings: Windows-specific settings associated with the Java container + minor version. + :vartype windows_container_settings: + ~azure.mgmt.web.v2021_02_01.models.WindowsJavaContainerSettings + """ + + _validation = { + 'linux_runtime_settings': {'readonly': True}, + 'windows_runtime_settings': {'readonly': True}, + 'linux_container_settings': {'readonly': True}, + 'windows_container_settings': {'readonly': True}, + } + + _attribute_map = { + 'linux_runtime_settings': {'key': 'linuxRuntimeSettings', 'type': 'WebAppRuntimeSettings'}, + 'windows_runtime_settings': {'key': 'windowsRuntimeSettings', 'type': 'WebAppRuntimeSettings'}, + 'linux_container_settings': {'key': 'linuxContainerSettings', 'type': 'LinuxJavaContainerSettings'}, + 'windows_container_settings': {'key': 'windowsContainerSettings', 'type': 'WindowsJavaContainerSettings'}, + } + + def __init__( + self, + **kwargs + ): + super(WebAppRuntimes, self).__init__(**kwargs) + self.linux_runtime_settings = None + self.windows_runtime_settings = None + self.linux_container_settings = None + self.windows_container_settings = None + + +class WebAppRuntimeSettings(msrest.serialization.Model): + """Web App runtime settings. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar runtime_version: Web App stack minor version (runtime only). + :vartype runtime_version: str + :ivar remote_debugging_supported: :code:`true` if remote debugging is supported + for the stack; otherwise, :code:`false`. + :vartype remote_debugging_supported: bool + :ivar app_insights_settings: Application Insights settings associated with the minor version. + :vartype app_insights_settings: + ~azure.mgmt.web.v2021_02_01.models.AppInsightsWebAppStackSettings + :ivar git_hub_action_settings: GitHub Actions settings associated with the minor version. + :vartype git_hub_action_settings: + ~azure.mgmt.web.v2021_02_01.models.GitHubActionWebAppStackSettings + :ivar is_preview: :code:`true` if the stack is in preview; otherwise, + :code:`false`. + :vartype is_preview: bool + :ivar is_deprecated: :code:`true` if the stack is deprecated; otherwise, + :code:`false`. + :vartype is_deprecated: bool + :ivar is_hidden: :code:`true` if the stack should be hidden; otherwise, + :code:`false`. + :vartype is_hidden: bool + :ivar end_of_life_date: End-of-life date for the minor version. + :vartype end_of_life_date: ~datetime.datetime + :ivar is_auto_update: :code:`true` if the stack version is auto-updated; + otherwise, :code:`false`. + :vartype is_auto_update: bool + :ivar is_early_access: :code:`true` if the minor version is early-access; + otherwise, :code:`false`. + :vartype is_early_access: bool + """ + + _validation = { + 'runtime_version': {'readonly': True}, + 'remote_debugging_supported': {'readonly': True}, + 'app_insights_settings': {'readonly': True}, + 'git_hub_action_settings': {'readonly': True}, + 'is_preview': {'readonly': True}, + 'is_deprecated': {'readonly': True}, + 'is_hidden': {'readonly': True}, + 'end_of_life_date': {'readonly': True}, + 'is_auto_update': {'readonly': True}, + 'is_early_access': {'readonly': True}, + } + + _attribute_map = { + 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, + 'remote_debugging_supported': {'key': 'remoteDebuggingSupported', 'type': 'bool'}, + 'app_insights_settings': {'key': 'appInsightsSettings', 'type': 'AppInsightsWebAppStackSettings'}, + 'git_hub_action_settings': {'key': 'gitHubActionSettings', 'type': 'GitHubActionWebAppStackSettings'}, + 'is_preview': {'key': 'isPreview', 'type': 'bool'}, + 'is_deprecated': {'key': 'isDeprecated', 'type': 'bool'}, + 'is_hidden': {'key': 'isHidden', 'type': 'bool'}, + 'end_of_life_date': {'key': 'endOfLifeDate', 'type': 'iso-8601'}, + 'is_auto_update': {'key': 'isAutoUpdate', 'type': 'bool'}, + 'is_early_access': {'key': 'isEarlyAccess', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(WebAppRuntimeSettings, self).__init__(**kwargs) + self.runtime_version = None + self.remote_debugging_supported = None + self.app_insights_settings = None + self.git_hub_action_settings = None + self.is_preview = None + self.is_deprecated = None + self.is_hidden = None + self.end_of_life_date = None + self.is_auto_update = None + self.is_early_access = None + + +class WebAppStack(ProxyOnlyResource): + """Web App stack. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :ivar location: Web App stack location. + :vartype location: str + :ivar display_text: Web App stack (display only). + :vartype display_text: str + :ivar value: Web App stack name. + :vartype value: str + :ivar major_versions: List of major versions available. + :vartype major_versions: list[~azure.mgmt.web.v2021_02_01.models.WebAppMajorVersion] + :ivar preferred_os: Web App stack preferred OS. Possible values include: "Windows", "Linux". + :vartype preferred_os: str or ~azure.mgmt.web.v2021_02_01.models.StackPreferredOs + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'readonly': True}, + 'display_text': {'readonly': True}, + 'value': {'readonly': True}, + 'major_versions': {'readonly': True}, + 'preferred_os': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'display_text': {'key': 'properties.displayText', 'type': 'str'}, + 'value': {'key': 'properties.value', 'type': 'str'}, + 'major_versions': {'key': 'properties.majorVersions', 'type': '[WebAppMajorVersion]'}, + 'preferred_os': {'key': 'properties.preferredOs', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + **kwargs + ): + super(WebAppStack, self).__init__(kind=kind, **kwargs) + self.location = None + self.display_text = None + self.value = None + self.major_versions = None + self.preferred_os = None + + +class WebAppStackCollection(msrest.serialization.Model): + """Collection of Web app Stacks. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.WebAppStack] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[WebAppStack]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["WebAppStack"], + **kwargs + ): + super(WebAppStackCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class WebJob(ProxyOnlyResource): + """Web Job Information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param run_command: Run command. + :type run_command: str + :param url: Job URL. + :type url: str + :param extra_info_url: Extra Info URL. + :type extra_info_url: str + :param web_job_type: Job type. Possible values include: "Continuous", "Triggered". + :type web_job_type: str or ~azure.mgmt.web.v2021_02_01.models.WebJobType + :param error: Error information. + :type error: str + :param using_sdk: Using SDK?. + :type using_sdk: bool + :param settings: Job settings. + :type settings: dict[str, any] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'run_command': {'key': 'properties.run_command', 'type': 'str'}, + 'url': {'key': 'properties.url', 'type': 'str'}, + 'extra_info_url': {'key': 'properties.extra_info_url', 'type': 'str'}, + 'web_job_type': {'key': 'properties.web_job_type', 'type': 'str'}, + 'error': {'key': 'properties.error', 'type': 'str'}, + 'using_sdk': {'key': 'properties.using_sdk', 'type': 'bool'}, + 'settings': {'key': 'properties.settings', 'type': '{object}'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + run_command: Optional[str] = None, + url: Optional[str] = None, + extra_info_url: Optional[str] = None, + web_job_type: Optional[Union[str, "WebJobType"]] = None, + error: Optional[str] = None, + using_sdk: Optional[bool] = None, + settings: Optional[Dict[str, Any]] = None, + **kwargs + ): + super(WebJob, self).__init__(kind=kind, **kwargs) + self.run_command = run_command + self.url = url + self.extra_info_url = extra_info_url + self.web_job_type = web_job_type + self.error = error + self.using_sdk = using_sdk + self.settings = settings + + +class WebJobCollection(msrest.serialization.Model): + """Collection of Kudu web job information elements. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.WebJob] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[WebJob]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["WebJob"], + **kwargs + ): + super(WebJobCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class WebSiteInstanceStatus(ProxyOnlyResource): + """WebSiteInstanceStatus. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param state: Possible values include: "READY", "STOPPED", "UNKNOWN". + :type state: str or ~azure.mgmt.web.v2021_02_01.models.SiteRuntimeState + :param status_url: Link to the GetStatusApi in Kudu. + :type status_url: str + :param detector_url: Link to the Diagnose and Solve Portal. + :type detector_url: str + :param console_url: Link to the console to web app instance. + :type console_url: str + :param health_check_url: Link to the console to web app instance. + :type health_check_url: str + :param containers: Dictionary of :code:``. + :type containers: dict[str, ~azure.mgmt.web.v2021_02_01.models.ContainerInfo] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'status_url': {'key': 'properties.statusUrl', 'type': 'str'}, + 'detector_url': {'key': 'properties.detectorUrl', 'type': 'str'}, + 'console_url': {'key': 'properties.consoleUrl', 'type': 'str'}, + 'health_check_url': {'key': 'properties.healthCheckUrl', 'type': 'str'}, + 'containers': {'key': 'properties.containers', 'type': '{ContainerInfo}'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + state: Optional[Union[str, "SiteRuntimeState"]] = None, + status_url: Optional[str] = None, + detector_url: Optional[str] = None, + console_url: Optional[str] = None, + health_check_url: Optional[str] = None, + containers: Optional[Dict[str, "ContainerInfo"]] = None, + **kwargs + ): + super(WebSiteInstanceStatus, self).__init__(kind=kind, **kwargs) + self.state = state + self.status_url = status_url + self.detector_url = detector_url + self.console_url = console_url + self.health_check_url = health_check_url + self.containers = containers + + +class WindowsJavaContainerSettings(msrest.serialization.Model): + """Windows Java Container settings. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar java_container: Java container (runtime only). + :vartype java_container: str + :ivar java_container_version: Java container version (runtime only). + :vartype java_container_version: str + :ivar is_preview: :code:`true` if the stack is in preview; otherwise, + :code:`false`. + :vartype is_preview: bool + :ivar is_deprecated: :code:`true` if the stack is deprecated; otherwise, + :code:`false`. + :vartype is_deprecated: bool + :ivar is_hidden: :code:`true` if the stack should be hidden; otherwise, + :code:`false`. + :vartype is_hidden: bool + :ivar end_of_life_date: End-of-life date for the minor version. + :vartype end_of_life_date: ~datetime.datetime + :ivar is_auto_update: :code:`true` if the stack version is auto-updated; + otherwise, :code:`false`. + :vartype is_auto_update: bool + :ivar is_early_access: :code:`true` if the minor version is early-access; + otherwise, :code:`false`. + :vartype is_early_access: bool + """ + + _validation = { + 'java_container': {'readonly': True}, + 'java_container_version': {'readonly': True}, + 'is_preview': {'readonly': True}, + 'is_deprecated': {'readonly': True}, + 'is_hidden': {'readonly': True}, + 'end_of_life_date': {'readonly': True}, + 'is_auto_update': {'readonly': True}, + 'is_early_access': {'readonly': True}, + } + + _attribute_map = { + 'java_container': {'key': 'javaContainer', 'type': 'str'}, + 'java_container_version': {'key': 'javaContainerVersion', 'type': 'str'}, + 'is_preview': {'key': 'isPreview', 'type': 'bool'}, + 'is_deprecated': {'key': 'isDeprecated', 'type': 'bool'}, + 'is_hidden': {'key': 'isHidden', 'type': 'bool'}, + 'end_of_life_date': {'key': 'endOfLifeDate', 'type': 'iso-8601'}, + 'is_auto_update': {'key': 'isAutoUpdate', 'type': 'bool'}, + 'is_early_access': {'key': 'isEarlyAccess', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(WindowsJavaContainerSettings, self).__init__(**kwargs) + self.java_container = None + self.java_container_version = None + self.is_preview = None + self.is_deprecated = None + self.is_hidden = None + self.end_of_life_date = None + self.is_auto_update = None + self.is_early_access = None + + +class WorkerPoolCollection(msrest.serialization.Model): + """Collection of worker pools. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.web.v2021_02_01.models.WorkerPoolResource] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[WorkerPoolResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["WorkerPoolResource"], + **kwargs + ): + super(WorkerPoolCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class WorkerPoolResource(ProxyOnlyResource): + """Worker pool of an App Service Environment ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource Name. + :vartype name: str + :param kind: Kind of resource. + :type kind: str + :ivar type: Resource type. + :vartype type: str + :param sku: Description of a SKU for a scalable resource. + :type sku: ~azure.mgmt.web.v2021_02_01.models.SkuDescription + :param worker_size_id: Worker size ID for referencing this worker pool. + :type worker_size_id: int + :param compute_mode: Shared or dedicated app hosting. Possible values include: "Shared", + "Dedicated", "Dynamic". + :type compute_mode: str or ~azure.mgmt.web.v2021_02_01.models.ComputeModeOptions + :param worker_size: VM size of the worker pool instances. + :type worker_size: str + :param worker_count: Number of instances in the worker pool. + :type worker_count: int + :ivar instance_names: Names of all instances in the worker pool (read only). + :vartype instance_names: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'instance_names': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'SkuDescription'}, + 'worker_size_id': {'key': 'properties.workerSizeId', 'type': 'int'}, + 'compute_mode': {'key': 'properties.computeMode', 'type': 'str'}, + 'worker_size': {'key': 'properties.workerSize', 'type': 'str'}, + 'worker_count': {'key': 'properties.workerCount', 'type': 'int'}, + 'instance_names': {'key': 'properties.instanceNames', 'type': '[str]'}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + sku: Optional["SkuDescription"] = None, + worker_size_id: Optional[int] = None, + compute_mode: Optional[Union[str, "ComputeModeOptions"]] = None, + worker_size: Optional[str] = None, + worker_count: Optional[int] = None, + **kwargs + ): + super(WorkerPoolResource, self).__init__(kind=kind, **kwargs) + self.sku = sku + self.worker_size_id = worker_size_id + self.compute_mode = compute_mode + self.worker_size = worker_size + self.worker_count = worker_count + self.instance_names = None diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/models/_web_site_management_client_enums.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/models/_web_site_management_client_enums.py new file mode 100644 index 000000000000..14723bd71fec --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/models/_web_site_management_client_enums.py @@ -0,0 +1,890 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + REGISTRATION_STATUS_NOT_SUPPORTED_FOR_RENEWAL = "RegistrationStatusNotSupportedForRenewal" + EXPIRATION_NOT_IN_RENEWAL_TIME_RANGE = "ExpirationNotInRenewalTimeRange" + SUBSCRIPTION_NOT_ACTIVE = "SubscriptionNotActive" + +class AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + REGISTRATION_STATUS_NOT_SUPPORTED_FOR_RENEWAL = "RegistrationStatusNotSupportedForRenewal" + EXPIRATION_NOT_IN_RENEWAL_TIME_RANGE = "ExpirationNotInRenewalTimeRange" + SUBSCRIPTION_NOT_ACTIVE = "SubscriptionNotActive" + +class AppServicePlanRestrictions(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """App Service plans this offer is restricted to. + """ + + NONE = "None" + FREE = "Free" + SHARED = "Shared" + BASIC = "Basic" + STANDARD = "Standard" + PREMIUM = "Premium" + +class AutoHealActionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Predefined action to be taken. + """ + + RECYCLE = "Recycle" + LOG_EVENT = "LogEvent" + CUSTOM_ACTION = "CustomAction" + +class AzureResourceType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of the Azure resource the hostname is assigned to. + """ + + WEBSITE = "Website" + TRAFFIC_MANAGER = "TrafficManager" + +class AzureStorageState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """State of the storage account. + """ + + OK = "Ok" + INVALID_CREDENTIALS = "InvalidCredentials" + INVALID_SHARE = "InvalidShare" + NOT_VALIDATED = "NotValidated" + +class AzureStorageType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of storage. + """ + + AZURE_FILES = "AzureFiles" + AZURE_BLOB = "AzureBlob" + +class BackupItemStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Backup status. + """ + + IN_PROGRESS = "InProgress" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + TIMED_OUT = "TimedOut" + CREATED = "Created" + SKIPPED = "Skipped" + PARTIALLY_SUCCEEDED = "PartiallySucceeded" + DELETE_IN_PROGRESS = "DeleteInProgress" + DELETE_FAILED = "DeleteFailed" + DELETED = "Deleted" + +class BackupRestoreOperationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Operation type. + """ + + DEFAULT = "Default" + CLONE = "Clone" + RELOCATION = "Relocation" + SNAPSHOT = "Snapshot" + CLOUD_FS = "CloudFS" + +class BuildStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The status of the static site build. + """ + + WAITING_FOR_DEPLOYMENT = "WaitingForDeployment" + UPLOADING = "Uploading" + DEPLOYING = "Deploying" + READY = "Ready" + FAILED = "Failed" + DELETING = "Deleting" + DETACHED = "Detached" + +class BuiltInAuthenticationProvider(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The default authentication provider to use when multiple providers are configured. + This setting is only needed if multiple providers are configured and the unauthenticated client + action is set to "RedirectToLoginPage". + """ + + AZURE_ACTIVE_DIRECTORY = "AzureActiveDirectory" + FACEBOOK = "Facebook" + GOOGLE = "Google" + MICROSOFT_ACCOUNT = "MicrosoftAccount" + TWITTER = "Twitter" + GITHUB = "Github" + +class CertificateOrderActionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Action type. + """ + + CERTIFICATE_ISSUED = "CertificateIssued" + CERTIFICATE_ORDER_CANCELED = "CertificateOrderCanceled" + CERTIFICATE_ORDER_CREATED = "CertificateOrderCreated" + CERTIFICATE_REVOKED = "CertificateRevoked" + DOMAIN_VALIDATION_COMPLETE = "DomainValidationComplete" + FRAUD_DETECTED = "FraudDetected" + ORG_NAME_CHANGE = "OrgNameChange" + ORG_VALIDATION_COMPLETE = "OrgValidationComplete" + SAN_DROP = "SanDrop" + FRAUD_CLEARED = "FraudCleared" + CERTIFICATE_EXPIRED = "CertificateExpired" + CERTIFICATE_EXPIRATION_WARNING = "CertificateExpirationWarning" + FRAUD_DOCUMENTATION_REQUIRED = "FraudDocumentationRequired" + UNKNOWN = "Unknown" + +class CertificateOrderStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Current order status. + """ + + PENDINGISSUANCE = "Pendingissuance" + ISSUED = "Issued" + REVOKED = "Revoked" + CANCELED = "Canceled" + DENIED = "Denied" + PENDINGREVOCATION = "Pendingrevocation" + PENDING_REKEY = "PendingRekey" + UNUSED = "Unused" + EXPIRED = "Expired" + NOT_SUBMITTED = "NotSubmitted" + +class CertificateProductType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Certificate product type. + """ + + STANDARD_DOMAIN_VALIDATED_SSL = "StandardDomainValidatedSsl" + STANDARD_DOMAIN_VALIDATED_WILD_CARD_SSL = "StandardDomainValidatedWildCardSsl" + +class Channels(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """List of channels that this recommendation can apply. + """ + + NOTIFICATION = "Notification" + API = "Api" + EMAIL = "Email" + WEBHOOK = "Webhook" + ALL = "All" + +class CheckNameResourceTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Resource type used for verification. + """ + + SITE = "Site" + SLOT = "Slot" + HOSTING_ENVIRONMENT = "HostingEnvironment" + PUBLISHING_USER = "PublishingUser" + MICROSOFT_WEB_SITES = "Microsoft.Web/sites" + MICROSOFT_WEB_SITES_SLOTS = "Microsoft.Web/sites/slots" + MICROSOFT_WEB_HOSTING_ENVIRONMENTS = "Microsoft.Web/hostingEnvironments" + MICROSOFT_WEB_PUBLISHING_USERS = "Microsoft.Web/publishingUsers" + +class ClientCertMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """This composes with ClientCertEnabled setting. + + + * ClientCertEnabled: false means ClientCert is ignored. + * ClientCertEnabled: true and ClientCertMode: Required means ClientCert is required. + * ClientCertEnabled: true and ClientCertMode: Optional means ClientCert is optional or + accepted. + """ + + REQUIRED = "Required" + OPTIONAL = "Optional" + OPTIONAL_INTERACTIVE_USER = "OptionalInteractiveUser" + +class CloneAbilityResult(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Name of app. + """ + + CLONEABLE = "Cloneable" + PARTIALLY_CLONEABLE = "PartiallyCloneable" + NOT_CLONEABLE = "NotCloneable" + +class ComputeModeOptions(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Shared/dedicated workers. + """ + + SHARED = "Shared" + DEDICATED = "Dedicated" + DYNAMIC = "Dynamic" + +class ConnectionStringType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of database. + """ + + MY_SQL = "MySql" + SQL_SERVER = "SQLServer" + SQL_AZURE = "SQLAzure" + CUSTOM = "Custom" + NOTIFICATION_HUB = "NotificationHub" + SERVICE_BUS = "ServiceBus" + EVENT_HUB = "EventHub" + API_HUB = "ApiHub" + DOC_DB = "DocDb" + REDIS_CACHE = "RedisCache" + POSTGRE_SQL = "PostgreSQL" + +class ContinuousWebJobStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Job status. + """ + + INITIALIZING = "Initializing" + STARTING = "Starting" + RUNNING = "Running" + PENDING_RESTART = "PendingRestart" + STOPPED = "Stopped" + +class CookieExpirationConvention(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The convention used when determining the session cookie's expiration. + """ + + FIXED_TIME = "FixedTime" + IDENTITY_PROVIDER_DERIVED = "IdentityProviderDerived" + +class CustomDomainStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The status of the custom domain + """ + + RETRIEVING_VALIDATION_TOKEN = "RetrievingValidationToken" + VALIDATING = "Validating" + ADDING = "Adding" + READY = "Ready" + FAILED = "Failed" + DELETING = "Deleting" + +class CustomHostNameDnsRecordType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of the DNS record. + """ + + C_NAME = "CName" + A = "A" + +class DatabaseType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Database type (e.g. SqlAzure / MySql). + """ + + SQL_AZURE = "SqlAzure" + MY_SQL = "MySql" + LOCAL_MY_SQL = "LocalMySql" + POSTGRE_SQL = "PostgreSql" + +class DetectorType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Whether this detector is an Analysis Detector or not. + """ + + DETECTOR = "Detector" + ANALYSIS = "Analysis" + CATEGORY_OVERVIEW = "CategoryOverview" + +class DnsType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Current DNS type + """ + + AZURE_DNS = "AzureDns" + DEFAULT_DOMAIN_REGISTRAR_DNS = "DefaultDomainRegistrarDns" + +class DnsVerificationTestResult(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """DNS verification test result. + """ + + PASSED = "Passed" + FAILED = "Failed" + SKIPPED = "Skipped" + +class DomainPatchResourcePropertiesDomainNotRenewableReasonsItem(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + REGISTRATION_STATUS_NOT_SUPPORTED_FOR_RENEWAL = "RegistrationStatusNotSupportedForRenewal" + EXPIRATION_NOT_IN_RENEWAL_TIME_RANGE = "ExpirationNotInRenewalTimeRange" + SUBSCRIPTION_NOT_ACTIVE = "SubscriptionNotActive" + +class DomainPropertiesDomainNotRenewableReasonsItem(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + REGISTRATION_STATUS_NOT_SUPPORTED_FOR_RENEWAL = "RegistrationStatusNotSupportedForRenewal" + EXPIRATION_NOT_IN_RENEWAL_TIME_RANGE = "ExpirationNotInRenewalTimeRange" + SUBSCRIPTION_NOT_ACTIVE = "SubscriptionNotActive" + +class DomainStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Domain registration status. + """ + + ACTIVE = "Active" + AWAITING = "Awaiting" + CANCELLED = "Cancelled" + CONFISCATED = "Confiscated" + DISABLED = "Disabled" + EXCLUDED = "Excluded" + EXPIRED = "Expired" + FAILED = "Failed" + HELD = "Held" + LOCKED = "Locked" + PARKED = "Parked" + PENDING = "Pending" + RESERVED = "Reserved" + REVERTED = "Reverted" + SUSPENDED = "Suspended" + TRANSFERRED = "Transferred" + UNKNOWN = "Unknown" + UNLOCKED = "Unlocked" + UNPARKED = "Unparked" + UPDATED = "Updated" + JSON_CONVERTER_FAILED = "JsonConverterFailed" + +class DomainType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Valid values are Regular domain: Azure will charge the full price of domain registration, + SoftDeleted: Purchasing this domain will simply restore it and this operation will not cost + anything. + """ + + REGULAR = "Regular" + SOFT_DELETED = "SoftDeleted" + +class Enum10(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + WINDOWS = "Windows" + LINUX = "Linux" + WINDOWS_FUNCTIONS = "WindowsFunctions" + LINUX_FUNCTIONS = "LinuxFunctions" + ALL = "All" + +class Enum11(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + WINDOWS = "Windows" + LINUX = "Linux" + ALL = "All" + +class Enum12(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + WINDOWS = "Windows" + LINUX = "Linux" + ALL = "All" + +class Enum13(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + WINDOWS = "Windows" + LINUX = "Linux" + ALL = "All" + +class Enum14(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + WINDOWS = "Windows" + LINUX = "Linux" + ALL = "All" + +class Enum15(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + WINDOWS = "Windows" + LINUX = "Linux" + WINDOWS_FUNCTIONS = "WindowsFunctions" + LINUX_FUNCTIONS = "LinuxFunctions" + ALL = "All" + +class ForwardProxyConvention(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The convention used to determine the url of the request made. + """ + + NO_PROXY = "NoProxy" + STANDARD = "Standard" + CUSTOM = "Custom" + +class FrequencyUnit(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The unit of time for how often the backup should be executed (e.g. for weekly backup, this + should be set to Day and FrequencyInterval should be set to 7) + """ + + DAY = "Day" + HOUR = "Hour" + +class FrontEndServiceType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + NODE_PORT = "NodePort" + LOAD_BALANCER = "LoadBalancer" + +class FtpsState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """State of FTP / FTPS service + """ + + ALL_ALLOWED = "AllAllowed" + FTPS_ONLY = "FtpsOnly" + DISABLED = "Disabled" + +class HostingEnvironmentStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Current status of the App Service Environment. + """ + + PREPARING = "Preparing" + READY = "Ready" + SCALING = "Scaling" + DELETING = "Deleting" + +class HostNameType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of the hostname. + """ + + VERIFIED = "Verified" + MANAGED = "Managed" + +class HostType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Indicates whether the hostname is a standard or repository hostname. + """ + + STANDARD = "Standard" + REPOSITORY = "Repository" + +class InAvailabilityReasonType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """:code:`Invalid` indicates the name provided does not match Azure App Service + naming requirements. :code:`AlreadyExists` indicates that the name is already in + use and is therefore unavailable. + """ + + INVALID = "Invalid" + ALREADY_EXISTS = "AlreadyExists" + +class InsightStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Level of the most severe insight generated by the detector. + """ + + CRITICAL = "Critical" + WARNING = "Warning" + INFO = "Info" + SUCCESS = "Success" + NONE = "None" + +class IpFilterTag(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Defines what this IP filter will be used for. This is to support IP filtering on proxies. + """ + + DEFAULT = "Default" + XFF_PROXY = "XffProxy" + SERVICE_TAG = "ServiceTag" + +class IssueType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Represents the type of the Detector + """ + + SERVICE_INCIDENT = "ServiceIncident" + APP_DEPLOYMENT = "AppDeployment" + APP_CRASH = "AppCrash" + RUNTIME_ISSUE_DETECTED = "RuntimeIssueDetected" + ASE_DEPLOYMENT = "AseDeployment" + USER_ISSUE = "UserIssue" + PLATFORM_ISSUE = "PlatformIssue" + OTHER = "Other" + +class KeyVaultSecretStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Status of the Key Vault secret. + """ + + INITIALIZED = "Initialized" + WAITING_ON_CERTIFICATE_ORDER = "WaitingOnCertificateOrder" + SUCCEEDED = "Succeeded" + CERTIFICATE_ORDER_FAILED = "CertificateOrderFailed" + OPERATION_NOT_PERMITTED_ON_KEY_VAULT = "OperationNotPermittedOnKeyVault" + AZURE_SERVICE_UNAUTHORIZED_TO_ACCESS_KEY_VAULT = "AzureServiceUnauthorizedToAccessKeyVault" + KEY_VAULT_DOES_NOT_EXIST = "KeyVaultDoesNotExist" + KEY_VAULT_SECRET_DOES_NOT_EXIST = "KeyVaultSecretDoesNotExist" + UNKNOWN_ERROR = "UnknownError" + EXTERNAL_PRIVATE_KEY = "ExternalPrivateKey" + UNKNOWN = "Unknown" + +class KubeEnvironmentProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Provisioning state of the Kubernetes Environment. + """ + + SUCCEEDED = "Succeeded" + FAILED = "Failed" + CANCELED = "Canceled" + WAITING = "Waiting" + INITIALIZATION_IN_PROGRESS = "InitializationInProgress" + INFRASTRUCTURE_SETUP_IN_PROGRESS = "InfrastructureSetupInProgress" + INFRASTRUCTURE_SETUP_COMPLETE = "InfrastructureSetupComplete" + SCHEDULED_FOR_DELETE = "ScheduledForDelete" + UPGRADE_REQUESTED = "UpgradeRequested" + UPGRADE_FAILED = "UpgradeFailed" + +class LoadBalancingMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies which endpoints to serve internally in the Virtual Network for the App Service + Environment. + """ + + NONE = "None" + WEB = "Web" + PUBLISHING = "Publishing" + WEB_PUBLISHING = "Web, Publishing" + +class LogLevel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Log level. + """ + + OFF = "Off" + VERBOSE = "Verbose" + INFORMATION = "Information" + WARNING = "Warning" + ERROR = "Error" + +class ManagedPipelineMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Managed pipeline mode. + """ + + INTEGRATED = "Integrated" + CLASSIC = "Classic" + +class ManagedServiceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of managed service identity. + """ + + SYSTEM_ASSIGNED = "SystemAssigned" + USER_ASSIGNED = "UserAssigned" + SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned, UserAssigned" + NONE = "None" + +class MSDeployLogEntryType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Log entry type + """ + + MESSAGE = "Message" + WARNING = "Warning" + ERROR = "Error" + +class MSDeployProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Provisioning state + """ + + ACCEPTED = "accepted" + RUNNING = "running" + SUCCEEDED = "succeeded" + FAILED = "failed" + CANCELED = "canceled" + +class MySqlMigrationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of migration operation to be done + """ + + LOCAL_TO_REMOTE = "LocalToRemote" + REMOTE_TO_LOCAL = "RemoteToLocal" + +class NotificationLevel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Level indicating how critical this recommendation can impact. + """ + + CRITICAL = "Critical" + WARNING = "Warning" + INFORMATION = "Information" + NON_URGENT_SUGGESTION = "NonUrgentSuggestion" + +class OperationStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The current status of the operation. + """ + + IN_PROGRESS = "InProgress" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + TIMED_OUT = "TimedOut" + CREATED = "Created" + +class ProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Status of certificate order. + """ + + SUCCEEDED = "Succeeded" + FAILED = "Failed" + CANCELED = "Canceled" + IN_PROGRESS = "InProgress" + DELETING = "Deleting" + +class PublicCertificateLocation(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Public Certificate Location + """ + + CURRENT_USER_MY = "CurrentUserMy" + LOCAL_MACHINE_MY = "LocalMachineMy" + UNKNOWN = "Unknown" + +class PublishingProfileFormat(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Name of the format. Valid values are: + FileZilla3 + WebDeploy -- default + Ftp + """ + + FILE_ZILLA3 = "FileZilla3" + WEB_DEPLOY = "WebDeploy" + FTP = "Ftp" + +class RedundancyMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Site redundancy mode + """ + + NONE = "None" + MANUAL = "Manual" + FAILOVER = "Failover" + ACTIVE_ACTIVE = "ActiveActive" + GEO_REDUNDANT = "GeoRedundant" + +class RenderingType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Rendering Type + """ + + NO_GRAPH = "NoGraph" + TABLE = "Table" + TIME_SERIES = "TimeSeries" + TIME_SERIES_PER_INSTANCE = "TimeSeriesPerInstance" + PIE_CHART = "PieChart" + DATA_SUMMARY = "DataSummary" + EMAIL = "Email" + INSIGHTS = "Insights" + DYNAMIC_INSIGHT = "DynamicInsight" + MARKDOWN = "Markdown" + DETECTOR = "Detector" + DROP_DOWN = "DropDown" + CARD = "Card" + SOLUTION = "Solution" + GUAGE = "Guage" + FORM = "Form" + CHANGE_SETS = "ChangeSets" + CHANGE_ANALYSIS_ONBOARDING = "ChangeAnalysisOnboarding" + CHANGES_VIEW = "ChangesView" + APP_INSIGHT = "AppInsight" + DEPENDENCY_GRAPH = "DependencyGraph" + DOWN_TIME = "DownTime" + SUMMARY_CARD = "SummaryCard" + SEARCH_COMPONENT = "SearchComponent" + APP_INSIGHT_ENABLEMENT = "AppInsightEnablement" + +class ResolveStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + INITIALIZED = "Initialized" + RESOLVED = "Resolved" + INVALID_SYNTAX = "InvalidSyntax" + MSI_NOT_ENABLED = "MSINotEnabled" + VAULT_NOT_FOUND = "VaultNotFound" + SECRET_NOT_FOUND = "SecretNotFound" + SECRET_VERSION_NOT_FOUND = "SecretVersionNotFound" + ACCESS_TO_KEY_VAULT_DENIED = "AccessToKeyVaultDenied" + OTHER_REASONS = "OtherReasons" + FETCH_TIMED_OUT = "FetchTimedOut" + UNAUTHORIZED_CLIENT = "UnauthorizedClient" + +class ResourceScopeType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Name of a resource type this recommendation applies, e.g. Subscription, ServerFarm, Site. + """ + + SERVER_FARM = "ServerFarm" + SUBSCRIPTION = "Subscription" + WEB_SITE = "WebSite" + +class RouteType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of route this is: + DEFAULT - By default, every app has routes to the local address ranges specified by RFC1918 + INHERITED - Routes inherited from the real Virtual Network routes + STATIC - Static route set on the app only + + These values will be used for syncing an app's routes with those from a Virtual Network. + """ + + DEFAULT = "DEFAULT" + INHERITED = "INHERITED" + STATIC = "STATIC" + +class ScmType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """SCM type. + """ + + NONE = "None" + DROPBOX = "Dropbox" + TFS = "Tfs" + LOCAL_GIT = "LocalGit" + GIT_HUB = "GitHub" + CODE_PLEX_GIT = "CodePlexGit" + CODE_PLEX_HG = "CodePlexHg" + BITBUCKET_GIT = "BitbucketGit" + BITBUCKET_HG = "BitbucketHg" + EXTERNAL_GIT = "ExternalGit" + EXTERNAL_HG = "ExternalHg" + ONE_DRIVE = "OneDrive" + VSO = "VSO" + VSTSRM = "VSTSRM" + +class SiteAvailabilityState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Management information availability state for the app. + """ + + NORMAL = "Normal" + LIMITED = "Limited" + DISASTER_RECOVERY_MODE = "DisasterRecoveryMode" + +class SiteExtensionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Site extension type. + """ + + GALLERY = "Gallery" + WEB_ROOT = "WebRoot" + +class SiteLoadBalancing(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Site load balancing. + """ + + WEIGHTED_ROUND_ROBIN = "WeightedRoundRobin" + LEAST_REQUESTS = "LeastRequests" + LEAST_RESPONSE_TIME = "LeastResponseTime" + WEIGHTED_TOTAL_TRAFFIC = "WeightedTotalTraffic" + REQUEST_HASH = "RequestHash" + PER_SITE_ROUND_ROBIN = "PerSiteRoundRobin" + +class SiteRuntimeState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + READY = "READY" + STOPPED = "STOPPED" + UNKNOWN = "UNKNOWN" + +class SkuName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + FREE = "Free" + SHARED = "Shared" + BASIC = "Basic" + STANDARD = "Standard" + PREMIUM = "Premium" + DYNAMIC = "Dynamic" + ISOLATED = "Isolated" + ISOLATED_V2 = "IsolatedV2" + PREMIUM_V2 = "PremiumV2" + PREMIUM_V3 = "PremiumV3" + PREMIUM_CONTAINER = "PremiumContainer" + ELASTIC_PREMIUM = "ElasticPremium" + ELASTIC_ISOLATED = "ElasticIsolated" + +class SolutionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of Solution + """ + + QUICK_SOLUTION = "QuickSolution" + DEEP_INVESTIGATION = "DeepInvestigation" + BEST_PRACTICES = "BestPractices" + +class SslState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """SSL type. + """ + + DISABLED = "Disabled" + SNI_ENABLED = "SniEnabled" + IP_BASED_ENABLED = "IpBasedEnabled" + +class StackPreferredOs(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Function App stack preferred OS. + """ + + WINDOWS = "Windows" + LINUX = "Linux" + +class StagingEnvironmentPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """State indicating whether staging environments are allowed or not allowed for a static web app. + """ + + ENABLED = "Enabled" + DISABLED = "Disabled" + +class StatusOptions(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """App Service plan status. + """ + + READY = "Ready" + PENDING = "Pending" + CREATING = "Creating" + +class StorageType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + LOCAL_NODE = "LocalNode" + NETWORK_FILE_SYSTEM = "NetworkFileSystem" + +class SupportedTlsVersions(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """MinTlsVersion: configures the minimum version of TLS required for SSL requests + """ + + ONE0 = "1.0" + ONE1 = "1.1" + ONE2 = "1.2" + +class TriggeredWebJobStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Job status. + """ + + SUCCESS = "Success" + FAILED = "Failed" + ERROR = "Error" + +class TriggerTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The trigger type of the function + """ + + HTTP_TRIGGER = "HttpTrigger" + UNKNOWN = "Unknown" + +class UnauthenticatedClientAction(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The action to take when an unauthenticated client attempts to access the app. + """ + + REDIRECT_TO_LOGIN_PAGE = "RedirectToLoginPage" + ALLOW_ANONYMOUS = "AllowAnonymous" + +class UnauthenticatedClientActionV2(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The action to take when an unauthenticated client attempts to access the app. + """ + + REDIRECT_TO_LOGIN_PAGE = "RedirectToLoginPage" + ALLOW_ANONYMOUS = "AllowAnonymous" + RETURN401 = "Return401" + RETURN403 = "Return403" + +class UsageState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """State indicating whether the app has exceeded its quota usage. Read-only. + """ + + NORMAL = "Normal" + EXCEEDED = "Exceeded" + +class ValidateResourceTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Resource type used for verification. + """ + + SERVER_FARM = "ServerFarm" + SITE = "Site" + MICROSOFT_WEB_HOSTING_ENVIRONMENTS = "Microsoft.Web/hostingEnvironments" + +class WebJobType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Job type. + """ + + CONTINUOUS = "Continuous" + TRIGGERED = "Triggered" + +class WorkerSizeOptions(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Size of the machines. + """ + + SMALL = "Small" + MEDIUM = "Medium" + LARGE = "Large" + D1 = "D1" + D2 = "D2" + D3 = "D3" + SMALL_V3 = "SmallV3" + MEDIUM_V3 = "MediumV3" + LARGE_V3 = "LargeV3" + NESTED_SMALL = "NestedSmall" + NESTED_SMALL_LINUX = "NestedSmallLinux" + DEFAULT = "Default" diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/__init__.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/__init__.py new file mode 100644 index 000000000000..5c7f8e46e95e --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/__init__.py @@ -0,0 +1,49 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._app_service_certificate_orders_operations import AppServiceCertificateOrdersOperations +from ._certificate_orders_diagnostics_operations import CertificateOrdersDiagnosticsOperations +from ._certificate_registration_provider_operations import CertificateRegistrationProviderOperations +from ._domains_operations import DomainsOperations +from ._top_level_domains_operations import TopLevelDomainsOperations +from ._domain_registration_provider_operations import DomainRegistrationProviderOperations +from ._app_service_environments_operations import AppServiceEnvironmentsOperations +from ._app_service_plans_operations import AppServicePlansOperations +from ._certificates_operations import CertificatesOperations +from ._deleted_web_apps_operations import DeletedWebAppsOperations +from ._diagnostics_operations import DiagnosticsOperations +from ._global_model_operations import GlobalOperations +from ._kube_environments_operations import KubeEnvironmentsOperations +from ._provider_operations import ProviderOperations +from ._recommendations_operations import RecommendationsOperations +from ._resource_health_metadata_operations import ResourceHealthMetadataOperations +from ._web_site_management_client_operations import WebSiteManagementClientOperationsMixin +from ._static_sites_operations import StaticSitesOperations +from ._web_apps_operations import WebAppsOperations + +__all__ = [ + 'AppServiceCertificateOrdersOperations', + 'CertificateOrdersDiagnosticsOperations', + 'CertificateRegistrationProviderOperations', + 'DomainsOperations', + 'TopLevelDomainsOperations', + 'DomainRegistrationProviderOperations', + 'AppServiceEnvironmentsOperations', + 'AppServicePlansOperations', + 'CertificatesOperations', + 'DeletedWebAppsOperations', + 'DiagnosticsOperations', + 'GlobalOperations', + 'KubeEnvironmentsOperations', + 'ProviderOperations', + 'RecommendationsOperations', + 'ResourceHealthMetadataOperations', + 'WebSiteManagementClientOperationsMixin', + 'StaticSitesOperations', + 'WebAppsOperations', +] diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_app_service_certificate_orders_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_app_service_certificate_orders_operations.py new file mode 100644 index 000000000000..9575f8b59946 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_app_service_certificate_orders_operations.py @@ -0,0 +1,1516 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, List, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class AppServiceCertificateOrdersOperations(object): + """AppServiceCertificateOrdersOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2021_02_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.AppServiceCertificateOrderCollection"] + """List all certificate orders in a subscription. + + Description for List all certificate orders in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AppServiceCertificateOrderCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.AppServiceCertificateOrderCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateOrderCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AppServiceCertificateOrderCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CertificateRegistration/certificateOrders'} # type: ignore + + def validate_purchase_information( + self, + app_service_certificate_order, # type: "_models.AppServiceCertificateOrder" + **kwargs # type: Any + ): + # type: (...) -> None + """Validate information for a certificate order. + + Description for Validate information for a certificate order. + + :param app_service_certificate_order: Information for a certificate order. + :type app_service_certificate_order: ~azure.mgmt.web.v2021_02_01.models.AppServiceCertificateOrder + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.validate_purchase_information.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(app_service_certificate_order, 'AppServiceCertificateOrder') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + validate_purchase_information.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CertificateRegistration/validateCertificateRegistrationInformation'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.AppServiceCertificateOrderCollection"] + """Get certificate orders in a resource group. + + Description for Get certificate orders in a resource group. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AppServiceCertificateOrderCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.AppServiceCertificateOrderCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateOrderCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AppServiceCertificateOrderCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders'} # type: ignore + + def get( + self, + resource_group_name, # type: str + certificate_order_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.AppServiceCertificateOrder" + """Get a certificate order. + + Description for Get a certificate order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order.. + :type certificate_order_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AppServiceCertificateOrder, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.AppServiceCertificateOrder + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateOrder"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AppServiceCertificateOrder', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + certificate_order_name, # type: str + certificate_distinguished_name, # type: "_models.AppServiceCertificateOrder" + **kwargs # type: Any + ): + # type: (...) -> "_models.AppServiceCertificateOrder" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateOrder"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(certificate_distinguished_name, 'AppServiceCertificateOrder') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AppServiceCertificateOrder', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('AppServiceCertificateOrder', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + certificate_order_name, # type: str + certificate_distinguished_name, # type: "_models.AppServiceCertificateOrder" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.AppServiceCertificateOrder"] + """Create or update a certificate purchase order. + + Description for Create or update a certificate purchase order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :param certificate_distinguished_name: Distinguished name to use for the certificate order. + :type certificate_distinguished_name: ~azure.mgmt.web.v2021_02_01.models.AppServiceCertificateOrder + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either AppServiceCertificateOrder or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2021_02_01.models.AppServiceCertificateOrder] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateOrder"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + certificate_order_name=certificate_order_name, + certificate_distinguished_name=certificate_distinguished_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AppServiceCertificateOrder', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + certificate_order_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete an existing certificate order. + + Description for Delete an existing certificate order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + certificate_order_name, # type: str + certificate_distinguished_name, # type: "_models.AppServiceCertificateOrderPatchResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.AppServiceCertificateOrder" + """Create or update a certificate purchase order. + + Description for Create or update a certificate purchase order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :param certificate_distinguished_name: Distinguished name to use for the certificate order. + :type certificate_distinguished_name: ~azure.mgmt.web.v2021_02_01.models.AppServiceCertificateOrderPatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AppServiceCertificateOrder, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.AppServiceCertificateOrder + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateOrder"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(certificate_distinguished_name, 'AppServiceCertificateOrderPatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AppServiceCertificateOrder', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}'} # type: ignore + + def list_certificates( + self, + resource_group_name, # type: str + certificate_order_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.AppServiceCertificateCollection"] + """List all certificates associated with a certificate order. + + Description for List all certificates associated with a certificate order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AppServiceCertificateCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.AppServiceCertificateCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_certificates.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AppServiceCertificateCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates'} # type: ignore + + def get_certificate( + self, + resource_group_name, # type: str + certificate_order_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.AppServiceCertificateResource" + """Get the certificate associated with a certificate order. + + Description for Get the certificate associated with a certificate order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :param name: Name of the certificate. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AppServiceCertificateResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.AppServiceCertificateResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_certificate.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AppServiceCertificateResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}'} # type: ignore + + def _create_or_update_certificate_initial( + self, + resource_group_name, # type: str + certificate_order_name, # type: str + name, # type: str + key_vault_certificate, # type: "_models.AppServiceCertificateResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.AppServiceCertificateResource" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_certificate_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(key_vault_certificate, 'AppServiceCertificateResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AppServiceCertificateResource', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('AppServiceCertificateResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_certificate_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}'} # type: ignore + + def begin_create_or_update_certificate( + self, + resource_group_name, # type: str + certificate_order_name, # type: str + name, # type: str + key_vault_certificate, # type: "_models.AppServiceCertificateResource" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.AppServiceCertificateResource"] + """Creates or updates a certificate and associates with key vault secret. + + Description for Creates or updates a certificate and associates with key vault secret. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :param name: Name of the certificate. + :type name: str + :param key_vault_certificate: Key vault certificate resource Id. + :type key_vault_certificate: ~azure.mgmt.web.v2021_02_01.models.AppServiceCertificateResource + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either AppServiceCertificateResource or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2021_02_01.models.AppServiceCertificateResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_certificate_initial( + resource_group_name=resource_group_name, + certificate_order_name=certificate_order_name, + name=name, + key_vault_certificate=key_vault_certificate, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AppServiceCertificateResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}'} # type: ignore + + def delete_certificate( + self, + resource_group_name, # type: str + certificate_order_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete the certificate associated with a certificate order. + + Description for Delete the certificate associated with a certificate order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :param name: Name of the certificate. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_certificate.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}'} # type: ignore + + def update_certificate( + self, + resource_group_name, # type: str + certificate_order_name, # type: str + name, # type: str + key_vault_certificate, # type: "_models.AppServiceCertificatePatchResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.AppServiceCertificateResource" + """Creates or updates a certificate and associates with key vault secret. + + Description for Creates or updates a certificate and associates with key vault secret. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :param name: Name of the certificate. + :type name: str + :param key_vault_certificate: Key vault certificate resource Id. + :type key_vault_certificate: ~azure.mgmt.web.v2021_02_01.models.AppServiceCertificatePatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AppServiceCertificateResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.AppServiceCertificateResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceCertificateResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_certificate.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(key_vault_certificate, 'AppServiceCertificatePatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AppServiceCertificateResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}'} # type: ignore + + def reissue( + self, + resource_group_name, # type: str + certificate_order_name, # type: str + reissue_certificate_order_request, # type: "_models.ReissueCertificateOrderRequest" + **kwargs # type: Any + ): + # type: (...) -> None + """Reissue an existing certificate order. + + Description for Reissue an existing certificate order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :param reissue_certificate_order_request: Parameters for the reissue. + :type reissue_certificate_order_request: ~azure.mgmt.web.v2021_02_01.models.ReissueCertificateOrderRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.reissue.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(reissue_certificate_order_request, 'ReissueCertificateOrderRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + reissue.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/reissue'} # type: ignore + + def renew( + self, + resource_group_name, # type: str + certificate_order_name, # type: str + renew_certificate_order_request, # type: "_models.RenewCertificateOrderRequest" + **kwargs # type: Any + ): + # type: (...) -> None + """Renew an existing certificate order. + + Description for Renew an existing certificate order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :param renew_certificate_order_request: Renew parameters. + :type renew_certificate_order_request: ~azure.mgmt.web.v2021_02_01.models.RenewCertificateOrderRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.renew.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(renew_certificate_order_request, 'RenewCertificateOrderRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + renew.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/renew'} # type: ignore + + def resend_email( + self, + resource_group_name, # type: str + certificate_order_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Resend certificate email. + + Description for Resend certificate email. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.resend_email.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + resend_email.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/resendEmail'} # type: ignore + + def resend_request_emails( + self, + resource_group_name, # type: str + certificate_order_name, # type: str + name_identifier, # type: "_models.NameIdentifier" + **kwargs # type: Any + ): + # type: (...) -> None + """Resend domain verification email to customer for this certificate order. + + Resend domain verification ownership email containing steps on how to verify a domain for a + given certificate order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :param name_identifier: Email address. + :type name_identifier: ~azure.mgmt.web.v2021_02_01.models.NameIdentifier + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.resend_request_emails.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(name_identifier, 'NameIdentifier') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + resend_request_emails.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/resendRequestEmails'} # type: ignore + + def retrieve_site_seal( + self, + resource_group_name, # type: str + certificate_order_name, # type: str + site_seal_request, # type: "_models.SiteSealRequest" + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteSeal" + """This method is used to obtain the site seal information for an issued certificate. + + This method is used to obtain the site seal information for an issued certificate. A site seal + is a graphic that the certificate purchaser can embed on their web site to show their visitors + information about their SSL certificate. If a web site visitor clicks on the site seal image, a + pop-up page is displayed that contains detailed information about the SSL certificate. The site + seal token is used to link the site seal graphic image to the appropriate certificate details + pop-up page display when a user clicks on the site seal. The site seal images are expected to + be static images and hosted by the reseller, to minimize delays for customer page load times. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :param site_seal_request: Site seal request. + :type site_seal_request: ~azure.mgmt.web.v2021_02_01.models.SiteSealRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteSeal, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SiteSeal + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteSeal"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.retrieve_site_seal.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_seal_request, 'SiteSealRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteSeal', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + retrieve_site_seal.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/retrieveSiteSeal'} # type: ignore + + def verify_domain_ownership( + self, + resource_group_name, # type: str + certificate_order_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Verify domain ownership for this certificate order. + + Description for Verify domain ownership for this certificate order. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: Name of the certificate order. + :type certificate_order_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.verify_domain_ownership.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + verify_domain_ownership.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/verifyDomainOwnership'} # type: ignore + + def retrieve_certificate_actions( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> List["_models.CertificateOrderAction"] + """Retrieve the list of certificate actions. + + Description for Retrieve the list of certificate actions. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the certificate order. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of CertificateOrderAction, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2021_02_01.models.CertificateOrderAction] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.CertificateOrderAction"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.retrieve_certificate_actions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[CertificateOrderAction]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + retrieve_certificate_actions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{name}/retrieveCertificateActions'} # type: ignore + + def retrieve_certificate_email_history( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> List["_models.CertificateEmail"] + """Retrieve email history. + + Description for Retrieve email history. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the certificate order. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of CertificateEmail, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2021_02_01.models.CertificateEmail] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.CertificateEmail"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.retrieve_certificate_email_history.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[CertificateEmail]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + retrieve_certificate_email_history.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{name}/retrieveEmailHistory'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_app_service_environments_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_app_service_environments_operations.py new file mode 100644 index 000000000000..f7c307733b06 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_app_service_environments_operations.py @@ -0,0 +1,3904 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, List, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class AppServiceEnvironmentsOperations(object): + """AppServiceEnvironmentsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2021_02_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.AppServiceEnvironmentCollection"] + """Get all App Service Environments for a subscription. + + Description for Get all App Service Environments for a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AppServiceEnvironmentCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.AppServiceEnvironmentCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceEnvironmentCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AppServiceEnvironmentCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/hostingEnvironments'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.AppServiceEnvironmentCollection"] + """Get all App Service Environments in a resource group. + + Description for Get all App Service Environments in a resource group. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AppServiceEnvironmentCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.AppServiceEnvironmentCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceEnvironmentCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AppServiceEnvironmentCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments'} # type: ignore + + def get( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.AppServiceEnvironmentResource" + """Get the properties of an App Service Environment. + + Description for Get the properties of an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AppServiceEnvironmentResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.AppServiceEnvironmentResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceEnvironmentResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AppServiceEnvironmentResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + name, # type: str + hosting_environment_envelope, # type: "_models.AppServiceEnvironmentResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.AppServiceEnvironmentResource" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceEnvironmentResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(hosting_environment_envelope, 'AppServiceEnvironmentResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AppServiceEnvironmentResource', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('AppServiceEnvironmentResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('AppServiceEnvironmentResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + name, # type: str + hosting_environment_envelope, # type: "_models.AppServiceEnvironmentResource" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.AppServiceEnvironmentResource"] + """Create or update an App Service Environment. + + Description for Create or update an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param hosting_environment_envelope: Configuration details of the App Service Environment. + :type hosting_environment_envelope: ~azure.mgmt.web.v2021_02_01.models.AppServiceEnvironmentResource + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either AppServiceEnvironmentResource or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2021_02_01.models.AppServiceEnvironmentResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceEnvironmentResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + name=name, + hosting_environment_envelope=hosting_environment_envelope, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AppServiceEnvironmentResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + name, # type: str + force_delete=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if force_delete is not None: + query_parameters['forceDelete'] = self._serialize.query("force_delete", force_delete, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + name, # type: str + force_delete=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Delete an App Service Environment. + + Description for Delete an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param force_delete: Specify :code:`true` to force the deletion even if the App + Service Environment contains resources. The default is :code:`false`. + :type force_delete: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + name=name, + force_delete=force_delete, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + name, # type: str + hosting_environment_envelope, # type: "_models.AppServiceEnvironmentPatchResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.AppServiceEnvironmentResource" + """Create or update an App Service Environment. + + Description for Create or update an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param hosting_environment_envelope: Configuration details of the App Service Environment. + :type hosting_environment_envelope: ~azure.mgmt.web.v2021_02_01.models.AppServiceEnvironmentPatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AppServiceEnvironmentResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.AppServiceEnvironmentResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServiceEnvironmentResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(hosting_environment_envelope, 'AppServiceEnvironmentPatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AppServiceEnvironmentResource', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('AppServiceEnvironmentResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('AppServiceEnvironmentResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}'} # type: ignore + + def list_capacities( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.StampCapacityCollection"] + """Get the used, available, and total worker capacity an App Service Environment. + + Description for Get the used, available, and total worker capacity an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StampCapacityCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.StampCapacityCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StampCapacityCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_capacities.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('StampCapacityCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_capacities.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/capacities/compute'} # type: ignore + + def get_vip_info( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.AddressResponse" + """Get IP addresses assigned to an App Service Environment. + + Description for Get IP addresses assigned to an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AddressResponse, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.AddressResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AddressResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_vip_info.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AddressResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_vip_info.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/capacities/virtualip'} # type: ignore + + def _change_vnet_initial( + self, + resource_group_name, # type: str + name, # type: str + vnet_info, # type: "_models.VirtualNetworkProfile" + **kwargs # type: Any + ): + # type: (...) -> "_models.WebAppCollection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._change_vnet_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(vnet_info, 'VirtualNetworkProfile') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('WebAppCollection', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('WebAppCollection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _change_vnet_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/changeVirtualNetwork'} # type: ignore + + def begin_change_vnet( + self, + resource_group_name, # type: str + name, # type: str + vnet_info, # type: "_models.VirtualNetworkProfile" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[ItemPaged["_models.WebAppCollection"]] + """Move an App Service Environment to a different VNET. + + Description for Move an App Service Environment to a different VNET. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param vnet_info: Details for the new virtual network. + :type vnet_info: ~azure.mgmt.web.v2021_02_01.models.VirtualNetworkProfile + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns an iterator like instance of either WebAppCollection or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.WebAppCollection]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = "application/json" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.change_vnet.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(vnet_info, 'VirtualNetworkProfile') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(vnet_info, 'VirtualNetworkProfile') + body_content_kwargs['content'] = body_content + request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._change_vnet_initial( + resource_group_name=resource_group_name, + name=name, + vnet_info=vnet_info, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): + def internal_get_next(next_link=None): + if next_link is None: + return pipeline_response + else: + return get_next(next_link) + + return ItemPaged( + internal_get_next, extract_data + ) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_change_vnet.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/changeVirtualNetwork'} # type: ignore + + def get_ase_v3_networking_configuration( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.AseV3NetworkingConfiguration" + """Get networking configuration of an App Service Environment. + + Description for Get networking configuration of an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AseV3NetworkingConfiguration, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.AseV3NetworkingConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AseV3NetworkingConfiguration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_ase_v3_networking_configuration.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AseV3NetworkingConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_ase_v3_networking_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/configurations/networking'} # type: ignore + + def update_ase_networking_configuration( + self, + resource_group_name, # type: str + name, # type: str + ase_networking_configuration, # type: "_models.AseV3NetworkingConfiguration" + **kwargs # type: Any + ): + # type: (...) -> "_models.AseV3NetworkingConfiguration" + """Update networking configuration of an App Service Environment. + + Description for Update networking configuration of an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param ase_networking_configuration: + :type ase_networking_configuration: ~azure.mgmt.web.v2021_02_01.models.AseV3NetworkingConfiguration + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AseV3NetworkingConfiguration, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.AseV3NetworkingConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AseV3NetworkingConfiguration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_ase_networking_configuration.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(ase_networking_configuration, 'AseV3NetworkingConfiguration') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AseV3NetworkingConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_ase_networking_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/configurations/networking'} # type: ignore + + def list_diagnostics( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> List["_models.HostingEnvironmentDiagnostics"] + """Get diagnostic information for an App Service Environment. + + Description for Get diagnostic information for an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of HostingEnvironmentDiagnostics, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2021_02_01.models.HostingEnvironmentDiagnostics] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.HostingEnvironmentDiagnostics"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_diagnostics.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[HostingEnvironmentDiagnostics]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_diagnostics.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/diagnostics'} # type: ignore + + def get_diagnostics_item( + self, + resource_group_name, # type: str + name, # type: str + diagnostics_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.HostingEnvironmentDiagnostics" + """Get a diagnostics item for an App Service Environment. + + Description for Get a diagnostics item for an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param diagnostics_name: Name of the diagnostics item. + :type diagnostics_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HostingEnvironmentDiagnostics, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.HostingEnvironmentDiagnostics + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HostingEnvironmentDiagnostics"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_diagnostics_item.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'diagnosticsName': self._serialize.url("diagnostics_name", diagnostics_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HostingEnvironmentDiagnostics', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_diagnostics_item.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/diagnostics/{diagnosticsName}'} # type: ignore + + def get_inbound_network_dependencies_endpoints( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.InboundEnvironmentEndpointCollection"] + """Get the network endpoints of all inbound dependencies of an App Service Environment. + + Description for Get the network endpoints of all inbound dependencies of an App Service + Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either InboundEnvironmentEndpointCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.InboundEnvironmentEndpointCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundEnvironmentEndpointCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_inbound_network_dependencies_endpoints.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('InboundEnvironmentEndpointCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + get_inbound_network_dependencies_endpoints.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/inboundNetworkDependenciesEndpoints'} # type: ignore + + def list_multi_role_pools( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.WorkerPoolCollection"] + """Get all multi-role pools. + + Description for Get all multi-role pools. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WorkerPoolCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.WorkerPoolCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkerPoolCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_multi_role_pools.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WorkerPoolCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_multi_role_pools.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools'} # type: ignore + + def get_multi_role_pool( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.WorkerPoolResource" + """Get properties of a multi-role pool. + + Description for Get properties of a multi-role pool. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkerPoolResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.WorkerPoolResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkerPoolResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_multi_role_pool.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_multi_role_pool.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default'} # type: ignore + + def _create_or_update_multi_role_pool_initial( + self, + resource_group_name, # type: str + name, # type: str + multi_role_pool_envelope, # type: "_models.WorkerPoolResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.WorkerPoolResource" + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkerPoolResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_multi_role_pool_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(multi_role_pool_envelope, 'WorkerPoolResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_multi_role_pool_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default'} # type: ignore + + def begin_create_or_update_multi_role_pool( + self, + resource_group_name, # type: str + name, # type: str + multi_role_pool_envelope, # type: "_models.WorkerPoolResource" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.WorkerPoolResource"] + """Create or update a multi-role pool. + + Description for Create or update a multi-role pool. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param multi_role_pool_envelope: Properties of the multi-role pool. + :type multi_role_pool_envelope: ~azure.mgmt.web.v2021_02_01.models.WorkerPoolResource + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either WorkerPoolResource or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2021_02_01.models.WorkerPoolResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkerPoolResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_multi_role_pool_initial( + resource_group_name=resource_group_name, + name=name, + multi_role_pool_envelope=multi_role_pool_envelope, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update_multi_role_pool.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default'} # type: ignore + + def update_multi_role_pool( + self, + resource_group_name, # type: str + name, # type: str + multi_role_pool_envelope, # type: "_models.WorkerPoolResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.WorkerPoolResource" + """Create or update a multi-role pool. + + Description for Create or update a multi-role pool. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param multi_role_pool_envelope: Properties of the multi-role pool. + :type multi_role_pool_envelope: ~azure.mgmt.web.v2021_02_01.models.WorkerPoolResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkerPoolResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.WorkerPoolResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkerPoolResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_multi_role_pool.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(multi_role_pool_envelope, 'WorkerPoolResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_multi_role_pool.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default'} # type: ignore + + def list_multi_role_pool_instance_metric_definitions( + self, + resource_group_name, # type: str + name, # type: str + instance, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ResourceMetricDefinitionCollection"] + """Get metric definitions for a specific instance of a multi-role pool of an App Service Environment. + + Description for Get metric definitions for a specific instance of a multi-role pool of an App + Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param instance: Name of the instance in the multi-role pool. + :type instance: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceMetricDefinitionCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.ResourceMetricDefinitionCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceMetricDefinitionCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_multi_role_pool_instance_metric_definitions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'instance': self._serialize.url("instance", instance, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceMetricDefinitionCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_multi_role_pool_instance_metric_definitions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/instances/{instance}/metricdefinitions'} # type: ignore + + def list_multi_role_metric_definitions( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ResourceMetricDefinitionCollection"] + """Get metric definitions for a multi-role pool of an App Service Environment. + + Description for Get metric definitions for a multi-role pool of an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceMetricDefinitionCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.ResourceMetricDefinitionCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceMetricDefinitionCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_multi_role_metric_definitions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceMetricDefinitionCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_multi_role_metric_definitions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/metricdefinitions'} # type: ignore + + def list_multi_role_pool_skus( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SkuInfoCollection"] + """Get available SKUs for scaling a multi-role pool. + + Description for Get available SKUs for scaling a multi-role pool. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SkuInfoCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.SkuInfoCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_multi_role_pool_skus.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SkuInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_multi_role_pool_skus.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/skus'} # type: ignore + + def list_multi_role_usages( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.UsageCollection"] + """Get usage metrics for a multi-role pool of an App Service Environment. + + Description for Get usage metrics for a multi-role pool of an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either UsageCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.UsageCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsageCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_multi_role_usages.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('UsageCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_multi_role_usages.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/usages'} # type: ignore + + def list_operations( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> List["_models.Operation"] + """List all currently running operations on the App Service Environment. + + Description for List all currently running operations on the App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of Operation, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2021_02_01.models.Operation] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.Operation"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_operations.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[Operation]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_operations.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/operations'} # type: ignore + + def get_outbound_network_dependencies_endpoints( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.OutboundEnvironmentEndpointCollection"] + """Get the network endpoints of all outbound dependencies of an App Service Environment. + + Description for Get the network endpoints of all outbound dependencies of an App Service + Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OutboundEnvironmentEndpointCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.OutboundEnvironmentEndpointCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundEnvironmentEndpointCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_outbound_network_dependencies_endpoints.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('OutboundEnvironmentEndpointCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + get_outbound_network_dependencies_endpoints.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/outboundNetworkDependenciesEndpoints'} # type: ignore + + def get_private_endpoint_connection_list( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.PrivateEndpointConnectionCollection"] + """Gets the list of private endpoints associated with a hosting environment. + + Description for Gets the list of private endpoints associated with a hosting environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PrivateEndpointConnectionCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.PrivateEndpointConnectionCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_private_endpoint_connection_list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('PrivateEndpointConnectionCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + get_private_endpoint_connection_list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/privateEndpointConnections'} # type: ignore + + def get_private_endpoint_connection( + self, + resource_group_name, # type: str + name, # type: str + private_endpoint_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.RemotePrivateEndpointConnectionARMResource" + """Gets a private endpoint connection. + + Description for Gets a private endpoint connection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param private_endpoint_connection_name: Name of the private endpoint connection. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RemotePrivateEndpointConnectionARMResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.RemotePrivateEndpointConnectionARMResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RemotePrivateEndpointConnectionARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_private_endpoint_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RemotePrivateEndpointConnectionARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_private_endpoint_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def _approve_or_reject_private_endpoint_connection_initial( + self, + resource_group_name, # type: str + name, # type: str + private_endpoint_connection_name, # type: str + private_endpoint_wrapper, # type: "_models.PrivateLinkConnectionApprovalRequestResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.RemotePrivateEndpointConnectionARMResource" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RemotePrivateEndpointConnectionARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._approve_or_reject_private_endpoint_connection_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(private_endpoint_wrapper, 'PrivateLinkConnectionApprovalRequestResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('RemotePrivateEndpointConnectionARMResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('RemotePrivateEndpointConnectionARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _approve_or_reject_private_endpoint_connection_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def begin_approve_or_reject_private_endpoint_connection( + self, + resource_group_name, # type: str + name, # type: str + private_endpoint_connection_name, # type: str + private_endpoint_wrapper, # type: "_models.PrivateLinkConnectionApprovalRequestResource" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.RemotePrivateEndpointConnectionARMResource"] + """Approves or rejects a private endpoint connection. + + Description for Approves or rejects a private endpoint connection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param private_endpoint_connection_name: + :type private_endpoint_connection_name: str + :param private_endpoint_wrapper: + :type private_endpoint_wrapper: ~azure.mgmt.web.v2021_02_01.models.PrivateLinkConnectionApprovalRequestResource + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either RemotePrivateEndpointConnectionARMResource or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2021_02_01.models.RemotePrivateEndpointConnectionARMResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RemotePrivateEndpointConnectionARMResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._approve_or_reject_private_endpoint_connection_initial( + resource_group_name=resource_group_name, + name=name, + private_endpoint_connection_name=private_endpoint_connection_name, + private_endpoint_wrapper=private_endpoint_wrapper, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('RemotePrivateEndpointConnectionARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_approve_or_reject_private_endpoint_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def _delete_private_endpoint_connection_initial( + self, + resource_group_name, # type: str + name, # type: str + private_endpoint_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Any + cls = kwargs.pop('cls', None) # type: ClsType[Any] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._delete_private_endpoint_connection_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('object', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('object', pipeline_response) + + if response.status_code == 204: + deserialized = self._deserialize('object', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _delete_private_endpoint_connection_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def begin_delete_private_endpoint_connection( + self, + resource_group_name, # type: str + name, # type: str + private_endpoint_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[Any] + """Deletes a private endpoint connection. + + Description for Deletes a private endpoint connection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param private_endpoint_connection_name: + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either any or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[any] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[Any] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_private_endpoint_connection_initial( + resource_group_name=resource_group_name, + name=name, + private_endpoint_connection_name=private_endpoint_connection_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('object', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete_private_endpoint_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def get_private_link_resources( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateLinkResourcesWrapper" + """Gets the private link resources. + + Description for Gets the private link resources. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkResourcesWrapper, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.PrivateLinkResourcesWrapper + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourcesWrapper"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_private_link_resources.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateLinkResourcesWrapper', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_private_link_resources.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/privateLinkResources'} # type: ignore + + def reboot( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Reboot all machines in an App Service Environment. + + Description for Reboot all machines in an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.reboot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + reboot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/reboot'} # type: ignore + + def _resume_initial( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.WebAppCollection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._resume_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('WebAppCollection', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('WebAppCollection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _resume_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/resume'} # type: ignore + + def begin_resume( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[ItemPaged["_models.WebAppCollection"]] + """Resume an App Service Environment. + + Description for Resume an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns an iterator like instance of either WebAppCollection or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.WebAppCollection]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.resume.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._resume_initial( + resource_group_name=resource_group_name, + name=name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): + def internal_get_next(next_link=None): + if next_link is None: + return pipeline_response + else: + return get_next(next_link) + + return ItemPaged( + internal_get_next, extract_data + ) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_resume.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/resume'} # type: ignore + + def list_app_service_plans( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.AppServicePlanCollection"] + """Get all App Service plans in an App Service Environment. + + Description for Get all App Service plans in an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AppServicePlanCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.AppServicePlanCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServicePlanCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_app_service_plans.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AppServicePlanCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_app_service_plans.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/serverfarms'} # type: ignore + + def list_web_apps( + self, + resource_group_name, # type: str + name, # type: str + properties_to_include=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.WebAppCollection"] + """Get all apps in an App Service Environment. + + Description for Get all apps in an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param properties_to_include: Comma separated list of app properties to include. + :type properties_to_include: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebAppCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.WebAppCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_web_apps.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if properties_to_include is not None: + query_parameters['propertiesToInclude'] = self._serialize.query("properties_to_include", properties_to_include, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_web_apps.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/sites'} # type: ignore + + def _suspend_initial( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.WebAppCollection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._suspend_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('WebAppCollection', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('WebAppCollection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _suspend_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/suspend'} # type: ignore + + def begin_suspend( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[ItemPaged["_models.WebAppCollection"]] + """Suspend an App Service Environment. + + Description for Suspend an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns an iterator like instance of either WebAppCollection or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.WebAppCollection]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.suspend.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._suspend_initial( + resource_group_name=resource_group_name, + name=name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + def get_long_running_output(pipeline_response): + def internal_get_next(next_link=None): + if next_link is None: + return pipeline_response + else: + return get_next(next_link) + + return ItemPaged( + internal_get_next, extract_data + ) + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_suspend.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/suspend'} # type: ignore + + def list_usages( + self, + resource_group_name, # type: str + name, # type: str + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.CsmUsageQuotaCollection"] + """Get global usage metrics of an App Service Environment. + + Description for Get global usage metrics of an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param filter: Return only usages/metrics specified in the filter. Filter conforms to odata + syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq + 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + duration'[Hour|Minute|Day]'. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CsmUsageQuotaCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.CsmUsageQuotaCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmUsageQuotaCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_usages.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('CsmUsageQuotaCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_usages.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/usages'} # type: ignore + + def list_worker_pools( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.WorkerPoolCollection"] + """Get all worker pools of an App Service Environment. + + Description for Get all worker pools of an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WorkerPoolCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.WorkerPoolCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkerPoolCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_worker_pools.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WorkerPoolCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_worker_pools.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools'} # type: ignore + + def get_worker_pool( + self, + resource_group_name, # type: str + name, # type: str + worker_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.WorkerPoolResource" + """Get properties of a worker pool. + + Description for Get properties of a worker pool. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param worker_pool_name: Name of the worker pool. + :type worker_pool_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkerPoolResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.WorkerPoolResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkerPoolResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_worker_pool.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'workerPoolName': self._serialize.url("worker_pool_name", worker_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_worker_pool.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}'} # type: ignore + + def _create_or_update_worker_pool_initial( + self, + resource_group_name, # type: str + name, # type: str + worker_pool_name, # type: str + worker_pool_envelope, # type: "_models.WorkerPoolResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.WorkerPoolResource" + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkerPoolResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_worker_pool_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'workerPoolName': self._serialize.url("worker_pool_name", worker_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(worker_pool_envelope, 'WorkerPoolResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_worker_pool_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}'} # type: ignore + + def begin_create_or_update_worker_pool( + self, + resource_group_name, # type: str + name, # type: str + worker_pool_name, # type: str + worker_pool_envelope, # type: "_models.WorkerPoolResource" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.WorkerPoolResource"] + """Create or update a worker pool. + + Description for Create or update a worker pool. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param worker_pool_name: Name of the worker pool. + :type worker_pool_name: str + :param worker_pool_envelope: Properties of the worker pool. + :type worker_pool_envelope: ~azure.mgmt.web.v2021_02_01.models.WorkerPoolResource + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either WorkerPoolResource or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2021_02_01.models.WorkerPoolResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkerPoolResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_worker_pool_initial( + resource_group_name=resource_group_name, + name=name, + worker_pool_name=worker_pool_name, + worker_pool_envelope=worker_pool_envelope, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'workerPoolName': self._serialize.url("worker_pool_name", worker_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update_worker_pool.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}'} # type: ignore + + def update_worker_pool( + self, + resource_group_name, # type: str + name, # type: str + worker_pool_name, # type: str + worker_pool_envelope, # type: "_models.WorkerPoolResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.WorkerPoolResource" + """Create or update a worker pool. + + Description for Create or update a worker pool. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param worker_pool_name: Name of the worker pool. + :type worker_pool_name: str + :param worker_pool_envelope: Properties of the worker pool. + :type worker_pool_envelope: ~azure.mgmt.web.v2021_02_01.models.WorkerPoolResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkerPoolResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.WorkerPoolResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkerPoolResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_worker_pool.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'workerPoolName': self._serialize.url("worker_pool_name", worker_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(worker_pool_envelope, 'WorkerPoolResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('WorkerPoolResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_worker_pool.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}'} # type: ignore + + def list_worker_pool_instance_metric_definitions( + self, + resource_group_name, # type: str + name, # type: str + worker_pool_name, # type: str + instance, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ResourceMetricDefinitionCollection"] + """Get metric definitions for a specific instance of a worker pool of an App Service Environment. + + Description for Get metric definitions for a specific instance of a worker pool of an App + Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param worker_pool_name: Name of the worker pool. + :type worker_pool_name: str + :param instance: Name of the instance in the worker pool. + :type instance: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceMetricDefinitionCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.ResourceMetricDefinitionCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceMetricDefinitionCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_worker_pool_instance_metric_definitions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'workerPoolName': self._serialize.url("worker_pool_name", worker_pool_name, 'str'), + 'instance': self._serialize.url("instance", instance, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceMetricDefinitionCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_worker_pool_instance_metric_definitions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/instances/{instance}/metricdefinitions'} # type: ignore + + def list_web_worker_metric_definitions( + self, + resource_group_name, # type: str + name, # type: str + worker_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ResourceMetricDefinitionCollection"] + """Get metric definitions for a worker pool of an App Service Environment. + + Description for Get metric definitions for a worker pool of an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param worker_pool_name: Name of the worker pool. + :type worker_pool_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceMetricDefinitionCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.ResourceMetricDefinitionCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceMetricDefinitionCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_web_worker_metric_definitions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'workerPoolName': self._serialize.url("worker_pool_name", worker_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceMetricDefinitionCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_web_worker_metric_definitions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/metricdefinitions'} # type: ignore + + def list_worker_pool_skus( + self, + resource_group_name, # type: str + name, # type: str + worker_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SkuInfoCollection"] + """Get available SKUs for scaling a worker pool. + + Description for Get available SKUs for scaling a worker pool. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param worker_pool_name: Name of the worker pool. + :type worker_pool_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SkuInfoCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.SkuInfoCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_worker_pool_skus.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'workerPoolName': self._serialize.url("worker_pool_name", worker_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SkuInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_worker_pool_skus.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/skus'} # type: ignore + + def list_web_worker_usages( + self, + resource_group_name, # type: str + name, # type: str + worker_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.UsageCollection"] + """Get usage metrics for a worker pool of an App Service Environment. + + Description for Get usage metrics for a worker pool of an App Service Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service Environment. + :type name: str + :param worker_pool_name: Name of the worker pool. + :type worker_pool_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either UsageCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.UsageCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsageCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_web_worker_usages.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'workerPoolName': self._serialize.url("worker_pool_name", worker_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('UsageCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_web_worker_usages.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/usages'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_app_service_plans_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_app_service_plans_operations.py new file mode 100644 index 000000000000..288932a37a7b --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_app_service_plans_operations.py @@ -0,0 +1,2029 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, List, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class AppServicePlansOperations(object): + """AppServicePlansOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2021_02_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + detailed=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.AppServicePlanCollection"] + """Get all App Service plans for a subscription. + + Description for Get all App Service plans for a subscription. + + :param detailed: Specify :code:`true` to return all App Service plan properties. + The default is :code:`false`, which returns a subset of the properties. + Retrieval of all properties may increase the API latency. + :type detailed: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AppServicePlanCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.AppServicePlanCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServicePlanCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if detailed is not None: + query_parameters['detailed'] = self._serialize.query("detailed", detailed, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AppServicePlanCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/serverfarms'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.AppServicePlanCollection"] + """Get all App Service plans in a resource group. + + Description for Get all App Service plans in a resource group. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AppServicePlanCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.AppServicePlanCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServicePlanCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AppServicePlanCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms'} # type: ignore + + def get( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.AppServicePlan" + """Get an App Service plan. + + Description for Get an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AppServicePlan, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.AppServicePlan + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServicePlan"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AppServicePlan', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + name, # type: str + app_service_plan, # type: "_models.AppServicePlan" + **kwargs # type: Any + ): + # type: (...) -> "_models.AppServicePlan" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServicePlan"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(app_service_plan, 'AppServicePlan') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AppServicePlan', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('AppServicePlan', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + name, # type: str + app_service_plan, # type: "_models.AppServicePlan" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.AppServicePlan"] + """Creates or updates an App Service Plan. + + Description for Creates or updates an App Service Plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param app_service_plan: Details of the App Service plan. + :type app_service_plan: ~azure.mgmt.web.v2021_02_01.models.AppServicePlan + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either AppServicePlan or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2021_02_01.models.AppServicePlan] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServicePlan"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + name=name, + app_service_plan=app_service_plan, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AppServicePlan', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete an App Service plan. + + Description for Delete an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + name, # type: str + app_service_plan, # type: "_models.AppServicePlanPatchResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.AppServicePlan" + """Creates or updates an App Service Plan. + + Description for Creates or updates an App Service Plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param app_service_plan: Details of the App Service plan. + :type app_service_plan: ~azure.mgmt.web.v2021_02_01.models.AppServicePlanPatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AppServicePlan, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.AppServicePlan + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppServicePlan"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(app_service_plan, 'AppServicePlanPatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AppServicePlan', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('AppServicePlan', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}'} # type: ignore + + def list_capabilities( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> List["_models.Capability"] + """List all capabilities of an App Service plan. + + Description for List all capabilities of an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of Capability, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2021_02_01.models.Capability] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.Capability"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_capabilities.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[Capability]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_capabilities.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/capabilities'} # type: ignore + + def get_hybrid_connection( + self, + resource_group_name, # type: str + name, # type: str + namespace_name, # type: str + relay_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.HybridConnection" + """Retrieve a Hybrid Connection in use in an App Service plan. + + Description for Retrieve a Hybrid Connection in use in an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param namespace_name: Name of the Service Bus namespace. + :type namespace_name: str + :param relay_name: Name of the Service Bus relay. + :type relay_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnection, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.HybridConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_hybrid_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_hybrid_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} # type: ignore + + def delete_hybrid_connection( + self, + resource_group_name, # type: str + name, # type: str + namespace_name, # type: str + relay_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a Hybrid Connection in use in an App Service plan. + + Description for Delete a Hybrid Connection in use in an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param namespace_name: Name of the Service Bus namespace. + :type namespace_name: str + :param relay_name: Name of the Service Bus relay. + :type relay_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_hybrid_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_hybrid_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} # type: ignore + + def list_hybrid_connection_keys( + self, + resource_group_name, # type: str + name, # type: str + namespace_name, # type: str + relay_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.HybridConnectionKey" + """Get the send key name and value of a Hybrid Connection. + + Description for Get the send key name and value of a Hybrid Connection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param namespace_name: The name of the Service Bus namespace. + :type namespace_name: str + :param relay_name: The name of the Service Bus relay. + :type relay_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnectionKey, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.HybridConnectionKey + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnectionKey"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_hybrid_connection_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnectionKey', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_hybrid_connection_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}/listKeys'} # type: ignore + + def list_web_apps_by_hybrid_connection( + self, + resource_group_name, # type: str + name, # type: str + namespace_name, # type: str + relay_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ResourceCollection"] + """Get all apps that use a Hybrid Connection in an App Service Plan. + + Description for Get all apps that use a Hybrid Connection in an App Service Plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param namespace_name: Name of the Hybrid Connection namespace. + :type namespace_name: str + :param relay_name: Name of the Hybrid Connection relay. + :type relay_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.ResourceCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_web_apps_by_hybrid_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_web_apps_by_hybrid_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}/sites'} # type: ignore + + def get_hybrid_connection_plan_limit( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.HybridConnectionLimits" + """Get the maximum number of Hybrid Connections allowed in an App Service plan. + + Description for Get the maximum number of Hybrid Connections allowed in an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnectionLimits, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.HybridConnectionLimits + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnectionLimits"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_hybrid_connection_plan_limit.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnectionLimits', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_hybrid_connection_plan_limit.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionPlanLimits/limit'} # type: ignore + + def list_hybrid_connections( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.HybridConnectionCollection"] + """Retrieve all Hybrid Connections in use in an App Service plan. + + Description for Retrieve all Hybrid Connections in use in an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either HybridConnectionCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.HybridConnectionCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnectionCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_hybrid_connections.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('HybridConnectionCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_hybrid_connections.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionRelays'} # type: ignore + + def restart_web_apps( + self, + resource_group_name, # type: str + name, # type: str + soft_restart=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> None + """Restart all apps in an App Service plan. + + Description for Restart all apps in an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param soft_restart: Specify :code:`true` to perform a soft restart, applies the + configuration settings and restarts the apps if necessary. The default is + :code:`false`, which always restarts and reprovisions the apps. + :type soft_restart: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.restart_web_apps.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if soft_restart is not None: + query_parameters['softRestart'] = self._serialize.query("soft_restart", soft_restart, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + restart_web_apps.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/restartSites'} # type: ignore + + def list_web_apps( + self, + resource_group_name, # type: str + name, # type: str + skip_token=None, # type: Optional[str] + filter=None, # type: Optional[str] + top=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.WebAppCollection"] + """Get all apps associated with an App Service plan. + + Description for Get all apps associated with an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param skip_token: Skip to a web app in the list of webapps associated with app service plan. + If specified, the resulting list will contain web apps starting from (including) the skipToken. + Otherwise, the resulting list contains web apps from the start of the list. + :type skip_token: str + :param filter: Supported filter: $filter=state eq running. Returns only web apps that are + currently running. + :type filter: str + :param top: List page size. If specified, results are paged. + :type top: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebAppCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.WebAppCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_web_apps.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_web_apps.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/sites'} # type: ignore + + def get_server_farm_skus( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Any + """Gets all selectable SKUs for a given App Service Plan. + + Description for Gets all selectable SKUs for a given App Service Plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of App Service Plan. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: any, or the result of cls(response) + :rtype: any + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Any] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_server_farm_skus.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('object', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_server_farm_skus.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/skus'} # type: ignore + + def list_usages( + self, + resource_group_name, # type: str + name, # type: str + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.CsmUsageQuotaCollection"] + """Gets server farm usage information. + + Description for Gets server farm usage information. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of App Service Plan. + :type name: str + :param filter: Return only usages/metrics specified in the filter. Filter conforms to odata + syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2'). + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CsmUsageQuotaCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.CsmUsageQuotaCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmUsageQuotaCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_usages.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('CsmUsageQuotaCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_usages.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/usages'} # type: ignore + + def list_vnets( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> List["_models.VnetInfoResource"] + """Get all Virtual Networks associated with an App Service plan. + + Description for Get all Virtual Networks associated with an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of VnetInfoResource, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2021_02_01.models.VnetInfoResource] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VnetInfoResource"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_vnets.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[VnetInfoResource]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_vnets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections'} # type: ignore + + def get_vnet_from_server_farm( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.VnetInfoResource" + """Get a Virtual Network associated with an App Service plan. + + Description for Get a Virtual Network associated with an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetInfoResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.VnetInfoResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetInfoResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_vnet_from_server_farm.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetInfoResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_vnet_from_server_farm.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}'} # type: ignore + + def get_vnet_gateway( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + gateway_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.VnetGateway" + """Get a Virtual Network gateway. + + Description for Get a Virtual Network gateway. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param gateway_name: Name of the gateway. Only the 'primary' gateway is supported. + :type gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetGateway, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.VnetGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_vnet_gateway.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_vnet_gateway.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'} # type: ignore + + def update_vnet_gateway( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + gateway_name, # type: str + connection_envelope, # type: "_models.VnetGateway" + **kwargs # type: Any + ): + # type: (...) -> "_models.VnetGateway" + """Update a Virtual Network gateway. + + Description for Update a Virtual Network gateway. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param gateway_name: Name of the gateway. Only the 'primary' gateway is supported. + :type gateway_name: str + :param connection_envelope: Definition of the gateway. + :type connection_envelope: ~azure.mgmt.web.v2021_02_01.models.VnetGateway + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetGateway, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.VnetGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_vnet_gateway.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'VnetGateway') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_vnet_gateway.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'} # type: ignore + + def list_routes_for_vnet( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> List["_models.VnetRoute"] + """Get all routes that are associated with a Virtual Network in an App Service plan. + + Description for Get all routes that are associated with a Virtual Network in an App Service + plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of VnetRoute, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2021_02_01.models.VnetRoute] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VnetRoute"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_routes_for_vnet.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[VnetRoute]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_routes_for_vnet.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes'} # type: ignore + + def get_route_for_vnet( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + route_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> List["_models.VnetRoute"] + """Get a Virtual Network route in an App Service plan. + + Description for Get a Virtual Network route in an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param route_name: Name of the Virtual Network route. + :type route_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of VnetRoute, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2021_02_01.models.VnetRoute] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VnetRoute"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_route_for_vnet.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[VnetRoute]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_route_for_vnet.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}'} # type: ignore + + def create_or_update_vnet_route( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + route_name, # type: str + route, # type: "_models.VnetRoute" + **kwargs # type: Any + ): + # type: (...) -> "_models.VnetRoute" + """Create or update a Virtual Network route in an App Service plan. + + Description for Create or update a Virtual Network route in an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param route_name: Name of the Virtual Network route. + :type route_name: str + :param route: Definition of the Virtual Network route. + :type route: ~azure.mgmt.web.v2021_02_01.models.VnetRoute + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetRoute, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.VnetRoute + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetRoute"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_vnet_route.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(route, 'VnetRoute') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetRoute', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_vnet_route.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}'} # type: ignore + + def delete_vnet_route( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + route_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a Virtual Network route in an App Service plan. + + Description for Delete a Virtual Network route in an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param route_name: Name of the Virtual Network route. + :type route_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_vnet_route.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_vnet_route.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}'} # type: ignore + + def update_vnet_route( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + route_name, # type: str + route, # type: "_models.VnetRoute" + **kwargs # type: Any + ): + # type: (...) -> "_models.VnetRoute" + """Create or update a Virtual Network route in an App Service plan. + + Description for Create or update a Virtual Network route in an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param route_name: Name of the Virtual Network route. + :type route_name: str + :param route: Definition of the Virtual Network route. + :type route: ~azure.mgmt.web.v2021_02_01.models.VnetRoute + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetRoute, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.VnetRoute + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetRoute"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_vnet_route.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'routeName': self._serialize.url("route_name", route_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(route, 'VnetRoute') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetRoute', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_vnet_route.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}'} # type: ignore + + def reboot_worker( + self, + resource_group_name, # type: str + name, # type: str + worker_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Reboot a worker machine in an App Service plan. + + Description for Reboot a worker machine in an App Service plan. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the App Service plan. + :type name: str + :param worker_name: Name of worker machine, which typically starts with RD. + :type worker_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.reboot_worker.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'workerName': self._serialize.url("worker_name", worker_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + reboot_worker.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/workers/{workerName}/reboot'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_certificate_orders_diagnostics_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_certificate_orders_diagnostics_operations.py new file mode 100644 index 000000000000..a1451541174b --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_certificate_orders_diagnostics_operations.py @@ -0,0 +1,207 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import datetime +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class CertificateOrdersDiagnosticsOperations(object): + """CertificateOrdersDiagnosticsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2021_02_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_app_service_certificate_order_detector_response( + self, + resource_group_name, # type: str + certificate_order_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DetectorResponseCollection"] + """Microsoft.CertificateRegistration to get the list of detectors for this RP. + + Description for Microsoft.CertificateRegistration to get the list of detectors for this RP. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: The certificate order name for which the response is needed. + :type certificate_order_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DetectorResponseCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.DetectorResponseCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DetectorResponseCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_app_service_certificate_order_detector_response.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DetectorResponseCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_app_service_certificate_order_detector_response.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/detectors'} # type: ignore + + def get_app_service_certificate_order_detector_response( + self, + resource_group_name, # type: str + certificate_order_name, # type: str + detector_name, # type: str + start_time=None, # type: Optional[datetime.datetime] + end_time=None, # type: Optional[datetime.datetime] + time_grain=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.DetectorResponse" + """Microsoft.CertificateRegistration call to get a detector response from App Lens. + + Description for Microsoft.CertificateRegistration call to get a detector response from App + Lens. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param certificate_order_name: The certificate order name for which the response is needed. + :type certificate_order_name: str + :param detector_name: The detector name which needs to be run. + :type detector_name: str + :param start_time: The start time for detector response. + :type start_time: ~datetime.datetime + :param end_time: The end time for the detector response. + :type end_time: ~datetime.datetime + :param time_grain: The time grain for the detector response. + :type time_grain: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DetectorResponse, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.DetectorResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DetectorResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_app_service_certificate_order_detector_response.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'certificateOrderName': self._serialize.url("certificate_order_name", certificate_order_name, 'str'), + 'detectorName': self._serialize.url("detector_name", detector_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if start_time is not None: + query_parameters['startTime'] = self._serialize.query("start_time", start_time, 'iso-8601') + if end_time is not None: + query_parameters['endTime'] = self._serialize.query("end_time", end_time, 'iso-8601') + if time_grain is not None: + query_parameters['timeGrain'] = self._serialize.query("time_grain", time_grain, 'str', pattern=r'PT[1-9][0-9]+[SMH]') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DetectorResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_app_service_certificate_order_detector_response.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/detectors/{detectorName}'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_certificate_registration_provider_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_certificate_registration_provider_operations.py new file mode 100644 index 000000000000..a7e86f8f810d --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_certificate_registration_provider_operations.py @@ -0,0 +1,113 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class CertificateRegistrationProviderOperations(object): + """CertificateRegistrationProviderOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2021_02_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_operations( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.CsmOperationCollection"] + """Implements Csm operations Api to exposes the list of available Csm Apis under the resource provider. + + Description for Implements Csm operations Api to exposes the list of available Csm Apis under + the resource provider. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CsmOperationCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.CsmOperationCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmOperationCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_operations.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('CsmOperationCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_operations.metadata = {'url': '/providers/Microsoft.CertificateRegistration/operations'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_certificates_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_certificates_operations.py new file mode 100644 index 000000000000..cf9080c10f36 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_certificates_operations.py @@ -0,0 +1,457 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class CertificatesOperations(object): + """CertificatesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2021_02_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.CertificateCollection"] + """Get all certificates for a subscription. + + Description for Get all certificates for a subscription. + + :param filter: Return only information specified in the filter (using OData syntax). For + example: $filter=KeyVaultId eq 'KeyVaultId'. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CertificateCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.CertificateCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CertificateCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('CertificateCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/certificates'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.CertificateCollection"] + """Get all certificates in a resource group. + + Description for Get all certificates in a resource group. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CertificateCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.CertificateCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CertificateCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('CertificateCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates'} # type: ignore + + def get( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Certificate" + """Get a certificate. + + Description for Get a certificate. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the certificate. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Certificate, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.Certificate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Certificate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Certificate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}'} # type: ignore + + def create_or_update( + self, + resource_group_name, # type: str + name, # type: str + certificate_envelope, # type: "_models.Certificate" + **kwargs # type: Any + ): + # type: (...) -> "_models.Certificate" + """Create or update a certificate. + + Description for Create or update a certificate. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the certificate. + :type name: str + :param certificate_envelope: Details of certificate, if it exists already. + :type certificate_envelope: ~azure.mgmt.web.v2021_02_01.models.Certificate + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Certificate, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.Certificate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Certificate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(certificate_envelope, 'Certificate') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Certificate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a certificate. + + Description for Delete a certificate. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the certificate. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + name, # type: str + certificate_envelope, # type: "_models.CertificatePatchResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.Certificate" + """Create or update a certificate. + + Description for Create or update a certificate. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the certificate. + :type name: str + :param certificate_envelope: Details of certificate, if it exists already. + :type certificate_envelope: ~azure.mgmt.web.v2021_02_01.models.CertificatePatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Certificate, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.Certificate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Certificate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(certificate_envelope, 'CertificatePatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Certificate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_deleted_web_apps_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_deleted_web_apps_operations.py new file mode 100644 index 000000000000..dc37f12e92e7 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_deleted_web_apps_operations.py @@ -0,0 +1,252 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class DeletedWebAppsOperations(object): + """DeletedWebAppsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2021_02_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DeletedWebAppCollection"] + """Get all deleted apps for a subscription. + + Description for Get all deleted apps for a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DeletedWebAppCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.DeletedWebAppCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DeletedWebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DeletedWebAppCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/deletedSites'} # type: ignore + + def list_by_location( + self, + location, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DeletedWebAppCollection"] + """Get all deleted apps for a subscription at location. + + Description for Get all deleted apps for a subscription at location. + + :param location: + :type location: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DeletedWebAppCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.DeletedWebAppCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DeletedWebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_location.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DeletedWebAppCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_location.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/locations/{location}/deletedSites'} # type: ignore + + def get_deleted_web_app_by_location( + self, + location, # type: str + deleted_site_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.DeletedSite" + """Get deleted app for a subscription at location. + + Description for Get deleted app for a subscription at location. + + :param location: + :type location: str + :param deleted_site_id: The numeric ID of the deleted app, e.g. 12345. + :type deleted_site_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DeletedSite, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.DeletedSite + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DeletedSite"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_deleted_web_app_by_location.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'deletedSiteId': self._serialize.url("deleted_site_id", deleted_site_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DeletedSite', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_deleted_web_app_by_location.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/locations/{location}/deletedSites/{deletedSiteId}'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_diagnostics_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_diagnostics_operations.py new file mode 100644 index 000000000000..9b50027ef5e4 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_diagnostics_operations.py @@ -0,0 +1,1800 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import datetime +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class DiagnosticsOperations(object): + """DiagnosticsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2021_02_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_hosting_environment_detector_responses( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DetectorResponseCollection"] + """List Hosting Environment Detector Responses. + + Description for List Hosting Environment Detector Responses. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site Name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DetectorResponseCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.DetectorResponseCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DetectorResponseCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_hosting_environment_detector_responses.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DetectorResponseCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_hosting_environment_detector_responses.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/detectors'} # type: ignore + + def get_hosting_environment_detector_response( + self, + resource_group_name, # type: str + name, # type: str + detector_name, # type: str + start_time=None, # type: Optional[datetime.datetime] + end_time=None, # type: Optional[datetime.datetime] + time_grain=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.DetectorResponse" + """Get Hosting Environment Detector Response. + + Description for Get Hosting Environment Detector Response. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: App Service Environment Name. + :type name: str + :param detector_name: Detector Resource Name. + :type detector_name: str + :param start_time: Start Time. + :type start_time: ~datetime.datetime + :param end_time: End Time. + :type end_time: ~datetime.datetime + :param time_grain: Time Grain. + :type time_grain: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DetectorResponse, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.DetectorResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DetectorResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_hosting_environment_detector_response.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'detectorName': self._serialize.url("detector_name", detector_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if start_time is not None: + query_parameters['startTime'] = self._serialize.query("start_time", start_time, 'iso-8601') + if end_time is not None: + query_parameters['endTime'] = self._serialize.query("end_time", end_time, 'iso-8601') + if time_grain is not None: + query_parameters['timeGrain'] = self._serialize.query("time_grain", time_grain, 'str', pattern=r'PT[1-9][0-9]+[SMH]') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DetectorResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_hosting_environment_detector_response.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/detectors/{detectorName}'} # type: ignore + + def list_site_detector_responses( + self, + resource_group_name, # type: str + site_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DetectorResponseCollection"] + """List Site Detector Responses. + + Description for List Site Detector Responses. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DetectorResponseCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.DetectorResponseCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DetectorResponseCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_detector_responses.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DetectorResponseCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_site_detector_responses.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/detectors'} # type: ignore + + def get_site_detector_response( + self, + resource_group_name, # type: str + site_name, # type: str + detector_name, # type: str + start_time=None, # type: Optional[datetime.datetime] + end_time=None, # type: Optional[datetime.datetime] + time_grain=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.DetectorResponse" + """Get site detector response. + + Description for Get site detector response. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param detector_name: Detector Resource Name. + :type detector_name: str + :param start_time: Start Time. + :type start_time: ~datetime.datetime + :param end_time: End Time. + :type end_time: ~datetime.datetime + :param time_grain: Time Grain. + :type time_grain: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DetectorResponse, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.DetectorResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DetectorResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_site_detector_response.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'detectorName': self._serialize.url("detector_name", detector_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if start_time is not None: + query_parameters['startTime'] = self._serialize.query("start_time", start_time, 'iso-8601') + if end_time is not None: + query_parameters['endTime'] = self._serialize.query("end_time", end_time, 'iso-8601') + if time_grain is not None: + query_parameters['timeGrain'] = self._serialize.query("time_grain", time_grain, 'str', pattern=r'PT[1-9][0-9]+[SMH]') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DetectorResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_detector_response.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/detectors/{detectorName}'} # type: ignore + + def list_site_diagnostic_categories( + self, + resource_group_name, # type: str + site_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DiagnosticCategoryCollection"] + """Get Diagnostics Categories. + + Description for Get Diagnostics Categories. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DiagnosticCategoryCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.DiagnosticCategoryCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticCategoryCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_diagnostic_categories.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DiagnosticCategoryCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_site_diagnostic_categories.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics'} # type: ignore + + def get_site_diagnostic_category( + self, + resource_group_name, # type: str + site_name, # type: str + diagnostic_category, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.DiagnosticCategory" + """Get Diagnostics Category. + + Description for Get Diagnostics Category. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Diagnostic Category. + :type diagnostic_category: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DiagnosticCategory, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.DiagnosticCategory + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticCategory"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_site_diagnostic_category.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DiagnosticCategory', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_diagnostic_category.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}'} # type: ignore + + def list_site_analyses( + self, + resource_group_name, # type: str + site_name, # type: str + diagnostic_category, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DiagnosticAnalysisCollection"] + """Get Site Analyses. + + Description for Get Site Analyses. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Diagnostic Category. + :type diagnostic_category: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DiagnosticAnalysisCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.DiagnosticAnalysisCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticAnalysisCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_analyses.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DiagnosticAnalysisCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_site_analyses.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/analyses'} # type: ignore + + def get_site_analysis( + self, + resource_group_name, # type: str + site_name, # type: str + diagnostic_category, # type: str + analysis_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.AnalysisDefinition" + """Get Site Analysis. + + Description for Get Site Analysis. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Diagnostic Category. + :type diagnostic_category: str + :param analysis_name: Analysis Name. + :type analysis_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AnalysisDefinition, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.AnalysisDefinition + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AnalysisDefinition"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_site_analysis.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'analysisName': self._serialize.url("analysis_name", analysis_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AnalysisDefinition', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_analysis.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/analyses/{analysisName}'} # type: ignore + + def execute_site_analysis( + self, + resource_group_name, # type: str + site_name, # type: str + diagnostic_category, # type: str + analysis_name, # type: str + start_time=None, # type: Optional[datetime.datetime] + end_time=None, # type: Optional[datetime.datetime] + time_grain=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.DiagnosticAnalysis" + """Execute Analysis. + + Description for Execute Analysis. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Category Name. + :type diagnostic_category: str + :param analysis_name: Analysis Resource Name. + :type analysis_name: str + :param start_time: Start Time. + :type start_time: ~datetime.datetime + :param end_time: End Time. + :type end_time: ~datetime.datetime + :param time_grain: Time Grain. + :type time_grain: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DiagnosticAnalysis, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.DiagnosticAnalysis + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticAnalysis"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.execute_site_analysis.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'analysisName': self._serialize.url("analysis_name", analysis_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if start_time is not None: + query_parameters['startTime'] = self._serialize.query("start_time", start_time, 'iso-8601') + if end_time is not None: + query_parameters['endTime'] = self._serialize.query("end_time", end_time, 'iso-8601') + if time_grain is not None: + query_parameters['timeGrain'] = self._serialize.query("time_grain", time_grain, 'str', pattern=r'PT[1-9][0-9]+[SMH]') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DiagnosticAnalysis', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + execute_site_analysis.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/analyses/{analysisName}/execute'} # type: ignore + + def list_site_detectors( + self, + resource_group_name, # type: str + site_name, # type: str + diagnostic_category, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DiagnosticDetectorCollection"] + """Get Detectors. + + Description for Get Detectors. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Diagnostic Category. + :type diagnostic_category: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DiagnosticDetectorCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.DiagnosticDetectorCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticDetectorCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_detectors.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DiagnosticDetectorCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_site_detectors.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/detectors'} # type: ignore + + def get_site_detector( + self, + resource_group_name, # type: str + site_name, # type: str + diagnostic_category, # type: str + detector_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.DetectorDefinitionResource" + """Get Detector. + + Description for Get Detector. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Diagnostic Category. + :type diagnostic_category: str + :param detector_name: Detector Name. + :type detector_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DetectorDefinitionResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.DetectorDefinitionResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DetectorDefinitionResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_site_detector.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'detectorName': self._serialize.url("detector_name", detector_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DetectorDefinitionResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_detector.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/detectors/{detectorName}'} # type: ignore + + def execute_site_detector( + self, + resource_group_name, # type: str + site_name, # type: str + detector_name, # type: str + diagnostic_category, # type: str + start_time=None, # type: Optional[datetime.datetime] + end_time=None, # type: Optional[datetime.datetime] + time_grain=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.DiagnosticDetectorResponse" + """Execute Detector. + + Description for Execute Detector. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param detector_name: Detector Resource Name. + :type detector_name: str + :param diagnostic_category: Category Name. + :type diagnostic_category: str + :param start_time: Start Time. + :type start_time: ~datetime.datetime + :param end_time: End Time. + :type end_time: ~datetime.datetime + :param time_grain: Time Grain. + :type time_grain: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DiagnosticDetectorResponse, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.DiagnosticDetectorResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticDetectorResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.execute_site_detector.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'detectorName': self._serialize.url("detector_name", detector_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if start_time is not None: + query_parameters['startTime'] = self._serialize.query("start_time", start_time, 'iso-8601') + if end_time is not None: + query_parameters['endTime'] = self._serialize.query("end_time", end_time, 'iso-8601') + if time_grain is not None: + query_parameters['timeGrain'] = self._serialize.query("time_grain", time_grain, 'str', pattern=r'PT[1-9][0-9]+[SMH]') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DiagnosticDetectorResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + execute_site_detector.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/detectors/{detectorName}/execute'} # type: ignore + + def list_site_detector_responses_slot( + self, + resource_group_name, # type: str + site_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DetectorResponseCollection"] + """List Site Detector Responses. + + Description for List Site Detector Responses. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param slot: Slot Name. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DetectorResponseCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.DetectorResponseCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DetectorResponseCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_detector_responses_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DetectorResponseCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_site_detector_responses_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/detectors'} # type: ignore + + def get_site_detector_response_slot( + self, + resource_group_name, # type: str + site_name, # type: str + detector_name, # type: str + slot, # type: str + start_time=None, # type: Optional[datetime.datetime] + end_time=None, # type: Optional[datetime.datetime] + time_grain=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.DetectorResponse" + """Get site detector response. + + Description for Get site detector response. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param detector_name: Detector Resource Name. + :type detector_name: str + :param slot: Slot Name. + :type slot: str + :param start_time: Start Time. + :type start_time: ~datetime.datetime + :param end_time: End Time. + :type end_time: ~datetime.datetime + :param time_grain: Time Grain. + :type time_grain: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DetectorResponse, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.DetectorResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DetectorResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_site_detector_response_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'detectorName': self._serialize.url("detector_name", detector_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if start_time is not None: + query_parameters['startTime'] = self._serialize.query("start_time", start_time, 'iso-8601') + if end_time is not None: + query_parameters['endTime'] = self._serialize.query("end_time", end_time, 'iso-8601') + if time_grain is not None: + query_parameters['timeGrain'] = self._serialize.query("time_grain", time_grain, 'str', pattern=r'PT[1-9][0-9]+[SMH]') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DetectorResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_detector_response_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/detectors/{detectorName}'} # type: ignore + + def list_site_diagnostic_categories_slot( + self, + resource_group_name, # type: str + site_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DiagnosticCategoryCollection"] + """Get Diagnostics Categories. + + Description for Get Diagnostics Categories. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param slot: Slot Name. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DiagnosticCategoryCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.DiagnosticCategoryCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticCategoryCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_diagnostic_categories_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DiagnosticCategoryCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_site_diagnostic_categories_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics'} # type: ignore + + def get_site_diagnostic_category_slot( + self, + resource_group_name, # type: str + site_name, # type: str + diagnostic_category, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.DiagnosticCategory" + """Get Diagnostics Category. + + Description for Get Diagnostics Category. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Diagnostic Category. + :type diagnostic_category: str + :param slot: Slot Name. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DiagnosticCategory, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.DiagnosticCategory + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticCategory"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_site_diagnostic_category_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DiagnosticCategory', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_diagnostic_category_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}'} # type: ignore + + def list_site_analyses_slot( + self, + resource_group_name, # type: str + site_name, # type: str + diagnostic_category, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DiagnosticAnalysisCollection"] + """Get Site Analyses. + + Description for Get Site Analyses. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Diagnostic Category. + :type diagnostic_category: str + :param slot: Slot Name. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DiagnosticAnalysisCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.DiagnosticAnalysisCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticAnalysisCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_analyses_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DiagnosticAnalysisCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_site_analyses_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/analyses'} # type: ignore + + def get_site_analysis_slot( + self, + resource_group_name, # type: str + site_name, # type: str + diagnostic_category, # type: str + analysis_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.AnalysisDefinition" + """Get Site Analysis. + + Description for Get Site Analysis. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Diagnostic Category. + :type diagnostic_category: str + :param analysis_name: Analysis Name. + :type analysis_name: str + :param slot: Slot - optional. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AnalysisDefinition, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.AnalysisDefinition + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AnalysisDefinition"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_site_analysis_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'analysisName': self._serialize.url("analysis_name", analysis_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AnalysisDefinition', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_analysis_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/analyses/{analysisName}'} # type: ignore + + def execute_site_analysis_slot( + self, + resource_group_name, # type: str + site_name, # type: str + diagnostic_category, # type: str + analysis_name, # type: str + slot, # type: str + start_time=None, # type: Optional[datetime.datetime] + end_time=None, # type: Optional[datetime.datetime] + time_grain=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.DiagnosticAnalysis" + """Execute Analysis. + + Description for Execute Analysis. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Category Name. + :type diagnostic_category: str + :param analysis_name: Analysis Resource Name. + :type analysis_name: str + :param slot: Slot Name. + :type slot: str + :param start_time: Start Time. + :type start_time: ~datetime.datetime + :param end_time: End Time. + :type end_time: ~datetime.datetime + :param time_grain: Time Grain. + :type time_grain: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DiagnosticAnalysis, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.DiagnosticAnalysis + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticAnalysis"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.execute_site_analysis_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'analysisName': self._serialize.url("analysis_name", analysis_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if start_time is not None: + query_parameters['startTime'] = self._serialize.query("start_time", start_time, 'iso-8601') + if end_time is not None: + query_parameters['endTime'] = self._serialize.query("end_time", end_time, 'iso-8601') + if time_grain is not None: + query_parameters['timeGrain'] = self._serialize.query("time_grain", time_grain, 'str', pattern=r'PT[1-9][0-9]+[SMH]') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DiagnosticAnalysis', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + execute_site_analysis_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/analyses/{analysisName}/execute'} # type: ignore + + def list_site_detectors_slot( + self, + resource_group_name, # type: str + site_name, # type: str + diagnostic_category, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DiagnosticDetectorCollection"] + """Get Detectors. + + Description for Get Detectors. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Diagnostic Category. + :type diagnostic_category: str + :param slot: Slot Name. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DiagnosticDetectorCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.DiagnosticDetectorCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticDetectorCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_detectors_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DiagnosticDetectorCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_site_detectors_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/detectors'} # type: ignore + + def get_site_detector_slot( + self, + resource_group_name, # type: str + site_name, # type: str + diagnostic_category, # type: str + detector_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.DetectorDefinitionResource" + """Get Detector. + + Description for Get Detector. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param diagnostic_category: Diagnostic Category. + :type diagnostic_category: str + :param detector_name: Detector Name. + :type detector_name: str + :param slot: Slot Name. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DetectorDefinitionResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.DetectorDefinitionResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DetectorDefinitionResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_site_detector_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'detectorName': self._serialize.url("detector_name", detector_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DetectorDefinitionResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_detector_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/detectors/{detectorName}'} # type: ignore + + def execute_site_detector_slot( + self, + resource_group_name, # type: str + site_name, # type: str + detector_name, # type: str + diagnostic_category, # type: str + slot, # type: str + start_time=None, # type: Optional[datetime.datetime] + end_time=None, # type: Optional[datetime.datetime] + time_grain=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.DiagnosticDetectorResponse" + """Execute Detector. + + Description for Execute Detector. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site Name. + :type site_name: str + :param detector_name: Detector Resource Name. + :type detector_name: str + :param diagnostic_category: Category Name. + :type diagnostic_category: str + :param slot: Slot Name. + :type slot: str + :param start_time: Start Time. + :type start_time: ~datetime.datetime + :param end_time: End Time. + :type end_time: ~datetime.datetime + :param time_grain: Time Grain. + :type time_grain: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DiagnosticDetectorResponse, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.DiagnosticDetectorResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticDetectorResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.execute_site_detector_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'detectorName': self._serialize.url("detector_name", detector_name, 'str'), + 'diagnosticCategory': self._serialize.url("diagnostic_category", diagnostic_category, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if start_time is not None: + query_parameters['startTime'] = self._serialize.query("start_time", start_time, 'iso-8601') + if end_time is not None: + query_parameters['endTime'] = self._serialize.query("end_time", end_time, 'iso-8601') + if time_grain is not None: + query_parameters['timeGrain'] = self._serialize.query("time_grain", time_grain, 'str', pattern=r'PT[1-9][0-9]+[SMH]') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DiagnosticDetectorResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + execute_site_detector_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/detectors/{detectorName}/execute'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_domain_registration_provider_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_domain_registration_provider_operations.py new file mode 100644 index 000000000000..0c1c7b5f0a80 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_domain_registration_provider_operations.py @@ -0,0 +1,113 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class DomainRegistrationProviderOperations(object): + """DomainRegistrationProviderOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2021_02_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_operations( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.CsmOperationCollection"] + """Implements Csm operations Api to exposes the list of available Csm Apis under the resource provider. + + Description for Implements Csm operations Api to exposes the list of available Csm Apis under + the resource provider. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CsmOperationCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.CsmOperationCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmOperationCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_operations.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('CsmOperationCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_operations.metadata = {'url': '/providers/Microsoft.DomainRegistration/operations'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_domains_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_domains_operations.py new file mode 100644 index 000000000000..43a2f65c3b39 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_domains_operations.py @@ -0,0 +1,1139 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class DomainsOperations(object): + """DomainsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2021_02_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def check_availability( + self, + identifier, # type: "_models.NameIdentifier" + **kwargs # type: Any + ): + # type: (...) -> "_models.DomainAvailabilityCheckResult" + """Check if a domain is available for registration. + + Description for Check if a domain is available for registration. + + :param identifier: Name of the domain. + :type identifier: ~azure.mgmt.web.v2021_02_01.models.NameIdentifier + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DomainAvailabilityCheckResult, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.DomainAvailabilityCheckResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DomainAvailabilityCheckResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.check_availability.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(identifier, 'NameIdentifier') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DomainAvailabilityCheckResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + check_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/checkDomainAvailability'} # type: ignore + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DomainCollection"] + """Get all domains in a subscription. + + Description for Get all domains in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DomainCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.DomainCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DomainCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DomainCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/domains'} # type: ignore + + def get_control_center_sso_request( + self, + **kwargs # type: Any + ): + # type: (...) -> "_models.DomainControlCenterSsoRequest" + """Generate a single sign-on request for the domain management portal. + + Description for Generate a single sign-on request for the domain management portal. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DomainControlCenterSsoRequest, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.DomainControlCenterSsoRequest + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DomainControlCenterSsoRequest"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_control_center_sso_request.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DomainControlCenterSsoRequest', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_control_center_sso_request.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/generateSsoRequest'} # type: ignore + + def list_recommendations( + self, + parameters, # type: "_models.DomainRecommendationSearchParameters" + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.NameIdentifierCollection"] + """Get domain name recommendations based on keywords. + + Description for Get domain name recommendations based on keywords. + + :param parameters: Search parameters for domain name recommendations. + :type parameters: ~azure.mgmt.web.v2021_02_01.models.DomainRecommendationSearchParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NameIdentifierCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.NameIdentifierCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NameIdentifierCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = "application/json" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_recommendations.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'DomainRecommendationSearchParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'DomainRecommendationSearchParameters') + body_content_kwargs['content'] = body_content + request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('NameIdentifierCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_recommendations.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/listDomainRecommendations'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DomainCollection"] + """Get all domains in a resource group. + + Description for Get all domains in a resource group. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DomainCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.DomainCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DomainCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DomainCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains'} # type: ignore + + def get( + self, + resource_group_name, # type: str + domain_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Domain" + """Get a domain. + + Description for Get a domain. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param domain_name: Name of the domain. + :type domain_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Domain, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.Domain + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Domain"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Domain', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + domain_name, # type: str + domain, # type: "_models.Domain" + **kwargs # type: Any + ): + # type: (...) -> "_models.Domain" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Domain"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str', pattern=r'[a-zA-Z0-9][a-zA-Z0-9\.-]+'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(domain, 'Domain') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Domain', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Domain', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + domain_name, # type: str + domain, # type: "_models.Domain" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.Domain"] + """Creates or updates a domain. + + Description for Creates or updates a domain. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param domain_name: Name of the domain. + :type domain_name: str + :param domain: Domain registration information. + :type domain: ~azure.mgmt.web.v2021_02_01.models.Domain + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either Domain or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2021_02_01.models.Domain] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Domain"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + domain_name=domain_name, + domain=domain, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Domain', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str', pattern=r'[a-zA-Z0-9][a-zA-Z0-9\.-]+'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + domain_name, # type: str + force_hard_delete_domain=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a domain. + + Description for Delete a domain. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param domain_name: Name of the domain. + :type domain_name: str + :param force_hard_delete_domain: Specify :code:`true` to delete the domain + immediately. The default is :code:`false` which deletes the domain after 24 hours. + :type force_hard_delete_domain: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if force_hard_delete_domain is not None: + query_parameters['forceHardDeleteDomain'] = self._serialize.query("force_hard_delete_domain", force_hard_delete_domain, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + domain_name, # type: str + domain, # type: "_models.DomainPatchResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.Domain" + """Creates or updates a domain. + + Description for Creates or updates a domain. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param domain_name: Name of the domain. + :type domain_name: str + :param domain: Domain registration information. + :type domain: ~azure.mgmt.web.v2021_02_01.models.DomainPatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Domain, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.Domain + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Domain"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str', pattern=r'[a-zA-Z0-9][a-zA-Z0-9\.-]+'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(domain, 'DomainPatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Domain', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Domain', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}'} # type: ignore + + def list_ownership_identifiers( + self, + resource_group_name, # type: str + domain_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DomainOwnershipIdentifierCollection"] + """Lists domain ownership identifiers. + + Description for Lists domain ownership identifiers. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param domain_name: Name of domain. + :type domain_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DomainOwnershipIdentifierCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.DomainOwnershipIdentifierCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DomainOwnershipIdentifierCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_ownership_identifiers.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DomainOwnershipIdentifierCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_ownership_identifiers.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers'} # type: ignore + + def get_ownership_identifier( + self, + resource_group_name, # type: str + domain_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.DomainOwnershipIdentifier" + """Get ownership identifier for domain. + + Description for Get ownership identifier for domain. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param domain_name: Name of domain. + :type domain_name: str + :param name: Name of identifier. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DomainOwnershipIdentifier, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.DomainOwnershipIdentifier + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DomainOwnershipIdentifier"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_ownership_identifier.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DomainOwnershipIdentifier', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers/{name}'} # type: ignore + + def create_or_update_ownership_identifier( + self, + resource_group_name, # type: str + domain_name, # type: str + name, # type: str + domain_ownership_identifier, # type: "_models.DomainOwnershipIdentifier" + **kwargs # type: Any + ): + # type: (...) -> "_models.DomainOwnershipIdentifier" + """Creates an ownership identifier for a domain or updates identifier details for an existing identifier. + + Description for Creates an ownership identifier for a domain or updates identifier details for + an existing identifier. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param domain_name: Name of domain. + :type domain_name: str + :param name: Name of identifier. + :type name: str + :param domain_ownership_identifier: A JSON representation of the domain ownership properties. + :type domain_ownership_identifier: ~azure.mgmt.web.v2021_02_01.models.DomainOwnershipIdentifier + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DomainOwnershipIdentifier, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.DomainOwnershipIdentifier + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DomainOwnershipIdentifier"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_ownership_identifier.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(domain_ownership_identifier, 'DomainOwnershipIdentifier') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DomainOwnershipIdentifier', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers/{name}'} # type: ignore + + def delete_ownership_identifier( + self, + resource_group_name, # type: str + domain_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete ownership identifier for domain. + + Description for Delete ownership identifier for domain. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param domain_name: Name of domain. + :type domain_name: str + :param name: Name of identifier. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_ownership_identifier.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers/{name}'} # type: ignore + + def update_ownership_identifier( + self, + resource_group_name, # type: str + domain_name, # type: str + name, # type: str + domain_ownership_identifier, # type: "_models.DomainOwnershipIdentifier" + **kwargs # type: Any + ): + # type: (...) -> "_models.DomainOwnershipIdentifier" + """Creates an ownership identifier for a domain or updates identifier details for an existing identifier. + + Description for Creates an ownership identifier for a domain or updates identifier details for + an existing identifier. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param domain_name: Name of domain. + :type domain_name: str + :param name: Name of identifier. + :type name: str + :param domain_ownership_identifier: A JSON representation of the domain ownership properties. + :type domain_ownership_identifier: ~azure.mgmt.web.v2021_02_01.models.DomainOwnershipIdentifier + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DomainOwnershipIdentifier, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.DomainOwnershipIdentifier + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DomainOwnershipIdentifier"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_ownership_identifier.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(domain_ownership_identifier, 'DomainOwnershipIdentifier') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DomainOwnershipIdentifier', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers/{name}'} # type: ignore + + def renew( + self, + resource_group_name, # type: str + domain_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Renew a domain. + + Description for Renew a domain. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param domain_name: Name of the domain. + :type domain_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.renew.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + renew.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/renew'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_global_model_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_global_model_operations.py new file mode 100644 index 000000000000..d24140642dda --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_global_model_operations.py @@ -0,0 +1,220 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class GlobalOperations(object): + """GlobalOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2021_02_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get_deleted_web_app( + self, + deleted_site_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.DeletedSite" + """Get deleted app for a subscription. + + Description for Get deleted app for a subscription. + + :param deleted_site_id: The numeric ID of the deleted app, e.g. 12345. + :type deleted_site_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DeletedSite, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.DeletedSite + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DeletedSite"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_deleted_web_app.metadata['url'] # type: ignore + path_format_arguments = { + 'deletedSiteId': self._serialize.url("deleted_site_id", deleted_site_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DeletedSite', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_deleted_web_app.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/deletedSites/{deletedSiteId}'} # type: ignore + + def get_deleted_web_app_snapshots( + self, + deleted_site_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> List["_models.Snapshot"] + """Get all deleted apps for a subscription. + + Description for Get all deleted apps for a subscription. + + :param deleted_site_id: The numeric ID of the deleted app, e.g. 12345. + :type deleted_site_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of Snapshot, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2021_02_01.models.Snapshot] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.Snapshot"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_deleted_web_app_snapshots.metadata['url'] # type: ignore + path_format_arguments = { + 'deletedSiteId': self._serialize.url("deleted_site_id", deleted_site_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[Snapshot]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_deleted_web_app_snapshots.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/deletedSites/{deletedSiteId}/snapshots'} # type: ignore + + def get_subscription_operation_with_async_response( + self, + location, # type: str + operation_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Gets an operation in a subscription and given region. + + Description for Gets an operation in a subscription and given region. + + :param location: Location name. + :type location: str + :param operation_id: Operation Id. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_subscription_operation_with_async_response.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + get_subscription_operation_with_async_response.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/locations/{location}/operations/{operationId}'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_kube_environments_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_kube_environments_operations.py new file mode 100644 index 000000000000..dd3039383cf8 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_kube_environments_operations.py @@ -0,0 +1,574 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class KubeEnvironmentsOperations(object): + """KubeEnvironmentsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2021_02_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_subscription( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.KubeEnvironmentCollection"] + """Get all Kubernetes Environments for a subscription. + + Description for Get all Kubernetes Environments for a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either KubeEnvironmentCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.KubeEnvironmentCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.KubeEnvironmentCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('KubeEnvironmentCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/kubeEnvironments'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.KubeEnvironmentCollection"] + """Get all the Kubernetes Environments in a resource group. + + Description for Get all the Kubernetes Environments in a resource group. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either KubeEnvironmentCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.KubeEnvironmentCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.KubeEnvironmentCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('KubeEnvironmentCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/kubeEnvironments'} # type: ignore + + def get( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.KubeEnvironment" + """Get the properties of a Kubernetes Environment. + + Description for Get the properties of a Kubernetes Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the Kubernetes Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: KubeEnvironment, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.KubeEnvironment + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.KubeEnvironment"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('KubeEnvironment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/kubeEnvironments/{name}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + name, # type: str + kube_environment_envelope, # type: "_models.KubeEnvironment" + **kwargs # type: Any + ): + # type: (...) -> "_models.KubeEnvironment" + cls = kwargs.pop('cls', None) # type: ClsType["_models.KubeEnvironment"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(kube_environment_envelope, 'KubeEnvironment') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('KubeEnvironment', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('KubeEnvironment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/kubeEnvironments/{name}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + name, # type: str + kube_environment_envelope, # type: "_models.KubeEnvironment" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.KubeEnvironment"] + """Creates or updates a Kubernetes Environment. + + Description for Creates or updates a Kubernetes Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the Kubernetes Environment. + :type name: str + :param kube_environment_envelope: Configuration details of the Kubernetes Environment. + :type kube_environment_envelope: ~azure.mgmt.web.v2021_02_01.models.KubeEnvironment + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either KubeEnvironment or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2021_02_01.models.KubeEnvironment] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.KubeEnvironment"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + name=name, + kube_environment_envelope=kube_environment_envelope, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('KubeEnvironment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/kubeEnvironments/{name}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/kubeEnvironments/{name}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Delete a Kubernetes Environment. + + Description for Delete a Kubernetes Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the Kubernetes Environment. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + name=name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/kubeEnvironments/{name}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + name, # type: str + kube_environment_envelope, # type: "_models.KubeEnvironmentPatchResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.KubeEnvironment" + """Creates or updates a Kubernetes Environment. + + Description for Creates or updates a Kubernetes Environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the Kubernetes Environment. + :type name: str + :param kube_environment_envelope: Configuration details of the Kubernetes Environment. + :type kube_environment_envelope: ~azure.mgmt.web.v2021_02_01.models.KubeEnvironmentPatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: KubeEnvironment, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.KubeEnvironment + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.KubeEnvironment"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(kube_environment_envelope, 'KubeEnvironmentPatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('KubeEnvironment', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('KubeEnvironment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/kubeEnvironments/{name}'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_provider_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_provider_operations.py new file mode 100644 index 000000000000..480f3463e4c1 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_provider_operations.py @@ -0,0 +1,557 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ProviderOperations(object): + """ProviderOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2021_02_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get_available_stacks( + self, + os_type_selected=None, # type: Optional[Union[str, "_models.Enum10"]] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ApplicationStackCollection"] + """Get available application frameworks and their versions. + + Description for Get available application frameworks and their versions. + + :param os_type_selected: + :type os_type_selected: str or ~azure.mgmt.web.v2021_02_01.models.Enum10 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ApplicationStackCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.ApplicationStackCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationStackCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_available_stacks.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if os_type_selected is not None: + query_parameters['osTypeSelected'] = self._serialize.query("os_type_selected", os_type_selected, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ApplicationStackCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + get_available_stacks.metadata = {'url': '/providers/Microsoft.Web/availableStacks'} # type: ignore + + def get_function_app_stacks( + self, + stack_os_type=None, # type: Optional[Union[str, "_models.Enum11"]] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.FunctionAppStackCollection"] + """Get available Function app frameworks and their versions. + + Description for Get available Function app frameworks and their versions. + + :param stack_os_type: Stack OS Type. + :type stack_os_type: str or ~azure.mgmt.web.v2021_02_01.models.Enum11 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either FunctionAppStackCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.FunctionAppStackCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionAppStackCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_function_app_stacks.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if stack_os_type is not None: + query_parameters['stackOsType'] = self._serialize.query("stack_os_type", stack_os_type, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('FunctionAppStackCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + get_function_app_stacks.metadata = {'url': '/providers/Microsoft.Web/functionAppStacks'} # type: ignore + + def get_function_app_stacks_for_location( + self, + location, # type: str + stack_os_type=None, # type: Optional[Union[str, "_models.Enum12"]] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.FunctionAppStackCollection"] + """Get available Function app frameworks and their versions for location. + + Description for Get available Function app frameworks and their versions for location. + + :param location: Function App stack location. + :type location: str + :param stack_os_type: Stack OS Type. + :type stack_os_type: str or ~azure.mgmt.web.v2021_02_01.models.Enum12 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either FunctionAppStackCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.FunctionAppStackCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionAppStackCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_function_app_stacks_for_location.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if stack_os_type is not None: + query_parameters['stackOsType'] = self._serialize.query("stack_os_type", stack_os_type, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('FunctionAppStackCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + get_function_app_stacks_for_location.metadata = {'url': '/providers/Microsoft.Web/locations/{location}/functionAppStacks'} # type: ignore + + def get_web_app_stacks_for_location( + self, + location, # type: str + stack_os_type=None, # type: Optional[Union[str, "_models.Enum13"]] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.WebAppStackCollection"] + """Get available Web app frameworks and their versions for location. + + Description for Get available Web app frameworks and their versions for location. + + :param location: Web App stack location. + :type location: str + :param stack_os_type: Stack OS Type. + :type stack_os_type: str or ~azure.mgmt.web.v2021_02_01.models.Enum13 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebAppStackCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.WebAppStackCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppStackCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_web_app_stacks_for_location.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if stack_os_type is not None: + query_parameters['stackOsType'] = self._serialize.query("stack_os_type", stack_os_type, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppStackCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + get_web_app_stacks_for_location.metadata = {'url': '/providers/Microsoft.Web/locations/{location}/webAppStacks'} # type: ignore + + def list_operations( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.CsmOperationCollection"] + """Gets all available operations for the Microsoft.Web resource provider. Also exposes resource metric definitions. + + Description for Gets all available operations for the Microsoft.Web resource provider. Also + exposes resource metric definitions. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CsmOperationCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.CsmOperationCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmOperationCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_operations.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('CsmOperationCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_operations.metadata = {'url': '/providers/Microsoft.Web/operations'} # type: ignore + + def get_web_app_stacks( + self, + stack_os_type=None, # type: Optional[Union[str, "_models.Enum14"]] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.WebAppStackCollection"] + """Get available Web app frameworks and their versions. + + Description for Get available Web app frameworks and their versions. + + :param stack_os_type: Stack OS Type. + :type stack_os_type: str or ~azure.mgmt.web.v2021_02_01.models.Enum14 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebAppStackCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.WebAppStackCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppStackCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_web_app_stacks.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if stack_os_type is not None: + query_parameters['stackOsType'] = self._serialize.query("stack_os_type", stack_os_type, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppStackCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + get_web_app_stacks.metadata = {'url': '/providers/Microsoft.Web/webAppStacks'} # type: ignore + + def get_available_stacks_on_prem( + self, + os_type_selected=None, # type: Optional[Union[str, "_models.Enum15"]] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ApplicationStackCollection"] + """Get available application frameworks and their versions. + + Description for Get available application frameworks and their versions. + + :param os_type_selected: + :type os_type_selected: str or ~azure.mgmt.web.v2021_02_01.models.Enum15 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ApplicationStackCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.ApplicationStackCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationStackCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_available_stacks_on_prem.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if os_type_selected is not None: + query_parameters['osTypeSelected'] = self._serialize.query("os_type_selected", os_type_selected, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ApplicationStackCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + get_available_stacks_on_prem.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/availableStacks'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_recommendations_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_recommendations_operations.py new file mode 100644 index 000000000000..2cee3c523f80 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_recommendations_operations.py @@ -0,0 +1,1128 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class RecommendationsOperations(object): + """RecommendationsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2021_02_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + featured=None, # type: Optional[bool] + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.RecommendationCollection"] + """List all recommendations for a subscription. + + Description for List all recommendations for a subscription. + + :param featured: Specify :code:`true` to return only the most critical + recommendations. The default is :code:`false`, which returns all recommendations. + :type featured: bool + :param filter: Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or + channel eq 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq + 2014-12-31T23:59:59Z and timeGrain eq duration'[PT1H|PT1M|P1D]. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RecommendationCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.RecommendationCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecommendationCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if featured is not None: + query_parameters['featured'] = self._serialize.query("featured", featured, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('RecommendationCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/recommendations'} # type: ignore + + def reset_all_filters( + self, + **kwargs # type: Any + ): + # type: (...) -> None + """Reset all recommendation opt-out settings for a subscription. + + Description for Reset all recommendation opt-out settings for a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.reset_all_filters.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + reset_all_filters.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/recommendations/reset'} # type: ignore + + def disable_recommendation_for_subscription( + self, + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Disables the specified rule so it will not apply to a subscription in the future. + + Description for Disables the specified rule so it will not apply to a subscription in the + future. + + :param name: Rule name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.disable_recommendation_for_subscription.metadata['url'] # type: ignore + path_format_arguments = { + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + disable_recommendation_for_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/recommendations/{name}/disable'} # type: ignore + + def list_history_for_hosting_environment( + self, + resource_group_name, # type: str + hosting_environment_name, # type: str + expired_only=None, # type: Optional[bool] + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.RecommendationCollection"] + """Get past recommendations for an app, optionally specified by the time range. + + Description for Get past recommendations for an app, optionally specified by the time range. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param hosting_environment_name: Name of the hosting environment. + :type hosting_environment_name: str + :param expired_only: Specify :code:`false` to return all recommendations. The + default is :code:`true`, which returns only expired recommendations. + :type expired_only: bool + :param filter: Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or + channel eq 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq + 2014-12-31T23:59:59Z and timeGrain eq duration'[PT1H|PT1M|P1D]. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RecommendationCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.RecommendationCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecommendationCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_history_for_hosting_environment.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'hostingEnvironmentName': self._serialize.url("hosting_environment_name", hosting_environment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if expired_only is not None: + query_parameters['expiredOnly'] = self._serialize.query("expired_only", expired_only, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('RecommendationCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_history_for_hosting_environment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendationHistory'} # type: ignore + + def list_recommended_rules_for_hosting_environment( + self, + resource_group_name, # type: str + hosting_environment_name, # type: str + featured=None, # type: Optional[bool] + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.RecommendationCollection"] + """Get all recommendations for a hosting environment. + + Description for Get all recommendations for a hosting environment. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param hosting_environment_name: Name of the app. + :type hosting_environment_name: str + :param featured: Specify :code:`true` to return only the most critical + recommendations. The default is :code:`false`, which returns all recommendations. + :type featured: bool + :param filter: Return only channels specified in the filter. Filter is specified by using OData + syntax. Example: $filter=channel eq 'Api' or channel eq 'Notification'. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RecommendationCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.RecommendationCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecommendationCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_recommended_rules_for_hosting_environment.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'hostingEnvironmentName': self._serialize.url("hosting_environment_name", hosting_environment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if featured is not None: + query_parameters['featured'] = self._serialize.query("featured", featured, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('RecommendationCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_recommended_rules_for_hosting_environment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendations'} # type: ignore + + def disable_all_for_hosting_environment( + self, + resource_group_name, # type: str + environment_name, # type: str + hosting_environment_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Disable all recommendations for an app. + + Description for Disable all recommendations for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param environment_name: Name of the app. + :type environment_name: str + :param hosting_environment_name: + :type hosting_environment_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.disable_all_for_hosting_environment.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'hostingEnvironmentName': self._serialize.url("hosting_environment_name", hosting_environment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['environmentName'] = self._serialize.query("environment_name", environment_name, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + disable_all_for_hosting_environment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendations/disable'} # type: ignore + + def reset_all_filters_for_hosting_environment( + self, + resource_group_name, # type: str + environment_name, # type: str + hosting_environment_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Reset all recommendation opt-out settings for an app. + + Description for Reset all recommendation opt-out settings for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param environment_name: Name of the app. + :type environment_name: str + :param hosting_environment_name: + :type hosting_environment_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.reset_all_filters_for_hosting_environment.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'hostingEnvironmentName': self._serialize.url("hosting_environment_name", hosting_environment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['environmentName'] = self._serialize.query("environment_name", environment_name, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + reset_all_filters_for_hosting_environment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendations/reset'} # type: ignore + + def get_rule_details_by_hosting_environment( + self, + resource_group_name, # type: str + hosting_environment_name, # type: str + name, # type: str + update_seen=None, # type: Optional[bool] + recommendation_id=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.RecommendationRule" + """Get a recommendation rule for an app. + + Description for Get a recommendation rule for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param hosting_environment_name: Name of the hosting environment. + :type hosting_environment_name: str + :param name: Name of the recommendation. + :type name: str + :param update_seen: Specify :code:`true` to update the last-seen timestamp of the + recommendation object. + :type update_seen: bool + :param recommendation_id: The GUID of the recommendation object if you query an expired one. + You don't need to specify it to query an active entry. + :type recommendation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RecommendationRule, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.RecommendationRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecommendationRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_rule_details_by_hosting_environment.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'hostingEnvironmentName': self._serialize.url("hosting_environment_name", hosting_environment_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if update_seen is not None: + query_parameters['updateSeen'] = self._serialize.query("update_seen", update_seen, 'bool') + if recommendation_id is not None: + query_parameters['recommendationId'] = self._serialize.query("recommendation_id", recommendation_id, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RecommendationRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_rule_details_by_hosting_environment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendations/{name}'} # type: ignore + + def disable_recommendation_for_hosting_environment( + self, + resource_group_name, # type: str + environment_name, # type: str + name, # type: str + hosting_environment_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Disables the specific rule for a web site permanently. + + Description for Disables the specific rule for a web site permanently. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param environment_name: Site name. + :type environment_name: str + :param name: Rule name. + :type name: str + :param hosting_environment_name: + :type hosting_environment_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.disable_recommendation_for_hosting_environment.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'hostingEnvironmentName': self._serialize.url("hosting_environment_name", hosting_environment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['environmentName'] = self._serialize.query("environment_name", environment_name, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + disable_recommendation_for_hosting_environment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendations/{name}/disable'} # type: ignore + + def list_history_for_web_app( + self, + resource_group_name, # type: str + site_name, # type: str + expired_only=None, # type: Optional[bool] + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.RecommendationCollection"] + """Get past recommendations for an app, optionally specified by the time range. + + Description for Get past recommendations for an app, optionally specified by the time range. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Name of the app. + :type site_name: str + :param expired_only: Specify :code:`false` to return all recommendations. The + default is :code:`true`, which returns only expired recommendations. + :type expired_only: bool + :param filter: Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or + channel eq 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq + 2014-12-31T23:59:59Z and timeGrain eq duration'[PT1H|PT1M|P1D]. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RecommendationCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.RecommendationCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecommendationCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_history_for_web_app.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if expired_only is not None: + query_parameters['expiredOnly'] = self._serialize.query("expired_only", expired_only, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('RecommendationCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_history_for_web_app.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendationHistory'} # type: ignore + + def list_recommended_rules_for_web_app( + self, + resource_group_name, # type: str + site_name, # type: str + featured=None, # type: Optional[bool] + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.RecommendationCollection"] + """Get all recommendations for an app. + + Description for Get all recommendations for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Name of the app. + :type site_name: str + :param featured: Specify :code:`true` to return only the most critical + recommendations. The default is :code:`false`, which returns all recommendations. + :type featured: bool + :param filter: Return only channels specified in the filter. Filter is specified by using OData + syntax. Example: $filter=channel eq 'Api' or channel eq 'Notification'. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RecommendationCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.RecommendationCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecommendationCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_recommended_rules_for_web_app.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if featured is not None: + query_parameters['featured'] = self._serialize.query("featured", featured, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('RecommendationCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_recommended_rules_for_web_app.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations'} # type: ignore + + def disable_all_for_web_app( + self, + resource_group_name, # type: str + site_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Disable all recommendations for an app. + + Description for Disable all recommendations for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Name of the app. + :type site_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.disable_all_for_web_app.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + disable_all_for_web_app.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations/disable'} # type: ignore + + def reset_all_filters_for_web_app( + self, + resource_group_name, # type: str + site_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Reset all recommendation opt-out settings for an app. + + Description for Reset all recommendation opt-out settings for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Name of the app. + :type site_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.reset_all_filters_for_web_app.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + reset_all_filters_for_web_app.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations/reset'} # type: ignore + + def get_rule_details_by_web_app( + self, + resource_group_name, # type: str + site_name, # type: str + name, # type: str + update_seen=None, # type: Optional[bool] + recommendation_id=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.RecommendationRule" + """Get a recommendation rule for an app. + + Description for Get a recommendation rule for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Name of the app. + :type site_name: str + :param name: Name of the recommendation. + :type name: str + :param update_seen: Specify :code:`true` to update the last-seen timestamp of the + recommendation object. + :type update_seen: bool + :param recommendation_id: The GUID of the recommendation object if you query an expired one. + You don't need to specify it to query an active entry. + :type recommendation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RecommendationRule, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.RecommendationRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecommendationRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_rule_details_by_web_app.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if update_seen is not None: + query_parameters['updateSeen'] = self._serialize.query("update_seen", update_seen, 'bool') + if recommendation_id is not None: + query_parameters['recommendationId'] = self._serialize.query("recommendation_id", recommendation_id, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RecommendationRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_rule_details_by_web_app.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations/{name}'} # type: ignore + + def disable_recommendation_for_site( + self, + resource_group_name, # type: str + site_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Disables the specific rule for a web site permanently. + + Description for Disables the specific rule for a web site permanently. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param site_name: Site name. + :type site_name: str + :param name: Rule name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.disable_recommendation_for_site.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'siteName': self._serialize.url("site_name", site_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + disable_recommendation_for_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations/{name}/disable'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_resource_health_metadata_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_resource_health_metadata_operations.py new file mode 100644 index 000000000000..07d7ec6a25be --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_resource_health_metadata_operations.py @@ -0,0 +1,481 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ResourceHealthMetadataOperations(object): + """ResourceHealthMetadataOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2021_02_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ResourceHealthMetadataCollection"] + """List all ResourceHealthMetadata for all sites in the subscription. + + Description for List all ResourceHealthMetadata for all sites in the subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceHealthMetadataCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.ResourceHealthMetadataCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceHealthMetadataCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceHealthMetadataCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/resourceHealthMetadata'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ResourceHealthMetadataCollection"] + """List all ResourceHealthMetadata for all sites in the resource group in the subscription. + + Description for List all ResourceHealthMetadata for all sites in the resource group in the + subscription. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceHealthMetadataCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.ResourceHealthMetadataCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceHealthMetadataCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceHealthMetadataCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/resourceHealthMetadata'} # type: ignore + + def list_by_site( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ResourceHealthMetadataCollection"] + """Gets the category of ResourceHealthMetadata to use for the given site as a collection. + + Description for Gets the category of ResourceHealthMetadata to use for the given site as a + collection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceHealthMetadataCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.ResourceHealthMetadataCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceHealthMetadataCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_site.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceHealthMetadataCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/resourceHealthMetadata'} # type: ignore + + def get_by_site( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ResourceHealthMetadata" + """Gets the category of ResourceHealthMetadata to use for the given site. + + Description for Gets the category of ResourceHealthMetadata to use for the given site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ResourceHealthMetadata, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.ResourceHealthMetadata + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceHealthMetadata"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_by_site.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ResourceHealthMetadata', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_by_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/resourceHealthMetadata/default'} # type: ignore + + def list_by_site_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ResourceHealthMetadataCollection"] + """Gets the category of ResourceHealthMetadata to use for the given site as a collection. + + Description for Gets the category of ResourceHealthMetadata to use for the given site as a + collection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceHealthMetadataCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.ResourceHealthMetadataCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceHealthMetadataCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_site_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceHealthMetadataCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_site_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/resourceHealthMetadata'} # type: ignore + + def get_by_site_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ResourceHealthMetadata" + """Gets the category of ResourceHealthMetadata to use for the given site. + + Description for Gets the category of ResourceHealthMetadata to use for the given site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ResourceHealthMetadata, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.ResourceHealthMetadata + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceHealthMetadata"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_by_site_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ResourceHealthMetadata', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_by_site_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/resourceHealthMetadata/default'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_static_sites_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_static_sites_operations.py new file mode 100644 index 000000000000..79a3bf0c3b5e --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_static_sites_operations.py @@ -0,0 +1,4221 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class StaticSitesOperations(object): + """StaticSitesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2021_02_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def preview_workflow( + self, + location, # type: str + static_sites_workflow_preview_request, # type: "_models.StaticSitesWorkflowPreviewRequest" + **kwargs # type: Any + ): + # type: (...) -> "_models.StaticSitesWorkflowPreview" + """Generates a preview workflow file for the static site. + + Description for Generates a preview workflow file for the static site. + + :param location: Location where you plan to create the static site. + :type location: str + :param static_sites_workflow_preview_request: A JSON representation of the + StaticSitesWorkflowPreviewRequest properties. See example. + :type static_sites_workflow_preview_request: ~azure.mgmt.web.v2021_02_01.models.StaticSitesWorkflowPreviewRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StaticSitesWorkflowPreview, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.StaticSitesWorkflowPreview + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSitesWorkflowPreview"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.preview_workflow.metadata['url'] # type: ignore + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(static_sites_workflow_preview_request, 'StaticSitesWorkflowPreviewRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StaticSitesWorkflowPreview', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + preview_workflow.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/locations/{location}/previewStaticSiteWorkflowFile'} # type: ignore + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.StaticSiteCollection"] + """Get all Static Sites for a subscription. + + Description for Get all Static Sites for a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StaticSiteCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.StaticSiteCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('StaticSiteCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/staticSites'} # type: ignore + + def get_static_sites_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.StaticSiteCollection"] + """Gets all static sites in the specified resource group. + + Description for Gets all static sites in the specified resource group. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StaticSiteCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.StaticSiteCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_static_sites_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('StaticSiteCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + get_static_sites_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites'} # type: ignore + + def get_static_site( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.StaticSiteARMResource" + """Gets the details of a static site. + + Description for Gets the details of a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StaticSiteARMResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.StaticSiteARMResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_static_site.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StaticSiteARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_static_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}'} # type: ignore + + def _create_or_update_static_site_initial( + self, + resource_group_name, # type: str + name, # type: str + static_site_envelope, # type: "_models.StaticSiteARMResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.StaticSiteARMResource" + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_static_site_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(static_site_envelope, 'StaticSiteARMResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('StaticSiteARMResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('StaticSiteARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_static_site_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}'} # type: ignore + + def begin_create_or_update_static_site( + self, + resource_group_name, # type: str + name, # type: str + static_site_envelope, # type: "_models.StaticSiteARMResource" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.StaticSiteARMResource"] + """Creates a new static site in an existing resource group, or updates an existing static site. + + Description for Creates a new static site in an existing resource group, or updates an existing + static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site to create or update. + :type name: str + :param static_site_envelope: A JSON representation of the staticsite properties. See example. + :type static_site_envelope: ~azure.mgmt.web.v2021_02_01.models.StaticSiteARMResource + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either StaticSiteARMResource or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2021_02_01.models.StaticSiteARMResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteARMResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_static_site_initial( + resource_group_name=resource_group_name, + name=name, + static_site_envelope=static_site_envelope, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('StaticSiteARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update_static_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}'} # type: ignore + + def _delete_static_site_initial( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._delete_static_site_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_static_site_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}'} # type: ignore + + def begin_delete_static_site( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes a static site. + + Description for Deletes a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site to delete. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_static_site_initial( + resource_group_name=resource_group_name, + name=name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete_static_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}'} # type: ignore + + def update_static_site( + self, + resource_group_name, # type: str + name, # type: str + static_site_envelope, # type: "_models.StaticSitePatchResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.StaticSiteARMResource" + """Creates a new static site in an existing resource group, or updates an existing static site. + + Description for Creates a new static site in an existing resource group, or updates an existing + static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site to create or update. + :type name: str + :param static_site_envelope: A JSON representation of the staticsite properties. See example. + :type static_site_envelope: ~azure.mgmt.web.v2021_02_01.models.StaticSitePatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StaticSiteARMResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.StaticSiteARMResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_static_site.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(static_site_envelope, 'StaticSitePatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('StaticSiteARMResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('StaticSiteARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_static_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}'} # type: ignore + + def list_static_site_users( + self, + resource_group_name, # type: str + name, # type: str + authprovider, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.StaticSiteUserCollection"] + """Gets the list of users of a static site. + + Description for Gets the list of users of a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param authprovider: The auth provider for the users. + :type authprovider: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StaticSiteUserCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.StaticSiteUserCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteUserCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_static_site_users.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'authprovider': self._serialize.url("authprovider", authprovider, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('StaticSiteUserCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_static_site_users.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/authproviders/{authprovider}/listUsers'} # type: ignore + + def delete_static_site_user( + self, + resource_group_name, # type: str + name, # type: str + authprovider, # type: str + userid, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes the user entry from the static site. + + Description for Deletes the user entry from the static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the staticsite. + :type name: str + :param authprovider: The auth provider for this user. + :type authprovider: str + :param userid: The user id of the user. + :type userid: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_static_site_user.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'authprovider': self._serialize.url("authprovider", authprovider, 'str'), + 'userid': self._serialize.url("userid", userid, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_static_site_user.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/authproviders/{authprovider}/users/{userid}'} # type: ignore + + def update_static_site_user( + self, + resource_group_name, # type: str + name, # type: str + authprovider, # type: str + userid, # type: str + static_site_user_envelope, # type: "_models.StaticSiteUserARMResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.StaticSiteUserARMResource" + """Updates a user entry with the listed roles. + + Description for Updates a user entry with the listed roles. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param authprovider: The auth provider for this user. + :type authprovider: str + :param userid: The user id of the user. + :type userid: str + :param static_site_user_envelope: A JSON representation of the StaticSiteUser properties. See + example. + :type static_site_user_envelope: ~azure.mgmt.web.v2021_02_01.models.StaticSiteUserARMResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StaticSiteUserARMResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.StaticSiteUserARMResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteUserARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_static_site_user.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'authprovider': self._serialize.url("authprovider", authprovider, 'str'), + 'userid': self._serialize.url("userid", userid, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(static_site_user_envelope, 'StaticSiteUserARMResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StaticSiteUserARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_static_site_user.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/authproviders/{authprovider}/users/{userid}'} # type: ignore + + def get_static_site_builds( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.StaticSiteBuildCollection"] + """Gets all static site builds for a particular static site. + + Description for Gets all static site builds for a particular static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StaticSiteBuildCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.StaticSiteBuildCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteBuildCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_static_site_builds.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('StaticSiteBuildCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + get_static_site_builds.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds'} # type: ignore + + def get_static_site_build( + self, + resource_group_name, # type: str + name, # type: str + environment_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.StaticSiteBuildARMResource" + """Gets the details of a static site build. + + Description for Gets the details of a static site build. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param environment_name: The stage site identifier. + :type environment_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StaticSiteBuildARMResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.StaticSiteBuildARMResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteBuildARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_static_site_build.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StaticSiteBuildARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_static_site_build.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}'} # type: ignore + + def _delete_static_site_build_initial( + self, + resource_group_name, # type: str + name, # type: str + environment_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._delete_static_site_build_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_static_site_build_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}'} # type: ignore + + def begin_delete_static_site_build( + self, + resource_group_name, # type: str + name, # type: str + environment_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes a static site build. + + Description for Deletes a static site build. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param environment_name: The stage site identifier. + :type environment_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_static_site_build_initial( + resource_group_name=resource_group_name, + name=name, + environment_name=environment_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete_static_site_build.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}'} # type: ignore + + def create_or_update_static_site_build_app_settings( + self, + resource_group_name, # type: str + name, # type: str + environment_name, # type: str + app_settings, # type: "_models.StringDictionary" + **kwargs # type: Any + ): + # type: (...) -> "_models.StringDictionary" + """Creates or updates the app settings of a static site build. + + Description for Creates or updates the app settings of a static site build. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param environment_name: The stage site identifier. + :type environment_name: str + :param app_settings: The dictionary containing the static site app settings to update. + :type app_settings: ~azure.mgmt.web.v2021_02_01.models.StringDictionary + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_static_site_build_app_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(app_settings, 'StringDictionary') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_static_site_build_app_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/config/appsettings'} # type: ignore + + def create_or_update_static_site_build_function_app_settings( + self, + resource_group_name, # type: str + name, # type: str + environment_name, # type: str + app_settings, # type: "_models.StringDictionary" + **kwargs # type: Any + ): + # type: (...) -> "_models.StringDictionary" + """Creates or updates the function app settings of a static site build. + + Description for Creates or updates the function app settings of a static site build. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param environment_name: The stage site identifier. + :type environment_name: str + :param app_settings: The dictionary containing the static site function app settings to update. + :type app_settings: ~azure.mgmt.web.v2021_02_01.models.StringDictionary + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_static_site_build_function_app_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(app_settings, 'StringDictionary') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_static_site_build_function_app_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/config/functionappsettings'} # type: ignore + + def list_static_site_build_functions( + self, + resource_group_name, # type: str + name, # type: str + environment_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.StaticSiteFunctionOverviewCollection"] + """Gets the functions of a particular static site build. + + Description for Gets the functions of a particular static site build. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param environment_name: The stage site identifier. + :type environment_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StaticSiteFunctionOverviewCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.StaticSiteFunctionOverviewCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteFunctionOverviewCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_static_site_build_functions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('StaticSiteFunctionOverviewCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_static_site_build_functions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/functions'} # type: ignore + + def list_static_site_build_app_settings( + self, + resource_group_name, # type: str + name, # type: str + environment_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.StringDictionary" + """Gets the application settings of a static site build. + + Description for Gets the application settings of a static site build. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param environment_name: The stage site identifier. + :type environment_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_static_site_build_app_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_static_site_build_app_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/listAppSettings'} # type: ignore + + def list_static_site_build_function_app_settings( + self, + resource_group_name, # type: str + name, # type: str + environment_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.StringDictionary" + """Gets the application settings of a static site build. + + Description for Gets the application settings of a static site build. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param environment_name: The stage site identifier. + :type environment_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_static_site_build_function_app_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_static_site_build_function_app_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/listFunctionAppSettings'} # type: ignore + + def get_user_provided_function_apps_for_static_site_build( + self, + resource_group_name, # type: str + name, # type: str + environment_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.StaticSiteUserProvidedFunctionAppsCollection"] + """Gets the details of the user provided function apps registered with a static site build. + + Description for Gets the details of the user provided function apps registered with a static + site build. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param environment_name: The stage site identifier. + :type environment_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StaticSiteUserProvidedFunctionAppsCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.StaticSiteUserProvidedFunctionAppsCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteUserProvidedFunctionAppsCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_user_provided_function_apps_for_static_site_build.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('StaticSiteUserProvidedFunctionAppsCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + get_user_provided_function_apps_for_static_site_build.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/userProvidedFunctionApps'} # type: ignore + + def get_user_provided_function_app_for_static_site_build( + self, + resource_group_name, # type: str + name, # type: str + environment_name, # type: str + function_app_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.StaticSiteUserProvidedFunctionAppARMResource" + """Gets the details of the user provided function app registered with a static site build. + + Description for Gets the details of the user provided function app registered with a static + site build. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param environment_name: The stage site identifier. + :type environment_name: str + :param function_app_name: Name of the function app registered with the static site build. + :type function_app_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StaticSiteUserProvidedFunctionAppARMResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.StaticSiteUserProvidedFunctionAppARMResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteUserProvidedFunctionAppARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_user_provided_function_app_for_static_site_build.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), + 'functionAppName': self._serialize.url("function_app_name", function_app_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StaticSiteUserProvidedFunctionAppARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_user_provided_function_app_for_static_site_build.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/userProvidedFunctionApps/{functionAppName}'} # type: ignore + + def _register_user_provided_function_app_with_static_site_build_initial( + self, + resource_group_name, # type: str + name, # type: str + environment_name, # type: str + function_app_name, # type: str + static_site_user_provided_function_envelope, # type: "_models.StaticSiteUserProvidedFunctionAppARMResource" + is_forced=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> "_models.StaticSiteUserProvidedFunctionAppARMResource" + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteUserProvidedFunctionAppARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._register_user_provided_function_app_with_static_site_build_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), + 'functionAppName': self._serialize.url("function_app_name", function_app_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if is_forced is not None: + query_parameters['isForced'] = self._serialize.query("is_forced", is_forced, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(static_site_user_provided_function_envelope, 'StaticSiteUserProvidedFunctionAppARMResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('StaticSiteUserProvidedFunctionAppARMResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('StaticSiteUserProvidedFunctionAppARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _register_user_provided_function_app_with_static_site_build_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/userProvidedFunctionApps/{functionAppName}'} # type: ignore + + def begin_register_user_provided_function_app_with_static_site_build( + self, + resource_group_name, # type: str + name, # type: str + environment_name, # type: str + function_app_name, # type: str + static_site_user_provided_function_envelope, # type: "_models.StaticSiteUserProvidedFunctionAppARMResource" + is_forced=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.StaticSiteUserProvidedFunctionAppARMResource"] + """Register a user provided function app with a static site build. + + Description for Register a user provided function app with a static site build. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param environment_name: The stage site identifier. + :type environment_name: str + :param function_app_name: Name of the function app to register with the static site build. + :type function_app_name: str + :param static_site_user_provided_function_envelope: A JSON representation of the user provided + function app properties. See example. + :type static_site_user_provided_function_envelope: ~azure.mgmt.web.v2021_02_01.models.StaticSiteUserProvidedFunctionAppARMResource + :param is_forced: Specify :code:`true` to force the update of the auth + configuration on the function app even if an AzureStaticWebApps provider is already configured + on the function app. The default is :code:`false`. + :type is_forced: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either StaticSiteUserProvidedFunctionAppARMResource or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2021_02_01.models.StaticSiteUserProvidedFunctionAppARMResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteUserProvidedFunctionAppARMResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._register_user_provided_function_app_with_static_site_build_initial( + resource_group_name=resource_group_name, + name=name, + environment_name=environment_name, + function_app_name=function_app_name, + static_site_user_provided_function_envelope=static_site_user_provided_function_envelope, + is_forced=is_forced, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('StaticSiteUserProvidedFunctionAppARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), + 'functionAppName': self._serialize.url("function_app_name", function_app_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_register_user_provided_function_app_with_static_site_build.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/userProvidedFunctionApps/{functionAppName}'} # type: ignore + + def detach_user_provided_function_app_from_static_site_build( + self, + resource_group_name, # type: str + name, # type: str + environment_name, # type: str + function_app_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Detach the user provided function app from the static site build. + + Description for Detach the user provided function app from the static site build. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param environment_name: The stage site identifier. + :type environment_name: str + :param function_app_name: Name of the function app registered with the static site build. + :type function_app_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.detach_user_provided_function_app_from_static_site_build.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), + 'functionAppName': self._serialize.url("function_app_name", function_app_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + detach_user_provided_function_app_from_static_site_build.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/userProvidedFunctionApps/{functionAppName}'} # type: ignore + + def _create_zip_deployment_for_static_site_build_initial( + self, + resource_group_name, # type: str + name, # type: str + environment_name, # type: str + static_site_zip_deployment_envelope, # type: "_models.StaticSiteZipDeploymentARMResource" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_zip_deployment_for_static_site_build_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(static_site_zip_deployment_envelope, 'StaticSiteZipDeploymentARMResource') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _create_zip_deployment_for_static_site_build_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/zipdeploy'} # type: ignore + + def begin_create_zip_deployment_for_static_site_build( + self, + resource_group_name, # type: str + name, # type: str + environment_name, # type: str + static_site_zip_deployment_envelope, # type: "_models.StaticSiteZipDeploymentARMResource" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deploys zipped content to a specific environment of a static site. + + Description for Deploys zipped content to a specific environment of a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param environment_name: Name of the environment. + :type environment_name: str + :param static_site_zip_deployment_envelope: A JSON representation of the + StaticSiteZipDeployment properties. See example. + :type static_site_zip_deployment_envelope: ~azure.mgmt.web.v2021_02_01.models.StaticSiteZipDeploymentARMResource + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_zip_deployment_for_static_site_build_initial( + resource_group_name=resource_group_name, + name=name, + environment_name=environment_name, + static_site_zip_deployment_envelope=static_site_zip_deployment_envelope, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_zip_deployment_for_static_site_build.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/zipdeploy'} # type: ignore + + def create_or_update_static_site_app_settings( + self, + resource_group_name, # type: str + name, # type: str + app_settings, # type: "_models.StringDictionary" + **kwargs # type: Any + ): + # type: (...) -> "_models.StringDictionary" + """Creates or updates the app settings of a static site. + + Description for Creates or updates the app settings of a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param app_settings: The dictionary containing the static site app settings to update. + :type app_settings: ~azure.mgmt.web.v2021_02_01.models.StringDictionary + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_static_site_app_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(app_settings, 'StringDictionary') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_static_site_app_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/config/appsettings'} # type: ignore + + def create_or_update_static_site_function_app_settings( + self, + resource_group_name, # type: str + name, # type: str + app_settings, # type: "_models.StringDictionary" + **kwargs # type: Any + ): + # type: (...) -> "_models.StringDictionary" + """Creates or updates the function app settings of a static site. + + Description for Creates or updates the function app settings of a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param app_settings: The dictionary containing the static site function app settings to update. + :type app_settings: ~azure.mgmt.web.v2021_02_01.models.StringDictionary + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_static_site_function_app_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(app_settings, 'StringDictionary') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_static_site_function_app_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/config/functionappsettings'} # type: ignore + + def create_user_roles_invitation_link( + self, + resource_group_name, # type: str + name, # type: str + static_site_user_roles_invitation_envelope, # type: "_models.StaticSiteUserInvitationRequestResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.StaticSiteUserInvitationResponseResource" + """Creates an invitation link for a user with the role. + + Description for Creates an invitation link for a user with the role. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param static_site_user_roles_invitation_envelope: + :type static_site_user_roles_invitation_envelope: ~azure.mgmt.web.v2021_02_01.models.StaticSiteUserInvitationRequestResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StaticSiteUserInvitationResponseResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.StaticSiteUserInvitationResponseResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteUserInvitationResponseResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_user_roles_invitation_link.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(static_site_user_roles_invitation_envelope, 'StaticSiteUserInvitationRequestResource') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StaticSiteUserInvitationResponseResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_user_roles_invitation_link.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/createUserInvitation'} # type: ignore + + def list_static_site_custom_domains( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.StaticSiteCustomDomainOverviewCollection"] + """Gets all static site custom domains for a particular static site. + + Description for Gets all static site custom domains for a particular static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site resource to search in. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StaticSiteCustomDomainOverviewCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.StaticSiteCustomDomainOverviewCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteCustomDomainOverviewCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_static_site_custom_domains.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('StaticSiteCustomDomainOverviewCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_static_site_custom_domains.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains'} # type: ignore + + def get_static_site_custom_domain( + self, + resource_group_name, # type: str + name, # type: str + domain_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.StaticSiteCustomDomainOverviewARMResource" + """Gets an existing custom domain for a particular static site. + + Description for Gets an existing custom domain for a particular static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site resource to search in. + :type name: str + :param domain_name: The custom domain name. + :type domain_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StaticSiteCustomDomainOverviewARMResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.StaticSiteCustomDomainOverviewARMResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteCustomDomainOverviewARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_static_site_custom_domain.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StaticSiteCustomDomainOverviewARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_static_site_custom_domain.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}'} # type: ignore + + def _create_or_update_static_site_custom_domain_initial( + self, + resource_group_name, # type: str + name, # type: str + domain_name, # type: str + static_site_custom_domain_request_properties_envelope, # type: "_models.StaticSiteCustomDomainRequestPropertiesARMResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.StaticSiteCustomDomainOverviewARMResource" + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteCustomDomainOverviewARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_static_site_custom_domain_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(static_site_custom_domain_request_properties_envelope, 'StaticSiteCustomDomainRequestPropertiesARMResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('StaticSiteCustomDomainOverviewARMResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('StaticSiteCustomDomainOverviewARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_static_site_custom_domain_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}'} # type: ignore + + def begin_create_or_update_static_site_custom_domain( + self, + resource_group_name, # type: str + name, # type: str + domain_name, # type: str + static_site_custom_domain_request_properties_envelope, # type: "_models.StaticSiteCustomDomainRequestPropertiesARMResource" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.StaticSiteCustomDomainOverviewARMResource"] + """Creates a new static site custom domain in an existing resource group and static site. + + Description for Creates a new static site custom domain in an existing resource group and + static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param domain_name: The custom domain to create. + :type domain_name: str + :param static_site_custom_domain_request_properties_envelope: A JSON representation of the + static site custom domain request properties. See example. + :type static_site_custom_domain_request_properties_envelope: ~azure.mgmt.web.v2021_02_01.models.StaticSiteCustomDomainRequestPropertiesARMResource + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either StaticSiteCustomDomainOverviewARMResource or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2021_02_01.models.StaticSiteCustomDomainOverviewARMResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteCustomDomainOverviewARMResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_static_site_custom_domain_initial( + resource_group_name=resource_group_name, + name=name, + domain_name=domain_name, + static_site_custom_domain_request_properties_envelope=static_site_custom_domain_request_properties_envelope, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('StaticSiteCustomDomainOverviewARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update_static_site_custom_domain.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}'} # type: ignore + + def _delete_static_site_custom_domain_initial( + self, + resource_group_name, # type: str + name, # type: str + domain_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._delete_static_site_custom_domain_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_static_site_custom_domain_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}'} # type: ignore + + def begin_delete_static_site_custom_domain( + self, + resource_group_name, # type: str + name, # type: str + domain_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes a custom domain. + + Description for Deletes a custom domain. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param domain_name: The custom domain to delete. + :type domain_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_static_site_custom_domain_initial( + resource_group_name=resource_group_name, + name=name, + domain_name=domain_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete_static_site_custom_domain.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}'} # type: ignore + + def _validate_custom_domain_can_be_added_to_static_site_initial( + self, + resource_group_name, # type: str + name, # type: str + domain_name, # type: str + static_site_custom_domain_request_properties_envelope, # type: "_models.StaticSiteCustomDomainRequestPropertiesARMResource" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._validate_custom_domain_can_be_added_to_static_site_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(static_site_custom_domain_request_properties_envelope, 'StaticSiteCustomDomainRequestPropertiesARMResource') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _validate_custom_domain_can_be_added_to_static_site_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}/validate'} # type: ignore + + def begin_validate_custom_domain_can_be_added_to_static_site( + self, + resource_group_name, # type: str + name, # type: str + domain_name, # type: str + static_site_custom_domain_request_properties_envelope, # type: "_models.StaticSiteCustomDomainRequestPropertiesARMResource" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Validates a particular custom domain can be added to a static site. + + Description for Validates a particular custom domain can be added to a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param domain_name: The custom domain to validate. + :type domain_name: str + :param static_site_custom_domain_request_properties_envelope: A JSON representation of the + static site custom domain request properties. See example. + :type static_site_custom_domain_request_properties_envelope: ~azure.mgmt.web.v2021_02_01.models.StaticSiteCustomDomainRequestPropertiesARMResource + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._validate_custom_domain_can_be_added_to_static_site_initial( + resource_group_name=resource_group_name, + name=name, + domain_name=domain_name, + static_site_custom_domain_request_properties_envelope=static_site_custom_domain_request_properties_envelope, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_validate_custom_domain_can_be_added_to_static_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}/validate'} # type: ignore + + def _detach_static_site_initial( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._detach_static_site_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _detach_static_site_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/detach'} # type: ignore + + def begin_detach_static_site( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Detaches a static site. + + Description for Detaches a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site to detach. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._detach_static_site_initial( + resource_group_name=resource_group_name, + name=name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_detach_static_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/detach'} # type: ignore + + def list_static_site_functions( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.StaticSiteFunctionOverviewCollection"] + """Gets the functions of a static site. + + Description for Gets the functions of a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StaticSiteFunctionOverviewCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.StaticSiteFunctionOverviewCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteFunctionOverviewCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_static_site_functions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('StaticSiteFunctionOverviewCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_static_site_functions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/functions'} # type: ignore + + def list_static_site_app_settings( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.StringDictionary" + """Gets the application settings of a static site. + + Description for Gets the application settings of a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_static_site_app_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_static_site_app_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/listAppSettings'} # type: ignore + + def list_static_site_configured_roles( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.StringList" + """Lists the roles configured for the static site. + + Description for Lists the roles configured for the static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringList, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.StringList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_static_site_configured_roles.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringList', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_static_site_configured_roles.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/listConfiguredRoles'} # type: ignore + + def list_static_site_function_app_settings( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.StringDictionary" + """Gets the application settings of a static site. + + Description for Gets the application settings of a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_static_site_function_app_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_static_site_function_app_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/listFunctionAppSettings'} # type: ignore + + def list_static_site_secrets( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.StringDictionary" + """Lists the secrets for an existing static site. + + Description for Lists the secrets for an existing static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_static_site_secrets.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_static_site_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/listSecrets'} # type: ignore + + def get_private_endpoint_connection_list( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.PrivateEndpointConnectionCollection"] + """Gets the list of private endpoint connections associated with a static site. + + Description for Gets the list of private endpoint connections associated with a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PrivateEndpointConnectionCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.PrivateEndpointConnectionCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_private_endpoint_connection_list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('PrivateEndpointConnectionCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + get_private_endpoint_connection_list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/privateEndpointConnections'} # type: ignore + + def get_private_endpoint_connection( + self, + resource_group_name, # type: str + name, # type: str + private_endpoint_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.RemotePrivateEndpointConnectionARMResource" + """Gets a private endpoint connection. + + Description for Gets a private endpoint connection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param private_endpoint_connection_name: Name of the private endpoint connection. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RemotePrivateEndpointConnectionARMResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.RemotePrivateEndpointConnectionARMResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RemotePrivateEndpointConnectionARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_private_endpoint_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RemotePrivateEndpointConnectionARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_private_endpoint_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def _approve_or_reject_private_endpoint_connection_initial( + self, + resource_group_name, # type: str + name, # type: str + private_endpoint_connection_name, # type: str + private_endpoint_wrapper, # type: "_models.PrivateLinkConnectionApprovalRequestResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.RemotePrivateEndpointConnectionARMResource" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RemotePrivateEndpointConnectionARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._approve_or_reject_private_endpoint_connection_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(private_endpoint_wrapper, 'PrivateLinkConnectionApprovalRequestResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('RemotePrivateEndpointConnectionARMResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('RemotePrivateEndpointConnectionARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _approve_or_reject_private_endpoint_connection_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def begin_approve_or_reject_private_endpoint_connection( + self, + resource_group_name, # type: str + name, # type: str + private_endpoint_connection_name, # type: str + private_endpoint_wrapper, # type: "_models.PrivateLinkConnectionApprovalRequestResource" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.RemotePrivateEndpointConnectionARMResource"] + """Approves or rejects a private endpoint connection. + + Description for Approves or rejects a private endpoint connection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param private_endpoint_connection_name: Name of the private endpoint connection. + :type private_endpoint_connection_name: str + :param private_endpoint_wrapper: Request body. + :type private_endpoint_wrapper: ~azure.mgmt.web.v2021_02_01.models.PrivateLinkConnectionApprovalRequestResource + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either RemotePrivateEndpointConnectionARMResource or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2021_02_01.models.RemotePrivateEndpointConnectionARMResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RemotePrivateEndpointConnectionARMResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._approve_or_reject_private_endpoint_connection_initial( + resource_group_name=resource_group_name, + name=name, + private_endpoint_connection_name=private_endpoint_connection_name, + private_endpoint_wrapper=private_endpoint_wrapper, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('RemotePrivateEndpointConnectionARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_approve_or_reject_private_endpoint_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def _delete_private_endpoint_connection_initial( + self, + resource_group_name, # type: str + name, # type: str + private_endpoint_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Any + cls = kwargs.pop('cls', None) # type: ClsType[Any] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._delete_private_endpoint_connection_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('object', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('object', pipeline_response) + + if response.status_code == 204: + deserialized = self._deserialize('object', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _delete_private_endpoint_connection_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def begin_delete_private_endpoint_connection( + self, + resource_group_name, # type: str + name, # type: str + private_endpoint_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[Any] + """Deletes a private endpoint connection. + + Description for Deletes a private endpoint connection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param private_endpoint_connection_name: Name of the private endpoint connection. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either any or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[any] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[Any] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_private_endpoint_connection_initial( + resource_group_name=resource_group_name, + name=name, + private_endpoint_connection_name=private_endpoint_connection_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('object', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete_private_endpoint_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def get_private_link_resources( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateLinkResourcesWrapper" + """Gets the private link resources. + + Description for Gets the private link resources. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the site. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkResourcesWrapper, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.PrivateLinkResourcesWrapper + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourcesWrapper"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_private_link_resources.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateLinkResourcesWrapper', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_private_link_resources.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/privateLinkResources'} # type: ignore + + def reset_static_site_api_key( + self, + resource_group_name, # type: str + name, # type: str + reset_properties_envelope, # type: "_models.StaticSiteResetPropertiesARMResource" + **kwargs # type: Any + ): + # type: (...) -> None + """Resets the api key for an existing static site. + + Description for Resets the api key for an existing static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param reset_properties_envelope: + :type reset_properties_envelope: ~azure.mgmt.web.v2021_02_01.models.StaticSiteResetPropertiesARMResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.reset_static_site_api_key.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(reset_properties_envelope, 'StaticSiteResetPropertiesARMResource') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + reset_static_site_api_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/resetapikey'} # type: ignore + + def get_user_provided_function_apps_for_static_site( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.StaticSiteUserProvidedFunctionAppsCollection"] + """Gets the details of the user provided function apps registered with a static site. + + Description for Gets the details of the user provided function apps registered with a static + site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StaticSiteUserProvidedFunctionAppsCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.StaticSiteUserProvidedFunctionAppsCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteUserProvidedFunctionAppsCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_user_provided_function_apps_for_static_site.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('StaticSiteUserProvidedFunctionAppsCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + get_user_provided_function_apps_for_static_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/userProvidedFunctionApps'} # type: ignore + + def get_user_provided_function_app_for_static_site( + self, + resource_group_name, # type: str + name, # type: str + function_app_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.StaticSiteUserProvidedFunctionAppARMResource" + """Gets the details of the user provided function app registered with a static site. + + Description for Gets the details of the user provided function app registered with a static + site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param function_app_name: Name of the function app registered with the static site. + :type function_app_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StaticSiteUserProvidedFunctionAppARMResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.StaticSiteUserProvidedFunctionAppARMResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteUserProvidedFunctionAppARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_user_provided_function_app_for_static_site.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionAppName': self._serialize.url("function_app_name", function_app_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StaticSiteUserProvidedFunctionAppARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_user_provided_function_app_for_static_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/userProvidedFunctionApps/{functionAppName}'} # type: ignore + + def _register_user_provided_function_app_with_static_site_initial( + self, + resource_group_name, # type: str + name, # type: str + function_app_name, # type: str + static_site_user_provided_function_envelope, # type: "_models.StaticSiteUserProvidedFunctionAppARMResource" + is_forced=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> "_models.StaticSiteUserProvidedFunctionAppARMResource" + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteUserProvidedFunctionAppARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._register_user_provided_function_app_with_static_site_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionAppName': self._serialize.url("function_app_name", function_app_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if is_forced is not None: + query_parameters['isForced'] = self._serialize.query("is_forced", is_forced, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(static_site_user_provided_function_envelope, 'StaticSiteUserProvidedFunctionAppARMResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('StaticSiteUserProvidedFunctionAppARMResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('StaticSiteUserProvidedFunctionAppARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _register_user_provided_function_app_with_static_site_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/userProvidedFunctionApps/{functionAppName}'} # type: ignore + + def begin_register_user_provided_function_app_with_static_site( + self, + resource_group_name, # type: str + name, # type: str + function_app_name, # type: str + static_site_user_provided_function_envelope, # type: "_models.StaticSiteUserProvidedFunctionAppARMResource" + is_forced=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.StaticSiteUserProvidedFunctionAppARMResource"] + """Register a user provided function app with a static site. + + Description for Register a user provided function app with a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param function_app_name: Name of the function app to register with the static site. + :type function_app_name: str + :param static_site_user_provided_function_envelope: A JSON representation of the user provided + function app properties. See example. + :type static_site_user_provided_function_envelope: ~azure.mgmt.web.v2021_02_01.models.StaticSiteUserProvidedFunctionAppARMResource + :param is_forced: Specify :code:`true` to force the update of the auth + configuration on the function app even if an AzureStaticWebApps provider is already configured + on the function app. The default is :code:`false`. + :type is_forced: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either StaticSiteUserProvidedFunctionAppARMResource or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2021_02_01.models.StaticSiteUserProvidedFunctionAppARMResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StaticSiteUserProvidedFunctionAppARMResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._register_user_provided_function_app_with_static_site_initial( + resource_group_name=resource_group_name, + name=name, + function_app_name=function_app_name, + static_site_user_provided_function_envelope=static_site_user_provided_function_envelope, + is_forced=is_forced, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('StaticSiteUserProvidedFunctionAppARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionAppName': self._serialize.url("function_app_name", function_app_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_register_user_provided_function_app_with_static_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/userProvidedFunctionApps/{functionAppName}'} # type: ignore + + def detach_user_provided_function_app_from_static_site( + self, + resource_group_name, # type: str + name, # type: str + function_app_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Detach the user provided function app from the static site. + + Description for Detach the user provided function app from the static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param function_app_name: Name of the function app registered with the static site. + :type function_app_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.detach_user_provided_function_app_from_static_site.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionAppName': self._serialize.url("function_app_name", function_app_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + detach_user_provided_function_app_from_static_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/userProvidedFunctionApps/{functionAppName}'} # type: ignore + + def _create_zip_deployment_for_static_site_initial( + self, + resource_group_name, # type: str + name, # type: str + static_site_zip_deployment_envelope, # type: "_models.StaticSiteZipDeploymentARMResource" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_zip_deployment_for_static_site_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(static_site_zip_deployment_envelope, 'StaticSiteZipDeploymentARMResource') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _create_zip_deployment_for_static_site_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/zipdeploy'} # type: ignore + + def begin_create_zip_deployment_for_static_site( + self, + resource_group_name, # type: str + name, # type: str + static_site_zip_deployment_envelope, # type: "_models.StaticSiteZipDeploymentARMResource" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deploys zipped content to a static site. + + Description for Deploys zipped content to a static site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the static site. + :type name: str + :param static_site_zip_deployment_envelope: A JSON representation of the + StaticSiteZipDeployment properties. See example. + :type static_site_zip_deployment_envelope: ~azure.mgmt.web.v2021_02_01.models.StaticSiteZipDeploymentARMResource + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_zip_deployment_for_static_site_initial( + resource_group_name=resource_group_name, + name=name, + static_site_zip_deployment_envelope=static_site_zip_deployment_envelope, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_zip_deployment_for_static_site.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/zipdeploy'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_top_level_domains_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_top_level_domains_operations.py new file mode 100644 index 000000000000..dee136ad1b75 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_top_level_domains_operations.py @@ -0,0 +1,259 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class TopLevelDomainsOperations(object): + """TopLevelDomainsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2021_02_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.TopLevelDomainCollection"] + """Get all top-level domains supported for registration. + + Description for Get all top-level domains supported for registration. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either TopLevelDomainCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.TopLevelDomainCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TopLevelDomainCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('TopLevelDomainCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/topLevelDomains'} # type: ignore + + def get( + self, + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.TopLevelDomain" + """Get details of a top-level domain. + + Description for Get details of a top-level domain. + + :param name: Name of the top-level domain. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TopLevelDomain, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.TopLevelDomain + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TopLevelDomain"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('TopLevelDomain', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/topLevelDomains/{name}'} # type: ignore + + def list_agreements( + self, + name, # type: str + agreement_option, # type: "_models.TopLevelDomainAgreementOption" + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.TldLegalAgreementCollection"] + """Gets all legal agreements that user needs to accept before purchasing a domain. + + Description for Gets all legal agreements that user needs to accept before purchasing a domain. + + :param name: Name of the top-level domain. + :type name: str + :param agreement_option: Domain agreement options. + :type agreement_option: ~azure.mgmt.web.v2021_02_01.models.TopLevelDomainAgreementOption + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either TldLegalAgreementCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.TldLegalAgreementCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TldLegalAgreementCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = "application/json" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_agreements.metadata['url'] # type: ignore + path_format_arguments = { + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(agreement_option, 'TopLevelDomainAgreementOption') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(agreement_option, 'TopLevelDomainAgreementOption') + body_content_kwargs['content'] = body_content + request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('TldLegalAgreementCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_agreements.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/topLevelDomains/{name}/listAgreements'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_web_apps_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_web_apps_operations.py new file mode 100644 index 000000000000..f5ac08d0d66a --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_web_apps_operations.py @@ -0,0 +1,30191 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, IO, Iterable, List, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class WebAppsOperations(object): + """WebAppsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.web.v2021_02_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.WebAppCollection"] + """Get all apps for a subscription. + + Description for Get all apps for a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebAppCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.WebAppCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/sites'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + include_slots=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.WebAppCollection"] + """Gets all web, mobile, and API apps in the specified resource group. + + Description for Gets all web, mobile, and API apps in the specified resource group. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param include_slots: Specify :code:`true` to include deployment slots in + results. The default is false, which only gives you the production slot of all apps. + :type include_slots: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebAppCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.WebAppCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if include_slots is not None: + query_parameters['includeSlots'] = self._serialize.query("include_slots", include_slots, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites'} # type: ignore + + def get( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Site" + """Gets the details of a web, mobile, or API app. + + Description for Gets the details of a web, mobile, or API app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Site, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.Site + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Site"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Site', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + name, # type: str + site_envelope, # type: "_models.Site" + **kwargs # type: Any + ): + # type: (...) -> "_models.Site" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Site"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_envelope, 'Site') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Site', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Site', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + name, # type: str + site_envelope, # type: "_models.Site" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.Site"] + """Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. + + Description for Creates a new web, mobile, or API app in an existing resource group, or updates + an existing app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Unique name of the app to create or update. To create or update a deployment slot, + use the {slot} parameter. + :type name: str + :param site_envelope: A JSON representation of the app properties. See example. + :type site_envelope: ~azure.mgmt.web.v2021_02_01.models.Site + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either Site or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2021_02_01.models.Site] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Site"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + name=name, + site_envelope=site_envelope, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Site', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + name, # type: str + delete_metrics=None, # type: Optional[bool] + delete_empty_server_farm=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a web, mobile, or API app, or one of the deployment slots. + + Description for Deletes a web, mobile, or API app, or one of the deployment slots. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app to delete. + :type name: str + :param delete_metrics: If true, web app metrics are also deleted. + :type delete_metrics: bool + :param delete_empty_server_farm: Specify false if you want to keep empty App Service plan. By + default, empty App Service plan is deleted. + :type delete_empty_server_farm: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if delete_metrics is not None: + query_parameters['deleteMetrics'] = self._serialize.query("delete_metrics", delete_metrics, 'bool') + if delete_empty_server_farm is not None: + query_parameters['deleteEmptyServerFarm'] = self._serialize.query("delete_empty_server_farm", delete_empty_server_farm, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + name, # type: str + site_envelope, # type: "_models.SitePatchResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.Site" + """Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. + + Description for Creates a new web, mobile, or API app in an existing resource group, or updates + an existing app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Unique name of the app to create or update. To create or update a deployment slot, + use the {slot} parameter. + :type name: str + :param site_envelope: A JSON representation of the app properties. See example. + :type site_envelope: ~azure.mgmt.web.v2021_02_01.models.SitePatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Site, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.Site + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Site"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_envelope, 'SitePatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Site', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Site', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}'} # type: ignore + + def analyze_custom_hostname( + self, + resource_group_name, # type: str + name, # type: str + host_name=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.CustomHostnameAnalysisResult" + """Analyze a custom hostname. + + Description for Analyze a custom hostname. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param host_name: Custom hostname. + :type host_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CustomHostnameAnalysisResult, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.CustomHostnameAnalysisResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomHostnameAnalysisResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.analyze_custom_hostname.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if host_name is not None: + query_parameters['hostName'] = self._serialize.query("host_name", host_name, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CustomHostnameAnalysisResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + analyze_custom_hostname.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/analyzeCustomHostname'} # type: ignore + + def apply_slot_config_to_production( + self, + resource_group_name, # type: str + name, # type: str + slot_swap_entity, # type: "_models.CsmSlotEntity" + **kwargs # type: Any + ): + # type: (...) -> None + """Applies the configuration settings from the target slot onto the current slot. + + Description for Applies the configuration settings from the target slot onto the current slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot_swap_entity: JSON object that contains the target slot name. See example. + :type slot_swap_entity: ~azure.mgmt.web.v2021_02_01.models.CsmSlotEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.apply_slot_config_to_production.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(slot_swap_entity, 'CsmSlotEntity') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + apply_slot_config_to_production.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/applySlotConfig'} # type: ignore + + def backup( + self, + resource_group_name, # type: str + name, # type: str + request, # type: "_models.BackupRequest" + **kwargs # type: Any + ): + # type: (...) -> "_models.BackupItem" + """Creates a backup of an app. + + Description for Creates a backup of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param request: Backup configuration. You can use the JSON response from the POST action as + input here. + :type request: ~azure.mgmt.web.v2021_02_01.models.BackupRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupItem, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.BackupItem + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupItem"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.backup.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'BackupRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupItem', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + backup.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backup'} # type: ignore + + def list_backups( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.BackupItemCollection"] + """Gets existing backups of an app. + + Description for Gets existing backups of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either BackupItemCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.BackupItemCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupItemCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_backups.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('BackupItemCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_backups.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups'} # type: ignore + + def get_backup_status( + self, + resource_group_name, # type: str + name, # type: str + backup_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.BackupItem" + """Gets a backup of an app by its ID. + + Description for Gets a backup of an app by its ID. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param backup_id: ID of the backup. + :type backup_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupItem, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.BackupItem + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupItem"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_backup_status.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupItem', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_backup_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}'} # type: ignore + + def delete_backup( + self, + resource_group_name, # type: str + name, # type: str + backup_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a backup of an app by its ID. + + Description for Deletes a backup of an app by its ID. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param backup_id: ID of the backup. + :type backup_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_backup.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_backup.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}'} # type: ignore + + def list_backup_status_secrets( + self, + resource_group_name, # type: str + name, # type: str + backup_id, # type: str + request, # type: "_models.BackupRequest" + **kwargs # type: Any + ): + # type: (...) -> "_models.BackupItem" + """Gets status of a web app backup that may be in progress, including secrets associated with the backup, such as the Azure Storage SAS URL. Also can be used to update the SAS URL for the backup if a new URL is passed in the request body. + + Description for Gets status of a web app backup that may be in progress, including secrets + associated with the backup, such as the Azure Storage SAS URL. Also can be used to update the + SAS URL for the backup if a new URL is passed in the request body. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param backup_id: ID of backup. + :type backup_id: str + :param request: Information on backup request. + :type request: ~azure.mgmt.web.v2021_02_01.models.BackupRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupItem, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.BackupItem + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupItem"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.list_backup_status_secrets.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'BackupRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupItem', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_backup_status_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}/list'} # type: ignore + + def _restore_initial( + self, + resource_group_name, # type: str + name, # type: str + backup_id, # type: str + request, # type: "_models.RestoreRequest" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._restore_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'RestoreRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _restore_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}/restore'} # type: ignore + + def begin_restore( + self, + resource_group_name, # type: str + name, # type: str + backup_id, # type: str + request, # type: "_models.RestoreRequest" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Restores a specific backup to another app (or deployment slot, if specified). + + Description for Restores a specific backup to another app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param backup_id: ID of the backup. + :type backup_id: str + :param request: Information on restore request . + :type request: ~azure.mgmt.web.v2021_02_01.models.RestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._restore_initial( + resource_group_name=resource_group_name, + name=name, + backup_id=backup_id, + request=request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_restore.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}/restore'} # type: ignore + + def list_basic_publishing_credentials_policies( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.PublishingCredentialsPoliciesCollection"] + """Returns whether Scm basic auth is allowed and whether Ftp is allowed for a given site. + + Description for Returns whether Scm basic auth is allowed and whether Ftp is allowed for a + given site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PublishingCredentialsPoliciesCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.PublishingCredentialsPoliciesCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublishingCredentialsPoliciesCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_basic_publishing_credentials_policies.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('PublishingCredentialsPoliciesCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_basic_publishing_credentials_policies.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/basicPublishingCredentialsPolicies'} # type: ignore + + def get_ftp_allowed( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.CsmPublishingCredentialsPoliciesEntity" + """Returns whether FTP is allowed on the site or not. + + Description for Returns whether FTP is allowed on the site or not. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CsmPublishingCredentialsPoliciesEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.CsmPublishingCredentialsPoliciesEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmPublishingCredentialsPoliciesEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_ftp_allowed.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CsmPublishingCredentialsPoliciesEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_ftp_allowed.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/basicPublishingCredentialsPolicies/ftp'} # type: ignore + + def update_ftp_allowed( + self, + resource_group_name, # type: str + name, # type: str + csm_publishing_access_policies_entity, # type: "_models.CsmPublishingCredentialsPoliciesEntity" + **kwargs # type: Any + ): + # type: (...) -> "_models.CsmPublishingCredentialsPoliciesEntity" + """Updates whether FTP is allowed on the site or not. + + Description for Updates whether FTP is allowed on the site or not. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param csm_publishing_access_policies_entity: + :type csm_publishing_access_policies_entity: ~azure.mgmt.web.v2021_02_01.models.CsmPublishingCredentialsPoliciesEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CsmPublishingCredentialsPoliciesEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.CsmPublishingCredentialsPoliciesEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmPublishingCredentialsPoliciesEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_ftp_allowed.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(csm_publishing_access_policies_entity, 'CsmPublishingCredentialsPoliciesEntity') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CsmPublishingCredentialsPoliciesEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_ftp_allowed.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/basicPublishingCredentialsPolicies/ftp'} # type: ignore + + def get_scm_allowed( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.CsmPublishingCredentialsPoliciesEntity" + """Returns whether Scm basic auth is allowed on the site or not. + + Description for Returns whether Scm basic auth is allowed on the site or not. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CsmPublishingCredentialsPoliciesEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.CsmPublishingCredentialsPoliciesEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmPublishingCredentialsPoliciesEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_scm_allowed.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CsmPublishingCredentialsPoliciesEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_scm_allowed.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/basicPublishingCredentialsPolicies/scm'} # type: ignore + + def update_scm_allowed( + self, + resource_group_name, # type: str + name, # type: str + csm_publishing_access_policies_entity, # type: "_models.CsmPublishingCredentialsPoliciesEntity" + **kwargs # type: Any + ): + # type: (...) -> "_models.CsmPublishingCredentialsPoliciesEntity" + """Updates whether user publishing credentials are allowed on the site or not. + + Description for Updates whether user publishing credentials are allowed on the site or not. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param csm_publishing_access_policies_entity: + :type csm_publishing_access_policies_entity: ~azure.mgmt.web.v2021_02_01.models.CsmPublishingCredentialsPoliciesEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CsmPublishingCredentialsPoliciesEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.CsmPublishingCredentialsPoliciesEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmPublishingCredentialsPoliciesEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_scm_allowed.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(csm_publishing_access_policies_entity, 'CsmPublishingCredentialsPoliciesEntity') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CsmPublishingCredentialsPoliciesEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_scm_allowed.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/basicPublishingCredentialsPolicies/scm'} # type: ignore + + def list_configurations( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SiteConfigResourceCollection"] + """List the configurations of an app. + + Description for List the configurations of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SiteConfigResourceCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.SiteConfigResourceCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigResourceCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_configurations.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SiteConfigResourceCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_configurations.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config'} # type: ignore + + def update_application_settings( + self, + resource_group_name, # type: str + name, # type: str + app_settings, # type: "_models.StringDictionary" + **kwargs # type: Any + ): + # type: (...) -> "_models.StringDictionary" + """Replaces the application settings of an app. + + Description for Replaces the application settings of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param app_settings: Application settings of the app. + :type app_settings: ~azure.mgmt.web.v2021_02_01.models.StringDictionary + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_application_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(app_settings, 'StringDictionary') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_application_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/appsettings'} # type: ignore + + def list_application_settings( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.StringDictionary" + """Gets the application settings of an app. + + Description for Gets the application settings of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_application_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_application_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/appsettings/list'} # type: ignore + + def update_auth_settings( + self, + resource_group_name, # type: str + name, # type: str + site_auth_settings, # type: "_models.SiteAuthSettings" + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteAuthSettings" + """Updates the Authentication / Authorization settings associated with web app. + + Description for Updates the Authentication / Authorization settings associated with web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param site_auth_settings: Auth settings associated with web app. + :type site_auth_settings: ~azure.mgmt.web.v2021_02_01.models.SiteAuthSettings + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteAuthSettings, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SiteAuthSettings + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteAuthSettings"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_auth_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_auth_settings, 'SiteAuthSettings') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteAuthSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_auth_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/authsettings'} # type: ignore + + def get_auth_settings( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteAuthSettings" + """Gets the Authentication/Authorization settings of an app. + + Description for Gets the Authentication/Authorization settings of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteAuthSettings, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SiteAuthSettings + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteAuthSettings"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_auth_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteAuthSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_auth_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/authsettings/list'} # type: ignore + + def update_auth_settings_v2( + self, + resource_group_name, # type: str + name, # type: str + site_auth_settings_v2, # type: "_models.SiteAuthSettingsV2" + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteAuthSettingsV2" + """Updates site's Authentication / Authorization settings for apps via the V2 format. + + Description for Updates site's Authentication / Authorization settings for apps via the V2 + format. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param site_auth_settings_v2: Auth settings associated with web app. + :type site_auth_settings_v2: ~azure.mgmt.web.v2021_02_01.models.SiteAuthSettingsV2 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteAuthSettingsV2, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SiteAuthSettingsV2 + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteAuthSettingsV2"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_auth_settings_v2.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_auth_settings_v2, 'SiteAuthSettingsV2') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteAuthSettingsV2', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_auth_settings_v2.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/authsettingsV2'} # type: ignore + + def get_auth_settings_v2( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteAuthSettingsV2" + """Gets site's Authentication / Authorization settings for apps via the V2 format. + + Description for Gets site's Authentication / Authorization settings for apps via the V2 format. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteAuthSettingsV2, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SiteAuthSettingsV2 + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteAuthSettingsV2"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_auth_settings_v2.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteAuthSettingsV2', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_auth_settings_v2.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/authsettingsV2/list'} # type: ignore + + def update_azure_storage_accounts( + self, + resource_group_name, # type: str + name, # type: str + azure_storage_accounts, # type: "_models.AzureStoragePropertyDictionaryResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.AzureStoragePropertyDictionaryResource" + """Updates the Azure storage account configurations of an app. + + Description for Updates the Azure storage account configurations of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param azure_storage_accounts: Azure storage accounts of the app. + :type azure_storage_accounts: ~azure.mgmt.web.v2021_02_01.models.AzureStoragePropertyDictionaryResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AzureStoragePropertyDictionaryResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.AzureStoragePropertyDictionaryResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureStoragePropertyDictionaryResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_azure_storage_accounts.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(azure_storage_accounts, 'AzureStoragePropertyDictionaryResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AzureStoragePropertyDictionaryResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_azure_storage_accounts.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/azurestorageaccounts'} # type: ignore + + def list_azure_storage_accounts( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.AzureStoragePropertyDictionaryResource" + """Gets the Azure storage account configurations of an app. + + Description for Gets the Azure storage account configurations of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AzureStoragePropertyDictionaryResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.AzureStoragePropertyDictionaryResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureStoragePropertyDictionaryResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_azure_storage_accounts.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AzureStoragePropertyDictionaryResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_azure_storage_accounts.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/azurestorageaccounts/list'} # type: ignore + + def update_backup_configuration( + self, + resource_group_name, # type: str + name, # type: str + request, # type: "_models.BackupRequest" + **kwargs # type: Any + ): + # type: (...) -> "_models.BackupRequest" + """Updates the backup configuration of an app. + + Description for Updates the backup configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param request: Edited backup configuration. + :type request: ~azure.mgmt.web.v2021_02_01.models.BackupRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupRequest, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.BackupRequest + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupRequest"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_backup_configuration.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'BackupRequest') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupRequest', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_backup_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/backup'} # type: ignore + + def delete_backup_configuration( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes the backup configuration of an app. + + Description for Deletes the backup configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_backup_configuration.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_backup_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/backup'} # type: ignore + + def get_backup_configuration( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.BackupRequest" + """Gets the backup configuration of an app. + + Description for Gets the backup configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupRequest, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.BackupRequest + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupRequest"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_backup_configuration.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupRequest', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_backup_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/backup/list'} # type: ignore + + def get_app_settings_key_vault_references( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ApiKVReferenceCollection"] + """Gets the config reference app settings and status of an app. + + Description for Gets the config reference app settings and status of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ApiKVReferenceCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.ApiKVReferenceCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiKVReferenceCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_app_settings_key_vault_references.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ApiKVReferenceCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + get_app_settings_key_vault_references.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/configreferences/appsettings'} # type: ignore + + def get_app_setting_key_vault_reference( + self, + resource_group_name, # type: str + name, # type: str + app_setting_key, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ApiKVReference" + """Gets the config reference and status of an app. + + Description for Gets the config reference and status of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param app_setting_key: App Setting key name. + :type app_setting_key: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ApiKVReference, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.ApiKVReference + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiKVReference"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_app_setting_key_vault_reference.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'appSettingKey': self._serialize.url("app_setting_key", app_setting_key, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ApiKVReference', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_app_setting_key_vault_reference.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/configreferences/appsettings/{appSettingKey}'} # type: ignore + + def get_site_connection_string_key_vault_references( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ApiKVReferenceCollection"] + """Gets the config reference app settings and status of an app. + + Description for Gets the config reference app settings and status of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ApiKVReferenceCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.ApiKVReferenceCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiKVReferenceCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_site_connection_string_key_vault_references.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ApiKVReferenceCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + get_site_connection_string_key_vault_references.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/configreferences/connectionstrings'} # type: ignore + + def get_site_connection_string_key_vault_reference( + self, + resource_group_name, # type: str + name, # type: str + connection_string_key, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ApiKVReference" + """Gets the config reference and status of an app. + + Description for Gets the config reference and status of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param connection_string_key: + :type connection_string_key: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ApiKVReference, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.ApiKVReference + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiKVReference"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_site_connection_string_key_vault_reference.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'connectionStringKey': self._serialize.url("connection_string_key", connection_string_key, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ApiKVReference', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_connection_string_key_vault_reference.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/configreferences/connectionstrings/{connectionStringKey}'} # type: ignore + + def update_connection_strings( + self, + resource_group_name, # type: str + name, # type: str + connection_strings, # type: "_models.ConnectionStringDictionary" + **kwargs # type: Any + ): + # type: (...) -> "_models.ConnectionStringDictionary" + """Replaces the connection strings of an app. + + Description for Replaces the connection strings of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param connection_strings: Connection strings of the app or deployment slot. See example. + :type connection_strings: ~azure.mgmt.web.v2021_02_01.models.ConnectionStringDictionary + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ConnectionStringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.ConnectionStringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionStringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_connection_strings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_strings, 'ConnectionStringDictionary') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ConnectionStringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_connection_strings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/connectionstrings'} # type: ignore + + def list_connection_strings( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ConnectionStringDictionary" + """Gets the connection strings of an app. + + Description for Gets the connection strings of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ConnectionStringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.ConnectionStringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionStringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_connection_strings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ConnectionStringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_connection_strings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/connectionstrings/list'} # type: ignore + + def get_diagnostic_logs_configuration( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteLogsConfig" + """Gets the logging configuration of an app. + + Description for Gets the logging configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteLogsConfig, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SiteLogsConfig + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteLogsConfig"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_diagnostic_logs_configuration.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteLogsConfig', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_diagnostic_logs_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/logs'} # type: ignore + + def update_diagnostic_logs_config( + self, + resource_group_name, # type: str + name, # type: str + site_logs_config, # type: "_models.SiteLogsConfig" + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteLogsConfig" + """Updates the logging configuration of an app. + + Description for Updates the logging configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param site_logs_config: A SiteLogsConfig JSON object that contains the logging configuration + to change in the "properties" property. + :type site_logs_config: ~azure.mgmt.web.v2021_02_01.models.SiteLogsConfig + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteLogsConfig, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SiteLogsConfig + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteLogsConfig"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_diagnostic_logs_config.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_logs_config, 'SiteLogsConfig') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteLogsConfig', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_diagnostic_logs_config.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/logs'} # type: ignore + + def update_metadata( + self, + resource_group_name, # type: str + name, # type: str + metadata, # type: "_models.StringDictionary" + **kwargs # type: Any + ): + # type: (...) -> "_models.StringDictionary" + """Replaces the metadata of an app. + + Description for Replaces the metadata of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param metadata: Edited metadata of the app or deployment slot. See example. + :type metadata: ~azure.mgmt.web.v2021_02_01.models.StringDictionary + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_metadata.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(metadata, 'StringDictionary') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_metadata.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/metadata'} # type: ignore + + def list_metadata( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.StringDictionary" + """Gets the metadata of an app. + + Description for Gets the metadata of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_metadata.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_metadata.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/metadata/list'} # type: ignore + + def _list_publishing_credentials_initial( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.User" + cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._list_publishing_credentials_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _list_publishing_credentials_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/publishingcredentials/list'} # type: ignore + + def begin_list_publishing_credentials( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.User"] + """Gets the Git/FTP publishing credentials of an app. + + Description for Gets the Git/FTP publishing credentials of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either User or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2021_02_01.models.User] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._list_publishing_credentials_initial( + resource_group_name=resource_group_name, + name=name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_list_publishing_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/publishingcredentials/list'} # type: ignore + + def update_site_push_settings( + self, + resource_group_name, # type: str + name, # type: str + push_settings, # type: "_models.PushSettings" + **kwargs # type: Any + ): + # type: (...) -> "_models.PushSettings" + """Updates the Push settings associated with web app. + + Description for Updates the Push settings associated with web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param push_settings: Push settings associated with web app. + :type push_settings: ~azure.mgmt.web.v2021_02_01.models.PushSettings + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PushSettings, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.PushSettings + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PushSettings"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_site_push_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(push_settings, 'PushSettings') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PushSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_site_push_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/pushsettings'} # type: ignore + + def list_site_push_settings( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PushSettings" + """Gets the Push settings associated with web app. + + Description for Gets the Push settings associated with web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PushSettings, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.PushSettings + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PushSettings"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_site_push_settings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PushSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_site_push_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/pushsettings/list'} # type: ignore + + def list_slot_configuration_names( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SlotConfigNamesResource" + """Gets the names of app settings and connection strings that stick to the slot (not swapped). + + Description for Gets the names of app settings and connection strings that stick to the slot + (not swapped). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SlotConfigNamesResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SlotConfigNamesResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SlotConfigNamesResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_slot_configuration_names.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SlotConfigNamesResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_slot_configuration_names.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/slotConfigNames'} # type: ignore + + def update_slot_configuration_names( + self, + resource_group_name, # type: str + name, # type: str + slot_config_names, # type: "_models.SlotConfigNamesResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.SlotConfigNamesResource" + """Updates the names of application settings and connection string that remain with the slot during swap operation. + + Description for Updates the names of application settings and connection string that remain + with the slot during swap operation. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot_config_names: Names of application settings and connection strings. See example. + :type slot_config_names: ~azure.mgmt.web.v2021_02_01.models.SlotConfigNamesResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SlotConfigNamesResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SlotConfigNamesResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SlotConfigNamesResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_slot_configuration_names.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(slot_config_names, 'SlotConfigNamesResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SlotConfigNamesResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_slot_configuration_names.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/slotConfigNames'} # type: ignore + + def get_configuration( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteConfigResource" + """Gets the configuration of an app, such as platform version and bitness, default documents, virtual applications, Always On, etc. + + Description for Gets the configuration of an app, such as platform version and bitness, default + documents, virtual applications, Always On, etc. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteConfigResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SiteConfigResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_configuration.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteConfigResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web'} # type: ignore + + def create_or_update_configuration( + self, + resource_group_name, # type: str + name, # type: str + site_config, # type: "_models.SiteConfigResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteConfigResource" + """Updates the configuration of an app. + + Description for Updates the configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param site_config: JSON representation of a SiteConfig object. See example. + :type site_config: ~azure.mgmt.web.v2021_02_01.models.SiteConfigResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteConfigResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SiteConfigResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_configuration.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_config, 'SiteConfigResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteConfigResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web'} # type: ignore + + def update_configuration( + self, + resource_group_name, # type: str + name, # type: str + site_config, # type: "_models.SiteConfigResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteConfigResource" + """Updates the configuration of an app. + + Description for Updates the configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param site_config: JSON representation of a SiteConfig object. See example. + :type site_config: ~azure.mgmt.web.v2021_02_01.models.SiteConfigResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteConfigResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SiteConfigResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_configuration.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_config, 'SiteConfigResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteConfigResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web'} # type: ignore + + def list_configuration_snapshot_info( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SiteConfigurationSnapshotInfoCollection"] + """Gets a list of web app configuration snapshots identifiers. Each element of the list contains a timestamp and the ID of the snapshot. + + Description for Gets a list of web app configuration snapshots identifiers. Each element of the + list contains a timestamp and the ID of the snapshot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SiteConfigurationSnapshotInfoCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.SiteConfigurationSnapshotInfoCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigurationSnapshotInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_configuration_snapshot_info.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SiteConfigurationSnapshotInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_configuration_snapshot_info.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots'} # type: ignore + + def get_configuration_snapshot( + self, + resource_group_name, # type: str + name, # type: str + snapshot_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteConfigResource" + """Gets a snapshot of the configuration of an app at a previous point in time. + + Description for Gets a snapshot of the configuration of an app at a previous point in time. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param snapshot_id: The ID of the snapshot to read. + :type snapshot_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteConfigResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SiteConfigResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_configuration_snapshot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'snapshotId': self._serialize.url("snapshot_id", snapshot_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteConfigResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_configuration_snapshot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots/{snapshotId}'} # type: ignore + + def recover_site_configuration_snapshot( + self, + resource_group_name, # type: str + name, # type: str + snapshot_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Reverts the configuration of an app to a previous snapshot. + + Description for Reverts the configuration of an app to a previous snapshot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param snapshot_id: The ID of the snapshot to read. + :type snapshot_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.recover_site_configuration_snapshot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'snapshotId': self._serialize.url("snapshot_id", snapshot_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + recover_site_configuration_snapshot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots/{snapshotId}/recover'} # type: ignore + + def get_web_site_container_logs( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional[IO] + """Gets the last lines of docker logs for the given site. + + Description for Gets the last lines of docker logs for the given site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional[IO]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/octet-stream" + + # Construct URL + url = self.get_web_site_container_logs.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_web_site_container_logs.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/containerlogs'} # type: ignore + + def get_container_logs_zip( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional[IO] + """Gets the ZIP archived docker log files for the given site. + + Description for Gets the ZIP archived docker log files for the given site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional[IO]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/zip" + + # Construct URL + url = self.get_container_logs_zip.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_container_logs_zip.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/containerlogs/zip/download'} # type: ignore + + def list_continuous_web_jobs( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ContinuousWebJobCollection"] + """List continuous web jobs for an app, or a deployment slot. + + Description for List continuous web jobs for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ContinuousWebJobCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.ContinuousWebJobCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ContinuousWebJobCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_continuous_web_jobs.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ContinuousWebJobCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_continuous_web_jobs.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs'} # type: ignore + + def get_continuous_web_job( + self, + resource_group_name, # type: str + name, # type: str + web_job_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ContinuousWebJob" + """Gets a continuous web job by its ID for an app, or a deployment slot. + + Description for Gets a continuous web job by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ContinuousWebJob, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.ContinuousWebJob + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ContinuousWebJob"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_continuous_web_job.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ContinuousWebJob', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_continuous_web_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}'} # type: ignore + + def delete_continuous_web_job( + self, + resource_group_name, # type: str + name, # type: str + web_job_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a continuous web job by its ID for an app, or a deployment slot. + + Description for Delete a continuous web job by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_continuous_web_job.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_continuous_web_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}'} # type: ignore + + def start_continuous_web_job( + self, + resource_group_name, # type: str + name, # type: str + web_job_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Start a continuous web job for an app, or a deployment slot. + + Description for Start a continuous web job for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.start_continuous_web_job.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + start_continuous_web_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}/start'} # type: ignore + + def stop_continuous_web_job( + self, + resource_group_name, # type: str + name, # type: str + web_job_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Stop a continuous web job for an app, or a deployment slot. + + Description for Stop a continuous web job for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.stop_continuous_web_job.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + stop_continuous_web_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}/stop'} # type: ignore + + def list_deployments( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DeploymentCollection"] + """List deployments for an app, or a deployment slot. + + Description for List deployments for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DeploymentCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.DeploymentCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DeploymentCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_deployments.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DeploymentCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_deployments.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments'} # type: ignore + + def get_deployment( + self, + resource_group_name, # type: str + name, # type: str + id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Deployment" + """Get a deployment by its ID for an app, or a deployment slot. + + Description for Get a deployment by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param id: Deployment ID. + :type id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Deployment, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.Deployment + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Deployment"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_deployment.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Deployment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_deployment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}'} # type: ignore + + def create_deployment( + self, + resource_group_name, # type: str + name, # type: str + id, # type: str + deployment, # type: "_models.Deployment" + **kwargs # type: Any + ): + # type: (...) -> "_models.Deployment" + """Create a deployment for an app, or a deployment slot. + + Description for Create a deployment for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param id: ID of an existing deployment. + :type id: str + :param deployment: Deployment details. + :type deployment: ~azure.mgmt.web.v2021_02_01.models.Deployment + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Deployment, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.Deployment + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Deployment"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_deployment.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(deployment, 'Deployment') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Deployment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_deployment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}'} # type: ignore + + def delete_deployment( + self, + resource_group_name, # type: str + name, # type: str + id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a deployment by its ID for an app, or a deployment slot. + + Description for Delete a deployment by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param id: Deployment ID. + :type id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_deployment.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_deployment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}'} # type: ignore + + def list_deployment_log( + self, + resource_group_name, # type: str + name, # type: str + id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Deployment" + """List deployment log for specific deployment for an app, or a deployment slot. + + Description for List deployment log for specific deployment for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param id: The ID of a specific deployment. This is the value of the name property in the JSON + response from "GET /api/sites/{siteName}/deployments". + :type id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Deployment, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.Deployment + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Deployment"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_deployment_log.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Deployment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_deployment_log.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}/log'} # type: ignore + + def discover_backup( + self, + resource_group_name, # type: str + name, # type: str + request, # type: "_models.RestoreRequest" + **kwargs # type: Any + ): + # type: (...) -> "_models.RestoreRequest" + """Discovers an existing app backup that can be restored from a blob in Azure storage. Use this to get information about the databases stored in a backup. + + Description for Discovers an existing app backup that can be restored from a blob in Azure + storage. Use this to get information about the databases stored in a backup. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param request: A RestoreRequest object that includes Azure storage URL and blog name for + discovery of backup. + :type request: ~azure.mgmt.web.v2021_02_01.models.RestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RestoreRequest, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.RestoreRequest + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RestoreRequest"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.discover_backup.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'RestoreRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RestoreRequest', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + discover_backup.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/discoverbackup'} # type: ignore + + def list_domain_ownership_identifiers( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.IdentifierCollection"] + """Lists ownership identifiers for domain associated with web app. + + Description for Lists ownership identifiers for domain associated with web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either IdentifierCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.IdentifierCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.IdentifierCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_domain_ownership_identifiers.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('IdentifierCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_domain_ownership_identifiers.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers'} # type: ignore + + def get_domain_ownership_identifier( + self, + resource_group_name, # type: str + name, # type: str + domain_ownership_identifier_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Identifier" + """Get domain ownership identifier for web app. + + Description for Get domain ownership identifier for web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param domain_ownership_identifier_name: Name of domain ownership identifier. + :type domain_ownership_identifier_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Identifier, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.Identifier + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Identifier"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_domain_ownership_identifier.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Identifier', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_domain_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} # type: ignore + + def create_or_update_domain_ownership_identifier( + self, + resource_group_name, # type: str + name, # type: str + domain_ownership_identifier_name, # type: str + domain_ownership_identifier, # type: "_models.Identifier" + **kwargs # type: Any + ): + # type: (...) -> "_models.Identifier" + """Creates a domain ownership identifier for web app, or updates an existing ownership identifier. + + Description for Creates a domain ownership identifier for web app, or updates an existing + ownership identifier. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param domain_ownership_identifier_name: Name of domain ownership identifier. + :type domain_ownership_identifier_name: str + :param domain_ownership_identifier: A JSON representation of the domain ownership properties. + :type domain_ownership_identifier: ~azure.mgmt.web.v2021_02_01.models.Identifier + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Identifier, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.Identifier + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Identifier"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_domain_ownership_identifier.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(domain_ownership_identifier, 'Identifier') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Identifier', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_domain_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} # type: ignore + + def delete_domain_ownership_identifier( + self, + resource_group_name, # type: str + name, # type: str + domain_ownership_identifier_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a domain ownership identifier for a web app. + + Description for Deletes a domain ownership identifier for a web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param domain_ownership_identifier_name: Name of domain ownership identifier. + :type domain_ownership_identifier_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_domain_ownership_identifier.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_domain_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} # type: ignore + + def update_domain_ownership_identifier( + self, + resource_group_name, # type: str + name, # type: str + domain_ownership_identifier_name, # type: str + domain_ownership_identifier, # type: "_models.Identifier" + **kwargs # type: Any + ): + # type: (...) -> "_models.Identifier" + """Creates a domain ownership identifier for web app, or updates an existing ownership identifier. + + Description for Creates a domain ownership identifier for web app, or updates an existing + ownership identifier. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param domain_ownership_identifier_name: Name of domain ownership identifier. + :type domain_ownership_identifier_name: str + :param domain_ownership_identifier: A JSON representation of the domain ownership properties. + :type domain_ownership_identifier: ~azure.mgmt.web.v2021_02_01.models.Identifier + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Identifier, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.Identifier + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Identifier"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_domain_ownership_identifier.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(domain_ownership_identifier, 'Identifier') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Identifier', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_domain_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} # type: ignore + + def get_ms_deploy_status( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.MSDeployStatus" + """Get the status of the last MSDeploy operation. + + Description for Get the status of the last MSDeploy operation. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MSDeployStatus, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.MSDeployStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_ms_deploy_status.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_ms_deploy_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy'} # type: ignore + + def _create_ms_deploy_operation_initial( + self, + resource_group_name, # type: str + name, # type: str + ms_deploy, # type: "_models.MSDeploy" + **kwargs # type: Any + ): + # type: (...) -> "_models.MSDeployStatus" + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_ms_deploy_operation_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(ms_deploy, 'MSDeploy') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_ms_deploy_operation_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy'} # type: ignore + + def begin_create_ms_deploy_operation( + self, + resource_group_name, # type: str + name, # type: str + ms_deploy, # type: "_models.MSDeploy" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.MSDeployStatus"] + """Invoke the MSDeploy web app extension. + + Description for Invoke the MSDeploy web app extension. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param ms_deploy: Details of MSDeploy operation. + :type ms_deploy: ~azure.mgmt.web.v2021_02_01.models.MSDeploy + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either MSDeployStatus or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2021_02_01.models.MSDeployStatus] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployStatus"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_ms_deploy_operation_initial( + resource_group_name=resource_group_name, + name=name, + ms_deploy=ms_deploy, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_ms_deploy_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy'} # type: ignore + + def get_ms_deploy_log( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.MSDeployLog" + """Get the MSDeploy Log for the last MSDeploy operation. + + Description for Get the MSDeploy Log for the last MSDeploy operation. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MSDeployLog, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.MSDeployLog + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployLog"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_ms_deploy_log.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MSDeployLog', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_ms_deploy_log.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy/log'} # type: ignore + + def list_functions( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.FunctionEnvelopeCollection"] + """List the functions for a web site, or a deployment slot. + + Description for List the functions for a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either FunctionEnvelopeCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.FunctionEnvelopeCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionEnvelopeCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_functions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('FunctionEnvelopeCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_functions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions'} # type: ignore + + def get_functions_admin_token( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> str + """Fetch a short lived token that can be exchanged for a master key. + + Description for Fetch a short lived token that can be exchanged for a master key. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: str, or the result of cls(response) + :rtype: str + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[str] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_functions_admin_token.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_functions_admin_token.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/admin/token'} # type: ignore + + def get_function( + self, + resource_group_name, # type: str + name, # type: str + function_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.FunctionEnvelope" + """Get function information by its ID for web site, or a deployment slot. + + Description for Get function information by its ID for web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: Function name. + :type function_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FunctionEnvelope, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.FunctionEnvelope + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionEnvelope"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_function.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FunctionEnvelope', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_function.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}'} # type: ignore + + def _create_function_initial( + self, + resource_group_name, # type: str + name, # type: str + function_name, # type: str + function_envelope, # type: "_models.FunctionEnvelope" + **kwargs # type: Any + ): + # type: (...) -> "_models.FunctionEnvelope" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionEnvelope"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_function_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(function_envelope, 'FunctionEnvelope') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FunctionEnvelope', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_function_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}'} # type: ignore + + def begin_create_function( + self, + resource_group_name, # type: str + name, # type: str + function_name, # type: str + function_envelope, # type: "_models.FunctionEnvelope" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.FunctionEnvelope"] + """Create function for web site, or a deployment slot. + + Description for Create function for web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: Function name. + :type function_name: str + :param function_envelope: Function details. + :type function_envelope: ~azure.mgmt.web.v2021_02_01.models.FunctionEnvelope + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either FunctionEnvelope or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2021_02_01.models.FunctionEnvelope] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionEnvelope"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_function_initial( + resource_group_name=resource_group_name, + name=name, + function_name=function_name, + function_envelope=function_envelope, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('FunctionEnvelope', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_function.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}'} # type: ignore + + def delete_function( + self, + resource_group_name, # type: str + name, # type: str + function_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a function for web site, or a deployment slot. + + Description for Delete a function for web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: Function name. + :type function_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_function.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_function.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}'} # type: ignore + + def create_or_update_function_secret( + self, + resource_group_name, # type: str + name, # type: str + function_name, # type: str + key_name, # type: str + key, # type: "_models.KeyInfo" + **kwargs # type: Any + ): + # type: (...) -> "_models.KeyInfo" + """Add or update a function secret. + + Description for Add or update a function secret. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: The name of the function. + :type function_name: str + :param key_name: The name of the key. + :type key_name: str + :param key: The key to create or update. + :type key: ~azure.mgmt.web.v2021_02_01.models.KeyInfo + :keyword callable cls: A custom type or function that will be passed the direct response + :return: KeyInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.KeyInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.KeyInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_function_secret.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'keyName': self._serialize.url("key_name", key_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(key, 'KeyInfo') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('KeyInfo', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('KeyInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_function_secret.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/keys/{keyName}'} # type: ignore + + def delete_function_secret( + self, + resource_group_name, # type: str + name, # type: str + function_name, # type: str + key_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a function secret. + + Description for Delete a function secret. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: The name of the function. + :type function_name: str + :param key_name: The name of the key. + :type key_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_function_secret.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'keyName': self._serialize.url("key_name", key_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_function_secret.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/keys/{keyName}'} # type: ignore + + def list_function_keys( + self, + resource_group_name, # type: str + name, # type: str + function_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.StringDictionary" + """Get function keys for a function in a web site, or a deployment slot. + + Description for Get function keys for a function in a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: Function name. + :type function_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_function_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_function_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/listkeys'} # type: ignore + + def list_function_secrets( + self, + resource_group_name, # type: str + name, # type: str + function_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.FunctionSecrets" + """Get function secrets for a function in a web site, or a deployment slot. + + Description for Get function secrets for a function in a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: Function name. + :type function_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FunctionSecrets, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.FunctionSecrets + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionSecrets"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_function_secrets.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FunctionSecrets', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_function_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/listsecrets'} # type: ignore + + def list_host_keys( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.HostKeys" + """Get host secrets for a function app. + + Description for Get host secrets for a function app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HostKeys, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.HostKeys + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HostKeys"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_host_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HostKeys', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_host_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/listkeys'} # type: ignore + + def list_sync_status( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """This is to allow calling via powershell and ARM template. + + Description for This is to allow calling via powershell and ARM template. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_sync_status.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + list_sync_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/listsyncstatus'} # type: ignore + + def sync_functions( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Syncs function trigger metadata to the management database. + + Description for Syncs function trigger metadata to the management database. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.sync_functions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + sync_functions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/sync'} # type: ignore + + def create_or_update_host_secret( + self, + resource_group_name, # type: str + name, # type: str + key_type, # type: str + key_name, # type: str + key, # type: "_models.KeyInfo" + **kwargs # type: Any + ): + # type: (...) -> "_models.KeyInfo" + """Add or update a host level secret. + + Description for Add or update a host level secret. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param key_type: The type of host key. + :type key_type: str + :param key_name: The name of the key. + :type key_name: str + :param key: The key to create or update. + :type key: ~azure.mgmt.web.v2021_02_01.models.KeyInfo + :keyword callable cls: A custom type or function that will be passed the direct response + :return: KeyInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.KeyInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.KeyInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_host_secret.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'keyType': self._serialize.url("key_type", key_type, 'str'), + 'keyName': self._serialize.url("key_name", key_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(key, 'KeyInfo') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('KeyInfo', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('KeyInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_host_secret.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/{keyType}/{keyName}'} # type: ignore + + def delete_host_secret( + self, + resource_group_name, # type: str + name, # type: str + key_type, # type: str + key_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a host level secret. + + Description for Delete a host level secret. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param key_type: The type of host key. + :type key_type: str + :param key_name: The name of the key. + :type key_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_host_secret.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'keyType': self._serialize.url("key_type", key_type, 'str'), + 'keyName': self._serialize.url("key_name", key_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_host_secret.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/{keyType}/{keyName}'} # type: ignore + + def list_host_name_bindings( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.HostNameBindingCollection"] + """Get hostname bindings for an app or a deployment slot. + + Description for Get hostname bindings for an app or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either HostNameBindingCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.HostNameBindingCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HostNameBindingCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_host_name_bindings.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('HostNameBindingCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_host_name_bindings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings'} # type: ignore + + def get_host_name_binding( + self, + resource_group_name, # type: str + name, # type: str + host_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.HostNameBinding" + """Get the named hostname binding for an app (or deployment slot, if specified). + + Description for Get the named hostname binding for an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param host_name: Hostname in the hostname binding. + :type host_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HostNameBinding, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.HostNameBinding + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HostNameBinding"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_host_name_binding.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HostNameBinding', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_host_name_binding.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}'} # type: ignore + + def create_or_update_host_name_binding( + self, + resource_group_name, # type: str + name, # type: str + host_name, # type: str + host_name_binding, # type: "_models.HostNameBinding" + **kwargs # type: Any + ): + # type: (...) -> "_models.HostNameBinding" + """Creates a hostname binding for an app. + + Description for Creates a hostname binding for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param host_name: Hostname in the hostname binding. + :type host_name: str + :param host_name_binding: Binding details. This is the JSON representation of a HostNameBinding + object. + :type host_name_binding: ~azure.mgmt.web.v2021_02_01.models.HostNameBinding + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HostNameBinding, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.HostNameBinding + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HostNameBinding"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_host_name_binding.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(host_name_binding, 'HostNameBinding') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HostNameBinding', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_host_name_binding.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}'} # type: ignore + + def delete_host_name_binding( + self, + resource_group_name, # type: str + name, # type: str + host_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a hostname binding for an app. + + Description for Deletes a hostname binding for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param host_name: Hostname in the hostname binding. + :type host_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_host_name_binding.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_host_name_binding.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}'} # type: ignore + + def get_hybrid_connection( + self, + resource_group_name, # type: str + name, # type: str + namespace_name, # type: str + relay_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.HybridConnection" + """Retrieves a specific Service Bus Hybrid Connection used by this Web App. + + Description for Retrieves a specific Service Bus Hybrid Connection used by this Web App. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param namespace_name: The namespace for this hybrid connection. + :type namespace_name: str + :param relay_name: The relay name for this hybrid connection. + :type relay_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnection, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.HybridConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_hybrid_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_hybrid_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} # type: ignore + + def create_or_update_hybrid_connection( + self, + resource_group_name, # type: str + name, # type: str + namespace_name, # type: str + relay_name, # type: str + connection_envelope, # type: "_models.HybridConnection" + **kwargs # type: Any + ): + # type: (...) -> "_models.HybridConnection" + """Creates a new Hybrid Connection using a Service Bus relay. + + Description for Creates a new Hybrid Connection using a Service Bus relay. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param namespace_name: The namespace for this hybrid connection. + :type namespace_name: str + :param relay_name: The relay name for this hybrid connection. + :type relay_name: str + :param connection_envelope: The details of the hybrid connection. + :type connection_envelope: ~azure.mgmt.web.v2021_02_01.models.HybridConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnection, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.HybridConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_hybrid_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'HybridConnection') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_hybrid_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} # type: ignore + + def delete_hybrid_connection( + self, + resource_group_name, # type: str + name, # type: str + namespace_name, # type: str + relay_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Removes a Hybrid Connection from this site. + + Description for Removes a Hybrid Connection from this site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param namespace_name: The namespace for this hybrid connection. + :type namespace_name: str + :param relay_name: The relay name for this hybrid connection. + :type relay_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_hybrid_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_hybrid_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} # type: ignore + + def update_hybrid_connection( + self, + resource_group_name, # type: str + name, # type: str + namespace_name, # type: str + relay_name, # type: str + connection_envelope, # type: "_models.HybridConnection" + **kwargs # type: Any + ): + # type: (...) -> "_models.HybridConnection" + """Creates a new Hybrid Connection using a Service Bus relay. + + Description for Creates a new Hybrid Connection using a Service Bus relay. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param namespace_name: The namespace for this hybrid connection. + :type namespace_name: str + :param relay_name: The relay name for this hybrid connection. + :type relay_name: str + :param connection_envelope: The details of the hybrid connection. + :type connection_envelope: ~azure.mgmt.web.v2021_02_01.models.HybridConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnection, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.HybridConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_hybrid_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'HybridConnection') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_hybrid_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} # type: ignore + + def list_hybrid_connections( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.HybridConnection" + """Retrieves all Service Bus Hybrid Connections used by this Web App. + + Description for Retrieves all Service Bus Hybrid Connections used by this Web App. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnection, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.HybridConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_hybrid_connections.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_hybrid_connections.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionRelays'} # type: ignore + + def list_relay_service_connections( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.RelayServiceConnectionEntity" + """Gets hybrid connections configured for an app (or deployment slot, if specified). + + Description for Gets hybrid connections configured for an app (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RelayServiceConnectionEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.RelayServiceConnectionEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RelayServiceConnectionEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_relay_service_connections.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RelayServiceConnectionEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_relay_service_connections.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection'} # type: ignore + + def get_relay_service_connection( + self, + resource_group_name, # type: str + name, # type: str + entity_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.RelayServiceConnectionEntity" + """Gets a hybrid connection configuration by its name. + + Description for Gets a hybrid connection configuration by its name. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param entity_name: Name of the hybrid connection. + :type entity_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RelayServiceConnectionEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.RelayServiceConnectionEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RelayServiceConnectionEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_relay_service_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'entityName': self._serialize.url("entity_name", entity_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RelayServiceConnectionEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_relay_service_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}'} # type: ignore + + def create_or_update_relay_service_connection( + self, + resource_group_name, # type: str + name, # type: str + entity_name, # type: str + connection_envelope, # type: "_models.RelayServiceConnectionEntity" + **kwargs # type: Any + ): + # type: (...) -> "_models.RelayServiceConnectionEntity" + """Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). + + Description for Creates a new hybrid connection configuration (PUT), or updates an existing one + (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param entity_name: Name of the hybrid connection configuration. + :type entity_name: str + :param connection_envelope: Details of the hybrid connection configuration. + :type connection_envelope: ~azure.mgmt.web.v2021_02_01.models.RelayServiceConnectionEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RelayServiceConnectionEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.RelayServiceConnectionEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RelayServiceConnectionEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_relay_service_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'entityName': self._serialize.url("entity_name", entity_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'RelayServiceConnectionEntity') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RelayServiceConnectionEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_relay_service_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}'} # type: ignore + + def delete_relay_service_connection( + self, + resource_group_name, # type: str + name, # type: str + entity_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a relay service connection by its name. + + Description for Deletes a relay service connection by its name. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param entity_name: Name of the hybrid connection configuration. + :type entity_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_relay_service_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'entityName': self._serialize.url("entity_name", entity_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_relay_service_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}'} # type: ignore + + def update_relay_service_connection( + self, + resource_group_name, # type: str + name, # type: str + entity_name, # type: str + connection_envelope, # type: "_models.RelayServiceConnectionEntity" + **kwargs # type: Any + ): + # type: (...) -> "_models.RelayServiceConnectionEntity" + """Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). + + Description for Creates a new hybrid connection configuration (PUT), or updates an existing one + (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param entity_name: Name of the hybrid connection configuration. + :type entity_name: str + :param connection_envelope: Details of the hybrid connection configuration. + :type connection_envelope: ~azure.mgmt.web.v2021_02_01.models.RelayServiceConnectionEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RelayServiceConnectionEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.RelayServiceConnectionEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RelayServiceConnectionEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_relay_service_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'entityName': self._serialize.url("entity_name", entity_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'RelayServiceConnectionEntity') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RelayServiceConnectionEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_relay_service_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}'} # type: ignore + + def list_instance_identifiers( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.WebAppInstanceStatusCollection"] + """Gets all scale-out instances of an app. + + Description for Gets all scale-out instances of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebAppInstanceStatusCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.WebAppInstanceStatusCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppInstanceStatusCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_instance_identifiers.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppInstanceStatusCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_instance_identifiers.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances'} # type: ignore + + def get_instance_info( + self, + resource_group_name, # type: str + name, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.WebSiteInstanceStatus" + """Gets all scale-out instances of an app. + + Description for Gets all scale-out instances of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param instance_id: + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WebSiteInstanceStatus, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.WebSiteInstanceStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebSiteInstanceStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_info.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('WebSiteInstanceStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_info.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}'} # type: ignore + + def get_instance_ms_deploy_status( + self, + resource_group_name, # type: str + name, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.MSDeployStatus" + """Get the status of the last MSDeploy operation. + + Description for Get the status of the last MSDeploy operation. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param instance_id: ID of web app instance. + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MSDeployStatus, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.MSDeployStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_ms_deploy_status.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_ms_deploy_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy'} # type: ignore + + def _create_instance_ms_deploy_operation_initial( + self, + resource_group_name, # type: str + name, # type: str + instance_id, # type: str + ms_deploy, # type: "_models.MSDeploy" + **kwargs # type: Any + ): + # type: (...) -> "_models.MSDeployStatus" + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_instance_ms_deploy_operation_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(ms_deploy, 'MSDeploy') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_instance_ms_deploy_operation_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy'} # type: ignore + + def begin_create_instance_ms_deploy_operation( + self, + resource_group_name, # type: str + name, # type: str + instance_id, # type: str + ms_deploy, # type: "_models.MSDeploy" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.MSDeployStatus"] + """Invoke the MSDeploy web app extension. + + Description for Invoke the MSDeploy web app extension. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param instance_id: ID of web app instance. + :type instance_id: str + :param ms_deploy: Details of MSDeploy operation. + :type ms_deploy: ~azure.mgmt.web.v2021_02_01.models.MSDeploy + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either MSDeployStatus or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2021_02_01.models.MSDeployStatus] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployStatus"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_instance_ms_deploy_operation_initial( + resource_group_name=resource_group_name, + name=name, + instance_id=instance_id, + ms_deploy=ms_deploy, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_instance_ms_deploy_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy'} # type: ignore + + def get_instance_ms_deploy_log( + self, + resource_group_name, # type: str + name, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.MSDeployLog" + """Get the MSDeploy Log for the last MSDeploy operation. + + Description for Get the MSDeploy Log for the last MSDeploy operation. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param instance_id: ID of web app instance. + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MSDeployLog, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.MSDeployLog + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployLog"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_ms_deploy_log.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MSDeployLog', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_ms_deploy_log.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy/log'} # type: ignore + + def list_instance_processes( + self, + resource_group_name, # type: str + name, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ProcessInfoCollection"] + """Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. + + Description for Get list of processes for a web site, or a deployment slot, or for a specific + scaled-out instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessInfoCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.ProcessInfoCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_instance_processes.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_instance_processes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes'} # type: ignore + + def get_instance_process( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ProcessInfo" + """Get process information by its ID for a specific scaled-out instance in a web site. + + Description for Get process information by its ID for a specific scaled-out instance in a web + site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProcessInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.ProcessInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_process.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ProcessInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_process.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}'} # type: ignore + + def delete_instance_process( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web site. + + Description for Terminate a process by its ID for a web site, or a deployment slot, or specific + scaled-out instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_instance_process.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_instance_process.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}'} # type: ignore + + def get_instance_process_dump( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> IO + """Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. + + Description for Get a memory dump of a process by its ID for a specific scaled-out instance in + a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[IO] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_process_dump.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_process_dump.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/dump'} # type: ignore + + def list_instance_process_modules( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ProcessModuleInfoCollection"] + """List module information for a process by its ID for a specific scaled-out instance in a web site. + + Description for List module information for a process by its ID for a specific scaled-out + instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessModuleInfoCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.ProcessModuleInfoCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessModuleInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_instance_process_modules.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessModuleInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_instance_process_modules.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/modules'} # type: ignore + + def get_instance_process_module( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + base_address, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ProcessModuleInfo" + """Get process information by its ID for a specific scaled-out instance in a web site. + + Description for Get process information by its ID for a specific scaled-out instance in a web + site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param base_address: Module base address. + :type base_address: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProcessModuleInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.ProcessModuleInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessModuleInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_process_module.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'baseAddress': self._serialize.url("base_address", base_address, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ProcessModuleInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_process_module.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/modules/{baseAddress}'} # type: ignore + + def list_instance_process_threads( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ProcessThreadInfoCollection"] + """List the threads in a process by its ID for a specific scaled-out instance in a web site. + + Description for List the threads in a process by its ID for a specific scaled-out instance in a + web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessThreadInfoCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.ProcessThreadInfoCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessThreadInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_instance_process_threads.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessThreadInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_instance_process_threads.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/threads'} # type: ignore + + def is_cloneable( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteCloneability" + """Shows whether an app can be cloned to another resource group or subscription. + + Description for Shows whether an app can be cloned to another resource group or subscription. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteCloneability, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SiteCloneability + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteCloneability"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.is_cloneable.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteCloneability', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + is_cloneable.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/iscloneable'} # type: ignore + + def list_site_backups( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.BackupItemCollection"] + """Gets existing backups of an app. + + Description for Gets existing backups of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either BackupItemCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.BackupItemCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupItemCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_backups.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('BackupItemCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_site_backups.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/listbackups'} # type: ignore + + def list_sync_function_triggers( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.FunctionSecrets" + """This is to allow calling via powershell and ARM template. + + Description for This is to allow calling via powershell and ARM template. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FunctionSecrets, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.FunctionSecrets + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionSecrets"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_sync_function_triggers.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FunctionSecrets', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_sync_function_triggers.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/listsyncfunctiontriggerstatus'} # type: ignore + + def _migrate_storage_initial( + self, + subscription_name, # type: str + resource_group_name, # type: str + name, # type: str + migration_options, # type: "_models.StorageMigrationOptions" + **kwargs # type: Any + ): + # type: (...) -> "_models.StorageMigrationResponse" + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageMigrationResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._migrate_storage_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['subscriptionName'] = self._serialize.query("subscription_name", subscription_name, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(migration_options, 'StorageMigrationOptions') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StorageMigrationResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _migrate_storage_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migrate'} # type: ignore + + def begin_migrate_storage( + self, + subscription_name, # type: str + resource_group_name, # type: str + name, # type: str + migration_options, # type: "_models.StorageMigrationOptions" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.StorageMigrationResponse"] + """Restores a web app. + + Description for Restores a web app. + + :param subscription_name: Azure subscription. + :type subscription_name: str + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param migration_options: Migration migrationOptions. + :type migration_options: ~azure.mgmt.web.v2021_02_01.models.StorageMigrationOptions + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either StorageMigrationResponse or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2021_02_01.models.StorageMigrationResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageMigrationResponse"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._migrate_storage_initial( + subscription_name=subscription_name, + resource_group_name=resource_group_name, + name=name, + migration_options=migration_options, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('StorageMigrationResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_migrate_storage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migrate'} # type: ignore + + def _migrate_my_sql_initial( + self, + resource_group_name, # type: str + name, # type: str + migration_request_envelope, # type: "_models.MigrateMySqlRequest" + **kwargs # type: Any + ): + # type: (...) -> "_models.Operation" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Operation"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._migrate_my_sql_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(migration_request_envelope, 'MigrateMySqlRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Operation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _migrate_my_sql_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migratemysql'} # type: ignore + + def begin_migrate_my_sql( + self, + resource_group_name, # type: str + name, # type: str + migration_request_envelope, # type: "_models.MigrateMySqlRequest" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.Operation"] + """Migrates a local (in-app) MySql database to a remote MySql database. + + Description for Migrates a local (in-app) MySql database to a remote MySql database. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param migration_request_envelope: MySql migration options. + :type migration_request_envelope: ~azure.mgmt.web.v2021_02_01.models.MigrateMySqlRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either Operation or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2021_02_01.models.Operation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Operation"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._migrate_my_sql_initial( + resource_group_name=resource_group_name, + name=name, + migration_request_envelope=migration_request_envelope, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Operation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_migrate_my_sql.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migratemysql'} # type: ignore + + def get_migrate_my_sql_status( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.MigrateMySqlStatus" + """Returns the status of MySql in app migration, if one is active, and whether or not MySql in app is enabled. + + Description for Returns the status of MySql in app migration, if one is active, and whether or + not MySql in app is enabled. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MigrateMySqlStatus, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.MigrateMySqlStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MigrateMySqlStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_migrate_my_sql_status.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MigrateMySqlStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_migrate_my_sql_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migratemysql/status'} # type: ignore + + def get_swift_virtual_network_connection( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SwiftVirtualNetwork" + """Gets a Swift Virtual Network connection. + + Description for Gets a Swift Virtual Network connection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SwiftVirtualNetwork, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SwiftVirtualNetwork + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SwiftVirtualNetwork"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_swift_virtual_network_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SwiftVirtualNetwork', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_swift_virtual_network_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork'} # type: ignore + + def create_or_update_swift_virtual_network_connection_with_check( + self, + resource_group_name, # type: str + name, # type: str + connection_envelope, # type: "_models.SwiftVirtualNetwork" + **kwargs # type: Any + ): + # type: (...) -> "_models.SwiftVirtualNetwork" + """Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet has already been delegated, and is not + in use by another App Service Plan other than the one this App is in. + + Description for Integrates this Web App with a Virtual Network. This requires that 1) + "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet + has already been delegated, and is not + in use by another App Service Plan other than the one this App is in. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param connection_envelope: Properties of the Virtual Network connection. See example. + :type connection_envelope: ~azure.mgmt.web.v2021_02_01.models.SwiftVirtualNetwork + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SwiftVirtualNetwork, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SwiftVirtualNetwork + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SwiftVirtualNetwork"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_swift_virtual_network_connection_with_check.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'SwiftVirtualNetwork') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SwiftVirtualNetwork', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_swift_virtual_network_connection_with_check.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork'} # type: ignore + + def delete_swift_virtual_network( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a Swift Virtual Network connection from an app (or deployment slot). + + Description for Deletes a Swift Virtual Network connection from an app (or deployment slot). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_swift_virtual_network.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_swift_virtual_network.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork'} # type: ignore + + def update_swift_virtual_network_connection_with_check( + self, + resource_group_name, # type: str + name, # type: str + connection_envelope, # type: "_models.SwiftVirtualNetwork" + **kwargs # type: Any + ): + # type: (...) -> "_models.SwiftVirtualNetwork" + """Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet has already been delegated, and is not + in use by another App Service Plan other than the one this App is in. + + Description for Integrates this Web App with a Virtual Network. This requires that 1) + "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet + has already been delegated, and is not + in use by another App Service Plan other than the one this App is in. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param connection_envelope: Properties of the Virtual Network connection. See example. + :type connection_envelope: ~azure.mgmt.web.v2021_02_01.models.SwiftVirtualNetwork + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SwiftVirtualNetwork, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SwiftVirtualNetwork + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SwiftVirtualNetwork"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_swift_virtual_network_connection_with_check.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'SwiftVirtualNetwork') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SwiftVirtualNetwork', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_swift_virtual_network_connection_with_check.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork'} # type: ignore + + def list_network_features( + self, + resource_group_name, # type: str + name, # type: str + view, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.NetworkFeatures" + """Gets all network features used by the app (or deployment slot, if specified). + + Description for Gets all network features used by the app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param view: The type of view. Only "summary" is supported at this time. + :type view: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkFeatures, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.NetworkFeatures + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFeatures"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_network_features.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'view': self._serialize.url("view", view, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkFeatures', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_network_features.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkFeatures/{view}'} # type: ignore + + def get_network_trace_operation( + self, + resource_group_name, # type: str + name, # type: str + operation_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> List["_models.NetworkTrace"] + """Gets a named operation for a network trace capturing (or deployment slot, if specified). + + Description for Gets a named operation for a network trace capturing (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param operation_id: GUID of the operation. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of NetworkTrace, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2021_02_01.models.NetworkTrace] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_network_trace_operation.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_network_trace_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/operationresults/{operationId}'} # type: ignore + + def start_web_site_network_trace( + self, + resource_group_name, # type: str + name, # type: str + duration_in_seconds=None, # type: Optional[int] + max_frame_length=None, # type: Optional[int] + sas_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> str + """Start capturing network packets for the site (To be deprecated). + + Description for Start capturing network packets for the site (To be deprecated). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param duration_in_seconds: The duration to keep capturing in seconds. + :type duration_in_seconds: int + :param max_frame_length: The maximum frame length in bytes (Optional). + :type max_frame_length: int + :param sas_url: The Blob URL to store capture file. + :type sas_url: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: str, or the result of cls(response) + :rtype: str + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[str] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.start_web_site_network_trace.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if duration_in_seconds is not None: + query_parameters['durationInSeconds'] = self._serialize.query("duration_in_seconds", duration_in_seconds, 'int') + if max_frame_length is not None: + query_parameters['maxFrameLength'] = self._serialize.query("max_frame_length", max_frame_length, 'int') + if sas_url is not None: + query_parameters['sasUrl'] = self._serialize.query("sas_url", sas_url, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + start_web_site_network_trace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/start'} # type: ignore + + def _start_web_site_network_trace_operation_initial( + self, + resource_group_name, # type: str + name, # type: str + duration_in_seconds=None, # type: Optional[int] + max_frame_length=None, # type: Optional[int] + sas_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> List["_models.NetworkTrace"] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._start_web_site_network_trace_operation_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if duration_in_seconds is not None: + query_parameters['durationInSeconds'] = self._serialize.query("duration_in_seconds", duration_in_seconds, 'int') + if max_frame_length is not None: + query_parameters['maxFrameLength'] = self._serialize.query("max_frame_length", max_frame_length, 'int') + if sas_url is not None: + query_parameters['sasUrl'] = self._serialize.query("sas_url", sas_url, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _start_web_site_network_trace_operation_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/startOperation'} # type: ignore + + def begin_start_web_site_network_trace_operation( + self, + resource_group_name, # type: str + name, # type: str + duration_in_seconds=None, # type: Optional[int] + max_frame_length=None, # type: Optional[int] + sas_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> LROPoller[List["_models.NetworkTrace"]] + """Start capturing network packets for the site. + + Description for Start capturing network packets for the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param duration_in_seconds: The duration to keep capturing in seconds. + :type duration_in_seconds: int + :param max_frame_length: The maximum frame length in bytes (Optional). + :type max_frame_length: int + :param sas_url: The Blob URL to store capture file. + :type sas_url: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either list of NetworkTrace or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[list[~azure.mgmt.web.v2021_02_01.models.NetworkTrace]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._start_web_site_network_trace_operation_initial( + resource_group_name=resource_group_name, + name=name, + duration_in_seconds=duration_in_seconds, + max_frame_length=max_frame_length, + sas_url=sas_url, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start_web_site_network_trace_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/startOperation'} # type: ignore + + def stop_web_site_network_trace( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Stop ongoing capturing network packets for the site. + + Description for Stop ongoing capturing network packets for the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.stop_web_site_network_trace.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + stop_web_site_network_trace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/stop'} # type: ignore + + def get_network_traces( + self, + resource_group_name, # type: str + name, # type: str + operation_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> List["_models.NetworkTrace"] + """Gets a named operation for a network trace capturing (or deployment slot, if specified). + + Description for Gets a named operation for a network trace capturing (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param operation_id: GUID of the operation. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of NetworkTrace, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2021_02_01.models.NetworkTrace] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_network_traces.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_network_traces.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/{operationId}'} # type: ignore + + def get_network_trace_operation_v2( + self, + resource_group_name, # type: str + name, # type: str + operation_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> List["_models.NetworkTrace"] + """Gets a named operation for a network trace capturing (or deployment slot, if specified). + + Description for Gets a named operation for a network trace capturing (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param operation_id: GUID of the operation. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of NetworkTrace, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2021_02_01.models.NetworkTrace] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_network_trace_operation_v2.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_network_trace_operation_v2.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTraces/current/operationresults/{operationId}'} # type: ignore + + def get_network_traces_v2( + self, + resource_group_name, # type: str + name, # type: str + operation_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> List["_models.NetworkTrace"] + """Gets a named operation for a network trace capturing (or deployment slot, if specified). + + Description for Gets a named operation for a network trace capturing (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param operation_id: GUID of the operation. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of NetworkTrace, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2021_02_01.models.NetworkTrace] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_network_traces_v2.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_network_traces_v2.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTraces/{operationId}'} # type: ignore + + def generate_new_site_publishing_password( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Generates a new publishing password for an app (or deployment slot, if specified). + + Description for Generates a new publishing password for an app (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.generate_new_site_publishing_password.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + generate_new_site_publishing_password.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/newpassword'} # type: ignore + + def list_perf_mon_counters( + self, + resource_group_name, # type: str + name, # type: str + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.PerfMonCounterCollection"] + """Gets perfmon counters for web app. + + Description for Gets perfmon counters for web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param filter: Return only usages/metrics specified in the filter. Filter conforms to odata + syntax. Example: $filter=(startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z + and timeGrain eq duration'[Hour|Minute|Day]'. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PerfMonCounterCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.PerfMonCounterCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PerfMonCounterCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_perf_mon_counters.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('PerfMonCounterCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_perf_mon_counters.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/perfcounters'} # type: ignore + + def get_site_php_error_log_flag( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SitePhpErrorLogFlag" + """Gets web app's event logs. + + Description for Gets web app's event logs. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SitePhpErrorLogFlag, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SitePhpErrorLogFlag + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SitePhpErrorLogFlag"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_site_php_error_log_flag.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SitePhpErrorLogFlag', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_php_error_log_flag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/phplogging'} # type: ignore + + def list_premier_add_ons( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PremierAddOn" + """Gets the premier add-ons of an app. + + Description for Gets the premier add-ons of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PremierAddOn, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.PremierAddOn + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PremierAddOn"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_premier_add_ons.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PremierAddOn', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_premier_add_ons.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons'} # type: ignore + + def get_premier_add_on( + self, + resource_group_name, # type: str + name, # type: str + premier_add_on_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PremierAddOn" + """Gets a named add-on of an app. + + Description for Gets a named add-on of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param premier_add_on_name: Add-on name. + :type premier_add_on_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PremierAddOn, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.PremierAddOn + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PremierAddOn"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_premier_add_on.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PremierAddOn', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_premier_add_on.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}'} # type: ignore + + def add_premier_add_on( + self, + resource_group_name, # type: str + name, # type: str + premier_add_on_name, # type: str + premier_add_on, # type: "_models.PremierAddOn" + **kwargs # type: Any + ): + # type: (...) -> "_models.PremierAddOn" + """Updates a named add-on of an app. + + Description for Updates a named add-on of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param premier_add_on_name: Add-on name. + :type premier_add_on_name: str + :param premier_add_on: A JSON representation of the edited premier add-on. + :type premier_add_on: ~azure.mgmt.web.v2021_02_01.models.PremierAddOn + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PremierAddOn, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.PremierAddOn + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PremierAddOn"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.add_premier_add_on.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(premier_add_on, 'PremierAddOn') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PremierAddOn', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + add_premier_add_on.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}'} # type: ignore + + def delete_premier_add_on( + self, + resource_group_name, # type: str + name, # type: str + premier_add_on_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a premier add-on from an app. + + Description for Delete a premier add-on from an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param premier_add_on_name: Add-on name. + :type premier_add_on_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_premier_add_on.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_premier_add_on.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}'} # type: ignore + + def update_premier_add_on( + self, + resource_group_name, # type: str + name, # type: str + premier_add_on_name, # type: str + premier_add_on, # type: "_models.PremierAddOnPatchResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.PremierAddOn" + """Updates a named add-on of an app. + + Description for Updates a named add-on of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param premier_add_on_name: Add-on name. + :type premier_add_on_name: str + :param premier_add_on: A JSON representation of the edited premier add-on. + :type premier_add_on: ~azure.mgmt.web.v2021_02_01.models.PremierAddOnPatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PremierAddOn, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.PremierAddOn + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PremierAddOn"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_premier_add_on.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(premier_add_on, 'PremierAddOnPatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PremierAddOn', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_premier_add_on.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}'} # type: ignore + + def get_private_access( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateAccess" + """Gets data around private site access enablement and authorized Virtual Networks that can access the site. + + Description for Gets data around private site access enablement and authorized Virtual Networks + that can access the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateAccess, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.PrivateAccess + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateAccess"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_private_access.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateAccess', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_private_access.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateAccess/virtualNetworks'} # type: ignore + + def put_private_access_vnet( + self, + resource_group_name, # type: str + name, # type: str + access, # type: "_models.PrivateAccess" + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateAccess" + """Sets data around private site access enablement and authorized Virtual Networks that can access the site. + + Description for Sets data around private site access enablement and authorized Virtual Networks + that can access the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param access: The information for the private access. + :type access: ~azure.mgmt.web.v2021_02_01.models.PrivateAccess + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateAccess, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.PrivateAccess + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateAccess"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.put_private_access_vnet.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(access, 'PrivateAccess') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateAccess', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + put_private_access_vnet.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateAccess/virtualNetworks'} # type: ignore + + def get_private_endpoint_connection_list( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.PrivateEndpointConnectionCollection"] + """Gets the list of private endpoint connections associated with a site. + + Description for Gets the list of private endpoint connections associated with a site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the site. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PrivateEndpointConnectionCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.PrivateEndpointConnectionCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_private_endpoint_connection_list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('PrivateEndpointConnectionCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + get_private_endpoint_connection_list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections'} # type: ignore + + def get_private_endpoint_connection( + self, + resource_group_name, # type: str + name, # type: str + private_endpoint_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.RemotePrivateEndpointConnectionARMResource" + """Gets a private endpoint connection. + + Description for Gets a private endpoint connection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the site. + :type name: str + :param private_endpoint_connection_name: Name of the private endpoint connection. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RemotePrivateEndpointConnectionARMResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.RemotePrivateEndpointConnectionARMResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RemotePrivateEndpointConnectionARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_private_endpoint_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RemotePrivateEndpointConnectionARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_private_endpoint_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def _approve_or_reject_private_endpoint_connection_initial( + self, + resource_group_name, # type: str + name, # type: str + private_endpoint_connection_name, # type: str + private_endpoint_wrapper, # type: "_models.PrivateLinkConnectionApprovalRequestResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.RemotePrivateEndpointConnectionARMResource" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RemotePrivateEndpointConnectionARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._approve_or_reject_private_endpoint_connection_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(private_endpoint_wrapper, 'PrivateLinkConnectionApprovalRequestResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('RemotePrivateEndpointConnectionARMResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('RemotePrivateEndpointConnectionARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _approve_or_reject_private_endpoint_connection_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def begin_approve_or_reject_private_endpoint_connection( + self, + resource_group_name, # type: str + name, # type: str + private_endpoint_connection_name, # type: str + private_endpoint_wrapper, # type: "_models.PrivateLinkConnectionApprovalRequestResource" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.RemotePrivateEndpointConnectionARMResource"] + """Approves or rejects a private endpoint connection. + + Description for Approves or rejects a private endpoint connection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the site. + :type name: str + :param private_endpoint_connection_name: + :type private_endpoint_connection_name: str + :param private_endpoint_wrapper: + :type private_endpoint_wrapper: ~azure.mgmt.web.v2021_02_01.models.PrivateLinkConnectionApprovalRequestResource + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either RemotePrivateEndpointConnectionARMResource or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2021_02_01.models.RemotePrivateEndpointConnectionARMResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RemotePrivateEndpointConnectionARMResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._approve_or_reject_private_endpoint_connection_initial( + resource_group_name=resource_group_name, + name=name, + private_endpoint_connection_name=private_endpoint_connection_name, + private_endpoint_wrapper=private_endpoint_wrapper, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('RemotePrivateEndpointConnectionARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_approve_or_reject_private_endpoint_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def _delete_private_endpoint_connection_initial( + self, + resource_group_name, # type: str + name, # type: str + private_endpoint_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Any + cls = kwargs.pop('cls', None) # type: ClsType[Any] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._delete_private_endpoint_connection_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('object', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('object', pipeline_response) + + if response.status_code == 204: + deserialized = self._deserialize('object', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _delete_private_endpoint_connection_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def begin_delete_private_endpoint_connection( + self, + resource_group_name, # type: str + name, # type: str + private_endpoint_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[Any] + """Deletes a private endpoint connection. + + Description for Deletes a private endpoint connection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the site. + :type name: str + :param private_endpoint_connection_name: + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either any or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[any] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[Any] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_private_endpoint_connection_initial( + resource_group_name=resource_group_name, + name=name, + private_endpoint_connection_name=private_endpoint_connection_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('object', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete_private_endpoint_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def get_private_link_resources( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateLinkResourcesWrapper" + """Gets the private link resources. + + Description for Gets the private link resources. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the site. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkResourcesWrapper, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.PrivateLinkResourcesWrapper + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourcesWrapper"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_private_link_resources.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateLinkResourcesWrapper', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_private_link_resources.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateLinkResources'} # type: ignore + + def list_processes( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ProcessInfoCollection"] + """Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. + + Description for Get list of processes for a web site, or a deployment slot, or for a specific + scaled-out instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessInfoCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.ProcessInfoCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_processes.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_processes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes'} # type: ignore + + def get_process( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ProcessInfo" + """Get process information by its ID for a specific scaled-out instance in a web site. + + Description for Get process information by its ID for a specific scaled-out instance in a web + site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProcessInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.ProcessInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_process.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ProcessInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_process.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}'} # type: ignore + + def delete_process( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web site. + + Description for Terminate a process by its ID for a web site, or a deployment slot, or specific + scaled-out instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_process.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_process.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}'} # type: ignore + + def get_process_dump( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> IO + """Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. + + Description for Get a memory dump of a process by its ID for a specific scaled-out instance in + a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[IO] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_process_dump.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_process_dump.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/dump'} # type: ignore + + def list_process_modules( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ProcessModuleInfoCollection"] + """List module information for a process by its ID for a specific scaled-out instance in a web site. + + Description for List module information for a process by its ID for a specific scaled-out + instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessModuleInfoCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.ProcessModuleInfoCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessModuleInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_process_modules.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessModuleInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_process_modules.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/modules'} # type: ignore + + def get_process_module( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + base_address, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ProcessModuleInfo" + """Get process information by its ID for a specific scaled-out instance in a web site. + + Description for Get process information by its ID for a specific scaled-out instance in a web + site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param base_address: Module base address. + :type base_address: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProcessModuleInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.ProcessModuleInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessModuleInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_process_module.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'baseAddress': self._serialize.url("base_address", base_address, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ProcessModuleInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_process_module.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/modules/{baseAddress}'} # type: ignore + + def list_process_threads( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ProcessThreadInfoCollection"] + """List the threads in a process by its ID for a specific scaled-out instance in a web site. + + Description for List the threads in a process by its ID for a specific scaled-out instance in a + web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessThreadInfoCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.ProcessThreadInfoCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessThreadInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_process_threads.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessThreadInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_process_threads.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/threads'} # type: ignore + + def list_public_certificates( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.PublicCertificateCollection"] + """Get public certificates for an app or a deployment slot. + + Description for Get public certificates for an app or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PublicCertificateCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.PublicCertificateCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicCertificateCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_public_certificates.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('PublicCertificateCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_public_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates'} # type: ignore + + def get_public_certificate( + self, + resource_group_name, # type: str + name, # type: str + public_certificate_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PublicCertificate" + """Get the named public certificate for an app (or deployment slot, if specified). + + Description for Get the named public certificate for an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param public_certificate_name: Public certificate name. + :type public_certificate_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PublicCertificate, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.PublicCertificate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicCertificate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_public_certificate.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'publicCertificateName': self._serialize.url("public_certificate_name", public_certificate_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PublicCertificate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_public_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}'} # type: ignore + + def create_or_update_public_certificate( + self, + resource_group_name, # type: str + name, # type: str + public_certificate_name, # type: str + public_certificate, # type: "_models.PublicCertificate" + **kwargs # type: Any + ): + # type: (...) -> "_models.PublicCertificate" + """Creates a hostname binding for an app. + + Description for Creates a hostname binding for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param public_certificate_name: Public certificate name. + :type public_certificate_name: str + :param public_certificate: Public certificate details. This is the JSON representation of a + PublicCertificate object. + :type public_certificate: ~azure.mgmt.web.v2021_02_01.models.PublicCertificate + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PublicCertificate, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.PublicCertificate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicCertificate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_public_certificate.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'publicCertificateName': self._serialize.url("public_certificate_name", public_certificate_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(public_certificate, 'PublicCertificate') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PublicCertificate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_public_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}'} # type: ignore + + def delete_public_certificate( + self, + resource_group_name, # type: str + name, # type: str + public_certificate_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a hostname binding for an app. + + Description for Deletes a hostname binding for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param public_certificate_name: Public certificate name. + :type public_certificate_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_public_certificate.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'publicCertificateName': self._serialize.url("public_certificate_name", public_certificate_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_public_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}'} # type: ignore + + def list_publishing_profile_xml_with_secrets( + self, + resource_group_name, # type: str + name, # type: str + publishing_profile_options, # type: "_models.CsmPublishingProfileOptions" + **kwargs # type: Any + ): + # type: (...) -> IO + """Gets the publishing profile for an app (or deployment slot, if specified). + + Description for Gets the publishing profile for an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param publishing_profile_options: Specifies publishingProfileOptions for publishing profile. + For example, use {"format": "FileZilla3"} to get a FileZilla publishing profile. + :type publishing_profile_options: ~azure.mgmt.web.v2021_02_01.models.CsmPublishingProfileOptions + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[IO] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/xml" + + # Construct URL + url = self.list_publishing_profile_xml_with_secrets.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(publishing_profile_options, 'CsmPublishingProfileOptions') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_publishing_profile_xml_with_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publishxml'} # type: ignore + + def reset_production_slot_config( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Resets the configuration settings of the current slot if they were previously modified by calling the API with POST. + + Description for Resets the configuration settings of the current slot if they were previously + modified by calling the API with POST. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.reset_production_slot_config.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + reset_production_slot_config.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/resetSlotConfig'} # type: ignore + + def restart( + self, + resource_group_name, # type: str + name, # type: str + soft_restart=None, # type: Optional[bool] + synchronous=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> None + """Restarts an app (or deployment slot, if specified). + + Description for Restarts an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param soft_restart: Specify true to apply the configuration settings and restarts the app only + if necessary. By default, the API always restarts and reprovisions the app. + :type soft_restart: bool + :param synchronous: Specify true to block until the app is restarted. By default, it is set to + false, and the API responds immediately (asynchronous). + :type synchronous: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.restart.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if soft_restart is not None: + query_parameters['softRestart'] = self._serialize.query("soft_restart", soft_restart, 'bool') + if synchronous is not None: + query_parameters['synchronous'] = self._serialize.query("synchronous", synchronous, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restart'} # type: ignore + + def _restore_from_backup_blob_initial( + self, + resource_group_name, # type: str + name, # type: str + request, # type: "_models.RestoreRequest" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._restore_from_backup_blob_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'RestoreRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _restore_from_backup_blob_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreFromBackupBlob'} # type: ignore + + def begin_restore_from_backup_blob( + self, + resource_group_name, # type: str + name, # type: str + request, # type: "_models.RestoreRequest" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Restores an app from a backup blob in Azure Storage. + + Description for Restores an app from a backup blob in Azure Storage. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param request: Information on restore request . + :type request: ~azure.mgmt.web.v2021_02_01.models.RestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._restore_from_backup_blob_initial( + resource_group_name=resource_group_name, + name=name, + request=request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_restore_from_backup_blob.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreFromBackupBlob'} # type: ignore + + def _restore_from_deleted_app_initial( + self, + resource_group_name, # type: str + name, # type: str + restore_request, # type: "_models.DeletedAppRestoreRequest" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._restore_from_deleted_app_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(restore_request, 'DeletedAppRestoreRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _restore_from_deleted_app_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreFromDeletedApp'} # type: ignore + + def begin_restore_from_deleted_app( + self, + resource_group_name, # type: str + name, # type: str + restore_request, # type: "_models.DeletedAppRestoreRequest" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Restores a deleted web app to this web app. + + Description for Restores a deleted web app to this web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param restore_request: Deleted web app restore information. + :type restore_request: ~azure.mgmt.web.v2021_02_01.models.DeletedAppRestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._restore_from_deleted_app_initial( + resource_group_name=resource_group_name, + name=name, + restore_request=restore_request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_restore_from_deleted_app.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreFromDeletedApp'} # type: ignore + + def _restore_snapshot_initial( + self, + resource_group_name, # type: str + name, # type: str + restore_request, # type: "_models.SnapshotRestoreRequest" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._restore_snapshot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(restore_request, 'SnapshotRestoreRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _restore_snapshot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreSnapshot'} # type: ignore + + def begin_restore_snapshot( + self, + resource_group_name, # type: str + name, # type: str + restore_request, # type: "_models.SnapshotRestoreRequest" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Restores a web app from a snapshot. + + Description for Restores a web app from a snapshot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param restore_request: Snapshot restore settings. Snapshot information can be obtained by + calling GetDeletedSites or GetSiteSnapshots API. + :type restore_request: ~azure.mgmt.web.v2021_02_01.models.SnapshotRestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._restore_snapshot_initial( + resource_group_name=resource_group_name, + name=name, + restore_request=restore_request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_restore_snapshot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreSnapshot'} # type: ignore + + def list_site_extensions( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SiteExtensionInfoCollection"] + """Get list of siteextensions for a web site, or a deployment slot. + + Description for Get list of siteextensions for a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SiteExtensionInfoCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.SiteExtensionInfoCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteExtensionInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_extensions.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SiteExtensionInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_site_extensions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions'} # type: ignore + + def get_site_extension( + self, + resource_group_name, # type: str + name, # type: str + site_extension_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteExtensionInfo" + """Get site extension information by its ID for a web site, or a deployment slot. + + Description for Get site extension information by its ID for a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param site_extension_id: Site extension name. + :type site_extension_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteExtensionInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SiteExtensionInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteExtensionInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_site_extension.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'siteExtensionId': self._serialize.url("site_extension_id", site_extension_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteExtensionInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_extension.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}'} # type: ignore + + def _install_site_extension_initial( + self, + resource_group_name, # type: str + name, # type: str + site_extension_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteExtensionInfo" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteExtensionInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._install_site_extension_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'siteExtensionId': self._serialize.url("site_extension_id", site_extension_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.put(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SiteExtensionInfo', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SiteExtensionInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _install_site_extension_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}'} # type: ignore + + def begin_install_site_extension( + self, + resource_group_name, # type: str + name, # type: str + site_extension_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.SiteExtensionInfo"] + """Install site extension on a web site, or a deployment slot. + + Description for Install site extension on a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param site_extension_id: Site extension name. + :type site_extension_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either SiteExtensionInfo or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2021_02_01.models.SiteExtensionInfo] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteExtensionInfo"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._install_site_extension_initial( + resource_group_name=resource_group_name, + name=name, + site_extension_id=site_extension_id, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('SiteExtensionInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'siteExtensionId': self._serialize.url("site_extension_id", site_extension_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_install_site_extension.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}'} # type: ignore + + def delete_site_extension( + self, + resource_group_name, # type: str + name, # type: str + site_extension_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Remove a site extension from a web site, or a deployment slot. + + Description for Remove a site extension from a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param site_extension_id: Site extension name. + :type site_extension_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_site_extension.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'siteExtensionId': self._serialize.url("site_extension_id", site_extension_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_site_extension.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}'} # type: ignore + + def list_slots( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.WebAppCollection"] + """Gets an app's deployment slots. + + Description for Gets an app's deployment slots. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebAppCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.WebAppCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_slots.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_slots.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots'} # type: ignore + + def get_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Site" + """Gets the details of a web, mobile, or API app. + + Description for Gets the details of a web, mobile, or API app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. By default, this API returns the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Site, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.Site + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Site"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Site', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}'} # type: ignore + + def _create_or_update_slot_initial( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + site_envelope, # type: "_models.Site" + **kwargs # type: Any + ): + # type: (...) -> "_models.Site" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Site"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_envelope, 'Site') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Site', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Site', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}'} # type: ignore + + def begin_create_or_update_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + site_envelope, # type: "_models.Site" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.Site"] + """Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. + + Description for Creates a new web, mobile, or API app in an existing resource group, or updates + an existing app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Unique name of the app to create or update. To create or update a deployment slot, + use the {slot} parameter. + :type name: str + :param slot: Name of the deployment slot to create or update. By default, this API attempts to + create or modify the production slot. + :type slot: str + :param site_envelope: A JSON representation of the app properties. See example. + :type site_envelope: ~azure.mgmt.web.v2021_02_01.models.Site + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either Site or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2021_02_01.models.Site] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Site"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + site_envelope=site_envelope, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Site', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}'} # type: ignore + + def delete_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + delete_metrics=None, # type: Optional[bool] + delete_empty_server_farm=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a web, mobile, or API app, or one of the deployment slots. + + Description for Deletes a web, mobile, or API app, or one of the deployment slots. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app to delete. + :type name: str + :param slot: Name of the deployment slot to delete. By default, the API deletes the production + slot. + :type slot: str + :param delete_metrics: If true, web app metrics are also deleted. + :type delete_metrics: bool + :param delete_empty_server_farm: Specify false if you want to keep empty App Service plan. By + default, empty App Service plan is deleted. + :type delete_empty_server_farm: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if delete_metrics is not None: + query_parameters['deleteMetrics'] = self._serialize.query("delete_metrics", delete_metrics, 'bool') + if delete_empty_server_farm is not None: + query_parameters['deleteEmptyServerFarm'] = self._serialize.query("delete_empty_server_farm", delete_empty_server_farm, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}'} # type: ignore + + def update_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + site_envelope, # type: "_models.SitePatchResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.Site" + """Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. + + Description for Creates a new web, mobile, or API app in an existing resource group, or updates + an existing app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Unique name of the app to create or update. To create or update a deployment slot, + use the {slot} parameter. + :type name: str + :param slot: Name of the deployment slot to create or update. By default, this API attempts to + create or modify the production slot. + :type slot: str + :param site_envelope: A JSON representation of the app properties. See example. + :type site_envelope: ~azure.mgmt.web.v2021_02_01.models.SitePatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Site, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.Site + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Site"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_envelope, 'SitePatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Site', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Site', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}'} # type: ignore + + def analyze_custom_hostname_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + host_name=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.CustomHostnameAnalysisResult" + """Analyze a custom hostname. + + Description for Analyze a custom hostname. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param host_name: Custom hostname. + :type host_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CustomHostnameAnalysisResult, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.CustomHostnameAnalysisResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CustomHostnameAnalysisResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.analyze_custom_hostname_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if host_name is not None: + query_parameters['hostName'] = self._serialize.query("host_name", host_name, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CustomHostnameAnalysisResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + analyze_custom_hostname_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/analyzeCustomHostname'} # type: ignore + + def apply_slot_configuration_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + slot_swap_entity, # type: "_models.CsmSlotEntity" + **kwargs # type: Any + ): + # type: (...) -> None + """Applies the configuration settings from the target slot onto the current slot. + + Description for Applies the configuration settings from the target slot onto the current slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the source slot. If a slot is not specified, the production slot is used + as the source slot. + :type slot: str + :param slot_swap_entity: JSON object that contains the target slot name. See example. + :type slot_swap_entity: ~azure.mgmt.web.v2021_02_01.models.CsmSlotEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.apply_slot_configuration_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(slot_swap_entity, 'CsmSlotEntity') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + apply_slot_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/applySlotConfig'} # type: ignore + + def backup_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + request, # type: "_models.BackupRequest" + **kwargs # type: Any + ): + # type: (...) -> "_models.BackupItem" + """Creates a backup of an app. + + Description for Creates a backup of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will create a + backup for the production slot. + :type slot: str + :param request: Backup configuration. You can use the JSON response from the POST action as + input here. + :type request: ~azure.mgmt.web.v2021_02_01.models.BackupRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupItem, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.BackupItem + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupItem"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.backup_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'BackupRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupItem', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + backup_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backup'} # type: ignore + + def list_backups_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.BackupItemCollection"] + """Gets existing backups of an app. + + Description for Gets existing backups of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get backups + of the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either BackupItemCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.BackupItemCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupItemCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_backups_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('BackupItemCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_backups_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups'} # type: ignore + + def get_backup_status_slot( + self, + resource_group_name, # type: str + name, # type: str + backup_id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.BackupItem" + """Gets a backup of an app by its ID. + + Description for Gets a backup of an app by its ID. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param backup_id: ID of the backup. + :type backup_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get a backup + of the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupItem, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.BackupItem + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupItem"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_backup_status_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupItem', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_backup_status_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}'} # type: ignore + + def delete_backup_slot( + self, + resource_group_name, # type: str + name, # type: str + backup_id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a backup of an app by its ID. + + Description for Deletes a backup of an app by its ID. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param backup_id: ID of the backup. + :type backup_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete a + backup of the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_backup_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_backup_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}'} # type: ignore + + def list_backup_status_secrets_slot( + self, + resource_group_name, # type: str + name, # type: str + backup_id, # type: str + slot, # type: str + request, # type: "_models.BackupRequest" + **kwargs # type: Any + ): + # type: (...) -> "_models.BackupItem" + """Gets status of a web app backup that may be in progress, including secrets associated with the backup, such as the Azure Storage SAS URL. Also can be used to update the SAS URL for the backup if a new URL is passed in the request body. + + Description for Gets status of a web app backup that may be in progress, including secrets + associated with the backup, such as the Azure Storage SAS URL. Also can be used to update the + SAS URL for the backup if a new URL is passed in the request body. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param backup_id: ID of backup. + :type backup_id: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param request: Information on backup request. + :type request: ~azure.mgmt.web.v2021_02_01.models.BackupRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupItem, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.BackupItem + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupItem"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.list_backup_status_secrets_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'BackupRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupItem', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_backup_status_secrets_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}/list'} # type: ignore + + def _restore_slot_initial( + self, + resource_group_name, # type: str + name, # type: str + backup_id, # type: str + slot, # type: str + request, # type: "_models.RestoreRequest" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._restore_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'RestoreRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _restore_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}/restore'} # type: ignore + + def begin_restore_slot( + self, + resource_group_name, # type: str + name, # type: str + backup_id, # type: str + slot, # type: str + request, # type: "_models.RestoreRequest" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Restores a specific backup to another app (or deployment slot, if specified). + + Description for Restores a specific backup to another app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param backup_id: ID of the backup. + :type backup_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will restore a + backup of the production slot. + :type slot: str + :param request: Information on restore request . + :type request: ~azure.mgmt.web.v2021_02_01.models.RestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._restore_slot_initial( + resource_group_name=resource_group_name, + name=name, + backup_id=backup_id, + slot=slot, + request=request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'backupId': self._serialize.url("backup_id", backup_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_restore_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}/restore'} # type: ignore + + def list_basic_publishing_credentials_policies_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.PublishingCredentialsPoliciesCollection"] + """Returns whether Scm basic auth is allowed and whether Ftp is allowed for a given site. + + Description for Returns whether Scm basic auth is allowed and whether Ftp is allowed for a + given site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PublishingCredentialsPoliciesCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.PublishingCredentialsPoliciesCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublishingCredentialsPoliciesCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_basic_publishing_credentials_policies_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('PublishingCredentialsPoliciesCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_basic_publishing_credentials_policies_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/basicPublishingCredentialsPolicies'} # type: ignore + + def get_ftp_allowed_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.CsmPublishingCredentialsPoliciesEntity" + """Returns whether FTP is allowed on the site or not. + + Description for Returns whether FTP is allowed on the site or not. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CsmPublishingCredentialsPoliciesEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.CsmPublishingCredentialsPoliciesEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmPublishingCredentialsPoliciesEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_ftp_allowed_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CsmPublishingCredentialsPoliciesEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_ftp_allowed_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/basicPublishingCredentialsPolicies/ftp'} # type: ignore + + def update_ftp_allowed_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + csm_publishing_access_policies_entity, # type: "_models.CsmPublishingCredentialsPoliciesEntity" + **kwargs # type: Any + ): + # type: (...) -> "_models.CsmPublishingCredentialsPoliciesEntity" + """Updates whether FTP is allowed on the site or not. + + Description for Updates whether FTP is allowed on the site or not. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: + :type slot: str + :param csm_publishing_access_policies_entity: + :type csm_publishing_access_policies_entity: ~azure.mgmt.web.v2021_02_01.models.CsmPublishingCredentialsPoliciesEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CsmPublishingCredentialsPoliciesEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.CsmPublishingCredentialsPoliciesEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmPublishingCredentialsPoliciesEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_ftp_allowed_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(csm_publishing_access_policies_entity, 'CsmPublishingCredentialsPoliciesEntity') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CsmPublishingCredentialsPoliciesEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_ftp_allowed_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/basicPublishingCredentialsPolicies/ftp'} # type: ignore + + def get_scm_allowed_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.CsmPublishingCredentialsPoliciesEntity" + """Returns whether Scm basic auth is allowed on the site or not. + + Description for Returns whether Scm basic auth is allowed on the site or not. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CsmPublishingCredentialsPoliciesEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.CsmPublishingCredentialsPoliciesEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmPublishingCredentialsPoliciesEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_scm_allowed_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CsmPublishingCredentialsPoliciesEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_scm_allowed_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/basicPublishingCredentialsPolicies/scm'} # type: ignore + + def update_scm_allowed_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + csm_publishing_access_policies_entity, # type: "_models.CsmPublishingCredentialsPoliciesEntity" + **kwargs # type: Any + ): + # type: (...) -> "_models.CsmPublishingCredentialsPoliciesEntity" + """Updates whether user publishing credentials are allowed on the site or not. + + Description for Updates whether user publishing credentials are allowed on the site or not. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: + :type slot: str + :param csm_publishing_access_policies_entity: + :type csm_publishing_access_policies_entity: ~azure.mgmt.web.v2021_02_01.models.CsmPublishingCredentialsPoliciesEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CsmPublishingCredentialsPoliciesEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.CsmPublishingCredentialsPoliciesEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmPublishingCredentialsPoliciesEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_scm_allowed_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(csm_publishing_access_policies_entity, 'CsmPublishingCredentialsPoliciesEntity') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CsmPublishingCredentialsPoliciesEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_scm_allowed_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/basicPublishingCredentialsPolicies/scm'} # type: ignore + + def list_configurations_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SiteConfigResourceCollection"] + """List the configurations of an app. + + Description for List the configurations of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will return + configuration for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SiteConfigResourceCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.SiteConfigResourceCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigResourceCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_configurations_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SiteConfigResourceCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_configurations_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config'} # type: ignore + + def update_application_settings_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + app_settings, # type: "_models.StringDictionary" + **kwargs # type: Any + ): + # type: (...) -> "_models.StringDictionary" + """Replaces the application settings of an app. + + Description for Replaces the application settings of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + application settings for the production slot. + :type slot: str + :param app_settings: Application settings of the app. + :type app_settings: ~azure.mgmt.web.v2021_02_01.models.StringDictionary + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_application_settings_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(app_settings, 'StringDictionary') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_application_settings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/appsettings'} # type: ignore + + def list_application_settings_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.StringDictionary" + """Gets the application settings of an app. + + Description for Gets the application settings of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + application settings for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_application_settings_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_application_settings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/appsettings/list'} # type: ignore + + def update_auth_settings_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + site_auth_settings, # type: "_models.SiteAuthSettings" + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteAuthSettings" + """Updates the Authentication / Authorization settings associated with web app. + + Description for Updates the Authentication / Authorization settings associated with web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param site_auth_settings: Auth settings associated with web app. + :type site_auth_settings: ~azure.mgmt.web.v2021_02_01.models.SiteAuthSettings + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteAuthSettings, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SiteAuthSettings + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteAuthSettings"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_auth_settings_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_auth_settings, 'SiteAuthSettings') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteAuthSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_auth_settings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettings'} # type: ignore + + def get_auth_settings_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteAuthSettings" + """Gets the Authentication/Authorization settings of an app. + + Description for Gets the Authentication/Authorization settings of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + settings for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteAuthSettings, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SiteAuthSettings + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteAuthSettings"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_auth_settings_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteAuthSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_auth_settings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettings/list'} # type: ignore + + def update_auth_settings_v2_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + site_auth_settings_v2, # type: "_models.SiteAuthSettingsV2" + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteAuthSettingsV2" + """Updates site's Authentication / Authorization settings for apps via the V2 format. + + Description for Updates site's Authentication / Authorization settings for apps via the V2 + format. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param site_auth_settings_v2: Auth settings associated with web app. + :type site_auth_settings_v2: ~azure.mgmt.web.v2021_02_01.models.SiteAuthSettingsV2 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteAuthSettingsV2, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SiteAuthSettingsV2 + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteAuthSettingsV2"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_auth_settings_v2_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_auth_settings_v2, 'SiteAuthSettingsV2') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteAuthSettingsV2', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_auth_settings_v2_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettingsV2'} # type: ignore + + def get_auth_settings_v2_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteAuthSettingsV2" + """Gets site's Authentication / Authorization settings for apps via the V2 format. + + Description for Gets site's Authentication / Authorization settings for apps via the V2 format. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + settings for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteAuthSettingsV2, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SiteAuthSettingsV2 + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteAuthSettingsV2"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_auth_settings_v2_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteAuthSettingsV2', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_auth_settings_v2_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettingsV2/list'} # type: ignore + + def update_azure_storage_accounts_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + azure_storage_accounts, # type: "_models.AzureStoragePropertyDictionaryResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.AzureStoragePropertyDictionaryResource" + """Updates the Azure storage account configurations of an app. + + Description for Updates the Azure storage account configurations of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + Azure storage account configurations for the production slot. + :type slot: str + :param azure_storage_accounts: Azure storage accounts of the app. + :type azure_storage_accounts: ~azure.mgmt.web.v2021_02_01.models.AzureStoragePropertyDictionaryResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AzureStoragePropertyDictionaryResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.AzureStoragePropertyDictionaryResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureStoragePropertyDictionaryResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_azure_storage_accounts_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(azure_storage_accounts, 'AzureStoragePropertyDictionaryResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AzureStoragePropertyDictionaryResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_azure_storage_accounts_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/azurestorageaccounts'} # type: ignore + + def list_azure_storage_accounts_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.AzureStoragePropertyDictionaryResource" + """Gets the Azure storage account configurations of an app. + + Description for Gets the Azure storage account configurations of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + Azure storage account configurations for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AzureStoragePropertyDictionaryResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.AzureStoragePropertyDictionaryResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureStoragePropertyDictionaryResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_azure_storage_accounts_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AzureStoragePropertyDictionaryResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_azure_storage_accounts_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/azurestorageaccounts/list'} # type: ignore + + def update_backup_configuration_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + request, # type: "_models.BackupRequest" + **kwargs # type: Any + ): + # type: (...) -> "_models.BackupRequest" + """Updates the backup configuration of an app. + + Description for Updates the backup configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + backup configuration for the production slot. + :type slot: str + :param request: Edited backup configuration. + :type request: ~azure.mgmt.web.v2021_02_01.models.BackupRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupRequest, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.BackupRequest + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupRequest"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_backup_configuration_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'BackupRequest') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupRequest', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_backup_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup'} # type: ignore + + def delete_backup_configuration_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes the backup configuration of an app. + + Description for Deletes the backup configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + backup configuration for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_backup_configuration_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_backup_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup'} # type: ignore + + def get_backup_configuration_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.BackupRequest" + """Gets the backup configuration of an app. + + Description for Gets the backup configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + backup configuration for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupRequest, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.BackupRequest + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupRequest"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_backup_configuration_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupRequest', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_backup_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup/list'} # type: ignore + + def get_app_settings_key_vault_references_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ApiKVReferenceCollection"] + """Gets the config reference app settings and status of an app. + + Description for Gets the config reference app settings and status of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ApiKVReferenceCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.ApiKVReferenceCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiKVReferenceCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_app_settings_key_vault_references_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ApiKVReferenceCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + get_app_settings_key_vault_references_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/configreferences/appsettings'} # type: ignore + + def get_app_setting_key_vault_reference_slot( + self, + resource_group_name, # type: str + name, # type: str + app_setting_key, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ApiKVReference" + """Gets the config reference and status of an app. + + Description for Gets the config reference and status of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param app_setting_key: App Setting key name. + :type app_setting_key: str + :param slot: + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ApiKVReference, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.ApiKVReference + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiKVReference"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_app_setting_key_vault_reference_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'appSettingKey': self._serialize.url("app_setting_key", app_setting_key, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ApiKVReference', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_app_setting_key_vault_reference_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/configreferences/appsettings/{appSettingKey}'} # type: ignore + + def get_site_connection_string_key_vault_references_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ApiKVReferenceCollection"] + """Gets the config reference app settings and status of an app. + + Description for Gets the config reference app settings and status of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ApiKVReferenceCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.ApiKVReferenceCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiKVReferenceCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_site_connection_string_key_vault_references_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ApiKVReferenceCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + get_site_connection_string_key_vault_references_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/configreferences/connectionstrings'} # type: ignore + + def get_site_connection_string_key_vault_reference_slot( + self, + resource_group_name, # type: str + name, # type: str + connection_string_key, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ApiKVReference" + """Gets the config reference and status of an app. + + Description for Gets the config reference and status of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param connection_string_key: + :type connection_string_key: str + :param slot: + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ApiKVReference, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.ApiKVReference + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiKVReference"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_site_connection_string_key_vault_reference_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'connectionStringKey': self._serialize.url("connection_string_key", connection_string_key, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ApiKVReference', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_connection_string_key_vault_reference_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/configreferences/connectionstrings/{connectionStringKey}'} # type: ignore + + def update_connection_strings_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + connection_strings, # type: "_models.ConnectionStringDictionary" + **kwargs # type: Any + ): + # type: (...) -> "_models.ConnectionStringDictionary" + """Replaces the connection strings of an app. + + Description for Replaces the connection strings of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + connection settings for the production slot. + :type slot: str + :param connection_strings: Connection strings of the app or deployment slot. See example. + :type connection_strings: ~azure.mgmt.web.v2021_02_01.models.ConnectionStringDictionary + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ConnectionStringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.ConnectionStringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionStringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_connection_strings_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_strings, 'ConnectionStringDictionary') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ConnectionStringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_connection_strings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/connectionstrings'} # type: ignore + + def list_connection_strings_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ConnectionStringDictionary" + """Gets the connection strings of an app. + + Description for Gets the connection strings of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + connection settings for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ConnectionStringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.ConnectionStringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionStringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_connection_strings_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ConnectionStringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_connection_strings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/connectionstrings/list'} # type: ignore + + def get_diagnostic_logs_configuration_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteLogsConfig" + """Gets the logging configuration of an app. + + Description for Gets the logging configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + logging configuration for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteLogsConfig, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SiteLogsConfig + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteLogsConfig"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_diagnostic_logs_configuration_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteLogsConfig', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_diagnostic_logs_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/logs'} # type: ignore + + def update_diagnostic_logs_config_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + site_logs_config, # type: "_models.SiteLogsConfig" + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteLogsConfig" + """Updates the logging configuration of an app. + + Description for Updates the logging configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + logging configuration for the production slot. + :type slot: str + :param site_logs_config: A SiteLogsConfig JSON object that contains the logging configuration + to change in the "properties" property. + :type site_logs_config: ~azure.mgmt.web.v2021_02_01.models.SiteLogsConfig + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteLogsConfig, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SiteLogsConfig + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteLogsConfig"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_diagnostic_logs_config_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_logs_config, 'SiteLogsConfig') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteLogsConfig', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_diagnostic_logs_config_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/logs'} # type: ignore + + def update_metadata_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + metadata, # type: "_models.StringDictionary" + **kwargs # type: Any + ): + # type: (...) -> "_models.StringDictionary" + """Replaces the metadata of an app. + + Description for Replaces the metadata of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + metadata for the production slot. + :type slot: str + :param metadata: Edited metadata of the app or deployment slot. See example. + :type metadata: ~azure.mgmt.web.v2021_02_01.models.StringDictionary + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_metadata_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(metadata, 'StringDictionary') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_metadata_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/metadata'} # type: ignore + + def list_metadata_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.StringDictionary" + """Gets the metadata of an app. + + Description for Gets the metadata of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + metadata for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_metadata_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_metadata_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/metadata/list'} # type: ignore + + def _list_publishing_credentials_slot_initial( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.User" + cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._list_publishing_credentials_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _list_publishing_credentials_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/publishingcredentials/list'} # type: ignore + + def begin_list_publishing_credentials_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.User"] + """Gets the Git/FTP publishing credentials of an app. + + Description for Gets the Git/FTP publishing credentials of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + publishing credentials for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either User or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2021_02_01.models.User] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._list_publishing_credentials_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_list_publishing_credentials_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/publishingcredentials/list'} # type: ignore + + def update_site_push_settings_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + push_settings, # type: "_models.PushSettings" + **kwargs # type: Any + ): + # type: (...) -> "_models.PushSettings" + """Updates the Push settings associated with web app. + + Description for Updates the Push settings associated with web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param push_settings: Push settings associated with web app. + :type push_settings: ~azure.mgmt.web.v2021_02_01.models.PushSettings + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PushSettings, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.PushSettings + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PushSettings"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_site_push_settings_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(push_settings, 'PushSettings') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PushSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_site_push_settings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/pushsettings'} # type: ignore + + def list_site_push_settings_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PushSettings" + """Gets the Push settings associated with web app. + + Description for Gets the Push settings associated with web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PushSettings, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.PushSettings + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PushSettings"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_site_push_settings_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PushSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_site_push_settings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/pushsettings/list'} # type: ignore + + def get_configuration_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteConfigResource" + """Gets the configuration of an app, such as platform version and bitness, default documents, virtual applications, Always On, etc. + + Description for Gets the configuration of an app, such as platform version and bitness, default + documents, virtual applications, Always On, etc. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will return + configuration for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteConfigResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SiteConfigResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_configuration_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteConfigResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web'} # type: ignore + + def create_or_update_configuration_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + site_config, # type: "_models.SiteConfigResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteConfigResource" + """Updates the configuration of an app. + + Description for Updates the configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update + configuration for the production slot. + :type slot: str + :param site_config: JSON representation of a SiteConfig object. See example. + :type site_config: ~azure.mgmt.web.v2021_02_01.models.SiteConfigResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteConfigResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SiteConfigResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_configuration_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_config, 'SiteConfigResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteConfigResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web'} # type: ignore + + def update_configuration_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + site_config, # type: "_models.SiteConfigResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteConfigResource" + """Updates the configuration of an app. + + Description for Updates the configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update + configuration for the production slot. + :type slot: str + :param site_config: JSON representation of a SiteConfig object. See example. + :type site_config: ~azure.mgmt.web.v2021_02_01.models.SiteConfigResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteConfigResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SiteConfigResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_configuration_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_config, 'SiteConfigResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteConfigResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web'} # type: ignore + + def list_configuration_snapshot_info_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SiteConfigurationSnapshotInfoCollection"] + """Gets a list of web app configuration snapshots identifiers. Each element of the list contains a timestamp and the ID of the snapshot. + + Description for Gets a list of web app configuration snapshots identifiers. Each element of the + list contains a timestamp and the ID of the snapshot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will return + configuration for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SiteConfigurationSnapshotInfoCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.SiteConfigurationSnapshotInfoCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigurationSnapshotInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_configuration_snapshot_info_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SiteConfigurationSnapshotInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_configuration_snapshot_info_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots'} # type: ignore + + def get_configuration_snapshot_slot( + self, + resource_group_name, # type: str + name, # type: str + snapshot_id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteConfigResource" + """Gets a snapshot of the configuration of an app at a previous point in time. + + Description for Gets a snapshot of the configuration of an app at a previous point in time. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param snapshot_id: The ID of the snapshot to read. + :type snapshot_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will return + configuration for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteConfigResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SiteConfigResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteConfigResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_configuration_snapshot_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'snapshotId': self._serialize.url("snapshot_id", snapshot_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteConfigResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_configuration_snapshot_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots/{snapshotId}'} # type: ignore + + def recover_site_configuration_snapshot_slot( + self, + resource_group_name, # type: str + name, # type: str + snapshot_id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Reverts the configuration of an app to a previous snapshot. + + Description for Reverts the configuration of an app to a previous snapshot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param snapshot_id: The ID of the snapshot to read. + :type snapshot_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will return + configuration for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.recover_site_configuration_snapshot_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'snapshotId': self._serialize.url("snapshot_id", snapshot_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + recover_site_configuration_snapshot_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots/{snapshotId}/recover'} # type: ignore + + def get_web_site_container_logs_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional[IO] + """Gets the last lines of docker logs for the given site. + + Description for Gets the last lines of docker logs for the given site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional[IO]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/octet-stream" + + # Construct URL + url = self.get_web_site_container_logs_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_web_site_container_logs_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/containerlogs'} # type: ignore + + def get_container_logs_zip_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional[IO] + """Gets the ZIP archived docker log files for the given site. + + Description for Gets the ZIP archived docker log files for the given site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional[IO]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/zip" + + # Construct URL + url = self.get_container_logs_zip_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_container_logs_zip_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/containerlogs/zip/download'} # type: ignore + + def list_continuous_web_jobs_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ContinuousWebJobCollection"] + """List continuous web jobs for an app, or a deployment slot. + + Description for List continuous web jobs for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API deletes a + deployment for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ContinuousWebJobCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.ContinuousWebJobCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ContinuousWebJobCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_continuous_web_jobs_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ContinuousWebJobCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_continuous_web_jobs_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs'} # type: ignore + + def get_continuous_web_job_slot( + self, + resource_group_name, # type: str + name, # type: str + web_job_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ContinuousWebJob" + """Gets a continuous web job by its ID for an app, or a deployment slot. + + Description for Gets a continuous web job by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API deletes a + deployment for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ContinuousWebJob, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.ContinuousWebJob + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ContinuousWebJob"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_continuous_web_job_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ContinuousWebJob', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_continuous_web_job_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}'} # type: ignore + + def delete_continuous_web_job_slot( + self, + resource_group_name, # type: str + name, # type: str + web_job_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a continuous web job by its ID for an app, or a deployment slot. + + Description for Delete a continuous web job by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API deletes a + deployment for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_continuous_web_job_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_continuous_web_job_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}'} # type: ignore + + def start_continuous_web_job_slot( + self, + resource_group_name, # type: str + name, # type: str + web_job_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Start a continuous web job for an app, or a deployment slot. + + Description for Start a continuous web job for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API deletes a + deployment for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.start_continuous_web_job_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + start_continuous_web_job_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}/start'} # type: ignore + + def stop_continuous_web_job_slot( + self, + resource_group_name, # type: str + name, # type: str + web_job_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Stop a continuous web job for an app, or a deployment slot. + + Description for Stop a continuous web job for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API deletes a + deployment for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.stop_continuous_web_job_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + stop_continuous_web_job_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}/stop'} # type: ignore + + def list_deployments_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DeploymentCollection"] + """List deployments for an app, or a deployment slot. + + Description for List deployments for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DeploymentCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.DeploymentCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DeploymentCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_deployments_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DeploymentCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_deployments_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments'} # type: ignore + + def get_deployment_slot( + self, + resource_group_name, # type: str + name, # type: str + id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Deployment" + """Get a deployment by its ID for an app, or a deployment slot. + + Description for Get a deployment by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param id: Deployment ID. + :type id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API gets a deployment + for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Deployment, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.Deployment + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Deployment"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_deployment_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Deployment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_deployment_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}'} # type: ignore + + def create_deployment_slot( + self, + resource_group_name, # type: str + name, # type: str + id, # type: str + slot, # type: str + deployment, # type: "_models.Deployment" + **kwargs # type: Any + ): + # type: (...) -> "_models.Deployment" + """Create a deployment for an app, or a deployment slot. + + Description for Create a deployment for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param id: ID of an existing deployment. + :type id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API creates a + deployment for the production slot. + :type slot: str + :param deployment: Deployment details. + :type deployment: ~azure.mgmt.web.v2021_02_01.models.Deployment + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Deployment, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.Deployment + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Deployment"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_deployment_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(deployment, 'Deployment') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Deployment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_deployment_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}'} # type: ignore + + def delete_deployment_slot( + self, + resource_group_name, # type: str + name, # type: str + id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a deployment by its ID for an app, or a deployment slot. + + Description for Delete a deployment by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param id: Deployment ID. + :type id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API deletes a + deployment for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_deployment_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_deployment_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}'} # type: ignore + + def list_deployment_log_slot( + self, + resource_group_name, # type: str + name, # type: str + id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Deployment" + """List deployment log for specific deployment for an app, or a deployment slot. + + Description for List deployment log for specific deployment for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param id: The ID of a specific deployment. This is the value of the name property in the JSON + response from "GET /api/sites/{siteName}/deployments". + :type id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Deployment, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.Deployment + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Deployment"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_deployment_log_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Deployment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_deployment_log_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}/log'} # type: ignore + + def discover_backup_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + request, # type: "_models.RestoreRequest" + **kwargs # type: Any + ): + # type: (...) -> "_models.RestoreRequest" + """Discovers an existing app backup that can be restored from a blob in Azure storage. Use this to get information about the databases stored in a backup. + + Description for Discovers an existing app backup that can be restored from a blob in Azure + storage. Use this to get information about the databases stored in a backup. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will perform + discovery for the production slot. + :type slot: str + :param request: A RestoreRequest object that includes Azure storage URL and blog name for + discovery of backup. + :type request: ~azure.mgmt.web.v2021_02_01.models.RestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RestoreRequest, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.RestoreRequest + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RestoreRequest"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.discover_backup_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'RestoreRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RestoreRequest', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + discover_backup_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/discoverbackup'} # type: ignore + + def list_domain_ownership_identifiers_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.IdentifierCollection"] + """Lists ownership identifiers for domain associated with web app. + + Description for Lists ownership identifiers for domain associated with web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + binding for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either IdentifierCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.IdentifierCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.IdentifierCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_domain_ownership_identifiers_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('IdentifierCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_domain_ownership_identifiers_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers'} # type: ignore + + def get_domain_ownership_identifier_slot( + self, + resource_group_name, # type: str + name, # type: str + domain_ownership_identifier_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Identifier" + """Get domain ownership identifier for web app. + + Description for Get domain ownership identifier for web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param domain_ownership_identifier_name: Name of domain ownership identifier. + :type domain_ownership_identifier_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + binding for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Identifier, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.Identifier + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Identifier"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_domain_ownership_identifier_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Identifier', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_domain_ownership_identifier_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} # type: ignore + + def create_or_update_domain_ownership_identifier_slot( + self, + resource_group_name, # type: str + name, # type: str + domain_ownership_identifier_name, # type: str + slot, # type: str + domain_ownership_identifier, # type: "_models.Identifier" + **kwargs # type: Any + ): + # type: (...) -> "_models.Identifier" + """Creates a domain ownership identifier for web app, or updates an existing ownership identifier. + + Description for Creates a domain ownership identifier for web app, or updates an existing + ownership identifier. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param domain_ownership_identifier_name: Name of domain ownership identifier. + :type domain_ownership_identifier_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + binding for the production slot. + :type slot: str + :param domain_ownership_identifier: A JSON representation of the domain ownership properties. + :type domain_ownership_identifier: ~azure.mgmt.web.v2021_02_01.models.Identifier + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Identifier, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.Identifier + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Identifier"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_domain_ownership_identifier_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(domain_ownership_identifier, 'Identifier') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Identifier', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_domain_ownership_identifier_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} # type: ignore + + def delete_domain_ownership_identifier_slot( + self, + resource_group_name, # type: str + name, # type: str + domain_ownership_identifier_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a domain ownership identifier for a web app. + + Description for Deletes a domain ownership identifier for a web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param domain_ownership_identifier_name: Name of domain ownership identifier. + :type domain_ownership_identifier_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + binding for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_domain_ownership_identifier_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_domain_ownership_identifier_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} # type: ignore + + def update_domain_ownership_identifier_slot( + self, + resource_group_name, # type: str + name, # type: str + domain_ownership_identifier_name, # type: str + slot, # type: str + domain_ownership_identifier, # type: "_models.Identifier" + **kwargs # type: Any + ): + # type: (...) -> "_models.Identifier" + """Creates a domain ownership identifier for web app, or updates an existing ownership identifier. + + Description for Creates a domain ownership identifier for web app, or updates an existing + ownership identifier. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param domain_ownership_identifier_name: Name of domain ownership identifier. + :type domain_ownership_identifier_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + binding for the production slot. + :type slot: str + :param domain_ownership_identifier: A JSON representation of the domain ownership properties. + :type domain_ownership_identifier: ~azure.mgmt.web.v2021_02_01.models.Identifier + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Identifier, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.Identifier + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Identifier"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_domain_ownership_identifier_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'domainOwnershipIdentifierName': self._serialize.url("domain_ownership_identifier_name", domain_ownership_identifier_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(domain_ownership_identifier, 'Identifier') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Identifier', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_domain_ownership_identifier_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'} # type: ignore + + def get_ms_deploy_status_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.MSDeployStatus" + """Get the status of the last MSDeploy operation. + + Description for Get the status of the last MSDeploy operation. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MSDeployStatus, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.MSDeployStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_ms_deploy_status_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_ms_deploy_status_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy'} # type: ignore + + def _create_ms_deploy_operation_slot_initial( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + ms_deploy, # type: "_models.MSDeploy" + **kwargs # type: Any + ): + # type: (...) -> "_models.MSDeployStatus" + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_ms_deploy_operation_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(ms_deploy, 'MSDeploy') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_ms_deploy_operation_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy'} # type: ignore + + def begin_create_ms_deploy_operation_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + ms_deploy, # type: "_models.MSDeploy" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.MSDeployStatus"] + """Invoke the MSDeploy web app extension. + + Description for Invoke the MSDeploy web app extension. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param ms_deploy: Details of MSDeploy operation. + :type ms_deploy: ~azure.mgmt.web.v2021_02_01.models.MSDeploy + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either MSDeployStatus or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2021_02_01.models.MSDeployStatus] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployStatus"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_ms_deploy_operation_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + ms_deploy=ms_deploy, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_ms_deploy_operation_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy'} # type: ignore + + def get_ms_deploy_log_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.MSDeployLog" + """Get the MSDeploy Log for the last MSDeploy operation. + + Description for Get the MSDeploy Log for the last MSDeploy operation. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MSDeployLog, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.MSDeployLog + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployLog"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_ms_deploy_log_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MSDeployLog', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_ms_deploy_log_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy/log'} # type: ignore + + def list_instance_functions_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.FunctionEnvelopeCollection"] + """List the functions for a web site, or a deployment slot. + + Description for List the functions for a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either FunctionEnvelopeCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.FunctionEnvelopeCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionEnvelopeCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_instance_functions_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('FunctionEnvelopeCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_instance_functions_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions'} # type: ignore + + def get_functions_admin_token_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> str + """Fetch a short lived token that can be exchanged for a master key. + + Description for Fetch a short lived token that can be exchanged for a master key. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: str, or the result of cls(response) + :rtype: str + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[str] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_functions_admin_token_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_functions_admin_token_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/admin/token'} # type: ignore + + def get_instance_function_slot( + self, + resource_group_name, # type: str + name, # type: str + function_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.FunctionEnvelope" + """Get function information by its ID for web site, or a deployment slot. + + Description for Get function information by its ID for web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: Function name. + :type function_name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FunctionEnvelope, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.FunctionEnvelope + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionEnvelope"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_function_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FunctionEnvelope', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_function_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}'} # type: ignore + + def _create_instance_function_slot_initial( + self, + resource_group_name, # type: str + name, # type: str + function_name, # type: str + slot, # type: str + function_envelope, # type: "_models.FunctionEnvelope" + **kwargs # type: Any + ): + # type: (...) -> "_models.FunctionEnvelope" + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionEnvelope"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_instance_function_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(function_envelope, 'FunctionEnvelope') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FunctionEnvelope', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_instance_function_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}'} # type: ignore + + def begin_create_instance_function_slot( + self, + resource_group_name, # type: str + name, # type: str + function_name, # type: str + slot, # type: str + function_envelope, # type: "_models.FunctionEnvelope" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.FunctionEnvelope"] + """Create function for web site, or a deployment slot. + + Description for Create function for web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: Function name. + :type function_name: str + :param slot: Name of the deployment slot. + :type slot: str + :param function_envelope: Function details. + :type function_envelope: ~azure.mgmt.web.v2021_02_01.models.FunctionEnvelope + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either FunctionEnvelope or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2021_02_01.models.FunctionEnvelope] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionEnvelope"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_instance_function_slot_initial( + resource_group_name=resource_group_name, + name=name, + function_name=function_name, + slot=slot, + function_envelope=function_envelope, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('FunctionEnvelope', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_instance_function_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}'} # type: ignore + + def delete_instance_function_slot( + self, + resource_group_name, # type: str + name, # type: str + function_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a function for web site, or a deployment slot. + + Description for Delete a function for web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: Function name. + :type function_name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_instance_function_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_instance_function_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}'} # type: ignore + + def create_or_update_function_secret_slot( + self, + resource_group_name, # type: str + name, # type: str + function_name, # type: str + key_name, # type: str + slot, # type: str + key, # type: "_models.KeyInfo" + **kwargs # type: Any + ): + # type: (...) -> "_models.KeyInfo" + """Add or update a function secret. + + Description for Add or update a function secret. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: The name of the function. + :type function_name: str + :param key_name: The name of the key. + :type key_name: str + :param slot: Name of the deployment slot. + :type slot: str + :param key: The key to create or update. + :type key: ~azure.mgmt.web.v2021_02_01.models.KeyInfo + :keyword callable cls: A custom type or function that will be passed the direct response + :return: KeyInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.KeyInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.KeyInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_function_secret_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'keyName': self._serialize.url("key_name", key_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(key, 'KeyInfo') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('KeyInfo', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('KeyInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_function_secret_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/keys/{keyName}'} # type: ignore + + def delete_function_secret_slot( + self, + resource_group_name, # type: str + name, # type: str + function_name, # type: str + key_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a function secret. + + Description for Delete a function secret. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: The name of the function. + :type function_name: str + :param key_name: The name of the key. + :type key_name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_function_secret_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'keyName': self._serialize.url("key_name", key_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_function_secret_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/keys/{keyName}'} # type: ignore + + def list_function_keys_slot( + self, + resource_group_name, # type: str + name, # type: str + function_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.StringDictionary" + """Get function keys for a function in a web site, or a deployment slot. + + Description for Get function keys for a function in a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: Function name. + :type function_name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StringDictionary, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.StringDictionary + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StringDictionary"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_function_keys_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StringDictionary', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_function_keys_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/listkeys'} # type: ignore + + def list_function_secrets_slot( + self, + resource_group_name, # type: str + name, # type: str + function_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.FunctionSecrets" + """Get function secrets for a function in a web site, or a deployment slot. + + Description for Get function secrets for a function in a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param function_name: Function name. + :type function_name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FunctionSecrets, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.FunctionSecrets + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionSecrets"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_function_secrets_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'functionName': self._serialize.url("function_name", function_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FunctionSecrets', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_function_secrets_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/listsecrets'} # type: ignore + + def list_host_keys_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.HostKeys" + """Get host secrets for a function app. + + Description for Get host secrets for a function app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HostKeys, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.HostKeys + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HostKeys"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_host_keys_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HostKeys', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_host_keys_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/listkeys'} # type: ignore + + def list_sync_status_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """This is to allow calling via powershell and ARM template. + + Description for This is to allow calling via powershell and ARM template. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_sync_status_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + list_sync_status_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/listsyncstatus'} # type: ignore + + def sync_functions_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Syncs function trigger metadata to the management database. + + Description for Syncs function trigger metadata to the management database. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.sync_functions_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + sync_functions_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/sync'} # type: ignore + + def create_or_update_host_secret_slot( + self, + resource_group_name, # type: str + name, # type: str + key_type, # type: str + key_name, # type: str + slot, # type: str + key, # type: "_models.KeyInfo" + **kwargs # type: Any + ): + # type: (...) -> "_models.KeyInfo" + """Add or update a host level secret. + + Description for Add or update a host level secret. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param key_type: The type of host key. + :type key_type: str + :param key_name: The name of the key. + :type key_name: str + :param slot: Name of the deployment slot. + :type slot: str + :param key: The key to create or update. + :type key: ~azure.mgmt.web.v2021_02_01.models.KeyInfo + :keyword callable cls: A custom type or function that will be passed the direct response + :return: KeyInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.KeyInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.KeyInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_host_secret_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'keyType': self._serialize.url("key_type", key_type, 'str'), + 'keyName': self._serialize.url("key_name", key_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(key, 'KeyInfo') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('KeyInfo', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('KeyInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_host_secret_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/{keyType}/{keyName}'} # type: ignore + + def delete_host_secret_slot( + self, + resource_group_name, # type: str + name, # type: str + key_type, # type: str + key_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a host level secret. + + Description for Delete a host level secret. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param key_type: The type of host key. + :type key_type: str + :param key_name: The name of the key. + :type key_name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_host_secret_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'keyType': self._serialize.url("key_type", key_type, 'str'), + 'keyName': self._serialize.url("key_name", key_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_host_secret_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/{keyType}/{keyName}'} # type: ignore + + def list_host_name_bindings_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.HostNameBindingCollection"] + """Get hostname bindings for an app or a deployment slot. + + Description for Get hostname bindings for an app or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API gets hostname + bindings for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either HostNameBindingCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.HostNameBindingCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HostNameBindingCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_host_name_bindings_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('HostNameBindingCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_host_name_bindings_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings'} # type: ignore + + def get_host_name_binding_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + host_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.HostNameBinding" + """Get the named hostname binding for an app (or deployment slot, if specified). + + Description for Get the named hostname binding for an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API the named binding + for the production slot. + :type slot: str + :param host_name: Hostname in the hostname binding. + :type host_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HostNameBinding, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.HostNameBinding + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HostNameBinding"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_host_name_binding_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HostNameBinding', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_host_name_binding_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}'} # type: ignore + + def create_or_update_host_name_binding_slot( + self, + resource_group_name, # type: str + name, # type: str + host_name, # type: str + slot, # type: str + host_name_binding, # type: "_models.HostNameBinding" + **kwargs # type: Any + ): + # type: (...) -> "_models.HostNameBinding" + """Creates a hostname binding for an app. + + Description for Creates a hostname binding for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param host_name: Hostname in the hostname binding. + :type host_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will create a + binding for the production slot. + :type slot: str + :param host_name_binding: Binding details. This is the JSON representation of a HostNameBinding + object. + :type host_name_binding: ~azure.mgmt.web.v2021_02_01.models.HostNameBinding + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HostNameBinding, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.HostNameBinding + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HostNameBinding"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_host_name_binding_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(host_name_binding, 'HostNameBinding') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HostNameBinding', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_host_name_binding_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}'} # type: ignore + + def delete_host_name_binding_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + host_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a hostname binding for an app. + + Description for Deletes a hostname binding for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + binding for the production slot. + :type slot: str + :param host_name: Hostname in the hostname binding. + :type host_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_host_name_binding_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'hostName': self._serialize.url("host_name", host_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_host_name_binding_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}'} # type: ignore + + def get_hybrid_connection_slot( + self, + resource_group_name, # type: str + name, # type: str + namespace_name, # type: str + relay_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.HybridConnection" + """Retrieves a specific Service Bus Hybrid Connection used by this Web App. + + Description for Retrieves a specific Service Bus Hybrid Connection used by this Web App. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param namespace_name: The namespace for this hybrid connection. + :type namespace_name: str + :param relay_name: The relay name for this hybrid connection. + :type relay_name: str + :param slot: The name of the slot for the web app. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnection, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.HybridConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_hybrid_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_hybrid_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} # type: ignore + + def create_or_update_hybrid_connection_slot( + self, + resource_group_name, # type: str + name, # type: str + namespace_name, # type: str + relay_name, # type: str + slot, # type: str + connection_envelope, # type: "_models.HybridConnection" + **kwargs # type: Any + ): + # type: (...) -> "_models.HybridConnection" + """Creates a new Hybrid Connection using a Service Bus relay. + + Description for Creates a new Hybrid Connection using a Service Bus relay. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param namespace_name: The namespace for this hybrid connection. + :type namespace_name: str + :param relay_name: The relay name for this hybrid connection. + :type relay_name: str + :param slot: The name of the slot for the web app. + :type slot: str + :param connection_envelope: The details of the hybrid connection. + :type connection_envelope: ~azure.mgmt.web.v2021_02_01.models.HybridConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnection, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.HybridConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_hybrid_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'HybridConnection') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_hybrid_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} # type: ignore + + def delete_hybrid_connection_slot( + self, + resource_group_name, # type: str + name, # type: str + namespace_name, # type: str + relay_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Removes a Hybrid Connection from this site. + + Description for Removes a Hybrid Connection from this site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param namespace_name: The namespace for this hybrid connection. + :type namespace_name: str + :param relay_name: The relay name for this hybrid connection. + :type relay_name: str + :param slot: The name of the slot for the web app. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_hybrid_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_hybrid_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} # type: ignore + + def update_hybrid_connection_slot( + self, + resource_group_name, # type: str + name, # type: str + namespace_name, # type: str + relay_name, # type: str + slot, # type: str + connection_envelope, # type: "_models.HybridConnection" + **kwargs # type: Any + ): + # type: (...) -> "_models.HybridConnection" + """Creates a new Hybrid Connection using a Service Bus relay. + + Description for Creates a new Hybrid Connection using a Service Bus relay. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param namespace_name: The namespace for this hybrid connection. + :type namespace_name: str + :param relay_name: The relay name for this hybrid connection. + :type relay_name: str + :param slot: The name of the slot for the web app. + :type slot: str + :param connection_envelope: The details of the hybrid connection. + :type connection_envelope: ~azure.mgmt.web.v2021_02_01.models.HybridConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnection, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.HybridConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_hybrid_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str'), + 'relayName': self._serialize.url("relay_name", relay_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'HybridConnection') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_hybrid_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'} # type: ignore + + def list_hybrid_connections_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.HybridConnection" + """Retrieves all Service Bus Hybrid Connections used by this Web App. + + Description for Retrieves all Service Bus Hybrid Connections used by this Web App. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param slot: The name of the slot for the web app. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HybridConnection, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.HybridConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HybridConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_hybrid_connections_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HybridConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_hybrid_connections_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionRelays'} # type: ignore + + def list_relay_service_connections_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.RelayServiceConnectionEntity" + """Gets hybrid connections configured for an app (or deployment slot, if specified). + + Description for Gets hybrid connections configured for an app (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get hybrid + connections for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RelayServiceConnectionEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.RelayServiceConnectionEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RelayServiceConnectionEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_relay_service_connections_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RelayServiceConnectionEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_relay_service_connections_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection'} # type: ignore + + def get_relay_service_connection_slot( + self, + resource_group_name, # type: str + name, # type: str + entity_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.RelayServiceConnectionEntity" + """Gets a hybrid connection configuration by its name. + + Description for Gets a hybrid connection configuration by its name. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param entity_name: Name of the hybrid connection. + :type entity_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get a hybrid + connection for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RelayServiceConnectionEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.RelayServiceConnectionEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RelayServiceConnectionEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_relay_service_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'entityName': self._serialize.url("entity_name", entity_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RelayServiceConnectionEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_relay_service_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}'} # type: ignore + + def create_or_update_relay_service_connection_slot( + self, + resource_group_name, # type: str + name, # type: str + entity_name, # type: str + slot, # type: str + connection_envelope, # type: "_models.RelayServiceConnectionEntity" + **kwargs # type: Any + ): + # type: (...) -> "_models.RelayServiceConnectionEntity" + """Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). + + Description for Creates a new hybrid connection configuration (PUT), or updates an existing one + (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param entity_name: Name of the hybrid connection configuration. + :type entity_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will create or + update a hybrid connection for the production slot. + :type slot: str + :param connection_envelope: Details of the hybrid connection configuration. + :type connection_envelope: ~azure.mgmt.web.v2021_02_01.models.RelayServiceConnectionEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RelayServiceConnectionEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.RelayServiceConnectionEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RelayServiceConnectionEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_relay_service_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'entityName': self._serialize.url("entity_name", entity_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'RelayServiceConnectionEntity') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RelayServiceConnectionEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_relay_service_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}'} # type: ignore + + def delete_relay_service_connection_slot( + self, + resource_group_name, # type: str + name, # type: str + entity_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a relay service connection by its name. + + Description for Deletes a relay service connection by its name. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param entity_name: Name of the hybrid connection configuration. + :type entity_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete a + hybrid connection for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_relay_service_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'entityName': self._serialize.url("entity_name", entity_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_relay_service_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}'} # type: ignore + + def update_relay_service_connection_slot( + self, + resource_group_name, # type: str + name, # type: str + entity_name, # type: str + slot, # type: str + connection_envelope, # type: "_models.RelayServiceConnectionEntity" + **kwargs # type: Any + ): + # type: (...) -> "_models.RelayServiceConnectionEntity" + """Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). + + Description for Creates a new hybrid connection configuration (PUT), or updates an existing one + (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param entity_name: Name of the hybrid connection configuration. + :type entity_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will create or + update a hybrid connection for the production slot. + :type slot: str + :param connection_envelope: Details of the hybrid connection configuration. + :type connection_envelope: ~azure.mgmt.web.v2021_02_01.models.RelayServiceConnectionEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RelayServiceConnectionEntity, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.RelayServiceConnectionEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RelayServiceConnectionEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_relay_service_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'entityName': self._serialize.url("entity_name", entity_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'RelayServiceConnectionEntity') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RelayServiceConnectionEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_relay_service_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}'} # type: ignore + + def list_instance_identifiers_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.WebAppInstanceStatusCollection"] + """Gets all scale-out instances of an app. + + Description for Gets all scale-out instances of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API gets the + production slot instances. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebAppInstanceStatusCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.WebAppInstanceStatusCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebAppInstanceStatusCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_instance_identifiers_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WebAppInstanceStatusCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_instance_identifiers_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances'} # type: ignore + + def get_instance_info_slot( + self, + resource_group_name, # type: str + name, # type: str + instance_id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.WebSiteInstanceStatus" + """Gets all scale-out instances of an app. + + Description for Gets all scale-out instances of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param instance_id: + :type instance_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API gets the + production slot instances. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WebSiteInstanceStatus, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.WebSiteInstanceStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebSiteInstanceStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_info_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('WebSiteInstanceStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_info_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}'} # type: ignore + + def get_instance_ms_deploy_status_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.MSDeployStatus" + """Get the status of the last MSDeploy operation. + + Description for Get the status of the last MSDeploy operation. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param instance_id: ID of web app instance. + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MSDeployStatus, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.MSDeployStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_ms_deploy_status_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_ms_deploy_status_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy'} # type: ignore + + def _create_instance_ms_deploy_operation_slot_initial( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + instance_id, # type: str + ms_deploy, # type: "_models.MSDeploy" + **kwargs # type: Any + ): + # type: (...) -> "_models.MSDeployStatus" + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_instance_ms_deploy_operation_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(ms_deploy, 'MSDeploy') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_instance_ms_deploy_operation_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy'} # type: ignore + + def begin_create_instance_ms_deploy_operation_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + instance_id, # type: str + ms_deploy, # type: "_models.MSDeploy" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.MSDeployStatus"] + """Invoke the MSDeploy web app extension. + + Description for Invoke the MSDeploy web app extension. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param instance_id: ID of web app instance. + :type instance_id: str + :param ms_deploy: Details of MSDeploy operation. + :type ms_deploy: ~azure.mgmt.web.v2021_02_01.models.MSDeploy + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either MSDeployStatus or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2021_02_01.models.MSDeployStatus] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployStatus"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_instance_ms_deploy_operation_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + instance_id=instance_id, + ms_deploy=ms_deploy, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('MSDeployStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_instance_ms_deploy_operation_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy'} # type: ignore + + def get_instance_ms_deploy_log_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.MSDeployLog" + """Get the MSDeploy Log for the last MSDeploy operation. + + Description for Get the MSDeploy Log for the last MSDeploy operation. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param instance_id: ID of web app instance. + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MSDeployLog, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.MSDeployLog + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MSDeployLog"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_ms_deploy_log_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MSDeployLog', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_ms_deploy_log_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy/log'} # type: ignore + + def list_instance_processes_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ProcessInfoCollection"] + """Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. + + Description for Get list of processes for a web site, or a deployment slot, or for a specific + scaled-out instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessInfoCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.ProcessInfoCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_instance_processes_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_instance_processes_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes'} # type: ignore + + def get_instance_process_slot( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + slot, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ProcessInfo" + """Get process information by its ID for a specific scaled-out instance in a web site. + + Description for Get process information by its ID for a specific scaled-out instance in a web + site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProcessInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.ProcessInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_process_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ProcessInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_process_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}'} # type: ignore + + def delete_instance_process_slot( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + slot, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web site. + + Description for Terminate a process by its ID for a web site, or a deployment slot, or specific + scaled-out instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_instance_process_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_instance_process_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}'} # type: ignore + + def get_instance_process_dump_slot( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + slot, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> IO + """Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. + + Description for Get a memory dump of a process by its ID for a specific scaled-out instance in + a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[IO] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_process_dump_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_process_dump_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/dump'} # type: ignore + + def list_instance_process_modules_slot( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + slot, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ProcessModuleInfoCollection"] + """List module information for a process by its ID for a specific scaled-out instance in a web site. + + Description for List module information for a process by its ID for a specific scaled-out + instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessModuleInfoCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.ProcessModuleInfoCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessModuleInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_instance_process_modules_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessModuleInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_instance_process_modules_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/modules'} # type: ignore + + def get_instance_process_module_slot( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + base_address, # type: str + slot, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ProcessModuleInfo" + """Get process information by its ID for a specific scaled-out instance in a web site. + + Description for Get process information by its ID for a specific scaled-out instance in a web + site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param base_address: Module base address. + :type base_address: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProcessModuleInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.ProcessModuleInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessModuleInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_instance_process_module_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'baseAddress': self._serialize.url("base_address", base_address, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ProcessModuleInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_instance_process_module_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/modules/{baseAddress}'} # type: ignore + + def list_instance_process_threads_slot( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + slot, # type: str + instance_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ProcessThreadInfoCollection"] + """List the threads in a process by its ID for a specific scaled-out instance in a web site. + + Description for List the threads in a process by its ID for a specific scaled-out instance in a + web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :param instance_id: ID of a specific scaled-out instance. This is the value of the name + property in the JSON response from "GET api/sites/{siteName}/instances". + :type instance_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessThreadInfoCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.ProcessThreadInfoCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessThreadInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_instance_process_threads_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessThreadInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_instance_process_threads_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/threads'} # type: ignore + + def is_cloneable_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteCloneability" + """Shows whether an app can be cloned to another resource group or subscription. + + Description for Shows whether an app can be cloned to another resource group or subscription. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. By default, this API returns information on the + production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteCloneability, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SiteCloneability + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteCloneability"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.is_cloneable_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteCloneability', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + is_cloneable_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/iscloneable'} # type: ignore + + def list_site_backups_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.BackupItemCollection"] + """Gets existing backups of an app. + + Description for Gets existing backups of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get backups + of the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either BackupItemCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.BackupItemCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupItemCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_backups_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('BackupItemCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_site_backups_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/listbackups'} # type: ignore + + def list_sync_function_triggers_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.FunctionSecrets" + """This is to allow calling via powershell and ARM template. + + Description for This is to allow calling via powershell and ARM template. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FunctionSecrets, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.FunctionSecrets + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FunctionSecrets"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_sync_function_triggers_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FunctionSecrets', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_sync_function_triggers_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/listsyncfunctiontriggerstatus'} # type: ignore + + def get_migrate_my_sql_status_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.MigrateMySqlStatus" + """Returns the status of MySql in app migration, if one is active, and whether or not MySql in app is enabled. + + Description for Returns the status of MySql in app migration, if one is active, and whether or + not MySql in app is enabled. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MigrateMySqlStatus, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.MigrateMySqlStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MigrateMySqlStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_migrate_my_sql_status_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MigrateMySqlStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_migrate_my_sql_status_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/migratemysql/status'} # type: ignore + + def get_swift_virtual_network_connection_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SwiftVirtualNetwork" + """Gets a Swift Virtual Network connection. + + Description for Gets a Swift Virtual Network connection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get a + gateway for the production slot's Virtual Network. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SwiftVirtualNetwork, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SwiftVirtualNetwork + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SwiftVirtualNetwork"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_swift_virtual_network_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SwiftVirtualNetwork', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_swift_virtual_network_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork'} # type: ignore + + def create_or_update_swift_virtual_network_connection_with_check_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + connection_envelope, # type: "_models.SwiftVirtualNetwork" + **kwargs # type: Any + ): + # type: (...) -> "_models.SwiftVirtualNetwork" + """Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet has already been delegated, and is not + in use by another App Service Plan other than the one this App is in. + + Description for Integrates this Web App with a Virtual Network. This requires that 1) + "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet + has already been delegated, and is not + in use by another App Service Plan other than the one this App is in. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will add or + update connections for the production slot. + :type slot: str + :param connection_envelope: Properties of the Virtual Network connection. See example. + :type connection_envelope: ~azure.mgmt.web.v2021_02_01.models.SwiftVirtualNetwork + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SwiftVirtualNetwork, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SwiftVirtualNetwork + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SwiftVirtualNetwork"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_swift_virtual_network_connection_with_check_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'SwiftVirtualNetwork') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SwiftVirtualNetwork', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_swift_virtual_network_connection_with_check_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork'} # type: ignore + + def delete_swift_virtual_network_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a Swift Virtual Network connection from an app (or deployment slot). + + Description for Deletes a Swift Virtual Network connection from an app (or deployment slot). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + connection for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_swift_virtual_network_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_swift_virtual_network_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork'} # type: ignore + + def update_swift_virtual_network_connection_with_check_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + connection_envelope, # type: "_models.SwiftVirtualNetwork" + **kwargs # type: Any + ): + # type: (...) -> "_models.SwiftVirtualNetwork" + """Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet has already been delegated, and is not + in use by another App Service Plan other than the one this App is in. + + Description for Integrates this Web App with a Virtual Network. This requires that 1) + "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet + has already been delegated, and is not + in use by another App Service Plan other than the one this App is in. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will add or + update connections for the production slot. + :type slot: str + :param connection_envelope: Properties of the Virtual Network connection. See example. + :type connection_envelope: ~azure.mgmt.web.v2021_02_01.models.SwiftVirtualNetwork + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SwiftVirtualNetwork, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SwiftVirtualNetwork + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SwiftVirtualNetwork"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_swift_virtual_network_connection_with_check_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'SwiftVirtualNetwork') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SwiftVirtualNetwork', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_swift_virtual_network_connection_with_check_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork'} # type: ignore + + def list_network_features_slot( + self, + resource_group_name, # type: str + name, # type: str + view, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.NetworkFeatures" + """Gets all network features used by the app (or deployment slot, if specified). + + Description for Gets all network features used by the app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param view: The type of view. Only "summary" is supported at this time. + :type view: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get network + features for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkFeatures, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.NetworkFeatures + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFeatures"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_network_features_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'view': self._serialize.url("view", view, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkFeatures', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_network_features_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkFeatures/{view}'} # type: ignore + + def get_network_trace_operation_slot( + self, + resource_group_name, # type: str + name, # type: str + operation_id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> List["_models.NetworkTrace"] + """Gets a named operation for a network trace capturing (or deployment slot, if specified). + + Description for Gets a named operation for a network trace capturing (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param operation_id: GUID of the operation. + :type operation_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get an + operation for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of NetworkTrace, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2021_02_01.models.NetworkTrace] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_network_trace_operation_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_network_trace_operation_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/operationresults/{operationId}'} # type: ignore + + def start_web_site_network_trace_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + duration_in_seconds=None, # type: Optional[int] + max_frame_length=None, # type: Optional[int] + sas_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> str + """Start capturing network packets for the site (To be deprecated). + + Description for Start capturing network packets for the site (To be deprecated). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param slot: The name of the slot for this web app. + :type slot: str + :param duration_in_seconds: The duration to keep capturing in seconds. + :type duration_in_seconds: int + :param max_frame_length: The maximum frame length in bytes (Optional). + :type max_frame_length: int + :param sas_url: The Blob URL to store capture file. + :type sas_url: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: str, or the result of cls(response) + :rtype: str + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[str] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.start_web_site_network_trace_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if duration_in_seconds is not None: + query_parameters['durationInSeconds'] = self._serialize.query("duration_in_seconds", duration_in_seconds, 'int') + if max_frame_length is not None: + query_parameters['maxFrameLength'] = self._serialize.query("max_frame_length", max_frame_length, 'int') + if sas_url is not None: + query_parameters['sasUrl'] = self._serialize.query("sas_url", sas_url, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + start_web_site_network_trace_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/start'} # type: ignore + + def _start_web_site_network_trace_operation_slot_initial( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + duration_in_seconds=None, # type: Optional[int] + max_frame_length=None, # type: Optional[int] + sas_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> List["_models.NetworkTrace"] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._start_web_site_network_trace_operation_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if duration_in_seconds is not None: + query_parameters['durationInSeconds'] = self._serialize.query("duration_in_seconds", duration_in_seconds, 'int') + if max_frame_length is not None: + query_parameters['maxFrameLength'] = self._serialize.query("max_frame_length", max_frame_length, 'int') + if sas_url is not None: + query_parameters['sasUrl'] = self._serialize.query("sas_url", sas_url, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _start_web_site_network_trace_operation_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/startOperation'} # type: ignore + + def begin_start_web_site_network_trace_operation_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + duration_in_seconds=None, # type: Optional[int] + max_frame_length=None, # type: Optional[int] + sas_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> LROPoller[List["_models.NetworkTrace"]] + """Start capturing network packets for the site. + + Description for Start capturing network packets for the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param slot: The name of the slot for this web app. + :type slot: str + :param duration_in_seconds: The duration to keep capturing in seconds. + :type duration_in_seconds: int + :param max_frame_length: The maximum frame length in bytes (Optional). + :type max_frame_length: int + :param sas_url: The Blob URL to store capture file. + :type sas_url: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either list of NetworkTrace or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[list[~azure.mgmt.web.v2021_02_01.models.NetworkTrace]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._start_web_site_network_trace_operation_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + duration_in_seconds=duration_in_seconds, + max_frame_length=max_frame_length, + sas_url=sas_url, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start_web_site_network_trace_operation_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/startOperation'} # type: ignore + + def stop_web_site_network_trace_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Stop ongoing capturing network packets for the site. + + Description for Stop ongoing capturing network packets for the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param slot: The name of the slot for this web app. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.stop_web_site_network_trace_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + stop_web_site_network_trace_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/stop'} # type: ignore + + def get_network_traces_slot( + self, + resource_group_name, # type: str + name, # type: str + operation_id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> List["_models.NetworkTrace"] + """Gets a named operation for a network trace capturing (or deployment slot, if specified). + + Description for Gets a named operation for a network trace capturing (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param operation_id: GUID of the operation. + :type operation_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get an + operation for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of NetworkTrace, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2021_02_01.models.NetworkTrace] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_network_traces_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_network_traces_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/{operationId}'} # type: ignore + + def get_network_trace_operation_slot_v2( + self, + resource_group_name, # type: str + name, # type: str + operation_id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> List["_models.NetworkTrace"] + """Gets a named operation for a network trace capturing (or deployment slot, if specified). + + Description for Gets a named operation for a network trace capturing (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param operation_id: GUID of the operation. + :type operation_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get an + operation for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of NetworkTrace, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2021_02_01.models.NetworkTrace] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_network_trace_operation_slot_v2.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_network_trace_operation_slot_v2.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTraces/current/operationresults/{operationId}'} # type: ignore + + def get_network_traces_slot_v2( + self, + resource_group_name, # type: str + name, # type: str + operation_id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> List["_models.NetworkTrace"] + """Gets a named operation for a network trace capturing (or deployment slot, if specified). + + Description for Gets a named operation for a network trace capturing (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param operation_id: GUID of the operation. + :type operation_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get an + operation for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of NetworkTrace, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2021_02_01.models.NetworkTrace] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_network_traces_slot_v2.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_network_traces_slot_v2.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTraces/{operationId}'} # type: ignore + + def generate_new_site_publishing_password_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Generates a new publishing password for an app (or deployment slot, if specified). + + Description for Generates a new publishing password for an app (or deployment slot, if + specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API generate a new + publishing password for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.generate_new_site_publishing_password_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + generate_new_site_publishing_password_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/newpassword'} # type: ignore + + def list_perf_mon_counters_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.PerfMonCounterCollection"] + """Gets perfmon counters for web app. + + Description for Gets perfmon counters for web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param filter: Return only usages/metrics specified in the filter. Filter conforms to odata + syntax. Example: $filter=(startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z + and timeGrain eq duration'[Hour|Minute|Day]'. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PerfMonCounterCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.PerfMonCounterCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PerfMonCounterCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_perf_mon_counters_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('PerfMonCounterCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_perf_mon_counters_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/perfcounters'} # type: ignore + + def get_site_php_error_log_flag_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SitePhpErrorLogFlag" + """Gets web app's event logs. + + Description for Gets web app's event logs. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SitePhpErrorLogFlag, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SitePhpErrorLogFlag + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SitePhpErrorLogFlag"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_site_php_error_log_flag_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SitePhpErrorLogFlag', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_php_error_log_flag_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/phplogging'} # type: ignore + + def list_premier_add_ons_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PremierAddOn" + """Gets the premier add-ons of an app. + + Description for Gets the premier add-ons of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + premier add-ons for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PremierAddOn, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.PremierAddOn + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PremierAddOn"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_premier_add_ons_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PremierAddOn', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_premier_add_ons_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons'} # type: ignore + + def get_premier_add_on_slot( + self, + resource_group_name, # type: str + name, # type: str + premier_add_on_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PremierAddOn" + """Gets a named add-on of an app. + + Description for Gets a named add-on of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param premier_add_on_name: Add-on name. + :type premier_add_on_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + named add-on for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PremierAddOn, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.PremierAddOn + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PremierAddOn"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_premier_add_on_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PremierAddOn', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_premier_add_on_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}'} # type: ignore + + def add_premier_add_on_slot( + self, + resource_group_name, # type: str + name, # type: str + premier_add_on_name, # type: str + slot, # type: str + premier_add_on, # type: "_models.PremierAddOn" + **kwargs # type: Any + ): + # type: (...) -> "_models.PremierAddOn" + """Updates a named add-on of an app. + + Description for Updates a named add-on of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param premier_add_on_name: Add-on name. + :type premier_add_on_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + named add-on for the production slot. + :type slot: str + :param premier_add_on: A JSON representation of the edited premier add-on. + :type premier_add_on: ~azure.mgmt.web.v2021_02_01.models.PremierAddOn + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PremierAddOn, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.PremierAddOn + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PremierAddOn"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.add_premier_add_on_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(premier_add_on, 'PremierAddOn') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PremierAddOn', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + add_premier_add_on_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}'} # type: ignore + + def delete_premier_add_on_slot( + self, + resource_group_name, # type: str + name, # type: str + premier_add_on_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a premier add-on from an app. + + Description for Delete a premier add-on from an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param premier_add_on_name: Add-on name. + :type premier_add_on_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + named add-on for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_premier_add_on_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_premier_add_on_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}'} # type: ignore + + def update_premier_add_on_slot( + self, + resource_group_name, # type: str + name, # type: str + premier_add_on_name, # type: str + slot, # type: str + premier_add_on, # type: "_models.PremierAddOnPatchResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.PremierAddOn" + """Updates a named add-on of an app. + + Description for Updates a named add-on of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param premier_add_on_name: Add-on name. + :type premier_add_on_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + named add-on for the production slot. + :type slot: str + :param premier_add_on: A JSON representation of the edited premier add-on. + :type premier_add_on: ~azure.mgmt.web.v2021_02_01.models.PremierAddOnPatchResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PremierAddOn, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.PremierAddOn + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PremierAddOn"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_premier_add_on_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'premierAddOnName': self._serialize.url("premier_add_on_name", premier_add_on_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(premier_add_on, 'PremierAddOnPatchResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PremierAddOn', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_premier_add_on_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}'} # type: ignore + + def get_private_access_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateAccess" + """Gets data around private site access enablement and authorized Virtual Networks that can access the site. + + Description for Gets data around private site access enablement and authorized Virtual Networks + that can access the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param slot: The name of the slot for the web app. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateAccess, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.PrivateAccess + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateAccess"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_private_access_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateAccess', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_private_access_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateAccess/virtualNetworks'} # type: ignore + + def put_private_access_vnet_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + access, # type: "_models.PrivateAccess" + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateAccess" + """Sets data around private site access enablement and authorized Virtual Networks that can access the site. + + Description for Sets data around private site access enablement and authorized Virtual Networks + that can access the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param slot: The name of the slot for the web app. + :type slot: str + :param access: The information for the private access. + :type access: ~azure.mgmt.web.v2021_02_01.models.PrivateAccess + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateAccess, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.PrivateAccess + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateAccess"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.put_private_access_vnet_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(access, 'PrivateAccess') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateAccess', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + put_private_access_vnet_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateAccess/virtualNetworks'} # type: ignore + + def get_private_endpoint_connection_list_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.PrivateEndpointConnectionCollection"] + """Gets the list of private endpoint connections associated with a site. + + Description for Gets the list of private endpoint connections associated with a site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the site. + :type name: str + :param slot: Name of the site deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PrivateEndpointConnectionCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.PrivateEndpointConnectionCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.get_private_endpoint_connection_list_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('PrivateEndpointConnectionCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + get_private_endpoint_connection_list_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateEndpointConnections'} # type: ignore + + def get_private_endpoint_connection_slot( + self, + resource_group_name, # type: str + name, # type: str + private_endpoint_connection_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.RemotePrivateEndpointConnectionARMResource" + """Gets a private endpoint connection. + + Description for Gets a private endpoint connection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the site. + :type name: str + :param private_endpoint_connection_name: Name of the private endpoint connection. + :type private_endpoint_connection_name: str + :param slot: Name of the site deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RemotePrivateEndpointConnectionARMResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.RemotePrivateEndpointConnectionARMResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RemotePrivateEndpointConnectionARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_private_endpoint_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('RemotePrivateEndpointConnectionARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_private_endpoint_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def _approve_or_reject_private_endpoint_connection_slot_initial( + self, + resource_group_name, # type: str + name, # type: str + private_endpoint_connection_name, # type: str + slot, # type: str + private_endpoint_wrapper, # type: "_models.PrivateLinkConnectionApprovalRequestResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.RemotePrivateEndpointConnectionARMResource" + cls = kwargs.pop('cls', None) # type: ClsType["_models.RemotePrivateEndpointConnectionARMResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._approve_or_reject_private_endpoint_connection_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(private_endpoint_wrapper, 'PrivateLinkConnectionApprovalRequestResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('RemotePrivateEndpointConnectionARMResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('RemotePrivateEndpointConnectionARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _approve_or_reject_private_endpoint_connection_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def begin_approve_or_reject_private_endpoint_connection_slot( + self, + resource_group_name, # type: str + name, # type: str + private_endpoint_connection_name, # type: str + slot, # type: str + private_endpoint_wrapper, # type: "_models.PrivateLinkConnectionApprovalRequestResource" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.RemotePrivateEndpointConnectionARMResource"] + """Approves or rejects a private endpoint connection. + + Description for Approves or rejects a private endpoint connection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the site. + :type name: str + :param private_endpoint_connection_name: + :type private_endpoint_connection_name: str + :param slot: + :type slot: str + :param private_endpoint_wrapper: + :type private_endpoint_wrapper: ~azure.mgmt.web.v2021_02_01.models.PrivateLinkConnectionApprovalRequestResource + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either RemotePrivateEndpointConnectionARMResource or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2021_02_01.models.RemotePrivateEndpointConnectionARMResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RemotePrivateEndpointConnectionARMResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._approve_or_reject_private_endpoint_connection_slot_initial( + resource_group_name=resource_group_name, + name=name, + private_endpoint_connection_name=private_endpoint_connection_name, + slot=slot, + private_endpoint_wrapper=private_endpoint_wrapper, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('RemotePrivateEndpointConnectionARMResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_approve_or_reject_private_endpoint_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def _delete_private_endpoint_connection_slot_initial( + self, + resource_group_name, # type: str + name, # type: str + private_endpoint_connection_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Any + cls = kwargs.pop('cls', None) # type: ClsType[Any] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._delete_private_endpoint_connection_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('object', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('object', pipeline_response) + + if response.status_code == 204: + deserialized = self._deserialize('object', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _delete_private_endpoint_connection_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def begin_delete_private_endpoint_connection_slot( + self, + resource_group_name, # type: str + name, # type: str + private_endpoint_connection_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[Any] + """Deletes a private endpoint connection. + + Description for Deletes a private endpoint connection. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the site. + :type name: str + :param private_endpoint_connection_name: + :type private_endpoint_connection_name: str + :param slot: + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either any or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[any] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[Any] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_private_endpoint_connection_slot_initial( + resource_group_name=resource_group_name, + name=name, + private_endpoint_connection_name=private_endpoint_connection_name, + slot=slot, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('object', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete_private_endpoint_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def get_private_link_resources_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateLinkResourcesWrapper" + """Gets the private link resources. + + Description for Gets the private link resources. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the site. + :type name: str + :param slot: + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkResourcesWrapper, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.PrivateLinkResourcesWrapper + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourcesWrapper"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_private_link_resources_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateLinkResourcesWrapper', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_private_link_resources_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateLinkResources'} # type: ignore + + def list_processes_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ProcessInfoCollection"] + """Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. + + Description for Get list of processes for a web site, or a deployment slot, or for a specific + scaled-out instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessInfoCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.ProcessInfoCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_processes_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_processes_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes'} # type: ignore + + def get_process_slot( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ProcessInfo" + """Get process information by its ID for a specific scaled-out instance in a web site. + + Description for Get process information by its ID for a specific scaled-out instance in a web + site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProcessInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.ProcessInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_process_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ProcessInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_process_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}'} # type: ignore + + def delete_process_slot( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web site. + + Description for Terminate a process by its ID for a web site, or a deployment slot, or specific + scaled-out instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_process_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_process_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}'} # type: ignore + + def get_process_dump_slot( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> IO + """Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. + + Description for Get a memory dump of a process by its ID for a specific scaled-out instance in + a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[IO] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_process_dump_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_process_dump_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/dump'} # type: ignore + + def list_process_modules_slot( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ProcessModuleInfoCollection"] + """List module information for a process by its ID for a specific scaled-out instance in a web site. + + Description for List module information for a process by its ID for a specific scaled-out + instance in a web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessModuleInfoCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.ProcessModuleInfoCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessModuleInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_process_modules_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessModuleInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_process_modules_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/modules'} # type: ignore + + def get_process_module_slot( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + base_address, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ProcessModuleInfo" + """Get process information by its ID for a specific scaled-out instance in a web site. + + Description for Get process information by its ID for a specific scaled-out instance in a web + site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param base_address: Module base address. + :type base_address: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProcessModuleInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.ProcessModuleInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessModuleInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_process_module_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'baseAddress': self._serialize.url("base_address", base_address, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ProcessModuleInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_process_module_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/modules/{baseAddress}'} # type: ignore + + def list_process_threads_slot( + self, + resource_group_name, # type: str + name, # type: str + process_id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ProcessThreadInfoCollection"] + """List the threads in a process by its ID for a specific scaled-out instance in a web site. + + Description for List the threads in a process by its ID for a specific scaled-out instance in a + web site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param process_id: PID. + :type process_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProcessThreadInfoCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.ProcessThreadInfoCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProcessThreadInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_process_threads_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'processId': self._serialize.url("process_id", process_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ProcessThreadInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_process_threads_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/threads'} # type: ignore + + def list_public_certificates_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.PublicCertificateCollection"] + """Get public certificates for an app or a deployment slot. + + Description for Get public certificates for an app or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API gets hostname + bindings for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PublicCertificateCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.PublicCertificateCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicCertificateCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_public_certificates_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('PublicCertificateCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_public_certificates_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates'} # type: ignore + + def get_public_certificate_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + public_certificate_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PublicCertificate" + """Get the named public certificate for an app (or deployment slot, if specified). + + Description for Get the named public certificate for an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API the named binding + for the production slot. + :type slot: str + :param public_certificate_name: Public certificate name. + :type public_certificate_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PublicCertificate, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.PublicCertificate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicCertificate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_public_certificate_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'publicCertificateName': self._serialize.url("public_certificate_name", public_certificate_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PublicCertificate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_public_certificate_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}'} # type: ignore + + def create_or_update_public_certificate_slot( + self, + resource_group_name, # type: str + name, # type: str + public_certificate_name, # type: str + slot, # type: str + public_certificate, # type: "_models.PublicCertificate" + **kwargs # type: Any + ): + # type: (...) -> "_models.PublicCertificate" + """Creates a hostname binding for an app. + + Description for Creates a hostname binding for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param public_certificate_name: Public certificate name. + :type public_certificate_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will create a + binding for the production slot. + :type slot: str + :param public_certificate: Public certificate details. This is the JSON representation of a + PublicCertificate object. + :type public_certificate: ~azure.mgmt.web.v2021_02_01.models.PublicCertificate + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PublicCertificate, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.PublicCertificate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicCertificate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_public_certificate_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'publicCertificateName': self._serialize.url("public_certificate_name", public_certificate_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(public_certificate, 'PublicCertificate') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PublicCertificate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_public_certificate_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}'} # type: ignore + + def delete_public_certificate_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + public_certificate_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a hostname binding for an app. + + Description for Deletes a hostname binding for an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + binding for the production slot. + :type slot: str + :param public_certificate_name: Public certificate name. + :type public_certificate_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_public_certificate_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'publicCertificateName': self._serialize.url("public_certificate_name", public_certificate_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_public_certificate_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}'} # type: ignore + + def list_publishing_profile_xml_with_secrets_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + publishing_profile_options, # type: "_models.CsmPublishingProfileOptions" + **kwargs # type: Any + ): + # type: (...) -> IO + """Gets the publishing profile for an app (or deployment slot, if specified). + + Description for Gets the publishing profile for an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + publishing profile for the production slot. + :type slot: str + :param publishing_profile_options: Specifies publishingProfileOptions for publishing profile. + For example, use {"format": "FileZilla3"} to get a FileZilla publishing profile. + :type publishing_profile_options: ~azure.mgmt.web.v2021_02_01.models.CsmPublishingProfileOptions + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IO, or the result of cls(response) + :rtype: IO + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[IO] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/xml" + + # Construct URL + url = self.list_publishing_profile_xml_with_secrets_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(publishing_profile_options, 'CsmPublishingProfileOptions') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = response.stream_download(self._client._pipeline) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_publishing_profile_xml_with_secrets_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publishxml'} # type: ignore + + def reset_slot_configuration_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Resets the configuration settings of the current slot if they were previously modified by calling the API with POST. + + Description for Resets the configuration settings of the current slot if they were previously + modified by calling the API with POST. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API resets + configuration settings for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.reset_slot_configuration_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + reset_slot_configuration_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/resetSlotConfig'} # type: ignore + + def restart_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + soft_restart=None, # type: Optional[bool] + synchronous=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> None + """Restarts an app (or deployment slot, if specified). + + Description for Restarts an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will restart the + production slot. + :type slot: str + :param soft_restart: Specify true to apply the configuration settings and restarts the app only + if necessary. By default, the API always restarts and reprovisions the app. + :type soft_restart: bool + :param synchronous: Specify true to block until the app is restarted. By default, it is set to + false, and the API responds immediately (asynchronous). + :type synchronous: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.restart_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if soft_restart is not None: + query_parameters['softRestart'] = self._serialize.query("soft_restart", soft_restart, 'bool') + if synchronous is not None: + query_parameters['synchronous'] = self._serialize.query("synchronous", synchronous, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + restart_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restart'} # type: ignore + + def _restore_from_backup_blob_slot_initial( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + request, # type: "_models.RestoreRequest" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._restore_from_backup_blob_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request, 'RestoreRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _restore_from_backup_blob_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreFromBackupBlob'} # type: ignore + + def begin_restore_from_backup_blob_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + request, # type: "_models.RestoreRequest" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Restores an app from a backup blob in Azure Storage. + + Description for Restores an app from a backup blob in Azure Storage. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will restore a + backup of the production slot. + :type slot: str + :param request: Information on restore request . + :type request: ~azure.mgmt.web.v2021_02_01.models.RestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._restore_from_backup_blob_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + request=request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_restore_from_backup_blob_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreFromBackupBlob'} # type: ignore + + def _restore_from_deleted_app_slot_initial( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + restore_request, # type: "_models.DeletedAppRestoreRequest" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._restore_from_deleted_app_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(restore_request, 'DeletedAppRestoreRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _restore_from_deleted_app_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreFromDeletedApp'} # type: ignore + + def begin_restore_from_deleted_app_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + restore_request, # type: "_models.DeletedAppRestoreRequest" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Restores a deleted web app to this web app. + + Description for Restores a deleted web app to this web app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param restore_request: Deleted web app restore information. + :type restore_request: ~azure.mgmt.web.v2021_02_01.models.DeletedAppRestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._restore_from_deleted_app_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + restore_request=restore_request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_restore_from_deleted_app_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreFromDeletedApp'} # type: ignore + + def _restore_snapshot_slot_initial( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + restore_request, # type: "_models.SnapshotRestoreRequest" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._restore_snapshot_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(restore_request, 'SnapshotRestoreRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _restore_snapshot_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreSnapshot'} # type: ignore + + def begin_restore_snapshot_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + restore_request, # type: "_models.SnapshotRestoreRequest" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Restores a web app from a snapshot. + + Description for Restores a web app from a snapshot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :param restore_request: Snapshot restore settings. Snapshot information can be obtained by + calling GetDeletedSites or GetSiteSnapshots API. + :type restore_request: ~azure.mgmt.web.v2021_02_01.models.SnapshotRestoreRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._restore_snapshot_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + restore_request=restore_request, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_restore_snapshot_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreSnapshot'} # type: ignore + + def list_site_extensions_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SiteExtensionInfoCollection"] + """Get list of siteextensions for a web site, or a deployment slot. + + Description for Get list of siteextensions for a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API uses the + production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SiteExtensionInfoCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.SiteExtensionInfoCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteExtensionInfoCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_extensions_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SiteExtensionInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_site_extensions_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions'} # type: ignore + + def get_site_extension_slot( + self, + resource_group_name, # type: str + name, # type: str + site_extension_id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteExtensionInfo" + """Get site extension information by its ID for a web site, or a deployment slot. + + Description for Get site extension information by its ID for a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param site_extension_id: Site extension name. + :type site_extension_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API uses the + production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteExtensionInfo, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SiteExtensionInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteExtensionInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_site_extension_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'siteExtensionId': self._serialize.url("site_extension_id", site_extension_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteExtensionInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_site_extension_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}'} # type: ignore + + def _install_site_extension_slot_initial( + self, + resource_group_name, # type: str + name, # type: str + site_extension_id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteExtensionInfo" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteExtensionInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._install_site_extension_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'siteExtensionId': self._serialize.url("site_extension_id", site_extension_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.put(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SiteExtensionInfo', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SiteExtensionInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _install_site_extension_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}'} # type: ignore + + def begin_install_site_extension_slot( + self, + resource_group_name, # type: str + name, # type: str + site_extension_id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.SiteExtensionInfo"] + """Install site extension on a web site, or a deployment slot. + + Description for Install site extension on a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param site_extension_id: Site extension name. + :type site_extension_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API uses the + production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either SiteExtensionInfo or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2021_02_01.models.SiteExtensionInfo] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteExtensionInfo"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._install_site_extension_slot_initial( + resource_group_name=resource_group_name, + name=name, + site_extension_id=site_extension_id, + slot=slot, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('SiteExtensionInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'siteExtensionId': self._serialize.url("site_extension_id", site_extension_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_install_site_extension_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}'} # type: ignore + + def delete_site_extension_slot( + self, + resource_group_name, # type: str + name, # type: str + site_extension_id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Remove a site extension from a web site, or a deployment slot. + + Description for Remove a site extension from a web site, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param site_extension_id: Site extension name. + :type site_extension_id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API deletes a + deployment for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_site_extension_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'siteExtensionId': self._serialize.url("site_extension_id", site_extension_id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_site_extension_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}'} # type: ignore + + def list_slot_differences_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + slot_swap_entity, # type: "_models.CsmSlotEntity" + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SlotDifferenceCollection"] + """Get the difference in configuration settings between two web app slots. + + Description for Get the difference in configuration settings between two web app slots. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the source slot. If a slot is not specified, the production slot is used + as the source slot. + :type slot: str + :param slot_swap_entity: JSON object that contains the target slot name. See example. + :type slot_swap_entity: ~azure.mgmt.web.v2021_02_01.models.CsmSlotEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SlotDifferenceCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.SlotDifferenceCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SlotDifferenceCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = "application/json" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_slot_differences_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(slot_swap_entity, 'CsmSlotEntity') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(slot_swap_entity, 'CsmSlotEntity') + body_content_kwargs['content'] = body_content + request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SlotDifferenceCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_slot_differences_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotsdiffs'} # type: ignore + + def _swap_slot_initial( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + slot_swap_entity, # type: "_models.CsmSlotEntity" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._swap_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(slot_swap_entity, 'CsmSlotEntity') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _swap_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotsswap'} # type: ignore + + def begin_swap_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + slot_swap_entity, # type: "_models.CsmSlotEntity" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Swaps two deployment slots of an app. + + Description for Swaps two deployment slots of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the source slot. If a slot is not specified, the production slot is used + as the source slot. + :type slot: str + :param slot_swap_entity: JSON object that contains the target slot name. See example. + :type slot_swap_entity: ~azure.mgmt.web.v2021_02_01.models.CsmSlotEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._swap_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + slot_swap_entity=slot_swap_entity, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_swap_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotsswap'} # type: ignore + + def list_snapshots_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SnapshotCollection"] + """Returns all Snapshots to the user. + + Description for Returns all Snapshots to the user. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Website Name. + :type name: str + :param slot: Website Slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SnapshotCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.SnapshotCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_snapshots_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SnapshotCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_snapshots_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/snapshots'} # type: ignore + + def list_snapshots_from_dr_secondary_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SnapshotCollection"] + """Returns all Snapshots to the user from DRSecondary endpoint. + + Description for Returns all Snapshots to the user from DRSecondary endpoint. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Website Name. + :type name: str + :param slot: Website Slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SnapshotCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.SnapshotCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_snapshots_from_dr_secondary_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SnapshotCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_snapshots_from_dr_secondary_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/snapshotsdr'} # type: ignore + + def get_source_control_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteSourceControl" + """Gets the source control configuration of an app. + + Description for Gets the source control configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + source control configuration for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteSourceControl, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SiteSourceControl + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteSourceControl"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_source_control_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_source_control_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web'} # type: ignore + + def _create_or_update_source_control_slot_initial( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + site_source_control, # type: "_models.SiteSourceControl" + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteSourceControl" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteSourceControl"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_source_control_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_source_control, 'SiteSourceControl') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_source_control_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web'} # type: ignore + + def begin_create_or_update_source_control_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + site_source_control, # type: "_models.SiteSourceControl" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.SiteSourceControl"] + """Updates the source control configuration of an app. + + Description for Updates the source control configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + source control configuration for the production slot. + :type slot: str + :param site_source_control: JSON representation of a SiteSourceControl object. See example. + :type site_source_control: ~azure.mgmt.web.v2021_02_01.models.SiteSourceControl + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either SiteSourceControl or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2021_02_01.models.SiteSourceControl] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteSourceControl"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_source_control_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + site_source_control=site_source_control, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update_source_control_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web'} # type: ignore + + def delete_source_control_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + additional_flags=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes the source control configuration of an app. + + Description for Deletes the source control configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + source control configuration for the production slot. + :type slot: str + :param additional_flags: + :type additional_flags: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_source_control_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if additional_flags is not None: + query_parameters['additionalFlags'] = self._serialize.query("additional_flags", additional_flags, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_source_control_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web'} # type: ignore + + def update_source_control_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + site_source_control, # type: "_models.SiteSourceControl" + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteSourceControl" + """Updates the source control configuration of an app. + + Description for Updates the source control configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will update the + source control configuration for the production slot. + :type slot: str + :param site_source_control: JSON representation of a SiteSourceControl object. See example. + :type site_source_control: ~azure.mgmt.web.v2021_02_01.models.SiteSourceControl + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteSourceControl, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SiteSourceControl + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteSourceControl"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_source_control_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_source_control, 'SiteSourceControl') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_source_control_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web'} # type: ignore + + def start_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Starts an app (or deployment slot, if specified). + + Description for Starts an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will start the + production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.start_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + start_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/start'} # type: ignore + + def _start_network_trace_slot_initial( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + duration_in_seconds=None, # type: Optional[int] + max_frame_length=None, # type: Optional[int] + sas_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> List["_models.NetworkTrace"] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._start_network_trace_slot_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if duration_in_seconds is not None: + query_parameters['durationInSeconds'] = self._serialize.query("duration_in_seconds", duration_in_seconds, 'int') + if max_frame_length is not None: + query_parameters['maxFrameLength'] = self._serialize.query("max_frame_length", max_frame_length, 'int') + if sas_url is not None: + query_parameters['sasUrl'] = self._serialize.query("sas_url", sas_url, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _start_network_trace_slot_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/startNetworkTrace'} # type: ignore + + def begin_start_network_trace_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + duration_in_seconds=None, # type: Optional[int] + max_frame_length=None, # type: Optional[int] + sas_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> LROPoller[List["_models.NetworkTrace"]] + """Start capturing network packets for the site. + + Description for Start capturing network packets for the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param slot: The name of the slot for this web app. + :type slot: str + :param duration_in_seconds: The duration to keep capturing in seconds. + :type duration_in_seconds: int + :param max_frame_length: The maximum frame length in bytes (Optional). + :type max_frame_length: int + :param sas_url: The Blob URL to store capture file. + :type sas_url: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either list of NetworkTrace or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[list[~azure.mgmt.web.v2021_02_01.models.NetworkTrace]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._start_network_trace_slot_initial( + resource_group_name=resource_group_name, + name=name, + slot=slot, + duration_in_seconds=duration_in_seconds, + max_frame_length=max_frame_length, + sas_url=sas_url, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start_network_trace_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/startNetworkTrace'} # type: ignore + + def stop_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Stops an app (or deployment slot, if specified). + + Description for Stops an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will stop the + production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.stop_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + stop_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/stop'} # type: ignore + + def stop_network_trace_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Stop ongoing capturing network packets for the site. + + Description for Stop ongoing capturing network packets for the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param slot: The name of the slot for this web app. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.stop_network_trace_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + stop_network_trace_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/stopNetworkTrace'} # type: ignore + + def sync_repository_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Sync web app repository. + + Description for Sync web app repository. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :param slot: Name of web app slot. If not specified then will default to production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.sync_repository_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + sync_repository_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sync'} # type: ignore + + def sync_function_triggers_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Syncs function trigger metadata to the management database. + + Description for Syncs function trigger metadata to the management database. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.sync_function_triggers_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + sync_function_triggers_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/syncfunctiontriggers'} # type: ignore + + def list_triggered_web_jobs_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.TriggeredWebJobCollection"] + """List triggered web jobs for an app, or a deployment slot. + + Description for List triggered web jobs for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API deletes a + deployment for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either TriggeredWebJobCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.TriggeredWebJobCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TriggeredWebJobCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_triggered_web_jobs_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('TriggeredWebJobCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_triggered_web_jobs_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs'} # type: ignore + + def get_triggered_web_job_slot( + self, + resource_group_name, # type: str + name, # type: str + web_job_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.TriggeredWebJob" + """Gets a triggered web job by its ID for an app, or a deployment slot. + + Description for Gets a triggered web job by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API uses the + production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TriggeredWebJob, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.TriggeredWebJob + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TriggeredWebJob"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_triggered_web_job_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('TriggeredWebJob', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_triggered_web_job_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}'} # type: ignore + + def delete_triggered_web_job_slot( + self, + resource_group_name, # type: str + name, # type: str + web_job_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a triggered web job by its ID for an app, or a deployment slot. + + Description for Delete a triggered web job by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API deletes web job + for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_triggered_web_job_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_triggered_web_job_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}'} # type: ignore + + def list_triggered_web_job_history_slot( + self, + resource_group_name, # type: str + name, # type: str + web_job_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.TriggeredJobHistoryCollection"] + """List a triggered web job's history for an app, or a deployment slot. + + Description for List a triggered web job's history for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API uses the + production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either TriggeredJobHistoryCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.TriggeredJobHistoryCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TriggeredJobHistoryCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_triggered_web_job_history_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('TriggeredJobHistoryCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_triggered_web_job_history_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/history'} # type: ignore + + def get_triggered_web_job_history_slot( + self, + resource_group_name, # type: str + name, # type: str + web_job_name, # type: str + id, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.TriggeredJobHistory" + """Gets a triggered web job's history by its ID for an app, , or a deployment slot. + + Description for Gets a triggered web job's history by its ID for an app, , or a deployment + slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param id: History ID. + :type id: str + :param slot: Name of the deployment slot. If a slot is not specified, the API uses the + production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TriggeredJobHistory, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.TriggeredJobHistory + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TriggeredJobHistory"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_triggered_web_job_history_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('TriggeredJobHistory', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_triggered_web_job_history_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/history/{id}'} # type: ignore + + def run_triggered_web_job_slot( + self, + resource_group_name, # type: str + name, # type: str + web_job_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Run a triggered web job for an app, or a deployment slot. + + Description for Run a triggered web job for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API uses the + production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.run_triggered_web_job_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + run_triggered_web_job_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/run'} # type: ignore + + def list_usages_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.CsmUsageQuotaCollection"] + """Gets the quota usage information of an app (or deployment slot, if specified). + + Description for Gets the quota usage information of an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get quota + information of the production slot. + :type slot: str + :param filter: Return only information specified in the filter (using OData syntax). For + example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq + 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + duration'[Hour|Minute|Day]'. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CsmUsageQuotaCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.CsmUsageQuotaCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmUsageQuotaCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_usages_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('CsmUsageQuotaCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_usages_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/usages'} # type: ignore + + def list_vnet_connections_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> List["_models.VnetInfoResource"] + """Gets the virtual networks the app (or deployment slot) is connected to. + + Description for Gets the virtual networks the app (or deployment slot) is connected to. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get virtual + network connections for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of VnetInfoResource, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2021_02_01.models.VnetInfoResource] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VnetInfoResource"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_vnet_connections_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[VnetInfoResource]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_vnet_connections_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections'} # type: ignore + + def get_vnet_connection_slot( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.VnetInfoResource" + """Gets a virtual network the app (or deployment slot) is connected to by name. + + Description for Gets a virtual network the app (or deployment slot) is connected to by name. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of the virtual network. + :type vnet_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get the + named virtual network for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetInfoResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.VnetInfoResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetInfoResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_vnet_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetInfoResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_vnet_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}'} # type: ignore + + def create_or_update_vnet_connection_slot( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + slot, # type: str + connection_envelope, # type: "_models.VnetInfoResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.VnetInfoResource" + """Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). + + Description for Adds a Virtual Network connection to an app or slot (PUT) or updates the + connection properties (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of an existing Virtual Network. + :type vnet_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will add or + update connections for the production slot. + :type slot: str + :param connection_envelope: Properties of the Virtual Network connection. See example. + :type connection_envelope: ~azure.mgmt.web.v2021_02_01.models.VnetInfoResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetInfoResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.VnetInfoResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetInfoResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_vnet_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'VnetInfoResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetInfoResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_vnet_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}'} # type: ignore + + def delete_vnet_connection_slot( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a connection from an app (or deployment slot to a named virtual network. + + Description for Deletes a connection from an app (or deployment slot to a named virtual + network. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of the virtual network. + :type vnet_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will delete the + connection for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_vnet_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_vnet_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}'} # type: ignore + + def update_vnet_connection_slot( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + slot, # type: str + connection_envelope, # type: "_models.VnetInfoResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.VnetInfoResource" + """Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). + + Description for Adds a Virtual Network connection to an app or slot (PUT) or updates the + connection properties (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of an existing Virtual Network. + :type vnet_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will add or + update connections for the production slot. + :type slot: str + :param connection_envelope: Properties of the Virtual Network connection. See example. + :type connection_envelope: ~azure.mgmt.web.v2021_02_01.models.VnetInfoResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetInfoResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.VnetInfoResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetInfoResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_vnet_connection_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'VnetInfoResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetInfoResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_vnet_connection_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}'} # type: ignore + + def get_vnet_connection_gateway_slot( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + gateway_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.VnetGateway" + """Gets an app's Virtual Network gateway. + + Description for Gets an app's Virtual Network gateway. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param gateway_name: Name of the gateway. Currently, the only supported string is "primary". + :type gateway_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will get a + gateway for the production slot's Virtual Network. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetGateway, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.VnetGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_vnet_connection_gateway_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_vnet_connection_gateway_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'} # type: ignore + + def create_or_update_vnet_connection_gateway_slot( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + gateway_name, # type: str + slot, # type: str + connection_envelope, # type: "_models.VnetGateway" + **kwargs # type: Any + ): + # type: (...) -> "_models.VnetGateway" + """Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + + Description for Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param gateway_name: Name of the gateway. Currently, the only supported string is "primary". + :type gateway_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will add or + update a gateway for the production slot's Virtual Network. + :type slot: str + :param connection_envelope: The properties to update this gateway with. + :type connection_envelope: ~azure.mgmt.web.v2021_02_01.models.VnetGateway + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetGateway, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.VnetGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_vnet_connection_gateway_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'VnetGateway') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_vnet_connection_gateway_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'} # type: ignore + + def update_vnet_connection_gateway_slot( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + gateway_name, # type: str + slot, # type: str + connection_envelope, # type: "_models.VnetGateway" + **kwargs # type: Any + ): + # type: (...) -> "_models.VnetGateway" + """Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + + Description for Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param gateway_name: Name of the gateway. Currently, the only supported string is "primary". + :type gateway_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API will add or + update a gateway for the production slot's Virtual Network. + :type slot: str + :param connection_envelope: The properties to update this gateway with. + :type connection_envelope: ~azure.mgmt.web.v2021_02_01.models.VnetGateway + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetGateway, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.VnetGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_vnet_connection_gateway_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'VnetGateway') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_vnet_connection_gateway_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'} # type: ignore + + def list_web_jobs_slot( + self, + resource_group_name, # type: str + name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.WebJobCollection"] + """List webjobs for an app, or a deployment slot. + + Description for List webjobs for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebJobCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.WebJobCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebJobCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_web_jobs_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WebJobCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_web_jobs_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/webjobs'} # type: ignore + + def get_web_job_slot( + self, + resource_group_name, # type: str + name, # type: str + web_job_name, # type: str + slot, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.WebJob" + """Get webjob information for an app, or a deployment slot. + + Description for Get webjob information for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of the web job. + :type web_job_name: str + :param slot: Name of the deployment slot. If a slot is not specified, the API returns + deployments for the production slot. + :type slot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WebJob, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.WebJob + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebJob"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_web_job_slot.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'slot': self._serialize.url("slot", slot, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('WebJob', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_web_job_slot.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/webjobs/{webJobName}'} # type: ignore + + def list_slot_differences_from_production( + self, + resource_group_name, # type: str + name, # type: str + slot_swap_entity, # type: "_models.CsmSlotEntity" + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SlotDifferenceCollection"] + """Get the difference in configuration settings between two web app slots. + + Description for Get the difference in configuration settings between two web app slots. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot_swap_entity: JSON object that contains the target slot name. See example. + :type slot_swap_entity: ~azure.mgmt.web.v2021_02_01.models.CsmSlotEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SlotDifferenceCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.SlotDifferenceCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SlotDifferenceCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = "application/json" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_slot_differences_from_production.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(slot_swap_entity, 'CsmSlotEntity') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(slot_swap_entity, 'CsmSlotEntity') + body_content_kwargs['content'] = body_content + request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SlotDifferenceCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_slot_differences_from_production.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotsdiffs'} # type: ignore + + def _swap_slot_with_production_initial( + self, + resource_group_name, # type: str + name, # type: str + slot_swap_entity, # type: "_models.CsmSlotEntity" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._swap_slot_with_production_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(slot_swap_entity, 'CsmSlotEntity') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _swap_slot_with_production_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotsswap'} # type: ignore + + def begin_swap_slot_with_production( + self, + resource_group_name, # type: str + name, # type: str + slot_swap_entity, # type: "_models.CsmSlotEntity" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Swaps two deployment slots of an app. + + Description for Swaps two deployment slots of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param slot_swap_entity: JSON object that contains the target slot name. See example. + :type slot_swap_entity: ~azure.mgmt.web.v2021_02_01.models.CsmSlotEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._swap_slot_with_production_initial( + resource_group_name=resource_group_name, + name=name, + slot_swap_entity=slot_swap_entity, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_swap_slot_with_production.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotsswap'} # type: ignore + + def list_snapshots( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SnapshotCollection"] + """Returns all Snapshots to the user. + + Description for Returns all Snapshots to the user. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Website Name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SnapshotCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.SnapshotCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_snapshots.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SnapshotCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_snapshots.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/snapshots'} # type: ignore + + def list_snapshots_from_dr_secondary( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SnapshotCollection"] + """Returns all Snapshots to the user from DRSecondary endpoint. + + Description for Returns all Snapshots to the user from DRSecondary endpoint. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Website Name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SnapshotCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.SnapshotCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_snapshots_from_dr_secondary.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SnapshotCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_snapshots_from_dr_secondary.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/snapshotsdr'} # type: ignore + + def get_source_control( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteSourceControl" + """Gets the source control configuration of an app. + + Description for Gets the source control configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteSourceControl, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SiteSourceControl + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteSourceControl"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_source_control.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_source_control.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web'} # type: ignore + + def _create_or_update_source_control_initial( + self, + resource_group_name, # type: str + name, # type: str + site_source_control, # type: "_models.SiteSourceControl" + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteSourceControl" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteSourceControl"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_source_control_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_source_control, 'SiteSourceControl') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_source_control_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web'} # type: ignore + + def begin_create_or_update_source_control( + self, + resource_group_name, # type: str + name, # type: str + site_source_control, # type: "_models.SiteSourceControl" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.SiteSourceControl"] + """Updates the source control configuration of an app. + + Description for Updates the source control configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param site_source_control: JSON representation of a SiteSourceControl object. See example. + :type site_source_control: ~azure.mgmt.web.v2021_02_01.models.SiteSourceControl + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either SiteSourceControl or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.web.v2021_02_01.models.SiteSourceControl] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteSourceControl"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_source_control_initial( + resource_group_name=resource_group_name, + name=name, + site_source_control=site_source_control, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update_source_control.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web'} # type: ignore + + def delete_source_control( + self, + resource_group_name, # type: str + name, # type: str + additional_flags=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes the source control configuration of an app. + + Description for Deletes the source control configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param additional_flags: + :type additional_flags: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_source_control.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if additional_flags is not None: + query_parameters['additionalFlags'] = self._serialize.query("additional_flags", additional_flags, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_source_control.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web'} # type: ignore + + def update_source_control( + self, + resource_group_name, # type: str + name, # type: str + site_source_control, # type: "_models.SiteSourceControl" + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteSourceControl" + """Updates the source control configuration of an app. + + Description for Updates the source control configuration of an app. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param site_source_control: JSON representation of a SiteSourceControl object. See example. + :type site_source_control: ~azure.mgmt.web.v2021_02_01.models.SiteSourceControl + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteSourceControl, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SiteSourceControl + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteSourceControl"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_source_control.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(site_source_control, 'SiteSourceControl') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('SiteSourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_source_control.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web'} # type: ignore + + def start( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Starts an app (or deployment slot, if specified). + + Description for Starts an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.start.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/start'} # type: ignore + + def _start_network_trace_initial( + self, + resource_group_name, # type: str + name, # type: str + duration_in_seconds=None, # type: Optional[int] + max_frame_length=None, # type: Optional[int] + sas_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> List["_models.NetworkTrace"] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self._start_network_trace_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if duration_in_seconds is not None: + query_parameters['durationInSeconds'] = self._serialize.query("duration_in_seconds", duration_in_seconds, 'int') + if max_frame_length is not None: + query_parameters['maxFrameLength'] = self._serialize.query("max_frame_length", max_frame_length, 'int') + if sas_url is not None: + query_parameters['sasUrl'] = self._serialize.query("sas_url", sas_url, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _start_network_trace_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/startNetworkTrace'} # type: ignore + + def begin_start_network_trace( + self, + resource_group_name, # type: str + name, # type: str + duration_in_seconds=None, # type: Optional[int] + max_frame_length=None, # type: Optional[int] + sas_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> LROPoller[List["_models.NetworkTrace"]] + """Start capturing network packets for the site. + + Description for Start capturing network packets for the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :param duration_in_seconds: The duration to keep capturing in seconds. + :type duration_in_seconds: int + :param max_frame_length: The maximum frame length in bytes (Optional). + :type max_frame_length: int + :param sas_url: The Blob URL to store capture file. + :type sas_url: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either list of NetworkTrace or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[list[~azure.mgmt.web.v2021_02_01.models.NetworkTrace]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkTrace"]] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._start_network_trace_initial( + resource_group_name=resource_group_name, + name=name, + duration_in_seconds=duration_in_seconds, + max_frame_length=max_frame_length, + sas_url=sas_url, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('[NetworkTrace]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start_network_trace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/startNetworkTrace'} # type: ignore + + def stop( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Stops an app (or deployment slot, if specified). + + Description for Stops an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.stop.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/stop'} # type: ignore + + def stop_network_trace( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Stop ongoing capturing network packets for the site. + + Description for Stop ongoing capturing network packets for the site. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: The name of the web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.stop_network_trace.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + stop_network_trace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/stopNetworkTrace'} # type: ignore + + def sync_repository( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Sync web app repository. + + Description for Sync web app repository. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of web app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.sync_repository.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + sync_repository.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sync'} # type: ignore + + def sync_function_triggers( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Syncs function trigger metadata to the management database. + + Description for Syncs function trigger metadata to the management database. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.sync_function_triggers.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + sync_function_triggers.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/syncfunctiontriggers'} # type: ignore + + def list_triggered_web_jobs( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.TriggeredWebJobCollection"] + """List triggered web jobs for an app, or a deployment slot. + + Description for List triggered web jobs for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either TriggeredWebJobCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.TriggeredWebJobCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TriggeredWebJobCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_triggered_web_jobs.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('TriggeredWebJobCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_triggered_web_jobs.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs'} # type: ignore + + def get_triggered_web_job( + self, + resource_group_name, # type: str + name, # type: str + web_job_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.TriggeredWebJob" + """Gets a triggered web job by its ID for an app, or a deployment slot. + + Description for Gets a triggered web job by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TriggeredWebJob, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.TriggeredWebJob + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TriggeredWebJob"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_triggered_web_job.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('TriggeredWebJob', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_triggered_web_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}'} # type: ignore + + def delete_triggered_web_job( + self, + resource_group_name, # type: str + name, # type: str + web_job_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a triggered web job by its ID for an app, or a deployment slot. + + Description for Delete a triggered web job by its ID for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_triggered_web_job.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_triggered_web_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}'} # type: ignore + + def list_triggered_web_job_history( + self, + resource_group_name, # type: str + name, # type: str + web_job_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.TriggeredJobHistoryCollection"] + """List a triggered web job's history for an app, or a deployment slot. + + Description for List a triggered web job's history for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either TriggeredJobHistoryCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.TriggeredJobHistoryCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TriggeredJobHistoryCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_triggered_web_job_history.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('TriggeredJobHistoryCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_triggered_web_job_history.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}/history'} # type: ignore + + def get_triggered_web_job_history( + self, + resource_group_name, # type: str + name, # type: str + web_job_name, # type: str + id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.TriggeredJobHistory" + """Gets a triggered web job's history by its ID for an app, , or a deployment slot. + + Description for Gets a triggered web job's history by its ID for an app, , or a deployment + slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :param id: History ID. + :type id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TriggeredJobHistory, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.TriggeredJobHistory + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TriggeredJobHistory"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_triggered_web_job_history.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'id': self._serialize.url("id", id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('TriggeredJobHistory', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_triggered_web_job_history.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}/history/{id}'} # type: ignore + + def run_triggered_web_job( + self, + resource_group_name, # type: str + name, # type: str + web_job_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Run a triggered web job for an app, or a deployment slot. + + Description for Run a triggered web job for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of Web Job. + :type web_job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.run_triggered_web_job.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + run_triggered_web_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}/run'} # type: ignore + + def list_usages( + self, + resource_group_name, # type: str + name, # type: str + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.CsmUsageQuotaCollection"] + """Gets the quota usage information of an app (or deployment slot, if specified). + + Description for Gets the quota usage information of an app (or deployment slot, if specified). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param filter: Return only information specified in the filter (using OData syntax). For + example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq + 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + duration'[Hour|Minute|Day]'. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CsmUsageQuotaCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.CsmUsageQuotaCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CsmUsageQuotaCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_usages.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str', skip_quote=True) + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('CsmUsageQuotaCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_usages.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/usages'} # type: ignore + + def list_vnet_connections( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> List["_models.VnetInfoResource"] + """Gets the virtual networks the app (or deployment slot) is connected to. + + Description for Gets the virtual networks the app (or deployment slot) is connected to. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of VnetInfoResource, or the result of cls(response) + :rtype: list[~azure.mgmt.web.v2021_02_01.models.VnetInfoResource] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["_models.VnetInfoResource"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_vnet_connections.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[VnetInfoResource]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_vnet_connections.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections'} # type: ignore + + def get_vnet_connection( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.VnetInfoResource" + """Gets a virtual network the app (or deployment slot) is connected to by name. + + Description for Gets a virtual network the app (or deployment slot) is connected to by name. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of the virtual network. + :type vnet_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetInfoResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.VnetInfoResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetInfoResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_vnet_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetInfoResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_vnet_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}'} # type: ignore + + def create_or_update_vnet_connection( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + connection_envelope, # type: "_models.VnetInfoResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.VnetInfoResource" + """Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). + + Description for Adds a Virtual Network connection to an app or slot (PUT) or updates the + connection properties (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of an existing Virtual Network. + :type vnet_name: str + :param connection_envelope: Properties of the Virtual Network connection. See example. + :type connection_envelope: ~azure.mgmt.web.v2021_02_01.models.VnetInfoResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetInfoResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.VnetInfoResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetInfoResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_vnet_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'VnetInfoResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetInfoResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_vnet_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}'} # type: ignore + + def delete_vnet_connection( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a connection from an app (or deployment slot to a named virtual network. + + Description for Deletes a connection from an app (or deployment slot to a named virtual + network. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of the virtual network. + :type vnet_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.delete_vnet_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_vnet_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}'} # type: ignore + + def update_vnet_connection( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + connection_envelope, # type: "_models.VnetInfoResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.VnetInfoResource" + """Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). + + Description for Adds a Virtual Network connection to an app or slot (PUT) or updates the + connection properties (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of an existing Virtual Network. + :type vnet_name: str + :param connection_envelope: Properties of the Virtual Network connection. See example. + :type connection_envelope: ~azure.mgmt.web.v2021_02_01.models.VnetInfoResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetInfoResource, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.VnetInfoResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetInfoResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_vnet_connection.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'VnetInfoResource') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetInfoResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_vnet_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}'} # type: ignore + + def get_vnet_connection_gateway( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + gateway_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.VnetGateway" + """Gets an app's Virtual Network gateway. + + Description for Gets an app's Virtual Network gateway. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param gateway_name: Name of the gateway. Currently, the only supported string is "primary". + :type gateway_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetGateway, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.VnetGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_vnet_connection_gateway.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_vnet_connection_gateway.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'} # type: ignore + + def create_or_update_vnet_connection_gateway( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + gateway_name, # type: str + connection_envelope, # type: "_models.VnetGateway" + **kwargs # type: Any + ): + # type: (...) -> "_models.VnetGateway" + """Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + + Description for Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param gateway_name: Name of the gateway. Currently, the only supported string is "primary". + :type gateway_name: str + :param connection_envelope: The properties to update this gateway with. + :type connection_envelope: ~azure.mgmt.web.v2021_02_01.models.VnetGateway + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetGateway, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.VnetGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_vnet_connection_gateway.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'VnetGateway') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_vnet_connection_gateway.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'} # type: ignore + + def update_vnet_connection_gateway( + self, + resource_group_name, # type: str + name, # type: str + vnet_name, # type: str + gateway_name, # type: str + connection_envelope, # type: "_models.VnetGateway" + **kwargs # type: Any + ): + # type: (...) -> "_models.VnetGateway" + """Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + + Description for Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Name of the app. + :type name: str + :param vnet_name: Name of the Virtual Network. + :type vnet_name: str + :param gateway_name: Name of the gateway. Currently, the only supported string is "primary". + :type gateway_name: str + :param connection_envelope: The properties to update this gateway with. + :type connection_envelope: ~azure.mgmt.web.v2021_02_01.models.VnetGateway + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetGateway, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.VnetGateway + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetGateway"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_vnet_connection_gateway.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'vnetName': self._serialize.url("vnet_name", vnet_name, 'str'), + 'gatewayName': self._serialize.url("gateway_name", gateway_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(connection_envelope, 'VnetGateway') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetGateway', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_vnet_connection_gateway.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'} # type: ignore + + def list_web_jobs( + self, + resource_group_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.WebJobCollection"] + """List webjobs for an app, or a deployment slot. + + Description for List webjobs for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WebJobCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.WebJobCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebJobCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_web_jobs.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WebJobCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_web_jobs.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/webjobs'} # type: ignore + + def get_web_job( + self, + resource_group_name, # type: str + name, # type: str + web_job_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.WebJob" + """Get webjob information for an app, or a deployment slot. + + Description for Get webjob information for an app, or a deployment slot. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param name: Site name. + :type name: str + :param web_job_name: Name of the web job. + :type web_job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WebJob, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.WebJob + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WebJob"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_web_job.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'name': self._serialize.url("name", name, 'str'), + 'webJobName': self._serialize.url("web_job_name", web_job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('WebJob', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_web_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/webjobs/{webJobName}'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_web_site_management_client_operations.py b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_web_site_management_client_operations.py new file mode 100644 index 000000000000..2d4da8d294ee --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/operations/_web_site_management_client_operations.py @@ -0,0 +1,1142 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class WebSiteManagementClientOperationsMixin(object): + + def generate_github_access_token_for_appservice_cli_async( + self, + code, # type: str + state, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.AppserviceGithubToken" + """Exchange code for GitHub access token for AppService CLI. + + Description for Exchange code for GitHub access token for AppService CLI. + + :param code: Code string to exchange for Github Access token. + :type code: str + :param state: State string used for verification. + :type state: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AppserviceGithubToken, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.AppserviceGithubToken + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AppserviceGithubToken"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + _request = _models.AppserviceGithubTokenRequest(code=code, state=state) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.generate_github_access_token_for_appservice_cli_async.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_request, 'AppserviceGithubTokenRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AppserviceGithubToken', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + generate_github_access_token_for_appservice_cli_async.metadata = {'url': '/providers/Microsoft.Web/generateGithubAccessTokenForAppserviceCLI'} # type: ignore + + def get_publishing_user( + self, + **kwargs # type: Any + ): + # type: (...) -> "_models.User" + """Gets publishing user. + + Description for Gets publishing user. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: User, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.User + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_publishing_user.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_publishing_user.metadata = {'url': '/providers/Microsoft.Web/publishingUsers/web'} # type: ignore + + def update_publishing_user( + self, + user_details, # type: "_models.User" + **kwargs # type: Any + ): + # type: (...) -> "_models.User" + """Updates publishing user. + + Description for Updates publishing user. + + :param user_details: Details of publishing user. + :type user_details: ~azure.mgmt.web.v2021_02_01.models.User + :keyword callable cls: A custom type or function that will be passed the direct response + :return: User, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.User + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.User"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_publishing_user.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(user_details, 'User') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('User', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_publishing_user.metadata = {'url': '/providers/Microsoft.Web/publishingUsers/web'} # type: ignore + + def list_source_controls( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SourceControlCollection"] + """Gets the source controls available for Azure websites. + + Description for Gets the source controls available for Azure websites. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SourceControlCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.SourceControlCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControlCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_source_controls.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SourceControlCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_source_controls.metadata = {'url': '/providers/Microsoft.Web/sourcecontrols'} # type: ignore + + def get_source_control( + self, + source_control_type, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SourceControl" + """Gets source control token. + + Description for Gets source control token. + + :param source_control_type: Type of source control. + :type source_control_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SourceControl, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SourceControl + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControl"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_source_control.metadata['url'] # type: ignore + path_format_arguments = { + 'sourceControlType': self._serialize.url("source_control_type", source_control_type, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_source_control.metadata = {'url': '/providers/Microsoft.Web/sourcecontrols/{sourceControlType}'} # type: ignore + + def update_source_control( + self, + source_control_type, # type: str + request_message, # type: "_models.SourceControl" + **kwargs # type: Any + ): + # type: (...) -> "_models.SourceControl" + """Updates source control token. + + Description for Updates source control token. + + :param source_control_type: Type of source control. + :type source_control_type: str + :param request_message: Source control token information. + :type request_message: ~azure.mgmt.web.v2021_02_01.models.SourceControl + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SourceControl, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SourceControl + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SourceControl"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_source_control.metadata['url'] # type: ignore + path_format_arguments = { + 'sourceControlType': self._serialize.url("source_control_type", source_control_type, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request_message, 'SourceControl') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SourceControl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_source_control.metadata = {'url': '/providers/Microsoft.Web/sourcecontrols/{sourceControlType}'} # type: ignore + + def list_billing_meters( + self, + billing_location=None, # type: Optional[str] + os_type=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.BillingMeterCollection"] + """Gets a list of meters for a given location. + + Description for Gets a list of meters for a given location. + + :param billing_location: Azure Location of billable resource. + :type billing_location: str + :param os_type: App Service OS type meters used for. + :type os_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either BillingMeterCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.BillingMeterCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BillingMeterCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_billing_meters.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if billing_location is not None: + query_parameters['billingLocation'] = self._serialize.query("billing_location", billing_location, 'str') + if os_type is not None: + query_parameters['osType'] = self._serialize.query("os_type", os_type, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('BillingMeterCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_billing_meters.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/billingMeters'} # type: ignore + + def check_name_availability( + self, + name, # type: str + type, # type: Union[str, "_models.CheckNameResourceTypes"] + is_fqdn=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> "_models.ResourceNameAvailability" + """Check if a resource name is available. + + Description for Check if a resource name is available. + + :param name: Resource name to verify. + :type name: str + :param type: Resource type used for verification. + :type type: str or ~azure.mgmt.web.v2021_02_01.models.CheckNameResourceTypes + :param is_fqdn: Is fully qualified domain name. + :type is_fqdn: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ResourceNameAvailability, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.ResourceNameAvailability + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceNameAvailability"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + _request = _models.ResourceNameAvailabilityRequest(name=name, type=type, is_fqdn=is_fqdn) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.check_name_availability.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_request, 'ResourceNameAvailabilityRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ResourceNameAvailability', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/checknameavailability'} # type: ignore + + def get_subscription_deployment_locations( + self, + **kwargs # type: Any + ): + # type: (...) -> "_models.DeploymentLocations" + """Gets list of available geo regions plus ministamps. + + Description for Gets list of available geo regions plus ministamps. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DeploymentLocations, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.DeploymentLocations + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DeploymentLocations"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.get_subscription_deployment_locations.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DeploymentLocations', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_subscription_deployment_locations.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/deploymentLocations'} # type: ignore + + def list_geo_regions( + self, + sku=None, # type: Optional[Union[str, "_models.SkuName"]] + linux_workers_enabled=None, # type: Optional[bool] + xenon_workers_enabled=None, # type: Optional[bool] + linux_dynamic_workers_enabled=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.GeoRegionCollection"] + """Get a list of available geographical regions. + + Description for Get a list of available geographical regions. + + :param sku: Name of SKU used to filter the regions. + :type sku: str or ~azure.mgmt.web.v2021_02_01.models.SkuName + :param linux_workers_enabled: Specify :code:`true` if you want to filter to only + regions that support Linux workers. + :type linux_workers_enabled: bool + :param xenon_workers_enabled: Specify :code:`true` if you want to filter to only + regions that support Xenon workers. + :type xenon_workers_enabled: bool + :param linux_dynamic_workers_enabled: Specify :code:`true` if you want to filter + to only regions that support Linux Consumption Workers. + :type linux_dynamic_workers_enabled: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either GeoRegionCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.GeoRegionCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GeoRegionCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_geo_regions.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if sku is not None: + query_parameters['sku'] = self._serialize.query("sku", sku, 'str') + if linux_workers_enabled is not None: + query_parameters['linuxWorkersEnabled'] = self._serialize.query("linux_workers_enabled", linux_workers_enabled, 'bool') + if xenon_workers_enabled is not None: + query_parameters['xenonWorkersEnabled'] = self._serialize.query("xenon_workers_enabled", xenon_workers_enabled, 'bool') + if linux_dynamic_workers_enabled is not None: + query_parameters['linuxDynamicWorkersEnabled'] = self._serialize.query("linux_dynamic_workers_enabled", linux_dynamic_workers_enabled, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('GeoRegionCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_geo_regions.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/geoRegions'} # type: ignore + + def list_site_identifiers_assigned_to_host_name( + self, + name_identifier, # type: "_models.NameIdentifier" + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.IdentifierCollection"] + """List all apps that are assigned to a hostname. + + Description for List all apps that are assigned to a hostname. + + :param name_identifier: Hostname information. + :type name_identifier: ~azure.mgmt.web.v2021_02_01.models.NameIdentifier + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either IdentifierCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.IdentifierCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.IdentifierCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = "application/json" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_site_identifiers_assigned_to_host_name.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(name_identifier, 'NameIdentifier') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(name_identifier, 'NameIdentifier') + body_content_kwargs['content'] = body_content + request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('IdentifierCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_site_identifiers_assigned_to_host_name.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/listSitesAssignedToHostName'} # type: ignore + + def list_premier_add_on_offers( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.PremierAddOnOfferCollection"] + """List all premier add-on offers. + + Description for List all premier add-on offers. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PremierAddOnOfferCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.web.v2021_02_01.models.PremierAddOnOfferCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PremierAddOnOfferCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_premier_add_on_offers.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('PremierAddOnOfferCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_premier_add_on_offers.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/premieraddonoffers'} # type: ignore + + def list_skus( + self, + **kwargs # type: Any + ): + # type: (...) -> "_models.SkuInfos" + """List all SKUs. + + Description for List all SKUs. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SkuInfos, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.SkuInfos + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuInfos"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + accept = "application/json" + + # Construct URL + url = self.list_skus.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SkuInfos', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_skus.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/skus'} # type: ignore + + def verify_hosting_environment_vnet( + self, + parameters, # type: "_models.VnetParameters" + **kwargs # type: Any + ): + # type: (...) -> "_models.VnetValidationFailureDetails" + """Verifies if this VNET is compatible with an App Service Environment by analyzing the Network Security Group rules. + + Description for Verifies if this VNET is compatible with an App Service Environment by + analyzing the Network Security Group rules. + + :param parameters: VNET information. + :type parameters: ~azure.mgmt.web.v2021_02_01.models.VnetParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VnetValidationFailureDetails, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.VnetValidationFailureDetails + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VnetValidationFailureDetails"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.verify_hosting_environment_vnet.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'VnetParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VnetValidationFailureDetails', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + verify_hosting_environment_vnet.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Web/verifyHostingEnvironmentVnet'} # type: ignore + + def move( + self, + resource_group_name, # type: str + move_resource_envelope, # type: "_models.CsmMoveResourceEnvelope" + **kwargs # type: Any + ): + # type: (...) -> None + """Move resources between resource groups. + + Description for Move resources between resource groups. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param move_resource_envelope: Object that represents the resource to move. + :type move_resource_envelope: ~azure.mgmt.web.v2021_02_01.models.CsmMoveResourceEnvelope + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.move.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(move_resource_envelope, 'CsmMoveResourceEnvelope') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + move.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/moveResources'} # type: ignore + + def validate( + self, + resource_group_name, # type: str + validate_request, # type: "_models.ValidateRequest" + **kwargs # type: Any + ): + # type: (...) -> "_models.ValidateResponse" + """Validate if a resource can be created. + + Description for Validate if a resource can be created. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param validate_request: Request with the resources to validate. + :type validate_request: ~azure.mgmt.web.v2021_02_01.models.ValidateRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ValidateResponse, or the result of cls(response) + :rtype: ~azure.mgmt.web.v2021_02_01.models.ValidateResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidateResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.validate.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(validate_request, 'ValidateRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ValidateResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + validate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/validate'} # type: ignore + + def validate_move( + self, + resource_group_name, # type: str + move_resource_envelope, # type: "_models.CsmMoveResourceEnvelope" + **kwargs # type: Any + ): + # type: (...) -> None + """Validate whether a resource can be moved. + + Description for Validate whether a resource can be moved. + + :param resource_group_name: Name of the resource group to which the resource belongs. + :type resource_group_name: str + :param move_resource_envelope: Object that represents the resource to move. + :type move_resource_envelope: ~azure.mgmt.web.v2021_02_01.models.CsmMoveResourceEnvelope + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.validate_move.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+[^\.]$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(move_resource_envelope, 'CsmMoveResourceEnvelope') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + validate_move.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/validateMoveResources'} # type: ignore diff --git a/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/py.typed b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_02_01/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file From 6ccb4ad0cd4bd72f149f4308445cb1a8a0b8e631 Mon Sep 17 00:00:00 2001 From: iscai-msft <43154838+iscai-msft@users.noreply.github.com> Date: Wed, 8 Sep 2021 11:25:45 -0400 Subject: [PATCH 05/85] [rest] correctly pickle rest aiohttp responses (#20577) --- sdk/core/azure-core/azure/core/rest/_aiohttp.py | 2 +- .../tests/async_tests/test_rest_polling_async.py | 13 +++++++++++++ sdk/core/azure-core/tests/test_rest_polling.py | 12 ++++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/sdk/core/azure-core/azure/core/rest/_aiohttp.py b/sdk/core/azure-core/azure/core/rest/_aiohttp.py index 44e45174f6eb..055e569b8166 100644 --- a/sdk/core/azure-core/azure/core/rest/_aiohttp.py +++ b/sdk/core/azure-core/azure/core/rest/_aiohttp.py @@ -155,7 +155,7 @@ async def iter_bytes(self) -> AsyncIterator[bytes]: def __getstate__(self): state = self.__dict__.copy() # Remove the unpicklable entries. - state['internal_response'] = None # aiohttp response are not pickable (see headers comments) + state['_internal_response'] = None # aiohttp response are not pickable (see headers comments) state['headers'] = CIMultiDict(self.headers) # MultiDictProxy is not pickable return state diff --git a/sdk/core/azure-core/tests/async_tests/test_rest_polling_async.py b/sdk/core/azure-core/tests/async_tests/test_rest_polling_async.py index 4f97b9d1cee4..b80ac0596768 100644 --- a/sdk/core/azure-core/tests/async_tests/test_rest_polling_async.py +++ b/sdk/core/azure-core/tests/async_tests/test_rest_polling_async.py @@ -118,3 +118,16 @@ async def test_delete_operation_location(lro_poller): async def test_request_id(lro_poller): result = await (await lro_poller(HttpRequest("POST", "/polling/request-id"), request_id="123456789")).result() assert result['status'] == "Succeeded" + +@pytest.mark.asyncio +async def test_continuation_token(client, lro_poller, deserialization_callback): + poller = await lro_poller(HttpRequest("POST", "/polling/post/location-and-operation-location")) + token = poller.continuation_token() + new_poller = AsyncLROPoller.from_continuation_token( + continuation_token=token, + polling_method=AsyncLROBasePolling(0), + client=client._client, + deserialization_callback=deserialization_callback, + ) + result = await new_poller.result() + assert result == {'location_result': True} diff --git a/sdk/core/azure-core/tests/test_rest_polling.py b/sdk/core/azure-core/tests/test_rest_polling.py index 3f7caa96f04c..3dfebef958db 100644 --- a/sdk/core/azure-core/tests/test_rest_polling.py +++ b/sdk/core/azure-core/tests/test_rest_polling.py @@ -104,3 +104,15 @@ def test_delete_operation_location(lro_poller): def test_request_id(lro_poller): result = lro_poller(HttpRequest("POST", "/polling/request-id"), request_id="123456789").result() + +def test_continuation_token(client, lro_poller, deserialization_callback): + poller = lro_poller(HttpRequest("POST", "/polling/post/location-and-operation-location")) + token = poller.continuation_token() + new_poller = LROPoller.from_continuation_token( + continuation_token=token, + polling_method=LROBasePolling(0), + client=client._client, + deserialization_callback=deserialization_callback, + ) + result = new_poller.result() + assert result == {'location_result': True} From dcbd6d9ae6de17356d08b5753771c01a9afa76e0 Mon Sep 17 00:00:00 2001 From: Charles Lowell Date: Wed, 8 Sep 2021 08:48:03 -0700 Subject: [PATCH 06/85] Allow overriding client_id for token exchange (#20571) --- .../azure/identity/_constants.py | 2 +- .../identity/_credentials/managed_identity.py | 6 +- .../aio/_credentials/managed_identity.py | 6 +- .../tests/test_managed_identity.py | 105 ++++++++++++------ .../tests/test_managed_identity_async.py | 86 +++++++++++--- 5 files changed, 152 insertions(+), 53 deletions(-) diff --git a/sdk/identity/azure-identity/azure/identity/_constants.py b/sdk/identity/azure-identity/azure/identity/_constants.py index e72aa59d9772..878d7f6bce7f 100644 --- a/sdk/identity/azure-identity/azure/identity/_constants.py +++ b/sdk/identity/azure-identity/azure/identity/_constants.py @@ -48,4 +48,4 @@ class EnvironmentVariables: AZURE_REGIONAL_AUTHORITY_NAME = "AZURE_REGIONAL_AUTHORITY_NAME" AZURE_FEDERATED_TOKEN_FILE = "AZURE_FEDERATED_TOKEN_FILE" - TOKEN_EXCHANGE_VARS = (AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_FEDERATED_TOKEN_FILE) + TOKEN_EXCHANGE_VARS = (AZURE_AUTHORITY_HOST, AZURE_TENANT_ID, AZURE_FEDERATED_TOKEN_FILE) diff --git a/sdk/identity/azure-identity/azure/identity/_credentials/managed_identity.py b/sdk/identity/azure-identity/azure/identity/_credentials/managed_identity.py index d48a9ac4c4ba..d602c4d4d4e3 100644 --- a/sdk/identity/azure-identity/azure/identity/_credentials/managed_identity.py +++ b/sdk/identity/azure-identity/azure/identity/_credentials/managed_identity.py @@ -69,9 +69,13 @@ def __init__(self, **kwargs): _LOGGER.info("%s will use token exchange", self.__class__.__name__) from .token_exchange import TokenExchangeCredential + client_id = kwargs.pop("client_id", None) or os.environ.get(EnvironmentVariables.AZURE_CLIENT_ID) + if not client_id: + raise ValueError('Configure the environment with a client ID or pass a value for "client_id" argument') + self._credential = TokenExchangeCredential( tenant_id=os.environ[EnvironmentVariables.AZURE_TENANT_ID], - client_id=os.environ[EnvironmentVariables.AZURE_CLIENT_ID], + client_id=client_id, token_file_path=os.environ[EnvironmentVariables.AZURE_FEDERATED_TOKEN_FILE], **kwargs ) diff --git a/sdk/identity/azure-identity/azure/identity/aio/_credentials/managed_identity.py b/sdk/identity/azure-identity/azure/identity/aio/_credentials/managed_identity.py index ac0e6c450f0e..dabb1be0b21f 100644 --- a/sdk/identity/azure-identity/azure/identity/aio/_credentials/managed_identity.py +++ b/sdk/identity/azure-identity/azure/identity/aio/_credentials/managed_identity.py @@ -66,9 +66,13 @@ def __init__(self, **kwargs: "Any") -> None: _LOGGER.info("%s will use token exchange", self.__class__.__name__) from .token_exchange import TokenExchangeCredential + client_id = kwargs.pop("client_id", None) or os.environ.get(EnvironmentVariables.AZURE_CLIENT_ID) + if not client_id: + raise ValueError('Configure the environment with a client ID or pass a value for "client_id" argument') + self._credential = TokenExchangeCredential( tenant_id=os.environ[EnvironmentVariables.AZURE_TENANT_ID], - client_id=os.environ[EnvironmentVariables.AZURE_CLIENT_ID], + client_id=client_id, token_file_path=os.environ[EnvironmentVariables.AZURE_FEDERATED_TOKEN_FILE], **kwargs ) diff --git a/sdk/identity/azure-identity/tests/test_managed_identity.py b/sdk/identity/azure-identity/tests/test_managed_identity.py index f7a21eba2d7b..1eb31cc12448 100644 --- a/sdk/identity/azure-identity/tests/test_managed_identity.py +++ b/sdk/identity/azure-identity/tests/test_managed_identity.py @@ -31,6 +31,7 @@ }, {EnvironmentVariables.IDENTITY_ENDPOINT: "...", EnvironmentVariables.IMDS_ENDPOINT: "..."}, # Arc { # token exchange + EnvironmentVariables.AZURE_AUTHORITY_HOST: "https://localhost", EnvironmentVariables.AZURE_CLIENT_ID: "...", EnvironmentVariables.AZURE_TENANT_ID: "...", EnvironmentVariables.AZURE_FEDERATED_TOKEN_FILE: __file__, @@ -73,24 +74,6 @@ def test_context_manager_incomplete_configuration(): pass -ALL_ENVIRONMENTS = ( - {EnvironmentVariables.MSI_ENDPOINT: "...", EnvironmentVariables.MSI_SECRET: "..."}, # App Service - {EnvironmentVariables.MSI_ENDPOINT: "..."}, # Cloud Shell - { # Service Fabric - EnvironmentVariables.IDENTITY_ENDPOINT: "...", - EnvironmentVariables.IDENTITY_HEADER: "...", - EnvironmentVariables.IDENTITY_SERVER_THUMBPRINT: "...", - }, - {EnvironmentVariables.IDENTITY_ENDPOINT: "...", EnvironmentVariables.IMDS_ENDPOINT: "..."}, # Arc - { # token exchange - EnvironmentVariables.AZURE_CLIENT_ID: "...", - EnvironmentVariables.AZURE_TENANT_ID: "...", - EnvironmentVariables.AZURE_FEDERATED_TOKEN_FILE: __file__, - }, - {}, # IMDS -) - - @pytest.mark.parametrize("environ", ALL_ENVIRONMENTS) def test_custom_hooks(environ): """The credential's pipeline should include azure-core's CustomHookPolicy""" @@ -790,10 +773,21 @@ def test_token_exchange(tmpdir): token_file.write(exchange_token) access_token = "***" authority = "https://localhost" - client_id = "client_id" + default_client_id = "default_client_id" tenant = "tenant_id" scope = "scope" + success_response = mock_response( + json_payload={ + "access_token": access_token, + "expires_in": 3600, + "ext_expires_in": 3600, + "expires_on": int(time.time()) + 3600, + "not_before": int(time.time()), + "resource": scope, + "token_type": "Bearer", + } + ) transport = validating_transport( requests=[ Request( @@ -802,38 +796,81 @@ def test_token_exchange(tmpdir): required_data={ "client_assertion": exchange_token, "client_assertion_type": "urn:ietf:params:oauth:client-assertion-type:jwt-bearer", - "client_id": client_id, + "client_id": default_client_id, "grant_type": "client_credentials", "scope": scope, }, ) ], - responses=[ - mock_response( - json_payload={ - "access_token": access_token, - "expires_in": 3600, - "ext_expires_in": 3600, - "expires_on": int(time.time()) + 3600, - "not_before": int(time.time()), - "resource": scope, - "token_type": "Bearer", - } + responses=[success_response], + ) + + mock_environ = { + EnvironmentVariables.AZURE_AUTHORITY_HOST: authority, + EnvironmentVariables.AZURE_CLIENT_ID: default_client_id, + EnvironmentVariables.AZURE_TENANT_ID: tenant, + EnvironmentVariables.AZURE_FEDERATED_TOKEN_FILE: token_file.strpath, + } + # credential should default to AZURE_CLIENT_ID + with mock.patch.dict("os.environ", mock_environ, clear=True): + credential = ManagedIdentityCredential(transport=transport) + token = credential.get_token(scope) + assert token.token == access_token + + # client_id kwarg should override AZURE_CLIENT_ID + nondefault_client_id = "non" + default_client_id + transport = validating_transport( + requests=[ + Request( + base_url=authority, + method="POST", + required_data={ + "client_assertion": exchange_token, + "client_assertion_type": "urn:ietf:params:oauth:client-assertion-type:jwt-bearer", + "client_id": nondefault_client_id, + "grant_type": "client_credentials", + "scope": scope, + }, ) ], + responses=[success_response], + ) + + with mock.patch.dict("os.environ", mock_environ, clear=True): + credential = ManagedIdentityCredential(client_id=nondefault_client_id, transport=transport) + token = credential.get_token(scope) + assert token.token == access_token + + # AZURE_CLIENT_ID may not have a value, in which case client_id is required + transport = validating_transport( + requests=[ + Request( + base_url=authority, + method="POST", + required_data={ + "client_assertion": exchange_token, + "client_assertion_type": "urn:ietf:params:oauth:client-assertion-type:jwt-bearer", + "client_id": nondefault_client_id, + "grant_type": "client_credentials", + "scope": scope, + }, + ) + ], + responses=[success_response], ) with mock.patch.dict( "os.environ", { EnvironmentVariables.AZURE_AUTHORITY_HOST: authority, - EnvironmentVariables.AZURE_CLIENT_ID: client_id, EnvironmentVariables.AZURE_TENANT_ID: tenant, EnvironmentVariables.AZURE_FEDERATED_TOKEN_FILE: token_file.strpath, }, clear=True, ): - credential = ManagedIdentityCredential(transport=transport) - token = credential.get_token(scope) + with pytest.raises(ValueError): + ManagedIdentityCredential() + credential = ManagedIdentityCredential(client_id=nondefault_client_id, transport=transport) + token = credential.get_token(scope) assert token.token == access_token diff --git a/sdk/identity/azure-identity/tests/test_managed_identity_async.py b/sdk/identity/azure-identity/tests/test_managed_identity_async.py index 0cbcf044f2b8..27fe2779a2c7 100644 --- a/sdk/identity/azure-identity/tests/test_managed_identity_async.py +++ b/sdk/identity/azure-identity/tests/test_managed_identity_async.py @@ -731,10 +731,21 @@ async def test_token_exchange(tmpdir): token_file.write(exchange_token) access_token = "***" authority = "https://localhost" - client_id = "client_id" + default_client_id = "default_client_id" tenant = "tenant_id" scope = "scope" + success_response = mock_response( + json_payload={ + "access_token": access_token, + "expires_in": 3600, + "ext_expires_in": 3600, + "expires_on": int(time.time()) + 3600, + "not_before": int(time.time()), + "resource": scope, + "token_type": "Bearer", + } + ) transport = async_validating_transport( requests=[ Request( @@ -743,38 +754,81 @@ async def test_token_exchange(tmpdir): required_data={ "client_assertion": exchange_token, "client_assertion_type": "urn:ietf:params:oauth:client-assertion-type:jwt-bearer", - "client_id": client_id, + "client_id": default_client_id, "grant_type": "client_credentials", "scope": scope, }, ) ], - responses=[ - mock_response( - json_payload={ - "access_token": access_token, - "expires_in": 3600, - "ext_expires_in": 3600, - "expires_on": int(time.time()) + 3600, - "not_before": int(time.time()), - "resource": scope, - "token_type": "Bearer", - } + responses=[success_response], + ) + + mock_environ = { + EnvironmentVariables.AZURE_AUTHORITY_HOST: authority, + EnvironmentVariables.AZURE_CLIENT_ID: default_client_id, + EnvironmentVariables.AZURE_TENANT_ID: tenant, + EnvironmentVariables.AZURE_FEDERATED_TOKEN_FILE: token_file.strpath, + } + # credential should default to AZURE_CLIENT_ID + with mock.patch.dict("os.environ", mock_environ, clear=True): + credential = ManagedIdentityCredential(transport=transport) + token = await credential.get_token(scope) + assert token.token == access_token + + # client_id kwarg should override AZURE_CLIENT_ID + nondefault_client_id = "non" + default_client_id + transport = async_validating_transport( + requests=[ + Request( + base_url=authority, + method="POST", + required_data={ + "client_assertion": exchange_token, + "client_assertion_type": "urn:ietf:params:oauth:client-assertion-type:jwt-bearer", + "client_id": nondefault_client_id, + "grant_type": "client_credentials", + "scope": scope, + }, ) ], + responses=[success_response], + ) + + with mock.patch.dict("os.environ", mock_environ, clear=True): + credential = ManagedIdentityCredential(client_id=nondefault_client_id, transport=transport) + token = await credential.get_token(scope) + assert token.token == access_token + + # AZURE_CLIENT_ID may not have a value, in which case client_id is required + transport = async_validating_transport( + requests=[ + Request( + base_url=authority, + method="POST", + required_data={ + "client_assertion": exchange_token, + "client_assertion_type": "urn:ietf:params:oauth:client-assertion-type:jwt-bearer", + "client_id": nondefault_client_id, + "grant_type": "client_credentials", + "scope": scope, + }, + ) + ], + responses=[success_response], ) with mock.patch.dict( "os.environ", { EnvironmentVariables.AZURE_AUTHORITY_HOST: authority, - EnvironmentVariables.AZURE_CLIENT_ID: client_id, EnvironmentVariables.AZURE_TENANT_ID: tenant, EnvironmentVariables.AZURE_FEDERATED_TOKEN_FILE: token_file.strpath, }, clear=True, ): - credential = ManagedIdentityCredential(transport=transport) - token = await credential.get_token(scope) + with pytest.raises(ValueError): + ManagedIdentityCredential() + credential = ManagedIdentityCredential(client_id=nondefault_client_id, transport=transport) + token = await credential.get_token(scope) assert token.token == access_token From c458c425e88ad58c9180d0310f40893889ed6855 Mon Sep 17 00:00:00 2001 From: Rodrigo Souza Date: Wed, 8 Sep 2021 09:57:51 -0700 Subject: [PATCH 07/85] Update README.md (#20574) * Update README.md * Update README.md * Update README.md --- sdk/cosmos/azure-cosmos/README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sdk/cosmos/azure-cosmos/README.md b/sdk/cosmos/azure-cosmos/README.md index 1ad02f94e343..2923e0613cf5 100644 --- a/sdk/cosmos/azure-cosmos/README.md +++ b/sdk/cosmos/azure-cosmos/README.md @@ -81,6 +81,11 @@ Once you've initialized a [CosmosClient][ref_cosmosclient], you can interact wit For more information about these resources, see [Working with Azure Cosmos databases, containers and items][cosmos_resources]. + +## How to use `enable_cross_partition_query` + +The keyword-argument `enable_cross_partition_query` accepts 2 options: `None` (default) or `True`. + ## Limitations Currently the features below are **not supported**. For alternatives options, check the **Workarounds** section below. @@ -123,7 +128,7 @@ If you want to use Python SDK to perform bulk inserts to Cosmos DB, the best alt ### Control Plane Limitations Workaround -Typically you can use [Azure Portal](https://portal.azure.com/), [Azure Cosmos DB Resource Provider REST API](https://docs.microsoft.com/rest/api/cosmos-db-resource-provider), [Azure CLI](https://docs.microsoft.com/azure/cosmos-db/manage-with-cli) or [PowerShell](https://docs.microsoft.com/azure/cosmos-db/manage-with-powershell) for the control plane unsupported limitations. +Typically you can use [Azure Portal](https://portal.azure.com/), [Azure Cosmos DB Resource Provider REST API](https://docs.microsoft.com/rest/api/cosmos-db-resource-provider), [Azure CLI](https://docs.microsoft.com/cli/azure/azure-cli-reference-for-cosmos-db) or [PowerShell](https://docs.microsoft.com/azure/cosmos-db/manage-with-powershell) for the control plane unsupported limitations. ### AAD Support Workaround From 82c7e67fcf734e5846799f30eb0bc18f2a152e71 Mon Sep 17 00:00:00 2001 From: Krista Pratico Date: Wed, 8 Sep 2021 10:11:08 -0700 Subject: [PATCH 08/85] update changelog + some edits (#20588) --- .../azure-ai-translation-document/CHANGELOG.md | 2 +- sdk/translation/azure-ai-translation-document/README.md | 9 ++++----- .../sample_translation_with_custom_model_async.py | 2 +- .../samples/sample_translation_with_custom_model.py | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/sdk/translation/azure-ai-translation-document/CHANGELOG.md b/sdk/translation/azure-ai-translation-document/CHANGELOG.md index 4f5682d7ab0b..bdb09757fc53 100644 --- a/sdk/translation/azure-ai-translation-document/CHANGELOG.md +++ b/sdk/translation/azure-ai-translation-document/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 1.0.0b5 (Unreleased) +## 1.0.0b5 (2021-09-08) ### Breaking Changes - Changed: `list_all_translation_statuses` has been renamed to `list_translation_statuses` diff --git a/sdk/translation/azure-ai-translation-document/README.md b/sdk/translation/azure-ai-translation-document/README.md index 18476cb83a3c..c0bf3ab5554d 100644 --- a/sdk/translation/azure-ai-translation-document/README.md +++ b/sdk/translation/azure-ai-translation-document/README.md @@ -325,10 +325,10 @@ Note that you will need to install the [azure-storage-blob][azure_storage_blob] ## Advanced Topics -The following section provides some insights for some of the advanced translation features such as glossaries and custom translation models. +The following section provides some insights for some advanced translation features such as glossaries and custom translation models. ### **Glossaries** -Glossaries are domain-specific dictionaries. For example, if you want to translate some medical-related documents, you may need support for the many words, terminology, and idioms in the medical field which you can't find in the standard translation dictionary or you simply need specific translation. This is why Document Translation provides support for glossaries. +Glossaries are domain-specific dictionaries. For example, if you want to translate some medical-related documents, you may need support for the many words, terminology, and idioms in the medical field which you can't find in the standard translation dictionary, or you simply need specific translation. This is why Document Translation provides support for glossaries. #### **How To Create Glossary File** @@ -337,14 +337,13 @@ Document Translation supports glossaries in the following formats: |**File Type**|**Extension**|**Description**|**Samples**| |---------------|---------------|---------------|---------------| |Tab-Separated Values/TAB|.tsv, .tab|Read more on [wikipedia][tsv_files_wikipedia]|[glossary_sample.tsv][sample_tsv_file]| -|Comma-Seperated Values|.csv|Read more on [wikipedia][csv_files_wikipedia]|[glossary_sample.csv][sample_csv_file]| +|Comma-Separated Values|.csv|Read more on [wikipedia][csv_files_wikipedia]|[glossary_sample.csv][sample_csv_file]| |Localization Interchange File Format|.xlf, .xliff|Read more on [wikipedia][xlf_files_wikipedia]|[glossary_sample.xlf][sample_xlf_file]| View all supported formats [here][supported_glossary_formats]. #### **How Use Glossaries in Document Translation** -In order to use glossaries with Document Translation, you first need to upload your glossaries file to some blob container, and then provide the SaS url to of this glossary file to Document Translation as in the code samples [sample_translation_with_glossaries.py][sample_translation_with_glossaries]. - +In order to use glossaries with Document Translation, you first need to upload your glossary file to a blob container, and then provide the SAS URL to the file as in the code samples [sample_translation_with_glossaries.py][sample_translation_with_glossaries]. ### **Custom Translation Models** Instead of using Document Translation's engine for translation, you can use your own custom Azure machine/deep learning model. diff --git a/sdk/translation/azure-ai-translation-document/samples/async_samples/sample_translation_with_custom_model_async.py b/sdk/translation/azure-ai-translation-document/samples/async_samples/sample_translation_with_custom_model_async.py index ff5709380e48..cb69a2c2e76b 100644 --- a/sdk/translation/azure-ai-translation-document/samples/async_samples/sample_translation_with_custom_model_async.py +++ b/sdk/translation/azure-ai-translation-document/samples/async_samples/sample_translation_with_custom_model_async.py @@ -8,7 +8,7 @@ FILE: sample_translation_with_custom_model_async.py DESCRIPTION: - This sample demonstrates how to create a translation operation and apply custom azure translation model when doing the translation. + This sample demonstrates how to create a translation operation and apply a custom translation model. To set up your containers for translation and generate SAS tokens to your containers (or files) with the appropriate permissions, see the README. diff --git a/sdk/translation/azure-ai-translation-document/samples/sample_translation_with_custom_model.py b/sdk/translation/azure-ai-translation-document/samples/sample_translation_with_custom_model.py index 011f687fbadc..ad8813f2b525 100644 --- a/sdk/translation/azure-ai-translation-document/samples/sample_translation_with_custom_model.py +++ b/sdk/translation/azure-ai-translation-document/samples/sample_translation_with_custom_model.py @@ -8,7 +8,7 @@ FILE: sample_translation_with_custom_model.py DESCRIPTION: - This sample demonstrates how to create a translation operation and apply custom azure translation model when doing the translation. + This sample demonstrates how to create a translation operation and apply a custom translation model. To set up your containers for translation and generate SAS tokens to your containers (or files) with the appropriate permissions, see the README. From 1795106935ec31d6b7fae9091f37a7fcb5851ec6 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Wed, 8 Sep 2021 11:42:36 -0700 Subject: [PATCH 09/85] Increment version for servicebus releases (#20593) Increment package version after release of azure-servicebus --- sdk/servicebus/azure-servicebus/CHANGELOG.md | 10 ++++++++++ .../azure-servicebus/azure/servicebus/_version.py | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/sdk/servicebus/azure-servicebus/CHANGELOG.md b/sdk/servicebus/azure-servicebus/CHANGELOG.md index 98649d9dc29a..cdcd908ba3d6 100644 --- a/sdk/servicebus/azure-servicebus/CHANGELOG.md +++ b/sdk/servicebus/azure-servicebus/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 7.3.4 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 7.3.3 (2021-09-08) ### Bugs Fixed diff --git a/sdk/servicebus/azure-servicebus/azure/servicebus/_version.py b/sdk/servicebus/azure-servicebus/azure/servicebus/_version.py index c82eac62f190..95447996ec0f 100644 --- a/sdk/servicebus/azure-servicebus/azure/servicebus/_version.py +++ b/sdk/servicebus/azure-servicebus/azure/servicebus/_version.py @@ -3,4 +3,4 @@ # Licensed under the MIT License. # ------------------------------------ -VERSION = "7.3.3" +VERSION = "7.3.4" From c0d33d7d8b5eb24ab4e62b7496260bd8b69bcf80 Mon Sep 17 00:00:00 2001 From: annatisch Date: Wed, 8 Sep 2021 12:11:49 -0700 Subject: [PATCH 10/85] Release notes (#20587) --- sdk/tables/azure-data-tables/CHANGELOG.md | 7 ++----- sdk/tables/azure-data-tables/README.md | 18 ++++++++++-------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/sdk/tables/azure-data-tables/CHANGELOG.md b/sdk/tables/azure-data-tables/CHANGELOG.md index 284c5b4577ce..a10e7f5d0c82 100644 --- a/sdk/tables/azure-data-tables/CHANGELOG.md +++ b/sdk/tables/azure-data-tables/CHANGELOG.md @@ -1,14 +1,11 @@ # Release History -## 12.1.1 (Unreleased) - -### Features Added - -### Breaking Changes +## 12.1.1 (2021-09-08) ### Bugs Fixed - Resolved bug where strings couldn't be used instead of enum value for entity Update Mode (#20247). +- Resolved bug where single quote characters in Partition and Row keys were not escaped correctly (#20301). ### Other Changes diff --git a/sdk/tables/azure-data-tables/README.md b/sdk/tables/azure-data-tables/README.md index 4f1a193c401e..05bc39a30578 100644 --- a/sdk/tables/azure-data-tables/README.md +++ b/sdk/tables/azure-data-tables/README.md @@ -2,7 +2,9 @@ Azure Data Tables is a NoSQL data storage service that can be accessed from anywhere in the world via authenticated calls using HTTP or HTTPS. Tables scales as needed to support the amount of data inserted, and allow for the storing of data with non-complex accessing. -The Azure Data Tables client can be used to access Azure Storage or Cosmos accounts. This document covers [`azure-data-tables`][Tables_pypi]. If you're using [`azure-cosmosdb-tables`](https://github.com/Azure/azure-cosmos-table-python/tree/master/azure-cosmosdb-table), we recommend that you upgrade your code. See the [migration guide][migration_guide] for more details. +The Azure Data Tables client can be used to access Azure Storage or Cosmos accounts. This document covers [`azure-data-tables`][Tables_pypi]. + +Please note, this package is a replacement for [`azure-cosmosdb-tables`](https://github.com/Azure/azure-cosmos-table-python/tree/master/azure-cosmosdb-table) which is now deprecated. See the [migration guide][migration_guide] for more details. [Source code][source_code] | [Package (PyPI)][Tables_pypi] | [API reference documentation][Tables_ref_docs] | [Samples][Tables_samples] @@ -332,7 +334,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][msft_oss_co [source_code]:https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/tables/azure-data-tables [Tables_pypi]:https://aka.ms/azsdk/python/tablespypi -[Tables_ref_docs]:https://docs.microsoft.com/python/api/overview/azure/data-tables-readme-pre?view=azure-python-preview +[Tables_ref_docs]:https://docs.microsoft.com/python/api/overview/azure/data-tables-readme?view=azure-python [Tables_product_doc]:https://docs.microsoft.com/azure/cosmos-db/table-introduction [Tables_samples]:https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/tables/azure-data-tables/samples [migration_guide]:https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/tables/azure-data-tables/migration_guide.md @@ -370,11 +372,11 @@ This project has adopted the [Microsoft Open Source Code of Conduct][msft_oss_co [tables_rest]: https://docs.microsoft.com/rest/api/storageservices/table-service-rest-api -[create_entity]:https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/tables/azure-data-tables/samples/sample_insert_delete_entities.py#L51-L57 -[delete_entity]:https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/tables/azure-data-tables/samples/sample_insert_delete_entities.py#L73-L80 -[update_entity]:https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/tables/azure-data-tables/samples/sample_update_upsert_merge_entities.py#L128-L129 -[query_entities]:https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/tables/azure-data-tables/samples/sample_query_table.py#L63-L72 -[get_entity]:https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/tables/azure-data-tables/samples/sample_update_upsert_merge_entities.py#L52-L55 -[upsert_entity]:https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/tables/azure-data-tables/samples/sample_update_upsert_merge_entities.py#L103-L120 +[create_entity]:https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/tables/azure-data-tables/samples/sample_insert_delete_entities.py#L67-L73 +[delete_entity]:https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/tables/azure-data-tables/samples/sample_insert_delete_entities.py#L89-L92 +[update_entity]:https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/tables/azure-data-tables/samples/sample_update_upsert_merge_entities.py#L165-L181 +[query_entities]:https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/tables/azure-data-tables/samples/sample_query_table.py#L75-L89 +[get_entity]:https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/tables/azure-data-tables/samples/sample_update_upsert_merge_entities.py#L67-L71 +[upsert_entity]:https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/tables/azure-data-tables/samples/sample_update_upsert_merge_entities.py#L155-L163 ![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python/sdk/tables/azure-data-tables/README.png) From e089b1b5b51850db1190a3bf5b5d7f95f9428d90 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Wed, 8 Sep 2021 12:17:32 -0700 Subject: [PATCH 11/85] Increment version for search releases (#20586) Increment package version after release of azure-search-documents --- sdk/search/azure-search-documents/CHANGELOG.md | 10 ++++++++++ .../azure/search/documents/_version.py | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/sdk/search/azure-search-documents/CHANGELOG.md b/sdk/search/azure-search-documents/CHANGELOG.md index c576ec78aca8..dce720459dba 100644 --- a/sdk/search/azure-search-documents/CHANGELOG.md +++ b/sdk/search/azure-search-documents/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 11.3.0b4 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 11.3.0b3 (2021-09-08) ### Features Added diff --git a/sdk/search/azure-search-documents/azure/search/documents/_version.py b/sdk/search/azure-search-documents/azure/search/documents/_version.py index 49efd4643318..c2b7261b3491 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/_version.py +++ b/sdk/search/azure-search-documents/azure/search/documents/_version.py @@ -3,6 +3,6 @@ # Licensed under the MIT License. # ------------------------------------ -VERSION = "11.3.0b3" # type: str +VERSION = "11.3.0b4" # type: str SDK_MONIKER = "search-documents/{}".format(VERSION) # type: str From 8be2477705853969ceb2d274fcae6f55b266f0e3 Mon Sep 17 00:00:00 2001 From: Xiaoxi Fu <49707495+xiafu-msft@users.noreply.github.com> Date: Wed, 8 Sep 2021 12:24:05 -0700 Subject: [PATCH 12/85] [STG78]Address comments (#20539) --- .../azure/storage/blob/__init__.py | 2 +- .../azure/storage/blob/_models.py | 21 ++++++++++++++----- .../tests/test_append_blob.py | 2 +- .../tests/test_append_blob_async.py | 2 +- .../tests/test_block_blob.py | 2 +- .../tests/test_block_blob_async.py | 2 +- .../tests/test_common_blob.py | 14 ++++++------- .../tests/test_common_blob_async.py | 8 +++---- .../tests/test_page_blob.py | 2 +- .../tests/test_page_blob_async.py | 2 +- 10 files changed, 34 insertions(+), 23 deletions(-) diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/__init__.py b/sdk/storage/azure-storage-blob/azure/storage/blob/__init__.py index 5c546a65b537..58442edc91ea 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/__init__.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/__init__.py @@ -25,13 +25,13 @@ ) from ._generated.models import ( RehydratePriority, - BlobImmutabilityPolicyMode ) from ._models import ( BlobType, BlockState, StandardBlobTier, PremiumPageBlobTier, + BlobImmutabilityPolicyMode, SequenceNumberAction, PublicAccess, BlobAnalyticsLogging, diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_models.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_models.py index 0dd2d5ac3c90..68c3b4d193d7 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_models.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_models.py @@ -120,6 +120,17 @@ class PublicAccess(str, Enum): """ +class BlobImmutabilityPolicyMode(str, Enum): + """ + Specifies the immutability policy mode to set on the blob. + "Mutable" can only be returned by service, don't set to "Mutable". + """ + + Unlocked = "Unlocked" + Locked = "Locked" + Mutable = "Mutable" + + class BlobAnalyticsLogging(GeneratedLogging): """Azure Analytics Logging settings. @@ -441,17 +452,17 @@ class ImmutabilityPolicy(DictMixin): .. versionadded:: 12.10.0 This was introduced in API version '2020-10-02'. - :param ~datetime.datetime expiry_time: + :keyword ~datetime.datetime expiry_time: Specifies the date time when the blobs immutability policy is set to expire. - :param str or ~azure.storage.blob.BlobImmutabilityPolicyMode policy_mode: + :keyword str or ~azure.storage.blob.BlobImmutabilityPolicyMode policy_mode: Specifies the immutability policy mode to set on the blob. Possible values to set include: "Locked", "Unlocked". "Mutable" can only be returned by service, don't set to "Mutable". """ - def __init__(self, expiry_time=None, policy_mode=None): - self.expiry_time = expiry_time - self.policy_mode = policy_mode + def __init__(self, **kwargs): + self.expiry_time = kwargs.pop('expiry_time', None) + self.policy_mode = kwargs.pop('policy_mode', None) @classmethod def _from_generated(cls, generated): diff --git a/sdk/storage/azure-storage-blob/tests/test_append_blob.py b/sdk/storage/azure-storage-blob/tests/test_append_blob.py index 9a9214619804..a7852904e25a 100644 --- a/sdk/storage/azure-storage-blob/tests/test_append_blob.py +++ b/sdk/storage/azure-storage-blob/tests/test_append_blob.py @@ -1363,7 +1363,7 @@ def test_create_append_blob_with_immutability_policy(self, resource_group, locat blob = bsc.get_blob_client(container_name, blob_name) immutability_policy = ImmutabilityPolicy(expiry_time=datetime.utcnow() + timedelta(seconds=5), - policy_mode=BlobImmutabilityPolicyMode.UNLOCKED) + policy_mode=BlobImmutabilityPolicyMode.Unlocked) blob.create_append_blob(immutability_policy=immutability_policy, legal_hold=True) diff --git a/sdk/storage/azure-storage-blob/tests/test_append_blob_async.py b/sdk/storage/azure-storage-blob/tests/test_append_blob_async.py index 54196008dc47..0d64f29bf209 100644 --- a/sdk/storage/azure-storage-blob/tests/test_append_blob_async.py +++ b/sdk/storage/azure-storage-blob/tests/test_append_blob_async.py @@ -1446,7 +1446,7 @@ async def test_create_append_blob_with_immutability_policy_async(self, resource_ blob = bsc.get_blob_client(container_name, blob_name) immutability_policy = ImmutabilityPolicy(expiry_time=datetime.utcnow() + timedelta(seconds=5), - policy_mode=BlobImmutabilityPolicyMode.UNLOCKED) + policy_mode=BlobImmutabilityPolicyMode.Unlocked) await blob.create_append_blob(immutability_policy=immutability_policy, legal_hold=True) diff --git a/sdk/storage/azure-storage-blob/tests/test_block_blob.py b/sdk/storage/azure-storage-blob/tests/test_block_blob.py index 17321484eee6..96655565bca8 100644 --- a/sdk/storage/azure-storage-blob/tests/test_block_blob.py +++ b/sdk/storage/azure-storage-blob/tests/test_block_blob.py @@ -477,7 +477,7 @@ def test_put_block_with_immutability_policy(self, resource_group, location, stor # Act block_list = [BlobBlock(block_id='1'), BlobBlock(block_id='2'), BlobBlock(block_id='3')] immutability_policy = ImmutabilityPolicy(expiry_time=datetime.utcnow() + timedelta(seconds=5), - policy_mode=BlobImmutabilityPolicyMode.UNLOCKED) + policy_mode=BlobImmutabilityPolicyMode.Unlocked) put_block_list_resp = blob.commit_block_list(block_list, immutability_policy=immutability_policy, legal_hold=True, diff --git a/sdk/storage/azure-storage-blob/tests/test_block_blob_async.py b/sdk/storage/azure-storage-blob/tests/test_block_blob_async.py index e852667fb2aa..d160f1703615 100644 --- a/sdk/storage/azure-storage-blob/tests/test_block_blob_async.py +++ b/sdk/storage/azure-storage-blob/tests/test_block_blob_async.py @@ -584,7 +584,7 @@ async def test_put_block_with_immutability_policy(self, resource_group, location # Act block_list = [BlobBlock(block_id='1'), BlobBlock(block_id='2'), BlobBlock(block_id='3')] immutability_policy = ImmutabilityPolicy(expiry_time=datetime.utcnow() + timedelta(seconds=5), - policy_mode=BlobImmutabilityPolicyMode.UNLOCKED) + policy_mode=BlobImmutabilityPolicyMode.Unlocked) put_block_list_resp = await blob.commit_block_list(block_list, immutability_policy=immutability_policy, legal_hold=True, diff --git a/sdk/storage/azure-storage-blob/tests/test_common_blob.py b/sdk/storage/azure-storage-blob/tests/test_common_blob.py index 12b172c65730..5d35a3388d3c 100644 --- a/sdk/storage/azure-storage-blob/tests/test_common_blob.py +++ b/sdk/storage/azure-storage-blob/tests/test_common_blob.py @@ -1222,7 +1222,7 @@ def test_copy_blob_with_immutability_policy(self, resource_group, location, stor copyblob = self.bsc.get_blob_client(container_name, 'blob1copy') immutability_policy = ImmutabilityPolicy(expiry_time=datetime.utcnow() + timedelta(seconds=5), - policy_mode=BlobImmutabilityPolicyMode.UNLOCKED) + policy_mode=BlobImmutabilityPolicyMode.Unlocked) copy = copyblob.start_copy_from_url(sourceblob, immutability_policy=immutability_policy, legal_hold=True, ) @@ -1837,7 +1837,7 @@ def test_set_immutability_policy_using_sas(self, resource_group, location, stora blob = BlobClient( self.bsc.url, container_name= container_name, blob_name=blob_name, credential=account_sas_token) immutability_policy = ImmutabilityPolicy(expiry_time=datetime.utcnow() + timedelta(seconds=5), - policy_mode=BlobImmutabilityPolicyMode.UNLOCKED) + policy_mode=BlobImmutabilityPolicyMode.Unlocked) resp_with_account_sas = blob.set_immutability_policy(immutability_policy=immutability_policy) blob_response = requests.get(blob.url) @@ -1858,7 +1858,7 @@ def test_set_immutability_policy_using_sas(self, resource_group, location, stora self.bsc.url, container_name=container_name, blob_name=blob_name, credential=container_sas_token) immutability_policy = ImmutabilityPolicy(expiry_time=datetime.utcnow() + timedelta(seconds=5), - policy_mode=BlobImmutabilityPolicyMode.UNLOCKED) + policy_mode=BlobImmutabilityPolicyMode.Unlocked) resp_with_container_sas = blob1.set_immutability_policy(immutability_policy=immutability_policy) # Assert response using container sas self.assertIsNotNone(resp_with_container_sas['immutability_policy_until_date']) @@ -1876,7 +1876,7 @@ def test_set_immutability_policy_using_sas(self, resource_group, location, stora blob2 = BlobClient( self.bsc.url, container_name=container_name, blob_name=blob_name, credential=blob_sas_token) immutability_policy = ImmutabilityPolicy(expiry_time=datetime.utcnow() + timedelta(seconds=5), - policy_mode=BlobImmutabilityPolicyMode.UNLOCKED) + policy_mode=BlobImmutabilityPolicyMode.Unlocked) resp_with_blob_sas = blob2.set_immutability_policy(immutability_policy=immutability_policy) # Assert response using blob sas @@ -2586,7 +2586,7 @@ def test_blob_immutability_policy(self, resource_group, location, storage_accoun blob = self.bsc.get_blob_client(container_name, blob_name) blob.upload_blob(b"abc", overwrite=True) immutability_policy = ImmutabilityPolicy(expiry_time=datetime.utcnow() + timedelta(seconds=5), - policy_mode=BlobImmutabilityPolicyMode.UNLOCKED) + policy_mode=BlobImmutabilityPolicyMode.Unlocked) resp = blob.set_immutability_policy(immutability_policy=immutability_policy) # Assert @@ -2668,7 +2668,7 @@ def test_download_blob_with_immutability_policy(self, resource_group, location, content = b"abcedfg" immutability_policy = ImmutabilityPolicy(expiry_time=datetime.utcnow() + timedelta(seconds=5), - policy_mode=BlobImmutabilityPolicyMode.UNLOCKED) + policy_mode=BlobImmutabilityPolicyMode.Unlocked) blob.upload_blob(content, immutability_policy=immutability_policy, legal_hold=True, @@ -2710,7 +2710,7 @@ def test_list_blobs_with_immutability_policy(self, resource_group, location, sto content = b"abcedfg" immutability_policy = ImmutabilityPolicy(expiry_time=datetime.utcnow() + timedelta(seconds=5), - policy_mode=BlobImmutabilityPolicyMode.UNLOCKED) + policy_mode=BlobImmutabilityPolicyMode.Unlocked) blob.upload_blob(content,immutability_policy=immutability_policy, legal_hold=True, overwrite=True) diff --git a/sdk/storage/azure-storage-blob/tests/test_common_blob_async.py b/sdk/storage/azure-storage-blob/tests/test_common_blob_async.py index 6429d514594b..2247ed8df781 100644 --- a/sdk/storage/azure-storage-blob/tests/test_common_blob_async.py +++ b/sdk/storage/azure-storage-blob/tests/test_common_blob_async.py @@ -1497,7 +1497,7 @@ async def test_copy_blob_with_immutability_policy(self, resource_group, location copyblob = self.bsc.get_blob_client(container_name, 'blob1copy') immutability_policy = ImmutabilityPolicy(expiry_time=datetime.utcnow() + timedelta(seconds=5), - policy_mode=BlobImmutabilityPolicyMode.UNLOCKED) + policy_mode=BlobImmutabilityPolicyMode.Unlocked) copy = await copyblob.start_copy_from_url(sourceblob, immutability_policy=immutability_policy, legal_hold=True, @@ -2594,7 +2594,7 @@ async def test_blob_immutability_policy(self, resource_group, location, storage_ await blob.upload_blob(b"abc", overwrite=True) immutability_policy = ImmutabilityPolicy(expiry_time=datetime.utcnow() + timedelta(seconds=5), - policy_mode=BlobImmutabilityPolicyMode.UNLOCKED) + policy_mode=BlobImmutabilityPolicyMode.Unlocked) resp = await blob.set_immutability_policy( immutability_policy=immutability_policy) @@ -2677,7 +2677,7 @@ async def test_download_blob_with_immutability_policy(self, resource_group, loca content = b"abcedfg" immutability_policy = ImmutabilityPolicy(expiry_time=datetime.utcnow() + timedelta(seconds=5), - policy_mode=BlobImmutabilityPolicyMode.UNLOCKED) + policy_mode=BlobImmutabilityPolicyMode.Unlocked) await blob.upload_blob(content, immutability_policy=immutability_policy, legal_hold=True, @@ -2722,7 +2722,7 @@ async def test_list_blobs_with_immutability_policy(self, resource_group, locatio content = b"abcedfg" immutability_policy = ImmutabilityPolicy(expiry_time=datetime.utcnow() + timedelta(seconds=5), - policy_mode=BlobImmutabilityPolicyMode.UNLOCKED) + policy_mode=BlobImmutabilityPolicyMode.Unlocked) await blob.upload_blob(content, immutability_policy=immutability_policy, legal_hold=True, diff --git a/sdk/storage/azure-storage-blob/tests/test_page_blob.py b/sdk/storage/azure-storage-blob/tests/test_page_blob.py index 8471bfc50d4a..8f92947aba96 100644 --- a/sdk/storage/azure-storage-blob/tests/test_page_blob.py +++ b/sdk/storage/azure-storage-blob/tests/test_page_blob.py @@ -165,7 +165,7 @@ def test_create_blob_with_immutability_policy(self, resource_group, location, st # Act immutability_policy = ImmutabilityPolicy(expiry_time=datetime.utcnow() + timedelta(seconds=5), - policy_mode=BlobImmutabilityPolicyMode.UNLOCKED) + policy_mode=BlobImmutabilityPolicyMode.Unlocked) resp = blob.create_page_blob(1024, immutability_policy=immutability_policy, legal_hold=True) props = blob.get_blob_properties() diff --git a/sdk/storage/azure-storage-blob/tests/test_page_blob_async.py b/sdk/storage/azure-storage-blob/tests/test_page_blob_async.py index e10b23715970..d15289df0898 100644 --- a/sdk/storage/azure-storage-blob/tests/test_page_blob_async.py +++ b/sdk/storage/azure-storage-blob/tests/test_page_blob_async.py @@ -211,7 +211,7 @@ async def test_create_blob_with_immutability_policy(self, resource_group, locati # Act immutability_policy = ImmutabilityPolicy(expiry_time=datetime.utcnow() + timedelta(seconds=5), - policy_mode=BlobImmutabilityPolicyMode.UNLOCKED) + policy_mode=BlobImmutabilityPolicyMode.Unlocked) resp = await blob.create_page_blob(1024, immutability_policy=immutability_policy, legal_hold=True) From 50ff9897e925031873f5f6922578ff107ddc9618 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Wed, 8 Sep 2021 12:57:35 -0700 Subject: [PATCH 13/85] Increment package version after release of azure-ai-translation-document (#20596) --- .../azure-ai-translation-document/CHANGELOG.md | 10 ++++++++++ .../azure/ai/translation/document/_version.py | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/sdk/translation/azure-ai-translation-document/CHANGELOG.md b/sdk/translation/azure-ai-translation-document/CHANGELOG.md index bdb09757fc53..2546cffe1aec 100644 --- a/sdk/translation/azure-ai-translation-document/CHANGELOG.md +++ b/sdk/translation/azure-ai-translation-document/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.0.0b6 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.0.0b5 (2021-09-08) ### Breaking Changes diff --git a/sdk/translation/azure-ai-translation-document/azure/ai/translation/document/_version.py b/sdk/translation/azure-ai-translation-document/azure/ai/translation/document/_version.py index e7c6e5b64eca..5860fe399e86 100644 --- a/sdk/translation/azure-ai-translation-document/azure/ai/translation/document/_version.py +++ b/sdk/translation/azure-ai-translation-document/azure/ai/translation/document/_version.py @@ -4,4 +4,4 @@ # Licensed under the MIT License. # ------------------------------------ -VERSION = "1.0.0b5" +VERSION = "1.0.0b6" From 0af2ce57d5bfed720ed5cdd24812671d2a30e619 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Wed, 8 Sep 2021 13:00:40 -0700 Subject: [PATCH 14/85] Add Skip.SetTestPipelineVersion to allow overidiing of use of BuildID for test version (#20589) Co-authored-by: Chidozie Ononiwu --- .../pipelines/templates/steps/set-test-pipeline-version.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/common/pipelines/templates/steps/set-test-pipeline-version.yml b/eng/common/pipelines/templates/steps/set-test-pipeline-version.yml index 9f21918de992..091ef62766eb 100644 --- a/eng/common/pipelines/templates/steps/set-test-pipeline-version.yml +++ b/eng/common/pipelines/templates/steps/set-test-pipeline-version.yml @@ -4,10 +4,10 @@ parameters: TestPipeline: false steps: -- ${{if eq(parameters.TestPipeline, 'true')}}: +- ${{ if eq(parameters.TestPipeline, 'true') }}: - task: PowerShell@2 displayName: Prep template pipeline for release - condition: succeeded() + condition: and(succeeded(), ne(variables['Skip.SetTestPipelineVersion'], 'true')) inputs: pwsh: true workingDirectory: $(Build.SourcesDirectory) From aa44b0232908895506ecda8b6539213e14d9b0c3 Mon Sep 17 00:00:00 2001 From: Yalin Li Date: Wed, 8 Sep 2021 15:17:39 -0700 Subject: [PATCH 15/85] Run mypy in azure-keyvault-secrets CI (#20507) --- eng/tox/mypy_hard_failure_packages.py | 1 + .../azure/keyvault/keys/_shared/_polling.py | 4 +- .../azure/keyvault/secrets/_client.py | 5 +- .../azure/keyvault/secrets/_models.py | 111 +++++++++--------- .../keyvault/secrets/_shared/_polling.py | 4 +- sdk/keyvault/azure-keyvault-secrets/mypy.ini | 7 ++ 6 files changed, 71 insertions(+), 61 deletions(-) create mode 100644 sdk/keyvault/azure-keyvault-secrets/mypy.ini diff --git a/eng/tox/mypy_hard_failure_packages.py b/eng/tox/mypy_hard_failure_packages.py index 7619732b13b4..3ae063eb4fb1 100644 --- a/eng/tox/mypy_hard_failure_packages.py +++ b/eng/tox/mypy_hard_failure_packages.py @@ -11,6 +11,7 @@ "azure-identity", "azure-keyvault-administration", "azure-keyvault-certificates", + "azure-keyvault-secrets", "azure-servicebus", "azure-ai-textanalytics", "azure-ai-formrecognizer", diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_polling.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_polling.py index df63ad0a70ec..ec1898453d81 100644 --- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_polling.py +++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_shared/_polling.py @@ -33,11 +33,11 @@ class KeyVaultOperationPoller(LROPoller): # pylint: disable=arguments-differ def __init__(self, polling_method): # type: (PollingMethod) -> None - super(KeyVaultOperationPoller, self).__init__(None, None, None, NoPolling()) + super(KeyVaultOperationPoller, self).__init__(None, None, lambda *_: None, NoPolling()) self._polling_method = polling_method # pylint: disable=arguments-differ - def result(self): + def result(self): # type: ignore # type: () -> Any """Returns a representation of the final resource without waiting for the operation to complete. diff --git a/sdk/keyvault/azure-keyvault-secrets/azure/keyvault/secrets/_client.py b/sdk/keyvault/azure-keyvault-secrets/azure/keyvault/secrets/_client.py index 2f1e376504e8..ed3790c0a715 100644 --- a/sdk/keyvault/azure-keyvault-secrets/azure/keyvault/secrets/_client.py +++ b/sdk/keyvault/azure-keyvault-secrets/azure/keyvault/secrets/_client.py @@ -4,6 +4,7 @@ # ------------------------------------ from functools import partial from azure.core.tracing.decorator import distributed_trace +from azure.core.polling import LROPoller from ._models import KeyVaultSecret, DeletedSecret, SecretProperties from ._shared import KeyVaultClientBase @@ -294,7 +295,7 @@ def restore_secret_backup(self, backup, **kwargs): @distributed_trace def begin_delete_secret(self, name, **kwargs): - # type: (str, **Any) -> DeletedSecret + # type: (str, **Any) -> LROPoller """Delete all versions of a secret. Requires secrets/delete permission. When this method returns Key Vault has begun deleting the secret. Deletion may take several seconds in a vault @@ -416,7 +417,7 @@ def purge_deleted_secret(self, name, **kwargs): @distributed_trace def begin_recover_deleted_secret(self, name, **kwargs): - # type: (str, **Any) -> SecretProperties + # type: (str, **Any) -> LROPoller """Recover a deleted secret to its latest version. Possible only in a vault with soft-delete enabled. If the vault does not have soft-delete enabled, :func:`begin_delete_secret` is permanent, and this method will diff --git a/sdk/keyvault/azure-keyvault-secrets/azure/keyvault/secrets/_models.py b/sdk/keyvault/azure-keyvault-secrets/azure/keyvault/secrets/_models.py index 03ef5dc268b8..7cb02cef9a3f 100644 --- a/sdk/keyvault/azure-keyvault-secrets/azure/keyvault/secrets/_models.py +++ b/sdk/keyvault/azure-keyvault-secrets/azure/keyvault/secrets/_models.py @@ -20,10 +20,10 @@ class SecretProperties(object): """A secret's id and attributes.""" def __init__(self, attributes, vault_id, **kwargs): - # type: (_models.SecretAttributes, str, **Any) -> None + # type: (Optional[_models.SecretAttributes], Optional[str], **Any) -> None self._attributes = attributes self._id = vault_id - self._vault_id = KeyVaultSecretIdentifier(vault_id) + self._vault_id = KeyVaultSecretIdentifier(vault_id) if vault_id else None self._content_type = kwargs.get("content_type", None) self._key_id = kwargs.get("key_id", None) self._managed = kwargs.get("managed", None) @@ -60,82 +60,82 @@ def _from_secret_item(cls, secret_item): @property def content_type(self): - # type: () -> str + # type: () -> Optional[str] """An arbitrary string indicating the type of the secret - :rtype: str + :rtype: str or None """ return self._content_type @property def id(self): - # type: () -> str + # type: () -> Optional[str] """The secret's id - :rtype: str + :rtype: str or None """ return self._id @property def key_id(self): - # type: () -> str + # type: () -> Optional[str] """If this secret backs a certificate, this property is the identifier of the corresponding key. - :rtype: str + :rtype: str or None """ return self._key_id @property def enabled(self): - # type: () -> bool + # type: () -> Optional[bool] """Whether the secret is enabled for use - :rtype: bool + :rtype: bool or None """ - return self._attributes.enabled + return self._attributes.enabled if self._attributes else None @property def not_before(self): - # type: () -> datetime + # type: () -> Optional[datetime] """The time before which the secret can not be used, in UTC - :rtype: ~datetime.datetime + :rtype: ~datetime.datetime or None """ - return self._attributes.not_before + return self._attributes.not_before if self._attributes else None @property def expires_on(self): - # type: () -> datetime + # type: () -> Optional[datetime] """When the secret expires, in UTC - :rtype: ~datetime.datetime + :rtype: ~datetime.datetime or None """ - return self._attributes.expires + return self._attributes.expires if self._attributes else None @property def created_on(self): - # type: () -> datetime + # type: () -> Optional[datetime] """When the secret was created, in UTC - :rtype: ~datetime.datetime + :rtype: ~datetime.datetime or None """ - return self._attributes.created + return self._attributes.created if self._attributes else None @property def updated_on(self): - # type: () -> datetime + # type: () -> Optional[datetime] """When the secret was last updated, in UTC - :rtype: ~datetime.datetime + :rtype: ~datetime.datetime or None """ - return self._attributes.updated + return self._attributes.updated if self._attributes else None @property def recoverable_days(self): # type: () -> Optional[int] """The number of days the key is retained before being deleted from a soft-delete enabled Key Vault. - :rtype: int + :rtype: int or None """ # recoverable_days was added in 7.1-preview if self._attributes and hasattr(self._attributes, "recoverable_days"): @@ -144,46 +144,47 @@ def recoverable_days(self): @property def recovery_level(self): - # type: () -> str + # type: () -> Optional[str] """The vault's deletion recovery level for secrets - :rtype: str + :rtype: str or None """ - return self._attributes.recovery_level + return self._attributes.recovery_level if self._attributes else None @property def vault_url(self): - # type: () -> str + # type: () -> Optional[str] """URL of the vault containing the secret - :rtype: str + :rtype: str or None """ - return self._vault_id.vault_url + return self._vault_id.vault_url if self._vault_id else None @property def name(self): - # type: () -> str + # type: () -> Optional[str] """The secret's name - :rtype: str + :rtype: str or None """ - return self._vault_id.name + return self._vault_id.name if self._vault_id else None @property def version(self): - # type: () -> str + # type: () -> Optional[str] """The secret's version - :rtype: str + :rtype: str or None """ - return self._vault_id.version + return self._vault_id.version if self._vault_id else None @property def tags(self): - # type: () -> Dict[str, str] + # type: () -> Optional[Dict[str, str]] """Application specific metadata in the form of key-value pairs - :rtype: dict""" + :rtype: dict or None + """ return self._tags @@ -191,7 +192,7 @@ class KeyVaultSecret(object): """All of a secret's properties, and its value.""" def __init__(self, properties, value): - # type: (SecretProperties, str) -> None + # type: (SecretProperties, Optional[str]) -> None self._properties = properties self._value = value @@ -210,19 +211,19 @@ def _from_secret_bundle(cls, secret_bundle): @property def name(self): - # type: () -> str + # type: () -> Optional[str] """The secret's name - :rtype: str + :rtype: str or None """ return self._properties.name @property def id(self): - # type: () -> str + # type: () -> Optional[str] """The secret's id - :rtype: str + :rtype: str or None """ return self._properties.id @@ -237,10 +238,10 @@ def properties(self): @property def value(self): - # type: () -> str + # type: () -> Optional[str] """The secret's value - :rtype: str + :rtype: str or None """ return self._value @@ -329,19 +330,19 @@ def _from_deleted_secret_item(cls, deleted_secret_item): @property def name(self): - # type: () -> str + # type: () -> Optional[str] """The secret's name - :rtype: str + :rtype: str or None """ return self._properties.name @property def id(self): - # type: () -> str + # type: () -> Optional[str] """The secret's id - :rtype: str + :rtype: str or None """ return self._properties.id @@ -356,27 +357,27 @@ def properties(self): @property def deleted_date(self): - # type: () -> datetime + # type: () -> Optional[datetime] """When the secret was deleted, in UTC - :rtype: ~datetime.datetime + :rtype: ~datetime.datetime or None """ return self._deleted_date @property def recovery_id(self): - # type: () -> str + # type: () -> Optional[str] """An identifier used to recover the deleted secret. Returns ``None`` if soft-delete is disabled. - :rtype: str + :rtype: str or None """ return self._recovery_id @property def scheduled_purge_date(self): - # type: () -> datetime + # type: () -> Optional[datetime] """When the secret is scheduled to be purged, in UTC. Returns ``None`` if soft-delete is disabled. - :rtype: ~datetime.datetime + :rtype: ~datetime.datetime or None """ return self._scheduled_purge_date diff --git a/sdk/keyvault/azure-keyvault-secrets/azure/keyvault/secrets/_shared/_polling.py b/sdk/keyvault/azure-keyvault-secrets/azure/keyvault/secrets/_shared/_polling.py index df63ad0a70ec..ec1898453d81 100644 --- a/sdk/keyvault/azure-keyvault-secrets/azure/keyvault/secrets/_shared/_polling.py +++ b/sdk/keyvault/azure-keyvault-secrets/azure/keyvault/secrets/_shared/_polling.py @@ -33,11 +33,11 @@ class KeyVaultOperationPoller(LROPoller): # pylint: disable=arguments-differ def __init__(self, polling_method): # type: (PollingMethod) -> None - super(KeyVaultOperationPoller, self).__init__(None, None, None, NoPolling()) + super(KeyVaultOperationPoller, self).__init__(None, None, lambda *_: None, NoPolling()) self._polling_method = polling_method # pylint: disable=arguments-differ - def result(self): + def result(self): # type: ignore # type: () -> Any """Returns a representation of the final resource without waiting for the operation to complete. diff --git a/sdk/keyvault/azure-keyvault-secrets/mypy.ini b/sdk/keyvault/azure-keyvault-secrets/mypy.ini new file mode 100644 index 000000000000..18b37b44c426 --- /dev/null +++ b/sdk/keyvault/azure-keyvault-secrets/mypy.ini @@ -0,0 +1,7 @@ +[mypy] +python_version = 3.6 +warn_unused_configs = True +ignore_missing_imports = True + +[mypy-azure.keyvault.*._generated.*] +ignore_errors = True From c11e83597b8a60e10e1c84381dee8ca181c4d310 Mon Sep 17 00:00:00 2001 From: Xiang Yan Date: Wed, 8 Sep 2021 15:29:40 -0700 Subject: [PATCH 16/85] add interactive_browser_client_id (#20591) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add interactive_browser_client_id * Update sdk/identity/azure-identity/azure/identity/_credentials/default.py Co-authored-by: Charles Lowell * Update sdk/identity/azure-identity/azure/identity/_credentials/default.py Co-authored-by: Charles Lowell * update * update * update * update * update * Update sdk/identity/azure-identity/azure/identity/_credentials/default.py Co-authored-by: McCoy Patiño <39780829+mccoyp@users.noreply.github.com> * update Co-authored-by: Charles Lowell Co-authored-by: McCoy Patiño <39780829+mccoyp@users.noreply.github.com> --- sdk/identity/azure-identity/CHANGELOG.md | 2 ++ .../azure/identity/_credentials/default.py | 12 +++++++++++- sdk/identity/azure-identity/tests/test_default.py | 15 +++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/sdk/identity/azure-identity/CHANGELOG.md b/sdk/identity/azure-identity/CHANGELOG.md index 43075dd8f743..bc728cf02ee3 100644 --- a/sdk/identity/azure-identity/CHANGELOG.md +++ b/sdk/identity/azure-identity/CHANGELOG.md @@ -8,6 +8,8 @@ - `OnBehalfOfCredential` supports the on-behalf-of authentication flow for accessing resources on behalf of users ([#19308](https://github.com/Azure/azure-sdk-for-python/issues/19308)) +- `DefaultAzureCredential` allows specifying the client ID of interactive browser via keyword argument `interactive_browser_client_id` + ([#20487](https://github.com/Azure/azure-sdk-for-python/issues/20487)) ### Breaking Changes diff --git a/sdk/identity/azure-identity/azure/identity/_credentials/default.py b/sdk/identity/azure-identity/azure/identity/_credentials/default.py index bc74b37ecc89..90ddc1b39b53 100644 --- a/sdk/identity/azure-identity/azure/identity/_credentials/default.py +++ b/sdk/identity/azure-identity/azure/identity/_credentials/default.py @@ -70,6 +70,8 @@ class DefaultAzureCredential(ChainedTokenCredential): AZURE_TENANT_ID, if any. If unspecified, users will authenticate in their home tenants. :keyword str managed_identity_client_id: The client ID of a user-assigned managed identity. Defaults to the value of the environment variable AZURE_CLIENT_ID, if any. If not specified, a system-assigned identity will be used. + :keyword str interactive_browser_client_id: The client ID to be used in interactive browser credential. If not + specified, users will authenticate to an Azure development application. :keyword str shared_cache_username: Preferred username for :class:`~azure.identity.SharedTokenCacheCredential`. Defaults to the value of environment variable AZURE_USERNAME, if any. :keyword str shared_cache_tenant_id: Preferred tenant for :class:`~azure.identity.SharedTokenCacheCredential`. @@ -102,6 +104,7 @@ def __init__(self, **kwargs): managed_identity_client_id = kwargs.pop( "managed_identity_client_id", os.environ.get(EnvironmentVariables.AZURE_CLIENT_ID) ) + interactive_browser_client_id = kwargs.pop("interactive_browser_client_id", None) shared_cache_username = kwargs.pop("shared_cache_username", os.environ.get(EnvironmentVariables.AZURE_USERNAME)) shared_cache_tenant_id = kwargs.pop( @@ -137,7 +140,14 @@ def __init__(self, **kwargs): if not exclude_powershell_credential: credentials.append(AzurePowerShellCredential(**kwargs)) if not exclude_interactive_browser_credential: - credentials.append(InteractiveBrowserCredential(tenant_id=interactive_browser_tenant_id, **kwargs)) + if interactive_browser_client_id: + credentials.append( + InteractiveBrowserCredential( + tenant_id=interactive_browser_tenant_id, client_id=interactive_browser_client_id, **kwargs + ) + ) + else: + credentials.append(InteractiveBrowserCredential(tenant_id=interactive_browser_tenant_id, **kwargs)) super(DefaultAzureCredential, self).__init__(*credentials) diff --git a/sdk/identity/azure-identity/tests/test_default.py b/sdk/identity/azure-identity/tests/test_default.py index a03a16cb85cc..8c8189996861 100644 --- a/sdk/identity/azure-identity/tests/test_default.py +++ b/sdk/identity/azure-identity/tests/test_default.py @@ -387,6 +387,21 @@ def validate_tenant_id(credential): validate_tenant_id(mock_credential) +def test_interactive_browser_client_id(): + """the credential should allow configuring a client ID for InteractiveBrowserCredential by kwarg""" + + client_id = "client-id" + + def validate_client_id(credential): + assert len(credential.call_args_list) == 1, "InteractiveBrowserCredential should be instantiated once" + _, kwargs = credential.call_args + assert kwargs["client_id"] == client_id + + with patch(DefaultAzureCredential.__module__ + ".InteractiveBrowserCredential") as mock_credential: + DefaultAzureCredential(exclude_interactive_browser_credential=False, interactive_browser_client_id=client_id) + validate_client_id(mock_credential) + + @pytest.mark.parametrize("expected_value", (True, False)) def test_allow_multitenant_authentication(expected_value): """the credential should pass "allow_multitenant_authentication" to the inner credentials which support it""" From 40c90601dff0bcbcd40940a0f0b6b3004cec1186 Mon Sep 17 00:00:00 2001 From: Xiang Yan Date: Wed, 8 Sep 2021 16:01:33 -0700 Subject: [PATCH 17/85] update release date (#20601) --- sdk/identity/azure-identity/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/identity/azure-identity/CHANGELOG.md b/sdk/identity/azure-identity/CHANGELOG.md index bc728cf02ee3..eb32e8df944e 100644 --- a/sdk/identity/azure-identity/CHANGELOG.md +++ b/sdk/identity/azure-identity/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 1.7.0b4 (2021-09-08) +## 1.7.0b4 (2021-09-09) ### Features Added - `CertificateCredential` accepts certificates in PKCS12 format From 1f2218a1226807f5d1d6b1e2e2e97e36f62b41a1 Mon Sep 17 00:00:00 2001 From: swathipil <76007337+swathipil@users.noreply.github.com> Date: Wed, 8 Sep 2021 17:13:33 -0700 Subject: [PATCH 18/85] [SchemaRegistry] update API for consistency (#20538) * changes * updated failing tests * keep Dict for now * pylint errors * nit * add recordings * tests recordings --- .../_schema_registry_avro_serializer.py | 35 ++++---- .../samples/eventhub_receive_integration.py | 4 +- .../samples/eventhub_send_integration.py | 6 +- ...ializer.test_basic_sr_avro_serializer.yaml | 53 ----------- ...serializer_with_auto_register_schemas.yaml | 8 +- ...ializer_without_auto_register_schemas.yaml | 8 +- .../tests/test_avro_serializer.py | 2 +- .../_common/_response_handlers.py | 9 +- .../azure/schemaregistry/_common/_schema.py | 27 +++--- .../schemaregistry/_schema_registry_client.py | 64 ++++++------- .../aio/_schema_registry_client_async.py | 68 +++++++------- .../sample_code_schemaregistry_async.py | 19 ++-- .../async_samples/schema_registry_async.py | 24 ++--- .../sample_code_schemaregistry.py | 25 +++--- .../samples/sync_samples/schema_registry.py | 24 ++--- ...egistry_async.test_schema_basic_async.yaml | 32 +++---- ....test_schema_negative_no_schema_async.yaml | 22 ++--- ...ry_async.test_schema_same_twice_async.yaml | 32 +++---- ...gistry_async.test_schema_update_async.yaml | 90 +++++++++---------- .../async_tests/test_schema_registry_async.py | 82 ++++++++--------- ...est_schema_registry.test_schema_basic.yaml | 28 +++--- ...gistry.test_schema_negative_no_schema.yaml | 18 ++-- ...chema_registry.test_schema_same_twice.yaml | 28 +++--- ...st_schema_registry.test_schema_update.yaml | 80 ++++++++--------- .../tests/test_schema_registry.py | 82 ++++++++--------- 25 files changed, 400 insertions(+), 470 deletions(-) delete mode 100644 sdk/schemaregistry/azure-schemaregistry-avroserializer/tests/recordings/test_avro_serializer.test_basic_sr_avro_serializer.yaml diff --git a/sdk/schemaregistry/azure-schemaregistry-avroserializer/azure/schemaregistry/serializer/avroserializer/_schema_registry_avro_serializer.py b/sdk/schemaregistry/azure-schemaregistry-avroserializer/azure/schemaregistry/serializer/avroserializer/_schema_registry_avro_serializer.py index 5d3fef4fa3b0..73eb25a9b31d 100644 --- a/sdk/schemaregistry/azure-schemaregistry-avroserializer/azure/schemaregistry/serializer/avroserializer/_schema_registry_avro_serializer.py +++ b/sdk/schemaregistry/azure-schemaregistry-avroserializer/azure/schemaregistry/serializer/avroserializer/_schema_registry_avro_serializer.py @@ -36,21 +36,21 @@ class SchemaRegistryAvroSerializer(object): SchemaRegistryAvroSerializer provides the ability to serialize and deserialize data according to the given avro schema. It would automatically register, get and cache the schema. - :param schema_registry: The schema registry client + :param client: The schema registry client which is used to register schema and retrieve schema from the service. - :type schema_registry: ~azure.schemaregistry.SchemaRegistryClient - :param str schema_group: Schema group under which schema should be registered. + :type client: ~azure.schemaregistry.SchemaRegistryClient + :param str group_name: Schema group under which schema should be registered. :keyword bool auto_register_schemas: When true, register new schemas passed to serialize. Otherwise, and by default, fail if it has not been pre-registered in the registry. :keyword str codec: The writer codec. If None, let the avro library decides. """ - def __init__(self, schema_registry, schema_group, **kwargs): + def __init__(self, client, group_name, **kwargs): # type: ("SchemaRegistryClient", str, Any) -> None - self._schema_group = schema_group + self._schema_group = group_name self._avro_serializer = AvroObjectSerializer(codec=kwargs.get("codec")) - self._schema_registry_client = schema_registry # type: "SchemaRegistryClient" + self._schema_registry_client = client # type: "SchemaRegistryClient" self._auto_register_schemas = kwargs.get("auto_register_schemas", False) self._auto_register_schema_func = ( self._schema_registry_client.register_schema @@ -120,17 +120,18 @@ def _get_schema(self, schema_id, **kwargs): self._schema_to_id[schema_str] = schema_id return schema_str - def serialize(self, data, schema, **kwargs): + def serialize(self, value, schema, **kwargs): # type: (Dict[str, Any], Union[str, bytes], Any) -> bytes """ - Encode dict data with the given schema. The returns bytes are consisted of: The first 4 bytes + Encode data with the given schema. The returns bytes are consisted of: The first 4 bytes denoting record format identifier. The following 32 bytes denoting schema id returned by schema registry service. The remaining bytes are the real data payload. - :param data: The dict data to be encoded. + :param value: The data to be encoded. + :type value: Dict[str, Any] :param schema: The schema used to encode the data. :type schema: Union[str, bytes] - :return: + :rtype: bytes """ raw_input_schema = schema try: @@ -142,7 +143,7 @@ def serialize(self, data, schema, **kwargs): record_format_identifier = b"\0\0\0\0" schema_id = self._get_schema_id(cached_schema.fullname, cached_schema, **kwargs) - data_bytes = self._avro_serializer.serialize(data, cached_schema) + data_bytes = self._avro_serializer.serialize(value, cached_schema) stream = BytesIO() @@ -155,21 +156,21 @@ def serialize(self, data, schema, **kwargs): stream.close() return payload - def deserialize(self, data, **kwargs): + def deserialize(self, value, **kwargs): # type: (bytes, Any) -> Dict[str, Any] """ Decode bytes data. - :param bytes data: The bytes data needs to be decoded. + :param bytes value: The bytes data needs to be decoded. :rtype: Dict[str, Any] """ # record_format_identifier = data[0:4] # The first 4 bytes are retained for future record format identifier. - schema_id = data[ + schema_id = value[ SCHEMA_ID_START_INDEX : (SCHEMA_ID_START_INDEX + SCHEMA_ID_LENGTH) ].decode("utf-8") schema_content = self._get_schema(schema_id, **kwargs) - dict_data = self._avro_serializer.deserialize( - data[DATA_START_INDEX:], schema_content + dict_value = self._avro_serializer.deserialize( + value[DATA_START_INDEX:], schema_content ) - return dict_data + return dict_value diff --git a/sdk/schemaregistry/azure-schemaregistry-avroserializer/samples/eventhub_receive_integration.py b/sdk/schemaregistry/azure-schemaregistry-avroserializer/samples/eventhub_receive_integration.py index 95919dc5756f..6d4fc4a8933b 100644 --- a/sdk/schemaregistry/azure-schemaregistry-avroserializer/samples/eventhub_receive_integration.py +++ b/sdk/schemaregistry/azure-schemaregistry-avroserializer/samples/eventhub_receive_integration.py @@ -46,11 +46,11 @@ def on_event(partition_context, event): # create a SchemaRegistryAvroSerializer instance avro_serializer = SchemaRegistryAvroSerializer( - schema_registry=SchemaRegistryClient( + client=SchemaRegistryClient( endpoint=SCHEMA_REGISTRY_ENDPOINT, credential=DefaultAzureCredential() ), - schema_group=SCHEMA_GROUP + group_name=SCHEMA_GROUP ) diff --git a/sdk/schemaregistry/azure-schemaregistry-avroserializer/samples/eventhub_send_integration.py b/sdk/schemaregistry/azure-schemaregistry-avroserializer/samples/eventhub_send_integration.py index 3509eeb2904e..960ba3a47ffa 100644 --- a/sdk/schemaregistry/azure-schemaregistry-avroserializer/samples/eventhub_send_integration.py +++ b/sdk/schemaregistry/azure-schemaregistry-avroserializer/samples/eventhub_send_integration.py @@ -42,7 +42,7 @@ def send_event_data_batch(producer, serializer): # Use the serialize method to convert dict object to bytes with the given avro schema. # The serialize method would automatically register the schema into the Schema Registry Service and # schema would be cached locally for future usage. - payload_bytes = serializer.serialize(data=dict_data, schema=SCHEMA_STRING) + payload_bytes = serializer.serialize(value=dict_data, schema=SCHEMA_STRING) print('The bytes of serialized dict data is {}.'.format(payload_bytes)) event_data = EventData(body=payload_bytes) # pass the bytes data to the body of an EventData @@ -60,11 +60,11 @@ def send_event_data_batch(producer, serializer): # create a SchemaRegistryAvroSerializer instance avro_serializer = SchemaRegistryAvroSerializer( - schema_registry=SchemaRegistryClient( + client=SchemaRegistryClient( endpoint=SCHEMA_REGISTRY_ENDPOINT, credential=DefaultAzureCredential() ), - schema_group=SCHEMA_GROUP + group_name=SCHEMA_GROUP ) diff --git a/sdk/schemaregistry/azure-schemaregistry-avroserializer/tests/recordings/test_avro_serializer.test_basic_sr_avro_serializer.yaml b/sdk/schemaregistry/azure-schemaregistry-avroserializer/tests/recordings/test_avro_serializer.test_basic_sr_avro_serializer.yaml deleted file mode 100644 index 5aed19d07918..000000000000 --- a/sdk/schemaregistry/azure-schemaregistry-avroserializer/tests/recordings/test_avro_serializer.test_basic_sr_avro_serializer.yaml +++ /dev/null @@ -1,53 +0,0 @@ -interactions: -- request: - body: '"{\"type\": \"record\", \"name\": \"User\", \"namespace\": \"example.avro\", - \"fields\": [{\"type\": \"string\", \"name\": \"name\"}, {\"type\": [\"int\", - \"null\"], \"name\": \"favorite_number\"}, {\"type\": [\"string\", \"null\"], - \"name\": \"favorite_color\"}]}"' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '265' - Content-Type: - - application/json - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0b1 Python/3.9.0 (Windows-10-10.0.19041-SP0) - X-Schema-Type: - - Avro - method: PUT - uri: https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/example.avro.User?api-version=2017-04 - response: - body: - string: '{"id":"576838e0558c43f8b85cdaadbd4561f5"}' - headers: - content-type: - - application/json - date: - - Wed, 01 Sep 2021 17:08:23 GMT - location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/example.avro.User/versions/1?api-version=2017-04 - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000 - transfer-encoding: - - chunked - x-schema-id: - - 576838e0558c43f8b85cdaadbd4561f5 - x-schema-id-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/getschemabyid/576838e0558c43f8b85cdaadbd4561f5?api-version=2017-04 - x-schema-type: - - Avro - x-schema-version: - - '1' - x-schema-versions-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/example.avro.User/versions?api-version=2017-04 - status: - code: 200 - message: OK -version: 1 diff --git a/sdk/schemaregistry/azure-schemaregistry-avroserializer/tests/recordings/test_avro_serializer.test_basic_sr_avro_serializer_with_auto_register_schemas.yaml b/sdk/schemaregistry/azure-schemaregistry-avroserializer/tests/recordings/test_avro_serializer.test_basic_sr_avro_serializer_with_auto_register_schemas.yaml index 98ae3fe7ff57..2410144713ec 100644 --- a/sdk/schemaregistry/azure-schemaregistry-avroserializer/tests/recordings/test_avro_serializer.test_basic_sr_avro_serializer_with_auto_register_schemas.yaml +++ b/sdk/schemaregistry/azure-schemaregistry-avroserializer/tests/recordings/test_avro_serializer.test_basic_sr_avro_serializer_with_auto_register_schemas.yaml @@ -23,12 +23,12 @@ interactions: uri: https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/example.avro.User?api-version=2017-04 response: body: - string: '{"id":"576838e0558c43f8b85cdaadbd4561f5"}' + string: '{"id":"041afcdb34a546faa3aa26a991567e32"}' headers: content-type: - application/json date: - - Wed, 01 Sep 2021 17:06:46 GMT + - Wed, 08 Sep 2021 22:17:05 GMT location: - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/example.avro.User/versions/1?api-version=2017-04 server: @@ -38,9 +38,9 @@ interactions: transfer-encoding: - chunked x-schema-id: - - 576838e0558c43f8b85cdaadbd4561f5 + - 041afcdb34a546faa3aa26a991567e32 x-schema-id-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/getschemabyid/576838e0558c43f8b85cdaadbd4561f5?api-version=2017-04 + - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/getschemabyid/041afcdb34a546faa3aa26a991567e32?api-version=2017-04 x-schema-type: - Avro x-schema-version: diff --git a/sdk/schemaregistry/azure-schemaregistry-avroserializer/tests/recordings/test_avro_serializer.test_basic_sr_avro_serializer_without_auto_register_schemas.yaml b/sdk/schemaregistry/azure-schemaregistry-avroserializer/tests/recordings/test_avro_serializer.test_basic_sr_avro_serializer_without_auto_register_schemas.yaml index d59340f26830..bad3c1562982 100644 --- a/sdk/schemaregistry/azure-schemaregistry-avroserializer/tests/recordings/test_avro_serializer.test_basic_sr_avro_serializer_without_auto_register_schemas.yaml +++ b/sdk/schemaregistry/azure-schemaregistry-avroserializer/tests/recordings/test_avro_serializer.test_basic_sr_avro_serializer_without_auto_register_schemas.yaml @@ -23,12 +23,12 @@ interactions: uri: https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/example.avro.User?api-version=2017-04 response: body: - string: '{"id":"576838e0558c43f8b85cdaadbd4561f5"}' + string: '{"id":"041afcdb34a546faa3aa26a991567e32"}' headers: content-type: - application/json date: - - Wed, 01 Sep 2021 17:08:24 GMT + - Wed, 08 Sep 2021 22:17:06 GMT location: - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/example.avro.User/versions/1?api-version=2017-04 server: @@ -38,9 +38,9 @@ interactions: transfer-encoding: - chunked x-schema-id: - - 576838e0558c43f8b85cdaadbd4561f5 + - 041afcdb34a546faa3aa26a991567e32 x-schema-id-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/getschemabyid/576838e0558c43f8b85cdaadbd4561f5?api-version=2017-04 + - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/getschemabyid/041afcdb34a546faa3aa26a991567e32?api-version=2017-04 x-schema-type: - Avro x-schema-version: diff --git a/sdk/schemaregistry/azure-schemaregistry-avroserializer/tests/test_avro_serializer.py b/sdk/schemaregistry/azure-schemaregistry-avroserializer/tests/test_avro_serializer.py index a9b46fac783b..9e8e6308c052 100644 --- a/sdk/schemaregistry/azure-schemaregistry-avroserializer/tests/test_avro_serializer.py +++ b/sdk/schemaregistry/azure-schemaregistry-avroserializer/tests/test_avro_serializer.py @@ -75,7 +75,7 @@ def test_raw_avro_serializer_negative(self): raw_avro_object_serializer.serialize(dict_data_missing_required_field, schema) @SchemaRegistryPowerShellPreparer() - def test_basic_sr_avro_serializer(self, schemaregistry_endpoint, schemaregistry_group, **kwargs): + def test_basic_sr_avro_serializer_with_auto_register_schemas(self, schemaregistry_endpoint, schemaregistry_group, **kwargs): sr_client = self.create_basic_client(SchemaRegistryClient, endpoint=schemaregistry_endpoint) sr_avro_serializer = SchemaRegistryAvroSerializer(sr_client, schemaregistry_group, auto_register_schemas=True) diff --git a/sdk/schemaregistry/azure-schemaregistry/azure/schemaregistry/_common/_response_handlers.py b/sdk/schemaregistry/azure-schemaregistry/azure/schemaregistry/_common/_response_handlers.py index ed751a14cc9b..ad1fda4b2bdc 100644 --- a/sdk/schemaregistry/azure-schemaregistry/azure/schemaregistry/_common/_response_handlers.py +++ b/sdk/schemaregistry/azure-schemaregistry/azure/schemaregistry/_common/_response_handlers.py @@ -29,8 +29,7 @@ def _parse_schema_properties_dict(response): return { 'location': response.headers.get('location'), - 'location_by_id': response.headers.get('schema-id-location'), - 'schema_id': response.headers.get('schema-id'), + 'id': response.headers.get('schema-id'), 'serialization_type': response.headers.get('serialization-type'), 'version': int(response.headers.get('schema-version')) } @@ -38,7 +37,7 @@ def _parse_schema_properties_dict(response): def _parse_response_schema_properties(response): properties_dict = _parse_schema_properties_dict(response) - properties_dict['schema_id'] = response.json()["id"] + properties_dict['id'] = response.json()["id"] return SchemaProperties( **properties_dict ) @@ -46,6 +45,6 @@ def _parse_response_schema_properties(response): def _parse_response_schema(response): return Schema( - schema_content=response.text(), - schema_properties=SchemaProperties(**_parse_schema_properties_dict(response)) + content=response.text(), + properties=SchemaProperties(**_parse_schema_properties_dict(response)) ) diff --git a/sdk/schemaregistry/azure-schemaregistry/azure/schemaregistry/_common/_schema.py b/sdk/schemaregistry/azure-schemaregistry/azure/schemaregistry/_common/_schema.py index a3056eb760e9..582cb729f7b4 100644 --- a/sdk/schemaregistry/azure-schemaregistry/azure/schemaregistry/_common/_schema.py +++ b/sdk/schemaregistry/azure-schemaregistry/azure/schemaregistry/_common/_schema.py @@ -30,12 +30,10 @@ class SchemaProperties(object): """ Meta properties of a schema. - :ivar schema_id: References specific schema in registry namespace. - :type schema_id: str + :ivar id: References specific schema in registry namespace. + :type id: str :ivar location: URL location of schema, identified by schema group, schema name, and version. :type location: str - :ivar location_by_id: URL location of schema, identified by schema ID. - :type location_by_id: str :ivar serialization_type: Serialization type for the schema being stored. :type serialization_type: str :ivar version: Version of the returned schema. @@ -54,13 +52,12 @@ class SchemaProperties(object): def __init__( self, - schema_id=None, + id=None, # pylint:disable=redefined-builtin **kwargs ): # type: (Optional[str], Any) -> None - self.schema_id = schema_id + self.id = id self.location = kwargs.get('location') - self.location_by_id = kwargs.get('location_by_id') self.serialization_type = kwargs.get('serialization_type') self.version = kwargs.get('version') @@ -69,10 +66,10 @@ class Schema(object): """ The schema content of a schema, along with id and meta properties. - :ivar schema_content: The content of the schema. - :type schema_content: str - :ivar schema_properties: The properties of the schema. - :type schema_properties: SchemaProperties + :ivar content: The content of the schema. + :type content: str + :ivar properties: The properties of the schema. + :type properties: SchemaProperties .. admonition:: Example: @@ -87,9 +84,9 @@ class Schema(object): def __init__( self, - schema_content, - schema_properties, + content, + properties, ): # type: (str, SchemaProperties) -> None - self.schema_content = schema_content - self.schema_properties = schema_properties + self.content = content + self.properties = properties diff --git a/sdk/schemaregistry/azure-schemaregistry/azure/schemaregistry/_schema_registry_client.py b/sdk/schemaregistry/azure-schemaregistry/azure/schemaregistry/_schema_registry_client.py index 83a8d5c3ff68..1c28f6b71ed7 100644 --- a/sdk/schemaregistry/azure-schemaregistry/azure/schemaregistry/_schema_registry_client.py +++ b/sdk/schemaregistry/azure-schemaregistry/azure/schemaregistry/_schema_registry_client.py @@ -84,20 +84,20 @@ def close(self): self._generated_client.close() def register_schema( - self, schema_group, schema_name, serialization_type, schema_content, **kwargs + self, group_name, name, content, serialization_type, **kwargs ): - # type: (str, str, Union[str, SerializationType], str, Any) -> SchemaProperties + # type: (str, str, str, Union[str, SerializationType], Any) -> SchemaProperties """ Register new schema. If schema of specified name does not exist in specified group, schema is created at version 1. If schema of specified name exists already in specified group, schema is created at latest version + 1. - :param str schema_group: Schema group under which schema should be registered. - :param str schema_name: Name of schema being registered. + :param str group_name: Schema group under which schema should be registered. + :param str name: Name of schema being registered. + :param str content: String representation of the schema being registered. :param serialization_type: Serialization type for the schema being registered. For now Avro is the only supported serialization type by the service. :type serialization_type: Union[str, SerializationType] - :param str schema_content: String representation of the schema being registered. :keyword content_type: The content type of the request. Default value is 'application/json'. :paramtype content_type: str :rtype: SchemaProperties @@ -118,9 +118,9 @@ def register_schema( pass request = schema_rest.build_register_request( - group_name=schema_group, - schema_name=schema_name, - content=schema_content, + group_name=group_name, + schema_name=name, + content=content, serialization_type=serialization_type, content_type=kwargs.pop("content_type", "application/json"), **kwargs @@ -131,25 +131,25 @@ def register_schema( schema_properties = _parse_response_schema_properties(response) schema_description = ( - schema_group, - schema_name, + group_name, + name, + content, serialization_type, - schema_content, ) - self._id_to_schema[schema_properties.schema_id] = Schema( - schema_content, schema_properties + self._id_to_schema[schema_properties.id] = Schema( + content, schema_properties ) self._description_to_properties[schema_description] = schema_properties return schema_properties - def get_schema(self, schema_id, **kwargs): + def get_schema(self, id, **kwargs): # pylint:disable=redefined-builtin # type: (str, Any) -> Schema """ Gets a registered schema by its unique ID. Azure Schema Registry guarantees that ID is unique within a namespace. - :param str schema_id: References specific schema in registry namespace. + :param str id: References specific schema in registry namespace. :rtype: Schema .. admonition:: Example: @@ -163,28 +163,28 @@ def get_schema(self, schema_id, **kwargs): """ try: - return self._id_to_schema[schema_id] + return self._id_to_schema[id] except KeyError: - request = schema_rest.build_get_by_id_request(schema_id=schema_id) + request = schema_rest.build_get_by_id_request(schema_id=id) response = self._generated_client.send_request(request, **kwargs) response.raise_for_status() schema = _parse_response_schema(response) - self._id_to_schema[schema_id] = schema + self._id_to_schema[id] = schema return schema - def get_schema_id( - self, schema_group, schema_name, serialization_type, schema_content, **kwargs + def get_schema_properties( + self, group_name, name, content, serialization_type, **kwargs ): - # type: (str, str, Union[str, SerializationType], str, Any) -> SchemaProperties + # type: (str, str, str, Union[str, SerializationType], Any) -> SchemaProperties """ Gets the ID referencing an existing schema within the specified schema group, as matched by schema content comparison. - :param str schema_group: Schema group under which schema should be registered. - :param str schema_name: Name of schema being registered. + :param str group_name: Schema group under which schema should be registered. + :param str name: Name of schema being registered. + :param str content: String representation of the schema being registered. :param serialization_type: Serialization type for the schema being registered. :type serialization_type: Union[str, SerializationType] - :param str schema_content: String representation of the schema being registered. :keyword content_type: The content type of the request. Default value is 'application/json'. :paramtype content_type: str :rtype: SchemaProperties @@ -206,14 +206,14 @@ def get_schema_id( try: properties = self._description_to_properties[ - (schema_group, schema_name, serialization_type, schema_content) + (group_name, name, content, serialization_type) ] return properties except KeyError: request = schema_rest.build_query_id_by_content_request( - group_name=schema_group, - schema_name=schema_name, - content=schema_content, + group_name=group_name, + schema_name=name, + content=content, serialization_type=serialization_type, content_type=kwargs.pop("content_type", "application/json"), **kwargs @@ -223,11 +223,11 @@ def get_schema_id( response.raise_for_status() schema_properties = _parse_response_schema_properties(response) - if not self._id_to_schema.get(schema_properties.schema_id): - self._id_to_schema[schema_properties.schema_id] = Schema(schema_content, schema_properties) + if not self._id_to_schema.get(schema_properties.id): + self._id_to_schema[schema_properties.id] = Schema(content, schema_properties) else: - schema_properties = self._id_to_schema[schema_properties.schema_id].schema_properties + schema_properties = self._id_to_schema[schema_properties.id].properties self._description_to_properties[ - (schema_group, schema_name, serialization_type, schema_content) + (group_name, name, content, serialization_type) ] = schema_properties return schema_properties diff --git a/sdk/schemaregistry/azure-schemaregistry/azure/schemaregistry/aio/_schema_registry_client_async.py b/sdk/schemaregistry/azure-schemaregistry/azure/schemaregistry/aio/_schema_registry_client_async.py index d7408cf79f5a..aa5531cc7a6a 100644 --- a/sdk/schemaregistry/azure-schemaregistry/azure/schemaregistry/aio/_schema_registry_client_async.py +++ b/sdk/schemaregistry/azure-schemaregistry/azure/schemaregistry/aio/_schema_registry_client_async.py @@ -83,10 +83,10 @@ async def close(self) -> None: async def register_schema( self, - schema_group: str, - schema_name: str, + group_name: str, + name: str, + content: str, serialization_type: Union[str, SerializationType], - schema_content: str, **kwargs: Any ) -> SchemaProperties: """ @@ -94,12 +94,12 @@ async def register_schema( schema is created at version 1. If schema of specified name exists already in specified group, schema is created at latest version + 1. - :param str schema_group: Schema group under which schema should be registered. - :param str schema_name: Name of schema being registered. + :param str group_name: Schema group under which schema should be registered. + :param str name: Name of schema being registered. + :param str content: String representation of the schema being registered. :param serialization_type: Serialization type for the schema being registered. For now Avro is the only supported serialization type by the service. :type serialization_type: Union[str, SerializationType] - :param str schema_content: String representation of the schema being registered. :rtype: SchemaProperties .. admonition:: Example: @@ -118,9 +118,9 @@ async def register_schema( pass request = schema_rest.build_register_request( - group_name=schema_group, - schema_name=schema_name, - content=schema_content, + group_name=group_name, + schema_name=name, + content=content, serialization_type=serialization_type, content_type=kwargs.pop("content_type", "application/json"), **kwargs @@ -131,13 +131,13 @@ async def register_schema( schema_properties = _parse_response_schema_properties(response) schema_description = ( - schema_group, - schema_name, + group_name, + name, + content, serialization_type, - schema_content, ) - self._id_to_schema[schema_properties.schema_id] = Schema( - schema_content, schema_properties + self._id_to_schema[schema_properties.id] = Schema( + content, schema_properties ) self._description_to_properties[schema_description] = schema_properties @@ -145,14 +145,14 @@ async def register_schema( async def get_schema( self, - schema_id: str, + id: str, # pylint:disable=redefined-builtin **kwargs: Any ) -> Schema: """ Gets a registered schema by its unique ID. Azure Schema Registry guarantees that ID is unique within a namespace. - :param str schema_id: References specific schema in registry namespace. + :param str id: References specific schema in registry namespace. :rtype: Schema .. admonition:: Example: @@ -166,32 +166,32 @@ async def get_schema( """ try: - return self._id_to_schema[schema_id] + return self._id_to_schema[id] except KeyError: - request = schema_rest.build_get_by_id_request(schema_id=schema_id) + request = schema_rest.build_get_by_id_request(schema_id=id) response = await self._generated_client.send_request(request, **kwargs) response.raise_for_status() schema = _parse_response_schema(response) - self._id_to_schema[schema_id] = schema + self._id_to_schema[id] = schema return schema - async def get_schema_id( + async def get_schema_properties( self, - schema_group: str, - schema_name: str, + group_name: str, + name: str, + content: str, serialization_type: Union[str, SerializationType], - schema_content: str, **kwargs: Any ) -> SchemaProperties: """ Gets the ID referencing an existing schema within the specified schema group, as matched by schema content comparison. - :param str schema_group: Schema group under which schema should be registered. - :param str schema_name: Name of schema being registered. + :param str group_name: Schema group under which schema should be registered. + :param str name: Name of schema being registered. + :param str content: String representation of the schema being registered. :param serialization_type: Serialization type for the schema being registered. :type serialization_type: Union[str, SerializationType] - :param str schema_content: String representation of the schema being registered. :rtype: SchemaProperties .. admonition:: Example: @@ -211,14 +211,14 @@ async def get_schema_id( try: properties = self._description_to_properties[ - (schema_group, schema_name, serialization_type, schema_content) + (group_name, name, content, serialization_type) ] return properties except KeyError: request = schema_rest.build_query_id_by_content_request( - group_name=schema_group, - schema_name=schema_name, - content=schema_content, + group_name=group_name, + schema_name=name, + content=content, serialization_type=serialization_type, content_type=kwargs.pop("content_type", "application/json"), **kwargs @@ -228,11 +228,11 @@ async def get_schema_id( response.raise_for_status() schema_properties = _parse_response_schema_properties(response) - if not self._id_to_schema.get(schema_properties.schema_id): - self._id_to_schema[schema_properties.schema_id] = Schema(schema_content, schema_properties) + if not self._id_to_schema.get(schema_properties.id): + self._id_to_schema[schema_properties.id] = Schema(content, schema_properties) else: - schema_properties = self._id_to_schema[schema_properties.schema_id].schema_properties + schema_properties = self._id_to_schema[schema_properties.id].properties self._description_to_properties[ - (schema_group, schema_name, serialization_type, schema_content) + (group_name, name, content, serialization_type) ] = schema_properties return schema_properties diff --git a/sdk/schemaregistry/azure-schemaregistry/samples/async_samples/sample_code_schemaregistry_async.py b/sdk/schemaregistry/azure-schemaregistry/samples/async_samples/sample_code_schemaregistry_async.py index 091a76ac33a7..6b64971132e2 100644 --- a/sdk/schemaregistry/azure-schemaregistry/samples/async_samples/sample_code_schemaregistry_async.py +++ b/sdk/schemaregistry/azure-schemaregistry/samples/async_samples/sample_code_schemaregistry_async.py @@ -45,22 +45,22 @@ def create_client(): return schema_registry_client, token_credential -async def register_scehma(schema_registry_client): +async def register_schema(schema_registry_client): # [START register_schema_async] SCHEMA_GROUP = os.environ['SCHEMA_REGISTRY_GROUP'] SCHEMA_NAME = 'your-schema-name' SERIALIZATION_TYPE = SerializationType.AVRO SCHEMA_CONTENT = """{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}""" - schema_properties = await schema_registry_client.register_schema(SCHEMA_GROUP, SCHEMA_NAME, SERIALIZATION_TYPE, SCHEMA_CONTENT) - schem_id = schema_properties.schema_id + schema_properties = await schema_registry_client.register_schema(SCHEMA_GROUP, SCHEMA_NAME, SCHEMA_CONTENT, SERIALIZATION_TYPE) + schema_id = schema_properties.id # [END register_schema_async] - return schem_id + return schema_id async def get_schema(schema_registry_client, schema_id): # [START get_schema_async] schema = await schema_registry_client.get_schema(schema_id) - schema_content = schema.schema_content + schema_content = schema.content # [END get_schema_async] return schema_content @@ -72,16 +72,16 @@ async def get_schema_id(schema_registry_client): schema_content = """{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}""" # [START get_schema_id_async] - schema_properties = await schema_registry_client.get_schema_id(schema_group, schema_name, serialization_type, schema_content) - schem_id = schema_properties.schema_id + schema_properties = await schema_registry_client.get_schema_properties(schema_group, schema_name, schema_content, serialization_type) + schema_id = schema_properties.id # [END get_schema_id_async] - return schem_id + return schema_id async def main(): client, credential = create_client() async with client, credential: - id = await register_scehma(client) + id = await register_schema(client) schema = await get_schema(client, id) id = await get_schema_id(client) @@ -89,4 +89,3 @@ async def main(): if __name__ == '__main__': loop = asyncio.get_event_loop() loop.run_until_complete(main()) - diff --git a/sdk/schemaregistry/azure-schemaregistry/samples/async_samples/schema_registry_async.py b/sdk/schemaregistry/azure-schemaregistry/samples/async_samples/schema_registry_async.py index 2ea3c99cb611..766d6075ba67 100644 --- a/sdk/schemaregistry/azure-schemaregistry/samples/async_samples/schema_registry_async.py +++ b/sdk/schemaregistry/azure-schemaregistry/samples/async_samples/schema_registry_async.py @@ -29,28 +29,28 @@ SCHEMA_STRING = """{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}""" -async def register_schema(client, schema_group, schema_name, serialization_type, schema_string): +async def register_schema(client, schema_group, schema_name, schema_string, serialization_type): print("Registering schema...") - schema_properties = await client.register_schema(schema_group, schema_name, serialization_type, schema_string) - print("Schema registered, returned schema id is {}".format(schema_properties.schema_id)) + schema_properties = await client.register_schema(schema_group, schema_name, schema_string, serialization_type) + print("Schema registered, returned schema id is {}".format(schema_properties.id)) print("Schema properties are {}".format(schema_properties)) - return schema_properties.schema_id + return schema_properties.id async def get_schema_by_id(client, schema_id): print("Getting schema by id...") schema = await client.get_schema(schema_id) - print("The schema string of schema id: {} string is {}".format(schema_id, schema.schema_content)) + print("The schema string of schema id: {} string is {}".format(schema_id, schema.content)) print("Schema properties are {}".format(schema_id)) - return schema.schema_content + return schema.content -async def get_schema_id(client, schema_group, schema_name, serialization_type, schema_string): +async def get_schema_id(client, schema_group, schema_name, schema_string, serialization_type): print("Getting schema id...") - schema_properties = await client.get_schema_id(schema_group, schema_name, serialization_type, schema_string) - print("The schema id is: {}".format(schema_properties.schema_id)) + schema_properties = await client.get_schema_properties(schema_group, schema_name, schema_string, serialization_type) + print("The schema id is: {}".format(schema_properties.id)) print("Schema properties are {}".format(schema_properties)) - return schema_properties.schema_id + return schema_properties.id async def main(): @@ -61,9 +61,9 @@ async def main(): ) schema_registry_client = SchemaRegistryClient(endpoint=SCHEMA_REGISTRY_ENDPOINT, credential=token_credential) async with token_credential, schema_registry_client: - schema_id = await register_schema(schema_registry_client, SCHEMA_GROUP, SCHEMA_NAME, SERIALIZATION_TYPE, SCHEMA_STRING) + schema_id = await register_schema(schema_registry_client, SCHEMA_GROUP, SCHEMA_NAME, SCHEMA_STRING, SERIALIZATION_TYPE) schema_str = await get_schema_by_id(schema_registry_client, schema_id) - schema_id = await get_schema_id(schema_registry_client, SCHEMA_GROUP, SCHEMA_NAME, SERIALIZATION_TYPE, SCHEMA_STRING) + schema_id = await get_schema_id(schema_registry_client, SCHEMA_GROUP, SCHEMA_NAME, SCHEMA_STRING, SERIALIZATION_TYPE) loop = asyncio.get_event_loop() diff --git a/sdk/schemaregistry/azure-schemaregistry/samples/sync_samples/sample_code_schemaregistry.py b/sdk/schemaregistry/azure-schemaregistry/samples/sync_samples/sample_code_schemaregistry.py index 170eebeb638e..001182601c38 100644 --- a/sdk/schemaregistry/azure-schemaregistry/samples/sync_samples/sample_code_schemaregistry.py +++ b/sdk/schemaregistry/azure-schemaregistry/samples/sync_samples/sample_code_schemaregistry.py @@ -43,36 +43,35 @@ def create_client(): return schema_registry_client -def register_scehma(schema_registry_client): +def register_schema(schema_registry_client): # [START register_schema_sync] SCHEMA_GROUP = os.environ['SCHEMA_REGISTRY_GROUP'] SCHEMA_NAME = 'your-schema-name' SERIALIZATION_TYPE = SerializationType.AVRO SCHEMA_CONTENT = """{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}""" - schema_properties = schema_registry_client.register_schema(SCHEMA_GROUP, SCHEMA_NAME, SERIALIZATION_TYPE, SCHEMA_CONTENT) - schem_id = schema_properties.schema_id + schema_properties = schema_registry_client.register_schema(SCHEMA_GROUP, SCHEMA_NAME, SCHEMA_CONTENT, SERIALIZATION_TYPE) + schema_id = schema_properties.id # [END register_schema_sync] # [START print_schema_properties] - print(schema_properties.schema_id) + print(schema_properties.id) print(schema_properties.location) - print(schema_properties.location_by_id) print(schema_properties.serialization_type) print(schema_properties.version) # [END print_schema_properties] - return schem_id + return schema_id def get_schema(schema_registry_client, schema_id): # [START get_schema_sync] schema = schema_registry_client.get_schema(schema_id) - schema_content = schema.schema_content + schema_content = schema.content # [END get_schema_sync] # [START print_schema] - print(schema.schema_content) - print(schema.schema_properties) + print(schema.content) + print(schema.properties) # [END print_schema] return schema @@ -83,15 +82,15 @@ def get_schema_id(schema_registry_client): serialization_type = SerializationType.AVRO schema_content = """{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}""" # [START get_schema_id_sync] - schema_properties = schema_registry_client.get_schema_id(schema_group, schema_name, serialization_type, schema_content) - schem_id = schema_properties.schema_id + schema_properties = schema_registry_client.get_schema_properties(schema_group, schema_name, schema_content, serialization_type) + schema_id = schema_properties.id # [END get_schema_id_sync] - return schem_id + return schema_id if __name__ == '__main__': client = create_client() with client: - id = register_scehma(client) + id = register_schema(client) schema = get_schema(client, id) id = get_schema_id(client) diff --git a/sdk/schemaregistry/azure-schemaregistry/samples/sync_samples/schema_registry.py b/sdk/schemaregistry/azure-schemaregistry/samples/sync_samples/schema_registry.py index 0a5e2c3926e4..78ba7271526f 100644 --- a/sdk/schemaregistry/azure-schemaregistry/samples/sync_samples/schema_registry.py +++ b/sdk/schemaregistry/azure-schemaregistry/samples/sync_samples/schema_registry.py @@ -69,28 +69,28 @@ SCHEMA_STRING = json.dumps(SCHEMA_JSON, separators=(',', ':')) -def register_schema(client, schema_group, schema_name, serialization_type, schema_string): +def register_schema(client, schema_group, schema_name, schema_string, serialization_type): print("Registering schema...") - schema_properties = client.register_schema(schema_group, schema_name, serialization_type, schema_string) - print("Schema registered, returned schema id is {}".format(schema_properties.schema_id)) + schema_properties = client.register_schema(schema_group, schema_name, schema_string, serialization_type) + print("Schema registered, returned schema id is {}".format(schema_properties.id)) print("Schema properties are {}".format(schema_properties)) - return schema_properties.schema_id + return schema_properties.id def get_schema_by_id(client, schema_id): print("Getting schema by id...") schema = client.get_schema(schema_id) - print("The schema string of schema id: {} string is {}".format(schema_id, schema.schema_content)) + print("The schema string of schema id: {} string is {}".format(schema_id, schema.content)) print("Schema properties are {}".format(schema_id)) - return schema.schema_content + return schema.content -def get_schema_id(client, schema_group, schema_name, serialization_type, schema_string): +def get_schema_id(client, schema_group, schema_name, schema_string, serialization_type): print("Getting schema id...") - schema_properties = client.get_schema_id(schema_group, schema_name, serialization_type, schema_string) - print("The schema id is: {}".format(schema_properties.schema_id)) + schema_properties = client.get_schema_properties(schema_group, schema_name, schema_string, serialization_type) + print("The schema id is: {}".format(schema_properties.id)) print("Schema properties are {}".format(schema_properties)) - return schema_properties.schema_id + return schema_properties.id if __name__ == '__main__': @@ -101,7 +101,7 @@ def get_schema_id(client, schema_group, schema_name, serialization_type, schema_ ) schema_registry_client = SchemaRegistryClient(endpoint=SCHEMA_REGISTRY_ENDPOINT, credential=token_credential) with schema_registry_client: - schema_id = register_schema(schema_registry_client, SCHEMA_GROUP, SCHEMA_NAME, SERIALIZATION_TYPE, SCHEMA_STRING) + schema_id = register_schema(schema_registry_client, SCHEMA_GROUP, SCHEMA_NAME, SCHEMA_STRING, SERIALIZATION_TYPE) schema_str = get_schema_by_id(schema_registry_client, schema_id=schema_id) - schema_id = get_schema_id(schema_registry_client, SCHEMA_GROUP, SCHEMA_NAME, SERIALIZATION_TYPE, SCHEMA_STRING) + schema_id = get_schema_id(schema_registry_client, SCHEMA_GROUP, SCHEMA_NAME, SCHEMA_STRING, SERIALIZATION_TYPE) diff --git a/sdk/schemaregistry/azure-schemaregistry/tests/async_tests/recordings/test_schema_registry_async.test_schema_basic_async.yaml b/sdk/schemaregistry/azure-schemaregistry/tests/async_tests/recordings/test_schema_registry_async.test_schema_basic_async.yaml index 75d533747100..f9cf0fca7608 100644 --- a/sdk/schemaregistry/azure-schemaregistry/tests/async_tests/recordings/test_schema_registry_async.test_schema_basic_async.yaml +++ b/sdk/schemaregistry/azure-schemaregistry/tests/async_tests/recordings/test_schema_registry_async.test_schema_basic_async.yaml @@ -11,20 +11,20 @@ interactions: Serialization-Type: - Avro User-Agent: - - azsdk-python-azureschemaregistry/1.0.0b3 Python/3.7.10 (Windows-10-10.0.22000-SP0) + - azsdk-python-azureschemaregistry/1.0.0b3 Python/3.9.0 (Windows-10-10.0.19041-SP0) method: PUT uri: https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/test-schema-basic-asynce5e1482?api-version=2020-09-01-preview response: body: - string: '{"id":"a65a85a8db7643439b1a8634a81eecda"}' + string: '{"id":"c87ba6c2c15e4645b3665802159c6b37"}' headers: content-type: application/json - date: Tue, 31 Aug 2021 22:25:29 GMT - location: https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/test-schema-basic-asynce5e1482/versions/1?api-version=2020-09-01-preview - schema-id: a65a85a8db7643439b1a8634a81eecda - schema-id-location: https://sr-playground.servicebus.windows.net:443/$schemagroups/getschemabyid/a65a85a8db7643439b1a8634a81eecda?api-version=2020-09-01-preview + date: Fri, 03 Sep 2021 21:37:45 GMT + location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-basic-asynce5e1482/versions/1?api-version=2020-09-01-preview + schema-id: c87ba6c2c15e4645b3665802159c6b37 + schema-id-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/getschemabyid/c87ba6c2c15e4645b3665802159c6b37?api-version=2020-09-01-preview schema-version: '1' - schema-versions-location: https://sr-playground.servicebus.windows.net:443/$schemagroups/yuling-test-group/schemas/test-schema-basic-asynce5e1482/versions?api-version=2020-09-01-preview + schema-versions-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/test-schema-basic-asynce5e1482/versions?api-version=2020-09-01-preview serialization-type: Avro server: Microsoft-HTTPAPI/2.0 strict-transport-security: max-age=31536000 @@ -32,7 +32,7 @@ interactions: status: code: 200 message: OK - url: https://sr-playground.servicebus.windows.net/$schemagroups/yuling-test-group/schemas/test-schema-basic-asynce5e1482?api-version=2020-09-01-preview + url: https://swathip-test-eventhubs.servicebus.windows.net/$schemagroups/swathip-test-schema/schemas/test-schema-basic-asynce5e1482?api-version=2020-09-01-preview - request: body: '{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}' headers: @@ -45,20 +45,20 @@ interactions: Serialization-Type: - Avro User-Agent: - - azsdk-python-azureschemaregistry/1.0.0b3 Python/3.7.10 (Windows-10-10.0.22000-SP0) + - azsdk-python-azureschemaregistry/1.0.0b3 Python/3.9.0 (Windows-10-10.0.19041-SP0) method: POST uri: https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/test-schema-basic-asynce5e1482?api-version=2020-09-01-preview response: body: - string: '{"id":"a65a85a8db7643439b1a8634a81eecda"}' + string: '{"id":"c87ba6c2c15e4645b3665802159c6b37"}' headers: content-type: application/json - date: Tue, 31 Aug 2021 22:25:29 GMT - location: https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/test-schema-basic-asynce5e1482/versions/1?api-version=2020-09-01-preview - schema-id: a65a85a8db7643439b1a8634a81eecda - schema-id-location: https://sr-playground.servicebus.windows.net:443/$schemagroups/getschemabyid/a65a85a8db7643439b1a8634a81eecda?api-version=2020-09-01-preview + date: Fri, 03 Sep 2021 21:37:45 GMT + location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-basic-asynce5e1482/versions/1?api-version=2020-09-01-preview + schema-id: c87ba6c2c15e4645b3665802159c6b37 + schema-id-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/getschemabyid/c87ba6c2c15e4645b3665802159c6b37?api-version=2020-09-01-preview schema-version: '1' - schema-versions-location: https://sr-playground.servicebus.windows.net:443/$schemagroups/yuling-test-group/schemas/test-schema-basic-asynce5e1482/versions?api-version=2020-09-01-preview + schema-versions-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/test-schema-basic-asynce5e1482/versions?api-version=2020-09-01-preview serialization-type: Avro server: Microsoft-HTTPAPI/2.0 strict-transport-security: max-age=31536000 @@ -66,5 +66,5 @@ interactions: status: code: 200 message: OK - url: https://sr-playground.servicebus.windows.net/$schemagroups/yuling-test-group/schemas/test-schema-basic-asynce5e1482?api-version=2020-09-01-preview + url: https://swathip-test-eventhubs.servicebus.windows.net/$schemagroups/swathip-test-schema/schemas/test-schema-basic-asynce5e1482?api-version=2020-09-01-preview version: 1 diff --git a/sdk/schemaregistry/azure-schemaregistry/tests/async_tests/recordings/test_schema_registry_async.test_schema_negative_no_schema_async.yaml b/sdk/schemaregistry/azure-schemaregistry/tests/async_tests/recordings/test_schema_registry_async.test_schema_negative_no_schema_async.yaml index 1eecf9fd3fc5..c190d43ab754 100644 --- a/sdk/schemaregistry/azure-schemaregistry/tests/async_tests/recordings/test_schema_registry_async.test_schema_negative_no_schema_async.yaml +++ b/sdk/schemaregistry/azure-schemaregistry/tests/async_tests/recordings/test_schema_registry_async.test_schema_negative_no_schema_async.yaml @@ -5,47 +5,47 @@ interactions: Accept: - text/plain; charset=utf-8 User-Agent: - - azsdk-python-azureschemaregistry/1.0.0b3 Python/3.7.10 (Windows-10-10.0.22000-SP0) + - azsdk-python-azureschemaregistry/1.0.0b3 Python/3.9.0 (Windows-10-10.0.19041-SP0) method: GET uri: https://fake_resource.servicebus.windows.net/$schemagroups/getSchemaById/a?api-version=2020-09-01-preview response: body: string: '{"Code":400,"Detail":"SubCode=40000, UnknownType:The request is invalid. - [MGResponseHttpError=BadRequest]. TrackingId:645389d5-1337-41c1-ba12-e9ec8aa555d4_G5, - SystemTracker:fake_resource.servicebus.windows.net/:$schemagroups\/getSchemaById\/a, - Timestamp:2021-08-31T22:25:31"}' + [MGResponseHttpError=BadRequest]. TrackingId:faf1cce9-f0c7-4dfb-bdcc-4410c3f74b30_G29, + SystemTracker:swathip-test-eventhubs.servicebus.windows.net:$schemagroups\/getSchemaById\/a, + Timestamp:2021-09-03T21:37:47"}' headers: content-type: application/json - date: Tue, 31 Aug 2021 22:25:31 GMT + date: Fri, 03 Sep 2021 21:37:47 GMT server: Microsoft-HTTPAPI/2.0 strict-transport-security: max-age=31536000 transfer-encoding: chunked status: code: 400 message: Bad Request - url: https://sr-playground.servicebus.windows.net/$schemagroups/getSchemaById/a?api-version=2020-09-01-preview + url: https://swathip-test-eventhubs.servicebus.windows.net/$schemagroups/getSchemaById/a?api-version=2020-09-01-preview - request: body: null headers: Accept: - text/plain; charset=utf-8 User-Agent: - - azsdk-python-azureschemaregistry/1.0.0b3 Python/3.7.10 (Windows-10-10.0.22000-SP0) + - azsdk-python-azureschemaregistry/1.0.0b3 Python/3.9.0 (Windows-10-10.0.19041-SP0) method: GET uri: https://fake_resource.servicebus.windows.net/$schemagroups/getSchemaById/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa?api-version=2020-09-01-preview response: body: string: '{"Code":404,"Detail":"Schema id aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa does - not exist. TrackingId:2f235cd0-3f3f-4066-a793-c22a377b65a8_G5, SystemTracker:fake_resource.servicebus.windows.net/:$schemagroups\/getSchemaById\/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, - Timestamp:2021-08-31T22:25:31"}' + not exist. TrackingId:520d7a70-c165-4edd-8855-046ff6be2f72_G29, SystemTracker:swathip-test-eventhubs.servicebus.windows.net:$schemagroups\/getSchemaById\/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, + Timestamp:2021-09-03T21:37:48"}' headers: content-type: application/json - date: Tue, 31 Aug 2021 22:25:31 GMT + date: Fri, 03 Sep 2021 21:37:47 GMT server: Microsoft-HTTPAPI/2.0 strict-transport-security: max-age=31536000 transfer-encoding: chunked status: code: 404 message: Not Found - url: https://sr-playground.servicebus.windows.net/$schemagroups/getSchemaById/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa?api-version=2020-09-01-preview + url: https://swathip-test-eventhubs.servicebus.windows.net/$schemagroups/getSchemaById/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa?api-version=2020-09-01-preview version: 1 diff --git a/sdk/schemaregistry/azure-schemaregistry/tests/async_tests/recordings/test_schema_registry_async.test_schema_same_twice_async.yaml b/sdk/schemaregistry/azure-schemaregistry/tests/async_tests/recordings/test_schema_registry_async.test_schema_same_twice_async.yaml index d3b1d6dc4cb1..25fe86bf5574 100644 --- a/sdk/schemaregistry/azure-schemaregistry/tests/async_tests/recordings/test_schema_registry_async.test_schema_same_twice_async.yaml +++ b/sdk/schemaregistry/azure-schemaregistry/tests/async_tests/recordings/test_schema_registry_async.test_schema_same_twice_async.yaml @@ -11,20 +11,20 @@ interactions: Serialization-Type: - Avro User-Agent: - - azsdk-python-azureschemaregistry/1.0.0b3 Python/3.7.10 (Windows-10-10.0.22000-SP0) + - azsdk-python-azureschemaregistry/1.0.0b3 Python/3.9.0 (Windows-10-10.0.19041-SP0) method: PUT uri: https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/test-schema-twice-async7bfd16a1?api-version=2020-09-01-preview response: body: - string: '{"id":"7b256fb77fff49749307eb40e10bbc8e"}' + string: '{"id":"99a89631052e4a22a9fca816cbd2761a"}' headers: content-type: application/json - date: Tue, 31 Aug 2021 22:25:39 GMT - location: https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/test-schema-twice-async7bfd16a1/versions/1?api-version=2020-09-01-preview - schema-id: 7b256fb77fff49749307eb40e10bbc8e - schema-id-location: https://sr-playground.servicebus.windows.net:443/$schemagroups/getschemabyid/7b256fb77fff49749307eb40e10bbc8e?api-version=2020-09-01-preview + date: Fri, 03 Sep 2021 21:37:54 GMT + location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-twice-async7bfd16a1/versions/1?api-version=2020-09-01-preview + schema-id: 99a89631052e4a22a9fca816cbd2761a + schema-id-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/getschemabyid/99a89631052e4a22a9fca816cbd2761a?api-version=2020-09-01-preview schema-version: '1' - schema-versions-location: https://sr-playground.servicebus.windows.net:443/$schemagroups/yuling-test-group/schemas/test-schema-twice-async7bfd16a1/versions?api-version=2020-09-01-preview + schema-versions-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/test-schema-twice-async7bfd16a1/versions?api-version=2020-09-01-preview serialization-type: Avro server: Microsoft-HTTPAPI/2.0 strict-transport-security: max-age=31536000 @@ -32,7 +32,7 @@ interactions: status: code: 200 message: OK - url: https://sr-playground.servicebus.windows.net/$schemagroups/yuling-test-group/schemas/test-schema-twice-async7bfd16a1?api-version=2020-09-01-preview + url: https://swathip-test-eventhubs.servicebus.windows.net/$schemagroups/swathip-test-schema/schemas/test-schema-twice-async7bfd16a1?api-version=2020-09-01-preview - request: body: '{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"age","type":["int","null"]},{"name":"city","type":["string","null"]}]}' headers: @@ -45,20 +45,20 @@ interactions: Serialization-Type: - Avro User-Agent: - - azsdk-python-azureschemaregistry/1.0.0b3 Python/3.7.10 (Windows-10-10.0.22000-SP0) + - azsdk-python-azureschemaregistry/1.0.0b3 Python/3.9.0 (Windows-10-10.0.19041-SP0) method: PUT uri: https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/test-schema-twice-async7bfd16a1?api-version=2020-09-01-preview response: body: - string: '{"id":"7b256fb77fff49749307eb40e10bbc8e"}' + string: '{"id":"99a89631052e4a22a9fca816cbd2761a"}' headers: content-type: application/json - date: Tue, 31 Aug 2021 22:25:39 GMT - location: https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/test-schema-twice-async7bfd16a1/versions/1?api-version=2020-09-01-preview - schema-id: 7b256fb77fff49749307eb40e10bbc8e - schema-id-location: https://sr-playground.servicebus.windows.net:443/$schemagroups/getschemabyid/7b256fb77fff49749307eb40e10bbc8e?api-version=2020-09-01-preview + date: Fri, 03 Sep 2021 21:37:55 GMT + location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-twice-async7bfd16a1/versions/1?api-version=2020-09-01-preview + schema-id: 99a89631052e4a22a9fca816cbd2761a + schema-id-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/getschemabyid/99a89631052e4a22a9fca816cbd2761a?api-version=2020-09-01-preview schema-version: '1' - schema-versions-location: https://sr-playground.servicebus.windows.net:443/$schemagroups/yuling-test-group/schemas/test-schema-twice-async7bfd16a1/versions?api-version=2020-09-01-preview + schema-versions-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/test-schema-twice-async7bfd16a1/versions?api-version=2020-09-01-preview serialization-type: Avro server: Microsoft-HTTPAPI/2.0 strict-transport-security: max-age=31536000 @@ -66,5 +66,5 @@ interactions: status: code: 200 message: OK - url: https://sr-playground.servicebus.windows.net/$schemagroups/yuling-test-group/schemas/test-schema-twice-async7bfd16a1?api-version=2020-09-01-preview + url: https://swathip-test-eventhubs.servicebus.windows.net/$schemagroups/swathip-test-schema/schemas/test-schema-twice-async7bfd16a1?api-version=2020-09-01-preview version: 1 diff --git a/sdk/schemaregistry/azure-schemaregistry/tests/async_tests/recordings/test_schema_registry_async.test_schema_update_async.yaml b/sdk/schemaregistry/azure-schemaregistry/tests/async_tests/recordings/test_schema_registry_async.test_schema_update_async.yaml index 6970b53fbc8c..e220c13d7e0b 100644 --- a/sdk/schemaregistry/azure-schemaregistry/tests/async_tests/recordings/test_schema_registry_async.test_schema_update_async.yaml +++ b/sdk/schemaregistry/azure-schemaregistry/tests/async_tests/recordings/test_schema_registry_async.test_schema_update_async.yaml @@ -11,20 +11,20 @@ interactions: Serialization-Type: - Avro User-Agent: - - azsdk-python-azureschemaregistry/1.0.0b3 Python/3.7.10 (Windows-10-10.0.22000-SP0) + - azsdk-python-azureschemaregistry/1.0.0b3 Python/3.9.0 (Windows-10-10.0.19041-SP0) method: PUT uri: https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/test-schema-update-async24591503?api-version=2020-09-01-preview response: body: - string: '{"id":"5de96b34209e45d0ad3eb5716ca48db6"}' + string: '{"id":"ff159041473444f1a972100623c394fd"}' headers: content-type: application/json - date: Tue, 31 Aug 2021 22:25:41 GMT - location: https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/test-schema-update-async24591503/versions/1?api-version=2020-09-01-preview - schema-id: 5de96b34209e45d0ad3eb5716ca48db6 - schema-id-location: https://sr-playground.servicebus.windows.net:443/$schemagroups/getschemabyid/5de96b34209e45d0ad3eb5716ca48db6?api-version=2020-09-01-preview - schema-version: '1' - schema-versions-location: https://sr-playground.servicebus.windows.net:443/$schemagroups/yuling-test-group/schemas/test-schema-update-async24591503/versions?api-version=2020-09-01-preview + date: Fri, 03 Sep 2021 21:37:56 GMT + location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-update-async24591503/versions/3?api-version=2020-09-01-preview + schema-id: ff159041473444f1a972100623c394fd + schema-id-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/getschemabyid/ff159041473444f1a972100623c394fd?api-version=2020-09-01-preview + schema-version: '3' + schema-versions-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/test-schema-update-async24591503/versions?api-version=2020-09-01-preview serialization-type: Avro server: Microsoft-HTTPAPI/2.0 strict-transport-security: max-age=31536000 @@ -32,7 +32,7 @@ interactions: status: code: 200 message: OK - url: https://sr-playground.servicebus.windows.net/$schemagroups/yuling-test-group/schemas/test-schema-update-async24591503?api-version=2020-09-01-preview + url: https://swathip-test-eventhubs.servicebus.windows.net/$schemagroups/swathip-test-schema/schemas/test-schema-update-async24591503?api-version=2020-09-01-preview - request: body: '{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_food","type":["string","null"]}]}' headers: @@ -45,20 +45,20 @@ interactions: Serialization-Type: - Avro User-Agent: - - azsdk-python-azureschemaregistry/1.0.0b3 Python/3.7.10 (Windows-10-10.0.22000-SP0) + - azsdk-python-azureschemaregistry/1.0.0b3 Python/3.9.0 (Windows-10-10.0.19041-SP0) method: PUT uri: https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/test-schema-update-async24591503?api-version=2020-09-01-preview response: body: - string: '{"id":"1bd929dd66b54cb5a04da5dfc4736835"}' + string: '{"id":"680ba41f9439473d9efb9b8c044635cc"}' headers: content-type: application/json - date: Tue, 31 Aug 2021 22:25:41 GMT - location: https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/test-schema-update-async24591503/versions/2?api-version=2020-09-01-preview - schema-id: 1bd929dd66b54cb5a04da5dfc4736835 - schema-id-location: https://sr-playground.servicebus.windows.net:443/$schemagroups/getschemabyid/1bd929dd66b54cb5a04da5dfc4736835?api-version=2020-09-01-preview - schema-version: '2' - schema-versions-location: https://sr-playground.servicebus.windows.net:443/$schemagroups/yuling-test-group/schemas/test-schema-update-async24591503/versions?api-version=2020-09-01-preview + date: Fri, 03 Sep 2021 21:37:57 GMT + location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-update-async24591503/versions/4?api-version=2020-09-01-preview + schema-id: 680ba41f9439473d9efb9b8c044635cc + schema-id-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/getschemabyid/680ba41f9439473d9efb9b8c044635cc?api-version=2020-09-01-preview + schema-version: '4' + schema-versions-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/test-schema-update-async24591503/versions?api-version=2020-09-01-preview serialization-type: Avro server: Microsoft-HTTPAPI/2.0 strict-transport-security: max-age=31536000 @@ -66,27 +66,27 @@ interactions: status: code: 200 message: OK - url: https://sr-playground.servicebus.windows.net/$schemagroups/yuling-test-group/schemas/test-schema-update-async24591503?api-version=2020-09-01-preview + url: https://swathip-test-eventhubs.servicebus.windows.net/$schemagroups/swathip-test-schema/schemas/test-schema-update-async24591503?api-version=2020-09-01-preview - request: body: null headers: Accept: - text/plain; charset=utf-8 User-Agent: - - azsdk-python-azureschemaregistry/1.0.0b3 Python/3.7.10 (Windows-10-10.0.22000-SP0) + - azsdk-python-azureschemaregistry/1.0.0b3 Python/3.9.0 (Windows-10-10.0.19041-SP0) method: GET - uri: https://fake_resource.servicebus.windows.net/$schemagroups/getSchemaById/1bd929dd66b54cb5a04da5dfc4736835?api-version=2020-09-01-preview + uri: https://fake_resource.servicebus.windows.net/$schemagroups/getSchemaById/680ba41f9439473d9efb9b8c044635cc?api-version=2020-09-01-preview response: body: string: '{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_food","type":["string","null"]}]}' headers: content-type: application/json - date: Tue, 31 Aug 2021 22:25:42 GMT - location: https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/test-schema-update-async24591503/versions/2?api-version=2020-09-01-preview - schema-id: 1bd929dd66b54cb5a04da5dfc4736835 - schema-id-location: https://sr-playground.servicebus.windows.net:443/$schemagroups/getschemabyid/1bd929dd66b54cb5a04da5dfc4736835?api-version=2020-09-01-preview - schema-version: '2' - schema-versions-location: https://sr-playground.servicebus.windows.net:443/$schemagroups/yuling-test-group/schemas/test-schema-update-async24591503/versions?api-version=2020-09-01-preview + date: Fri, 03 Sep 2021 21:37:57 GMT + location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-update-async24591503/versions/4?api-version=2020-09-01-preview + schema-id: 680ba41f9439473d9efb9b8c044635cc + schema-id-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/getschemabyid/680ba41f9439473d9efb9b8c044635cc?api-version=2020-09-01-preview + schema-version: '4' + schema-versions-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/test-schema-update-async24591503/versions?api-version=2020-09-01-preview serialization-type: Avro server: Microsoft-HTTPAPI/2.0 strict-transport-security: max-age=31536000 @@ -94,27 +94,27 @@ interactions: status: code: 200 message: OK - url: https://sr-playground.servicebus.windows.net/$schemagroups/getSchemaById/1bd929dd66b54cb5a04da5dfc4736835?api-version=2020-09-01-preview + url: https://swathip-test-eventhubs.servicebus.windows.net/$schemagroups/getSchemaById/680ba41f9439473d9efb9b8c044635cc?api-version=2020-09-01-preview - request: body: null headers: Accept: - text/plain; charset=utf-8 User-Agent: - - azsdk-python-azureschemaregistry/1.0.0b3 Python/3.7.10 (Windows-10-10.0.22000-SP0) + - azsdk-python-azureschemaregistry/1.0.0b3 Python/3.9.0 (Windows-10-10.0.19041-SP0) method: GET - uri: https://fake_resource.servicebus.windows.net/$schemagroups/getSchemaById/1bd929dd66b54cb5a04da5dfc4736835?api-version=2020-09-01-preview + uri: https://fake_resource.servicebus.windows.net/$schemagroups/getSchemaById/680ba41f9439473d9efb9b8c044635cc?api-version=2020-09-01-preview response: body: string: '{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_food","type":["string","null"]}]}' headers: content-type: application/json - date: Tue, 31 Aug 2021 22:25:42 GMT - location: https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/test-schema-update-async24591503/versions/2?api-version=2020-09-01-preview - schema-id: 1bd929dd66b54cb5a04da5dfc4736835 - schema-id-location: https://sr-playground.servicebus.windows.net:443/$schemagroups/getschemabyid/1bd929dd66b54cb5a04da5dfc4736835?api-version=2020-09-01-preview - schema-version: '2' - schema-versions-location: https://sr-playground.servicebus.windows.net:443/$schemagroups/yuling-test-group/schemas/test-schema-update-async24591503/versions?api-version=2020-09-01-preview + date: Fri, 03 Sep 2021 21:37:57 GMT + location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-update-async24591503/versions/4?api-version=2020-09-01-preview + schema-id: 680ba41f9439473d9efb9b8c044635cc + schema-id-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/getschemabyid/680ba41f9439473d9efb9b8c044635cc?api-version=2020-09-01-preview + schema-version: '4' + schema-versions-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/test-schema-update-async24591503/versions?api-version=2020-09-01-preview serialization-type: Avro server: Microsoft-HTTPAPI/2.0 strict-transport-security: max-age=31536000 @@ -122,7 +122,7 @@ interactions: status: code: 200 message: OK - url: https://sr-playground.servicebus.windows.net/$schemagroups/getSchemaById/1bd929dd66b54cb5a04da5dfc4736835?api-version=2020-09-01-preview + url: https://swathip-test-eventhubs.servicebus.windows.net/$schemagroups/getSchemaById/680ba41f9439473d9efb9b8c044635cc?api-version=2020-09-01-preview - request: body: '{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_food","type":["string","null"]}]}' headers: @@ -135,20 +135,20 @@ interactions: Serialization-Type: - Avro User-Agent: - - azsdk-python-azureschemaregistry/1.0.0b3 Python/3.7.10 (Windows-10-10.0.22000-SP0) + - azsdk-python-azureschemaregistry/1.0.0b3 Python/3.9.0 (Windows-10-10.0.19041-SP0) method: POST uri: https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/test-schema-update-async24591503?api-version=2020-09-01-preview response: body: - string: '{"id":"1bd929dd66b54cb5a04da5dfc4736835"}' + string: '{"id":"680ba41f9439473d9efb9b8c044635cc"}' headers: content-type: application/json - date: Tue, 31 Aug 2021 22:25:42 GMT - location: https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/test-schema-update-async24591503/versions/2?api-version=2020-09-01-preview - schema-id: 1bd929dd66b54cb5a04da5dfc4736835 - schema-id-location: https://sr-playground.servicebus.windows.net:443/$schemagroups/getschemabyid/1bd929dd66b54cb5a04da5dfc4736835?api-version=2020-09-01-preview - schema-version: '2' - schema-versions-location: https://sr-playground.servicebus.windows.net:443/$schemagroups/yuling-test-group/schemas/test-schema-update-async24591503/versions?api-version=2020-09-01-preview + date: Fri, 03 Sep 2021 21:37:58 GMT + location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-update-async24591503/versions/4?api-version=2020-09-01-preview + schema-id: 680ba41f9439473d9efb9b8c044635cc + schema-id-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/getschemabyid/680ba41f9439473d9efb9b8c044635cc?api-version=2020-09-01-preview + schema-version: '4' + schema-versions-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/test-schema-update-async24591503/versions?api-version=2020-09-01-preview serialization-type: Avro server: Microsoft-HTTPAPI/2.0 strict-transport-security: max-age=31536000 @@ -156,5 +156,5 @@ interactions: status: code: 200 message: OK - url: https://sr-playground.servicebus.windows.net/$schemagroups/yuling-test-group/schemas/test-schema-update-async24591503?api-version=2020-09-01-preview + url: https://swathip-test-eventhubs.servicebus.windows.net/$schemagroups/swathip-test-schema/schemas/test-schema-update-async24591503?api-version=2020-09-01-preview version: 1 diff --git a/sdk/schemaregistry/azure-schemaregistry/tests/async_tests/test_schema_registry_async.py b/sdk/schemaregistry/azure-schemaregistry/tests/async_tests/test_schema_registry_async.py index 94ea91274cd2..093bb43e085e 100644 --- a/sdk/schemaregistry/azure-schemaregistry/tests/async_tests/test_schema_registry_async.py +++ b/sdk/schemaregistry/azure-schemaregistry/tests/async_tests/test_schema_registry_async.py @@ -49,46 +49,43 @@ async def test_schema_basic_async(self, schemaregistry_endpoint, schemaregistry_ serialization_type = "Avro" assert len(client._id_to_schema) == 0 assert len(client._description_to_properties) == 0 - schema_properties = await client.register_schema(schemaregistry_group, schema_name, serialization_type, schema_str) + schema_properties = await client.register_schema(schemaregistry_group, schema_name, schema_str, serialization_type) assert len(client._id_to_schema) == 1 assert len(client._description_to_properties) == 1 - assert schema_properties.schema_id is not None + assert schema_properties.id is not None assert schema_properties.location is not None - assert schema_properties.location_by_id is not None assert schema_properties.version is 1 assert schema_properties.serialization_type == "Avro" - returned_schema = await client.get_schema(schema_id=schema_properties.schema_id) + returned_schema = await client.get_schema(id=schema_properties.id) - assert returned_schema.schema_properties.schema_id == schema_properties.schema_id - assert returned_schema.schema_properties.location is not None - assert returned_schema.schema_properties.location_by_id is not None - assert returned_schema.schema_properties.version == 1 - assert returned_schema.schema_properties.serialization_type == "Avro" - assert returned_schema.schema_content == schema_str + assert returned_schema.properties.id == schema_properties.id + assert returned_schema.properties.location is not None + assert returned_schema.properties.version == 1 + assert returned_schema.properties.serialization_type == "Avro" + assert returned_schema.content == schema_str - # check that same cached properties object is returned by get_schema_id - cached_properties = await client.get_schema_id(schemaregistry_group, schema_name, serialization_type, schema_str) - same_cached_properties = await client.get_schema_id(schemaregistry_group, schema_name, serialization_type, schema_str) + # check that same cached properties object is returned by get_schema_properties + cached_properties = await client.get_schema_properties(schemaregistry_group, schema_name, schema_str, serialization_type) + same_cached_properties = await client.get_schema_properties(schemaregistry_group, schema_name, schema_str, serialization_type) assert same_cached_properties == cached_properties # check if schema is added to cache when it does not exist in the cache cached_properties = client._description_to_properties[ - (schemaregistry_group, schema_name, serialization_type, schema_str) + (schemaregistry_group, schema_name, schema_str, serialization_type) ] properties_cache_length = len(client._description_to_properties) del client._description_to_properties[ - (schemaregistry_group, schema_name, serialization_type, schema_str) + (schemaregistry_group, schema_name, schema_str, serialization_type) ] assert len(client._description_to_properties) == properties_cache_length - 1 - returned_schema_properties = await client.get_schema_id(schemaregistry_group, schema_name, serialization_type, schema_str) + returned_schema_properties = await client.get_schema_properties(schemaregistry_group, schema_name, schema_str, serialization_type) assert len(client._description_to_properties) == properties_cache_length - assert returned_schema_properties.schema_id == schema_properties.schema_id + assert returned_schema_properties.id == schema_properties.id assert returned_schema_properties.location is not None - assert returned_schema_properties.location_by_id is not None assert returned_schema_properties.version == 1 assert returned_schema_properties.serialization_type == "Avro" await client._generated_client._config.credential.close() @@ -100,51 +97,48 @@ async def test_schema_update_async(self, schemaregistry_endpoint, schemaregistry schema_name = self.get_resource_name('test-schema-update-async') schema_str = """{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}""" serialization_type = "Avro" - schema_properties = await client.register_schema(schemaregistry_group, schema_name, serialization_type, schema_str) + schema_properties = await client.register_schema(schemaregistry_group, schema_name, schema_str, serialization_type) - assert schema_properties.schema_id is not None + assert schema_properties.id is not None assert schema_properties.location is not None - assert schema_properties.location_by_id is not None assert schema_properties.version != 0 assert schema_properties.serialization_type == "Avro" schema_str_new = """{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_food","type":["string","null"]}]}""" - new_schema_properties = await client.register_schema(schemaregistry_group, schema_name, serialization_type, schema_str_new) + new_schema_properties = await client.register_schema(schemaregistry_group, schema_name, schema_str_new, serialization_type) - assert new_schema_properties.schema_id is not None + assert new_schema_properties.id is not None assert new_schema_properties.location is not None - assert new_schema_properties.location_by_id is not None assert new_schema_properties.version == schema_properties.version + 1 assert new_schema_properties.serialization_type == "Avro" # check that same cached schema object is returned by get_schema - cached_schema = await client.get_schema(schema_id=new_schema_properties.schema_id) - same_cached_schema = await client.get_schema(schema_id=new_schema_properties.schema_id) + cached_schema = await client.get_schema(id=new_schema_properties.id) + same_cached_schema = await client.get_schema(id=new_schema_properties.id) assert same_cached_schema == cached_schema # check if schema is added to cache when it does not exist in the cache - cached_schema = client._id_to_schema[new_schema_properties.schema_id] + cached_schema = client._id_to_schema[new_schema_properties.id] schema_cache_length = len(client._id_to_schema) - del client._id_to_schema[new_schema_properties.schema_id] + del client._id_to_schema[new_schema_properties.id] assert len(client._id_to_schema) == schema_cache_length - 1 - new_schema = await client.get_schema(schema_id=new_schema_properties.schema_id) + new_schema = await client.get_schema(id=new_schema_properties.id) assert len(client._id_to_schema) == schema_cache_length - assert new_schema.schema_properties.schema_id != schema_properties.schema_id - assert new_schema.schema_properties.schema_id == new_schema_properties.schema_id - assert new_schema.schema_properties.location is not None - assert new_schema.schema_properties.location_by_id is not None - assert new_schema.schema_content == schema_str_new - assert new_schema.schema_properties.version == schema_properties.version + 1 - assert new_schema.schema_properties.serialization_type == "Avro" + assert new_schema.properties.id != schema_properties.id + assert new_schema.properties.id == new_schema_properties.id + assert new_schema.properties.location is not None + assert new_schema.content == schema_str_new + assert new_schema.properties.version == schema_properties.version + 1 + assert new_schema.properties.serialization_type == "Avro" # check that properties object is the same in caches client._id_to_schema = {} client._description_to_properties = {} - new_schema = await client.get_schema(schema_id=new_schema_properties.schema_id) - new_schema_properties = await client.get_schema_id(schemaregistry_group, schema_name, serialization_type, schema_str_new) - assert new_schema.schema_properties == new_schema_properties + new_schema = await client.get_schema(id=new_schema_properties.id) + new_schema_properties = await client.get_schema_properties(schemaregistry_group, schema_name, schema_str_new, serialization_type) + assert new_schema.properties == new_schema_properties await client._generated_client._config.credential.close() @SchemaRegistryPowerShellPreparer() @@ -154,13 +148,13 @@ async def test_schema_same_twice_async(self, schemaregistry_endpoint, schemaregi schema_str = """{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"age","type":["int","null"]},{"name":"city","type":["string","null"]}]}""" serialization_type = "Avro" async with client: - schema_properties = await client.register_schema(schemaregistry_group, schema_name, serialization_type, schema_str) + schema_properties = await client.register_schema(schemaregistry_group, schema_name, schema_str, serialization_type) schema_cache_length = len(client._id_to_schema) desc_cache_length = len(client._description_to_properties) - schema_properties_second = await client.register_schema(schemaregistry_group, schema_name, serialization_type, schema_str) + schema_properties_second = await client.register_schema(schemaregistry_group, schema_name, schema_str, serialization_type) schema_cache_second_length = len(client._id_to_schema) desc_cache_second_length = len(client._description_to_properties) - assert schema_properties.schema_id == schema_properties_second.schema_id + assert schema_properties.id == schema_properties_second.id assert schema_cache_length == schema_cache_second_length assert desc_cache_length == desc_cache_second_length await client._generated_client._config.credential.close() @@ -174,7 +168,7 @@ async def test_schema_negative_wrong_credential_async(self, schemaregistry_endpo schema_str = """{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}""" serialization_type = "Avro" with pytest.raises(ClientAuthenticationError): - await client.register_schema(schemaregistry_group, schema_name, serialization_type, schema_str) + await client.register_schema(schemaregistry_group, schema_name, schema_str, serialization_type) @SchemaRegistryPowerShellPreparer() async def test_schema_negative_wrong_endpoint_async(self, schemaregistry_endpoint, schemaregistry_group, **kwargs): @@ -184,7 +178,7 @@ async def test_schema_negative_wrong_endpoint_async(self, schemaregistry_endpoin schema_str = """{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}""" serialization_type = "Avro" with pytest.raises(ServiceRequestError): - await client.register_schema(schemaregistry_group, schema_name, serialization_type, schema_str) + await client.register_schema(schemaregistry_group, schema_name, schema_str, serialization_type) await client._generated_client._config.credential.close() @SchemaRegistryPowerShellPreparer() diff --git a/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_schema_basic.yaml b/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_schema_basic.yaml index 489cb933c3a9..c49c7d65f97b 100644 --- a/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_schema_basic.yaml +++ b/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_schema_basic.yaml @@ -15,27 +15,27 @@ interactions: Serialization-Type: - Avro User-Agent: - - azsdk-python-azureschemaregistry/1.0.0b3 Python/3.7.10 (Windows-10-10.0.22000-SP0) + - azsdk-python-azureschemaregistry/1.0.0b3 Python/3.9.0 (Windows-10-10.0.19041-SP0) method: PUT uri: https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/test-schema-basic31c70f88?api-version=2020-09-01-preview response: body: - string: '{"id":"9c8d88f0996f4d119be49f2f38e8b9fe"}' + string: '{"id":"4e0f965608ea4e92b166bc3ef266cada"}' headers: content-type: - application/json date: - - Tue, 31 Aug 2021 22:25:12 GMT + - Fri, 03 Sep 2021 21:37:31 GMT location: - - https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/test-schema-basic31c70f88/versions/1?api-version=2020-09-01-preview + - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-basic31c70f88/versions/1?api-version=2020-09-01-preview schema-id: - - 9c8d88f0996f4d119be49f2f38e8b9fe + - 4e0f965608ea4e92b166bc3ef266cada schema-id-location: - - https://sr-playground.servicebus.windows.net:443/$schemagroups/getschemabyid/9c8d88f0996f4d119be49f2f38e8b9fe?api-version=2020-09-01-preview + - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/getschemabyid/4e0f965608ea4e92b166bc3ef266cada?api-version=2020-09-01-preview schema-version: - '1' schema-versions-location: - - https://sr-playground.servicebus.windows.net:443/$schemagroups/yuling-test-group/schemas/test-schema-basic31c70f88/versions?api-version=2020-09-01-preview + - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/test-schema-basic31c70f88/versions?api-version=2020-09-01-preview serialization-type: - Avro server: @@ -63,27 +63,27 @@ interactions: Serialization-Type: - Avro User-Agent: - - azsdk-python-azureschemaregistry/1.0.0b3 Python/3.7.10 (Windows-10-10.0.22000-SP0) + - azsdk-python-azureschemaregistry/1.0.0b3 Python/3.9.0 (Windows-10-10.0.19041-SP0) method: POST uri: https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/test-schema-basic31c70f88?api-version=2020-09-01-preview response: body: - string: '{"id":"9c8d88f0996f4d119be49f2f38e8b9fe"}' + string: '{"id":"4e0f965608ea4e92b166bc3ef266cada"}' headers: content-type: - application/json date: - - Tue, 31 Aug 2021 22:25:12 GMT + - Fri, 03 Sep 2021 21:37:31 GMT location: - - https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/test-schema-basic31c70f88/versions/1?api-version=2020-09-01-preview + - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-basic31c70f88/versions/1?api-version=2020-09-01-preview schema-id: - - 9c8d88f0996f4d119be49f2f38e8b9fe + - 4e0f965608ea4e92b166bc3ef266cada schema-id-location: - - https://sr-playground.servicebus.windows.net:443/$schemagroups/getschemabyid/9c8d88f0996f4d119be49f2f38e8b9fe?api-version=2020-09-01-preview + - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/getschemabyid/4e0f965608ea4e92b166bc3ef266cada?api-version=2020-09-01-preview schema-version: - '1' schema-versions-location: - - https://sr-playground.servicebus.windows.net:443/$schemagroups/yuling-test-group/schemas/test-schema-basic31c70f88/versions?api-version=2020-09-01-preview + - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/test-schema-basic31c70f88/versions?api-version=2020-09-01-preview serialization-type: - Avro server: diff --git a/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_schema_negative_no_schema.yaml b/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_schema_negative_no_schema.yaml index 51495fe471dd..0c94e9dcedfe 100644 --- a/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_schema_negative_no_schema.yaml +++ b/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_schema_negative_no_schema.yaml @@ -9,20 +9,20 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azureschemaregistry/1.0.0b3 Python/3.7.10 (Windows-10-10.0.22000-SP0) + - azsdk-python-azureschemaregistry/1.0.0b3 Python/3.9.0 (Windows-10-10.0.19041-SP0) method: GET uri: https://fake_resource.servicebus.windows.net/$schemagroups/getSchemaById/a?api-version=2020-09-01-preview response: body: string: '{"Code":400,"Detail":"SubCode=40000, UnknownType:The request is invalid. - [MGResponseHttpError=BadRequest]. TrackingId:051e2473-2128-4cb9-a388-a61b165b595a_G5, - SystemTracker:fake_resource.servicebus.windows.net/:$schemagroups\/getSchemaById\/a, - Timestamp:2021-08-31T22:25:15"}' + [MGResponseHttpError=BadRequest]. TrackingId:a563e2f1-335c-4828-9b2f-da273d9ccd8c_G28, + SystemTracker:swathip-test-eventhubs.servicebus.windows.net:$schemagroups\/getSchemaById\/a, + Timestamp:2021-09-03T21:37:33"}' headers: content-type: - application/json date: - - Tue, 31 Aug 2021 22:25:15 GMT + - Fri, 03 Sep 2021 21:37:32 GMT server: - Microsoft-HTTPAPI/2.0 strict-transport-security: @@ -42,19 +42,19 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azureschemaregistry/1.0.0b3 Python/3.7.10 (Windows-10-10.0.22000-SP0) + - azsdk-python-azureschemaregistry/1.0.0b3 Python/3.9.0 (Windows-10-10.0.19041-SP0) method: GET uri: https://fake_resource.servicebus.windows.net/$schemagroups/getSchemaById/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa?api-version=2020-09-01-preview response: body: string: '{"Code":404,"Detail":"Schema id aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa does - not exist. TrackingId:ff6d900e-703f-494f-af84-db1a961673bf_G5, SystemTracker:fake_resource.servicebus.windows.net/:$schemagroups\/getSchemaById\/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, - Timestamp:2021-08-31T22:25:15"}' + not exist. TrackingId:68ff2f6e-e922-4c97-9673-4b96c50bd517_G28, SystemTracker:swathip-test-eventhubs.servicebus.windows.net:$schemagroups\/getSchemaById\/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, + Timestamp:2021-09-03T21:37:33"}' headers: content-type: - application/json date: - - Tue, 31 Aug 2021 22:25:15 GMT + - Fri, 03 Sep 2021 21:37:33 GMT server: - Microsoft-HTTPAPI/2.0 strict-transport-security: diff --git a/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_schema_same_twice.yaml b/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_schema_same_twice.yaml index 74b7c6da7710..1b38f3f9a0f5 100644 --- a/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_schema_same_twice.yaml +++ b/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_schema_same_twice.yaml @@ -15,27 +15,27 @@ interactions: Serialization-Type: - Avro User-Agent: - - azsdk-python-azureschemaregistry/1.0.0b3 Python/3.7.10 (Windows-10-10.0.22000-SP0) + - azsdk-python-azureschemaregistry/1.0.0b3 Python/3.9.0 (Windows-10-10.0.19041-SP0) method: PUT uri: https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/test-schema-twice863b11a7?api-version=2020-09-01-preview response: body: - string: '{"id":"dc47e2b03a2b401ba1aa97cebcc54335"}' + string: '{"id":"d2fc67eed39142ddb6a93bb1c71a965d"}' headers: content-type: - application/json date: - - Tue, 31 Aug 2021 22:25:24 GMT + - Fri, 03 Sep 2021 21:37:41 GMT location: - - https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/test-schema-twice863b11a7/versions/1?api-version=2020-09-01-preview + - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-twice863b11a7/versions/1?api-version=2020-09-01-preview schema-id: - - dc47e2b03a2b401ba1aa97cebcc54335 + - d2fc67eed39142ddb6a93bb1c71a965d schema-id-location: - - https://sr-playground.servicebus.windows.net:443/$schemagroups/getschemabyid/dc47e2b03a2b401ba1aa97cebcc54335?api-version=2020-09-01-preview + - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/getschemabyid/d2fc67eed39142ddb6a93bb1c71a965d?api-version=2020-09-01-preview schema-version: - '1' schema-versions-location: - - https://sr-playground.servicebus.windows.net:443/$schemagroups/yuling-test-group/schemas/test-schema-twice863b11a7/versions?api-version=2020-09-01-preview + - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/test-schema-twice863b11a7/versions?api-version=2020-09-01-preview serialization-type: - Avro server: @@ -63,27 +63,27 @@ interactions: Serialization-Type: - Avro User-Agent: - - azsdk-python-azureschemaregistry/1.0.0b3 Python/3.7.10 (Windows-10-10.0.22000-SP0) + - azsdk-python-azureschemaregistry/1.0.0b3 Python/3.9.0 (Windows-10-10.0.19041-SP0) method: PUT uri: https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/test-schema-twice863b11a7?api-version=2020-09-01-preview response: body: - string: '{"id":"dc47e2b03a2b401ba1aa97cebcc54335"}' + string: '{"id":"d2fc67eed39142ddb6a93bb1c71a965d"}' headers: content-type: - application/json date: - - Tue, 31 Aug 2021 22:25:24 GMT + - Fri, 03 Sep 2021 21:37:41 GMT location: - - https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/test-schema-twice863b11a7/versions/1?api-version=2020-09-01-preview + - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-twice863b11a7/versions/1?api-version=2020-09-01-preview schema-id: - - dc47e2b03a2b401ba1aa97cebcc54335 + - d2fc67eed39142ddb6a93bb1c71a965d schema-id-location: - - https://sr-playground.servicebus.windows.net:443/$schemagroups/getschemabyid/dc47e2b03a2b401ba1aa97cebcc54335?api-version=2020-09-01-preview + - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/getschemabyid/d2fc67eed39142ddb6a93bb1c71a965d?api-version=2020-09-01-preview schema-version: - '1' schema-versions-location: - - https://sr-playground.servicebus.windows.net:443/$schemagroups/yuling-test-group/schemas/test-schema-twice863b11a7/versions?api-version=2020-09-01-preview + - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/test-schema-twice863b11a7/versions?api-version=2020-09-01-preview serialization-type: - Avro server: diff --git a/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_schema_update.yaml b/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_schema_update.yaml index 59973353b1df..2d2c8798614a 100644 --- a/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_schema_update.yaml +++ b/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_schema_update.yaml @@ -15,27 +15,27 @@ interactions: Serialization-Type: - Avro User-Agent: - - azsdk-python-azureschemaregistry/1.0.0b3 Python/3.7.10 (Windows-10-10.0.22000-SP0) + - azsdk-python-azureschemaregistry/1.0.0b3 Python/3.9.0 (Windows-10-10.0.19041-SP0) method: PUT uri: https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/test-schema-update423f1009?api-version=2020-09-01-preview response: body: - string: '{"id":"b4e5e156d10747128b9d61698ca6c130"}' + string: '{"id":"45dc034a90014105b91fab6d837f57f4"}' headers: content-type: - application/json date: - - Tue, 31 Aug 2021 22:25:26 GMT + - Fri, 03 Sep 2021 21:37:42 GMT location: - - https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/test-schema-update423f1009/versions/1?api-version=2020-09-01-preview + - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-update423f1009/versions/3?api-version=2020-09-01-preview schema-id: - - b4e5e156d10747128b9d61698ca6c130 + - 45dc034a90014105b91fab6d837f57f4 schema-id-location: - - https://sr-playground.servicebus.windows.net:443/$schemagroups/getschemabyid/b4e5e156d10747128b9d61698ca6c130?api-version=2020-09-01-preview + - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/getschemabyid/45dc034a90014105b91fab6d837f57f4?api-version=2020-09-01-preview schema-version: - - '1' + - '3' schema-versions-location: - - https://sr-playground.servicebus.windows.net:443/$schemagroups/yuling-test-group/schemas/test-schema-update423f1009/versions?api-version=2020-09-01-preview + - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/test-schema-update423f1009/versions?api-version=2020-09-01-preview serialization-type: - Avro server: @@ -63,27 +63,27 @@ interactions: Serialization-Type: - Avro User-Agent: - - azsdk-python-azureschemaregistry/1.0.0b3 Python/3.7.10 (Windows-10-10.0.22000-SP0) + - azsdk-python-azureschemaregistry/1.0.0b3 Python/3.9.0 (Windows-10-10.0.19041-SP0) method: PUT uri: https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/test-schema-update423f1009?api-version=2020-09-01-preview response: body: - string: '{"id":"2247f93fcb074f8eb117d05419db8a2e"}' + string: '{"id":"d5f23b7f77434922bb8d503188609973"}' headers: content-type: - application/json date: - - Tue, 31 Aug 2021 22:25:26 GMT + - Fri, 03 Sep 2021 21:37:43 GMT location: - - https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/test-schema-update423f1009/versions/2?api-version=2020-09-01-preview + - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-update423f1009/versions/4?api-version=2020-09-01-preview schema-id: - - 2247f93fcb074f8eb117d05419db8a2e + - d5f23b7f77434922bb8d503188609973 schema-id-location: - - https://sr-playground.servicebus.windows.net:443/$schemagroups/getschemabyid/2247f93fcb074f8eb117d05419db8a2e?api-version=2020-09-01-preview + - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/getschemabyid/d5f23b7f77434922bb8d503188609973?api-version=2020-09-01-preview schema-version: - - '2' + - '4' schema-versions-location: - - https://sr-playground.servicebus.windows.net:443/$schemagroups/yuling-test-group/schemas/test-schema-update423f1009/versions?api-version=2020-09-01-preview + - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/test-schema-update423f1009/versions?api-version=2020-09-01-preview serialization-type: - Avro server: @@ -105,9 +105,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azureschemaregistry/1.0.0b3 Python/3.7.10 (Windows-10-10.0.22000-SP0) + - azsdk-python-azureschemaregistry/1.0.0b3 Python/3.9.0 (Windows-10-10.0.19041-SP0) method: GET - uri: https://fake_resource.servicebus.windows.net/$schemagroups/getSchemaById/2247f93fcb074f8eb117d05419db8a2e?api-version=2020-09-01-preview + uri: https://fake_resource.servicebus.windows.net/$schemagroups/getSchemaById/d5f23b7f77434922bb8d503188609973?api-version=2020-09-01-preview response: body: string: '{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_food","type":["string","null"]}]}' @@ -115,17 +115,17 @@ interactions: content-type: - application/json date: - - Tue, 31 Aug 2021 22:25:27 GMT + - Fri, 03 Sep 2021 21:37:43 GMT location: - - https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/test-schema-update423f1009/versions/2?api-version=2020-09-01-preview + - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-update423f1009/versions/4?api-version=2020-09-01-preview schema-id: - - 2247f93fcb074f8eb117d05419db8a2e + - d5f23b7f77434922bb8d503188609973 schema-id-location: - - https://sr-playground.servicebus.windows.net:443/$schemagroups/getschemabyid/2247f93fcb074f8eb117d05419db8a2e?api-version=2020-09-01-preview + - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/getschemabyid/d5f23b7f77434922bb8d503188609973?api-version=2020-09-01-preview schema-version: - - '2' + - '4' schema-versions-location: - - https://sr-playground.servicebus.windows.net:443/$schemagroups/yuling-test-group/schemas/test-schema-update423f1009/versions?api-version=2020-09-01-preview + - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/test-schema-update423f1009/versions?api-version=2020-09-01-preview serialization-type: - Avro server: @@ -147,9 +147,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azureschemaregistry/1.0.0b3 Python/3.7.10 (Windows-10-10.0.22000-SP0) + - azsdk-python-azureschemaregistry/1.0.0b3 Python/3.9.0 (Windows-10-10.0.19041-SP0) method: GET - uri: https://fake_resource.servicebus.windows.net/$schemagroups/getSchemaById/2247f93fcb074f8eb117d05419db8a2e?api-version=2020-09-01-preview + uri: https://fake_resource.servicebus.windows.net/$schemagroups/getSchemaById/d5f23b7f77434922bb8d503188609973?api-version=2020-09-01-preview response: body: string: '{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_food","type":["string","null"]}]}' @@ -157,17 +157,17 @@ interactions: content-type: - application/json date: - - Tue, 31 Aug 2021 22:25:27 GMT + - Fri, 03 Sep 2021 21:37:44 GMT location: - - https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/test-schema-update423f1009/versions/2?api-version=2020-09-01-preview + - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-update423f1009/versions/4?api-version=2020-09-01-preview schema-id: - - 2247f93fcb074f8eb117d05419db8a2e + - d5f23b7f77434922bb8d503188609973 schema-id-location: - - https://sr-playground.servicebus.windows.net:443/$schemagroups/getschemabyid/2247f93fcb074f8eb117d05419db8a2e?api-version=2020-09-01-preview + - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/getschemabyid/d5f23b7f77434922bb8d503188609973?api-version=2020-09-01-preview schema-version: - - '2' + - '4' schema-versions-location: - - https://sr-playground.servicebus.windows.net:443/$schemagroups/yuling-test-group/schemas/test-schema-update423f1009/versions?api-version=2020-09-01-preview + - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/test-schema-update423f1009/versions?api-version=2020-09-01-preview serialization-type: - Avro server: @@ -195,27 +195,27 @@ interactions: Serialization-Type: - Avro User-Agent: - - azsdk-python-azureschemaregistry/1.0.0b3 Python/3.7.10 (Windows-10-10.0.22000-SP0) + - azsdk-python-azureschemaregistry/1.0.0b3 Python/3.9.0 (Windows-10-10.0.19041-SP0) method: POST uri: https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/test-schema-update423f1009?api-version=2020-09-01-preview response: body: - string: '{"id":"2247f93fcb074f8eb117d05419db8a2e"}' + string: '{"id":"d5f23b7f77434922bb8d503188609973"}' headers: content-type: - application/json date: - - Tue, 31 Aug 2021 22:25:27 GMT + - Fri, 03 Sep 2021 21:37:44 GMT location: - - https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/test-schema-update423f1009/versions/2?api-version=2020-09-01-preview + - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-update423f1009/versions/4?api-version=2020-09-01-preview schema-id: - - 2247f93fcb074f8eb117d05419db8a2e + - d5f23b7f77434922bb8d503188609973 schema-id-location: - - https://sr-playground.servicebus.windows.net:443/$schemagroups/getschemabyid/2247f93fcb074f8eb117d05419db8a2e?api-version=2020-09-01-preview + - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/getschemabyid/d5f23b7f77434922bb8d503188609973?api-version=2020-09-01-preview schema-version: - - '2' + - '4' schema-versions-location: - - https://sr-playground.servicebus.windows.net:443/$schemagroups/yuling-test-group/schemas/test-schema-update423f1009/versions?api-version=2020-09-01-preview + - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/test-schema-update423f1009/versions?api-version=2020-09-01-preview serialization-type: - Avro server: diff --git a/sdk/schemaregistry/azure-schemaregistry/tests/test_schema_registry.py b/sdk/schemaregistry/azure-schemaregistry/tests/test_schema_registry.py index 61c1d2f8cdd6..4966f5713feb 100644 --- a/sdk/schemaregistry/azure-schemaregistry/tests/test_schema_registry.py +++ b/sdk/schemaregistry/azure-schemaregistry/tests/test_schema_registry.py @@ -44,45 +44,42 @@ def test_schema_basic(self, schemaregistry_endpoint, schemaregistry_group, **kwa serialization_type = "Avro" assert len(client._id_to_schema) == 0 assert len(client._description_to_properties) == 0 - schema_properties = client.register_schema(schemaregistry_group, schema_name, serialization_type, schema_str) + schema_properties = client.register_schema(schemaregistry_group, schema_name, schema_str, serialization_type) assert len(client._id_to_schema) == 1 assert len(client._description_to_properties) == 1 - assert schema_properties.schema_id is not None + assert schema_properties.id is not None assert schema_properties.location is not None - assert schema_properties.location_by_id is not None assert schema_properties.version is 1 assert schema_properties.serialization_type == "Avro" - returned_schema = client.get_schema(schema_id=schema_properties.schema_id) + returned_schema = client.get_schema(id=schema_properties.id) - assert returned_schema.schema_properties.schema_id == schema_properties.schema_id - assert returned_schema.schema_properties.location is not None - assert returned_schema.schema_properties.location_by_id is not None - assert returned_schema.schema_properties.version == 1 - assert returned_schema.schema_properties.serialization_type == "Avro" - assert returned_schema.schema_content == schema_str + assert returned_schema.properties.id == schema_properties.id + assert returned_schema.properties.location is not None + assert returned_schema.properties.version == 1 + assert returned_schema.properties.serialization_type == "Avro" + assert returned_schema.content == schema_str - # check that same cached properties object is returned by get_schema_id - cached_properties = client.get_schema_id(schemaregistry_group, schema_name, serialization_type, schema_str) - assert client.get_schema_id(schemaregistry_group, schema_name, serialization_type, schema_str) == cached_properties + # check that same cached properties object is returned by get_schema_properties + cached_properties = client.get_schema_properties(schemaregistry_group, schema_name, schema_str, serialization_type) + assert client.get_schema_properties(schemaregistry_group, schema_name, schema_str, serialization_type) == cached_properties # check if schema is added to cache when it does not exist in the cache cached_properties = client._description_to_properties[ - (schemaregistry_group, schema_name, serialization_type, schema_str) + (schemaregistry_group, schema_name, schema_str, serialization_type) ] properties_cache_length = len(client._description_to_properties) del client._description_to_properties[ - (schemaregistry_group, schema_name, serialization_type, schema_str) + (schemaregistry_group, schema_name, schema_str, serialization_type) ] assert len(client._description_to_properties) == properties_cache_length - 1 - returned_schema_properties = client.get_schema_id(schemaregistry_group, schema_name, serialization_type, schema_str) + returned_schema_properties = client.get_schema_properties(schemaregistry_group, schema_name, schema_str, serialization_type) assert len(client._description_to_properties) == properties_cache_length - assert returned_schema_properties.schema_id == schema_properties.schema_id + assert returned_schema_properties.id == schema_properties.id assert returned_schema_properties.location is not None - assert returned_schema_properties.location_by_id is not None assert returned_schema_properties.version == 1 assert returned_schema_properties.serialization_type == "Avro" @@ -92,51 +89,48 @@ def test_schema_update(self, schemaregistry_endpoint, schemaregistry_group, **kw schema_name = self.get_resource_name('test-schema-update') schema_str = """{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}""" serialization_type = "Avro" - schema_properties = client.register_schema(schemaregistry_group, schema_name, serialization_type, schema_str) + schema_properties = client.register_schema(schemaregistry_group, schema_name, schema_str, serialization_type) - assert schema_properties.schema_id is not None + assert schema_properties.id is not None assert schema_properties.location is not None - assert schema_properties.location_by_id is not None assert schema_properties.version != 0 assert schema_properties.serialization_type == "Avro" schema_str_new = """{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_food","type":["string","null"]}]}""" - new_schema_properties = client.register_schema(schemaregistry_group, schema_name, serialization_type, schema_str_new) + new_schema_properties = client.register_schema(schemaregistry_group, schema_name, schema_str_new, serialization_type) - assert new_schema_properties.schema_id is not None + assert new_schema_properties.id is not None assert new_schema_properties.location is not None - assert new_schema_properties.location_by_id is not None assert new_schema_properties.version == schema_properties.version + 1 assert new_schema_properties.serialization_type == "Avro" # check that same cached schema object is returned by get_schema - cached_schema = client.get_schema(schema_id=new_schema_properties.schema_id) - assert client.get_schema(schema_id=new_schema_properties.schema_id) == cached_schema + cached_schema = client.get_schema(id=new_schema_properties.id) + assert client.get_schema(id=new_schema_properties.id) == cached_schema # check if schema is added to cache when it does not exist in the cache - cached_schema = client._id_to_schema[new_schema_properties.schema_id] + cached_schema = client._id_to_schema[new_schema_properties.id] schema_cache_length = len(client._id_to_schema) - del client._id_to_schema[new_schema_properties.schema_id] + del client._id_to_schema[new_schema_properties.id] assert len(client._id_to_schema) == schema_cache_length - 1 - new_schema = client.get_schema(schema_id=new_schema_properties.schema_id) + new_schema = client.get_schema(id=new_schema_properties.id) assert len(client._id_to_schema) == schema_cache_length assert cached_schema != new_schema # assert not same object after deletion from cache - assert new_schema.schema_properties.schema_id != schema_properties.schema_id - assert new_schema.schema_properties.schema_id == new_schema_properties.schema_id - assert new_schema.schema_properties.location is not None - assert new_schema.schema_properties.location_by_id is not None - assert new_schema.schema_content == schema_str_new - assert new_schema.schema_properties.version == schema_properties.version + 1 - assert new_schema.schema_properties.serialization_type == "Avro" + assert new_schema.properties.id != schema_properties.id + assert new_schema.properties.id == new_schema_properties.id + assert new_schema.properties.location is not None + assert new_schema.content == schema_str_new + assert new_schema.properties.version == schema_properties.version + 1 + assert new_schema.properties.serialization_type == "Avro" # check that properties object is the same in caches client._id_to_schema = {} client._description_to_properties = {} - new_schema = client.get_schema(schema_id=new_schema_properties.schema_id) - new_schema_properties = client.get_schema_id(schemaregistry_group, schema_name, serialization_type, schema_str_new) - assert new_schema.schema_properties == new_schema_properties + new_schema = client.get_schema(id=new_schema_properties.id) + new_schema_properties = client.get_schema_properties(schemaregistry_group, schema_name, schema_str_new, serialization_type) + assert new_schema.properties == new_schema_properties @SchemaRegistryPowerShellPreparer() def test_schema_same_twice(self, schemaregistry_endpoint, schemaregistry_group, **kwargs): @@ -144,13 +138,13 @@ def test_schema_same_twice(self, schemaregistry_endpoint, schemaregistry_group, schema_name = self.get_resource_name('test-schema-twice') schema_str = """{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"age","type":["int","null"]},{"name":"city","type":["string","null"]}]}""" serialization_type = "Avro" - schema_properties = client.register_schema(schemaregistry_group, schema_name, serialization_type, schema_str) + schema_properties = client.register_schema(schemaregistry_group, schema_name, schema_str, serialization_type) schema_cache_length = len(client._id_to_schema) desc_cache_length = len(client._description_to_properties) - schema_properties_second = client.register_schema(schemaregistry_group, schema_name, serialization_type, schema_str) + schema_properties_second = client.register_schema(schemaregistry_group, schema_name, schema_str, serialization_type) schema_cache_second_length = len(client._id_to_schema) desc_cache_second_length = len(client._description_to_properties) - assert schema_properties.schema_id == schema_properties_second.schema_id + assert schema_properties.id == schema_properties_second.id assert schema_cache_length == schema_cache_second_length assert desc_cache_length == desc_cache_second_length @@ -162,7 +156,7 @@ def test_schema_negative_wrong_credential(self, schemaregistry_endpoint, schemar schema_str = """{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}""" serialization_type = "Avro" with pytest.raises(ClientAuthenticationError): - client.register_schema(schemaregistry_group, schema_name, serialization_type, schema_str) + client.register_schema(schemaregistry_group, schema_name, schema_str, serialization_type) @SchemaRegistryPowerShellPreparer() def test_schema_negative_wrong_endpoint(self, schemaregistry_endpoint, schemaregistry_group, **kwargs): @@ -171,7 +165,7 @@ def test_schema_negative_wrong_endpoint(self, schemaregistry_endpoint, schemareg schema_str = """{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}""" serialization_type = "Avro" with pytest.raises(ServiceRequestError): - client.register_schema(schemaregistry_group, schema_name, serialization_type, schema_str) + client.register_schema(schemaregistry_group, schema_name, schema_str, serialization_type) @SchemaRegistryPowerShellPreparer() def test_schema_negative_no_schema(self, schemaregistry_endpoint, schemaregistry_group, **kwargs): From bad587d704feb481547666acd1ce3dc08150d074 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Wed, 8 Sep 2021 17:28:20 -0700 Subject: [PATCH 19/85] Sync eng/common directory with azure-sdk-tools repository (#20604) --- .../templates/matthews/partials/head.tmpl.partial | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/eng/common/docgeneration/templates/matthews/partials/head.tmpl.partial b/eng/common/docgeneration/templates/matthews/partials/head.tmpl.partial index e1267f890d65..e97616c1780c 100644 --- a/eng/common/docgeneration/templates/matthews/partials/head.tmpl.partial +++ b/eng/common/docgeneration/templates/matthews/partials/head.tmpl.partial @@ -19,10 +19,10 @@ From 51f09fa697711829c95bf9593d1ad8328ac53b47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?McCoy=20Pati=C3=B1o?= <39780829+mccoyp@users.noreply.github.com> Date: Wed, 8 Sep 2021 18:21:08 -0700 Subject: [PATCH 20/85] [Key Vault] Update changelogs for release (#20607) --- .../azure-keyvault-administration/CHANGELOG.md | 11 ++--------- sdk/keyvault/azure-keyvault-certificates/CHANGELOG.md | 11 ++++------- sdk/keyvault/azure-keyvault-keys/CHANGELOG.md | 10 +++------- sdk/keyvault/azure-keyvault-secrets/CHANGELOG.md | 11 ++++------- 4 files changed, 13 insertions(+), 30 deletions(-) diff --git a/sdk/keyvault/azure-keyvault-administration/CHANGELOG.md b/sdk/keyvault/azure-keyvault-administration/CHANGELOG.md index 78715d2820e6..0ff44de895ac 100644 --- a/sdk/keyvault/azure-keyvault-administration/CHANGELOG.md +++ b/sdk/keyvault/azure-keyvault-administration/CHANGELOG.md @@ -1,16 +1,9 @@ # Release History -## 4.1.0b1 (Unreleased) +## 4.1.0b1 (2021-09-09) ### Features Added -- Key Vault API version 7.3-preview is the default version - -### Breaking Changes - -### Key Bugs Fixed - -### Fixed - +- Key Vault API version 7.3-preview is now the default ## 4.0.0 (2021-06-22) ### Changed diff --git a/sdk/keyvault/azure-keyvault-certificates/CHANGELOG.md b/sdk/keyvault/azure-keyvault-certificates/CHANGELOG.md index 9f639c329ff2..2ef39ff28fc9 100644 --- a/sdk/keyvault/azure-keyvault-certificates/CHANGELOG.md +++ b/sdk/keyvault/azure-keyvault-certificates/CHANGELOG.md @@ -1,16 +1,13 @@ # Release History -## 4.4.0b1 (Unreleased) +## 4.4.0b1 (2021-09-09) ### Features Added - Key Vault API version 7.3-preview is now the default -### Breaking Changes - -### Key Bugs Fixed - -### Fixed - +### Other Changes +- Updated type hints to fix mypy errors + ([#19158](https://github.com/Azure/azure-sdk-for-python/issues/19158)) ## 4.3.0 (2021-06-22) This is the last version to support Python 3.5. The next version will require Python 2.7 or 3.6+. diff --git a/sdk/keyvault/azure-keyvault-keys/CHANGELOG.md b/sdk/keyvault/azure-keyvault-keys/CHANGELOG.md index 70b236074e86..8896a149c378 100644 --- a/sdk/keyvault/azure-keyvault-keys/CHANGELOG.md +++ b/sdk/keyvault/azure-keyvault-keys/CHANGELOG.md @@ -1,14 +1,10 @@ # Release History -## 4.5.0b3 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed +## 4.5.0b3 (2021-09-09) ### Other Changes +- Updated type hints to fix mypy errors + ([#19158](https://github.com/Azure/azure-sdk-for-python/issues/19158)) ## 4.5.0b2 (2021-08-10) diff --git a/sdk/keyvault/azure-keyvault-secrets/CHANGELOG.md b/sdk/keyvault/azure-keyvault-secrets/CHANGELOG.md index 42ad8ecc477a..ba248cdd1d63 100644 --- a/sdk/keyvault/azure-keyvault-secrets/CHANGELOG.md +++ b/sdk/keyvault/azure-keyvault-secrets/CHANGELOG.md @@ -1,16 +1,13 @@ # Release History -## 4.4.0b1 (Unreleased) +## 4.4.0b1 (2021-09-09) ### Features Added - Key Vault API version 7.3-preview is now the default -### Breaking Changes - -### Key Bugs Fixed - -### Fixed - +### Other Changes +- Updated type hints to fix mypy errors + ([#19158](https://github.com/Azure/azure-sdk-for-python/issues/19158)) ## 4.3.0 (2021-06-22) This is the last version to support Python 3.5. The next version will require Python 2.7 or 3.6+. From 7373db2a493e23bb03a4d8d2f74fff9767f0cb94 Mon Sep 17 00:00:00 2001 From: Yalin Li Date: Wed, 8 Sep 2021 18:49:45 -0700 Subject: [PATCH 21/85] Run mypy in azure-keyvault-keys CI (#20545) --- eng/tox/mypy_hard_failure_packages.py | 1 + .../azure/keyvault/keys/_client.py | 8 +- .../azure/keyvault/keys/_models.py | 87 ++++++++++--------- .../azure/keyvault/keys/crypto/_client.py | 63 +++++++------- .../keys/crypto/_internal/__init__.py | 4 +- .../keys/crypto/_internal/algorithm.py | 14 ++- .../keys/crypto/_internal/algorithms/sha_2.py | 11 ++- .../keyvault/keys/crypto/_internal/key.py | 14 ++- .../azure/keyvault/keys/crypto/_models.py | 14 +-- .../keys/crypto/_providers/__init__.py | 8 +- .../keyvault/keys/crypto/_providers/ec.py | 2 +- .../keys/crypto/_providers/local_provider.py | 22 +++-- .../keyvault/keys/crypto/_providers/rsa.py | 2 +- .../keys/crypto/_providers/symmetric.py | 2 +- .../azure/keyvault/keys/crypto/aio/_client.py | 65 +++++++------- sdk/keyvault/azure-keyvault-keys/mypy.ini | 7 ++ 16 files changed, 191 insertions(+), 133 deletions(-) create mode 100644 sdk/keyvault/azure-keyvault-keys/mypy.ini diff --git a/eng/tox/mypy_hard_failure_packages.py b/eng/tox/mypy_hard_failure_packages.py index 3ae063eb4fb1..175058d3f286 100644 --- a/eng/tox/mypy_hard_failure_packages.py +++ b/eng/tox/mypy_hard_failure_packages.py @@ -11,6 +11,7 @@ "azure-identity", "azure-keyvault-administration", "azure-keyvault-certificates", + "azure-keyvault-keys", "azure-keyvault-secrets", "azure-servicebus", "azure-ai-textanalytics", diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_client.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_client.py index 498d6afb32b2..1e561321b9c2 100644 --- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_client.py +++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_client.py @@ -19,7 +19,9 @@ # pylint:disable=unused-import from typing import Any, Optional, Union from azure.core.paging import ItemPaged + from azure.core.polling import LROPoller from ._models import JsonWebKey + from ._enums import KeyType class KeyClient(KeyVaultClientBase): @@ -55,7 +57,7 @@ def _get_attributes(self, enabled, not_before, expires_on, exportable=None): @distributed_trace def create_key(self, name, key_type, **kwargs): - # type: (str, Union[str, azure.keyvault.keys.KeyType], **Any) -> KeyVaultKey + # type: (str, Union[str, KeyType], **Any) -> KeyVaultKey """Create a key or, if ``name`` is already in use, create a new version of the key. Requires keys/create permission. @@ -242,7 +244,7 @@ def create_oct_key(self, name, **kwargs): @distributed_trace def begin_delete_key(self, name, **kwargs): - # type: (str, **Any) -> DeletedKey + # type: (str, **Any) -> LROPoller """Delete all versions of a key and its cryptographic material. Requires keys/delete permission. When this method returns Key Vault has begun deleting the key. Deletion may @@ -450,7 +452,7 @@ def purge_deleted_key(self, name, **kwargs): @distributed_trace def begin_recover_deleted_key(self, name, **kwargs): - # type: (str, **Any) -> KeyVaultKey + # type: (str, **Any) -> LROPoller """Recover a deleted key to its latest version. Possible only in a vault with soft-delete enabled. Requires keys/recover permission. diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_models.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_models.py index 822cf9d420c6..6a127ced8283 100644 --- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_models.py +++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_models.py @@ -13,10 +13,10 @@ if TYPE_CHECKING: # pylint:disable=unused-import - from typing import Any, Dict, Optional + from typing import Any, Dict, Optional, List from datetime import datetime from ._generated.v7_0 import models as _models - from ._enums import KeyOperation + from ._enums import KeyOperation, KeyType KeyOperationResult = namedtuple("KeyOperationResult", ["id", "value"]) @@ -83,13 +83,15 @@ def _from_key_bundle(cls, key_bundle): """Construct a KeyProperties from an autorest-generated KeyBundle""" # release_policy was added in 7.3-preview release_policy = None - if hasattr(key_bundle, "release_policy") and key_bundle.release_policy is not None: + if (hasattr(key_bundle, "release_policy") and + key_bundle.release_policy is not None): # type: ignore[attr-defined] release_policy = KeyReleasePolicy( - data=key_bundle.release_policy.data, content_type=key_bundle.release_policy.content_type + data=key_bundle.release_policy.data, # type: ignore[attr-defined] + content_type=key_bundle.release_policy.content_type # type: ignore[attr-defined] ) return cls( - key_bundle.key.kid, + key_bundle.key.kid, # type: ignore attributes=key_bundle.attributes, managed=key_bundle.managed, tags=key_bundle.tags, @@ -100,7 +102,12 @@ def _from_key_bundle(cls, key_bundle): def _from_key_item(cls, key_item): # type: (_models.KeyItem) -> KeyProperties """Construct a KeyProperties from an autorest-generated KeyItem""" - return cls(key_id=key_item.kid, attributes=key_item.attributes, managed=key_item.managed, tags=key_item.tags) + return cls( + key_id=key_item.kid, # type: ignore + attributes=key_item.attributes, + managed=key_item.managed, + tags=key_item.tags + ) @property def id(self): @@ -122,57 +129,57 @@ def name(self): @property def version(self): - # type: () -> str + # type: () -> Optional[str] """The key's version - :rtype: str + :rtype: str or None """ return self._vault_id.version @property def enabled(self): - # type: () -> bool + # type: () -> Optional[bool] """Whether the key is enabled for use - :rtype: bool + :rtype: bool or None """ - return self._attributes.enabled + return self._attributes.enabled if self._attributes else None @property def not_before(self): - # type: () -> datetime + # type: () -> Optional[datetime] """The time before which the key can not be used, in UTC - :rtype: ~datetime.datetime + :rtype: ~datetime.datetime or None """ - return self._attributes.not_before + return self._attributes.not_before if self._attributes else None @property def expires_on(self): - # type: () -> datetime + # type: () -> Optional[datetime] """When the key will expire, in UTC - :rtype: ~datetime.datetime + :rtype: ~datetime.datetime or None """ - return self._attributes.expires + return self._attributes.expires if self._attributes else None @property def created_on(self): - # type: () -> datetime + # type: () -> Optional[datetime] """When the key was created, in UTC - :rtype: ~datetime.datetime + :rtype: ~datetime.datetime or None """ - return self._attributes.created + return self._attributes.created if self._attributes else None @property def updated_on(self): - # type: () -> datetime + # type: () -> Optional[datetime] """When the key was last updated, in UTC - :rtype: ~datetime.datetime + :rtype: ~datetime.datetime or None """ - return self._attributes.updated + return self._attributes.updated if self._attributes else None @property def vault_url(self): @@ -188,7 +195,7 @@ def recoverable_days(self): # type: () -> Optional[int] """The number of days the key is retained before being deleted from a soft-delete enabled Key Vault. - :rtype: int + :rtype: int or None """ # recoverable_days was added in 7.1-preview if self._attributes: @@ -197,12 +204,12 @@ def recoverable_days(self): @property def recovery_level(self): - # type: () -> str + # type: () -> Optional[str] """The vault's deletion recovery level for keys - :rtype: str + :rtype: str or None """ - return self._attributes.recovery_level + return self._attributes.recovery_level if self._attributes else None @property def tags(self): @@ -326,7 +333,7 @@ def _from_key_bundle(cls, key_bundle): """Construct a KeyVaultKey from an autorest-generated KeyBundle""" # pylint:disable=protected-access return cls( - key_id=key_bundle.key.kid, + key_id=key_bundle.key.kid, # type: ignore jwk={field: getattr(key_bundle.key, field, None) for field in JsonWebKey._FIELDS}, properties=KeyProperties._from_key_bundle(key_bundle), ) @@ -369,21 +376,23 @@ def key(self): @property def key_type(self): - # type: () -> str + # type: () -> KeyType """The key's type. See :class:`~azure.keyvault.keys.KeyType` for possible values. :rtype: ~azure.keyvault.keys.KeyType or str """ - return self._key_material.kty # pylint:disable=no-member + # pylint:disable=no-member + return self._key_material.kty # type: ignore[attr-defined] @property def key_operations(self): - # type: () -> list[KeyOperation] + # type: () -> List[KeyOperation] """Permitted operations. See :class:`~azure.keyvault.keys.KeyOperation` for possible values. :rtype: list[~azure.keyvault.keys.KeyOperation or str] """ - return self._key_material.key_ops # pylint:disable=no-member + # pylint:disable=no-member + return self._key_material.key_ops # type: ignore[attr-defined] class KeyVaultKeyIdentifier(object): @@ -454,7 +463,7 @@ def _from_deleted_key_bundle(cls, deleted_key_bundle): # pylint:disable=protected-access return cls( properties=KeyProperties._from_key_bundle(deleted_key_bundle), - key_id=deleted_key_bundle.key.kid, + key_id=deleted_key_bundle.key.kid, # type: ignore jwk={field: getattr(deleted_key_bundle.key, field, None) for field in JsonWebKey._FIELDS}, deleted_date=deleted_key_bundle.deleted_date, recovery_id=deleted_key_bundle.recovery_id, @@ -475,28 +484,28 @@ def _from_deleted_key_item(cls, deleted_key_item): @property def deleted_date(self): - # type: () -> datetime + # type: () -> Optional[datetime] """When the key was deleted, in UTC - :rtype: ~datetime.datetime + :rtype: ~datetime.datetime or None """ return self._deleted_date @property def recovery_id(self): - # type: () -> str + # type: () -> Optional[str] """An identifier used to recover the deleted key. Returns ``None`` if soft-delete is disabled. - :rtype: str + :rtype: str or None """ return self._recovery_id @property def scheduled_purge_date(self): - # type: () -> datetime + # type: () -> Optional[datetime] """When the key is scheduled to be purged, in UTC. Returns ``None`` if soft-delete is disabled. - :rtype: ~datetime.datetime + :rtype: ~datetime.datetime or None """ return self._scheduled_purge_date diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/crypto/_client.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/crypto/_client.py index c577ae69c471..1008ee131392 100644 --- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/crypto/_client.py +++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/crypto/_client.py @@ -3,7 +3,7 @@ # Licensed under the MIT License. # ------------------------------------ import logging -from typing import TYPE_CHECKING +from typing import TYPE_CHECKING, cast import six from azure.core.exceptions import HttpResponseError @@ -112,7 +112,7 @@ def __init__(self, key, credential, **kwargs): self._key_id = None # type: Optional[KeyVaultResourceId] if isinstance(key, KeyVaultKey): - self._key = key.key + self._key = key.key # type: Union[JsonWebKey, KeyVaultKey, str, None] self._key_id = parse_key_vault_id(key.id) if key.properties._attributes: # pylint:disable=protected-access self._not_before = key.properties.not_before @@ -120,18 +120,18 @@ def __init__(self, key, credential, **kwargs): elif isinstance(key, six.string_types): self._key = None self._key_id = parse_key_vault_id(key) - self._keys_get_forbidden = None # type: Optional[bool] + self._keys_get_forbidden = False elif self._jwk: self._key = key else: raise ValueError("'key' must be a KeyVaultKey instance or a key ID string including a version") - if not (self._jwk or self._key_id.version): + if not (self._jwk or (self._key_id.version if self._key_id else None)): raise ValueError("'key' must include a version") if self._jwk: try: - self._local_provider = get_local_cryptography_provider(self._key) + self._local_provider = get_local_cryptography_provider(cast(JsonWebKey, self._key)) self._initialized = True except Exception as ex: # pylint:disable=broad-except six.raise_from(ValueError("The provided jwk is not valid for local cryptography"), ex) @@ -139,7 +139,7 @@ def __init__(self, key, credential, **kwargs): self._local_provider = NoLocalCryptography() self._initialized = False - self._vault_url = None if self._jwk else self._key_id.vault_url + self._vault_url = None if (self._jwk or self._key_id is None) else self._key_id.vault_url # type: ignore super(CryptographyClient, self).__init__( vault_url=self._vault_url or "vault_url", credential=credential, **kwargs ) @@ -154,11 +154,11 @@ def key_id(self): :rtype: str or None """ if not self._jwk: - return self._key_id.source_id - return self._key.kid + return self._key_id.source_id if self._key_id else None + return cast(JsonWebKey, self._key).kid # type: ignore[attr-defined] @property - def vault_url(self): + def vault_url(self): # type: ignore # type: () -> Optional[str] """The base vault URL of the client's key. @@ -179,7 +179,7 @@ def from_jwk(cls, jwk): """ if not isinstance(jwk, JsonWebKey): jwk = JsonWebKey(**jwk) - return cls(jwk, object(), _jwk=True) + return cls(jwk, object(), _jwk=True) # type: ignore @distributed_trace def _initialize(self, **kwargs): @@ -191,7 +191,10 @@ def _initialize(self, **kwargs): if not (self._key or self._keys_get_forbidden): try: key_bundle = self._client.get_key( - self._key_id.vault_url, self._key_id.name, self._key_id.version, **kwargs + self._key_id.vault_url if self._key_id else None, + self._key_id.name if self._key_id else None, + self._key_id.version if self._key_id else None, + **kwargs ) self._key = KeyVaultKey._from_key_bundle(key_bundle).key # pylint:disable=protected-access except HttpResponseError as ex: @@ -201,7 +204,7 @@ def _initialize(self, **kwargs): # if we have the key material, create a local crypto provider with it if self._key: - self._local_provider = get_local_cryptography_provider(self._key) + self._local_provider = get_local_cryptography_provider(cast(JsonWebKey, self._key)) self._initialized = True else: # try to get the key again next time unless we know we're forbidden to do so @@ -250,9 +253,9 @@ def encrypt(self, algorithm, plaintext, **kwargs): ) operation_result = self._client.encrypt( - vault_base_url=self._key_id.vault_url, - key_name=self._key_id.name, - key_version=self._key_id.version, + vault_base_url=self._key_id.vault_url if self._key_id else None, + key_name=self._key_id.name if self._key_id else None, + key_version=self._key_id.version if self._key_id else None, parameters=self._models.KeyOperationsParameters(algorithm=algorithm, value=plaintext, iv=iv, aad=aad), **kwargs ) @@ -311,9 +314,9 @@ def decrypt(self, algorithm, ciphertext, **kwargs): ) operation_result = self._client.decrypt( - vault_base_url=self._key_id.vault_url, - key_name=self._key_id.name, - key_version=self._key_id.version, + vault_base_url=self._key_id.vault_url if self._key_id else None, + key_name=self._key_id.name if self._key_id else None, + key_version=self._key_id.version if self._key_id else None, parameters=self._models.KeyOperationsParameters( algorithm=algorithm, value=ciphertext, iv=iv, tag=tag, aad=aad ), @@ -356,9 +359,9 @@ def wrap_key(self, algorithm, key, **kwargs): ) operation_result = self._client.wrap_key( - vault_base_url=self._key_id.vault_url, - key_name=self._key_id.name, - key_version=self._key_id.version, + vault_base_url=self._key_id.vault_url if self._key_id else None, + key_name=self._key_id.name if self._key_id else None, + key_version=self._key_id.version if self._key_id else None, parameters=self._models.KeyOperationsParameters(algorithm=algorithm, value=key), **kwargs ) @@ -398,9 +401,9 @@ def unwrap_key(self, algorithm, encrypted_key, **kwargs): ) operation_result = self._client.unwrap_key( - vault_base_url=self._key_id.vault_url, - key_name=self._key_id.name, - key_version=self._key_id.version, + vault_base_url=self._key_id.vault_url if self._key_id else None, + key_name=self._key_id.name if self._key_id else None, + key_version=self._key_id.version if self._key_id else None, parameters=self._models.KeyOperationsParameters(algorithm=algorithm, value=encrypted_key), **kwargs ) @@ -440,9 +443,9 @@ def sign(self, algorithm, digest, **kwargs): ) operation_result = self._client.sign( - vault_base_url=self._key_id.vault_url, - key_name=self._key_id.name, - key_version=self._key_id.version, + vault_base_url=self._key_id.vault_url if self._key_id else None, + key_name=self._key_id.name if self._key_id else None, + key_version=self._key_id.version if self._key_id else None, parameters=self._models.KeySignParameters(algorithm=algorithm, value=digest), **kwargs ) @@ -484,9 +487,9 @@ def verify(self, algorithm, digest, signature, **kwargs): ) operation_result = self._client.verify( - vault_base_url=self._key_id.vault_url, - key_name=self._key_id.name, - key_version=self._key_id.version, + vault_base_url=self._key_id.vault_url if self._key_id else None, + key_name=self._key_id.name if self._key_id else None, + key_version=self._key_id.version if self._key_id else None, parameters=self._models.KeyVerifyParameters(algorithm=algorithm, digest=digest, signature=signature), **kwargs ) diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/crypto/_internal/__init__.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/crypto/_internal/__init__.py index 942edd662580..880d4cdeb7ae 100644 --- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/crypto/_internal/__init__.py +++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/crypto/_internal/__init__.py @@ -15,7 +15,7 @@ from .symmetric_key import SymmetricKey from .transform import CryptoTransform, BlockCryptoTransform, AuthenticatedCryptoTransform, SignatureTransform -__all__ = { +__all__ = [ "Key", "EllipticCurveKey", "RsaKey", @@ -29,4 +29,4 @@ "AuthenticatedSymmetricEncryptionAlgorithm", "SignatureTransform", "SymmetricKey", -} +] diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/crypto/_internal/algorithm.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/crypto/_internal/algorithm.py index 7270b14ff43c..1b850cf2b14b 100644 --- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/crypto/_internal/algorithm.py +++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/crypto/_internal/algorithm.py @@ -4,11 +4,21 @@ # ------------------------------------ from abc import abstractmethod +try: + from typing import TYPE_CHECKING +except ImportError: + TYPE_CHECKING = False + +if TYPE_CHECKING: + # pylint:disable=unused-import + from typing import Optional, Union + from cryptography.hazmat.primitives import hashes + _alg_registry = {} class Algorithm(object): - _name = None + _name = None # type: Optional[str] @classmethod def name(cls): @@ -56,7 +66,7 @@ def create_decryptor(self, key, iv, auth_data, auth_tag): class SignatureAlgorithm(Algorithm): - _default_hash_algorithm = None + _default_hash_algorithm = None # type: Union[hashes.SHA256, hashes.SHA384, hashes.SHA512, None] @property def default_hash_algorithm(self): diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/crypto/_internal/algorithms/sha_2.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/crypto/_internal/algorithms/sha_2.py index c6656b0493c5..18b4838afeba 100644 --- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/crypto/_internal/algorithms/sha_2.py +++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/crypto/_internal/algorithms/sha_2.py @@ -8,6 +8,15 @@ from ..algorithm import HashAlgorithm from ..transform import DigestTransform +try: + from typing import TYPE_CHECKING +except ImportError: + TYPE_CHECKING = False + +if TYPE_CHECKING: + # pylint:disable=unused-import + from typing import Union, Type + class _Sha2DigestTransform(DigestTransform): def __init__(self, algorithm): @@ -23,7 +32,7 @@ def finalize(self, data): class _Sha2HashAlgorithm(HashAlgorithm): - _algorithm_cls = None + _algorithm_cls = None # type: Union[Type[hashes.SHA256], Type[hashes.SHA384], Type[hashes.SHA512], None] def create_digest(self): return _Sha2DigestTransform(self._algorithm_cls()) # pylint:disable=not-callable diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/crypto/_internal/key.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/crypto/_internal/key.py index a593279bb2d7..2a04602ba8f1 100644 --- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/crypto/_internal/key.py +++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/crypto/_internal/key.py @@ -7,11 +7,19 @@ from six import with_metaclass from .algorithm import Algorithm +try: + from typing import TYPE_CHECKING +except ImportError: + TYPE_CHECKING = False + +if TYPE_CHECKING: + # pylint:disable=unused-import + from typing import Any, FrozenSet class Key(with_metaclass(ABCMeta, object)): - _supported_encryption_algorithms = [] - _supported_key_wrap_algorithms = [] - _supported_signature_algorithms = [] + _supported_encryption_algorithms = frozenset([]) # type: FrozenSet[Any] + _supported_key_wrap_algorithms = frozenset([]) # type: FrozenSet[Any] + _supported_signature_algorithms = frozenset([]) # type: FrozenSet[Any] def __init__(self): self._kid = None diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/crypto/_models.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/crypto/_models.py index 61fe89865625..fc9e9f9c6d2f 100644 --- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/crypto/_models.py +++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/crypto/_models.py @@ -6,7 +6,7 @@ if TYPE_CHECKING: from . import EncryptionAlgorithm, KeyWrapAlgorithm, SignatureAlgorithm - from typing import Any + from typing import Any, Optional class DecryptResult: @@ -19,7 +19,7 @@ class DecryptResult: """ def __init__(self, key_id, algorithm, plaintext): - # type: (str, EncryptionAlgorithm, bytes) -> None + # type: (Optional[str], EncryptionAlgorithm, bytes) -> None self.key_id = key_id self.algorithm = algorithm self.plaintext = plaintext @@ -40,7 +40,7 @@ class EncryptResult: """ def __init__(self, key_id, algorithm, ciphertext, **kwargs): - # type: (str, EncryptionAlgorithm, bytes, **Any) -> None + # type: (Optional[str], EncryptionAlgorithm, bytes, **Any) -> None self.key_id = key_id self.algorithm = algorithm self.ciphertext = ciphertext @@ -59,7 +59,7 @@ class SignResult: """ def __init__(self, key_id, algorithm, signature): - # type: (str, SignatureAlgorithm, bytes) -> None + # type: (Optional[str], SignatureAlgorithm, bytes) -> None self.key_id = key_id self.algorithm = algorithm self.signature = signature @@ -75,7 +75,7 @@ class VerifyResult: """ def __init__(self, key_id, is_valid, algorithm): - # type: (str, bool, SignatureAlgorithm) -> None + # type: (Optional[str], bool, SignatureAlgorithm) -> None self.key_id = key_id self.is_valid = is_valid self.algorithm = algorithm @@ -91,7 +91,7 @@ class UnwrapResult: """ def __init__(self, key_id, algorithm, key): - # type: (str, KeyWrapAlgorithm, bytes) -> None + # type: (Optional[str], KeyWrapAlgorithm, bytes) -> None self.key_id = key_id self.algorithm = algorithm self.key = key @@ -107,7 +107,7 @@ class WrapResult: """ def __init__(self, key_id, algorithm, encrypted_key): - # type: (str, KeyWrapAlgorithm, bytes) -> None + # type: (Optional[str], KeyWrapAlgorithm, bytes) -> None self.key_id = key_id self.algorithm = algorithm self.encrypted_key = encrypted_key diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/crypto/_providers/__init__.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/crypto/_providers/__init__.py index f13ec67b4dba..1ff9652740e7 100644 --- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/crypto/_providers/__init__.py +++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/crypto/_providers/__init__.py @@ -16,14 +16,14 @@ def get_local_cryptography_provider(key): # type: (JsonWebKey) -> LocalCryptographyProvider - if key.kty in (KeyType.ec, KeyType.ec_hsm): + if key.kty in (KeyType.ec, KeyType.ec_hsm): # type: ignore[attr-defined] return EllipticCurveCryptographyProvider(key) - if key.kty in (KeyType.rsa, KeyType.rsa_hsm): + if key.kty in (KeyType.rsa, KeyType.rsa_hsm): # type: ignore[attr-defined] return RsaCryptographyProvider(key) - if key.kty in (KeyType.oct, KeyType.oct_hsm): + if key.kty in (KeyType.oct, KeyType.oct_hsm): # type: ignore[attr-defined] return SymmetricCryptographyProvider(key) - raise ValueError('Unsupported key type "{}"'.format(key.kty)) + raise ValueError('Unsupported key type "{}"'.format(key.kty)) # type: ignore[attr-defined] class NoLocalCryptography(LocalCryptographyProvider): diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/crypto/_providers/ec.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/crypto/_providers/ec.py index e415474c90ae..5b2957062727 100644 --- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/crypto/_providers/ec.py +++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/crypto/_providers/ec.py @@ -20,7 +20,7 @@ class EllipticCurveCryptographyProvider(LocalCryptographyProvider): def _get_internal_key(self, key): # type: (JsonWebKey) -> Key - if key.kty not in (KeyType.ec, KeyType.ec_hsm): + if key.kty not in (KeyType.ec, KeyType.ec_hsm): # type: ignore[attr-defined] raise ValueError('"key" must be an EC or EC-HSM key') return EllipticCurveKey.from_jwk(key) diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/crypto/_providers/local_provider.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/crypto/_providers/local_provider.py index 504ff0ae8828..df8c03638bc1 100644 --- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/crypto/_providers/local_provider.py +++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/crypto/_providers/local_provider.py @@ -28,7 +28,7 @@ class LocalCryptographyProvider(ABC): def __init__(self, key): # type: (JsonWebKey) -> None - self._allowed_ops = frozenset(key.key_ops or []) + self._allowed_ops = frozenset(key.key_ops or []) # type: ignore[attr-defined] self._internal_key = self._get_internal_key(key) self._key = key @@ -49,7 +49,7 @@ def key_id(self): :rtype: str or None """ - return self._key.kid + return self._key.kid # type: ignore[attr-defined] def _raise_if_unsupported(self, operation, algorithm): # type: (KeyOperation, Algorithm) -> None @@ -64,34 +64,40 @@ def encrypt(self, algorithm, plaintext, iv=None): # type: (EncryptionAlgorithm, bytes, Optional[bytes]) -> EncryptResult self._raise_if_unsupported(KeyOperation.encrypt, algorithm) ciphertext = self._internal_key.encrypt(plaintext, algorithm=algorithm.value, iv=iv) - return EncryptResult(key_id=self._key.kid, algorithm=algorithm, ciphertext=ciphertext, iv=iv) + return EncryptResult( + key_id=self._key.kid, algorithm=algorithm, ciphertext=ciphertext, iv=iv # type: ignore[attr-defined] + ) def decrypt(self, algorithm, ciphertext, iv=None): # type: (EncryptionAlgorithm, bytes, Optional[bytes]) -> DecryptResult self._raise_if_unsupported(KeyOperation.decrypt, algorithm) plaintext = self._internal_key.decrypt(ciphertext, iv=iv, algorithm=algorithm.value) - return DecryptResult(key_id=self._key.kid, algorithm=algorithm, plaintext=plaintext) + return DecryptResult( + key_id=self._key.kid, algorithm=algorithm, plaintext=plaintext # type: ignore[attr-defined] + ) def wrap_key(self, algorithm, key): # type: (KeyWrapAlgorithm, bytes) -> WrapResult self._raise_if_unsupported(KeyOperation.wrap_key, algorithm) encrypted_key = self._internal_key.wrap_key(key, algorithm=algorithm.value) - return WrapResult(key_id=self._key.kid, algorithm=algorithm, encrypted_key=encrypted_key) + return WrapResult( + key_id=self._key.kid, algorithm=algorithm, encrypted_key=encrypted_key # type: ignore[attr-defined] + ) def unwrap_key(self, algorithm, encrypted_key): # type: (KeyWrapAlgorithm, bytes) -> UnwrapResult self._raise_if_unsupported(KeyOperation.unwrap_key, algorithm) unwrapped_key = self._internal_key.unwrap_key(encrypted_key, algorithm=algorithm.value) - return UnwrapResult(key_id=self._key.kid, algorithm=algorithm, key=unwrapped_key) + return UnwrapResult(key_id=self._key.kid, algorithm=algorithm, key=unwrapped_key) # type: ignore[attr-defined] def sign(self, algorithm, digest): # type: (SignatureAlgorithm, bytes) -> SignResult self._raise_if_unsupported(KeyOperation.sign, algorithm) signature = self._internal_key.sign(digest, algorithm=algorithm.value) - return SignResult(key_id=self._key.kid, algorithm=algorithm, signature=signature) + return SignResult(key_id=self._key.kid, algorithm=algorithm, signature=signature) # type: ignore[attr-defined] def verify(self, algorithm, digest, signature): # type: (SignatureAlgorithm, bytes, bytes) -> VerifyResult self._raise_if_unsupported(KeyOperation.verify, algorithm) is_valid = self._internal_key.verify(digest, signature, algorithm=algorithm.value) - return VerifyResult(key_id=self._key.kid, algorithm=algorithm, is_valid=is_valid) + return VerifyResult(key_id=self._key.kid, algorithm=algorithm, is_valid=is_valid) # type: ignore[attr-defined] diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/crypto/_providers/rsa.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/crypto/_providers/rsa.py index 3498072db217..292e6bba4c97 100644 --- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/crypto/_providers/rsa.py +++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/crypto/_providers/rsa.py @@ -20,7 +20,7 @@ class RsaCryptographyProvider(LocalCryptographyProvider): def _get_internal_key(self, key): # type: (JsonWebKey) -> Key - if key.kty not in (KeyType.rsa, KeyType.rsa_hsm): + if key.kty not in (KeyType.rsa, KeyType.rsa_hsm): # type: ignore[attr-defined] raise ValueError('"key" must be an RSA or RSA-HSM key') return RsaKey.from_jwk(key) diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/crypto/_providers/symmetric.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/crypto/_providers/symmetric.py index 73a07f296a6a..729377acab7b 100644 --- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/crypto/_providers/symmetric.py +++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/crypto/_providers/symmetric.py @@ -18,7 +18,7 @@ class SymmetricCryptographyProvider(LocalCryptographyProvider): def _get_internal_key(self, key): # type: (JsonWebKey) -> Key - if key.kty not in (KeyType.oct, KeyType.oct_hsm): + if key.kty not in (KeyType.oct, KeyType.oct_hsm): # type: ignore[attr-defined] raise ValueError('"key" must be an oct or oct-HSM (symmetric) key') return SymmetricKey.from_jwk(key) diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/crypto/aio/_client.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/crypto/aio/_client.py index ffda9d3d06f8..8c21543eddff 100644 --- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/crypto/aio/_client.py +++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/crypto/aio/_client.py @@ -3,7 +3,7 @@ # Licensed under the MIT License. # ------------------------------------ import logging -from typing import TYPE_CHECKING +from typing import TYPE_CHECKING, cast from azure.core.exceptions import HttpResponseError from azure.core.tracing.decorator_async import distributed_trace_async @@ -61,7 +61,7 @@ def __init__(self, key: "Union[KeyVaultKey, str]", credential: "AsyncTokenCreden self._key_id = None # type: Optional[KeyVaultResourceId] if isinstance(key, KeyVaultKey): - self._key = key.key + self._key = key.key # type: Union[JsonWebKey, KeyVaultKey, str, None] self._key_id = parse_key_vault_id(key.id) if key.properties._attributes: # pylint:disable=protected-access self._not_before = key.properties.not_before @@ -69,18 +69,18 @@ def __init__(self, key: "Union[KeyVaultKey, str]", credential: "AsyncTokenCreden elif isinstance(key, str): self._key = None self._key_id = parse_key_vault_id(key) - self._keys_get_forbidden = None # type: Optional[bool] + self._keys_get_forbidden = False elif self._jwk: self._key = key else: raise ValueError("'key' must be a KeyVaultKey instance or a key ID string including a version") - if not (self._jwk or self._key_id.version): + if not (self._jwk or (self._key_id.version if self._key_id else None)): raise ValueError("'key' must include a version") if self._jwk: try: - self._local_provider = get_local_cryptography_provider(self._key) + self._local_provider = get_local_cryptography_provider(cast(JsonWebKey, self._key)) self._initialized = True except Exception as ex: # pylint:disable=broad-except raise ValueError("The provided jwk is not valid for local cryptography") from ex @@ -88,7 +88,7 @@ def __init__(self, key: "Union[KeyVaultKey, str]", credential: "AsyncTokenCreden self._local_provider = NoLocalCryptography() self._initialized = False - self._vault_url = None if self._jwk else self._key_id.vault_url + self._vault_url = None if (self._jwk or self._key_id is None) else self._key_id.vault_url # type: ignore super().__init__(vault_url=self._vault_url or "vault_url", credential=credential, **kwargs) @property @@ -100,11 +100,11 @@ def key_id(self) -> "Optional[str]": :rtype: str or None """ if not self._jwk: - return self._key_id.source_id - return self._key.kid + return self._key_id.source_id if self._key_id else None + return cast(JsonWebKey, self._key).kid # type: ignore[attr-defined] @property - def vault_url(self) -> "Optional[str]": + def vault_url(self) -> "Optional[str]": # type: ignore """The base vault URL of the client's key. This property may be None when a client is constructed with :func:`from_jwk`. @@ -123,7 +123,7 @@ def from_jwk(cls, jwk: "Union[JsonWebKey, dict]") -> "CryptographyClient": """ if not isinstance(jwk, JsonWebKey): jwk = JsonWebKey(**jwk) - return cls(jwk, object(), _jwk=True) + return cls(jwk, object(), _jwk=True) # type: ignore @distributed_trace_async async def _initialize(self, **kwargs): @@ -135,7 +135,10 @@ async def _initialize(self, **kwargs): if not (self._key or self._keys_get_forbidden): try: key_bundle = await self._client.get_key( - self._key_id.vault_url, self._key_id.name, self._key_id.version, **kwargs + self._key_id.vault_url if self._key_id else None, + self._key_id.name if self._key_id else None, + self._key_id.version if self._key_id else None, + **kwargs ) self._key = KeyVaultKey._from_key_bundle(key_bundle).key # pylint:disable=protected-access except HttpResponseError as ex: @@ -145,7 +148,7 @@ async def _initialize(self, **kwargs): # if we have the key material, create a local crypto provider with it if self._key: - self._local_provider = get_local_cryptography_provider(self._key) + self._local_provider = get_local_cryptography_provider(cast(JsonWebKey, self._key)) self._initialized = True else: # try to get the key again next time unless we know we're forbidden to do so @@ -193,9 +196,9 @@ async def encrypt(self, algorithm: "EncryptionAlgorithm", plaintext: bytes, **kw ) operation_result = await self._client.encrypt( - vault_base_url=self._key_id.vault_url, - key_name=self._key_id.name, - key_version=self._key_id.version, + vault_base_url=self._key_id.vault_url if self._key_id else None, + key_name=self._key_id.name if self._key_id else None, + key_version=self._key_id.version if self._key_id else None, parameters=self._models.KeyOperationsParameters(algorithm=algorithm, value=plaintext, iv=iv, aad=aad), **kwargs ) @@ -253,9 +256,9 @@ async def decrypt(self, algorithm: "EncryptionAlgorithm", ciphertext: bytes, **k ) operation_result = await self._client.decrypt( - vault_base_url=self._key_id.vault_url, - key_name=self._key_id.name, - key_version=self._key_id.version, + vault_base_url=self._key_id.vault_url if self._key_id else None, + key_name=self._key_id.name if self._key_id else None, + key_version=self._key_id.version if self._key_id else None, parameters=self._models.KeyOperationsParameters( algorithm=algorithm, value=ciphertext, iv=iv, tag=tag, aad=aad ), @@ -297,9 +300,9 @@ async def wrap_key(self, algorithm: "KeyWrapAlgorithm", key: bytes, **kwargs: "A ) operation_result = await self._client.wrap_key( - vault_base_url=self._key_id.vault_url, - key_name=self._key_id.name, - key_version=self._key_id.version, + vault_base_url=self._key_id.vault_url if self._key_id else None, + key_name=self._key_id.name if self._key_id else None, + key_version=self._key_id.version if self._key_id else None, parameters=self._models.KeyOperationsParameters(algorithm=algorithm, value=key), **kwargs ) @@ -338,14 +341,14 @@ async def unwrap_key(self, algorithm: "KeyWrapAlgorithm", encrypted_key: bytes, ) operation_result = await self._client.unwrap_key( - vault_base_url=self._key_id.vault_url, - key_name=self._key_id.name, - key_version=self._key_id.version, + vault_base_url=self._key_id.vault_url if self._key_id else None, + key_name=self._key_id.name if self._key_id else None, + key_version=self._key_id.version if self._key_id else None, parameters=self._models.KeyOperationsParameters(algorithm=algorithm, value=encrypted_key), **kwargs ) - return UnwrapResult(key_id=self._key_id, algorithm=algorithm, key=operation_result.result) + return UnwrapResult(key_id=self.key_id, algorithm=algorithm, key=operation_result.result) @distributed_trace_async async def sign(self, algorithm: "SignatureAlgorithm", digest: bytes, **kwargs: "Any") -> SignResult: @@ -380,9 +383,9 @@ async def sign(self, algorithm: "SignatureAlgorithm", digest: bytes, **kwargs: " ) operation_result = await self._client.sign( - vault_base_url=self._key_id.vault_url, - key_name=self._key_id.name, - key_version=self._key_id.version, + vault_base_url=self._key_id.vault_url if self._key_id else None, + key_name=self._key_id.name if self._key_id else None, + key_version=self._key_id.version if self._key_id else None, parameters=self._models.KeySignParameters(algorithm=algorithm, value=digest), **kwargs ) @@ -425,9 +428,9 @@ async def verify( ) operation_result = await self._client.verify( - vault_base_url=self._key_id.vault_url, - key_name=self._key_id.name, - key_version=self._key_id.version, + vault_base_url=self._key_id.vault_url if self._key_id else None, + key_name=self._key_id.name if self._key_id else None, + key_version=self._key_id.version if self._key_id else None, parameters=self._models.KeyVerifyParameters(algorithm=algorithm, digest=digest, signature=signature), **kwargs ) diff --git a/sdk/keyvault/azure-keyvault-keys/mypy.ini b/sdk/keyvault/azure-keyvault-keys/mypy.ini new file mode 100644 index 000000000000..18b37b44c426 --- /dev/null +++ b/sdk/keyvault/azure-keyvault-keys/mypy.ini @@ -0,0 +1,7 @@ +[mypy] +python_version = 3.6 +warn_unused_configs = True +ignore_missing_imports = True + +[mypy-azure.keyvault.*._generated.*] +ignore_errors = True From 92a676d5f870463b63b4af0c8fe0d9eac21637d4 Mon Sep 17 00:00:00 2001 From: Xiang Yan Date: Thu, 9 Sep 2021 09:15:26 -0700 Subject: [PATCH 22/85] update changelog (#20619) --- sdk/identity/azure-identity/CHANGELOG.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sdk/identity/azure-identity/CHANGELOG.md b/sdk/identity/azure-identity/CHANGELOG.md index eb32e8df944e..afff1c495d80 100644 --- a/sdk/identity/azure-identity/CHANGELOG.md +++ b/sdk/identity/azure-identity/CHANGELOG.md @@ -11,10 +11,6 @@ - `DefaultAzureCredential` allows specifying the client ID of interactive browser via keyword argument `interactive_browser_client_id` ([#20487](https://github.com/Azure/azure-sdk-for-python/issues/20487)) -### Breaking Changes - -### Bugs Fixed - ### Other Changes - Added context manager methods and `close()` to credentials in the `azure.identity` namespace. At the end of a `with` block, or when `close()` From 853db908fa832a6c2e15a8947d5949af00bc4502 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Thu, 9 Sep 2021 10:59:29 -0700 Subject: [PATCH 23/85] Increment version for identity releases (#20620) Increment package version after release of azure-identity --- sdk/identity/azure-identity/CHANGELOG.md | 10 ++++++++++ sdk/identity/azure-identity/azure/identity/_version.py | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/sdk/identity/azure-identity/CHANGELOG.md b/sdk/identity/azure-identity/CHANGELOG.md index afff1c495d80..49c726f3f0a2 100644 --- a/sdk/identity/azure-identity/CHANGELOG.md +++ b/sdk/identity/azure-identity/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.7.0b5 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.7.0b4 (2021-09-09) ### Features Added diff --git a/sdk/identity/azure-identity/azure/identity/_version.py b/sdk/identity/azure-identity/azure/identity/_version.py index 46754f3b4a50..9b8985182a86 100644 --- a/sdk/identity/azure-identity/azure/identity/_version.py +++ b/sdk/identity/azure-identity/azure/identity/_version.py @@ -2,4 +2,4 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # ------------------------------------ -VERSION = "1.7.0b4" +VERSION = "1.7.0b5" From 476acd5a6700d227bda7e82a7750951186e87a1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?McCoy=20Pati=C3=B1o?= <39780829+mccoyp@users.noreply.github.com> Date: Thu, 9 Sep 2021 11:02:40 -0700 Subject: [PATCH 24/85] [Identity] Resolve CredScan warnings (#20543) --- eng/CredScanSuppression.json | 3 ++- .../azure-identity/tests/credscan_ignore.py | 9 +++++++++ .../recordings/test_cae.test_device_code.yaml | 20 +++++++++---------- .../test_cae.test_username_password.yaml | 8 ++++---- .../tests/test_powershell_credential.py | 12 +++-------- .../tests/test_powershell_credential_async.py | 11 ++-------- 6 files changed, 30 insertions(+), 33 deletions(-) create mode 100644 sdk/identity/azure-identity/tests/credscan_ignore.py diff --git a/eng/CredScanSuppression.json b/eng/CredScanSuppression.json index d772166f0b87..d852becfee33 100644 --- a/eng/CredScanSuppression.json +++ b/eng/CredScanSuppression.json @@ -40,9 +40,10 @@ "eng/common/testproxy/dotnet-devcert.pfx", "sdk/confidentialledger/azure-confidentialledger/tests/_shared/constants.py", "sdk/keyvault/azure-keyvault-certificates/tests/ca.key", - "sdk/identity/azure-identity/tests/ec-certificate.pem", "sdk/identity/azure-identity/tests/certificate.pfx", "sdk/identity/azure-identity/tests/certificate-with-password.pfx", + "sdk/identity/azure-identity/tests/credscan_ignore.py", + "sdk/identity/azure-identity/tests/ec-certificate.pem", "sdk/core/azure-servicemanagement-legacy/tests/legacy_mgmt_settings_fake.py", "sdk/storage/azure-storage-blob/tests/fake_credentials.py", "sdk/storage/azure-storage-file-datalake/tests/fake_credentials.py", diff --git a/sdk/identity/azure-identity/tests/credscan_ignore.py b/sdk/identity/azure-identity/tests/credscan_ignore.py new file mode 100644 index 000000000000..a1acb2ded56f --- /dev/null +++ b/sdk/identity/azure-identity/tests/credscan_ignore.py @@ -0,0 +1,9 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ + +POWERSHELL_INVALID_OPERATION_EXCEPTION = """#< CLIXML +System.Management.Automation.PSCustomObjectSystem.Object1Preparing modules for first use.0-1-1Completed-1 2Preparing modules for first use.0-1-1Completed-1 Get-AzAccessToken : Run Connect-AzAccount to login._x000D__x000A_At line:11 char:10_x000D__x000A_+ $token = Get-AzAccessToken -ResourceUrl 'scope'_x000D__x000A_+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~_x000D__x000A_ + CategoryInfo : CloseError: (:) [Get-AzAccessToken], PSInvalidOperationException_x000D__x000A_ + FullyQualifiedErrorId : Microsoft.Azure.Commands.Profile.GetAzureRmAccessTokenCommand_x000D__x000A_ _x000D__x000A_""" +POWERSHELL_NOT_LOGGED_IN_ERROR = """#< CLIXML +_x001B_[91mGet-AzAccessToken: _x000D__x000A__x001B_[96mLine |_x000D__x000A__x001B_[96m 11 | _x001B_[0m $token = _x001B_[96mGet-AzAccessToken -ResourceUrl 'scope'_x001B_[0m_x000D__x000A__x001B_[96m | _x001B_[91m ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~_x000D__x000A__x001B_[91m_x001B_[96m | _x001B_[91mRun Connect-AzAccount to login._x001B_[0m_x000D__x000A_""" diff --git a/sdk/identity/azure-identity/tests/recordings/test_cae.test_device_code.yaml b/sdk/identity/azure-identity/tests/recordings/test_cae.test_device_code.yaml index a52808dd1278..a4fe94f5d38a 100644 --- a/sdk/identity/azure-identity/tests/recordings/test_cae.test_device_code.yaml +++ b/sdk/identity/azure-identity/tests/recordings/test_cae.test_device_code.yaml @@ -92,10 +92,10 @@ interactions: uri: https://login.microsoftonline.com/tenant/oauth2/v2.0/devicecode response: body: - string: '{"user_code": "c934976f1393725db44d1d419b378baf00f383c5f3120eae059eb20bb86c08b0", - "device_code": "f942eaaebc9683c361e2038648fe4cf1ddb80d515ff47e10d48af420330eab5c", + string: '{"user_code": "redacted3c59ab", + "device_code": "redactedb9ef25", "verification_uri": "https://microsoft.com/devicelogin", "expires_in": 900, - "interval": 5, "message": "524aa9e7bd498505c8f902c5fe65bd4679d45709259cb590e75f46c980c05aa9"}' + "interval": 5, "message": "redactedf09f37"}' headers: cache-control: - no-store, no-cache @@ -299,8 +299,8 @@ interactions: body: string: '{"token_type": "Bearer", "scope": "https://management.azure.com/user_impersonation https://management.azure.com/.default", "expires_in": 86399, "ext_expires_in": - 86399, "access_token": "27a75655adaa9cd9cd7e604a510829826acb0da287713872a9ea5658df01830f", - "refresh_token": "4c9049a37c3f1bdc3c662fb0749e887cf6c0a100f9899ef0d77029867bc9e98e", + 86399, "access_token": "redactedca8839", + "refresh_token": "redacted7ef8cf", "foci": "1", "id_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Im5PbzNaRHJPRFhFSzFqS1doWHNsSFJfS1hFZyJ9.eyJhdWQiOiIwNGIwNzc5NS04ZGRiLTQ2MWEtYmJlZS0wMmY5ZTFiZjdiNDYiLCJpc3MiOiJodHRwczovL2xvZ2luLm1pY3Jvc29mdG9ubGluZS5jb20vNTQ4MjZiMjItMzhkNi00ZmIyLWJhZDktYjdiOTNhM2U5YzVhL3YyLjAiLCJpYXQiOjE2MTExNjQ2NTQsIm5iZiI6MTYxMTE2NDY1NCwiZXhwIjoxNjExMTY4NTU0LCJhaW8iOiJBVFFBeS84U0FBQUE4Zjl5WTlKeUFBRFQ5bEZkdlVKYU4ybk1NT3ROeGkwVlk1MWRUQUE0eFlWU3psdndwQ3NDNmdIcFRFSzB1MG1kIiwibmFtZSI6ImNobG93ZS10ZXN0Iiwib2lkIjoiYTcyOGM5MWEtNDdjOS00NTAyLWJhMDUtMzYwODQwODI2NjM2IiwicHJlZmVycmVkX3VzZXJuYW1lIjoiY2hsb3dlLXRlc3RAYXp1cmVzZGt0ZWFtLm9ubWljcm9zb2Z0LmNvbSIsInJoIjoiMC5BVGNBSW11Q1ZOWTRzay02MmJlNU9qNmNXcFYzc0FUYmpScEd1LTRDLWVHX2UwWTNBSkEuIiwic3ViIjoiSE5QcW9raHV6WUFmRlVlRkEtVm1rQ0M1Z253Mkp1b0xTSEtIZ2NDbkdHYyIsInRpZCI6IjU0ODI2YjIyLTM4ZDYtNGZiMi1iYWQ5LWI3YjkzYTNlOWM1YSIsInV0aSI6Ii10aTBqY1VrTjA2eHlxcTAzY0tFQVEiLCJ2ZXIiOiIyLjAifQ.cnsvmmnQzua0aZ96pXJOGq8hdgyUhy2DMTN2Yzjvs5TZCRd0voB0Ox_4VmjID3CFiixFOD58tn69pu5DkWEk8T3cBXMBecBRefdjEJcVuDeAQ_GnKZgVGVMjYHERcDxanukaknzs69an8nFASBJVHcLvaiRvy5UtJ4tJPpL1yM1XXwJd6EV4e2mqDt_5SgyWM_O2QPNtQF3IuozWRGrJ84ap2VN-zgkLrZRHeiE9XtNByQDfcwEXcxznx64lOXdJmUyfpxu8iiwChUzCa01PA-gM7UjTIBe_e71ALWdIj3fLmKp3HlquSDDV-eb9jTQrhtn7MtzONk6WbQTOahVMRA", "client_info": "eyJ1aWQiOiJhNzI4YzkxYS00N2M5LTQ1MDItYmEwNS0zNjA4NDA4MjY2MzYiLCJ1dGlkIjoiNTQ4MjZiMjItMzhkNi00ZmIyLWJhZDktYjdiOTNhM2U5YzVhIn0"}' headers: @@ -579,10 +579,10 @@ interactions: uri: https://login.microsoftonline.com/tenant/oauth2/v2.0/devicecode response: body: - string: '{"user_code": "37014a978b95ae6e752f54107987c3409b3cf801c3835261952f8740cb20d1c8", - "device_code": "428a20171292a6f89bedf5ef1b83a82a94f3196d1cdc914229be57fb5bdb6b1c", + string: '{"user_code": "redacted221497", + "device_code": "redacted486127", "verification_uri": "https://microsoft.com/devicelogin", "expires_in": 900, - "interval": 5, "message": "a92bcf4b00e3e6e783399306f14035815428ee07c9e2a0c7920a27fbdb9a9b27"}' + "interval": 5, "message": "redactedb92935"}' headers: cache-control: - no-store, no-cache @@ -789,8 +789,8 @@ interactions: body: string: '{"token_type": "Bearer", "scope": "https://management.azure.com/user_impersonation https://management.azure.com/.default", "expires_in": 86399, "ext_expires_in": - 86399, "access_token": "4eae20b397129621daea0169160d06c2d3d6a26bcac8c6aed6d722f89952d41b", - "refresh_token": "5013d6d09c2f1ff82a870572f6066aecebea1137e8b1c731be5bf01ae0f67f24", + 86399, "access_token": "redacteda22f90", + "refresh_token": "redacted0f5082", "foci": "1", "id_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Im5PbzNaRHJPRFhFSzFqS1doWHNsSFJfS1hFZyJ9.eyJhdWQiOiIwNGIwNzc5NS04ZGRiLTQ2MWEtYmJlZS0wMmY5ZTFiZjdiNDYiLCJpc3MiOiJodHRwczovL2xvZ2luLm1pY3Jvc29mdG9ubGluZS5jb20vNTQ4MjZiMjItMzhkNi00ZmIyLWJhZDktYjdiOTNhM2U5YzVhL3YyLjAiLCJpYXQiOjE2MTExNjUwODcsIm5iZiI6MTYxMTE2NTA4NywiZXhwIjoxNjExMTY4OTg3LCJhaW8iOiJBVFFBeS84U0FBQUE4L1lxaDZrd3UrRnJ3TjV2bENVQ2Z5QVlmVDR1dExpTitpeFhZS0ZsWEhZZndiSDZITW9JZEpMazlJMVZnMy9XIiwibmFtZSI6ImNobG93ZS10ZXN0Iiwib2lkIjoiYTcyOGM5MWEtNDdjOS00NTAyLWJhMDUtMzYwODQwODI2NjM2IiwicHJlZmVycmVkX3VzZXJuYW1lIjoiY2hsb3dlLXRlc3RAYXp1cmVzZGt0ZWFtLm9ubWljcm9zb2Z0LmNvbSIsInJoIjoiMC5BVGNBSW11Q1ZOWTRzay02MmJlNU9qNmNXcFYzc0FUYmpScEd1LTRDLWVHX2UwWTNBSkEuIiwic3ViIjoiSE5QcW9raHV6WUFmRlVlRkEtVm1rQ0M1Z253Mkp1b0xTSEtIZ2NDbkdHYyIsInRpZCI6IjU0ODI2YjIyLTM4ZDYtNGZiMi1iYWQ5LWI3YjkzYTNlOWM1YSIsInV0aSI6Ik9WY3ZkbXVncEV1YllWQU9va0szQVEiLCJ2ZXIiOiIyLjAifQ.b17pJRXmw9YnC97aQbdKihqjTnqYuFSGH0AxdtDk4cpt9ZviJV19dz5wVxaUORGNf6K6vnFhZRlEX89bhMLH1BpVq5lc28IQ-8zk-Q6ItIap2xVS4u2jjHHoSZLoIPtNXMXPnOz_KPuff_L46mJpKoBxpEOBUvB6Tx_k-hLyrabpNYo_swBemamDylbrDPUpyNZCIlHi_qMH60Hrtfg9JlnGUeUUi-seY4vRQcTnAB-wvsQtMWbKYsEpBgjUihoqScRZMNC9j3HuvAsWurrCIJ4vZ6WKsjg7aoqC-Z-AWnOmvVSlUTajCI1HFzhjcTYDRS_WrcKnModSLvR1I6eMrw", "client_info": "eyJ1aWQiOiJhNzI4YzkxYS00N2M5LTQ1MDItYmEwNS0zNjA4NDA4MjY2MzYiLCJ1dGlkIjoiNTQ4MjZiMjItMzhkNi00ZmIyLWJhZDktYjdiOTNhM2U5YzVhIn0"}' headers: diff --git a/sdk/identity/azure-identity/tests/recordings/test_cae.test_username_password.yaml b/sdk/identity/azure-identity/tests/recordings/test_cae.test_username_password.yaml index bccbe948fc44..40e08354efd2 100644 --- a/sdk/identity/azure-identity/tests/recordings/test_cae.test_username_password.yaml +++ b/sdk/identity/azure-identity/tests/recordings/test_cae.test_username_password.yaml @@ -147,8 +147,8 @@ interactions: body: string: '{"token_type": "Bearer", "scope": "https://management.azure.com/user_impersonation https://management.azure.com/.default", "expires_in": 86399, "ext_expires_in": - 86399, "access_token": "90bfb5b224af86355666990646b4560e01bd8e134409cf3b8957eb3439e1198d", - "refresh_token": "5cd3b6421bdc3b15ae207aa2dbd5382287ab90b682e8382d6e295dd2c9c63b95", + 86399, "access_token": "redactedf2adbf", + "refresh_token": "redacted72e298", "foci": "1", "id_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Im5PbzNaRHJPRFhFSzFqS1doWHNsSFJfS1hFZyJ9.eyJhdWQiOiIwNGIwNzc5NS04ZGRiLTQ2MWEtYmJlZS0wMmY5ZTFiZjdiNDYiLCJpc3MiOiJodHRwczovL2xvZ2luLm1pY3Jvc29mdG9ubGluZS5jb20vNTQ4MjZiMjItMzhkNi00ZmIyLWJhZDktYjdiOTNhM2U5YzVhL3YyLjAiLCJpYXQiOjE2MTExNjM2NDAsIm5iZiI6MTYxMTE2MzY0MCwiZXhwIjoxNjExMTY3NTQwLCJhaW8iOiJBVFFBeS84U0FBQUFjSU9MUjhRbmJJd0lKb1lTYkxoakhndzMrL3BEdWJaVTdlUHB1anFjQjBvMzNzQjVXRjJWV0w4bjEwWmhkM3dWIiwibmFtZSI6ImNobG93ZS10ZXN0Iiwib2lkIjoiYTcyOGM5MWEtNDdjOS00NTAyLWJhMDUtMzYwODQwODI2NjM2IiwicHJlZmVycmVkX3VzZXJuYW1lIjoiY2hsb3dlLXRlc3RAYXp1cmVzZGt0ZWFtLm9ubWljcm9zb2Z0LmNvbSIsInJoIjoiMC5BVGNBSW11Q1ZOWTRzay02MmJlNU9qNmNXcFYzc0FUYmpScEd1LTRDLWVHX2UwWTNBSkEuIiwic3ViIjoiSE5QcW9raHV6WUFmRlVlRkEtVm1rQ0M1Z253Mkp1b0xTSEtIZ2NDbkdHYyIsInRpZCI6IjU0ODI2YjIyLTM4ZDYtNGZiMi1iYWQ5LWI3YjkzYTNlOWM1YSIsInV0aSI6IjMyLWpHQW1tNkVPckVEM2J0dl9NQVEiLCJ2ZXIiOiIyLjAifQ.Selp9Tu_RXqJjKw2Jr9tlIDEO5ZDoEQmURRZyYVHHdv7VAntq6khKkxTbcWq_UMf-XQLV9_vislkdaydPzZaM8rb-9O3DDN9Mfug8s9clxWPAUu8Cv7A8qc-eMTYF7nSjZXvcDRcAINunnUeeXjYBYYa-Cm9XrVzKiXyjb9Ue4S7c42YCdE_PUgQPQq-qr_umkWmIYLa5cOB-a017vUdGQ2DOAT3scPKCwjXb2ZlSUfeVs7bXXmvzgNGaBkCe2g2m97Fbe9JCjfmsIj89D8gkYuSup7JYV6DJzw3XAXGH1f46hEAhcHhoLoVuTTbMRKhIUV_TSQpnWSvv2CrRGEBeQ", "client_info": "eyJ1aWQiOiJhNzI4YzkxYS00N2M5LTQ1MDItYmEwNS0zNjA4NDA4MjY2MzYiLCJ1dGlkIjoiNTQ4MjZiMjItMzhkNi00ZmIyLWJhZDktYjdiOTNhM2U5YzVhIn0"}' headers: @@ -483,8 +483,8 @@ interactions: body: string: '{"token_type": "Bearer", "scope": "https://management.azure.com/user_impersonation https://management.azure.com/.default", "expires_in": 86399, "ext_expires_in": - 86399, "access_token": "1cd53f96bc681d6e3c2c1e44d52166dc319ef18e0cff11cd164dcab68400703a", - "refresh_token": "543af57a4e02de41aab38056eee6672b51f7f2e4119bc09ec2f5698a94aeb569", + 86399, "access_token": "redacted154205", + "refresh_token": "redacted5cc1a0", "foci": "1", "id_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Im5PbzNaRHJPRFhFSzFqS1doWHNsSFJfS1hFZyJ9.eyJhdWQiOiIwNGIwNzc5NS04ZGRiLTQ2MWEtYmJlZS0wMmY5ZTFiZjdiNDYiLCJpc3MiOiJodHRwczovL2xvZ2luLm1pY3Jvc29mdG9ubGluZS5jb20vNTQ4MjZiMjItMzhkNi00ZmIyLWJhZDktYjdiOTNhM2U5YzVhL3YyLjAiLCJpYXQiOjE2MTExNjQwNDUsIm5iZiI6MTYxMTE2NDA0NSwiZXhwIjoxNjExMTY3OTQ1LCJhaW8iOiJBVFFBeS84U0FBQUFLODI3b3FSMjdsMGcyRG5qM0RuR2RmeTUxcjgrZk1wYTFUb3dOK2gvMTdtdllyRHlQY0t0aTBQV0NoQ2g5TmpsIiwibmFtZSI6ImNobG93ZS10ZXN0Iiwib2lkIjoiYTcyOGM5MWEtNDdjOS00NTAyLWJhMDUtMzYwODQwODI2NjM2IiwicHJlZmVycmVkX3VzZXJuYW1lIjoiY2hsb3dlLXRlc3RAYXp1cmVzZGt0ZWFtLm9ubWljcm9zb2Z0LmNvbSIsInJoIjoiMC5BVGNBSW11Q1ZOWTRzay02MmJlNU9qNmNXcFYzc0FUYmpScEd1LTRDLWVHX2UwWTNBSkEuIiwic3ViIjoiSE5QcW9raHV6WUFmRlVlRkEtVm1rQ0M1Z253Mkp1b0xTSEtIZ2NDbkdHYyIsInRpZCI6IjU0ODI2YjIyLTM4ZDYtNGZiMi1iYWQ5LWI3YjkzYTNlOWM1YSIsInV0aSI6ImcxOTZhbTJNYlV5R0FqOE44cDdIQVEiLCJ2ZXIiOiIyLjAifQ.Uhx_g7vsHlPMQzeSbkTbeCgAVq1Yj7OWk18zJr5huT9vGX2NlFIiLJa2fUGW_thsYtSNPrmRAFCaAPD402N1-gZwFyCId0ObpmgW4m-XUXwVScGbQ4malAOIAuxX_BFQ4tLKSUzi1JWryWBvs2eBh3ZCzATGw_gJGm83TYm4Ih-QrmGULMEQP0gC0gpqvfOo2giM8via-xSh0vDTZA07ip17C5Te_IAS3AJ1ChcnJvB5uCpTLd5a-zD2fsCvK602PDtCMMZNwnbmrXVUseP_1E_3JQGRa6dfBGFq4HSdV2EvQ5s5zq_Dy3aAgpGzLQiJQgf7rzcxUd0RRHoSSLp5XQ", "client_info": "eyJ1aWQiOiJhNzI4YzkxYS00N2M5LTQ1MDItYmEwNS0zNjA4NDA4MjY2MzYiLCJ1dGlkIjoiNTQ4MjZiMjItMzhkNi00ZmIyLWJhZDktYjdiOTNhM2U5YzVhIn0"}' headers: diff --git a/sdk/identity/azure-identity/tests/test_powershell_credential.py b/sdk/identity/azure-identity/tests/test_powershell_credential.py index 898f1714e33f..cdf83543f220 100644 --- a/sdk/identity/azure-identity/tests/test_powershell_credential.py +++ b/sdk/identity/azure-identity/tests/test_powershell_credential.py @@ -27,6 +27,8 @@ ) import pytest +from credscan_ignore import POWERSHELL_INVALID_OPERATION_EXCEPTION, POWERSHELL_NOT_LOGGED_IN_ERROR + POPEN = AzurePowerShellCredential.__module__ + ".subprocess.Popen" @@ -145,15 +147,7 @@ def test_powershell_not_installed_sh(): AzurePowerShellCredential().get_token("scope") -@pytest.mark.parametrize( - "stderr", - ( - """#< CLIXML -System.Management.Automation.PSCustomObjectSystem.Object1Preparing modules for first use.0-1-1Completed-1 2Preparing modules for first use.0-1-1Completed-1 Get-AzAccessToken : Run Connect-AzAccount to login._x000D__x000A_At line:11 char:10_x000D__x000A_+ $token = Get-AzAccessToken -ResourceUrl 'scope'_x000D__x000A_+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~_x000D__x000A_ + CategoryInfo : CloseError: (:) [Get-AzAccessToken], PSInvalidOperationException_x000D__x000A_ + FullyQualifiedErrorId : Microsoft.Azure.Commands.Profile.GetAzureRmAccessTokenCommand_x000D__x000A_ _x000D__x000A_""", - """#< CLIXML -_x001B_[91mGet-AzAccessToken: _x000D__x000A__x001B_[96mLine |_x000D__x000A__x001B_[96m 11 | _x001B_[0m $token = _x001B_[96mGet-AzAccessToken -ResourceUrl 'scope'_x001B_[0m_x000D__x000A__x001B_[96m | _x001B_[91m ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~_x000D__x000A__x001B_[91m_x001B_[96m | _x001B_[91mRun Connect-AzAccount to login._x001B_[0m_x000D__x000A_""", - ), -) +@pytest.mark.parametrize("stderr", (POWERSHELL_INVALID_OPERATION_EXCEPTION, POWERSHELL_NOT_LOGGED_IN_ERROR)) def test_not_logged_in(stderr): """The credential should raise CredentialUnavailableError when a user isn't logged in to Azure PowerShell""" diff --git a/sdk/identity/azure-identity/tests/test_powershell_credential_async.py b/sdk/identity/azure-identity/tests/test_powershell_credential_async.py index fa55a8e4b90c..2e67d6c19906 100644 --- a/sdk/identity/azure-identity/tests/test_powershell_credential_async.py +++ b/sdk/identity/azure-identity/tests/test_powershell_credential_async.py @@ -23,6 +23,7 @@ ) import pytest +from credscan_ignore import POWERSHELL_INVALID_OPERATION_EXCEPTION, POWERSHELL_NOT_LOGGED_IN_ERROR from helpers_async import get_completed_future from test_powershell_credential import PREPARING_MODULES @@ -133,15 +134,7 @@ async def test_powershell_not_installed_sh(): await AzurePowerShellCredential().get_token("scope") -@pytest.mark.parametrize( - "stderr", - ( - """#< CLIXML -System.Management.Automation.PSCustomObjectSystem.Object1Preparing modules for first use.0-1-1Completed-1 2Preparing modules for first use.0-1-1Completed-1 Get-AzAccessToken : Run Connect-AzAccount to login._x000D__x000A_At line:11 char:10_x000D__x000A_+ $token = Get-AzAccessToken -ResourceUrl 'scope'_x000D__x000A_+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~_x000D__x000A_ + CategoryInfo : CloseError: (:) [Get-AzAccessToken], PSInvalidOperationException_x000D__x000A_ + FullyQualifiedErrorId : Microsoft.Azure.Commands.Profile.GetAzureRmAccessTokenCommand_x000D__x000A_ _x000D__x000A_""", - """#< CLIXML -_x001B_[91mGet-AzAccessToken: _x000D__x000A__x001B_[96mLine |_x000D__x000A__x001B_[96m 11 | _x001B_[0m $token = _x001B_[96mGet-AzAccessToken -ResourceUrl 'scope'_x001B_[0m_x000D__x000A__x001B_[96m | _x001B_[91m ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~_x000D__x000A__x001B_[91m_x001B_[96m | _x001B_[91mRun Connect-AzAccount to login._x001B_[0m_x000D__x000A_""", - ), -) +@pytest.mark.parametrize("stderr", (POWERSHELL_INVALID_OPERATION_EXCEPTION, POWERSHELL_NOT_LOGGED_IN_ERROR)) async def test_not_logged_in(stderr): """The credential should raise CredentialUnavailableError when a user isn't logged in to Azure PowerShell""" From 0e5e53d017f9dd6147497280f7097dc51d3fa906 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Thu, 9 Sep 2021 11:03:54 -0700 Subject: [PATCH 25/85] Explicitly exit 0 so a failed inner command (like mvn) doesn't propagate up to a failure of the pipeline (#20609) Co-authored-by: Daniel Jurek --- eng/common/scripts/Update-DocsMsPackages.ps1 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/eng/common/scripts/Update-DocsMsPackages.ps1 b/eng/common/scripts/Update-DocsMsPackages.ps1 index 576159e7785d..f93e6cb058b4 100644 --- a/eng/common/scripts/Update-DocsMsPackages.ps1 +++ b/eng/common/scripts/Update-DocsMsPackages.ps1 @@ -133,3 +133,7 @@ if ($UpdateDocsMsPackagesFn -and (Test-Path "Function:$UpdateDocsMsPackagesFn")) See https://github.com/Azure/azure-sdk-tools/blob/main/doc/common/common_engsys.md#code-structure" exit 1 } + +# Exit 0 so DevOps doesn't fail the build when the last command called by the +# domain-specific function exited with a non-zero exit code. +exit 0 From 0c0b9754ebf0a733824fc0f39ca53c2eab46a39b Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Thu, 9 Sep 2021 13:34:52 -0700 Subject: [PATCH 26/85] Increment version for keyvault releases (#20625) Increment package version after release of azure-keyvault-keys --- sdk/keyvault/azure-keyvault-certificates/CHANGELOG.md | 10 ++++++++++ .../azure/keyvault/certificates/_version.py | 2 +- sdk/keyvault/azure-keyvault-keys/CHANGELOG.md | 10 ++++++++++ .../azure/keyvault/keys/_version.py | 2 +- sdk/keyvault/azure-keyvault-secrets/CHANGELOG.md | 10 ++++++++++ .../azure/keyvault/secrets/_version.py | 2 +- 6 files changed, 33 insertions(+), 3 deletions(-) diff --git a/sdk/keyvault/azure-keyvault-certificates/CHANGELOG.md b/sdk/keyvault/azure-keyvault-certificates/CHANGELOG.md index 2ef39ff28fc9..f399e57e03c3 100644 --- a/sdk/keyvault/azure-keyvault-certificates/CHANGELOG.md +++ b/sdk/keyvault/azure-keyvault-certificates/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 4.4.0b2 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 4.4.0b1 (2021-09-09) ### Features Added diff --git a/sdk/keyvault/azure-keyvault-certificates/azure/keyvault/certificates/_version.py b/sdk/keyvault/azure-keyvault-certificates/azure/keyvault/certificates/_version.py index 749d4c6914b0..56befbde59cd 100644 --- a/sdk/keyvault/azure-keyvault-certificates/azure/keyvault/certificates/_version.py +++ b/sdk/keyvault/azure-keyvault-certificates/azure/keyvault/certificates/_version.py @@ -3,4 +3,4 @@ # Licensed under the MIT License. # ------------------------------------ -VERSION = "4.4.0b1" +VERSION = "4.4.0b2" diff --git a/sdk/keyvault/azure-keyvault-keys/CHANGELOG.md b/sdk/keyvault/azure-keyvault-keys/CHANGELOG.md index 8896a149c378..8834bd492fb0 100644 --- a/sdk/keyvault/azure-keyvault-keys/CHANGELOG.md +++ b/sdk/keyvault/azure-keyvault-keys/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 4.5.0b4 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 4.5.0b3 (2021-09-09) ### Other Changes diff --git a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_version.py b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_version.py index e8c03ac83409..a5feaaf83096 100644 --- a/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_version.py +++ b/sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_version.py @@ -3,4 +3,4 @@ # Licensed under the MIT License. # ------------------------------------ -VERSION = "4.5.0b3" +VERSION = "4.5.0b4" diff --git a/sdk/keyvault/azure-keyvault-secrets/CHANGELOG.md b/sdk/keyvault/azure-keyvault-secrets/CHANGELOG.md index ba248cdd1d63..679cdf8ae1ba 100644 --- a/sdk/keyvault/azure-keyvault-secrets/CHANGELOG.md +++ b/sdk/keyvault/azure-keyvault-secrets/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 4.4.0b2 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 4.4.0b1 (2021-09-09) ### Features Added diff --git a/sdk/keyvault/azure-keyvault-secrets/azure/keyvault/secrets/_version.py b/sdk/keyvault/azure-keyvault-secrets/azure/keyvault/secrets/_version.py index 749d4c6914b0..56befbde59cd 100644 --- a/sdk/keyvault/azure-keyvault-secrets/azure/keyvault/secrets/_version.py +++ b/sdk/keyvault/azure-keyvault-secrets/azure/keyvault/secrets/_version.py @@ -3,4 +3,4 @@ # Licensed under the MIT License. # ------------------------------------ -VERSION = "4.4.0b1" +VERSION = "4.4.0b2" From 6d34b9013306c761176585a90d89d403ebcb5235 Mon Sep 17 00:00:00 2001 From: Yalin Li Date: Thu, 9 Sep 2021 13:36:32 -0700 Subject: [PATCH 27/85] Address incorrect links in README.md (#20626) --- sdk/keyvault/azure-keyvault-administration/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/keyvault/azure-keyvault-administration/README.md b/sdk/keyvault/azure-keyvault-administration/README.md index 0823efc6fba1..6d280c29554c 100644 --- a/sdk/keyvault/azure-keyvault-administration/README.md +++ b/sdk/keyvault/azure-keyvault-administration/README.md @@ -392,7 +392,7 @@ contact opencode@microsoft.com with any additional questions or comments. [keyvault_docs]: https://docs.microsoft.com/azure/key-vault/ [managed_hsm]: https://docs.microsoft.com/azure/key-vault/managed-hsm/ [pip]: https://pypi.org/project/pip/ -[pypi_package_administration]: https://aka.ms/azsdk/python/keyvault-administration/pypi +[pypi_package_administration]: https://pypi.org/project/azure-keyvault-administration [reference_docs]: https://aka.ms/azsdk/python/keyvault-administration/docs From 43a17d23a620de220c878f729358d9c6fa070389 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Thu, 9 Sep 2021 14:01:18 -0700 Subject: [PATCH 28/85] Install az module if not installed in deploy-stress-tests.ps1 (#20605) Co-authored-by: Ben Broderick Phillips --- eng/common/scripts/stress-testing/deploy-stress-tests.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/eng/common/scripts/stress-testing/deploy-stress-tests.ps1 b/eng/common/scripts/stress-testing/deploy-stress-tests.ps1 index a95ce62ff02b..80c6471a1199 100644 --- a/eng/common/scripts/stress-testing/deploy-stress-tests.ps1 +++ b/eng/common/scripts/stress-testing/deploy-stress-tests.ps1 @@ -22,6 +22,7 @@ $FailedCommands = New-Object Collections.Generic.List[hashtable] . (Join-Path $PSScriptRoot "../Helpers" PSModule-Helpers.ps1) Install-ModuleIfNotInstalled "powershell-yaml" "0.4.1" | Import-Module +Install-ModuleIfNotInstalled "az" "6.4.0" | Import-Module # Powershell does not (at time of writing) treat exit codes from external binaries # as cause for stopping execution, so do this via a wrapper function. From 5c1cf92ed2c84a35d7ecf22b1a32f1627590fb05 Mon Sep 17 00:00:00 2001 From: Rakshith Bhyravabhotla Date: Thu, 9 Sep 2021 14:32:22 -0700 Subject: [PATCH 29/85] Prepare for release (#20627) --- sdk/monitor/azure-monitor-query/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/monitor/azure-monitor-query/CHANGELOG.md b/sdk/monitor/azure-monitor-query/CHANGELOG.md index cae3e02459f1..1d6ca0ce60ec 100644 --- a/sdk/monitor/azure-monitor-query/CHANGELOG.md +++ b/sdk/monitor/azure-monitor-query/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 1.0.0b4 (Unreleased) +## 1.0.0b4 (09-09-2021) ### Features Added From 3d29229f86dcd558ac47323984f4b3dfba97082b Mon Sep 17 00:00:00 2001 From: Leighton Chen Date: Thu, 9 Sep 2021 15:06:15 -0700 Subject: [PATCH 30/85] rpc (#20563) --- .../exporter/export/trace/_exporter.py | 8 +++--- .../tests/trace/test_trace.py | 25 ++++++++++++++++--- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/export/trace/_exporter.py b/sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/export/trace/_exporter.py index 4ddbb806877e..732fe0caa160 100644 --- a/sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/export/trace/_exporter.py +++ b/sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/export/trace/_exporter.py @@ -108,7 +108,7 @@ def _convert_span_to_envelope(span: Span) -> TelemetryItem: envelope.tags["ai.operation.id"] = "{:032x}".format(span.context.trace_id) if "enduser.id" in span.attributes: envelope.tags["ai.user.id"] = span.attributes["enduser.id"] - if span.parent: + if span.parent and span.parent.span_id: envelope.tags["ai.operation.parentId"] = "{:016x}".format( span.parent.span_id ) @@ -314,8 +314,7 @@ def _convert_span_to_envelope(span: Span) -> TelemetryItem: elif "rpc.system" in span.attributes: # Rpc data.type = "rpc.system" # TODO: data.data for rpc - # rpc specific logic for target - if "peer.service" not in span.attributes: + if target is None: target = span.attributes["rpc.system"] else: # TODO: Azure specific types @@ -325,7 +324,8 @@ def _convert_span_to_envelope(span: Span) -> TelemetryItem: # TODO: data.data for messaging # TODO: Special logic for data.target for messaging? else: # SpanKind.INTERNAL - data.type = "InProc" + if span.parent: + data.type = "InProc" data.success = True # Apply truncation if data.result_code: diff --git a/sdk/monitor/azure-monitor-opentelemetry-exporter/tests/trace/test_trace.py b/sdk/monitor/azure-monitor-opentelemetry-exporter/tests/trace/test_trace.py index f566ea1a2bf0..cf58f037345b 100644 --- a/sdk/monitor/azure-monitor-opentelemetry-exporter/tests/trace/test_trace.py +++ b/sdk/monitor/azure-monitor-opentelemetry-exporter/tests/trace/test_trace.py @@ -401,6 +401,7 @@ def test_span_to_envelope_client_rpc(self): is_remote=False, ), attributes={ + "peer.service": "service", "rpc.system": "rpc", "rpc.service": "Test service", }, @@ -422,7 +423,16 @@ def test_span_to_envelope_client_rpc(self): self.assertEqual(envelope.data.base_type, "RemoteDependencyData") self.assertEqual(envelope.data.base_data.type, "rpc.system") + self.assertEqual(envelope.data.base_data.target, "service") + + # target + span._attributes = { + "rpc.system": "rpc", + "rpc.service": "Test service", + } + envelope = exporter._span_to_envelope(span) self.assertEqual(envelope.data.base_data.target, "rpc") + # TODO: data.data # self.assertEqual(envelope.data.base_data.data, "SELECT") self.assertEqual(envelope.data.base_data.result_code, "1") @@ -475,13 +485,15 @@ def test_span_to_envelope_internal(self): end_time = start_time + 1001000000 # SpanKind.INTERNAL - span = trace._Span( - name="test", - context=SpanContext( + context = SpanContext( trace_id=36873507687745823477771305566750195431, span_id=12030755672171557337, is_remote=False, - ), + ) + span = trace._Span( + name="test", + context=context, + parent=context, attributes={}, kind=SpanKind.INTERNAL, ) @@ -503,6 +515,11 @@ def test_span_to_envelope_internal(self): self.assertEqual(envelope.data.base_data.type, "InProc") self.assertEqual(envelope.data.base_data.result_code, "1") + # type + span._parent = None + envelope = exporter._span_to_envelope(span) + self.assertIsNone(envelope.data.base_data.type) + def test_span_envelope_server_http(self): exporter = self._exporter start_time = 1575494316027613500 From 28bb6325ddf04184042a84b3cdf639c2f3141773 Mon Sep 17 00:00:00 2001 From: swathipil <76007337+swathipil@users.noreply.github.com> Date: Thu, 9 Sep 2021 15:35:48 -0700 Subject: [PATCH 31/85] [SchemaRegistry] update Avro version + changelog (#20624) fixes: #20606 --- .../azure-schemaregistry-avroserializer/CHANGELOG.md | 4 ++++ .../schemaregistry/serializer/avroserializer/_version.py | 2 +- sdk/schemaregistry/azure-schemaregistry/CHANGELOG.md | 8 ++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/sdk/schemaregistry/azure-schemaregistry-avroserializer/CHANGELOG.md b/sdk/schemaregistry/azure-schemaregistry-avroserializer/CHANGELOG.md index a8104e774b82..ce6d28a08c1d 100644 --- a/sdk/schemaregistry/azure-schemaregistry-avroserializer/CHANGELOG.md +++ b/sdk/schemaregistry/azure-schemaregistry-avroserializer/CHANGELOG.md @@ -8,6 +8,10 @@ ### Breaking Changes +- `schema_registry` parameter in the `SchemaRegistryAvroSerializer` constructor has been renamed `client`. +- `schema_group` parameter in the `SchemaRegistryAvroSerializer` constructor has been renamed `group_name`. +- `data` parameter in the `serialize` and `deserialize` methods on `SchemaRegistryAvroSerializer` has been renamed `value`. + ### Bugs Fixed ### Other Changes diff --git a/sdk/schemaregistry/azure-schemaregistry-avroserializer/azure/schemaregistry/serializer/avroserializer/_version.py b/sdk/schemaregistry/azure-schemaregistry-avroserializer/azure/schemaregistry/serializer/avroserializer/_version.py index 501378b2daf6..3b8ff2016920 100644 --- a/sdk/schemaregistry/azure-schemaregistry-avroserializer/azure/schemaregistry/serializer/avroserializer/_version.py +++ b/sdk/schemaregistry/azure-schemaregistry-avroserializer/azure/schemaregistry/serializer/avroserializer/_version.py @@ -24,4 +24,4 @@ # # -------------------------------------------------------------------------- -VERSION = "1.0.0b2" +VERSION = "1.0.0b3" diff --git a/sdk/schemaregistry/azure-schemaregistry/CHANGELOG.md b/sdk/schemaregistry/azure-schemaregistry/CHANGELOG.md index f3d75c24698f..8a35560abc10 100644 --- a/sdk/schemaregistry/azure-schemaregistry/CHANGELOG.md +++ b/sdk/schemaregistry/azure-schemaregistry/CHANGELOG.md @@ -6,6 +6,14 @@ ### Breaking Changes +- `get_schema_id` method on sync and async `SchemaRegistryClient` has been renamed `get_schema_properties`. +- `schema_id` parameter in `get_schema` method on sync and async `SchemaRegistryClient` has been renamed `id`. +- `register_schema` and `get_schema_properties` methods on sync and async `SchemaRegistryClient` now take in the following parameters in the given order: + - `group_name`, which has been renamed from `schema_group` + - `name`, which has been renamed from `schema_name` + - `content`, which has been renamed from `schema_content` + - `serialization_type` + ### Bugs Fixed ### Other Changes From 71871eb4d0516539be08da7dc6b970c0f7f83923 Mon Sep 17 00:00:00 2001 From: Rakshith Bhyravabhotla Date: Thu, 9 Sep 2021 15:41:35 -0700 Subject: [PATCH 32/85] Update CHANGELOG.md (#20631) --- sdk/monitor/azure-monitor-query/CHANGELOG.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sdk/monitor/azure-monitor-query/CHANGELOG.md b/sdk/monitor/azure-monitor-query/CHANGELOG.md index 1d6ca0ce60ec..8e847161dfb3 100644 --- a/sdk/monitor/azure-monitor-query/CHANGELOG.md +++ b/sdk/monitor/azure-monitor-query/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 1.0.0b4 (09-09-2021) +## 1.0.0b4 (2021-09-09) ### Features Added @@ -40,8 +40,6 @@ - `include_statistics` and `include_visualization` args can now work together. -### Other Changes - ## 1.0.0b3 (2021-08-09) ### Features Added From bd89c09fb2d9611f7a4c6023b069aa8f25406a5e Mon Sep 17 00:00:00 2001 From: luc <44377201+LuChen-Microsoft@users.noreply.github.com> Date: Thu, 9 Sep 2021 17:09:01 -0700 Subject: [PATCH 33/85] Update Communication Chat Swagger & Tests Record (#20578) * update swagger * update changelog --- .../azure-communication-chat/CHANGELOG.md | 3 + .../chat/_generated/_configuration.py | 2 +- .../chat/_generated/aio/_configuration.py | 2 +- .../aio/operations/_chat_operations.py | 6 +- .../aio/operations/_chat_thread_operations.py | 26 +- .../_generated/operations/_chat_operations.py | 6 +- .../operations/_chat_thread_operations.py | 26 +- .../swagger/SWAGGER.md | 4 +- ...ient_e2e.test_access_token_validation.yaml | 89 ++-- ...at_client_e2e.test_create_chat_thread.yaml | 79 ++-- ..._create_chat_thread_w_no_participants.yaml | 77 ++-- ...hat_thread_w_repeatability_request_id.yaml | 101 ++--- ...at_client_e2e.test_delete_chat_thread.yaml | 89 ++-- ...hat_client_e2e.test_get_thread_client.yaml | 77 ++-- ...hat_client_e2e.test_list_chat_threads.yaml | 91 +++-- ...e_async.test_create_chat_thread_async.yaml | 81 ++-- ...e_chat_thread_w_no_participants_async.yaml | 81 ++-- ...read_w_repeatability_request_id_async.yaml | 105 ++--- ...ent_e2e_async.test_delete_chat_thread.yaml | 95 ++--- ...ient_e2e_async.test_get_thread_client.yaml | 81 ++-- ...ient_e2e_async.test_list_chat_threads.yaml | 95 ++--- ...read_client_e2e.test_add_participants.yaml | 134 +++--- ...thread_client_e2e.test_delete_message.yaml | 146 +++---- ...at_thread_client_e2e.test_get_message.yaml | 150 +++---- ...thread_client_e2e.test_get_properties.yaml | 138 ++++--- ..._thread_client_e2e.test_list_messages.yaml | 180 ++++---- ...ead_client_e2e.test_list_participants.yaml | 144 +++---- ...ad_client_e2e.test_list_read_receipts.yaml | 240 +++++------ ...ad_client_e2e.test_remove_participant.yaml | 148 +++---- ...t_thread_client_e2e.test_send_message.yaml | 132 +++--- ...ead_client_e2e.test_send_read_receipt.yaml | 144 +++---- ...ent_e2e.test_send_typing_notification.yaml | 141 ++++--- ...typing_notification_with_display_name.yaml | 386 ++++++++++++++++++ ...thread_client_e2e.test_update_message.yaml | 144 +++---- ...t_thread_client_e2e.test_update_topic.yaml | 132 +++--- ...lient_e2e_async.test_add_participants.yaml | 140 ++++--- ..._client_e2e_async.test_delete_message.yaml | 152 +++---- ...ead_client_e2e_async.test_get_message.yaml | 158 +++---- ..._client_e2e_async.test_get_properties.yaml | 144 +++---- ...d_client_e2e_async.test_list_messages.yaml | 194 ++++----- ...ient_e2e_async.test_list_participants.yaml | 152 +++---- ...ent_e2e_async.test_list_read_receipts.yaml | 264 ++++++------ ...ent_e2e_async.test_remove_participant.yaml | 156 +++---- ...ad_client_e2e_async.test_send_message.yaml | 140 ++++--- ...ient_e2e_async.test_send_read_receipt.yaml | 152 +++---- ...e_async.test_send_typing_notification.yaml | 145 ++++--- ...notification_with_sender_display_name.yaml | 354 ++++++++++++++++ ..._client_e2e_async.test_update_message.yaml | 152 +++---- ...ad_client_e2e_async.test_update_topic.yaml | 136 +++--- 49 files changed, 3478 insertions(+), 2536 deletions(-) create mode 100644 sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_send_typing_notification_with_display_name.yaml create mode 100644 sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_send_typing_notification_with_sender_display_name.yaml diff --git a/sdk/communication/azure-communication-chat/CHANGELOG.md b/sdk/communication/azure-communication-chat/CHANGELOG.md index 2f1929d0acc9..5d6e923f9b5a 100644 --- a/sdk/communication/azure-communication-chat/CHANGELOG.md +++ b/sdk/communication/azure-communication-chat/CHANGELOG.md @@ -1,5 +1,8 @@ # Release History +## 1.1.0 (Unreleased) +- Updated `azure-communication-chat` version. + ## 1.1.0b1 (2021-08-16) ### Added diff --git a/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/_configuration.py b/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/_configuration.py index 9ab172fca1ef..5b58f12b9f2e 100644 --- a/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/_configuration.py +++ b/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/_configuration.py @@ -38,7 +38,7 @@ def __init__( super(AzureCommunicationChatServiceConfiguration, self).__init__(**kwargs) self.endpoint = endpoint - self.api_version = "2021-04-05-preview6" + self.api_version = "2021-09-07" kwargs.setdefault('sdk_moniker', 'azurecommunicationchatservice/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/aio/_configuration.py b/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/aio/_configuration.py index 5b16d25053d0..00cb6d19b824 100644 --- a/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/aio/_configuration.py +++ b/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/aio/_configuration.py @@ -33,7 +33,7 @@ def __init__( super(AzureCommunicationChatServiceConfiguration, self).__init__(**kwargs) self.endpoint = endpoint - self.api_version = "2021-04-05-preview6" + self.api_version = "2021-09-07" kwargs.setdefault('sdk_moniker', 'azurecommunicationchatservice/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/aio/operations/_chat_operations.py b/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/aio/operations/_chat_operations.py index 54143070f4ee..0295ca765368 100644 --- a/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/aio/operations/_chat_operations.py +++ b/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/aio/operations/_chat_operations.py @@ -75,7 +75,7 @@ async def create_chat_thread( 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-05-preview6" + api_version = "2021-09-07" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -146,7 +146,7 @@ def list_chat_threads( 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-05-preview6" + api_version = "2021-09-07" accept = "application/json" def prepare_request(next_link=None): @@ -230,7 +230,7 @@ async def delete_chat_thread( 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-05-preview6" + api_version = "2021-09-07" accept = "application/json" # Construct URL diff --git a/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/aio/operations/_chat_thread_operations.py b/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/aio/operations/_chat_thread_operations.py index 814a44e30add..c045d32f074c 100644 --- a/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/aio/operations/_chat_thread_operations.py +++ b/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/aio/operations/_chat_thread_operations.py @@ -73,7 +73,7 @@ def list_chat_read_receipts( 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-05-preview6" + api_version = "2021-09-07" accept = "application/json" def prepare_request(next_link=None): @@ -162,7 +162,7 @@ async def send_chat_read_receipt( 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-05-preview6" + api_version = "2021-09-07" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -228,7 +228,7 @@ async def send_chat_message( 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-05-preview6" + api_version = "2021-09-07" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -301,7 +301,7 @@ def list_chat_messages( 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-05-preview6" + api_version = "2021-09-07" accept = "application/json" def prepare_request(next_link=None): @@ -390,7 +390,7 @@ async def get_chat_message( 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-05-preview6" + api_version = "2021-09-07" accept = "application/json" # Construct URL @@ -458,7 +458,7 @@ async def update_chat_message( 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-05-preview6" + api_version = "2021-09-07" content_type = kwargs.pop("content_type", "application/merge-patch+json") accept = "application/json" @@ -525,7 +525,7 @@ async def delete_chat_message( 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-05-preview6" + api_version = "2021-09-07" accept = "application/json" # Construct URL @@ -590,7 +590,7 @@ def list_chat_participants( 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-05-preview6" + api_version = "2021-09-07" accept = "application/json" def prepare_request(next_link=None): @@ -680,7 +680,7 @@ async def remove_chat_participant( 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-05-preview6" + api_version = "2021-09-07" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -746,7 +746,7 @@ async def add_chat_participants( 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-05-preview6" + api_version = "2021-09-07" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -815,7 +815,7 @@ async def update_chat_thread_properties( 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-05-preview6" + api_version = "2021-09-07" content_type = kwargs.pop("content_type", "application/merge-patch+json") accept = "application/json" @@ -878,7 +878,7 @@ async def get_chat_thread_properties( 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-05-preview6" + api_version = "2021-09-07" accept = "application/json" # Construct URL @@ -942,7 +942,7 @@ async def send_typing_notification( 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-05-preview6" + api_version = "2021-09-07" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" diff --git a/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/operations/_chat_operations.py b/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/operations/_chat_operations.py index 2a56d3af58c2..915d1dbfa95a 100644 --- a/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/operations/_chat_operations.py +++ b/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/operations/_chat_operations.py @@ -80,7 +80,7 @@ def create_chat_thread( 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-05-preview6" + api_version = "2021-09-07" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -152,7 +152,7 @@ def list_chat_threads( 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-05-preview6" + api_version = "2021-09-07" accept = "application/json" def prepare_request(next_link=None): @@ -237,7 +237,7 @@ def delete_chat_thread( 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-05-preview6" + api_version = "2021-09-07" accept = "application/json" # Construct URL diff --git a/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/operations/_chat_thread_operations.py b/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/operations/_chat_thread_operations.py index 7b77cc0f72fe..a9e049d59f73 100644 --- a/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/operations/_chat_thread_operations.py +++ b/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/operations/_chat_thread_operations.py @@ -78,7 +78,7 @@ def list_chat_read_receipts( 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-05-preview6" + api_version = "2021-09-07" accept = "application/json" def prepare_request(next_link=None): @@ -168,7 +168,7 @@ def send_chat_read_receipt( 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-05-preview6" + api_version = "2021-09-07" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -235,7 +235,7 @@ def send_chat_message( 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-05-preview6" + api_version = "2021-09-07" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -309,7 +309,7 @@ def list_chat_messages( 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-05-preview6" + api_version = "2021-09-07" accept = "application/json" def prepare_request(next_link=None): @@ -399,7 +399,7 @@ def get_chat_message( 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-05-preview6" + api_version = "2021-09-07" accept = "application/json" # Construct URL @@ -468,7 +468,7 @@ def update_chat_message( 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-05-preview6" + api_version = "2021-09-07" content_type = kwargs.pop("content_type", "application/merge-patch+json") accept = "application/json" @@ -536,7 +536,7 @@ def delete_chat_message( 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-05-preview6" + api_version = "2021-09-07" accept = "application/json" # Construct URL @@ -602,7 +602,7 @@ def list_chat_participants( 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-05-preview6" + api_version = "2021-09-07" accept = "application/json" def prepare_request(next_link=None): @@ -693,7 +693,7 @@ def remove_chat_participant( 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-05-preview6" + api_version = "2021-09-07" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -760,7 +760,7 @@ def add_chat_participants( 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-05-preview6" + api_version = "2021-09-07" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -830,7 +830,7 @@ def update_chat_thread_properties( 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-05-preview6" + api_version = "2021-09-07" content_type = kwargs.pop("content_type", "application/merge-patch+json") accept = "application/json" @@ -894,7 +894,7 @@ def get_chat_thread_properties( 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-05-preview6" + api_version = "2021-09-07" accept = "application/json" # Construct URL @@ -959,7 +959,7 @@ def send_typing_notification( 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-05-preview6" + api_version = "2021-09-07" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" diff --git a/sdk/communication/azure-communication-chat/swagger/SWAGGER.md b/sdk/communication/azure-communication-chat/swagger/SWAGGER.md index 93bd9b1b1af7..5631017f096c 100644 --- a/sdk/communication/azure-communication-chat/swagger/SWAGGER.md +++ b/sdk/communication/azure-communication-chat/swagger/SWAGGER.md @@ -16,8 +16,8 @@ autorest SWAGGER.md ### Settings ```yaml -tag: package-chat-2021-04-05-preview6 -require: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/29e0c9624a8e60138127457f2e863bb4a9ba1419/specification/communication/data-plane/Chat/readme.md +tag: package-chat-2021-09-07 +require: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/communication/data-plane/Chat/readme.md output-folder: ../azure/communication/chat/_generated namespace: azure.communication.chat no-namespace-folders: true diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e.test_access_token_validation.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e.test_access_token_validation.yaml index fcf7d1f38d4c..b4ffe8225b26 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e.test_access_token_validation.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e.test_access_token_validation.yaml @@ -13,24 +13,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:51:50 GMT + - Tue, 07 Sep 2021 21:43:01 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d55f-fdf3-f6c7-593a0d009fe2"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6218-8504-7bfa-553a0d0010a4"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:51:50 GMT + - Tue, 07 Sep 2021 21:43:01 GMT ms-cv: - - vSCUJP34TE698k75/G+nGQ.0 + - EEyir0Oeuk2E/SWL6Sy9HA.0 request-context: - appId= strict-transport-security: @@ -40,7 +41,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 49ms + - 121ms status: code: 201 message: Created @@ -58,24 +59,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:51:50 GMT + - Tue, 07 Sep 2021 21:43:01 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:51:50.0857826+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:43:02.0016613+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:51:50 GMT + - Tue, 07 Sep 2021 21:43:01 GMT ms-cv: - - cAHNVCW16kaXydTs9QHoPA.0 + - vI2OnGcapE2ATorqYlmDCQ.0 request-context: - appId= strict-transport-security: @@ -85,7 +87,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 65ms + - 179ms status: code: 200 message: OK @@ -103,26 +105,26 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) repeatability-request-id: - - fa6291de-4be7-4a5d-9269-277457040344 + - 182ad6e5-b600-4134-9e31-5bf8cee9a77c method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 response: - body: '{"chatThread": {"id": "19:0OpwXD84zHNn-hB5SAUm4xePrMNmulZ33M6QIOQKNdU1@thread.v2", - "topic": "test topic1", "createdOn": "2021-06-22T20:51:51Z", "createdByCommunicationIdentifier": - {"rawId": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d55f-fdf3-f6c7-593a0d009fe2", - "communicationUser": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d55f-fdf3-f6c7-593a0d009fe2"}}}}' + body: '{"chatThread": {"id": "19:4kfJhmwIOhuI7iZ-xpWn3DmjZjUZdCy58v2gIWanJpU1@thread.v2", + "topic": "test topic1", "createdOn": "2021-09-07T21:43:02Z", "createdByCommunicationIdentifier": + {"rawId": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6218-8504-7bfa-553a0d0010a4", + "communicationUser": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6218-8504-7bfa-553a0d0010a4"}}}}' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:51:52 GMT + - Tue, 07 Sep 2021 21:43:02 GMT ms-cv: - - +0LZ8diz9UmrKxeDG80Jnw.0 + - nBycMBOo3EyHkrnEtPJbAQ.0 strict-transport-security: - max-age=2592000 transfer-encoding: @@ -130,7 +132,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 958ms + - 926ms status: code: 201 message: Created @@ -144,21 +146,21 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: GET - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 response: body: '{"value": "sanitized"}' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:51:52 GMT + - Tue, 07 Sep 2021 21:43:02 GMT ms-cv: - - Ppc2hEf7IE2e1hwxmRJAkg.0 + - Kla+s01Uw0S/lhE//wkvUg.0 strict-transport-security: - max-age=2592000 transfer-encoding: @@ -166,7 +168,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 83ms + - 228ms status: code: 200 message: OK @@ -182,26 +184,26 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 response: body: string: '' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 date: - - Tue, 22 Jun 2021 20:51:52 GMT + - Tue, 07 Sep 2021 21:43:03 GMT ms-cv: - - fOJFQH20WkCsu48gFB3gTg.0 + - +lizt9/h4UKdOEKhEl3h0A.0 strict-transport-security: - max-age=2592000 x-cache: - CONFIG_NOCACHE x-processing-time: - - 281ms + - 429ms status: code: 204 message: No Content @@ -217,9 +219,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:51:53 GMT + - Tue, 07 Sep 2021 21:43:04 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -229,11 +231,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:51:53 GMT + - Tue, 07 Sep 2021 21:43:04 GMT ms-cv: - - yB9hp9ZolUu13FJoHHgR0w.0 + - 2kTyoCrl3k2DeAlxZmxZKw.0 request-context: - appId= strict-transport-security: @@ -241,7 +244,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 497ms + - 560ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e.test_create_chat_thread.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e.test_create_chat_thread.yaml index 1eaf939f6d2b..71cbdd631fa0 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e.test_create_chat_thread.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e.test_create_chat_thread.yaml @@ -13,24 +13,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:51:53 GMT + - Tue, 07 Sep 2021 21:43:04 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d560-0a75-ceb1-a43a0d00bdeb"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6218-923c-f3f5-343a0d001717"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:51:53 GMT + - Tue, 07 Sep 2021 21:43:04 GMT ms-cv: - - f4bZLHwBdECjuyyImBosHQ.0 + - otNiiJv1V06MACEI+YY2Eg.0 request-context: - appId= strict-transport-security: @@ -40,7 +41,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 69ms + - 26ms status: code: 201 message: Created @@ -58,24 +59,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:51:54 GMT + - Tue, 07 Sep 2021 21:43:05 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:51:53.3896803+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:43:05.1238691+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:51:54 GMT + - Tue, 07 Sep 2021 21:43:04 GMT ms-cv: - - GGUPhGRaNUCkR38QUSVFGA.0 + - FzeDyd7ytU2FBbz75SOjjQ.0 request-context: - appId= strict-transport-security: @@ -85,7 +87,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 137ms + - 34ms status: code: 200 message: OK @@ -99,30 +101,30 @@ interactions: Connection: - keep-alive Content-Length: - - '349' + - '350' Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) repeatability-request-id: - - c6bc96ed-cd7d-4809-bb2f-1b9278681d01 + - a220b600-3bdb-42e2-b920-943fc5a1ea39 method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 response: - body: '{"chatThread": {"id": "19:LM_q8olIzgltuHK6uNMVuo4u7FH0NaJO_HPHSFfMuIk1@thread.v2", - "topic": "test topic", "createdOn": "2021-06-22T20:51:54Z", "createdByCommunicationIdentifier": - {"rawId": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d560-0a75-ceb1-a43a0d00bdeb", - "communicationUser": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d560-0a75-ceb1-a43a0d00bdeb"}}}}' + body: '{"chatThread": {"id": "19:GMpqsxOPrT4wKh7Xuheu47OzosSzzQkVzHwj9ZKh2rA1@thread.v2", + "topic": "test topic", "createdOn": "2021-09-07T21:43:05Z", "createdByCommunicationIdentifier": + {"rawId": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6218-923c-f3f5-343a0d001717", + "communicationUser": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6218-923c-f3f5-343a0d001717"}}}}' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:51:55 GMT + - Tue, 07 Sep 2021 21:43:06 GMT ms-cv: - - ewF6qFpHKEikQywJ1GSbDA.0 + - QfrKCE1CGkuW8crJoqrWtw.0 strict-transport-security: - max-age=2592000 transfer-encoding: @@ -130,7 +132,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 508ms + - 675ms status: code: 201 message: Created @@ -146,26 +148,26 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 response: body: string: '' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 date: - - Tue, 22 Jun 2021 20:51:55 GMT + - Tue, 07 Sep 2021 21:43:06 GMT ms-cv: - - 1bYLG1U8+UuXKdfWHMC3xQ.0 + - /unInCiv8Uq6tilz+4iNew.0 strict-transport-security: - max-age=2592000 x-cache: - CONFIG_NOCACHE x-processing-time: - - 108ms + - 123ms status: code: 204 message: No Content @@ -181,9 +183,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:51:55 GMT + - Tue, 07 Sep 2021 21:43:06 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -193,11 +195,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:51:55 GMT + - Tue, 07 Sep 2021 21:43:06 GMT ms-cv: - - 2lggGcjKFEKHSRPaC+Tdtg.0 + - TqvZZD6LH0GF46hmOZOT/A.0 request-context: - appId= strict-transport-security: @@ -205,7 +208,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 685ms + - 825ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e.test_create_chat_thread_w_no_participants.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e.test_create_chat_thread_w_no_participants.yaml index fa647e635369..c1cda9346964 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e.test_create_chat_thread_w_no_participants.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e.test_create_chat_thread_w_no_participants.yaml @@ -13,24 +13,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:51:56 GMT + - Tue, 07 Sep 2021 21:43:07 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d560-1534-9806-113a0d002a51"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6218-9c51-d6d4-4448220013c7"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:51:56 GMT + - Tue, 07 Sep 2021 21:43:07 GMT ms-cv: - - KZYlls6Ju0uv3K93fXVuBA.0 + - 6MbgJyigoUSSq9+Yj55h8Q.0 request-context: - appId= strict-transport-security: @@ -40,7 +41,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 123ms + - 64ms status: code: 201 message: Created @@ -58,24 +59,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:51:57 GMT + - Tue, 07 Sep 2021 21:43:07 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:51:56.2488809+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:43:07.8575754+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:51:57 GMT + - Tue, 07 Sep 2021 21:43:07 GMT ms-cv: - - dPgBczYazEKv4sjiHqB9Gw.0 + - Zah6mwoal0OcJAU236kcEg.0 request-context: - appId= strict-transport-security: @@ -85,7 +87,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 165ms + - 133ms status: code: 200 message: OK @@ -103,26 +105,26 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) repeatability-request-id: - - 0587da26-8d1a-4b03-ade7-f702310b3e17 + - ebe93b04-9efa-4e23-bace-fdefdaa94f1a method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 response: - body: '{"chatThread": {"id": "19:EyT1M86f22dSYWHcXYA5QmKJ-EVOiXZ5TrkGPn0N1HY1@thread.v2", - "topic": "test topic", "createdOn": "2021-06-22T20:51:57Z", "createdByCommunicationIdentifier": - {"rawId": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d560-1534-9806-113a0d002a51", - "communicationUser": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d560-1534-9806-113a0d002a51"}}}}' + body: '{"chatThread": {"id": "19:KXkU_O83ZDXigWUXXD9jGalYO4VXCDNUUHWV2p_dzao1@thread.v2", + "topic": "test topic", "createdOn": "2021-09-07T21:43:08Z", "createdByCommunicationIdentifier": + {"rawId": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6218-9c51-d6d4-4448220013c7", + "communicationUser": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6218-9c51-d6d4-4448220013c7"}}}}' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:51:57 GMT + - Tue, 07 Sep 2021 21:43:08 GMT ms-cv: - - k0JPeei4/kykVHAe4VoHrQ.0 + - m1g41vyupkOkO/XbU/V4iw.0 strict-transport-security: - max-age=2592000 transfer-encoding: @@ -130,7 +132,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 725ms + - 837ms status: code: 201 message: Created @@ -146,26 +148,26 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 response: body: string: '' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 date: - - Tue, 22 Jun 2021 20:51:58 GMT + - Tue, 07 Sep 2021 21:43:08 GMT ms-cv: - - L2klub7EVU2txmVdZFb2pw.0 + - FRM3qr1bIE+FTpwveyJulw.0 strict-transport-security: - max-age=2592000 x-cache: - CONFIG_NOCACHE x-processing-time: - - 169ms + - 272ms status: code: 204 message: No Content @@ -181,9 +183,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:51:58 GMT + - Tue, 07 Sep 2021 21:43:09 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -193,11 +195,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:51:59 GMT + - Tue, 07 Sep 2021 21:43:09 GMT ms-cv: - - KeGcNL0Fh0ebitakfwUzAQ.0 + - ZS3inrsf50GyJOp+/lO6ow.0 request-context: - appId= strict-transport-security: @@ -205,7 +208,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 789ms + - 383ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e.test_create_chat_thread_w_repeatability_request_id.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e.test_create_chat_thread_w_repeatability_request_id.yaml index 120f929b1131..123d8df4f080 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e.test_create_chat_thread_w_repeatability_request_id.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e.test_create_chat_thread_w_repeatability_request_id.yaml @@ -13,24 +13,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:51:59 GMT + - Tue, 07 Sep 2021 21:43:09 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d560-2139-28c5-593a0d001bbf"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6218-a6be-ac00-343a0d000c83"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:51:59 GMT + - Tue, 07 Sep 2021 21:43:09 GMT ms-cv: - - HZFqLa4hkUyGMVEld3KdVA.0 + - 2ZbnCi2z/UCrT8qAOpRVKw.0 request-context: - appId= strict-transport-security: @@ -40,7 +41,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 51ms + - 53ms status: code: 201 message: Created @@ -58,24 +59,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:51:59 GMT + - Tue, 07 Sep 2021 21:43:10 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:51:59.096303+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:43:10.4041757+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:51:59 GMT + - Tue, 07 Sep 2021 21:43:09 GMT ms-cv: - - hZ+lbd0rsUmh4681jrgnYg.0 + - nLvqD7MAI0Ss+mnDi6vTYQ.0 request-context: - appId= strict-transport-security: @@ -85,7 +87,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 65ms + - 68ms status: code: 200 message: OK @@ -99,30 +101,30 @@ interactions: Connection: - keep-alive Content-Length: - - '349' + - '350' Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) repeatability-request-id: - - 9853473b-2e19-48a9-9e01-7213d5a48b17 + - 1ed3c914-fc25-48bd-8030-1e0bc3d06bfd method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 response: - body: '{"chatThread": {"id": "19:baoPhoV0MBRwCFaTw9B6KTXk9IPD6BdiXpmtgzOiZMU1@thread.v2", - "topic": "test topic", "createdOn": "2021-06-22T20:52:00Z", "createdByCommunicationIdentifier": - {"rawId": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d560-2139-28c5-593a0d001bbf", - "communicationUser": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d560-2139-28c5-593a0d001bbf"}}}}' + body: '{"chatThread": {"id": "19:Kw0hYC58kHK_nXHg8RMl3x0VTIyR3xQaxcBA_xE4vO41@thread.v2", + "topic": "test topic", "createdOn": "2021-09-07T21:43:10Z", "createdByCommunicationIdentifier": + {"rawId": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6218-a6be-ac00-343a0d000c83", + "communicationUser": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6218-a6be-ac00-343a0d000c83"}}}}' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:52:00 GMT + - Tue, 07 Sep 2021 21:43:10 GMT ms-cv: - - kGbFzY/Kk0ytZH55SddRAg.0 + - PyYHvmo9bEuXxqofv1IRpA.0 strict-transport-security: - max-age=2592000 transfer-encoding: @@ -130,7 +132,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 417ms + - 682ms status: code: 201 message: Created @@ -148,26 +150,26 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) repeatability-request-id: - - 9853473b-2e19-48a9-9e01-7213d5a48b17 + - 1ed3c914-fc25-48bd-8030-1e0bc3d06bfd method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 response: - body: '{"chatThread": {"id": "19:baoPhoV0MBRwCFaTw9B6KTXk9IPD6BdiXpmtgzOiZMU1@thread.v2", - "topic": "test topic", "createdOn": "2021-06-22T20:52:00Z", "createdByCommunicationIdentifier": - {"rawId": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d560-2139-28c5-593a0d001bbf", - "communicationUser": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d560-2139-28c5-593a0d001bbf"}}}}' + body: '{"chatThread": {"id": "19:Kw0hYC58kHK_nXHg8RMl3x0VTIyR3xQaxcBA_xE4vO41@thread.v2", + "topic": "test topic", "createdOn": "2021-09-07T21:43:10Z", "createdByCommunicationIdentifier": + {"rawId": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6218-a6be-ac00-343a0d000c83", + "communicationUser": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6218-a6be-ac00-343a0d000c83"}}}}' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:52:00 GMT + - Tue, 07 Sep 2021 21:43:15 GMT ms-cv: - - uD0G+0wiIUWTNMOyZ0YwMA.0 + - yJi1GKQE4kWHooIIxg1jvg.0 strict-transport-security: - max-age=2592000 transfer-encoding: @@ -175,7 +177,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 324ms + - 4850ms status: code: 201 message: Created @@ -191,26 +193,26 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 response: body: string: '' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 date: - - Tue, 22 Jun 2021 20:52:00 GMT + - Tue, 07 Sep 2021 21:43:15 GMT ms-cv: - - EOkx3+UMpUiLV24IbB04lg.0 + - Jy6MKVhCzUCTUR6GPMqKAA.0 strict-transport-security: - max-age=2592000 x-cache: - CONFIG_NOCACHE x-processing-time: - - 156ms + - 137ms status: code: 204 message: No Content @@ -226,9 +228,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:52:01 GMT + - Tue, 07 Sep 2021 21:43:16 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -238,11 +240,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:52:01 GMT + - Tue, 07 Sep 2021 21:43:16 GMT ms-cv: - - 4ibqaJ1kXE29KWKliFiPoQ.0 + - ZAZr0nbff0qf0AXr5CkfmQ.0 request-context: - appId= strict-transport-security: @@ -250,7 +253,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 849ms + - 562ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e.test_delete_chat_thread.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e.test_delete_chat_thread.yaml index 7e547b20ff4c..6e79b0029475 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e.test_delete_chat_thread.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e.test_delete_chat_thread.yaml @@ -13,24 +13,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:52:02 GMT + - Tue, 07 Sep 2021 21:43:17 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d560-2ca4-ceb1-a43a0d00bdf0"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6218-c1c1-f3f5-343a0d001718"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:52:02 GMT + - Tue, 07 Sep 2021 21:43:16 GMT ms-cv: - - LCJeZi2K80KbwaRWe9X53w.0 + - wdC4RYYzm0qXNr2A5c5nPQ.0 request-context: - appId= strict-transport-security: @@ -40,7 +41,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 69ms + - 26ms status: code: 201 message: Created @@ -58,24 +59,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:52:02 GMT + - Tue, 07 Sep 2021 21:43:17 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:52:02.1225636+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:43:17.2759219+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:52:02 GMT + - Tue, 07 Sep 2021 21:43:16 GMT ms-cv: - - k6lr9tU5H0mMyqWL4OzpHg.0 + - LafnLaz3R0+txjT3ixlbJg.0 request-context: - appId= strict-transport-security: @@ -85,7 +87,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 134ms + - 32ms status: code: 200 message: OK @@ -103,26 +105,26 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) repeatability-request-id: - - 86c48417-b6bc-4cd0-b961-dea8ef0c8b0f + - de3b1130-d2f1-414a-945d-fcee06a03c94 method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 response: - body: '{"chatThread": {"id": "19:tdfwwXihXDa8rsRse8l9B9hzKwqjOdap_gAcdLfikGI1@thread.v2", - "topic": "test topic", "createdOn": "2021-06-22T20:52:03Z", "createdByCommunicationIdentifier": - {"rawId": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d560-2ca4-ceb1-a43a0d00bdf0", - "communicationUser": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d560-2ca4-ceb1-a43a0d00bdf0"}}}}' + body: '{"chatThread": {"id": "19:fprPH94VnygtLgUgGN1GSzH6nn0dcm1G0rnKqy63_WE1@thread.v2", + "topic": "test topic", "createdOn": "2021-09-07T21:43:17Z", "createdByCommunicationIdentifier": + {"rawId": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6218-c1c1-f3f5-343a0d001718", + "communicationUser": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6218-c1c1-f3f5-343a0d001718"}}}}' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:52:03 GMT + - Tue, 07 Sep 2021 21:43:17 GMT ms-cv: - - eX/cox2sDEWqdZ2KfjE5ZQ.0 + - 9VwfcMvGw0qaTm9pkXnehQ.0 strict-transport-security: - max-age=2592000 transfer-encoding: @@ -130,7 +132,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 644ms + - 691ms status: code: 201 message: Created @@ -146,26 +148,26 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 response: body: string: '' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 date: - - Tue, 22 Jun 2021 20:52:03 GMT + - Tue, 07 Sep 2021 21:43:18 GMT ms-cv: - - d00+LMTFpUGitUriihYSJQ.0 + - ljKxWAiEP0O9ykHI2Hq7eg.0 strict-transport-security: - max-age=2592000 x-cache: - CONFIG_NOCACHE x-processing-time: - - 194ms + - 466ms status: code: 204 message: No Content @@ -181,26 +183,26 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 response: body: string: '' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 date: - - Tue, 22 Jun 2021 20:52:04 GMT + - Tue, 07 Sep 2021 21:43:18 GMT ms-cv: - - GPC1/PSvBE2rK0syf8hL6A.0 + - D+pzaTsX20qZ2EJ2vuKouw.0 strict-transport-security: - max-age=2592000 x-cache: - CONFIG_NOCACHE x-processing-time: - - 108ms + - 92ms status: code: 204 message: No Content @@ -216,9 +218,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:52:04 GMT + - Tue, 07 Sep 2021 21:43:18 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -228,11 +230,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:52:05 GMT + - Tue, 07 Sep 2021 21:43:18 GMT ms-cv: - - 6H/JZr2bRkCZemzgoxAUwQ.0 + - f2Ty2cJZpUKtvFDlpmc2tQ.0 request-context: - appId= strict-transport-security: @@ -240,7 +243,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 778ms + - 469ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e.test_get_thread_client.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e.test_get_thread_client.yaml index fbdd58d17623..a1b9c125381d 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e.test_get_thread_client.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e.test_get_thread_client.yaml @@ -13,24 +13,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:52:05 GMT + - Tue, 07 Sep 2021 21:43:19 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d560-393c-71bf-a43a0d00bb84"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6218-cb7b-23fd-343a0d002161"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:52:05 GMT + - Tue, 07 Sep 2021 21:43:19 GMT ms-cv: - - YDWH0ukBjU2aYAUz/jD7Pw.0 + - jtkXi+T//02Ciqvtw/tl7w.0 request-context: - appId= strict-transport-security: @@ -40,7 +41,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 101ms + - 55ms status: code: 201 message: Created @@ -58,24 +59,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:52:06 GMT + - Tue, 07 Sep 2021 21:43:19 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:52:05.3848576+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:43:19.7855196+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:52:05 GMT + - Tue, 07 Sep 2021 21:43:19 GMT ms-cv: - - ZLU/DNyJfUGKjlLVbVIo0Q.0 + - FrMs6N14wUS88PlQtYblCA.0 request-context: - appId= strict-transport-security: @@ -85,7 +87,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 167ms + - 46ms status: code: 200 message: OK @@ -103,26 +105,26 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) repeatability-request-id: - - 1f86cf03-f998-4b6a-9d80-eb795b4d78c0 + - fc665ffa-5ca7-4f81-b678-f85310ee81c9 method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 response: - body: '{"chatThread": {"id": "19:V41iISKlCQRg67Jwb7-K1BSJBq-bxYb2dARsXNarYS41@thread.v2", - "topic": "test topic", "createdOn": "2021-06-22T20:52:06Z", "createdByCommunicationIdentifier": - {"rawId": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d560-393c-71bf-a43a0d00bb84", - "communicationUser": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d560-393c-71bf-a43a0d00bb84"}}}}' + body: '{"chatThread": {"id": "19:Nj27i4RBQX2xWU7Zr1GZnmquzlpaCU5TJEd80cE8hQo1@thread.v2", + "topic": "test topic", "createdOn": "2021-09-07T21:43:20Z", "createdByCommunicationIdentifier": + {"rawId": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6218-cb7b-23fd-343a0d002161", + "communicationUser": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6218-cb7b-23fd-343a0d002161"}}}}' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:52:06 GMT + - Tue, 07 Sep 2021 21:43:20 GMT ms-cv: - - AJhAjaimzE2MvIIdIMf3Tg.0 + - F2/lfhmkwEa32nn2kQ6Kvw.0 strict-transport-security: - max-age=2592000 transfer-encoding: @@ -130,7 +132,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 573ms + - 883ms status: code: 201 message: Created @@ -146,26 +148,26 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 response: body: string: '' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 date: - - Tue, 22 Jun 2021 20:52:06 GMT + - Tue, 07 Sep 2021 21:43:20 GMT ms-cv: - - i+4bX327DEeBUOIFU2jUqg.0 + - ugvXhWAF5UO4QaNhYOOWzQ.0 strict-transport-security: - max-age=2592000 x-cache: - CONFIG_NOCACHE x-processing-time: - - 158ms + - 130ms status: code: 204 message: No Content @@ -181,9 +183,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:52:07 GMT + - Tue, 07 Sep 2021 21:43:21 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -193,11 +195,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:52:09 GMT + - Tue, 07 Sep 2021 21:43:21 GMT ms-cv: - - V0Q6d9eupkiPq53LK9K21g.0 + - 9rMpnwYiOUCNx6kLQQkThw.0 request-context: - appId= strict-transport-security: @@ -205,7 +208,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 2023ms + - 640ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e.test_list_chat_threads.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e.test_list_chat_threads.yaml index 3c53831c4e1a..0c81eb07f665 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e.test_list_chat_threads.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e.test_list_chat_threads.yaml @@ -13,24 +13,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:52:09 GMT + - Tue, 07 Sep 2021 21:43:21 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d560-4924-ceb1-a43a0d00bdf1"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6218-d63e-657a-254822005377"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:52:09 GMT + - Tue, 07 Sep 2021 21:43:22 GMT ms-cv: - - W70fntTim0iRoBmVnHyZPQ.0 + - 9GU8qSviHEm529wkfnr4oQ.0 request-context: - appId= strict-transport-security: @@ -40,7 +41,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 62ms + - 105ms status: code: 201 message: Created @@ -58,24 +59,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:52:10 GMT + - Tue, 07 Sep 2021 21:43:22 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:52:09.4380765+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:43:22.7859682+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:52:09 GMT + - Tue, 07 Sep 2021 21:43:22 GMT ms-cv: - - jM6nJq4WUUKkpZo9ye/2Hw.0 + - +xWTfHw4l0+LErEgBRWOww.0 request-context: - appId= strict-transport-security: @@ -85,7 +87,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 130ms + - 153ms status: code: 200 message: OK @@ -99,30 +101,30 @@ interactions: Connection: - keep-alive Content-Length: - - '350' + - '349' Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) repeatability-request-id: - - a9a8c11d-0ceb-4bd5-9763-a2acad21bf21 + - 26a67d04-e0b3-41fa-94a4-46d5f158b3e1 method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 response: - body: '{"chatThread": {"id": "19:qOEr5Gk8t3D51yo9xhFS77rwmzDD2Mc2qC3tZtag27A1@thread.v2", - "topic": "test topic", "createdOn": "2021-06-22T20:52:10Z", "createdByCommunicationIdentifier": - {"rawId": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d560-4924-ceb1-a43a0d00bdf1", - "communicationUser": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d560-4924-ceb1-a43a0d00bdf1"}}}}' + body: '{"chatThread": {"id": "19:xy0nRJZGiR62xpd5pVw3dSlMnmcQ7IUX1l9Nt8fOzkY1@thread.v2", + "topic": "test topic", "createdOn": "2021-09-07T21:43:23Z", "createdByCommunicationIdentifier": + {"rawId": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6218-d63e-657a-254822005377", + "communicationUser": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6218-d63e-657a-254822005377"}}}}' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:52:10 GMT + - Tue, 07 Sep 2021 21:43:23 GMT ms-cv: - - 4+bBwEXHXE2zCya+ryunJA.0 + - FF8l0U4VK0CKgiYKmZI5tg.0 strict-transport-security: - max-age=2592000 transfer-encoding: @@ -130,7 +132,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 667ms + - 923ms status: code: 201 message: Created @@ -144,21 +146,21 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: GET - uri: https://sanitized.communication.azure.com/chat/threads?maxPageSize=1&api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads?maxPageSize=1&api-version=2021-09-07 response: body: '{"value": "sanitized"}' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:52:13 GMT + - Tue, 07 Sep 2021 21:43:25 GMT ms-cv: - - pX4cwuqJe0SJay2Gyaw+zQ.0 + - UHXTw8c9D0WQF1VDdL2PBA.0 strict-transport-security: - max-age=2592000 transfer-encoding: @@ -166,7 +168,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 105ms + - 100ms status: code: 200 message: OK @@ -182,26 +184,26 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 response: body: string: '' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 date: - - Tue, 22 Jun 2021 20:52:13 GMT + - Tue, 07 Sep 2021 21:43:25 GMT ms-cv: - - 1ZpLuvKBpEGY+7NhkazJ2w.0 + - qOlTvI1bqEWNKy/pIMUkSQ.0 strict-transport-security: - max-age=2592000 x-cache: - CONFIG_NOCACHE x-processing-time: - - 170ms + - 296ms status: code: 204 message: No Content @@ -217,9 +219,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:52:14 GMT + - Tue, 07 Sep 2021 21:43:26 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -229,11 +231,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:52:13 GMT + - Tue, 07 Sep 2021 21:43:26 GMT ms-cv: - - qpnAW7teXUaMzuBaE/HE+w.0 + - YkwGkTgamEiiXKNcbiT35A.0 request-context: - appId= strict-transport-security: @@ -241,7 +244,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 771ms + - 376ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e_async.test_create_chat_thread_async.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e_async.test_create_chat_thread_async.yaml index 6f40a2a2b53f..3c99b1788610 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e_async.test_create_chat_thread_async.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e_async.test_create_chat_thread_async.yaml @@ -13,24 +13,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:52:14 GMT + - Tue, 07 Sep 2021 21:43:26 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d560-5eba-9806-113a0d002a58"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6218-e928-5505-4548220010ed"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:52:15 GMT + - Tue, 07 Sep 2021 21:43:26 GMT ms-cv: - - lrP95kLyUE2RhgWRM0xbaw.0 + - iFzBlBDiqUqsdO7MDUwDqA.0 request-context: - appId= strict-transport-security: @@ -40,7 +41,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 95ms + - 64ms status: code: 201 message: Created @@ -58,24 +59,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:52:15 GMT + - Tue, 07 Sep 2021 21:43:27 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:52:15.0461768+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:43:27.7175329+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:52:15 GMT + - Tue, 07 Sep 2021 21:43:27 GMT ms-cv: - - BBgY2fTxVEy5EhznI9pKEA.0 + - wbA0kTBOnUCtf2B/rrfJ9Q.0 request-context: - appId= strict-transport-security: @@ -85,7 +87,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 156ms + - 322ms status: code: 200 message: OK @@ -99,54 +101,54 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) repeatability-request-id: - - 9f521261-6c27-45b4-ab58-372720169acb + - 45a204ae-501a-49d6-89fb-b4c54e16b47b method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 response: - body: '{"chatThread": {"id": "19:5OTItLkfqgNZNbdkZJGi0Tw7Gk3947sX4ushhmOXPCI1@thread.v2", - "topic": "test topic", "createdOn": "2021-06-22T20:52:16Z", "createdByCommunicationIdentifier": - {"rawId": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d560-5eba-9806-113a0d002a58", - "communicationUser": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d560-5eba-9806-113a0d002a58"}}}}' + body: '{"chatThread": {"id": "19:IH2GWYcQbJYKdkqfrHGdDaxsqCZy2eK_c8LmH4qQkNE1@thread.v2", + "topic": "test topic", "createdOn": "2021-09-07T21:43:27Z", "createdByCommunicationIdentifier": + {"rawId": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6218-e928-5505-4548220010ed", + "communicationUser": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6218-e928-5505-4548220010ed"}}}}' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: application/json; charset=utf-8 - date: Tue, 22 Jun 2021 20:52:16 GMT - ms-cv: 4ST5GKZFYk6p3Xtr48//Pg.0 + date: Tue, 07 Sep 2021 21:43:27 GMT + ms-cv: iqWjNQnkqE6jcKR6yNEdwQ.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked x-cache: CONFIG_NOCACHE - x-processing-time: 594ms + x-processing-time: 435ms status: code: 201 message: Created - url: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 response: body: string: '' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 - date: Tue, 22 Jun 2021 20:52:16 GMT - ms-cv: 3wsOIOWPBkuiQC7iTEF5aQ.0 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 + date: Tue, 07 Sep 2021 21:43:27 GMT + ms-cv: HtkL6Hu7+U2jSJ3MAW0ttw.0 strict-transport-security: max-age=2592000 x-cache: CONFIG_NOCACHE - x-processing-time: 177ms + x-processing-time: 287ms status: code: 204 message: No Content - url: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 - request: body: null headers: @@ -159,9 +161,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:52:17 GMT + - Tue, 07 Sep 2021 21:43:28 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -171,11 +173,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:52:18 GMT + - Tue, 07 Sep 2021 21:43:28 GMT ms-cv: - - u9UPqVKkgEmt/w2caavvGQ.0 + - TujUO84wKkelIbFrM0kpGw.0 request-context: - appId= strict-transport-security: @@ -183,7 +186,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 914ms + - 495ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e_async.test_create_chat_thread_w_no_participants_async.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e_async.test_create_chat_thread_w_no_participants_async.yaml index 4ddb3da38fd8..931f949ee4e4 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e_async.test_create_chat_thread_w_no_participants_async.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e_async.test_create_chat_thread_w_no_participants_async.yaml @@ -13,24 +13,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:52:18 GMT + - Tue, 07 Sep 2021 21:43:29 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d560-6ba4-51b9-a43a0d0093f5"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6218-f2d5-defd-8b3a0d00085e"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:52:18 GMT + - Tue, 07 Sep 2021 21:43:28 GMT ms-cv: - - zjSh6ObOn0Kx8GCRti+iOg.0 + - fsHLA9DArE6hOIcUh7G3vg.0 request-context: - appId= strict-transport-security: @@ -40,7 +41,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 105ms + - 88ms status: code: 201 message: Created @@ -58,24 +59,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:52:19 GMT + - Tue, 07 Sep 2021 21:43:29 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:52:18.2935729+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:43:30.1503837+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:52:18 GMT + - Tue, 07 Sep 2021 21:43:29 GMT ms-cv: - - 4l2QFgYaT06TZVzmMDmgIA.0 + - aC13BDzlcESHy2F/qZOb8g.0 request-context: - appId= strict-transport-security: @@ -85,7 +87,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 178ms + - 216ms status: code: 200 message: OK @@ -99,54 +101,54 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) repeatability-request-id: - - 8d8b5540-2c6a-4722-8e95-299ec5e4f3cf + - 2bbab032-4bc0-4e24-b076-15bcd6225970 method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 response: - body: '{"chatThread": {"id": "19:0KyXGTSmW4__jXsrXdhuZ11gb50yZh_0LKKhtkVNtbo1@thread.v2", - "topic": "test topic", "createdOn": "2021-06-22T20:52:19Z", "createdByCommunicationIdentifier": - {"rawId": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d560-6ba4-51b9-a43a0d0093f5", - "communicationUser": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d560-6ba4-51b9-a43a0d0093f5"}}}}' + body: '{"chatThread": {"id": "19:ZTVQEE117o2rQ2H4NMO0ujRaV6JKnvfSaXm-eBtIOk41@thread.v2", + "topic": "test topic", "createdOn": "2021-09-07T21:43:30Z", "createdByCommunicationIdentifier": + {"rawId": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6218-f2d5-defd-8b3a0d00085e", + "communicationUser": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6218-f2d5-defd-8b3a0d00085e"}}}}' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: application/json; charset=utf-8 - date: Tue, 22 Jun 2021 20:52:20 GMT - ms-cv: uIgLKvBgaU2uqOf0xBEZDg.0 + date: Tue, 07 Sep 2021 21:43:30 GMT + ms-cv: kufYfMbafkeiEEngKsU68A.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked x-cache: CONFIG_NOCACHE - x-processing-time: 529ms + x-processing-time: 592ms status: code: 201 message: Created - url: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 response: body: string: '' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 - date: Tue, 22 Jun 2021 20:52:20 GMT - ms-cv: Hlu6bmKxBkeFxBtf6pExUA.0 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 + date: Tue, 07 Sep 2021 21:43:30 GMT + ms-cv: COklUDujgkem+VQQtFIhkg.0 strict-transport-security: max-age=2592000 x-cache: CONFIG_NOCACHE - x-processing-time: 108ms + x-processing-time: 154ms status: code: 204 message: No Content - url: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 - request: body: null headers: @@ -159,9 +161,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:52:20 GMT + - Tue, 07 Sep 2021 21:43:31 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -171,11 +173,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:52:21 GMT + - Tue, 07 Sep 2021 21:43:30 GMT ms-cv: - - B1y8Zlm4FEeeZ4IGvzVfNA.0 + - 4PJJlJBBNUS/oFrjy48GCw.0 request-context: - appId= strict-transport-security: @@ -183,7 +186,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 825ms + - 551ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e_async.test_create_chat_thread_w_repeatability_request_id_async.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e_async.test_create_chat_thread_w_repeatability_request_id_async.yaml index aa543399db5c..32441abcba91 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e_async.test_create_chat_thread_w_repeatability_request_id_async.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e_async.test_create_chat_thread_w_repeatability_request_id_async.yaml @@ -13,24 +13,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:52:21 GMT + - Tue, 07 Sep 2021 21:43:31 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d560-77dc-f6c7-593a0d009fe9"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6218-fb79-657a-254822005378"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:52:21 GMT + - Tue, 07 Sep 2021 21:43:31 GMT ms-cv: - - +YwKWQsXzkScD6ust3GIiw.0 + - 5p64Y2+2eUuIA8zrC5pqRw.0 request-context: - appId= strict-transport-security: @@ -40,7 +41,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 74ms + - 88ms status: code: 201 message: Created @@ -58,24 +59,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:52:22 GMT + - Tue, 07 Sep 2021 21:43:32 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:52:21.2418757+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:43:32.285219+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:52:22 GMT + - Tue, 07 Sep 2021 21:43:31 GMT ms-cv: - - Zj9KI87hAUKrZJHga6zfkQ.0 + - dYUaim4a8EqADDvZ6laIDQ.0 request-context: - appId= strict-transport-security: @@ -85,7 +87,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 37ms + - 150ms status: code: 200 message: OK @@ -99,30 +101,30 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) repeatability-request-id: - - 472eca96-c164-4ca5-b4db-e9a159504505 + - 27c754ad-8b96-4129-a468-b4d1dd40e5f9 method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 response: - body: '{"chatThread": {"id": "19:z524nkZNk3nmijkg6pYKT3aHFSqaAnjruZ15gorU1Gg1@thread.v2", - "topic": "test topic", "createdOn": "2021-06-22T20:52:22Z", "createdByCommunicationIdentifier": - {"rawId": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d560-77dc-f6c7-593a0d009fe9", - "communicationUser": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d560-77dc-f6c7-593a0d009fe9"}}}}' + body: '{"chatThread": {"id": "19:Fd9N4ZUj3m72VQCBeI-3foEl40-mZKBoced88P6e8Ag1@thread.v2", + "topic": "test topic", "createdOn": "2021-09-07T21:43:32Z", "createdByCommunicationIdentifier": + {"rawId": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6218-fb79-657a-254822005378", + "communicationUser": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6218-fb79-657a-254822005378"}}}}' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: application/json; charset=utf-8 - date: Tue, 22 Jun 2021 20:52:22 GMT - ms-cv: 3OFCTqMk5UCSLAdCEMTtrQ.0 + date: Tue, 07 Sep 2021 21:43:33 GMT + ms-cv: /iewCtPh/U+MmxsGy9P/DQ.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked x-cache: CONFIG_NOCACHE - x-processing-time: 343ms + x-processing-time: 858ms status: code: 201 message: Created - url: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 - request: body: '{"topic": "test topic", "participants": "sanitized"}' headers: @@ -133,54 +135,54 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) repeatability-request-id: - - 472eca96-c164-4ca5-b4db-e9a159504505 + - 27c754ad-8b96-4129-a468-b4d1dd40e5f9 method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 response: - body: '{"chatThread": {"id": "19:z524nkZNk3nmijkg6pYKT3aHFSqaAnjruZ15gorU1Gg1@thread.v2", - "topic": "test topic", "createdOn": "2021-06-22T20:52:22Z", "createdByCommunicationIdentifier": - {"rawId": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d560-77dc-f6c7-593a0d009fe9", - "communicationUser": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d560-77dc-f6c7-593a0d009fe9"}}}}' + body: '{"chatThread": {"id": "19:Fd9N4ZUj3m72VQCBeI-3foEl40-mZKBoced88P6e8Ag1@thread.v2", + "topic": "test topic", "createdOn": "2021-09-07T21:43:32Z", "createdByCommunicationIdentifier": + {"rawId": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6218-fb79-657a-254822005378", + "communicationUser": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6218-fb79-657a-254822005378"}}}}' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: application/json; charset=utf-8 - date: Tue, 22 Jun 2021 20:52:22 GMT - ms-cv: ysfM12uJ80a0KsSChilJeg.0 + date: Tue, 07 Sep 2021 21:43:33 GMT + ms-cv: BbzxvDRmLki8D/bRp6CEkQ.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked x-cache: CONFIG_NOCACHE - x-processing-time: 223ms + x-processing-time: 408ms status: code: 201 message: Created - url: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 response: body: string: '' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 - date: Tue, 22 Jun 2021 20:52:23 GMT - ms-cv: IeyURAjdEUeXe8t6++bOUg.0 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 + date: Tue, 07 Sep 2021 21:43:33 GMT + ms-cv: qaqNUQrrZ0mGhXikDvnTig.0 strict-transport-security: max-age=2592000 x-cache: CONFIG_NOCACHE - x-processing-time: 286ms + x-processing-time: 275ms status: code: 204 message: No Content - url: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 - request: body: null headers: @@ -193,9 +195,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:52:24 GMT + - Tue, 07 Sep 2021 21:43:34 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -205,11 +207,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:52:24 GMT + - Tue, 07 Sep 2021 21:43:34 GMT ms-cv: - - wZ0dtedx60qJURutofHpxA.0 + - 3UQQsMBts02ECyD8pTV3RQ.0 request-context: - appId= strict-transport-security: @@ -217,7 +220,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 688ms + - 351ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e_async.test_delete_chat_thread.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e_async.test_delete_chat_thread.yaml index 396965e752de..b3f661ef8c6a 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e_async.test_delete_chat_thread.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e_async.test_delete_chat_thread.yaml @@ -13,24 +13,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:52:25 GMT + - Tue, 07 Sep 2021 21:43:34 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d560-8736-9806-113a0d002a5b"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-082c-b271-25482200110b"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:52:26 GMT + - Tue, 07 Sep 2021 21:43:35 GMT ms-cv: - - pg7/XMlZ6k+ghW3ewBIGww.0 + - lEc3xGEvpUGJV+WCRMGjcw.0 request-context: - appId= strict-transport-security: @@ -40,7 +41,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 92ms + - 113ms status: code: 201 message: Created @@ -58,24 +59,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:52:26 GMT + - Tue, 07 Sep 2021 21:43:35 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:52:25.4830008+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:43:35.5570018+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:52:26 GMT + - Tue, 07 Sep 2021 21:43:35 GMT ms-cv: - - sJbW3M3D7EqBJAyD2O+3rw.0 + - CQeH5TWFpkKh3UJ68PQd9Q.0 request-context: - appId= strict-transport-security: @@ -85,7 +87,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 167ms + - 163ms status: code: 200 message: OK @@ -99,78 +101,78 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) repeatability-request-id: - - e3d2cd5a-8940-472f-a4a9-efce0f4d3abb + - de0255c7-43a7-4382-a986-b0a6917e7505 method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 response: - body: '{"chatThread": {"id": "19:43_h7rasMUfHonmcY5qxSv2o0lAK2BfUmPl9E0uUfmU1@thread.v2", - "topic": "test topic", "createdOn": "2021-06-22T20:52:27Z", "createdByCommunicationIdentifier": - {"rawId": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d560-8736-9806-113a0d002a5b", - "communicationUser": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d560-8736-9806-113a0d002a5b"}}}}' + body: '{"chatThread": {"id": "19:SaE0tqTV8XwubGagm8uo1LMedoPEu5Fg7Bz8U5miv6E1@thread.v2", + "topic": "test topic", "createdOn": "2021-09-07T21:43:35Z", "createdByCommunicationIdentifier": + {"rawId": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-082c-b271-25482200110b", + "communicationUser": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-082c-b271-25482200110b"}}}}' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: application/json; charset=utf-8 - date: Tue, 22 Jun 2021 20:52:27 GMT - ms-cv: WMOPSchIikmmQDHr+9gv4g.0 + date: Tue, 07 Sep 2021 21:43:36 GMT + ms-cv: TSTf8OyQdECvPm2VyEzDeA.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked x-cache: CONFIG_NOCACHE - x-processing-time: 568ms + x-processing-time: 573ms status: code: 201 message: Created - url: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 response: body: string: '' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 - date: Tue, 22 Jun 2021 20:52:27 GMT - ms-cv: MzbJCCwBj0GUpBzxDXQnAA.0 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 + date: Tue, 07 Sep 2021 21:43:36 GMT + ms-cv: /h+0MbIhX0e4GNSByPehDA.0 strict-transport-security: max-age=2592000 x-cache: CONFIG_NOCACHE - x-processing-time: 130ms + x-processing-time: 250ms status: code: 204 message: No Content - url: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 response: body: string: '' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 - date: Tue, 22 Jun 2021 20:52:28 GMT - ms-cv: kkb1Qs2qGESjwci1N+fo+Q.0 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 + date: Tue, 07 Sep 2021 21:43:36 GMT + ms-cv: geA4+xb6DUuYbWQY+wDhnQ.0 strict-transport-security: max-age=2592000 x-cache: CONFIG_NOCACHE - x-processing-time: 177ms + x-processing-time: 141ms status: code: 204 message: No Content - url: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 - request: body: null headers: @@ -183,9 +185,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:52:29 GMT + - Tue, 07 Sep 2021 21:43:36 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -195,11 +197,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:52:30 GMT + - Tue, 07 Sep 2021 21:43:37 GMT ms-cv: - - IiAIRAiNK0mVZYyjIzIRJA.0 + - 5e9IfUV8t0y/Nr6tCC1Q8w.0 request-context: - appId= strict-transport-security: @@ -207,7 +210,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 925ms + - 783ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e_async.test_get_thread_client.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e_async.test_get_thread_client.yaml index 8e1e9f6188b9..cee29e5d453e 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e_async.test_get_thread_client.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e_async.test_get_thread_client.yaml @@ -13,24 +13,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:52:30 GMT + - Tue, 07 Sep 2021 21:43:37 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d560-a2df-edbe-a43a0d00d178"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-129e-b271-25482200110c"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:52:32 GMT + - Tue, 07 Sep 2021 21:43:37 GMT ms-cv: - - goTz6/Zc8kSWOdRGe7I+vA.0 + - IfRyoSScz0GgjuVkhNvRFA.0 request-context: - appId= strict-transport-security: @@ -40,7 +41,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 85ms + - 88ms status: code: 201 message: Created @@ -58,24 +59,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:52:33 GMT + - Tue, 07 Sep 2021 21:43:38 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:52:32.9783707+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:43:38.2180999+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:52:33 GMT + - Tue, 07 Sep 2021 21:43:37 GMT ms-cv: - - 8YV1Fd9HFkmu3J9JbHja0Q.0 + - AYsKNLDkPk27CS272IKG/Q.0 request-context: - appId= strict-transport-security: @@ -85,7 +87,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 136ms + - 152ms status: code: 200 message: OK @@ -99,54 +101,54 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) repeatability-request-id: - - 6e1f34d0-972f-4a8f-ad0f-e454e3d90cad + - 6c8e1f37-2c3e-4eeb-b613-09b1a16730d1 method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 response: - body: '{"chatThread": {"id": "19:7LGDmjICcpbNNGmJgqpwIQ6QdF1GSHBbEGDhh9_0w3Q1@thread.v2", - "topic": "test topic", "createdOn": "2021-06-22T20:52:34Z", "createdByCommunicationIdentifier": - {"rawId": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d560-a2df-edbe-a43a0d00d178", - "communicationUser": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d560-a2df-edbe-a43a0d00d178"}}}}' + body: '{"chatThread": {"id": "19:He3LVtzJhGoHqHI7rbJQqJu6fU_7KSuUJsBfK8EHO1w1@thread.v2", + "topic": "test topic", "createdOn": "2021-09-07T21:43:38Z", "createdByCommunicationIdentifier": + {"rawId": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-129e-b271-25482200110c", + "communicationUser": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-129e-b271-25482200110c"}}}}' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: application/json; charset=utf-8 - date: Tue, 22 Jun 2021 20:52:34 GMT - ms-cv: jMldTRwtpkOwwkFKBoCJNQ.0 + date: Tue, 07 Sep 2021 21:43:37 GMT + ms-cv: Ga6xk+YHakmQ38CsRA8C8w.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked x-cache: CONFIG_NOCACHE - x-processing-time: 597ms + x-processing-time: 390ms status: code: 201 message: Created - url: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 response: body: string: '' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 - date: Tue, 22 Jun 2021 20:52:34 GMT - ms-cv: njWVsxdIVU+Zkc0yo+j84Q.0 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 + date: Tue, 07 Sep 2021 21:43:38 GMT + ms-cv: n/DC7gulbUKk9MENxF94/Q.0 strict-transport-security: max-age=2592000 x-cache: CONFIG_NOCACHE - x-processing-time: 169ms + x-processing-time: 151ms status: code: 204 message: No Content - url: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 - request: body: null headers: @@ -159,9 +161,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:52:35 GMT + - Tue, 07 Sep 2021 21:43:39 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -171,11 +173,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:52:35 GMT + - Tue, 07 Sep 2021 21:43:39 GMT ms-cv: - - 8sPeUSKmFEG+7OHyfJR1MQ.0 + - 8Yy4kuVM5EaasEjbnUyxeg.0 request-context: - appId= strict-transport-security: @@ -183,7 +186,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 640ms + - 591ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e_async.test_list_chat_threads.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e_async.test_list_chat_threads.yaml index 498026e03c2f..82148d6bbed3 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e_async.test_list_chat_threads.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e_async.test_list_chat_threads.yaml @@ -13,24 +13,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:52:36 GMT + - Tue, 07 Sep 2021 21:43:39 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d560-b3fa-ceb1-a43a0d00bdf8"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-1ab3-ac00-343a0d000c84"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:52:36 GMT + - Tue, 07 Sep 2021 21:43:39 GMT ms-cv: - - pSJ0VwTB20K1kSnqqHi0Nw.0 + - AHQv4BdaoUuapHznAbNk9w.0 request-context: - appId= strict-transport-security: @@ -40,7 +41,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 60ms + - 52ms status: code: 201 message: Created @@ -58,24 +59,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:52:37 GMT + - Tue, 07 Sep 2021 21:43:40 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:52:36.884581+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:43:40.0720938+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:52:37 GMT + - Tue, 07 Sep 2021 21:43:39 GMT ms-cv: - - b6q5W6gNAkW8vVnkBXne3A.0 + - O0khDv4GZUC/8N3b777bvw.0 request-context: - appId= strict-transport-security: @@ -85,7 +87,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 128ms + - 56ms status: code: 200 message: OK @@ -99,79 +101,79 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) repeatability-request-id: - - 3ad888a5-d7e1-48c7-bff7-7203e0738b4e + - 9f67f5f9-e523-4ada-ad1f-955e436cd581 method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 response: - body: '{"chatThread": {"id": "19:YPYZOu1agJIntrn2lZ-WacPkxyTBSYdJkOlUhiCoOwM1@thread.v2", - "topic": "test topic", "createdOn": "2021-06-22T20:52:38Z", "createdByCommunicationIdentifier": - {"rawId": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d560-b3fa-ceb1-a43a0d00bdf8", - "communicationUser": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d560-b3fa-ceb1-a43a0d00bdf8"}}}}' + body: '{"chatThread": {"id": "19:Js9XxxMFXF7CdT3eEC0UQJ52um1mvOnxlQ2TAyIyJv41@thread.v2", + "topic": "test topic", "createdOn": "2021-09-07T21:43:40Z", "createdByCommunicationIdentifier": + {"rawId": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-1ab3-ac00-343a0d000c84", + "communicationUser": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-1ab3-ac00-343a0d000c84"}}}}' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: application/json; charset=utf-8 - date: Tue, 22 Jun 2021 20:52:38 GMT - ms-cv: 4xGkE00hIUmbOhafN06YVg.0 + date: Tue, 07 Sep 2021 21:43:40 GMT + ms-cv: 8TMRWR1PcEafotoL8QeHMg.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked x-cache: CONFIG_NOCACHE - x-processing-time: 590ms + x-processing-time: 535ms status: code: 201 message: Created - url: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: GET - uri: https://sanitized.communication.azure.com/chat/threads?maxPageSize=1&api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads?maxPageSize=1&api-version=2021-09-07 response: body: '{"value": "sanitized"}' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: application/json; charset=utf-8 - date: Tue, 22 Jun 2021 20:52:41 GMT - ms-cv: KcAYig+aWkekdksKcPmhuA.0 + date: Tue, 07 Sep 2021 21:43:42 GMT + ms-cv: WgX2WaUGy0qd40MewVbXbw.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked x-cache: CONFIG_NOCACHE - x-processing-time: 81ms + x-processing-time: 123ms status: code: 200 message: OK - url: https://sanitized.communication.azure.com/chat/threads?maxPageSize=1&api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads?maxPageSize=1&api-version=2021-09-07 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 response: body: string: '' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 - date: Tue, 22 Jun 2021 20:52:41 GMT - ms-cv: 75liE9Ou006qfrU5tYTf+g.0 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 + date: Tue, 07 Sep 2021 21:43:42 GMT + ms-cv: z+T2ot3Gmk6wpzClXkrRsA.0 strict-transport-security: max-age=2592000 x-cache: CONFIG_NOCACHE - x-processing-time: 125ms + x-processing-time: 249ms status: code: 204 message: No Content - url: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 - request: body: null headers: @@ -184,9 +186,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:52:42 GMT + - Tue, 07 Sep 2021 21:43:43 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -196,11 +198,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:52:42 GMT + - Tue, 07 Sep 2021 21:43:42 GMT ms-cv: - - k1kuT9vr3E2aH1+qo4Ljfg.0 + - RUHM1yxrhkyhEFzRAaz0iw.0 request-context: - appId= strict-transport-security: @@ -208,7 +211,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 887ms + - 312ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_add_participants.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_add_participants.yaml index 43632207c237..0c53b9d08171 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_add_participants.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_add_participants.yaml @@ -13,24 +13,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:52:44 GMT + - Tue, 07 Sep 2021 21:43:44 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d560-cf6a-b8ba-a43a0d002ce4"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-2d92-89df-444822001277"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:52:43 GMT + - Tue, 07 Sep 2021 21:43:44 GMT ms-cv: - - gWrrJWCVOUumh2Oz9BQbtg.0 + - 2ADNhyaXWkql78apERt7wQ.0 request-context: - appId= strict-transport-security: @@ -40,7 +41,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 84ms + - 61ms status: code: 201 message: Created @@ -58,24 +59,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:52:44 GMT + - Tue, 07 Sep 2021 21:43:44 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:52:44.0742387+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:43:45.1808194+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:52:44 GMT + - Tue, 07 Sep 2021 21:43:45 GMT ms-cv: - - lDsgpVAIi029IUCxURZs+w.0 + - r6gbR9bFf0umM7wLlMNmtQ.0 request-context: - appId= strict-transport-security: @@ -85,7 +87,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 128ms + - 257ms status: code: 200 message: OK @@ -103,24 +105,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:52:45 GMT + - Tue, 07 Sep 2021 21:43:45 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d560-d207-b8ba-a43a0d002ce5"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-2faf-89df-444822001278"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:52:44 GMT + - Tue, 07 Sep 2021 21:43:45 GMT ms-cv: - - 1mRJWhZTy0yQ3VkF6ZGJOA.0 + - eDv9GdUvaUSUSyuuEjI3iw.0 request-context: - appId= strict-transport-security: @@ -130,7 +133,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 62ms + - 113ms status: code: 201 message: Created @@ -148,24 +151,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:52:45 GMT + - Tue, 07 Sep 2021 21:43:45 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:52:44.480522+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:43:45.8863235+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:52:44 GMT + - Tue, 07 Sep 2021 21:43:45 GMT ms-cv: - - U8K+fnmQl0ultnK/AMI8dQ.0 + - 3AZtZGfXbkyt2Is7D6hnjA.0 request-context: - appId= strict-transport-security: @@ -175,7 +179,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 136ms + - 312ms status: code: 200 message: OK @@ -189,30 +193,30 @@ interactions: Connection: - keep-alive Content-Length: - - '350' + - '347' Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) repeatability-request-id: - - 7b84fd83-f8c7-462a-8334-7a374313762f + - c13ade92-7e04-4a63-93be-3d4846ad8a0b method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 response: - body: '{"chatThread": {"id": "19:ewl3-fapK9Nosd1ilIbwq6vODeuiJWv30vQkNN7D0FQ1@thread.v2", - "topic": "test topic", "createdOn": "2021-06-22T20:52:46Z", "createdByCommunicationIdentifier": - {"rawId": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d560-cf6a-b8ba-a43a0d002ce4", - "communicationUser": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d560-cf6a-b8ba-a43a0d002ce4"}}}}' + body: '{"chatThread": {"id": "19:IsX0C5SRQcduTdYKxuTPPfB9-zIae9xj-eU8UN-h2381@thread.v2", + "topic": "test topic", "createdOn": "2021-09-07T21:43:46Z", "createdByCommunicationIdentifier": + {"rawId": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-2d92-89df-444822001277", + "communicationUser": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-2d92-89df-444822001277"}}}}' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:52:46 GMT + - Tue, 07 Sep 2021 21:43:45 GMT ms-cv: - - 6Uy157BgzUONPqW442LTHg.0 + - sU/3wYqPAkKGkI/F26I3pA.0 strict-transport-security: - max-age=2592000 transfer-encoding: @@ -220,7 +224,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 711ms + - 590ms status: code: 201 message: Created @@ -238,21 +242,21 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: POST - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/participants/:add?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/participants/:add?api-version=2021-09-07 response: body: '{}' headers: api-supported-versions: - 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, 2021-03-07, - 2021-04-05-preview6 + 2021-04-05-preview6, 2021-09-07 content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:52:47 GMT + - Tue, 07 Sep 2021 21:43:47 GMT ms-cv: - - 3k2SkPvs/0+RFMEZ4pkbVw.0 + - jHrhg7YlYUqTaO9GEnIRJw.0 strict-transport-security: - max-age=2592000 transfer-encoding: @@ -260,7 +264,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 369ms + - 535ms status: code: 201 message: Created @@ -276,26 +280,26 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 response: body: string: '' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 date: - - Tue, 22 Jun 2021 20:52:47 GMT + - Tue, 07 Sep 2021 21:43:46 GMT ms-cv: - - zr9KmXuUrUSU8qf7gOZB6Q.0 + - 5uFvkSDrdkqM8VM2GWFgtg.0 strict-transport-security: - max-age=2592000 x-cache: - CONFIG_NOCACHE x-processing-time: - - 170ms + - 135ms status: code: 204 message: No Content @@ -311,9 +315,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:52:48 GMT + - Tue, 07 Sep 2021 21:43:47 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -323,11 +327,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:52:49 GMT + - Tue, 07 Sep 2021 21:43:48 GMT ms-cv: - - 5eO0U4Xl70qmP+O5wxkUvA.0 + - e/tqdO5IgEKJRv1fLAAb7g.0 request-context: - appId= strict-transport-security: @@ -335,7 +340,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 1828ms + - 515ms status: code: 204 message: No Content @@ -351,9 +356,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:52:50 GMT + - Tue, 07 Sep 2021 21:43:48 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -363,11 +368,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:52:50 GMT + - Tue, 07 Sep 2021 21:43:48 GMT ms-cv: - - 0jEp3n0/Q0mKoLnwiVc44w.0 + - InBO+3vb90Wmp3IHN1ML/w.0 request-context: - appId= strict-transport-security: @@ -375,7 +381,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 929ms + - 399ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_delete_message.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_delete_message.yaml index 2a9a519101d4..6586c4588d4d 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_delete_message.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_delete_message.yaml @@ -13,24 +13,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:52:51 GMT + - Tue, 07 Sep 2021 21:43:48 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d560-ea1a-ceb1-a43a0d00bdfb"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-3db5-f3f5-343a0d00171a"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:52:51 GMT + - Tue, 07 Sep 2021 21:43:48 GMT ms-cv: - - NmIRlZ9MJUqhnkLfWeA4Jg.0 + - P9TINT5bbkmDjklD+oVyVA.0 request-context: - appId= strict-transport-security: @@ -40,7 +41,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 91ms + - 29ms status: code: 201 message: Created @@ -58,24 +59,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:52:51 GMT + - Tue, 07 Sep 2021 21:43:49 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:52:50.6187793+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:43:50.0149348+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:52:51 GMT + - Tue, 07 Sep 2021 21:43:48 GMT ms-cv: - - R/DEBPl8qEaKhCoerDW0sA.0 + - gyGFLDQei0uXgCshafjjUQ.0 request-context: - appId= strict-transport-security: @@ -85,7 +87,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 137ms + - 32ms status: code: 200 message: OK @@ -103,24 +105,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:52:51 GMT + - Tue, 07 Sep 2021 21:43:49 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d560-eb90-ceb1-a43a0d00bdfc"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-3e66-f3f5-343a0d00171b"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:52:51 GMT + - Tue, 07 Sep 2021 21:43:48 GMT ms-cv: - - 0y0XeeKYSE2rBdRQWOkO0g.0 + - gaztuKn93k+ZhlCBVryf8w.0 request-context: - appId= strict-transport-security: @@ -130,7 +133,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 71ms + - 25ms status: code: 201 message: Created @@ -148,24 +151,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:52:51 GMT + - Tue, 07 Sep 2021 21:43:49 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:52:51.0220441+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:43:49.3538411+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:52:51 GMT + - Tue, 07 Sep 2021 21:43:48 GMT ms-cv: - - Opq0xom0WkalaUwGpwIW4A.0 + - QrhIcGBhP0Cy52OB9V7d9Q.0 request-context: - appId= strict-transport-security: @@ -175,7 +179,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 165ms + - 78ms status: code: 200 message: OK @@ -189,30 +193,30 @@ interactions: Connection: - keep-alive Content-Length: - - '350' + - '349' Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) repeatability-request-id: - - 3d6f0447-94e6-49e5-bcce-81b5dbc225a7 + - e9198e79-ca80-4767-96d5-a907a2af3691 method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 response: - body: '{"chatThread": {"id": "19:Lka7ukU8T01s5p_sXicH_14AJWaqaPT64snT9Is6pM01@thread.v2", - "topic": "test topic", "createdOn": "2021-06-22T20:52:52Z", "createdByCommunicationIdentifier": - {"rawId": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d560-ea1a-ceb1-a43a0d00bdfb", - "communicationUser": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d560-ea1a-ceb1-a43a0d00bdfb"}}}}' + body: '{"chatThread": {"id": "19:flXz_5HJENTjYJMozyAxdl7oBi7jSrSarf48LAN_Bpo1@thread.v2", + "topic": "test topic", "createdOn": "2021-09-07T21:43:49Z", "createdByCommunicationIdentifier": + {"rawId": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-3db5-f3f5-343a0d00171a", + "communicationUser": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-3db5-f3f5-343a0d00171a"}}}}' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:52:52 GMT + - Tue, 07 Sep 2021 21:43:49 GMT ms-cv: - - gI1INlIc9Eq8hJIXY0zx9A.0 + - IySCWeBgCE+8KlRwtTVs5g.0 strict-transport-security: - max-age=2592000 transfer-encoding: @@ -220,7 +224,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 496ms + - 432ms status: code: 201 message: Created @@ -239,21 +243,21 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: POST - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2021-09-07 response: body: '{"id": "sanitized"}' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:52:52 GMT + - Tue, 07 Sep 2021 21:43:50 GMT ms-cv: - - Vep4URYeN0avDBFaJw3YBA.0 + - KFhsL/8B+Uqp0NO7fwB1rw.0 strict-transport-security: - max-age=2592000 transfer-encoding: @@ -261,7 +265,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 210ms + - 196ms status: code: 201 message: Created @@ -277,26 +281,26 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages/sanitized?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages/sanitized?api-version=2021-09-07 response: body: string: '' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 date: - - Tue, 22 Jun 2021 20:52:52 GMT + - Tue, 07 Sep 2021 21:43:50 GMT ms-cv: - - P73t5e6DHE2C+dpc3H8I6g.0 + - /mKgoizwQkGS0ysKCIRRzQ.0 strict-transport-security: - max-age=2592000 x-cache: - CONFIG_NOCACHE x-processing-time: - - 257ms + - 206ms status: code: 204 message: No Content @@ -312,26 +316,26 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 response: body: string: '' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 date: - - Tue, 22 Jun 2021 20:52:53 GMT + - Tue, 07 Sep 2021 21:43:50 GMT ms-cv: - - uE4gXOvDkkCNfASslmSzQg.0 + - /o7uBP2U4kyifd8patml1w.0 strict-transport-security: - max-age=2592000 x-cache: - CONFIG_NOCACHE x-processing-time: - - 318ms + - 363ms status: code: 204 message: No Content @@ -347,9 +351,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:52:53 GMT + - Tue, 07 Sep 2021 21:43:51 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -359,11 +363,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:52:54 GMT + - Tue, 07 Sep 2021 21:43:50 GMT ms-cv: - - we/NjoDv30eZV59VldrtQw.0 + - a2Jr+3G410mEjURnf5tSdw.0 request-context: - appId= strict-transport-security: @@ -371,7 +376,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 620ms + - 341ms status: code: 204 message: No Content @@ -387,9 +392,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:52:54 GMT + - Tue, 07 Sep 2021 21:43:51 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -399,11 +404,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:52:55 GMT + - Tue, 07 Sep 2021 21:43:50 GMT ms-cv: - - H5PY1b2hzEyKK2eXRdSnpA.0 + - bx6YUzTVnUWSbms69n7jlw.0 request-context: - appId= strict-transport-security: @@ -411,7 +417,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 732ms + - 224ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_get_message.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_get_message.yaml index a22948fc35dd..c0de389437c4 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_get_message.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_get_message.yaml @@ -13,24 +13,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:52:55 GMT + - Tue, 07 Sep 2021 21:43:51 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d560-faf7-e3c7-593a0d001af4"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-4aef-497d-2548220048f3"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:52:55 GMT + - Tue, 07 Sep 2021 21:43:52 GMT ms-cv: - - aaeABU1Xe06GwZEg1JswmQ.0 + - riaeLEHZMk6WGTw40AbnxQ.0 request-context: - appId= strict-transport-security: @@ -40,7 +41,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 42ms + - 152ms status: code: 201 message: Created @@ -58,24 +59,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:52:55 GMT + - Tue, 07 Sep 2021 21:43:52 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:52:54.7753604+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:43:52.6707235+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:52:55 GMT + - Tue, 07 Sep 2021 21:43:52 GMT ms-cv: - - 0N2X/MP2MESeB3PkXke1Og.0 + - /d2WE8aRdkKp0xRBwjcYPA.0 request-context: - appId= strict-transport-security: @@ -85,7 +87,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 37ms + - 194ms status: code: 200 message: OK @@ -103,24 +105,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:52:55 GMT + - Tue, 07 Sep 2021 21:43:52 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d560-fbac-e3c7-593a0d001af5"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-4cdb-497d-2548220048f4"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:52:55 GMT + - Tue, 07 Sep 2021 21:43:52 GMT ms-cv: - - XYeLM4uixEWWWjqTEwRQ8Q.0 + - PRV1bJeiB0aGymFKqNg9Mg.0 request-context: - appId= strict-transport-security: @@ -130,7 +133,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 24ms + - 143ms status: code: 201 message: Created @@ -148,24 +151,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:52:55 GMT + - Tue, 07 Sep 2021 21:43:53 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:52:54.9505748+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:43:53.3642856+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:52:55 GMT + - Tue, 07 Sep 2021 21:43:53 GMT ms-cv: - - 1c6kgzPFVU2Zq3K6kikL4A.0 + - wKB+f6TtDU+BY5DvDp+eNA.0 request-context: - appId= strict-transport-security: @@ -175,7 +179,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 32ms + - 257ms status: code: 200 message: OK @@ -193,26 +197,26 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) repeatability-request-id: - - 18c89648-0d4a-4373-8fa3-d52aa41524e2 + - 5d8c8924-2264-41b1-ae77-410cf20e1909 method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 response: - body: '{"chatThread": {"id": "19:DKWVb1_3iQgLjBQn3i_d2saoFSv3GgYXKAwt8tQRD2g1@thread.v2", - "topic": "test topic", "createdOn": "2021-06-22T20:52:56Z", "createdByCommunicationIdentifier": - {"rawId": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d560-faf7-e3c7-593a0d001af4", - "communicationUser": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d560-faf7-e3c7-593a0d001af4"}}}}' + body: '{"chatThread": {"id": "19:em_lUfue23ChshALktR2gtcqgzI4ijPUk_nypP7BCE81@thread.v2", + "topic": "test topic", "createdOn": "2021-09-07T21:43:53Z", "createdByCommunicationIdentifier": + {"rawId": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-4aef-497d-2548220048f3", + "communicationUser": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-4aef-497d-2548220048f3"}}}}' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:52:56 GMT + - Tue, 07 Sep 2021 21:43:53 GMT ms-cv: - - S5UG0uK3REel82YZV2fUFQ.0 + - LBhz2RTqyUOtQwwh1qbGnw.0 strict-transport-security: - max-age=2592000 transfer-encoding: @@ -220,7 +224,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 648ms + - 344ms status: code: 201 message: Created @@ -239,21 +243,21 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: POST - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2021-09-07 response: body: '{"id": "sanitized"}' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:52:56 GMT + - Tue, 07 Sep 2021 21:43:53 GMT ms-cv: - - 5CDv1n3FlUGnK8jVsBpvVQ.0 + - WTpaFN1CVkO8sGQsLOHgNA.0 strict-transport-security: - max-age=2592000 transfer-encoding: @@ -261,7 +265,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 279ms + - 382ms status: code: 201 message: Created @@ -275,24 +279,24 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: GET - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages/sanitized?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages/sanitized?api-version=2021-09-07 response: - body: '{"id": "sanitized", "type": "text", "sequenceId": "3", "version": "1624395177044", + body: '{"id": "sanitized", "type": "text", "sequenceId": "3", "version": "1631051034460", "content": {"message": "hello world"}, "senderDisplayName": "sender name", "createdOn": - "2021-06-22T20:52:57Z", "senderCommunicationIdentifier": {"rawId": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d560-faf7-e3c7-593a0d001af4", - "communicationUser": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d560-faf7-e3c7-593a0d001af4"}}}' + "2021-09-07T21:43:54Z", "senderCommunicationIdentifier": {"rawId": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-4aef-497d-2548220048f3", + "communicationUser": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-4aef-497d-2548220048f3"}}}' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:52:56 GMT + - Tue, 07 Sep 2021 21:43:54 GMT ms-cv: - - pdfPUTV8qEyLn2wHdcpVUQ.0 + - YYVnz+aXKEOeKWDtEDxMeg.0 strict-transport-security: - max-age=2592000 transfer-encoding: @@ -300,7 +304,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 116ms + - 134ms status: code: 200 message: OK @@ -316,26 +320,26 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 response: body: string: '' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 date: - - Tue, 22 Jun 2021 20:52:57 GMT + - Tue, 07 Sep 2021 21:43:54 GMT ms-cv: - - Y0Hhg87HE0CWyLi5i2UxZQ.0 + - S9fcD+vuVk658Rd33p993A.0 strict-transport-security: - max-age=2592000 x-cache: - CONFIG_NOCACHE x-processing-time: - - 257ms + - 126ms status: code: 204 message: No Content @@ -351,9 +355,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:52:57 GMT + - Tue, 07 Sep 2021 21:43:54 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -363,11 +367,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:52:58 GMT + - Tue, 07 Sep 2021 21:43:55 GMT ms-cv: - - cQZhKYzCikGiqhT3eXhJ4A.0 + - BIOEHi6Jz0CGU5vyihCK2Q.0 request-context: - appId= strict-transport-security: @@ -375,7 +380,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 664ms + - 625ms status: code: 204 message: No Content @@ -391,9 +396,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:52:58 GMT + - Tue, 07 Sep 2021 21:43:55 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -403,11 +408,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:52:58 GMT + - Tue, 07 Sep 2021 21:43:55 GMT ms-cv: - - EFf8o6CvCk+VlW6ZWZ57ag.0 + - 97lkVopij0OE3/cXKG3GUg.0 request-context: - appId= strict-transport-security: @@ -415,7 +421,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 563ms + - 463ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_get_properties.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_get_properties.yaml index 964de05022f0..61a87e34a8f2 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_get_properties.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_get_properties.yaml @@ -13,24 +13,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:52:59 GMT + - Tue, 07 Sep 2021 21:43:56 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d561-0a36-28c5-593a0d001bcf"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-5b2e-497d-2548220048f5"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:52:59 GMT + - Tue, 07 Sep 2021 21:43:56 GMT ms-cv: - - gidDQVUDekaenMwsLroXVg.0 + - NchWgoL+KEy7VGwx6dEXXQ.0 request-context: - appId= strict-transport-security: @@ -40,7 +41,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 29ms + - 100ms status: code: 201 message: Created @@ -58,24 +59,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:52:59 GMT + - Tue, 07 Sep 2021 21:43:56 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:52:58.6871619+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:43:56.8076168+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:52:59 GMT + - Tue, 07 Sep 2021 21:43:56 GMT ms-cv: - - 2phab7zz8U2Av91LApxy4g.0 + - ijwy5gFUvk+ptoMdnmg24w.0 request-context: - appId= strict-transport-security: @@ -85,7 +87,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 42ms + - 157ms status: code: 200 message: OK @@ -103,24 +105,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:52:59 GMT + - Tue, 07 Sep 2021 21:43:56 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d561-0af6-28c5-593a0d001bd0"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-5d05-497d-2548220048f6"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:52:59 GMT + - Tue, 07 Sep 2021 21:43:56 GMT ms-cv: - - vuehMXX20k+Hv+GvTd/Yjw.0 + - N0OTtxpkc0CLHV/sQveUsA.0 request-context: - appId= strict-transport-security: @@ -130,7 +133,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 33ms + - 130ms status: code: 201 message: Created @@ -148,24 +151,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:52:59 GMT + - Tue, 07 Sep 2021 21:43:57 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:52:58.8764278+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:43:57.3285111+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:52:59 GMT + - Tue, 07 Sep 2021 21:43:57 GMT ms-cv: - - E7vFE+bEWUmOwwMXVfMnlQ.0 + - vrnFbJKs4EGHp+apoyXCug.0 request-context: - appId= strict-transport-security: @@ -175,7 +179,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 44ms + - 159ms status: code: 200 message: OK @@ -193,26 +197,26 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) repeatability-request-id: - - f4f2f85f-1a8c-49ef-b712-05d30d214b63 + - dacb368f-bbdf-4289-9dba-bee34ac1b1f7 method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 response: - body: '{"chatThread": {"id": "19:cwsBqfi5P16U-E_PwkGgEcQcCg8z74f7OJfDhf2NRh01@thread.v2", - "topic": "test topic", "createdOn": "2021-06-22T20:53:00Z", "createdByCommunicationIdentifier": - {"rawId": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d561-0a36-28c5-593a0d001bcf", - "communicationUser": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d561-0a36-28c5-593a0d001bcf"}}}}' + body: '{"chatThread": {"id": "19:4HxOWVifAPN5gxQVhJqP4d-wMrUt2bT5kZXWX3fnNTc1@thread.v2", + "topic": "test topic", "createdOn": "2021-09-07T21:43:57Z", "createdByCommunicationIdentifier": + {"rawId": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-5b2e-497d-2548220048f5", + "communicationUser": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-5b2e-497d-2548220048f5"}}}}' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:52:59 GMT + - Tue, 07 Sep 2021 21:43:57 GMT ms-cv: - - EqMQTSelQEqNupIBD6T6QQ.0 + - FD29Ak3/9UOpUmXlgoGy9A.0 strict-transport-security: - max-age=2592000 transfer-encoding: @@ -220,7 +224,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 448ms + - 536ms status: code: 201 message: Created @@ -234,23 +238,23 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: GET - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 response: - body: '{"id": "sanitized", "topic": "test topic", "createdOn": "2021-06-22T20:53:00Z", - "createdByCommunicationIdentifier": {"rawId": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d561-0a36-28c5-593a0d001bcf", - "communicationUser": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d561-0a36-28c5-593a0d001bcf"}}}' + body: '{"id": "sanitized", "topic": "test topic", "createdOn": "2021-09-07T21:43:57Z", + "createdByCommunicationIdentifier": {"rawId": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-5b2e-497d-2548220048f5", + "communicationUser": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-5b2e-497d-2548220048f5"}}}' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:00 GMT + - Tue, 07 Sep 2021 21:43:57 GMT ms-cv: - - /bi1FXiao0y/xvLterHScg.0 + - +C8A+GKsHkGcIQQ/4FNjSQ.0 strict-transport-security: - max-age=2592000 transfer-encoding: @@ -258,7 +262,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 78ms + - 347ms status: code: 200 message: OK @@ -274,26 +278,26 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 response: body: string: '' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 date: - - Tue, 22 Jun 2021 20:53:00 GMT + - Tue, 07 Sep 2021 21:43:58 GMT ms-cv: - - 2IxEFt9ybkG3gNINgY8O+Q.0 + - br50fOuTSEmLkhvChWAMag.0 strict-transport-security: - max-age=2592000 x-cache: - CONFIG_NOCACHE x-processing-time: - - 163ms + - 191ms status: code: 204 message: No Content @@ -309,9 +313,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:01 GMT + - Tue, 07 Sep 2021 21:43:58 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -321,11 +325,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:53:02 GMT + - Tue, 07 Sep 2021 21:43:59 GMT ms-cv: - - ejBwpkXvCUS+XNnVD8e/EA.0 + - ZR5nDx6c40Oh7hHsZXt5FQ.0 request-context: - appId= strict-transport-security: @@ -333,7 +338,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 822ms + - 427ms status: code: 204 message: No Content @@ -349,9 +354,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:02 GMT + - Tue, 07 Sep 2021 21:43:59 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -361,11 +366,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:53:02 GMT + - Tue, 07 Sep 2021 21:43:59 GMT ms-cv: - - a33rA3Yc+EWEC30cSKX61Q.0 + - VmJavMligkSM4guevvBWyA.0 request-context: - appId= strict-transport-security: @@ -373,7 +379,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 682ms + - 401ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_list_messages.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_list_messages.yaml index fe112c14506d..c14209b3408a 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_list_messages.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_list_messages.yaml @@ -13,24 +13,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:03 GMT + - Tue, 07 Sep 2021 21:43:59 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d561-1a9b-e3c7-593a0d001af6"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-6975-dc7b-2548220015a8"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:03 GMT + - Tue, 07 Sep 2021 21:43:59 GMT ms-cv: - - XxjSxEXcr0yeB3LwWpKrWw.0 + - QiAO4B7uIkWAFBs223J8QQ.0 request-context: - appId= strict-transport-security: @@ -40,7 +41,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 33ms + - 91ms status: code: 201 message: Created @@ -58,24 +59,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:03 GMT + - Tue, 07 Sep 2021 21:44:00 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:53:02.8820605+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:44:00.5005111+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:03 GMT + - Tue, 07 Sep 2021 21:43:59 GMT ms-cv: - - 0Sm8wtmUL06twwBDAIqayQ.0 + - +VlkuK3kAkWUlptuCQdwAg.0 request-context: - appId= strict-transport-security: @@ -85,7 +87,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 37ms + - 158ms status: code: 200 message: OK @@ -103,24 +105,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:03 GMT + - Tue, 07 Sep 2021 21:44:00 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d561-1b65-e3c7-593a0d001af7"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-6b80-dc7b-2548220015a9"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:03 GMT + - Tue, 07 Sep 2021 21:44:00 GMT ms-cv: - - Wip+OVoQHUaijH1SnHH6iQ.0 + - DiO+d1PR90qGxm4qSPeXJw.0 request-context: - appId= strict-transport-security: @@ -130,7 +133,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 32ms + - 90ms status: code: 201 message: Created @@ -148,24 +151,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:04 GMT + - Tue, 07 Sep 2021 21:44:00 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:53:03.0774892+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:44:00.9791418+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:03 GMT + - Tue, 07 Sep 2021 21:44:00 GMT ms-cv: - - 0i289LekwEOikg+BVA3UfQ.0 + - BheM+ce4d0y3f89hnJiOlQ.0 request-context: - appId= strict-transport-security: @@ -175,7 +179,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 38ms + - 156ms status: code: 200 message: OK @@ -193,26 +197,26 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) repeatability-request-id: - - 8614c7c6-b342-468d-85b1-bfde25b7de9d + - 00d28564-77e2-4811-bd4f-a6522aed5559 method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 response: - body: '{"chatThread": {"id": "19:vraRn114U16p4LbamnaYDiO8aE4qGmzUCh_LwYJa6F81@thread.v2", - "topic": "test topic", "createdOn": "2021-06-22T20:53:04Z", "createdByCommunicationIdentifier": - {"rawId": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d561-1a9b-e3c7-593a0d001af6", - "communicationUser": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d561-1a9b-e3c7-593a0d001af6"}}}}' + body: '{"chatThread": {"id": "19:DYsMY01mmrxQU44y-plqTu7G8oCzFUAr-EBCtQ9m3qU1@thread.v2", + "topic": "test topic", "createdOn": "2021-09-07T21:44:01Z", "createdByCommunicationIdentifier": + {"rawId": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-6975-dc7b-2548220015a8", + "communicationUser": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-6975-dc7b-2548220015a8"}}}}' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:04 GMT + - Tue, 07 Sep 2021 21:44:01 GMT ms-cv: - - xJzLs8xs/E+Wd6SUL0s+6g.0 + - qqogZuTDHk+JBPBkpw0z5A.0 strict-transport-security: - max-age=2592000 transfer-encoding: @@ -220,7 +224,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 473ms + - 519ms status: code: 201 message: Created @@ -239,21 +243,21 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: POST - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2021-09-07 response: body: '{"id": "sanitized"}' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:05 GMT + - Tue, 07 Sep 2021 21:44:01 GMT ms-cv: - - f8/SrLeJzEudt21Z8SECeA.0 + - dcNTSkKrpkWr7XzQiqR5JA.0 strict-transport-security: - max-age=2592000 transfer-encoding: @@ -261,7 +265,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 387ms + - 195ms status: code: 201 message: Created @@ -275,21 +279,21 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: GET - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?maxPageSize=1&api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?maxPageSize=1&api-version=2021-09-07 response: body: '{"value": "sanitized", "nextLink": "sanitized"}' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:05 GMT + - Tue, 07 Sep 2021 21:44:02 GMT ms-cv: - - 9+11J0zs6UStci2lsiiFKA.0 + - hBtA90Clb0Whp2WinsBDrg.0 strict-transport-security: - max-age=2592000 transfer-encoding: @@ -297,7 +301,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 248ms + - 150ms status: code: 200 message: OK @@ -311,21 +315,21 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: GET - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?syncState=sanitized&startTime=1%2F1%2F1970%2012%3A00%3A00%20AM%20%2B00%3A00&maxPageSize=1&api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?syncState=sanitized&startTime=1%2F1%2F1970%2012%3A00%3A00%20AM%20%2B00%3A00&maxPageSize=1&api-version=2021-09-07 response: body: '{"value": "sanitized", "nextLink": "sanitized"}' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:06 GMT + - Tue, 07 Sep 2021 21:44:02 GMT ms-cv: - - KEAWOb6oxU6KA9Hz39ZIKw.0 + - LmFCh8OnrkK3QOMxKFhrRg.0 strict-transport-security: - max-age=2592000 transfer-encoding: @@ -333,7 +337,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 135ms + - 233ms status: code: 200 message: OK @@ -347,21 +351,21 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: GET - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?syncState=sanitized&startTime=1%2F1%2F1970%2012%3A00%3A00%20AM%20%2B00%3A00&maxPageSize=1&api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?syncState=sanitized&startTime=1%2F1%2F1970%2012%3A00%3A00%20AM%20%2B00%3A00&maxPageSize=1&api-version=2021-09-07 response: body: '{"value": "sanitized", "nextLink": "sanitized"}' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:06 GMT + - Tue, 07 Sep 2021 21:44:02 GMT ms-cv: - - CgimGtMmC06DX6PyMRZSyg.0 + - RwXrhtEfgEKznrHFDyaI5g.0 strict-transport-security: - max-age=2592000 transfer-encoding: @@ -369,7 +373,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 122ms + - 130ms status: code: 200 message: OK @@ -383,21 +387,21 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: GET - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?syncState=sanitized&startTime=1%2F1%2F1970%2012%3A00%3A00%20AM%20%2B00%3A00&maxPageSize=1&api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?syncState=sanitized&startTime=1%2F1%2F1970%2012%3A00%3A00%20AM%20%2B00%3A00&maxPageSize=1&api-version=2021-09-07 response: body: '{"value": "sanitized"}' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:06 GMT + - Tue, 07 Sep 2021 21:44:02 GMT ms-cv: - - qkqyBxwun0yjq1h68TFJqw.0 + - yfXoJOYtDE+AKtia/uWQqw.0 strict-transport-security: - max-age=2592000 transfer-encoding: @@ -405,7 +409,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 140ms + - 173ms status: code: 200 message: OK @@ -421,26 +425,26 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 response: body: string: '' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 date: - - Tue, 22 Jun 2021 20:53:06 GMT + - Tue, 07 Sep 2021 21:44:02 GMT ms-cv: - - 7HyA7KtuSkKaBUeV+n+PSQ.0 + - +iF5yzt1pEeK0EM3MWRtDw.0 strict-transport-security: - max-age=2592000 x-cache: - CONFIG_NOCACHE x-processing-time: - - 163ms + - 129ms status: code: 204 message: No Content @@ -456,9 +460,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:07 GMT + - Tue, 07 Sep 2021 21:44:03 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -468,11 +472,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:53:07 GMT + - Tue, 07 Sep 2021 21:44:03 GMT ms-cv: - - XqxzZLOwaESAnTU61BMWKw.0 + - muhtBq+1AUGf7pD9WN+6rw.0 request-context: - appId= strict-transport-security: @@ -480,7 +485,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 653ms + - 556ms status: code: 204 message: No Content @@ -496,9 +501,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:07 GMT + - Tue, 07 Sep 2021 21:44:04 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -508,11 +513,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:53:07 GMT + - Tue, 07 Sep 2021 21:44:03 GMT ms-cv: - - KrRW27v7vke+bGa6sB1ooQ.0 + - Yqekd7eK10e9MF0OdamT9Q.0 request-context: - appId= strict-transport-security: @@ -520,7 +526,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 495ms + - 410ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_list_participants.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_list_participants.yaml index 34a02528286b..a602101fbb58 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_list_participants.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_list_participants.yaml @@ -13,24 +13,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:08 GMT + - Tue, 07 Sep 2021 21:44:04 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d561-2d87-e3c7-593a0d001afd"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-7b47-dc7b-2548220015aa"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:08 GMT + - Tue, 07 Sep 2021 21:44:04 GMT ms-cv: - - Rluqi/eOcU6dMQwjIKC6AQ.0 + - i35wMt8XfkO1pUvJifP81w.0 request-context: - appId= strict-transport-security: @@ -40,7 +41,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 32ms + - 90ms status: code: 201 message: Created @@ -58,24 +59,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:08 GMT + - Tue, 07 Sep 2021 21:44:04 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:53:07.9578099+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:44:05.0042623+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:08 GMT + - Tue, 07 Sep 2021 21:44:04 GMT ms-cv: - - CK5W7uXtdkmqa2Q53s6lYw.0 + - OTF8j+3TFEaUNUQoe0aZ+g.0 request-context: - appId= strict-transport-security: @@ -85,7 +87,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 32ms + - 156ms status: code: 200 message: OK @@ -103,24 +105,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:08 GMT + - Tue, 07 Sep 2021 21:44:05 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d561-2f79-e3c7-593a0d001afe"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-7d05-dc7b-2548220015ab"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:08 GMT + - Tue, 07 Sep 2021 21:44:04 GMT ms-cv: - - fTyl4H0ty0umoTwv7SezUQ.0 + - ia0nkWNDtk2NuKGS1D2pBQ.0 request-context: - appId= strict-transport-security: @@ -130,7 +133,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 61ms + - 87ms status: code: 201 message: Created @@ -148,24 +151,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:09 GMT + - Tue, 07 Sep 2021 21:44:05 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:53:08.2355618+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:44:05.4458889+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:08 GMT + - Tue, 07 Sep 2021 21:44:04 GMT ms-cv: - - +2oplxi3EUqr2lusN4ziDw.0 + - 6l603i50ckiOnukLiB7w2w.0 request-context: - appId= strict-transport-security: @@ -175,7 +179,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 37ms + - 153ms status: code: 200 message: OK @@ -193,26 +197,26 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) repeatability-request-id: - - 25b72693-946f-409f-88e0-8d6310d2ad82 + - 6a3739f2-315d-475c-a37f-5df72696dd17 method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 response: - body: '{"chatThread": {"id": "19:0br5s3BTIsrwva4YZlbfaabAuOjWyXIbVyNh2PQCiiI1@thread.v2", - "topic": "test topic", "createdOn": "2021-06-22T20:53:09Z", "createdByCommunicationIdentifier": - {"rawId": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d561-2d87-e3c7-593a0d001afd", - "communicationUser": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d561-2d87-e3c7-593a0d001afd"}}}}' + body: '{"chatThread": {"id": "19:2w0PdVlhYPyR0zqQMm7dJHVR4y-kyyzig_fSyQdjEhI1@thread.v2", + "topic": "test topic", "createdOn": "2021-09-07T21:44:05Z", "createdByCommunicationIdentifier": + {"rawId": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-7b47-dc7b-2548220015aa", + "communicationUser": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-7b47-dc7b-2548220015aa"}}}}' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:09 GMT + - Tue, 07 Sep 2021 21:44:05 GMT ms-cv: - - oeY2bcXYNUibkNW6RjIT5g.0 + - RrGgwkVe0UySgOfhclXR3g.0 strict-transport-security: - max-age=2592000 transfer-encoding: @@ -220,7 +224,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 388ms + - 342ms status: code: 201 message: Created @@ -238,21 +242,21 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: POST - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/participants/:add?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/participants/:add?api-version=2021-09-07 response: body: '{}' headers: api-supported-versions: - 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, 2021-03-07, - 2021-04-05-preview6 + 2021-04-05-preview6, 2021-09-07 content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:09 GMT + - Tue, 07 Sep 2021 21:44:06 GMT ms-cv: - - Ti4/ZA+BF0W381v8cbyMxQ.0 + - 4iB6teLWRk621oR8648tBw.0 strict-transport-security: - max-age=2592000 transfer-encoding: @@ -260,7 +264,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 232ms + - 471ms status: code: 201 message: Created @@ -274,21 +278,21 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: GET - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/participants?maxPageSize=1&skip=1&api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/participants?maxPageSize=1&skip=1&api-version=2021-09-07 response: body: '{"value": "sanitized"}' headers: api-supported-versions: - 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, 2021-03-07, - 2021-04-05-preview6 + 2021-04-05-preview6, 2021-09-07 content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:10 GMT + - Tue, 07 Sep 2021 21:44:06 GMT ms-cv: - - jtJiO+vgSkKgprINEk5YVQ.0 + - 1Vgnn+vNd0SjS3kDjmwlpA.0 strict-transport-security: - max-age=2592000 transfer-encoding: @@ -296,7 +300,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 90ms + - 112ms status: code: 200 message: OK @@ -312,26 +316,26 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 response: body: string: '' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 date: - - Tue, 22 Jun 2021 20:53:10 GMT + - Tue, 07 Sep 2021 21:44:06 GMT ms-cv: - - p2SuPL7P40eykdmcjjT3UQ.0 + - pkAIw/AoWkqLjJKoijV8tA.0 strict-transport-security: - max-age=2592000 x-cache: - CONFIG_NOCACHE x-processing-time: - - 133ms + - 127ms status: code: 204 message: No Content @@ -347,9 +351,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:11 GMT + - Tue, 07 Sep 2021 21:44:06 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -359,11 +363,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:53:11 GMT + - Tue, 07 Sep 2021 21:44:06 GMT ms-cv: - - baMV3AnyNky8tPeBX5lw2A.0 + - 1XjIXFYdkku+wGddrXDkoA.0 request-context: - appId= strict-transport-security: @@ -371,7 +376,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 496ms + - 553ms status: code: 204 message: No Content @@ -387,9 +392,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:11 GMT + - Tue, 07 Sep 2021 21:44:07 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -399,11 +404,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:53:11 GMT + - Tue, 07 Sep 2021 21:44:07 GMT ms-cv: - - fe9iKwA87UasA/GHtUU+RQ.0 + - Kb/STxPSfUWbikxo/DsO9Q.0 request-context: - appId= strict-transport-security: @@ -411,7 +417,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 780ms + - 488ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_list_read_receipts.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_list_read_receipts.yaml index da10316d9e76..ae43c5206378 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_list_read_receipts.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_list_read_receipts.yaml @@ -13,24 +13,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:12 GMT + - Tue, 07 Sep 2021 21:44:08 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d561-3e21-b8ba-a43a0d002cea"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-89b0-ac00-343a0d000c86"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:12 GMT + - Tue, 07 Sep 2021 21:44:07 GMT ms-cv: - - fHf029up8kuT+ODkZAmEeg.0 + - hID6s1iAREuXWPAGpSOZ2A.0 request-context: - appId= strict-transport-security: @@ -40,7 +41,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 60ms + - 56ms status: code: 201 message: Created @@ -58,24 +59,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:12 GMT + - Tue, 07 Sep 2021 21:44:08 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:53:12.1709642+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:44:08.5206984+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:13 GMT + - Tue, 07 Sep 2021 21:44:07 GMT ms-cv: - - mlOYNkC/ZEiqZQCYum+K+Q.0 + - WMg/dw9sRUylCrTVLH+gqQ.0 request-context: - appId= strict-transport-security: @@ -85,7 +87,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 139ms + - 33ms status: code: 200 message: OK @@ -103,24 +105,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:13 GMT + - Tue, 07 Sep 2021 21:44:08 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d561-3ff1-b8ba-a43a0d002ceb"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-8a84-c6f3-343a0d001585"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:13 GMT + - Tue, 07 Sep 2021 21:44:07 GMT ms-cv: - - FVBq2qpqVEehAl4WMVZX/A.0 + - fUtxzOY4SkCo9jfgISIZVw.0 request-context: - appId= strict-transport-security: @@ -130,7 +133,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 62ms + - 25ms status: code: 201 message: Created @@ -148,24 +151,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:13 GMT + - Tue, 07 Sep 2021 21:44:08 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:53:12.6692365+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:44:08.6658613+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:13 GMT + - Tue, 07 Sep 2021 21:44:07 GMT ms-cv: - - VjZ1o+IGI0WTECW7C5fO7Q.0 + - R/OR3L0co0yjq3hTrPRV9A.0 request-context: - appId= strict-transport-security: @@ -175,7 +179,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 137ms + - 32ms status: code: 200 message: OK @@ -193,26 +197,26 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) repeatability-request-id: - - 7d46b5b6-7a25-4d7d-8aee-ad8407169ea1 + - e48420a0-d08a-406f-8951-51db6db18567 method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 response: - body: '{"chatThread": {"id": "19:wpJTRn5aSw3d4G3M1Lx45w56nPcIvSR7HiyTG-a0Q4Y1@thread.v2", - "topic": "test topic", "createdOn": "2021-06-22T20:53:14Z", "createdByCommunicationIdentifier": - {"rawId": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d561-3e21-b8ba-a43a0d002cea", - "communicationUser": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d561-3e21-b8ba-a43a0d002cea"}}}}' + body: '{"chatThread": {"id": "19:bheEcsrnjFg-QGgcB95oAJJAa4Rp4k7jzc2ZCpN9WUI1@thread.v2", + "topic": "test topic", "createdOn": "2021-09-07T21:44:08Z", "createdByCommunicationIdentifier": + {"rawId": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-89b0-ac00-343a0d000c86", + "communicationUser": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-89b0-ac00-343a0d000c86"}}}}' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:14 GMT + - Tue, 07 Sep 2021 21:44:09 GMT ms-cv: - - WMIPcRV1DE2QymDdVSubTw.0 + - PTSY11ZeTUimCuu/h5Hmdw.0 strict-transport-security: - max-age=2592000 transfer-encoding: @@ -220,7 +224,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 627ms + - 464ms status: code: 201 message: Created @@ -239,21 +243,21 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: POST - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2021-09-07 response: body: '{"id": "sanitized"}' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:15 GMT + - Tue, 07 Sep 2021 21:44:09 GMT ms-cv: - - CfjVEQ4yK0ikYCBocZpwDg.0 + - mcgnT+Sz/kGXQ/dy9KPfNQ.0 strict-transport-security: - max-age=2592000 transfer-encoding: @@ -261,7 +265,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 300ms + - 210ms status: code: 201 message: Created @@ -279,28 +283,28 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: POST - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/readReceipts?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/readReceipts?api-version=2021-09-07 response: body: string: '' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-length: - '0' date: - - Tue, 22 Jun 2021 20:53:15 GMT + - Tue, 07 Sep 2021 21:44:09 GMT ms-cv: - - 0ApUVuUYQ0yCxpTCzbz1MA.0 + - gTGJTEfaH0Os1UBUblCmAQ.0 strict-transport-security: - max-age=2592000 x-cache: - CONFIG_NOCACHE x-processing-time: - - 105ms + - 354ms status: code: 200 message: OK @@ -314,21 +318,21 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: GET - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/readReceipts?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/readReceipts?api-version=2021-09-07 response: body: '{"value": "sanitized"}' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:15 GMT + - Tue, 07 Sep 2021 21:44:10 GMT ms-cv: - - 2swZZP/ScU+cOSS4pD6mww.0 + - JWXZuJgh9UmnMPzXTidrig.0 strict-transport-security: - max-age=2592000 transfer-encoding: @@ -336,7 +340,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 352ms + - 141ms status: code: 200 message: OK @@ -355,21 +359,21 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: POST - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2021-09-07 response: body: '{"id": "sanitized"}' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:16 GMT + - Tue, 07 Sep 2021 21:44:10 GMT ms-cv: - - WdxhwXJo1kefM2D8x3ikOQ.0 + - cna9O0XZ/0CzMBxvt63viQ.0 strict-transport-security: - max-age=2592000 transfer-encoding: @@ -377,7 +381,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 327ms + - 210ms status: code: 201 message: Created @@ -395,28 +399,28 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: POST - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/readReceipts?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/readReceipts?api-version=2021-09-07 response: body: string: '' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-length: - '0' date: - - Tue, 22 Jun 2021 20:53:16 GMT + - Tue, 07 Sep 2021 21:44:10 GMT ms-cv: - - ylsoKw+1lEaJukci67zgpQ.0 + - 16KkZCpN3k+Xg+uHXrdCpg.0 strict-transport-security: - max-age=2592000 x-cache: - CONFIG_NOCACHE x-processing-time: - - 106ms + - 214ms status: code: 200 message: OK @@ -430,21 +434,21 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: GET - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/readReceipts?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/readReceipts?api-version=2021-09-07 response: body: '{"value": "sanitized"}' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:17 GMT + - Tue, 07 Sep 2021 21:44:10 GMT ms-cv: - - M4KP5msYP0KUXXatKodjQQ.0 + - 13BfXWVhrUqW/2SiAr5SLQ.0 strict-transport-security: - max-age=2592000 transfer-encoding: @@ -452,7 +456,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 292ms + - 166ms status: code: 200 message: OK @@ -471,21 +475,21 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: POST - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2021-09-07 response: body: '{"id": "sanitized"}' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:17 GMT + - Tue, 07 Sep 2021 21:44:11 GMT ms-cv: - - JWc/YZqq1Eu8BSezJgDfPQ.0 + - QKaapJefwEu98OYM++lOyw.0 strict-transport-security: - max-age=2592000 transfer-encoding: @@ -493,7 +497,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 346ms + - 202ms status: code: 201 message: Created @@ -511,28 +515,28 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: POST - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/readReceipts?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/readReceipts?api-version=2021-09-07 response: body: string: '' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-length: - '0' date: - - Tue, 22 Jun 2021 20:53:17 GMT + - Tue, 07 Sep 2021 21:44:11 GMT ms-cv: - - j9Sdx/cSN0Kb1dKlsnhUpQ.0 + - iJmY8LF7m02h3ZRejUNKyA.0 strict-transport-security: - max-age=2592000 x-cache: - CONFIG_NOCACHE x-processing-time: - - 124ms + - 542ms status: code: 200 message: OK @@ -546,21 +550,21 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: GET - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/readReceipts?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/readReceipts?api-version=2021-09-07 response: body: '{"value": "sanitized"}' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:18 GMT + - Tue, 07 Sep 2021 21:44:12 GMT ms-cv: - - 9Dh5KNDkjEiDSEzRUvSuzg.0 + - GqWjXOx+oUioH1mwmFiihg.0 strict-transport-security: - max-age=2592000 transfer-encoding: @@ -568,7 +572,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 153ms + - 107ms status: code: 200 message: OK @@ -582,21 +586,21 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: GET - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/readReceipts?maxPageSize=2&skip=0&api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/readReceipts?maxPageSize=2&skip=0&api-version=2021-09-07 response: body: '{"value": "sanitized"}' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:18 GMT + - Tue, 07 Sep 2021 21:44:12 GMT ms-cv: - - 1VPnxLIpgUOkkHYRxHFIDQ.0 + - 7DnTg+zE2kSV+bcnq2mhzQ.0 strict-transport-security: - max-age=2592000 transfer-encoding: @@ -604,7 +608,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 242ms + - 134ms status: code: 200 message: OK @@ -620,26 +624,26 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 response: body: string: '' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 date: - - Tue, 22 Jun 2021 20:53:18 GMT + - Tue, 07 Sep 2021 21:44:12 GMT ms-cv: - - 3vrdi7D8jU+7gEbplWdTrA.0 + - qzayVFA6QkyQ8+OzQiRZIQ.0 strict-transport-security: - max-age=2592000 x-cache: - CONFIG_NOCACHE x-processing-time: - - 244ms + - 131ms status: code: 204 message: No Content @@ -655,9 +659,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:19 GMT + - Tue, 07 Sep 2021 21:44:12 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -667,11 +671,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:53:19 GMT + - Tue, 07 Sep 2021 21:44:12 GMT ms-cv: - - FtE9hcMmuUC5kWzmNcUzig.0 + - 4q6S1++VmEiyQBFBCnw5pQ.0 request-context: - appId= strict-transport-security: @@ -679,7 +684,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 627ms + - 419ms status: code: 204 message: No Content @@ -695,9 +700,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:20 GMT + - Tue, 07 Sep 2021 21:44:13 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -707,11 +712,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:53:20 GMT + - Tue, 07 Sep 2021 21:44:12 GMT ms-cv: - - nzxtfmFkKkay+Hls9rdYOA.0 + - JiVOuvpVBE2d2lKh+Tv2iw.0 request-context: - appId= strict-transport-security: @@ -719,7 +725,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 718ms + - 470ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_remove_participant.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_remove_participant.yaml index 9c65800d5ca5..c995351ffecf 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_remove_participant.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_remove_participant.yaml @@ -13,24 +13,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:20 GMT + - Tue, 07 Sep 2021 21:44:13 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d561-5fb4-7f07-113a0d003339"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-9f30-5505-4548220010ef"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:21 GMT + - Tue, 07 Sep 2021 21:44:13 GMT ms-cv: - - GuyGzQIX8E+Qz3rFYdDezQ.0 + - VF+fHehiX06vVuu+nRl2Zw.0 request-context: - appId= strict-transport-security: @@ -40,7 +41,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 93ms + - 71ms status: code: 201 message: Created @@ -58,24 +59,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:21 GMT + - Tue, 07 Sep 2021 21:44:14 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:53:20.8161891+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:44:14.1500095+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:21 GMT + - Tue, 07 Sep 2021 21:44:13 GMT ms-cv: - - HV8G2cJnUUWV33uDFoLVsw.0 + - HuqIZnBOF0S2w91fZaL9bA.0 request-context: - appId= strict-transport-security: @@ -85,7 +87,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 164ms + - 151ms status: code: 200 message: OK @@ -103,24 +105,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:21 GMT + - Tue, 07 Sep 2021 21:44:14 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d561-6194-7f07-113a0d00333a"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-a10e-5505-4548220010f0"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:21 GMT + - Tue, 07 Sep 2021 21:44:13 GMT ms-cv: - - UUiH97VEAU2pplPeeZ+0TA.0 + - wbXFKE2klEKMA6hHLaIW8g.0 request-context: - appId= strict-transport-security: @@ -130,7 +133,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 89ms + - 125ms status: code: 201 message: Created @@ -148,24 +151,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:22 GMT + - Tue, 07 Sep 2021 21:44:14 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:53:21.2749423+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:44:14.8289899+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:22 GMT + - Tue, 07 Sep 2021 21:44:13 GMT ms-cv: - - xh9jGvTPbkSa5hIT/eouTQ.0 + - Ls7YC7XyRUiInYFsNoUpaA.0 request-context: - appId= strict-transport-security: @@ -175,7 +179,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 162ms + - 231ms status: code: 200 message: OK @@ -193,26 +197,26 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) repeatability-request-id: - - 64288911-987d-4cdb-93fb-f10417537668 + - 19a87920-4186-4b8f-9df9-7335900d164a method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 response: - body: '{"chatThread": {"id": "19:0oyHLO0Q80qnPax4RVGXdoRRVE5Z8SaMetegO5WtUkQ1@thread.v2", - "topic": "test topic", "createdOn": "2021-06-22T20:53:22Z", "createdByCommunicationIdentifier": - {"rawId": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d561-5fb4-7f07-113a0d003339", - "communicationUser": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d561-5fb4-7f07-113a0d003339"}}}}' + body: '{"chatThread": {"id": "19:ZTiS9evehERrMAL6c64Fyya5Lm6dahqNsEbrDzO3wuk1@thread.v2", + "topic": "test topic", "createdOn": "2021-09-07T21:44:15Z", "createdByCommunicationIdentifier": + {"rawId": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-9f30-5505-4548220010ef", + "communicationUser": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-9f30-5505-4548220010ef"}}}}' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:22 GMT + - Tue, 07 Sep 2021 21:44:15 GMT ms-cv: - - jzmK3rvGtkicAR1lgdsflQ.0 + - eUwP75UUcUChYYkWCHBLRw.0 strict-transport-security: - max-age=2592000 transfer-encoding: @@ -220,7 +224,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 700ms + - 634ms status: code: 201 message: Created @@ -238,21 +242,21 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: POST - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/participants/:add?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/participants/:add?api-version=2021-09-07 response: body: '{}' headers: api-supported-versions: - 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, 2021-03-07, - 2021-04-05-preview6 + 2021-04-05-preview6, 2021-09-07 content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:23 GMT + - Tue, 07 Sep 2021 21:44:15 GMT ms-cv: - - 7KcGmsNMwkW1HNSbQ0qDiQ.0 + - TRGvz+F5kUe4meXXBH+7FQ.0 strict-transport-security: - max-age=2592000 transfer-encoding: @@ -260,13 +264,13 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 321ms + - 376ms status: code: 201 message: Created - request: - body: '{"rawId": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d561-6194-7f07-113a0d00333a", - "communicationUser": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d561-6194-7f07-113a0d00333a"}}' + body: '{"rawId": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-a10e-5505-4548220010f0", + "communicationUser": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-a10e-5505-4548220010f0"}}' headers: Accept: - application/json @@ -279,26 +283,26 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: POST - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/participants/:remove?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/participants/:remove?api-version=2021-09-07 response: body: string: '' headers: api-supported-versions: - 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, 2021-03-07, - 2021-04-05-preview6 + 2021-04-05-preview6, 2021-09-07 date: - - Tue, 22 Jun 2021 20:53:24 GMT + - Tue, 07 Sep 2021 21:44:16 GMT ms-cv: - - xQefzArrQU+jLAFhP0ti6Q.0 + - Lkc1sR/dWEe742u4HyfLUw.0 strict-transport-security: - max-age=2592000 x-cache: - CONFIG_NOCACHE x-processing-time: - - 350ms + - 425ms status: code: 204 message: No Content @@ -314,26 +318,26 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 response: body: string: '' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 date: - - Tue, 22 Jun 2021 20:53:24 GMT + - Tue, 07 Sep 2021 21:44:16 GMT ms-cv: - - cg7UC/jYEEW0wGr5kqQQgA.0 + - SX2bOPOzbUG2NOLKjlJFRg.0 strict-transport-security: - max-age=2592000 x-cache: - CONFIG_NOCACHE x-processing-time: - - 302ms + - 208ms status: code: 204 message: No Content @@ -349,9 +353,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:24 GMT + - Tue, 07 Sep 2021 21:44:17 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -361,11 +365,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:53:25 GMT + - Tue, 07 Sep 2021 21:44:16 GMT ms-cv: - - gsxrvN956kGuqQBhnS0Xzw.0 + - 0DMzVDvgWUSMvG4Ni/Ul2A.0 request-context: - appId= strict-transport-security: @@ -373,7 +378,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 627ms + - 356ms status: code: 204 message: No Content @@ -389,9 +394,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:25 GMT + - Tue, 07 Sep 2021 21:44:17 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -401,11 +406,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:53:26 GMT + - Tue, 07 Sep 2021 21:44:16 GMT ms-cv: - - +5ImzKkfo0OBkmeyYZ2FXg.0 + - dQC44mIRTkaA9LZv42/3Yw.0 request-context: - appId= strict-transport-security: @@ -413,7 +419,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 683ms + - 262ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_send_message.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_send_message.yaml index 5a3d66d634a0..fa6910725454 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_send_message.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_send_message.yaml @@ -13,24 +13,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:26 GMT + - Tue, 07 Sep 2021 21:44:17 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d561-75b0-7f07-113a0d00333e"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-b026-a808-454822001712"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:26 GMT + - Tue, 07 Sep 2021 21:44:17 GMT ms-cv: - - e/M9zbkgvk+2x+PPER/ykA.0 + - ZwGoOSPSsEu26uteS2TzmA.0 request-context: - appId= strict-transport-security: @@ -40,7 +41,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 92ms + - 110ms status: code: 201 message: Created @@ -58,24 +59,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:27 GMT + - Tue, 07 Sep 2021 21:44:18 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:53:26.5023506+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:44:18.5799863+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:27 GMT + - Tue, 07 Sep 2021 21:44:18 GMT ms-cv: - - LDLFPZYQx0yhDeveIi2fXA.0 + - Z/x4eQ6QukCE92T9shq5+Q.0 request-context: - appId= strict-transport-security: @@ -85,7 +87,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 183ms + - 241ms status: code: 200 message: OK @@ -103,24 +105,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:27 GMT + - Tue, 07 Sep 2021 21:44:18 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d561-78f0-7f07-113a0d003340"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-b1ef-a808-454822001713"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:27 GMT + - Tue, 07 Sep 2021 21:44:18 GMT ms-cv: - - U+soSJC8mUSz5/jQ8D5wpg.0 + - Lo11tlDWZEqRO/FYQ9KfHg.0 request-context: - appId= strict-transport-security: @@ -130,7 +133,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 120ms + - 62ms status: code: 201 message: Created @@ -148,24 +151,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:28 GMT + - Tue, 07 Sep 2021 21:44:18 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:53:27.3067682+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:44:18.9146958+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:28 GMT + - Tue, 07 Sep 2021 21:44:18 GMT ms-cv: - - XIEOkE0fqk2VEB3lwaRJ7Q.0 + - 02RBBjogCE26afGx1ncNXg.0 request-context: - appId= strict-transport-security: @@ -175,7 +179,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 157ms + - 126ms status: code: 200 message: OK @@ -193,26 +197,26 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) repeatability-request-id: - - a35c8257-5af7-427d-8357-5c6047318e3e + - 2ac3cf12-2045-4a10-8719-ef5a6688a666 method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 response: - body: '{"chatThread": {"id": "19:vR7qiRNiD_0wWQfsiPL_8WwUsUQPBsr8NPvYTq5d4jo1@thread.v2", - "topic": "test topic", "createdOn": "2021-06-22T20:53:28Z", "createdByCommunicationIdentifier": - {"rawId": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d561-75b0-7f07-113a0d00333e", - "communicationUser": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d561-75b0-7f07-113a0d00333e"}}}}' + body: '{"chatThread": {"id": "19:jed61K4TYNwH2_nLxPDLW_ViHq71mymh2-ImrBl3dkQ1@thread.v2", + "topic": "test topic", "createdOn": "2021-09-07T21:44:19Z", "createdByCommunicationIdentifier": + {"rawId": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-b026-a808-454822001712", + "communicationUser": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-b026-a808-454822001712"}}}}' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:28 GMT + - Tue, 07 Sep 2021 21:44:19 GMT ms-cv: - - DnJbWwBN5ESfxpTNIGqhUA.0 + - w59cw/PPkEKxIxq2eFynGg.0 strict-transport-security: - max-age=2592000 transfer-encoding: @@ -220,7 +224,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 409ms + - 590ms status: code: 201 message: Created @@ -239,21 +243,21 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: POST - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2021-09-07 response: body: '{"id": "sanitized"}' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:29 GMT + - Tue, 07 Sep 2021 21:44:19 GMT ms-cv: - - +5/VKxVfwUOhIHMP70xKEw.0 + - XnqomjbJXkC5blD0nPcEnw.0 strict-transport-security: - max-age=2592000 transfer-encoding: @@ -261,7 +265,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 276ms + - 205ms status: code: 201 message: Created @@ -277,26 +281,26 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 response: body: string: '' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 date: - - Tue, 22 Jun 2021 20:53:29 GMT + - Tue, 07 Sep 2021 21:44:19 GMT ms-cv: - - 8C9BadazikSaZeAgH1bBCw.0 + - 5UBQXeUNI0CtK1PMnhWXiw.0 strict-transport-security: - max-age=2592000 x-cache: - CONFIG_NOCACHE x-processing-time: - - 196ms + - 108ms status: code: 204 message: No Content @@ -312,9 +316,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:30 GMT + - Tue, 07 Sep 2021 21:44:20 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -324,11 +328,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:53:31 GMT + - Tue, 07 Sep 2021 21:44:20 GMT ms-cv: - - 1FBeqW1Noku1KBz9CZJn0g.0 + - REfAoh27+k2ABre1beWhjw.0 request-context: - appId= strict-transport-security: @@ -336,7 +341,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 854ms + - 497ms status: code: 204 message: No Content @@ -352,9 +357,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:31 GMT + - Tue, 07 Sep 2021 21:44:20 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -364,11 +369,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:53:31 GMT + - Tue, 07 Sep 2021 21:44:20 GMT ms-cv: - - WJc4DNtM+U2H8YNFhmt6Vw.0 + - v+fM7qT22kimt3q6ziwaZw.0 request-context: - appId= strict-transport-security: @@ -376,7 +382,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 656ms + - 327ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_send_read_receipt.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_send_read_receipt.yaml index e56eabf5ce26..1db6cb17814a 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_send_read_receipt.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_send_read_receipt.yaml @@ -13,24 +13,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:32 GMT + - Tue, 07 Sep 2021 21:44:21 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d561-8e91-7f07-113a0d003343"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-bc48-497d-2548220048f7"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:33 GMT + - Tue, 07 Sep 2021 21:44:20 GMT ms-cv: - - YC+hyU3EtUmhOQUN+25Qtg.0 + - e62aiBTQZ0mQLs4o6f24wQ.0 request-context: - appId= strict-transport-security: @@ -58,24 +59,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:33 GMT + - Tue, 07 Sep 2021 21:44:21 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:53:32.8408559+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:44:21.7156815+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:33 GMT + - Tue, 07 Sep 2021 21:44:21 GMT ms-cv: - - +teTKivEfEOwOp4uWzVmBQ.0 + - Q9GqY5l360CFoYMf9PgDVg.0 request-context: - appId= strict-transport-security: @@ -85,7 +87,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 161ms + - 216ms status: code: 200 message: OK @@ -103,24 +105,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:33 GMT + - Tue, 07 Sep 2021 21:44:21 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d561-90c1-7f07-113a0d003346"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-be58-497d-2548220048f8"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:33 GMT + - Tue, 07 Sep 2021 21:44:21 GMT ms-cv: - - GC72mNEmjUmsyJnKAiDK1w.0 + - FpZHLHTCfEewy9+nXuzTcg.0 request-context: - appId= strict-transport-security: @@ -130,7 +133,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 93ms + - 187ms status: code: 201 message: Created @@ -148,24 +151,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:34 GMT + - Tue, 07 Sep 2021 21:44:22 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:53:33.4678143+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:44:22.4669323+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:34 GMT + - Tue, 07 Sep 2021 21:44:22 GMT ms-cv: - - wYvKyI1UxEK5UJ/KSkGsMw.0 + - rPw22qLN7k6032e5DyzQzA.0 request-context: - appId= strict-transport-security: @@ -175,7 +179,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 209ms + - 324ms status: code: 200 message: OK @@ -189,30 +193,30 @@ interactions: Connection: - keep-alive Content-Length: - - '350' + - '349' Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) repeatability-request-id: - - a3b50289-8979-4fd0-89f2-3b68176f405b + - 4bf40443-8f9b-48d7-8a1a-06417e125c6e method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 response: - body: '{"chatThread": {"id": "19:Ve2ZfT4zjCTsHMSPSmkK9mpLlrnk5VALkpg27IViYRk1@thread.v2", - "topic": "test topic", "createdOn": "2021-06-22T20:53:35Z", "createdByCommunicationIdentifier": - {"rawId": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d561-8e91-7f07-113a0d003343", - "communicationUser": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d561-8e91-7f07-113a0d003343"}}}}' + body: '{"chatThread": {"id": "19:7u_DIahvhtmqlZSm7W6Ewgbz-Tk7JgfEjZ1goLgNjxc1@thread.v2", + "topic": "test topic", "createdOn": "2021-09-07T21:44:22Z", "createdByCommunicationIdentifier": + {"rawId": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-bc48-497d-2548220048f7", + "communicationUser": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-bc48-497d-2548220048f7"}}}}' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:35 GMT + - Tue, 07 Sep 2021 21:44:22 GMT ms-cv: - - Bs6T1mw5o0+45P7eDf9qpA.0 + - 14/dY30jK0CCEbtEVdhilA.0 strict-transport-security: - max-age=2592000 transfer-encoding: @@ -220,7 +224,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 929ms + - 795ms status: code: 201 message: Created @@ -239,21 +243,21 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: POST - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2021-09-07 response: body: '{"id": "sanitized"}' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:36 GMT + - Tue, 07 Sep 2021 21:44:23 GMT ms-cv: - - Cm9q9MFS7U6D56hDuwrgbw.0 + - 8y2yn1YpaEO6/y7qasQtqg.0 strict-transport-security: - max-age=2592000 transfer-encoding: @@ -261,7 +265,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 320ms + - 251ms status: code: 201 message: Created @@ -279,28 +283,28 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: POST - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/readReceipts?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/readReceipts?api-version=2021-09-07 response: body: string: '' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-length: - '0' date: - - Tue, 22 Jun 2021 20:53:36 GMT + - Tue, 07 Sep 2021 21:44:23 GMT ms-cv: - - WZxNrQle/kW9xGuJYvkL8w.0 + - XpXSI48Ke06+gHZKzTCa/Q.0 strict-transport-security: - max-age=2592000 x-cache: - CONFIG_NOCACHE x-processing-time: - - 264ms + - 159ms status: code: 200 message: OK @@ -316,26 +320,26 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 response: body: string: '' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 date: - - Tue, 22 Jun 2021 20:53:37 GMT + - Tue, 07 Sep 2021 21:44:23 GMT ms-cv: - - NzMmuphMHUWHzO5sFXFejA.0 + - EPfPkE2CUEmXn/kEhscg5g.0 strict-transport-security: - max-age=2592000 x-cache: - CONFIG_NOCACHE x-processing-time: - - 248ms + - 290ms status: code: 204 message: No Content @@ -351,9 +355,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:37 GMT + - Tue, 07 Sep 2021 21:44:24 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -363,11 +367,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:53:39 GMT + - Tue, 07 Sep 2021 21:44:24 GMT ms-cv: - - vLztvNFxk0S8xVp/AC0eBA.0 + - 4wbIekqsHEaZXxbDiBL+gg.0 request-context: - appId= strict-transport-security: @@ -375,7 +380,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 2151ms + - 410ms status: code: 204 message: No Content @@ -391,9 +396,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:40 GMT + - Tue, 07 Sep 2021 21:44:24 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -403,11 +408,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:53:40 GMT + - Tue, 07 Sep 2021 21:44:24 GMT ms-cv: - - iT0wSdBgoEq1lO7X6CY3ow.0 + - n//w1Zo7JUSP+WPD7Pfwyw.0 request-context: - appId= strict-transport-security: @@ -415,7 +421,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 921ms + - 391ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_send_typing_notification.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_send_typing_notification.yaml index 7e1404bd16bd..c06e31c4e3c2 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_send_typing_notification.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_send_typing_notification.yaml @@ -13,24 +13,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:41 GMT + - Tue, 07 Sep 2021 21:44:25 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d561-ae62-b8ba-a43a0d002cf2"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-cd09-c6f3-343a0d001586"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:41 GMT + - Tue, 07 Sep 2021 21:44:24 GMT ms-cv: - - RLUpnCbVSUyNo5DyhQil8g.0 + - 7nLuvT2XCUyXChaIcvOstg.0 request-context: - appId= strict-transport-security: @@ -40,7 +41,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 59ms + - 28ms status: code: 201 message: Created @@ -58,24 +59,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:41 GMT + - Tue, 07 Sep 2021 21:44:25 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:53:40.9266298+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:44:25.6929138+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:41 GMT + - Tue, 07 Sep 2021 21:44:24 GMT ms-cv: - - sCbKx6FXeEivBwzCm7XK0A.0 + - pR2d84Tv30Ou3A6juGTetw.0 request-context: - appId= strict-transport-security: @@ -85,7 +87,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 141ms + - 30ms status: code: 200 message: OK @@ -103,24 +105,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:41 GMT + - Tue, 07 Sep 2021 21:44:25 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d561-b029-b8ba-a43a0d002cf3"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-cda0-c6f3-343a0d001587"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:41 GMT + - Tue, 07 Sep 2021 21:44:25 GMT ms-cv: - - kTDVqz4cpkSzy9XhBzOnmQ.0 + - r1957M70XE2a+CnGKMocIA.0 request-context: - appId= strict-transport-security: @@ -130,7 +133,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 62ms + - 26ms status: code: 201 message: Created @@ -148,24 +151,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:42 GMT + - Tue, 07 Sep 2021 21:44:25 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:53:41.364192+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:44:25.9536062+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:41 GMT + - Tue, 07 Sep 2021 21:44:25 GMT ms-cv: - - WaYQ6vTaOEOuTjIF5NIfDA.0 + - cp2ZlAHHGk+1dZmUkan84A.0 request-context: - appId= strict-transport-security: @@ -175,7 +179,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 136ms + - 78ms status: code: 200 message: OK @@ -189,30 +193,30 @@ interactions: Connection: - keep-alive Content-Length: - - '349' + - '350' Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) repeatability-request-id: - - 9773afa0-5c20-4ddb-a745-237b7e600dc0 + - 57af6c7d-3761-4098-846b-2442e00cbea1 method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 response: - body: '{"chatThread": {"id": "19:-t5q3MxOu7oWbKcEplCsZp-MpcHQ14TKECCMkGJKBIs1@thread.v2", - "topic": "test topic", "createdOn": "2021-06-22T20:53:42Z", "createdByCommunicationIdentifier": - {"rawId": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d561-ae62-b8ba-a43a0d002cf2", - "communicationUser": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d561-ae62-b8ba-a43a0d002cf2"}}}}' + body: '{"chatThread": {"id": "19:41nrUqqyzLVg7POeYVGhv8B7rSc1WtR065MsW9K3dPU1@thread.v2", + "topic": "test topic", "createdOn": "2021-09-07T21:44:26Z", "createdByCommunicationIdentifier": + {"rawId": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-cd09-c6f3-343a0d001586", + "communicationUser": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-cd09-c6f3-343a0d001586"}}}}' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:43 GMT + - Tue, 07 Sep 2021 21:44:26 GMT ms-cv: - - Mc6WCDj8AUmbWzXAfv/87Q.0 + - RhhMkRceXkugMV0BvdCEYQ.0 strict-transport-security: - max-age=2592000 transfer-encoding: @@ -220,12 +224,12 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 570ms + - 349ms status: code: 201 message: Created - request: - body: null + body: '{}' headers: Accept: - application/json @@ -234,30 +238,31 @@ interactions: Connection: - keep-alive Content-Length: - - '0' + - '2' + Content-Type: + - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: POST - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/typing?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/typing?api-version=2021-09-07 response: body: string: '' headers: api-supported-versions: - - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + - 2021-04-05-preview6, 2021-09-07 content-length: - '0' date: - - Tue, 22 Jun 2021 20:53:43 GMT + - Tue, 07 Sep 2021 21:44:26 GMT ms-cv: - - TOnwlAwHJE+eV9qDeWFrxg.0 + - gczLZsU4SUynbbJUsFP3+g.0 strict-transport-security: - max-age=2592000 x-cache: - CONFIG_NOCACHE x-processing-time: - - 457ms + - 232ms status: code: 200 message: OK @@ -273,26 +278,26 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 response: body: string: '' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 date: - - Tue, 22 Jun 2021 20:53:44 GMT + - Tue, 07 Sep 2021 21:44:26 GMT ms-cv: - - TzEabzIkPUa3B1DyMBQ9bw.0 + - lpVmU4xd5U+I7iHeJs+TMA.0 strict-transport-security: - max-age=2592000 x-cache: - CONFIG_NOCACHE x-processing-time: - - 264ms + - 122ms status: code: 204 message: No Content @@ -308,9 +313,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:44 GMT + - Tue, 07 Sep 2021 21:44:27 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -320,11 +325,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:53:44 GMT + - Tue, 07 Sep 2021 21:44:26 GMT ms-cv: - - sGMjak7Sg0CruPJuKaAqIg.0 + - 40tcN+jLf0qIW6LEHnkP5g.0 request-context: - appId= strict-transport-security: @@ -332,7 +338,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 742ms + - 256ms status: code: 204 message: No Content @@ -348,9 +354,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:45 GMT + - Tue, 07 Sep 2021 21:44:27 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -360,11 +366,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:53:45 GMT + - Tue, 07 Sep 2021 21:44:26 GMT ms-cv: - - pX5ETG4m80GrTEu8PfXGRw.0 + - 07NFqwcw1E6Z3hQTozjqHA.0 request-context: - appId= strict-transport-security: @@ -372,7 +379,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 754ms + - 334ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_send_typing_notification_with_display_name.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_send_typing_notification_with_display_name.yaml new file mode 100644 index 000000000000..6e99b8cb2adf --- /dev/null +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_send_typing_notification_with_display_name.yaml @@ -0,0 +1,386 @@ +interactions: +- request: + body: '{}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '2' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) + x-ms-date: + - Tue, 07 Sep 2021 21:44:27 GMT + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 + response: + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-d5c0-dc7b-2548220015ad"}}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview + content-type: + - application/json; charset=utf-8 + date: + - Tue, 07 Sep 2021 21:44:27 GMT + ms-cv: + - FjlWfZekcEaMJDj6BO0EMw.0 + request-context: + - appId= + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-cache: + - CONFIG_NOCACHE + x-processing-time: + - 88ms + status: + code: 201 + message: Created +- request: + body: '{"scopes": ["chat"]}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '20' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) + x-ms-date: + - Tue, 07 Sep 2021 21:44:28 GMT + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 + response: + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:44:28.1695173+00:00"}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview + content-type: + - application/json; charset=utf-8 + date: + - Tue, 07 Sep 2021 21:44:27 GMT + ms-cv: + - aZX9KFAAbU+uj8wzJpFlXg.0 + request-context: + - appId= + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-cache: + - CONFIG_NOCACHE + x-processing-time: + - 154ms + status: + code: 200 + message: OK +- request: + body: '{}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '2' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) + x-ms-date: + - Tue, 07 Sep 2021 21:44:28 GMT + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 + response: + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-d791-dc7b-2548220015ae"}}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview + content-type: + - application/json; charset=utf-8 + date: + - Tue, 07 Sep 2021 21:44:27 GMT + ms-cv: + - xQ3ApGPad0+BUPTGpshvJg.0 + request-context: + - appId= + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-cache: + - CONFIG_NOCACHE + x-processing-time: + - 90ms + status: + code: 201 + message: Created +- request: + body: '{"scopes": ["chat"]}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '20' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) + x-ms-date: + - Tue, 07 Sep 2021 21:44:28 GMT + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 + response: + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:44:28.6363166+00:00"}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview + content-type: + - application/json; charset=utf-8 + date: + - Tue, 07 Sep 2021 21:44:27 GMT + ms-cv: + - 6h4ZfW8zb0KZpSgiG0fNNg.0 + request-context: + - appId= + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-cache: + - CONFIG_NOCACHE + x-processing-time: + - 156ms + status: + code: 200 + message: OK +- request: + body: '{"topic": "test topic", "participants": "sanitized"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '350' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) + repeatability-request-id: + - bd9dae00-a75d-49a9-a557-a8168d7cfedd + method: POST + uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 + response: + body: '{"chatThread": {"id": "19:1P_S6sf7gPL6nhG69Us09Gn4qtsVv0F9c9XWQ29AWZo1@thread.v2", + "topic": "test topic", "createdOn": "2021-09-07T21:44:29Z", "createdByCommunicationIdentifier": + {"rawId": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-d5c0-dc7b-2548220015ad", + "communicationUser": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-d5c0-dc7b-2548220015ad"}}}}' + headers: + api-supported-versions: + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, + 2021-03-07, 2021-04-05-preview6, 2021-09-07 + content-type: + - application/json; charset=utf-8 + date: + - Tue, 07 Sep 2021 21:44:29 GMT + ms-cv: + - bgutoPKXCUih5RBJglmVdQ.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-cache: + - CONFIG_NOCACHE + x-processing-time: + - 734ms + status: + code: 201 + message: Created +- request: + body: '{"senderDisplayName": "John"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '29' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) + method: POST + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/typing?api-version=2021-09-07 + response: + body: + string: '' + headers: + api-supported-versions: + - 2021-04-05-preview6, 2021-09-07 + content-length: + - '0' + date: + - Tue, 07 Sep 2021 21:44:29 GMT + ms-cv: + - Gnoa43kciUal9FOqu2N4Pg.0 + strict-transport-security: + - max-age=2592000 + x-cache: + - CONFIG_NOCACHE + x-processing-time: + - 189ms + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) + method: DELETE + uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 + response: + body: + string: '' + headers: + api-supported-versions: + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, + 2021-03-07, 2021-04-05-preview6, 2021-09-07 + date: + - Tue, 07 Sep 2021 21:44:29 GMT + ms-cv: + - 8LiURxfDR0Ce8qshgFStUA.0 + strict-transport-security: + - max-age=2592000 + x-cache: + - CONFIG_NOCACHE + x-processing-time: + - 202ms + status: + code: 204 + message: No Content +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) + x-ms-date: + - Tue, 07 Sep 2021 21:44:30 GMT + x-ms-return-client-request-id: + - 'true' + method: DELETE + uri: https://sanitized.communication.azure.com/identities/sanitized?api-version=2021-03-07 + response: + body: + string: '' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview + date: + - Tue, 07 Sep 2021 21:44:29 GMT + ms-cv: + - jrTQ1oRggEGnygLVM8EFbw.0 + request-context: + - appId= + strict-transport-security: + - max-age=2592000 + x-cache: + - CONFIG_NOCACHE + x-processing-time: + - 555ms + status: + code: 204 + message: No Content +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) + x-ms-date: + - Tue, 07 Sep 2021 21:44:30 GMT + x-ms-return-client-request-id: + - 'true' + method: DELETE + uri: https://sanitized.communication.azure.com/identities/sanitized?api-version=2021-03-07 + response: + body: + string: '' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview + date: + - Tue, 07 Sep 2021 21:44:30 GMT + ms-cv: + - 7fxNZqnMTEqNE/D2Dswwlg.0 + request-context: + - appId= + strict-transport-security: + - max-age=2592000 + x-cache: + - CONFIG_NOCACHE + x-processing-time: + - 418ms + status: + code: 204 + message: No Content +version: 1 diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_update_message.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_update_message.yaml index 2011116c76ac..5b5f52201918 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_update_message.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_update_message.yaml @@ -13,24 +13,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:46 GMT + - Tue, 07 Sep 2021 21:44:31 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d561-c119-ceb1-a43a0d00be1b"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-e492-89df-444822001279"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:45 GMT + - Tue, 07 Sep 2021 21:44:31 GMT ms-cv: - - 36o/csKzK0iKljvfjxaZXA.0 + - NXr3YQy0/kS8nXO3qKB6jQ.0 request-context: - appId= strict-transport-security: @@ -40,7 +41,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 70ms + - 115ms status: code: 201 message: Created @@ -58,24 +59,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:46 GMT + - Tue, 07 Sep 2021 21:44:31 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:53:45.6679125+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:44:31.9755225+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:45 GMT + - Tue, 07 Sep 2021 21:44:31 GMT ms-cv: - - KY9aFZiwVk27Bc46g7gqJw.0 + - PCQeqIfzZ0KbdxOWB8fZvg.0 request-context: - appId= strict-transport-security: @@ -85,7 +87,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 133ms + - 221ms status: code: 200 message: OK @@ -103,24 +105,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:46 GMT + - Tue, 07 Sep 2021 21:44:32 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d561-c2cb-ceb1-a43a0d00be1e"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-e6a6-89df-44482200127a"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:46 GMT + - Tue, 07 Sep 2021 21:44:32 GMT ms-cv: - - 1hbDPoOCpUqNwm14IATLCA.0 + - fRTFOGtEB0eMadmQowS2EA.0 request-context: - appId= strict-transport-security: @@ -130,7 +133,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 111ms + - 188ms status: code: 201 message: Created @@ -148,24 +151,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:46 GMT + - Tue, 07 Sep 2021 21:44:32 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:53:46.1039276+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:44:32.6554649+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:46 GMT + - Tue, 07 Sep 2021 21:44:32 GMT ms-cv: - - M0dFUiEhjkCWJTm3auM3QA.0 + - OMUxMH6FCUOTIJTjtrx63g.0 request-context: - appId= strict-transport-security: @@ -175,7 +179,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 136ms + - 242ms status: code: 200 message: OK @@ -193,26 +197,26 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) repeatability-request-id: - - 68c54c2b-00e7-4ad4-9bee-be8d2218097c + - 58313e22-fc19-4165-bcf0-c66363d2748e method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 response: - body: '{"chatThread": {"id": "19:-BvngluhydL8F1gmUbbeNquC-NDG13ZZd8nJAbC_7iU1@thread.v2", - "topic": "test topic", "createdOn": "2021-06-22T20:53:47Z", "createdByCommunicationIdentifier": - {"rawId": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d561-c119-ceb1-a43a0d00be1b", - "communicationUser": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d561-c119-ceb1-a43a0d00be1b"}}}}' + body: '{"chatThread": {"id": "19:RYKdQPIYdtLI3odvtfhGRBeeT9erVUNIGExUBFqbdUE1@thread.v2", + "topic": "test topic", "createdOn": "2021-09-07T21:44:32Z", "createdByCommunicationIdentifier": + {"rawId": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-e492-89df-444822001279", + "communicationUser": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-e492-89df-444822001279"}}}}' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:47 GMT + - Tue, 07 Sep 2021 21:44:33 GMT ms-cv: - - Ci3MYsyp9kubNDY48OD1IQ.0 + - stOFX8zQ6k6yWTz8I5C4Hw.0 strict-transport-security: - max-age=2592000 transfer-encoding: @@ -220,7 +224,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 997ms + - 586ms status: code: 201 message: Created @@ -239,21 +243,21 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: POST - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2021-09-07 response: body: '{"id": "sanitized"}' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:48 GMT + - Tue, 07 Sep 2021 21:44:32 GMT ms-cv: - - a3NAsV7dWEmn/CoK4W57LA.0 + - VkdXKQwva0O++z5xnWKoeA.0 strict-transport-security: - max-age=2592000 transfer-encoding: @@ -261,7 +265,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 219ms + - 294ms status: code: 201 message: Created @@ -279,26 +283,26 @@ interactions: Content-Type: - application/merge-patch+json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: PATCH - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages/sanitized?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages/sanitized?api-version=2021-09-07 response: body: string: '' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 date: - - Tue, 22 Jun 2021 20:53:48 GMT + - Tue, 07 Sep 2021 21:44:33 GMT ms-cv: - - s78p5y6DlUqF3zHgw/4LwA.0 + - bvFYMJhmsk22L+Re13MUng.0 strict-transport-security: - max-age=2592000 x-cache: - CONFIG_NOCACHE x-processing-time: - - 262ms + - 461ms status: code: 204 message: No Content @@ -314,26 +318,26 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 response: body: string: '' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 date: - - Tue, 22 Jun 2021 20:53:48 GMT + - Tue, 07 Sep 2021 21:44:34 GMT ms-cv: - - M7CacyQ7tkS5+OEvhTWJjQ.0 + - SoBexTR4U0KArf7+w5IjJQ.0 strict-transport-security: - max-age=2592000 x-cache: - CONFIG_NOCACHE x-processing-time: - - 246ms + - 169ms status: code: 204 message: No Content @@ -349,9 +353,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:49 GMT + - Tue, 07 Sep 2021 21:44:34 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -361,11 +365,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:53:49 GMT + - Tue, 07 Sep 2021 21:44:34 GMT ms-cv: - - KM5Se/cnKk2EAdGA+26Wlg.0 + - CXmmqqJuqEahiF+N56dzsQ.0 request-context: - appId= strict-transport-security: @@ -373,7 +378,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 809ms + - 361ms status: code: 204 message: No Content @@ -389,9 +394,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:50 GMT + - Tue, 07 Sep 2021 21:44:35 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -401,11 +406,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:53:50 GMT + - Tue, 07 Sep 2021 21:44:35 GMT ms-cv: - - EZfrJ0Jq1kWOAzh/8YuZfw.0 + - JCK4uZVP+U6Lf4cqF/uAWQ.0 request-context: - appId= strict-transport-security: @@ -413,7 +419,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 592ms + - 246ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_update_topic.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_update_topic.yaml index eed2bbae1c44..e1400d2abdc5 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_update_topic.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_update_topic.yaml @@ -13,24 +13,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:51 GMT + - Tue, 07 Sep 2021 21:44:35 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d561-d525-f6c7-593a0d00a003"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-f3c8-89df-44482200127b"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:51 GMT + - Tue, 07 Sep 2021 21:44:35 GMT ms-cv: - - C1qoiNl7IkCnqP1Oqe0IYg.0 + - BtcXJ24iF0WTvU/CsQVhdA.0 request-context: - appId= strict-transport-security: @@ -40,7 +41,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 56ms + - 62ms status: code: 201 message: Created @@ -58,24 +59,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:51 GMT + - Tue, 07 Sep 2021 21:44:35 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:53:50.6495859+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:44:35.7870949+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:51 GMT + - Tue, 07 Sep 2021 21:44:35 GMT ms-cv: - - kDzPKMb+RU2zihyd2uvt9A.0 + - oce0ZFY+H0mBhg/tCNoxZg.0 request-context: - appId= strict-transport-security: @@ -85,7 +87,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 37ms + - 131ms status: code: 200 message: OK @@ -103,24 +105,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:51 GMT + - Tue, 07 Sep 2021 21:44:35 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d561-d5ff-f6c7-593a0d00a004"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-f53c-89df-44482200127c"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:51 GMT + - Tue, 07 Sep 2021 21:44:35 GMT ms-cv: - - FRzjdflDFkKar4pPIyo0/g.0 + - VXxrZSzo9k2DXLkOPaC60A.0 request-context: - appId= strict-transport-security: @@ -130,7 +133,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 31ms + - 62ms status: code: 201 message: Created @@ -148,24 +151,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:51 GMT + - Tue, 07 Sep 2021 21:44:36 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:53:50.8597505+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:44:36.2399684+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:51 GMT + - Tue, 07 Sep 2021 21:44:35 GMT ms-cv: - - 3Yc9mI+xq02hlX/S8YC4hg.0 + - QnB/jOhcGkWIlAzXLuA9yQ.0 request-context: - appId= strict-transport-security: @@ -175,7 +179,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 39ms + - 212ms status: code: 200 message: OK @@ -193,26 +197,26 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) repeatability-request-id: - - fce812e6-bc11-48a0-a1c2-2470f66d1b6f + - 06b922b3-b81a-47ba-8d77-ecfe10037493 method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 response: - body: '{"chatThread": {"id": "19:hrY9cyB7ZgErqa0D6SAjE_-qOhLJoVAFLMloLt7xs681@thread.v2", - "topic": "test topic", "createdOn": "2021-06-22T20:53:52Z", "createdByCommunicationIdentifier": - {"rawId": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d561-d525-f6c7-593a0d00a003", - "communicationUser": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d561-d525-f6c7-593a0d00a003"}}}}' + body: '{"chatThread": {"id": "19:esmty7HywuiHpeH2t2Dhjyxba2FE5ZL1bxDR-lQxuzQ1@thread.v2", + "topic": "test topic", "createdOn": "2021-09-07T21:44:36Z", "createdByCommunicationIdentifier": + {"rawId": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-f3c8-89df-44482200127b", + "communicationUser": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-6219-f3c8-89df-44482200127b"}}}}' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:52 GMT + - Tue, 07 Sep 2021 21:44:36 GMT ms-cv: - - GZIEKl0lO0ulGWefkkTkRg.0 + - ZVBSUoLZdk6CgroDXLgYfQ.0 strict-transport-security: - max-age=2592000 transfer-encoding: @@ -220,7 +224,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 913ms + - 515ms status: code: 201 message: Created @@ -238,26 +242,26 @@ interactions: Content-Type: - application/merge-patch+json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: PATCH - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 response: body: string: '' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 date: - - Tue, 22 Jun 2021 20:53:53 GMT + - Tue, 07 Sep 2021 21:44:36 GMT ms-cv: - - 7Wwzh2D3s0yJ9N3q9wElYw.0 + - 8AHkQ/5wekmxsgi8WoJI3A.0 strict-transport-security: - max-age=2592000 x-cache: - CONFIG_NOCACHE x-processing-time: - - 266ms + - 229ms status: code: 204 message: No Content @@ -273,26 +277,26 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 response: body: string: '' headers: api-supported-versions: - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 date: - - Tue, 22 Jun 2021 20:53:52 GMT + - Tue, 07 Sep 2021 21:44:36 GMT ms-cv: - - zrGvZuWGVkG5h0wDR8EHTg.0 + - 13EAfN0oY0CBDBf/i+McLA.0 strict-transport-security: - max-age=2592000 x-cache: - CONFIG_NOCACHE x-processing-time: - - 346ms + - 211ms status: code: 204 message: No Content @@ -308,9 +312,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:53 GMT + - Tue, 07 Sep 2021 21:44:37 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -320,11 +324,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:53:54 GMT + - Tue, 07 Sep 2021 21:44:37 GMT ms-cv: - - q9uOqr0GTUSKe/ir/ryyNA.0 + - 2oYMnv4fHkOpvJ6Dyckhcw.0 request-context: - appId= strict-transport-security: @@ -332,7 +337,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 824ms + - 537ms status: code: 204 message: No Content @@ -348,9 +353,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:54 GMT + - Tue, 07 Sep 2021 21:44:38 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -360,11 +365,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:53:55 GMT + - Tue, 07 Sep 2021 21:44:38 GMT ms-cv: - - iCVroY422E6rGrsUYenAUA.0 + - LKOleFzc+EeZeTWwVxz1yw.0 request-context: - appId= strict-transport-security: @@ -372,7 +378,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 721ms + - 235ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_add_participants.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_add_participants.yaml index 2e51e2a474c0..d835ad991b47 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_add_participants.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_add_participants.yaml @@ -13,24 +13,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:55 GMT + - Tue, 07 Sep 2021 21:44:38 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d561-e5e6-28c5-593a0d001c0d"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-01c1-8e0e-454822001a7d"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:55 GMT + - Tue, 07 Sep 2021 21:44:38 GMT ms-cv: - - XWpww3stDUyqbMmJ+1yJEw.0 + - wACYVrG+m0G1ncJyPkabQg.0 request-context: - appId= strict-transport-security: @@ -40,7 +41,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 30ms + - 63ms status: code: 201 message: Created @@ -58,24 +59,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:55 GMT + - Tue, 07 Sep 2021 21:44:39 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:53:54.9284912+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:44:39.3530327+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:55 GMT + - Tue, 07 Sep 2021 21:44:38 GMT ms-cv: - - mpm66b7OekSep7ZzPU5FPg.0 + - C2dXqhsXXkyK33LOtVRWVg.0 request-context: - appId= strict-transport-security: @@ -85,7 +87,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 40ms + - 130ms status: code: 200 message: OK @@ -103,24 +105,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:55 GMT + - Tue, 07 Sep 2021 21:44:39 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d561-e6cb-28c5-593a0d001c0e"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-0314-8e0e-454822001a7e"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:55 GMT + - Tue, 07 Sep 2021 21:44:39 GMT ms-cv: - - uBKTX6L61UCeqboOoOWdVw.0 + - si9HSQebAUqrVdX/CkL4Mg.0 request-context: - appId= strict-transport-security: @@ -130,7 +133,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 56ms + - 66ms status: code: 201 message: Created @@ -148,24 +151,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:56 GMT + - Tue, 07 Sep 2021 21:44:39 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:53:55.1582054+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:44:39.6930128+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:53:55 GMT + - Tue, 07 Sep 2021 21:44:39 GMT ms-cv: - - ZZH5HFJsw0WR+NDwglwoag.0 + - L1qV8JK7EU2WAol9XtvSQA.0 request-context: - appId= strict-transport-security: @@ -175,7 +179,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 37ms + - 132ms status: code: 200 message: OK @@ -185,34 +189,34 @@ interactions: Accept: - application/json Content-Length: - - '350' + - '349' Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) repeatability-request-id: - - c3f7b5a1-e256-4e60-a5ea-53aca37e7483 + - 83577246-5ff3-498b-ac82-aa7f02bc3bc1 method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 response: - body: '{"chatThread": {"id": "19:WUog7EmOuu8P05BLA7E9Ppvm30CDd5UxWWojjT26rzM1@thread.v2", - "topic": "test topic", "createdOn": "2021-06-22T20:53:56Z", "createdByCommunicationIdentifier": - {"rawId": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d561-e5e6-28c5-593a0d001c0d", - "communicationUser": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d561-e5e6-28c5-593a0d001c0d"}}}}' + body: '{"chatThread": {"id": "19:kE78Vipo98iC0ALMwoZDz7PVtLqENKcCoHU0u9sSz8s1@thread.v2", + "topic": "test topic", "createdOn": "2021-09-07T21:44:39Z", "createdByCommunicationIdentifier": + {"rawId": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-01c1-8e0e-454822001a7d", + "communicationUser": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-01c1-8e0e-454822001a7d"}}}}' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: application/json; charset=utf-8 - date: Tue, 22 Jun 2021 20:53:57 GMT - ms-cv: jxUIv3+9a0u0fx4mg0Q/Eg.0 + date: Tue, 07 Sep 2021 21:44:40 GMT + ms-cv: VSsoMu8FTEWZvVF7VK7VVw.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked x-cache: CONFIG_NOCACHE - x-processing-time: 1022ms + x-processing-time: 698ms status: code: 201 message: Created - url: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 - request: body: '{"participants": "sanitized"}' headers: @@ -223,49 +227,49 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: POST - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/participants/:add?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/participants/:add?api-version=2021-09-07 response: body: '{}' headers: api-supported-versions: 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: application/json; charset=utf-8 - date: Tue, 22 Jun 2021 20:53:57 GMT - ms-cv: cKjdzV9BgUqbKIyZSjwVdg.0 + date: Tue, 07 Sep 2021 21:44:40 GMT + ms-cv: DarlxWmyAEKpcNBzxTt5cw.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked x-cache: CONFIG_NOCACHE - x-processing-time: 152ms + x-processing-time: 542ms status: code: 201 message: Created - url: https://sanitized.communication.azure.com/chat/threads/sanitized/participants/:add?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads/sanitized/participants/:add?api-version=2021-09-07 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 response: body: string: '' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 - date: Tue, 22 Jun 2021 20:53:58 GMT - ms-cv: xGzw7HdbhkSAf0HtoZivGQ.0 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 + date: Tue, 07 Sep 2021 21:44:41 GMT + ms-cv: 7U+VIkCG+UCxeuBbNftD8g.0 strict-transport-security: max-age=2592000 x-cache: CONFIG_NOCACHE - x-processing-time: 281ms + x-processing-time: 327ms status: code: 204 message: No Content - url: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 - request: body: null headers: @@ -278,9 +282,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:58 GMT + - Tue, 07 Sep 2021 21:44:41 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -290,11 +294,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:53:58 GMT + - Tue, 07 Sep 2021 21:44:41 GMT ms-cv: - - P5+gBHsU7EOBwcN+yCtd8Q.0 + - b3GTm6rUDUe7bgH1ZNVnxA.0 request-context: - appId= strict-transport-security: @@ -302,7 +307,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 768ms + - 391ms status: code: 204 message: No Content @@ -318,9 +323,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:53:59 GMT + - Tue, 07 Sep 2021 21:44:42 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -330,11 +335,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:53:59 GMT + - Tue, 07 Sep 2021 21:44:42 GMT ms-cv: - - oKtZ9hnGZUSdsxiZNevOcw.0 + - La843JMV3U2X58UCZWysew.0 request-context: - appId= strict-transport-security: @@ -342,7 +348,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 888ms + - 566ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_delete_message.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_delete_message.yaml index 4b11017a7ab8..d88736fd7c14 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_delete_message.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_delete_message.yaml @@ -13,24 +13,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:00 GMT + - Tue, 07 Sep 2021 21:44:42 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d561-f8bc-570c-113a0d001776"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-1055-497d-2548220048f9"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:54:00 GMT + - Tue, 07 Sep 2021 21:44:42 GMT ms-cv: - - HAc+6a6fU0yftNm+UhGG/A.0 + - NkoT5Hanq06CJdLJS43HYg.0 request-context: - appId= strict-transport-security: @@ -40,7 +41,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 107ms + - 91ms status: code: 201 message: Created @@ -58,24 +59,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:00 GMT + - Tue, 07 Sep 2021 21:44:43 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:53:59.9986836+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:44:43.2380949+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:54:00 GMT + - Tue, 07 Sep 2021 21:44:42 GMT ms-cv: - - sqQKW1qslkaFHrvfE4Z4zw.0 + - drXMEB0UU0CdV/Mmeqk6WQ.0 request-context: - appId= strict-transport-security: @@ -85,7 +87,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 163ms + - 224ms status: code: 200 message: OK @@ -103,24 +105,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:01 GMT + - Tue, 07 Sep 2021 21:44:43 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d561-faad-570c-113a0d001777"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-1262-497d-2548220048fa"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:54:00 GMT + - Tue, 07 Sep 2021 21:44:42 GMT ms-cv: - - aitQoG1bV0Smf3M7CbIAbg.0 + - q93rvG9N6USVLDTV6ce3yA.0 request-context: - appId= strict-transport-security: @@ -130,7 +133,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 87ms + - 150ms status: code: 201 message: Created @@ -148,24 +151,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:01 GMT + - Tue, 07 Sep 2021 21:44:43 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:54:00.5218274+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:44:43.9414102+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:54:01 GMT + - Tue, 07 Sep 2021 21:44:43 GMT ms-cv: - - mBUPBK/5e0Cv/0LsuHuwtA.0 + - pPzummD3qEGUw+cskHOyrg.0 request-context: - appId= strict-transport-security: @@ -175,7 +179,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 186ms + - 276ms status: code: 200 message: OK @@ -189,30 +193,30 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) repeatability-request-id: - - 499169b3-89c3-4d79-8081-09329c9258ba + - 439b6e88-6a70-4314-8aa5-b5d089e4adb6 method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 response: - body: '{"chatThread": {"id": "19:2bfBBjFX-LF28V9kWUmHvOdoa9NM5hLZDnl824nt2kc1@thread.v2", - "topic": "test topic", "createdOn": "2021-06-22T20:54:02Z", "createdByCommunicationIdentifier": - {"rawId": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d561-f8bc-570c-113a0d001776", - "communicationUser": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d561-f8bc-570c-113a0d001776"}}}}' + body: '{"chatThread": {"id": "19:0kGA1MiJ-qWlp0D8JVJtzFiv2Qbo-mXd6Vl1wGmIK081@thread.v2", + "topic": "test topic", "createdOn": "2021-09-07T21:44:44Z", "createdByCommunicationIdentifier": + {"rawId": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-1055-497d-2548220048f9", + "communicationUser": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-1055-497d-2548220048f9"}}}}' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: application/json; charset=utf-8 - date: Tue, 22 Jun 2021 20:54:01 GMT - ms-cv: wiXbQ9z9hkCmXQ1WX6FLaA.0 + date: Tue, 07 Sep 2021 21:44:44 GMT + ms-cv: EA97LMkwFUGkgg8isSciWw.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked x-cache: CONFIG_NOCACHE - x-processing-time: 1070ms + x-processing-time: 502ms status: code: 201 message: Created - url: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 - request: body: '{"content": "hello world", "senderDisplayName": "sender name", "type": "text"}' @@ -224,73 +228,73 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: POST - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2021-09-07 response: body: '{"id": "sanitized"}' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: application/json; charset=utf-8 - date: Tue, 22 Jun 2021 20:54:02 GMT - ms-cv: HB4yT9fRYECvn1dkxaxrVw.0 + date: Tue, 07 Sep 2021 21:44:44 GMT + ms-cv: Vo2BiJUyukGok0m60ZW9zw.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked x-cache: CONFIG_NOCACHE - x-processing-time: 137ms + x-processing-time: 150ms status: code: 201 message: Created - url: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2021-09-07 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages/sanitized?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages/sanitized?api-version=2021-09-07 response: body: string: '' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 - date: Tue, 22 Jun 2021 20:54:02 GMT - ms-cv: 25Yp2PAvPkCjy6AEBdreNw.0 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 + date: Tue, 07 Sep 2021 21:44:45 GMT + ms-cv: IVV3yxa0n0G2XVQ+nLyjtQ.0 strict-transport-security: max-age=2592000 x-cache: CONFIG_NOCACHE - x-processing-time: 194ms + x-processing-time: 205ms status: code: 204 message: No Content - url: https://sanitized.communication.azure.com/chat/threads/sanitized/messages/sanitized?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads/sanitized/messages/sanitized?api-version=2021-09-07 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 response: body: string: '' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 - date: Tue, 22 Jun 2021 20:54:02 GMT - ms-cv: WdtqWb/hUk+TGfE+3yshCQ.0 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 + date: Tue, 07 Sep 2021 21:44:45 GMT + ms-cv: gt1ofcbgsUSv5cPwncTh6g.0 strict-transport-security: max-age=2592000 x-cache: CONFIG_NOCACHE - x-processing-time: 117ms + x-processing-time: 286ms status: code: 204 message: No Content - url: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 - request: body: null headers: @@ -303,9 +307,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:03 GMT + - Tue, 07 Sep 2021 21:44:45 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -315,11 +319,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:54:04 GMT + - Tue, 07 Sep 2021 21:44:45 GMT ms-cv: - - K2sAnihUKkCAGdItrSxxHg.0 + - T6wvaviBJ0KSJO6nLjDG1g.0 request-context: - appId= strict-transport-security: @@ -327,7 +332,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 876ms + - 460ms status: code: 204 message: No Content @@ -343,9 +348,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:04 GMT + - Tue, 07 Sep 2021 21:44:46 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -355,11 +360,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:54:05 GMT + - Tue, 07 Sep 2021 21:44:45 GMT ms-cv: - - Rk7bc2s7AU+LDjhYSpveNA.0 + - BXiwiPYr3Uy5/cQMFS4vBg.0 request-context: - appId= strict-transport-security: @@ -367,7 +373,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 776ms + - 406ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_get_message.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_get_message.yaml index 97ac02fac809..268bfff93d91 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_get_message.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_get_message.yaml @@ -13,24 +13,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:05 GMT + - Tue, 07 Sep 2021 21:44:46 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d562-0cbe-b8ba-a43a0d002cff"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-1f2b-23fd-343a0d002162"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:54:05 GMT + - Tue, 07 Sep 2021 21:44:46 GMT ms-cv: - - RLZBQT8YPUWAzD7bo/efSQ.0 + - dinyKqeGj0Sz1x9JaPH42g.0 request-context: - appId= strict-transport-security: @@ -40,7 +41,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 60ms + - 26ms status: code: 201 message: Created @@ -58,24 +59,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:05 GMT + - Tue, 07 Sep 2021 21:44:46 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:54:05.0254301+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:44:46.7221279+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:54:05 GMT + - Tue, 07 Sep 2021 21:44:46 GMT ms-cv: - - KIzItmhL+06VBiLxdETVrg.0 + - S/9prwupfUOtfpESbXdj8A.0 request-context: - appId= strict-transport-security: @@ -85,7 +87,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 135ms + - 33ms status: code: 200 message: OK @@ -103,24 +105,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:06 GMT + - Tue, 07 Sep 2021 21:44:46 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d562-0e62-b8ba-a43a0d002d00"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-1fca-23fd-343a0d002163"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:54:06 GMT + - Tue, 07 Sep 2021 21:44:46 GMT ms-cv: - - aSh00vLNLEizqRtjXeik2Q.0 + - J7EqqwK9BUGPZCTlfu+b/g.0 request-context: - appId= strict-transport-security: @@ -130,7 +133,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 96ms + - 26ms status: code: 201 message: Created @@ -148,24 +151,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:06 GMT + - Tue, 07 Sep 2021 21:44:46 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:54:05.4591877+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:44:46.8895062+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:54:06 GMT + - Tue, 07 Sep 2021 21:44:46 GMT ms-cv: - - r2KAkS0Wq02/qCN0Nu8D4Q.0 + - a8DxlPFeNECOavrf6NxZwA.0 request-context: - appId= strict-transport-security: @@ -175,7 +179,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 146ms + - 33ms status: code: 200 message: OK @@ -189,30 +193,30 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) repeatability-request-id: - - a70f4e5d-a202-447f-bbb6-39fe30a751e8 + - 241580b5-57d8-4b6a-904c-3ea35c4273e0 method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 response: - body: '{"chatThread": {"id": "19:OqsBKH78B-ASbL8lopnL7TfzS5oPZecTgP9h2bbOZ381@thread.v2", - "topic": "test topic", "createdOn": "2021-06-22T20:54:06Z", "createdByCommunicationIdentifier": - {"rawId": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d562-0cbe-b8ba-a43a0d002cff", - "communicationUser": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d562-0cbe-b8ba-a43a0d002cff"}}}}' + body: '{"chatThread": {"id": "19:TaS97aGS6Yk0EEVi27SCDJjUHy85Xzo5UvRftObf6UY1@thread.v2", + "topic": "test topic", "createdOn": "2021-09-07T21:44:47Z", "createdByCommunicationIdentifier": + {"rawId": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-1f2b-23fd-343a0d002162", + "communicationUser": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-1f2b-23fd-343a0d002162"}}}}' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: application/json; charset=utf-8 - date: Tue, 22 Jun 2021 20:54:07 GMT - ms-cv: dQKbZZTsvUqMSRDWJqXJeg.0 + date: Tue, 07 Sep 2021 21:44:46 GMT + ms-cv: OoqSPiIoF0SnBz9cPc6SYQ.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked x-cache: CONFIG_NOCACHE - x-processing-time: 463ms + x-processing-time: 492ms status: code: 201 message: Created - url: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 - request: body: '{"content": "hello world", "senderDisplayName": "sender name", "type": "text"}' @@ -224,77 +228,77 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: POST - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2021-09-07 response: body: '{"id": "sanitized"}' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: application/json; charset=utf-8 - date: Tue, 22 Jun 2021 20:54:07 GMT - ms-cv: mh4QuWAPn0qvfXZa61e9zg.0 + date: Tue, 07 Sep 2021 21:44:47 GMT + ms-cv: 5z0BtQUSvEuDna/gSfFVag.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked x-cache: CONFIG_NOCACHE - x-processing-time: 281ms + x-processing-time: 199ms status: code: 201 message: Created - url: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2021-09-07 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: GET - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages/sanitized?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages/sanitized?api-version=2021-09-07 response: - body: '{"id": "sanitized", "type": "text", "sequenceId": "3", "version": "1624395247382", + body: '{"id": "sanitized", "type": "text", "sequenceId": "3", "version": "1631051087755", "content": {"message": "hello world"}, "senderDisplayName": "sender name", "createdOn": - "2021-06-22T20:54:07Z", "senderCommunicationIdentifier": {"rawId": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d562-0cbe-b8ba-a43a0d002cff", - "communicationUser": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d562-0cbe-b8ba-a43a0d002cff"}}}' + "2021-09-07T21:44:47Z", "senderCommunicationIdentifier": {"rawId": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-1f2b-23fd-343a0d002162", + "communicationUser": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-1f2b-23fd-343a0d002162"}}}' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: application/json; charset=utf-8 - date: Tue, 22 Jun 2021 20:54:07 GMT - ms-cv: I++SMZGu7EyK3kv0WzQFDg.0 + date: Tue, 07 Sep 2021 21:44:47 GMT + ms-cv: s2KZgFNxukW2XUDetE9xTQ.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked x-cache: CONFIG_NOCACHE - x-processing-time: 109ms + x-processing-time: 259ms status: code: 200 message: OK - url: https://sanitized.communication.azure.com/chat/threads/sanitized/messages/sanitized?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads/sanitized/messages/sanitized?api-version=2021-09-07 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 response: body: string: '' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 - date: Tue, 22 Jun 2021 20:54:07 GMT - ms-cv: mVgN23PaGEyiGgo5V40rBA.0 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 + date: Tue, 07 Sep 2021 21:44:47 GMT + ms-cv: 8+HpvyFpF06HaUOTbEp3zg.0 strict-transport-security: max-age=2592000 x-cache: CONFIG_NOCACHE - x-processing-time: 270ms + x-processing-time: 116ms status: code: 204 message: No Content - url: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 - request: body: null headers: @@ -307,9 +311,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:08 GMT + - Tue, 07 Sep 2021 21:44:48 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -319,11 +323,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:54:08 GMT + - Tue, 07 Sep 2021 21:44:48 GMT ms-cv: - - PL/oc9cZC0qxaGACMwSDag.0 + - KXOaWUm1h025DtV7BF/AXg.0 request-context: - appId= strict-transport-security: @@ -331,7 +336,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 803ms + - 431ms status: code: 204 message: No Content @@ -347,9 +352,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:08 GMT + - Tue, 07 Sep 2021 21:44:48 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -359,11 +364,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:54:09 GMT + - Tue, 07 Sep 2021 21:44:48 GMT ms-cv: - - LpWYNIv5T06G4XDUnPyKvw.0 + - OAZTjqJL00O6kasR1xOlJA.0 request-context: - appId= strict-transport-security: @@ -371,7 +377,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 488ms + - 416ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_get_properties.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_get_properties.yaml index 31005e16ca6d..b33d92affe6a 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_get_properties.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_get_properties.yaml @@ -13,24 +13,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:09 GMT + - Tue, 07 Sep 2021 21:44:49 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d562-1df7-51b9-a43a0d009419"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-2a09-95f1-343a0d001a43"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:54:10 GMT + - Tue, 07 Sep 2021 21:44:48 GMT ms-cv: - - ZAAM4UZTJkii6HZy6TlB3g.0 + - KBkmZHan5UmSbA8Ad9W0WA.0 request-context: - appId= strict-transport-security: @@ -40,7 +41,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 69ms + - 27ms status: code: 201 message: Created @@ -58,24 +59,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:10 GMT + - Tue, 07 Sep 2021 21:44:49 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:54:09.490438+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:44:49.5049128+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:54:10 GMT + - Tue, 07 Sep 2021 21:44:48 GMT ms-cv: - - csbtpOA6nUmNIwpsfqdnfg.0 + - wG0b5Llq1kOrnhXje20L9w.0 request-context: - appId= strict-transport-security: @@ -85,7 +87,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 184ms + - 35ms status: code: 200 message: OK @@ -103,24 +105,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:10 GMT + - Tue, 07 Sep 2021 21:44:49 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d562-1fc9-51b9-a43a0d00941a"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-2aa6-95f1-343a0d001a44"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:54:10 GMT + - Tue, 07 Sep 2021 21:44:48 GMT ms-cv: - - Sf27eaCSXECGtSbQ3xVNgA.0 + - REnju7C2xkquE4UgL3RgrQ.0 request-context: - appId= strict-transport-security: @@ -130,7 +133,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 98ms + - 26ms status: code: 201 message: Created @@ -148,24 +151,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:10 GMT + - Tue, 07 Sep 2021 21:44:49 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:54:09.9658129+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:44:49.804738+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:54:10 GMT + - Tue, 07 Sep 2021 21:44:48 GMT ms-cv: - - 2pvk2x1rSEC49KodxUMVwA.0 + - Mu4We5ltm0q5wMUUXCCbmw.0 request-context: - appId= strict-transport-security: @@ -175,7 +179,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 155ms + - 33ms status: code: 200 message: OK @@ -189,81 +193,81 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) repeatability-request-id: - - 688c08f7-d916-485c-b32e-dc2de45bbab0 + - f0013ebb-0af2-47e3-a232-4f083945af6a method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 response: - body: '{"chatThread": {"id": "19:6LDSbOCXBWWvZnFFxPmDLC3x5_3oXqyaCG6OC28K2nQ1@thread.v2", - "topic": "test topic", "createdOn": "2021-06-22T20:54:11Z", "createdByCommunicationIdentifier": - {"rawId": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d562-1df7-51b9-a43a0d009419", - "communicationUser": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d562-1df7-51b9-a43a0d009419"}}}}' + body: '{"chatThread": {"id": "19:sGTCiUxXKC17NeVW5tPqq4XKafoB-V71V6acT69rD6o1@thread.v2", + "topic": "test topic", "createdOn": "2021-09-07T21:44:50Z", "createdByCommunicationIdentifier": + {"rawId": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-2a09-95f1-343a0d001a43", + "communicationUser": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-2a09-95f1-343a0d001a43"}}}}' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: application/json; charset=utf-8 - date: Tue, 22 Jun 2021 20:54:11 GMT - ms-cv: PjLujZB+ZEqERW3yVaQW2Q.0 + date: Tue, 07 Sep 2021 21:44:50 GMT + ms-cv: CuA407Gta06ExsZ4t68JNA.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked x-cache: CONFIG_NOCACHE - x-processing-time: 708ms + x-processing-time: 897ms status: code: 201 message: Created - url: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: GET - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 response: - body: '{"id": "sanitized", "topic": "test topic", "createdOn": "2021-06-22T20:54:11Z", - "createdByCommunicationIdentifier": {"rawId": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d562-1df7-51b9-a43a0d009419", - "communicationUser": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d562-1df7-51b9-a43a0d009419"}}}' + body: '{"id": "sanitized", "topic": "test topic", "createdOn": "2021-09-07T21:44:50Z", + "createdByCommunicationIdentifier": {"rawId": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-2a09-95f1-343a0d001a43", + "communicationUser": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-2a09-95f1-343a0d001a43"}}}' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: application/json; charset=utf-8 - date: Tue, 22 Jun 2021 20:54:12 GMT - ms-cv: t8aAZGqQREy2lRPb2tLSFw.0 + date: Tue, 07 Sep 2021 21:44:50 GMT + ms-cv: dDDfSbi3NEWvAv72YtXfOw.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked x-cache: CONFIG_NOCACHE - x-processing-time: 90ms + x-processing-time: 279ms status: code: 200 message: OK - url: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 response: body: string: '' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 - date: Tue, 22 Jun 2021 20:54:12 GMT - ms-cv: l1NFCKT1802RymnMQEMGUA.0 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 + date: Tue, 07 Sep 2021 21:44:51 GMT + ms-cv: LVSu8mPeU065YcrW37OaRA.0 strict-transport-security: max-age=2592000 x-cache: CONFIG_NOCACHE - x-processing-time: 124ms + x-processing-time: 403ms status: code: 204 message: No Content - url: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 - request: body: null headers: @@ -276,9 +280,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:12 GMT + - Tue, 07 Sep 2021 21:44:51 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -288,11 +292,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:54:13 GMT + - Tue, 07 Sep 2021 21:44:51 GMT ms-cv: - - tksE94u4g0mOaIPraXGUWw.0 + - PSQPz3h5pka/9H+6EIljWw.0 request-context: - appId= strict-transport-security: @@ -300,7 +305,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 679ms + - 229ms status: code: 204 message: No Content @@ -316,9 +321,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:13 GMT + - Tue, 07 Sep 2021 21:44:51 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -328,11 +333,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:54:14 GMT + - Tue, 07 Sep 2021 21:44:51 GMT ms-cv: - - XdL6QvFe3U+iwuyR4jQWXQ.0 + - UdsQMdV5XUqPrZ6ZmPgzmQ.0 request-context: - appId= strict-transport-security: @@ -340,7 +346,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 752ms + - 194ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_list_messages.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_list_messages.yaml index 3ce050a67048..c659aaf84b45 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_list_messages.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_list_messages.yaml @@ -13,24 +13,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:14 GMT + - Tue, 07 Sep 2021 21:44:52 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d562-2f94-ceb1-a43a0d00be3d"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-3586-b271-25482200110f"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:54:14 GMT + - Tue, 07 Sep 2021 21:44:51 GMT ms-cv: - - qno+WgjR1kijEOzaDWVRmw.0 + - niDxXuZxSEG2D2zDWkywZw.0 request-context: - appId= strict-transport-security: @@ -40,7 +41,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 59ms + - 92ms status: code: 201 message: Created @@ -58,24 +59,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:14 GMT + - Tue, 07 Sep 2021 21:44:52 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:54:13.9575394+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:44:52.697843+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:54:14 GMT + - Tue, 07 Sep 2021 21:44:52 GMT ms-cv: - - WxZVPzHY0EScFh1JhfdnSA.0 + - L2WVrJu2o0yqM4ZpU/ZD7w.0 request-context: - appId= strict-transport-security: @@ -85,7 +87,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 136ms + - 163ms status: code: 200 message: OK @@ -103,24 +105,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:15 GMT + - Tue, 07 Sep 2021 21:44:52 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d562-313b-ceb1-a43a0d00be3e"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-3763-b271-254822001110"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:54:14 GMT + - Tue, 07 Sep 2021 21:44:52 GMT ms-cv: - - GdmHh306W0qKqXYosKng5A.0 + - DtCdHEd8ukKClQcJk3OXzA.0 request-context: - appId= strict-transport-security: @@ -130,7 +133,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 60ms + - 156ms status: code: 201 message: Created @@ -148,24 +151,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:15 GMT + - Tue, 07 Sep 2021 21:44:53 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:54:14.3763+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:44:53.3289064+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:54:14 GMT + - Tue, 07 Sep 2021 21:44:52 GMT ms-cv: - - yapNkafm2UKFPdGE2kNABw.0 + - L4apj4P7YkixOFFUQv5A0Q.0 request-context: - appId= strict-transport-security: @@ -175,7 +179,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 135ms + - 200ms status: code: 200 message: OK @@ -189,30 +193,30 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) repeatability-request-id: - - 2ec1eab4-67e2-419c-a8c3-ad007e02e535 + - 24f8205c-a9d5-43bc-93e9-44c5bab710ce method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 response: - body: '{"chatThread": {"id": "19:-BvCnUQkh7-NosK2rCWxqE1TIlbPcrdeUpvGI_aw0WA1@thread.v2", - "topic": "test topic", "createdOn": "2021-06-22T20:54:15Z", "createdByCommunicationIdentifier": - {"rawId": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d562-2f94-ceb1-a43a0d00be3d", - "communicationUser": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d562-2f94-ceb1-a43a0d00be3d"}}}}' + body: '{"chatThread": {"id": "19:WXxNa9vqZ52MaEuMBiaZug4oyabQmXt41lWVyH7W9WU1@thread.v2", + "topic": "test topic", "createdOn": "2021-09-07T21:44:53Z", "createdByCommunicationIdentifier": + {"rawId": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-3586-b271-25482200110f", + "communicationUser": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-3586-b271-25482200110f"}}}}' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: application/json; charset=utf-8 - date: Tue, 22 Jun 2021 20:54:16 GMT - ms-cv: vOkIhlOJwEaDcWUwMwwEHg.0 + date: Tue, 07 Sep 2021 21:44:53 GMT + ms-cv: tN0tSv+YUUeiAZkQE4OCjw.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked x-cache: CONFIG_NOCACHE - x-processing-time: 1098ms + x-processing-time: 482ms status: code: 201 message: Created - url: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 - request: body: '{"content": "hello world", "senderDisplayName": "sender name", "type": "text"}' @@ -224,149 +228,149 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: POST - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2021-09-07 response: body: '{"id": "sanitized"}' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: application/json; charset=utf-8 - date: Tue, 22 Jun 2021 20:54:16 GMT - ms-cv: veT6Y7DBQEC2PGwqguj6Og.0 + date: Tue, 07 Sep 2021 21:44:54 GMT + ms-cv: tv7yqp0tjUWPpFezNwFpSA.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked x-cache: CONFIG_NOCACHE - x-processing-time: 255ms + x-processing-time: 326ms status: code: 201 message: Created - url: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2021-09-07 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: GET - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?maxPageSize=1&api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?maxPageSize=1&api-version=2021-09-07 response: body: '{"value": "sanitized", "nextLink": "sanitized"}' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: application/json; charset=utf-8 - date: Tue, 22 Jun 2021 20:54:16 GMT - ms-cv: zLsxENg1+EOnd1sRdwstVg.0 + date: Tue, 07 Sep 2021 21:44:54 GMT + ms-cv: 9oto8nu1IUWvJVtjY+TBCA.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked x-cache: CONFIG_NOCACHE - x-processing-time: 153ms + x-processing-time: 130ms status: code: 200 message: OK - url: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?maxPageSize=1&api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?maxPageSize=1&api-version=2021-09-07 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: GET - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?syncState=sanitized&startTime=1/1/1970%2012:00:00%20AM%20%2B00:00&maxPageSize=1&api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?syncState=sanitized&startTime=1/1/1970%2012:00:00%20AM%20%2B00:00&maxPageSize=1&api-version=2021-09-07 response: body: '{"value": "sanitized", "nextLink": "sanitized"}' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: application/json; charset=utf-8 - date: Tue, 22 Jun 2021 20:54:16 GMT - ms-cv: m8FKnXWBHUunjtpVcUn2xQ.0 + date: Tue, 07 Sep 2021 21:44:54 GMT + ms-cv: JzntGVq4Cke8xa1FEG/mbg.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked x-cache: CONFIG_NOCACHE - x-processing-time: 216ms + x-processing-time: 126ms status: code: 200 message: OK - url: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?syncState=sanitized&startTime=1/1/1970%2012:00:00%20AM%20%2B00:00&maxPageSize=1&api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?syncState=sanitized&startTime=1/1/1970%2012:00:00%20AM%20%2B00:00&maxPageSize=1&api-version=2021-09-07 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: GET - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?syncState=sanitized&startTime=1/1/1970%2012:00:00%20AM%20%2B00:00&maxPageSize=1&api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?syncState=sanitized&startTime=1/1/1970%2012:00:00%20AM%20%2B00:00&maxPageSize=1&api-version=2021-09-07 response: body: '{"value": "sanitized", "nextLink": "sanitized"}' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: application/json; charset=utf-8 - date: Tue, 22 Jun 2021 20:54:17 GMT - ms-cv: zTVMe32EGUCXcZzcbkK93w.0 + date: Tue, 07 Sep 2021 21:44:54 GMT + ms-cv: zXJz4SWKLkOqhU7nsvobdg.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked x-cache: CONFIG_NOCACHE - x-processing-time: 216ms + x-processing-time: 127ms status: code: 200 message: OK - url: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?syncState=sanitized&startTime=1/1/1970%2012:00:00%20AM%20%2B00:00&maxPageSize=1&api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?syncState=sanitized&startTime=1/1/1970%2012:00:00%20AM%20%2B00:00&maxPageSize=1&api-version=2021-09-07 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: GET - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?syncState=sanitized&startTime=1/1/1970%2012:00:00%20AM%20%2B00:00&maxPageSize=1&api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?syncState=sanitized&startTime=1/1/1970%2012:00:00%20AM%20%2B00:00&maxPageSize=1&api-version=2021-09-07 response: body: '{"value": "sanitized"}' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: application/json; charset=utf-8 - date: Tue, 22 Jun 2021 20:54:17 GMT - ms-cv: 50u/dVa2xkWKvfEtj8Hu1A.0 + date: Tue, 07 Sep 2021 21:44:55 GMT + ms-cv: r6wiQev7kkOj/al9VTzkkw.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked x-cache: CONFIG_NOCACHE - x-processing-time: 293ms + x-processing-time: 128ms status: code: 200 message: OK - url: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?syncState=sanitized&startTime=1/1/1970%2012:00:00%20AM%20%2B00:00&maxPageSize=1&api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?syncState=sanitized&startTime=1/1/1970%2012:00:00%20AM%20%2B00:00&maxPageSize=1&api-version=2021-09-07 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 response: body: string: '' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 - date: Tue, 22 Jun 2021 20:54:17 GMT - ms-cv: tyrZYzqAQk+y2NE0EGSyTA.0 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 + date: Tue, 07 Sep 2021 21:44:54 GMT + ms-cv: xMSuFtz4k0uQOjljqOKRWw.0 strict-transport-security: max-age=2592000 x-cache: CONFIG_NOCACHE - x-processing-time: 298ms + x-processing-time: 256ms status: code: 204 message: No Content - url: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 - request: body: null headers: @@ -379,9 +383,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:18 GMT + - Tue, 07 Sep 2021 21:44:55 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -391,11 +395,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:54:18 GMT + - Tue, 07 Sep 2021 21:44:55 GMT ms-cv: - - YYzFUh/Oq0GwQVQoy7DGEw.0 + - ZRU7fGCInUGgysxEcrdYLA.0 request-context: - appId= strict-transport-security: @@ -403,7 +408,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 588ms + - 647ms status: code: 204 message: No Content @@ -419,9 +424,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:19 GMT + - Tue, 07 Sep 2021 21:44:56 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -431,11 +436,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:54:19 GMT + - Tue, 07 Sep 2021 21:44:56 GMT ms-cv: - - D8kNdWJcFkSl65osT65WTg.0 + - 7jaX+PgjfUGhXimDu9GF5Q.0 request-context: - appId= strict-transport-security: @@ -443,7 +449,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 599ms + - 502ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_list_participants.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_list_participants.yaml index 1262bc561b98..c165c9b302d7 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_list_participants.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_list_participants.yaml @@ -13,24 +13,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:20 GMT + - Tue, 07 Sep 2021 21:44:56 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d562-47e0-ceb1-a43a0d00be45"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-4746-5505-4548220010f2"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:54:20 GMT + - Tue, 07 Sep 2021 21:44:56 GMT ms-cv: - - 4cdXxvLfn0yzJOe/FkqhEw.0 + - 9yDE9R4mPEO6JMGXenFzZw.0 request-context: - appId= strict-transport-security: @@ -40,7 +41,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 65ms + - 61ms status: code: 201 message: Created @@ -58,24 +59,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:21 GMT + - Tue, 07 Sep 2021 21:44:57 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:54:20.2206621+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:44:57.1834418+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:54:20 GMT + - Tue, 07 Sep 2021 21:44:57 GMT ms-cv: - - pXvVqjoZXESzKPWpK0nvbg.0 + - Ku25V/WbPUKrm1F5z3mRSA.0 request-context: - appId= strict-transport-security: @@ -85,7 +87,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 131ms + - 164ms status: code: 200 message: OK @@ -103,24 +105,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:21 GMT + - Tue, 07 Sep 2021 21:44:57 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d562-49d5-ceb1-a43a0d00be46"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-491e-5505-4548220010f3"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:54:20 GMT + - Tue, 07 Sep 2021 21:44:57 GMT ms-cv: - - J/GDmkv77kavo6bM1c+myQ.0 + - ETjii/fd00mJL1NIYxUGew.0 request-context: - appId= strict-transport-security: @@ -130,7 +133,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 63ms + - 125ms status: code: 201 message: Created @@ -148,24 +151,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:21 GMT + - Tue, 07 Sep 2021 21:44:57 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:54:20.6923263+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:44:57.7481403+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:54:20 GMT + - Tue, 07 Sep 2021 21:44:57 GMT ms-cv: - - i1fclV1Qskmh5v8J5pUukA.0 + - JjtmHNRBikmwUxJCkX3iZg.0 request-context: - appId= strict-transport-security: @@ -175,7 +179,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 130ms + - 127ms status: code: 200 message: OK @@ -189,30 +193,30 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) repeatability-request-id: - - 54313c93-9823-44c3-84e9-8b1d7e31cc53 + - 5336780d-0490-4e24-a361-7229339e60cc method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 response: - body: '{"chatThread": {"id": "19:vVHmsbRsyNUbAUFVwcFYrsJ970aWOClkvnZxG16V5TU1@thread.v2", - "topic": "test topic", "createdOn": "2021-06-22T20:54:21Z", "createdByCommunicationIdentifier": - {"rawId": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d562-47e0-ceb1-a43a0d00be45", - "communicationUser": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d562-47e0-ceb1-a43a0d00be45"}}}}' + body: '{"chatThread": {"id": "19:_wkExGuPJELz-udrzZ2E292HEajdtYybjfNM2mkZ4SE1@thread.v2", + "topic": "test topic", "createdOn": "2021-09-07T21:44:57Z", "createdByCommunicationIdentifier": + {"rawId": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-4746-5505-4548220010f2", + "communicationUser": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-4746-5505-4548220010f2"}}}}' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: application/json; charset=utf-8 - date: Tue, 22 Jun 2021 20:54:21 GMT - ms-cv: KR1oIRziQEKbK8OWcP2b0w.0 + date: Tue, 07 Sep 2021 21:44:57 GMT + ms-cv: 3ziGdCYb+E2Stzd1GzJdHA.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked x-cache: CONFIG_NOCACHE - x-processing-time: 696ms + x-processing-time: 607ms status: code: 201 message: Created - url: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 - request: body: '{"participants": "sanitized"}' headers: @@ -223,74 +227,74 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: POST - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/participants/:add?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/participants/:add?api-version=2021-09-07 response: body: '{}' headers: api-supported-versions: 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: application/json; charset=utf-8 - date: Tue, 22 Jun 2021 20:54:22 GMT - ms-cv: Abns45iUlEa8RmnjmVgaqQ.0 + date: Tue, 07 Sep 2021 21:44:58 GMT + ms-cv: A9UMKKHYS0CpCKAPwcTxIA.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked x-cache: CONFIG_NOCACHE - x-processing-time: 255ms + x-processing-time: 190ms status: code: 201 message: Created - url: https://sanitized.communication.azure.com/chat/threads/sanitized/participants/:add?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads/sanitized/participants/:add?api-version=2021-09-07 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: GET - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/participants?maxPageSize=1&skip=1&api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/participants?maxPageSize=1&skip=1&api-version=2021-09-07 response: body: '{"value": "sanitized"}' headers: api-supported-versions: 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: application/json; charset=utf-8 - date: Tue, 22 Jun 2021 20:54:22 GMT - ms-cv: 2Zr8WiuwTkeceKfN9+DAXA.0 + date: Tue, 07 Sep 2021 21:44:58 GMT + ms-cv: rPTH+xWgnUayx6llbtfD6Q.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked x-cache: CONFIG_NOCACHE - x-processing-time: 103ms + x-processing-time: 95ms status: code: 200 message: OK - url: https://sanitized.communication.azure.com/chat/threads/sanitized/participants?maxPageSize=1&skip=1&api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads/sanitized/participants?maxPageSize=1&skip=1&api-version=2021-09-07 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 response: body: string: '' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 - date: Tue, 22 Jun 2021 20:54:22 GMT - ms-cv: w1qWZgHqW0uHzw3N7K6x4Q.0 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 + date: Tue, 07 Sep 2021 21:44:58 GMT + ms-cv: QQCoSf+Rb0OPJTFqjrZ3kg.0 strict-transport-security: max-age=2592000 x-cache: CONFIG_NOCACHE - x-processing-time: 126ms + x-processing-time: 239ms status: code: 204 message: No Content - url: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 - request: body: null headers: @@ -303,9 +307,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:23 GMT + - Tue, 07 Sep 2021 21:44:59 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -315,11 +319,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:54:23 GMT + - Tue, 07 Sep 2021 21:44:59 GMT ms-cv: - - xbR2O1ZgsEuOFAZdOzSong.0 + - jVxb7h0q80mNBiuUPgDjVA.0 request-context: - appId= strict-transport-security: @@ -327,7 +332,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 671ms + - 326ms status: code: 204 message: No Content @@ -343,9 +348,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:24 GMT + - Tue, 07 Sep 2021 21:44:59 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -355,11 +360,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:54:24 GMT + - Tue, 07 Sep 2021 21:44:59 GMT ms-cv: - - I0MqS8Bp2kKNl/GtQRVL4w.0 + - yQUTcljTnU2K3AbAyukYOw.0 request-context: - appId= strict-transport-security: @@ -367,7 +373,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 711ms + - 260ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_list_read_receipts.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_list_read_receipts.yaml index edd49792d88a..56cf68b02bd3 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_list_read_receipts.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_list_read_receipts.yaml @@ -13,24 +13,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:25 GMT + - Tue, 07 Sep 2021 21:45:00 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d562-596b-b8ba-a43a0d002d11"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-53e5-89df-44482200127d"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:54:24 GMT + - Tue, 07 Sep 2021 21:44:59 GMT ms-cv: - - +M/pYbd5ekaEb+MikDW9Lg.0 + - hQlDNagHr0+40hsphzXKww.0 request-context: - appId= strict-transport-security: @@ -40,7 +41,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 62ms + - 63ms status: code: 201 message: Created @@ -58,24 +59,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:25 GMT + - Tue, 07 Sep 2021 21:45:00 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:54:24.6795353+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:45:00.4891763+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:54:24 GMT + - Tue, 07 Sep 2021 21:45:00 GMT ms-cv: - - 1Um9nUSh2EGxsDfUizh3Eg.0 + - UiXKrWpWyUqzGK4EB88gPA.0 request-context: - appId= strict-transport-security: @@ -85,7 +87,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 140ms + - 238ms status: code: 200 message: OK @@ -103,24 +105,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:25 GMT + - Tue, 07 Sep 2021 21:45:00 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d562-5afc-b8ba-a43a0d002d12"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-5618-89df-44482200127e"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:54:25 GMT + - Tue, 07 Sep 2021 21:45:00 GMT ms-cv: - - kApVSJfIj0SFaJ11GqWIQA.0 + - auCR2GSBwUqZLLZjZuAzQA.0 request-context: - appId= strict-transport-security: @@ -130,7 +133,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 60ms + - 62ms status: code: 201 message: Created @@ -148,24 +151,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:25 GMT + - Tue, 07 Sep 2021 21:45:00 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:54:24.0726322+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:45:01.1589607+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:54:25 GMT + - Tue, 07 Sep 2021 21:45:00 GMT ms-cv: - - b0jfkb4u3EicByRfv6TwJA.0 + - pyrEpCJGjECukzKBJhmOzA.0 request-context: - appId= strict-transport-security: @@ -175,7 +179,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 138ms + - 295ms status: code: 200 message: OK @@ -189,30 +193,30 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) repeatability-request-id: - - 6f60d9df-0261-4d6f-9df5-5d7dc4e020f5 + - 241bf0fc-79e9-427d-a80e-00481dc938b5 method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 response: - body: '{"chatThread": {"id": "19:e7oDYrKtGUNpCbdNh2sL0LFls3C25lvhfeEtoZlkRtM1@thread.v2", - "topic": "test topic", "createdOn": "2021-06-22T20:54:26Z", "createdByCommunicationIdentifier": - {"rawId": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d562-596b-b8ba-a43a0d002d11", - "communicationUser": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d562-596b-b8ba-a43a0d002d11"}}}}' + body: '{"chatThread": {"id": "19:dO_stDpbWrWsk4OuKPlcx7EyFkkcZGljtDGL-_AV5do1@thread.v2", + "topic": "test topic", "createdOn": "2021-09-07T21:45:01Z", "createdByCommunicationIdentifier": + {"rawId": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-53e5-89df-44482200127d", + "communicationUser": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-53e5-89df-44482200127d"}}}}' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: application/json; charset=utf-8 - date: Tue, 22 Jun 2021 20:54:26 GMT - ms-cv: G/hz8rX8jk27tlZG0No7TQ.0 + date: Tue, 07 Sep 2021 21:45:00 GMT + ms-cv: drEh+s+A9kq7OwJmabRCkg.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked x-cache: CONFIG_NOCACHE - x-processing-time: 450ms + x-processing-time: 547ms status: code: 201 message: Created - url: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 - request: body: '{"content": "hello world", "senderDisplayName": "sender name", "type": "text"}' @@ -224,25 +228,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: POST - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2021-09-07 response: body: '{"id": "sanitized"}' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: application/json; charset=utf-8 - date: Tue, 22 Jun 2021 20:54:26 GMT - ms-cv: TBzEYBVOp0ezRotk6g+oQQ.0 + date: Tue, 07 Sep 2021 21:45:01 GMT + ms-cv: +PAff+enIEihvY0rkYT0eA.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked x-cache: CONFIG_NOCACHE - x-processing-time: 198ms + x-processing-time: 232ms status: code: 201 message: Created - url: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2021-09-07 - request: body: '{"chatMessageId": "sanitized"}' headers: @@ -253,50 +257,50 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: POST - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/readReceipts?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/readReceipts?api-version=2021-09-07 response: body: string: '' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-length: '0' - date: Tue, 22 Jun 2021 20:54:26 GMT - ms-cv: ZQvBdcoiikKJuyqRUePN9A.0 + date: Tue, 07 Sep 2021 21:45:01 GMT + ms-cv: Vq4YOSxjFkOC0QdIq1aLlA.0 strict-transport-security: max-age=2592000 x-cache: CONFIG_NOCACHE - x-processing-time: 116ms + x-processing-time: 169ms status: code: 200 message: OK - url: https://sanitized.communication.azure.com/chat/threads/sanitized/readReceipts?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads/sanitized/readReceipts?api-version=2021-09-07 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: GET - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/readReceipts?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/readReceipts?api-version=2021-09-07 response: body: '{"value": "sanitized"}' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: application/json; charset=utf-8 - date: Tue, 22 Jun 2021 20:54:26 GMT - ms-cv: Il3dgS029UWsvq4r6vhkuw.0 + date: Tue, 07 Sep 2021 21:45:02 GMT + ms-cv: 28SMUeOvqkeQjXbJhIrVvA.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked x-cache: CONFIG_NOCACHE - x-processing-time: 148ms + x-processing-time: 376ms status: code: 200 message: OK - url: https://sanitized.communication.azure.com/chat/threads/sanitized/readReceipts?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads/sanitized/readReceipts?api-version=2021-09-07 - request: body: '{"content": "hello world", "senderDisplayName": "sender name", "type": "text"}' @@ -308,25 +312,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: POST - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2021-09-07 response: body: '{"id": "sanitized"}' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: application/json; charset=utf-8 - date: Tue, 22 Jun 2021 20:54:27 GMT - ms-cv: JBbVET7fwEOyN448LVR7Ng.0 + date: Tue, 07 Sep 2021 21:45:02 GMT + ms-cv: XGqt/Sbi/0WP04xECmPPhA.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked x-cache: CONFIG_NOCACHE - x-processing-time: 212ms + x-processing-time: 181ms status: code: 201 message: Created - url: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2021-09-07 - request: body: '{"chatMessageId": "sanitized"}' headers: @@ -337,50 +341,50 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: POST - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/readReceipts?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/readReceipts?api-version=2021-09-07 response: body: string: '' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-length: '0' - date: Tue, 22 Jun 2021 20:54:27 GMT - ms-cv: u5owL29DjkeGm+ywVNR4NA.0 + date: Tue, 07 Sep 2021 21:45:02 GMT + ms-cv: 3BKnc14wrUO6zmSe6G9FKw.0 strict-transport-security: max-age=2592000 x-cache: CONFIG_NOCACHE - x-processing-time: 141ms + x-processing-time: 168ms status: code: 200 message: OK - url: https://sanitized.communication.azure.com/chat/threads/sanitized/readReceipts?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads/sanitized/readReceipts?api-version=2021-09-07 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: GET - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/readReceipts?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/readReceipts?api-version=2021-09-07 response: body: '{"value": "sanitized"}' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: application/json; charset=utf-8 - date: Tue, 22 Jun 2021 20:54:28 GMT - ms-cv: D2vXx2TFZ0e8er0BZm9pCw.0 + date: Tue, 07 Sep 2021 21:45:02 GMT + ms-cv: CAKDAi26wE+vndJLqqdjbg.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked x-cache: CONFIG_NOCACHE - x-processing-time: 108ms + x-processing-time: 106ms status: code: 200 message: OK - url: https://sanitized.communication.azure.com/chat/threads/sanitized/readReceipts?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads/sanitized/readReceipts?api-version=2021-09-07 - request: body: '{"content": "content", "senderDisplayName": "sender_display_name", "type": "text"}' @@ -392,25 +396,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: POST - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2021-09-07 response: body: '{"id": "sanitized"}' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: application/json; charset=utf-8 - date: Tue, 22 Jun 2021 20:54:27 GMT - ms-cv: 6oJtVbwoWk+Lz5OTTmMpeg.0 + date: Tue, 07 Sep 2021 21:45:03 GMT + ms-cv: hmEZ4dqDlUudcnFRYWLvcA.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked x-cache: CONFIG_NOCACHE - x-processing-time: 174ms + x-processing-time: 210ms status: code: 201 message: Created - url: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2021-09-07 - request: body: '{"chatMessageId": "sanitized"}' headers: @@ -421,99 +425,99 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: POST - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/readReceipts?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/readReceipts?api-version=2021-09-07 response: body: string: '' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-length: '0' - date: Tue, 22 Jun 2021 20:54:28 GMT - ms-cv: RHxHXip2W0OP+wiA9aCwqg.0 + date: Tue, 07 Sep 2021 21:45:03 GMT + ms-cv: aBFM+UokIk2Xj1DeZKY12g.0 strict-transport-security: max-age=2592000 x-cache: CONFIG_NOCACHE - x-processing-time: 97ms + x-processing-time: 253ms status: code: 200 message: OK - url: https://sanitized.communication.azure.com/chat/threads/sanitized/readReceipts?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads/sanitized/readReceipts?api-version=2021-09-07 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: GET - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/readReceipts?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/readReceipts?api-version=2021-09-07 response: body: '{"value": "sanitized"}' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: application/json; charset=utf-8 - date: Tue, 22 Jun 2021 20:54:28 GMT - ms-cv: ndpKimPpNUy6KW4PW+QyIg.0 + date: Tue, 07 Sep 2021 21:45:03 GMT + ms-cv: v9wZrbcbY0mzSoQX7ltzdQ.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked x-cache: CONFIG_NOCACHE - x-processing-time: 118ms + x-processing-time: 103ms status: code: 200 message: OK - url: https://sanitized.communication.azure.com/chat/threads/sanitized/readReceipts?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads/sanitized/readReceipts?api-version=2021-09-07 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: GET - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/readReceipts?maxPageSize=2&skip=0&api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/readReceipts?maxPageSize=2&skip=0&api-version=2021-09-07 response: body: '{"value": "sanitized"}' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: application/json; charset=utf-8 - date: Tue, 22 Jun 2021 20:54:29 GMT - ms-cv: QTu1bX322EaphP3bGtdmig.0 + date: Tue, 07 Sep 2021 21:45:04 GMT + ms-cv: 4qvQ9Mj5Xki2XiV02tpZnw.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked x-cache: CONFIG_NOCACHE - x-processing-time: 129ms + x-processing-time: 85ms status: code: 200 message: OK - url: https://sanitized.communication.azure.com/chat/threads/sanitized/readReceipts?maxPageSize=2&skip=0&api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads/sanitized/readReceipts?maxPageSize=2&skip=0&api-version=2021-09-07 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 response: body: string: '' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 - date: Tue, 22 Jun 2021 20:54:29 GMT - ms-cv: cipnldZBs0qong6eweHJcQ.0 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 + date: Tue, 07 Sep 2021 21:45:03 GMT + ms-cv: +tR15y9KvEimI5dLd8gYNw.0 strict-transport-security: max-age=2592000 x-cache: CONFIG_NOCACHE - x-processing-time: 178ms + x-processing-time: 236ms status: code: 204 message: No Content - url: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 - request: body: null headers: @@ -526,9 +530,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:29 GMT + - Tue, 07 Sep 2021 21:45:04 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -538,11 +542,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:54:29 GMT + - Tue, 07 Sep 2021 21:45:04 GMT ms-cv: - - I9UVp+7RGky9WYz7K4svVA.0 + - NApEgi8dx0awc+ghdcbW4g.0 request-context: - appId= strict-transport-security: @@ -550,7 +555,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 657ms + - 268ms status: code: 204 message: No Content @@ -566,9 +571,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:30 GMT + - Tue, 07 Sep 2021 21:45:05 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -578,11 +583,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:54:30 GMT + - Tue, 07 Sep 2021 21:45:05 GMT ms-cv: - - X5aCNTC/lU+ik1HggqYISA.0 + - Jwnb1ja1iEOa0vzQNdYaIA.0 request-context: - appId= strict-transport-security: @@ -590,7 +596,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 618ms + - 322ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_remove_participant.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_remove_participant.yaml index f7f644ef3546..849ca93646cd 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_remove_participant.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_remove_participant.yaml @@ -13,24 +13,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:31 GMT + - Tue, 07 Sep 2021 21:45:05 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d562-717f-f6c7-593a0d00a00d"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-69a2-f3f5-343a0d00171c"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:54:31 GMT + - Tue, 07 Sep 2021 21:45:05 GMT ms-cv: - - IqvWsJuyq0WoSkExSYrgNg.0 + - kxpMp32TSEuoSO9oeOTCtA.0 request-context: - appId= strict-transport-security: @@ -40,7 +41,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 44ms + - 30ms status: code: 201 message: Created @@ -58,24 +59,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:31 GMT + - Tue, 07 Sep 2021 21:45:05 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:54:30.6578675+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:45:05.7781732+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:54:31 GMT + - Tue, 07 Sep 2021 21:45:05 GMT ms-cv: - - 2IcCcwd2v0CCS1Sjh8aCKg.0 + - L5GNcnbd1kmpo5WKBt28Ig.0 request-context: - appId= strict-transport-security: @@ -85,7 +87,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 26ms + - 32ms status: code: 200 message: OK @@ -103,24 +105,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:31 GMT + - Tue, 07 Sep 2021 21:45:05 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d562-7247-f6c7-593a0d00a00e"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-6a2d-f3f5-343a0d00171d"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:54:31 GMT + - Tue, 07 Sep 2021 21:45:05 GMT ms-cv: - - +ARJdn1gbUSv+VunSIQZ3A.0 + - txdvO/02f0CxviYHDKRDKg.0 request-context: - appId= strict-transport-security: @@ -130,7 +133,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 35ms + - 25ms status: code: 201 message: Created @@ -148,24 +151,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:31 GMT + - Tue, 07 Sep 2021 21:45:05 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:54:30.89207+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:45:06.0090653+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:54:31 GMT + - Tue, 07 Sep 2021 21:45:05 GMT ms-cv: - - P3/7emU+i0y5qG4b0Nkeew.0 + - 6e2kyI1wN0ywE4pXt+pzSg.0 request-context: - appId= strict-transport-security: @@ -175,7 +179,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 62ms + - 84ms status: code: 200 message: OK @@ -189,30 +193,30 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) repeatability-request-id: - - 1e069a50-3c63-4a4e-b49d-618ddebd4414 + - 377b718c-bacb-4a97-bec3-65b3867d3653 method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 response: - body: '{"chatThread": {"id": "19:1ungQFx5v99KM_cZK_UXp0A5vy822oO__BjqoQmIm0c1@thread.v2", - "topic": "test topic", "createdOn": "2021-06-22T20:54:32Z", "createdByCommunicationIdentifier": - {"rawId": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d562-717f-f6c7-593a0d00a00d", - "communicationUser": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d562-717f-f6c7-593a0d00a00d"}}}}' + body: '{"chatThread": {"id": "19:bYn5kDnCZ4uXYYycph5ut-Zw2a67z2KlK06WdNPR_Ko1@thread.v2", + "topic": "test topic", "createdOn": "2021-09-07T21:45:06Z", "createdByCommunicationIdentifier": + {"rawId": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-69a2-f3f5-343a0d00171c", + "communicationUser": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-69a2-f3f5-343a0d00171c"}}}}' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: application/json; charset=utf-8 - date: Tue, 22 Jun 2021 20:54:32 GMT - ms-cv: h7NhsyYQlEGj7XTNgWx4DQ.0 + date: Tue, 07 Sep 2021 21:45:06 GMT + ms-cv: 4KMQgB0V1EqAlsQG+Ec/sQ.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked x-cache: CONFIG_NOCACHE - x-processing-time: 742ms + x-processing-time: 614ms status: code: 201 message: Created - url: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 - request: body: '{"participants": "sanitized"}' headers: @@ -223,28 +227,28 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: POST - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/participants/:add?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/participants/:add?api-version=2021-09-07 response: body: '{}' headers: api-supported-versions: 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: application/json; charset=utf-8 - date: Tue, 22 Jun 2021 20:54:33 GMT - ms-cv: 792I65gM3UmT7bUDVx/xSQ.0 + date: Tue, 07 Sep 2021 21:45:06 GMT + ms-cv: PPz86090k0SL+zpdsZO/Gg.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked x-cache: CONFIG_NOCACHE - x-processing-time: 331ms + x-processing-time: 367ms status: code: 201 message: Created - url: https://sanitized.communication.azure.com/chat/threads/sanitized/participants/:add?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads/sanitized/participants/:add?api-version=2021-09-07 - request: - body: '{"rawId": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d562-7247-f6c7-593a0d00a00e", - "communicationUser": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d562-7247-f6c7-593a0d00a00e"}}' + body: '{"rawId": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-6a2d-f3f5-343a0d00171d", + "communicationUser": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-6a2d-f3f5-343a0d00171d"}}' headers: Accept: - application/json @@ -253,48 +257,48 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: POST - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/participants/:remove?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/participants/:remove?api-version=2021-09-07 response: body: string: '' headers: api-supported-versions: 2020-11-01-preview3, 2021-01-27-preview4, 2021-03-01-preview5, - 2021-03-07, 2021-04-05-preview6 - date: Tue, 22 Jun 2021 20:54:33 GMT - ms-cv: NBLyJEFAmkWBrQTBIF3J+g.0 + 2021-03-07, 2021-04-05-preview6, 2021-09-07 + date: Tue, 07 Sep 2021 21:45:07 GMT + ms-cv: 6+CWkg8xJkCNgcr0FLuEEQ.0 strict-transport-security: max-age=2592000 x-cache: CONFIG_NOCACHE - x-processing-time: 323ms + x-processing-time: 367ms status: code: 204 message: No Content - url: https://sanitized.communication.azure.com/chat/threads/sanitized/participants/:remove?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads/sanitized/participants/:remove?api-version=2021-09-07 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 response: body: string: '' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 - date: Tue, 22 Jun 2021 20:54:33 GMT - ms-cv: nd4N1IhVPEyzqWJkVYSTMg.0 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 + date: Tue, 07 Sep 2021 21:45:07 GMT + ms-cv: p7Y5xdCszEa4ExV3ex52ng.0 strict-transport-security: max-age=2592000 x-cache: CONFIG_NOCACHE - x-processing-time: 125ms + x-processing-time: 247ms status: code: 204 message: No Content - url: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 - request: body: null headers: @@ -307,9 +311,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:33 GMT + - Tue, 07 Sep 2021 21:45:07 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -319,11 +323,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:54:34 GMT + - Tue, 07 Sep 2021 21:45:08 GMT ms-cv: - - 29WY8NNhWUmQ9AeHdq/rNA.0 + - vnN/W1VkIkitb6V53CVsNg.0 request-context: - appId= strict-transport-security: @@ -331,7 +336,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 745ms + - 464ms status: code: 204 message: No Content @@ -347,9 +352,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:34 GMT + - Tue, 07 Sep 2021 21:45:08 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -359,11 +364,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:54:34 GMT + - Tue, 07 Sep 2021 21:45:08 GMT ms-cv: - - qPVyqimsdkmzcHUi+xuMUQ.0 + - xt8hporBskWIka8QsY0i2g.0 request-context: - appId= strict-transport-security: @@ -371,7 +377,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 778ms + - 366ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_send_message.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_send_message.yaml index f14608061d6a..a2f4741c9311 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_send_message.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_send_message.yaml @@ -13,24 +13,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:35 GMT + - Tue, 07 Sep 2021 21:45:08 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d562-8304-f6c7-593a0d00a00f"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-769e-7a77-254822004d7c"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:54:35 GMT + - Tue, 07 Sep 2021 21:45:08 GMT ms-cv: - - ALwGnKk//0OaT9X1Ntk95g.0 + - XVfj8/A/P0OtiBXL/Irdxg.0 request-context: - appId= strict-transport-security: @@ -40,7 +41,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 69ms + - 91ms status: code: 201 message: Created @@ -58,24 +59,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:36 GMT + - Tue, 07 Sep 2021 21:45:09 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:54:35.201396+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:45:09.8943178+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:54:35 GMT + - Tue, 07 Sep 2021 21:45:09 GMT ms-cv: - - osvRLdA+PEOeofdOK3gk1Q.0 + - KaHXsZroGEyhizKIW04vXg.0 request-context: - appId= strict-transport-security: @@ -85,7 +87,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 65ms + - 562ms status: code: 200 message: OK @@ -103,24 +105,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:36 GMT + - Tue, 07 Sep 2021 21:45:10 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d562-8412-f6c7-593a0d00a010"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-7a96-7a77-254822004d7e"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:54:35 GMT + - Tue, 07 Sep 2021 21:45:10 GMT ms-cv: - - OmV87kLnRkOjfAdvFuLr0A.0 + - vaOJTxkMEkmwdY7g3FAThg.0 request-context: - appId= strict-transport-security: @@ -130,7 +133,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 32ms + - 187ms status: code: 201 message: Created @@ -148,24 +151,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:36 GMT + - Tue, 07 Sep 2021 21:45:10 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:54:35.4291858+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:45:10.7099825+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:54:35 GMT + - Tue, 07 Sep 2021 21:45:10 GMT ms-cv: - - Kf7cM2EqkEamCtp1T/oThA.0 + - Q2Ansl/vDEy/ar3BEu7Czg.0 request-context: - appId= strict-transport-security: @@ -175,7 +179,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 40ms + - 316ms status: code: 200 message: OK @@ -185,34 +189,34 @@ interactions: Accept: - application/json Content-Length: - - '349' + - '350' Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) repeatability-request-id: - - be5b3ad2-e26e-431b-b848-2296fde84ed7 + - e330a6ef-4162-4bf6-a6f5-c7112107d810 method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 response: - body: '{"chatThread": {"id": "19:JwuKSQ17ePPSgIzlmMfT65-itpaosjoTTyeYTBu0DF01@thread.v2", - "topic": "test topic", "createdOn": "2021-06-22T20:54:36Z", "createdByCommunicationIdentifier": - {"rawId": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d562-8304-f6c7-593a0d00a00f", - "communicationUser": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d562-8304-f6c7-593a0d00a00f"}}}}' + body: '{"chatThread": {"id": "19:nPvYI6AbWROkP9PuRYAgagxOqL1ms7UUvJQ5T4cWzeM1@thread.v2", + "topic": "test topic", "createdOn": "2021-09-07T21:45:10Z", "createdByCommunicationIdentifier": + {"rawId": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-769e-7a77-254822004d7c", + "communicationUser": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-769e-7a77-254822004d7c"}}}}' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: application/json; charset=utf-8 - date: Tue, 22 Jun 2021 20:54:37 GMT - ms-cv: 8jJyi3KKOEqvs+XA+SEenA.0 + date: Tue, 07 Sep 2021 21:45:10 GMT + ms-cv: c49wTK85akW4KVlDmbPAhA.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked x-cache: CONFIG_NOCACHE - x-processing-time: 669ms + x-processing-time: 525ms status: code: 201 message: Created - url: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 - request: body: '{"content": "hello world", "senderDisplayName": "sender name", "type": "text"}' @@ -224,49 +228,49 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: POST - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2021-09-07 response: body: '{"id": "sanitized"}' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: application/json; charset=utf-8 - date: Tue, 22 Jun 2021 20:54:37 GMT - ms-cv: 5/f7LH34Ek+OLfGSOkJkNA.0 + date: Tue, 07 Sep 2021 21:45:10 GMT + ms-cv: LCdO3kyPzEWxfavnwuo0ow.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked x-cache: CONFIG_NOCACHE - x-processing-time: 187ms + x-processing-time: 242ms status: code: 201 message: Created - url: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2021-09-07 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 response: body: string: '' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 - date: Tue, 22 Jun 2021 20:54:37 GMT - ms-cv: +2tY6Wy0a0imxcK2aqE87w.0 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 + date: Tue, 07 Sep 2021 21:45:11 GMT + ms-cv: wOFTtOZNxUymyDK2F9CiNw.0 strict-transport-security: max-age=2592000 x-cache: CONFIG_NOCACHE - x-processing-time: 121ms + x-processing-time: 531ms status: code: 204 message: No Content - url: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 - request: body: null headers: @@ -279,9 +283,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:37 GMT + - Tue, 07 Sep 2021 21:45:12 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -291,11 +295,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:54:38 GMT + - Tue, 07 Sep 2021 21:45:12 GMT ms-cv: - - c82Dkxy8ikGWkihaylhR7w.0 + - ekbXYedqe06UpJokPBHWZg.0 request-context: - appId= strict-transport-security: @@ -303,7 +308,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 833ms + - 517ms status: code: 204 message: No Content @@ -319,9 +324,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:38 GMT + - Tue, 07 Sep 2021 21:45:12 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -331,11 +336,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:54:38 GMT + - Tue, 07 Sep 2021 21:45:13 GMT ms-cv: - - WC7lx3t0FUqf0K/5XiJeaQ.0 + - zdc2RpX7oUmoyQqQsaSrgQ.0 request-context: - appId= strict-transport-security: @@ -343,7 +349,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 510ms + - 434ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_send_read_receipt.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_send_read_receipt.yaml index ae2a14ae8545..4a6ccdb4fe84 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_send_read_receipt.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_send_read_receipt.yaml @@ -13,24 +13,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:39 GMT + - Tue, 07 Sep 2021 21:45:13 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d562-92ad-28c5-593a0d001c47"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-88b6-5505-4548220010f4"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:54:39 GMT + - Tue, 07 Sep 2021 21:45:13 GMT ms-cv: - - ZHWslVpngE6RjQ8qQR/2dw.0 + - La4yF2CdAkycWFtSdor47Q.0 request-context: - appId= strict-transport-security: @@ -40,7 +41,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 22ms + - 70ms status: code: 201 message: Created @@ -58,24 +59,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:40 GMT + - Tue, 07 Sep 2021 21:45:13 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:54:39.4154833+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:45:14.0003819+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:54:40 GMT + - Tue, 07 Sep 2021 21:45:13 GMT ms-cv: - - PzTxP5OSHkCBUT8iWGlpMg.0 + - 0Ka99W4zXkqBz75yRERndw.0 request-context: - appId= strict-transport-security: @@ -85,7 +87,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 42ms + - 213ms status: code: 200 message: OK @@ -103,24 +105,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:40 GMT + - Tue, 07 Sep 2021 21:45:14 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d562-957e-28c5-593a0d001c48"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-8aa2-5505-4548220010f5"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:54:40 GMT + - Tue, 07 Sep 2021 21:45:14 GMT ms-cv: - - hiTQSi757kSbcJn+6St8pQ.0 + - V+R/EPUkwkmaM0lUsDIyIw.0 request-context: - appId= strict-transport-security: @@ -130,7 +133,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 31ms + - 67ms status: code: 201 message: Created @@ -148,24 +151,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:40 GMT + - Tue, 07 Sep 2021 21:45:14 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:54:39.9305944+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:45:14.7511396+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:54:40 GMT + - Tue, 07 Sep 2021 21:45:14 GMT ms-cv: - - wGhXJm2eJ023sI2mKEDU8Q.0 + - 6xXo6hL06k6d19SBwNCyTw.0 request-context: - appId= strict-transport-security: @@ -175,7 +179,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 40ms + - 313ms status: code: 200 message: OK @@ -189,30 +193,30 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) repeatability-request-id: - - f11ba3f8-8d25-4853-a43b-60769bf0d247 + - e769ab00-b9a3-464c-9c45-af107c70d7b0 method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 response: - body: '{"chatThread": {"id": "19:-x6L3gHUNtF6P2wflnLjbCkW2cL6oS4UVpExU0XYUTQ1@thread.v2", - "topic": "test topic", "createdOn": "2021-06-22T20:54:41Z", "createdByCommunicationIdentifier": - {"rawId": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d562-92ad-28c5-593a0d001c47", - "communicationUser": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d562-92ad-28c5-593a0d001c47"}}}}' + body: '{"chatThread": {"id": "19:CvP3LPWwHwCrEB9QvgzPSln_PvsHsXese8mE0DxrRLg1@thread.v2", + "topic": "test topic", "createdOn": "2021-09-07T21:45:14Z", "createdByCommunicationIdentifier": + {"rawId": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-88b6-5505-4548220010f4", + "communicationUser": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-88b6-5505-4548220010f4"}}}}' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: application/json; charset=utf-8 - date: Tue, 22 Jun 2021 20:54:41 GMT - ms-cv: oKqWEz+oOkOp8R/UzkPrXQ.0 + date: Tue, 07 Sep 2021 21:45:14 GMT + ms-cv: 0Pfa+qKWU0SU24GwJbKEnA.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked x-cache: CONFIG_NOCACHE - x-processing-time: 697ms + x-processing-time: 352ms status: code: 201 message: Created - url: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 - request: body: '{"content": "hello world", "senderDisplayName": "sender name", "type": "text"}' @@ -224,25 +228,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: POST - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2021-09-07 response: body: '{"id": "sanitized"}' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: application/json; charset=utf-8 - date: Tue, 22 Jun 2021 20:54:41 GMT - ms-cv: RlHGvShOCUS3lAk7MtmZWA.0 + date: Tue, 07 Sep 2021 21:45:14 GMT + ms-cv: ALnnYLlSB0a7wpZamsFpGw.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked x-cache: CONFIG_NOCACHE - x-processing-time: 250ms + x-processing-time: 153ms status: code: 201 message: Created - url: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2021-09-07 - request: body: '{"chatMessageId": "sanitized"}' headers: @@ -253,49 +257,49 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: POST - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/readReceipts?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/readReceipts?api-version=2021-09-07 response: body: string: '' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-length: '0' - date: Tue, 22 Jun 2021 20:54:42 GMT - ms-cv: GsHLUVJxsU2h/j2Aj/qbcg.0 + date: Tue, 07 Sep 2021 21:45:14 GMT + ms-cv: 5RiVmAbD4UuPvop4WLJ+ew.0 strict-transport-security: max-age=2592000 x-cache: CONFIG_NOCACHE - x-processing-time: 241ms + x-processing-time: 171ms status: code: 200 message: OK - url: https://sanitized.communication.azure.com/chat/threads/sanitized/readReceipts?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads/sanitized/readReceipts?api-version=2021-09-07 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 response: body: string: '' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 - date: Tue, 22 Jun 2021 20:54:42 GMT - ms-cv: IjQ1s1MxpUWcw/T7RwqvNA.0 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 + date: Tue, 07 Sep 2021 21:45:15 GMT + ms-cv: pb7AE4km/EOb1I3kde6wTw.0 strict-transport-security: max-age=2592000 x-cache: CONFIG_NOCACHE - x-processing-time: 299ms + x-processing-time: 114ms status: code: 204 message: No Content - url: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 - request: body: null headers: @@ -308,9 +312,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:43 GMT + - Tue, 07 Sep 2021 21:45:15 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -320,11 +324,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:54:44 GMT + - Tue, 07 Sep 2021 21:45:16 GMT ms-cv: - - bFwZIKESmEi2kvlmluxhog.0 + - R9eBIXzmQkCBKj/6MgylTw.0 request-context: - appId= strict-transport-security: @@ -332,7 +337,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 822ms + - 255ms status: code: 204 message: No Content @@ -348,9 +353,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:45 GMT + - Tue, 07 Sep 2021 21:45:16 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -360,11 +365,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:54:45 GMT + - Tue, 07 Sep 2021 21:45:16 GMT ms-cv: - - EkWWHVPidk6GBzuv40xZtQ.0 + - Tz+F4wUgB0OGnHW4pb5jvg.0 request-context: - appId= strict-transport-security: @@ -372,7 +378,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 550ms + - 244ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_send_typing_notification.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_send_typing_notification.yaml index c956210778c8..a5f254d517ed 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_send_typing_notification.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_send_typing_notification.yaml @@ -13,24 +13,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:45 GMT + - Tue, 07 Sep 2021 21:45:16 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d562-abef-b8ba-a43a0d002d22"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-9480-7a77-254822004d7f"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:54:46 GMT + - Tue, 07 Sep 2021 21:45:16 GMT ms-cv: - - uNPycoiaHkSeEWdwYPGPHg.0 + - S7E2g5RDtkiYu5ihUc6cPw.0 request-context: - appId= strict-transport-security: @@ -40,7 +41,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 93ms + - 89ms status: code: 201 message: Created @@ -58,24 +59,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:46 GMT + - Tue, 07 Sep 2021 21:45:16 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:54:45.8106545+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:45:17.0062197+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:54:46 GMT + - Tue, 07 Sep 2021 21:45:16 GMT ms-cv: - - 2dxUqyMv0UyngcN5b3tnTw.0 + - Pkj03EQ7EkCnGnRH8p9zWw.0 request-context: - appId= strict-transport-security: @@ -85,7 +87,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 139ms + - 158ms status: code: 200 message: OK @@ -103,24 +105,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:46 GMT + - Tue, 07 Sep 2021 21:45:17 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d562-ada2-b8ba-a43a0d002d23"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-9646-7a77-254822004d80"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:54:46 GMT + - Tue, 07 Sep 2021 21:45:16 GMT ms-cv: - - FcZnCnf6rkGbxOWEuXKUfg.0 + - qNIskik+SUyJ8llsmIYScA.0 request-context: - appId= strict-transport-security: @@ -130,7 +133,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 87ms + - 90ms status: code: 201 message: Created @@ -148,24 +151,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:47 GMT + - Tue, 07 Sep 2021 21:45:17 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:54:46.2564276+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:45:17.4578215+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:54:46 GMT + - Tue, 07 Sep 2021 21:45:17 GMT ms-cv: - - yBJPkAejjkOgDtogXYfvwQ.0 + - jZswVc1aw0qUTqyUrZ4peA.0 request-context: - appId= strict-transport-security: @@ -175,7 +179,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 168ms + - 154ms status: code: 200 message: OK @@ -189,79 +193,82 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) repeatability-request-id: - - 28e6d964-77bd-42cd-a8e5-107268111a92 + - a299c8cd-dc84-4961-8727-be8dab9b7e15 method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 response: - body: '{"chatThread": {"id": "19:-Vtmg8MynfXaSL4-snZhqIM_F349EJKadyT2kmivCiQ1@thread.v2", - "topic": "test topic", "createdOn": "2021-06-22T20:54:47Z", "createdByCommunicationIdentifier": - {"rawId": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d562-abef-b8ba-a43a0d002d22", - "communicationUser": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d562-abef-b8ba-a43a0d002d22"}}}}' + body: '{"chatThread": {"id": "19:N4gOJcdXrWreeCiGDNdYUj8Xx9S6TW0FEJlv9_7IUtI1@thread.v2", + "topic": "test topic", "createdOn": "2021-09-07T21:45:17Z", "createdByCommunicationIdentifier": + {"rawId": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-9480-7a77-254822004d7f", + "communicationUser": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-9480-7a77-254822004d7f"}}}}' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: application/json; charset=utf-8 - date: Tue, 22 Jun 2021 20:54:47 GMT - ms-cv: kf0yrBRoL0a2Km5uJ/5ksw.0 + date: Tue, 07 Sep 2021 21:45:18 GMT + ms-cv: /lk4wawQ3U25RTLMPTi+CA.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked x-cache: CONFIG_NOCACHE - x-processing-time: 736ms + x-processing-time: 603ms status: code: 201 message: Created - url: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 - request: - body: null + body: '{}' headers: Accept: - application/json + Content-Length: + - '2' + Content-Type: + - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: POST - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/typing?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/typing?api-version=2021-09-07 response: body: string: '' headers: - api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 + api-supported-versions: 2021-04-05-preview6, 2021-09-07 content-length: '0' - date: Tue, 22 Jun 2021 20:54:47 GMT - ms-cv: UU5D+Mzz/EaLBOQo4tn+wA.0 + date: Tue, 07 Sep 2021 21:45:17 GMT + ms-cv: sWT31CJXEEyAy/oT/0Fujw.0 strict-transport-security: max-age=2592000 x-cache: CONFIG_NOCACHE - x-processing-time: 258ms + x-processing-time: 212ms status: code: 200 message: OK - url: https://sanitized.communication.azure.com/chat/threads/sanitized/typing?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads/sanitized/typing?api-version=2021-09-07 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 response: body: string: '' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 - date: Tue, 22 Jun 2021 20:54:48 GMT - ms-cv: Du6a5WU5+UiJIeDc8DDVzQ.0 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 + date: Tue, 07 Sep 2021 21:45:18 GMT + ms-cv: XZiCn6ALVEuDeMTliC6poA.0 strict-transport-security: max-age=2592000 x-cache: CONFIG_NOCACHE - x-processing-time: 238ms + x-processing-time: 182ms status: code: 204 message: No Content - url: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 - request: body: null headers: @@ -274,9 +281,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:48 GMT + - Tue, 07 Sep 2021 21:45:18 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -286,11 +293,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:54:49 GMT + - Tue, 07 Sep 2021 21:45:19 GMT ms-cv: - - /azBFW05bEGPuwTM4DeEVg.0 + - 205lGbjKSkOYvMLCmIlCog.0 request-context: - appId= strict-transport-security: @@ -298,7 +306,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 776ms + - 513ms status: code: 204 message: No Content @@ -314,9 +322,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:49 GMT + - Tue, 07 Sep 2021 21:45:19 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -326,11 +334,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:54:49 GMT + - Tue, 07 Sep 2021 21:45:19 GMT ms-cv: - - JjPmNNWASkCXMRnH9U6JoQ.0 + - mkw1tlQK7EW8cE7eDXidMQ.0 request-context: - appId= strict-transport-security: @@ -338,7 +347,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 640ms + - 428ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_send_typing_notification_with_sender_display_name.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_send_typing_notification_with_sender_display_name.yaml new file mode 100644 index 000000000000..1071da26ec95 --- /dev/null +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_send_typing_notification_with_sender_display_name.yaml @@ -0,0 +1,354 @@ +interactions: +- request: + body: '{}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '2' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) + x-ms-date: + - Tue, 07 Sep 2021 21:45:19 GMT + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 + response: + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-a1b0-89df-44482200127f"}}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview + content-type: + - application/json; charset=utf-8 + date: + - Tue, 07 Sep 2021 21:45:19 GMT + ms-cv: + - 8socINns5ke86wYHo68YLQ.0 + request-context: + - appId= + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-cache: + - CONFIG_NOCACHE + x-processing-time: + - 62ms + status: + code: 201 + message: Created +- request: + body: '{"scopes": ["chat"]}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '20' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) + x-ms-date: + - Tue, 07 Sep 2021 21:45:20 GMT + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 + response: + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:45:20.3297629+00:00"}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview + content-type: + - application/json; charset=utf-8 + date: + - Tue, 07 Sep 2021 21:45:19 GMT + ms-cv: + - 1CvCoBM0T0W+g/wv0oOM1Q.0 + request-context: + - appId= + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-cache: + - CONFIG_NOCACHE + x-processing-time: + - 166ms + status: + code: 200 + message: OK +- request: + body: '{}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '2' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) + x-ms-date: + - Tue, 07 Sep 2021 21:45:20 GMT + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 + response: + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-a396-89df-444822001280"}}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview + content-type: + - application/json; charset=utf-8 + date: + - Tue, 07 Sep 2021 21:45:20 GMT + ms-cv: + - dce6WiqL5kOfoEWtngtWRg.0 + request-context: + - appId= + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-cache: + - CONFIG_NOCACHE + x-processing-time: + - 62ms + status: + code: 201 + message: Created +- request: + body: '{"scopes": ["chat"]}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '20' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) + x-ms-date: + - Tue, 07 Sep 2021 21:45:20 GMT + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 + response: + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:45:21.0002474+00:00"}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview + content-type: + - application/json; charset=utf-8 + date: + - Tue, 07 Sep 2021 21:45:20 GMT + ms-cv: + - N3Tu5pVSnU+vVpUskASRNA.0 + request-context: + - appId= + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-cache: + - CONFIG_NOCACHE + x-processing-time: + - 233ms + status: + code: 200 + message: OK +- request: + body: '{"topic": "test topic", "participants": "sanitized"}' + headers: + Accept: + - application/json + Content-Length: + - '350' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) + repeatability-request-id: + - 4298d670-914d-47cc-9bd6-b48c106ea1b0 + method: POST + uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 + response: + body: '{"chatThread": {"id": "19:mFD9pm0lVzCUe78x39CuXX2y6P72CmX2kT8rYSU8PRQ1@thread.v2", + "topic": "test topic", "createdOn": "2021-09-07T21:45:21Z", "createdByCommunicationIdentifier": + {"rawId": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-a1b0-89df-44482200127f", + "communicationUser": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-a1b0-89df-44482200127f"}}}}' + headers: + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 + content-type: application/json; charset=utf-8 + date: Tue, 07 Sep 2021 21:45:21 GMT + ms-cv: 0SEsRr8IDEqJ753I2s/Llg.0 + strict-transport-security: max-age=2592000 + transfer-encoding: chunked + x-cache: CONFIG_NOCACHE + x-processing-time: 579ms + status: + code: 201 + message: Created + url: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 +- request: + body: '{"senderDisplayName": "John"}' + headers: + Accept: + - application/json + Content-Length: + - '29' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) + method: POST + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/typing?api-version=2021-09-07 + response: + body: + string: '' + headers: + api-supported-versions: 2021-04-05-preview6, 2021-09-07 + content-length: '0' + date: Tue, 07 Sep 2021 21:45:21 GMT + ms-cv: BPxHPBzzZ0yNHYIt43Bl2w.0 + strict-transport-security: max-age=2592000 + x-cache: CONFIG_NOCACHE + x-processing-time: 396ms + status: + code: 200 + message: OK + url: https://sanitized.communication.azure.com/chat/threads/sanitized/typing?api-version=2021-09-07 +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) + method: DELETE + uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 + response: + body: + string: '' + headers: + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 + date: Tue, 07 Sep 2021 21:45:22 GMT + ms-cv: xsMNf2On2kGdEB70WOF9rg.0 + strict-transport-security: max-age=2592000 + x-cache: CONFIG_NOCACHE + x-processing-time: 193ms + status: + code: 204 + message: No Content + url: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) + x-ms-date: + - Tue, 07 Sep 2021 21:45:22 GMT + x-ms-return-client-request-id: + - 'true' + method: DELETE + uri: https://sanitized.communication.azure.com/identities/sanitized?api-version=2021-03-07 + response: + body: + string: '' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview + date: + - Tue, 07 Sep 2021 21:45:22 GMT + ms-cv: + - wUcOvrnQE0av9N4aUILngg.0 + request-context: + - appId= + strict-transport-security: + - max-age=2592000 + x-cache: + - CONFIG_NOCACHE + x-processing-time: + - 262ms + status: + code: 204 + message: No Content +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) + x-ms-date: + - Tue, 07 Sep 2021 21:45:22 GMT + x-ms-return-client-request-id: + - 'true' + method: DELETE + uri: https://sanitized.communication.azure.com/identities/sanitized?api-version=2021-03-07 + response: + body: + string: '' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview + date: + - Tue, 07 Sep 2021 21:45:22 GMT + ms-cv: + - H1u0DY+3UkySJijS536fOg.0 + request-context: + - appId= + strict-transport-security: + - max-age=2592000 + x-cache: + - CONFIG_NOCACHE + x-processing-time: + - 244ms + status: + code: 204 + message: No Content +version: 1 diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_update_message.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_update_message.yaml index ff67dc4c7751..39df945ed6ea 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_update_message.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_update_message.yaml @@ -13,24 +13,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:50 GMT + - Tue, 07 Sep 2021 21:45:23 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d562-be09-51b9-a43a0d009445"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-aed6-e6f5-343a0d0019b2"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:54:50 GMT + - Tue, 07 Sep 2021 21:45:22 GMT ms-cv: - - /Ub5zZaghkaLwcdZOFVNrQ.0 + - ScBjZZ7wVkS+87kXviZdIw.0 request-context: - appId= strict-transport-security: @@ -40,7 +41,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 70ms + - 51ms status: code: 201 message: Created @@ -58,24 +59,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:51 GMT + - Tue, 07 Sep 2021 21:45:23 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:54:50.484132+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:45:23.5327257+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:54:50 GMT + - Tue, 07 Sep 2021 21:45:23 GMT ms-cv: - - iv3zmQ6ekUOcE3i6Sovp4Q.0 + - sS0aVxMj/UGWPB58EWPcdg.0 request-context: - appId= strict-transport-security: @@ -85,7 +87,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 171ms + - 60ms status: code: 200 message: OK @@ -103,24 +105,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:51 GMT + - Tue, 07 Sep 2021 21:45:23 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d562-c010-51b9-a43a0d009446"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-afea-e6f5-343a0d0019b3"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:54:50 GMT + - Tue, 07 Sep 2021 21:45:23 GMT ms-cv: - - NEhQUCZwjU2XlFeTkB632Q.0 + - fWk/noSuWk+IhXsClf7K1Q.0 request-context: - appId= strict-transport-security: @@ -130,7 +133,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 96ms + - 36ms status: code: 201 message: Created @@ -148,24 +151,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:51 GMT + - Tue, 07 Sep 2021 21:45:23 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:54:51.03718+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:45:23.7889531+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:54:52 GMT + - Tue, 07 Sep 2021 21:45:23 GMT ms-cv: - - uQGkYyW2NEOewW448sR/rQ.0 + - bTxgS6c4F0qFMj/b+pRspA.0 request-context: - appId= strict-transport-security: @@ -175,7 +179,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 147ms + - 33ms status: code: 200 message: OK @@ -189,30 +193,30 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) repeatability-request-id: - - 7cadd68e-5e6f-4a33-8862-fc8769ece727 + - 90499003-61cd-4a66-8b78-41037f133ff8 method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 response: - body: '{"chatThread": {"id": "19:h5Qj9fgSx2isMThWhsaE5_Jll8G0a163GcIoNmmFnIg1@thread.v2", - "topic": "test topic", "createdOn": "2021-06-22T20:54:52Z", "createdByCommunicationIdentifier": - {"rawId": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d562-be09-51b9-a43a0d009445", - "communicationUser": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d562-be09-51b9-a43a0d009445"}}}}' + body: '{"chatThread": {"id": "19:sOUsXcLHWLR7BuNls0eNI-2_VVbuwo38JfROmHiL_dQ1@thread.v2", + "topic": "test topic", "createdOn": "2021-09-07T21:45:23Z", "createdByCommunicationIdentifier": + {"rawId": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-aed6-e6f5-343a0d0019b2", + "communicationUser": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-aed6-e6f5-343a0d0019b2"}}}}' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: application/json; charset=utf-8 - date: Tue, 22 Jun 2021 20:54:52 GMT - ms-cv: c9gEYpnO8k+cpKoGdwsW+w.0 + date: Tue, 07 Sep 2021 21:45:23 GMT + ms-cv: OlamVAN330ic9SzS2L7UuQ.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked x-cache: CONFIG_NOCACHE - x-processing-time: 431ms + x-processing-time: 537ms status: code: 201 message: Created - url: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 - request: body: '{"content": "hello world", "senderDisplayName": "sender name", "type": "text"}' @@ -224,25 +228,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: POST - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2021-09-07 response: body: '{"id": "sanitized"}' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: application/json; charset=utf-8 - date: Tue, 22 Jun 2021 20:54:53 GMT - ms-cv: QWI0euuxD0i0svu061fdXw.0 + date: Tue, 07 Sep 2021 21:45:24 GMT + ms-cv: wlPmI/BbVESqbO3rDhvDQg.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked x-cache: CONFIG_NOCACHE - x-processing-time: 185ms + x-processing-time: 222ms status: code: 201 message: Created - url: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2021-09-07 - request: body: '{"content": "updated message content"}' headers: @@ -253,48 +257,48 @@ interactions: Content-Type: - application/merge-patch+json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: PATCH - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages/sanitized?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages/sanitized?api-version=2021-09-07 response: body: string: '' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 - date: Tue, 22 Jun 2021 20:54:53 GMT - ms-cv: Fcb4SdBa7EiwyKgPMltfWQ.0 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 + date: Tue, 07 Sep 2021 21:45:25 GMT + ms-cv: Wrrw0lnIbUym0XUdBEIhfA.0 strict-transport-security: max-age=2592000 x-cache: CONFIG_NOCACHE - x-processing-time: 245ms + x-processing-time: 271ms status: code: 204 message: No Content - url: https://sanitized.communication.azure.com/chat/threads/sanitized/messages/sanitized?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads/sanitized/messages/sanitized?api-version=2021-09-07 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 response: body: string: '' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 - date: Tue, 22 Jun 2021 20:54:53 GMT - ms-cv: AeZmKWdjskK4lhb+mpHV8A.0 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 + date: Tue, 07 Sep 2021 21:45:24 GMT + ms-cv: fJxPKTazF0qyzaZBrHMCYQ.0 strict-transport-security: max-age=2592000 x-cache: CONFIG_NOCACHE - x-processing-time: 179ms + x-processing-time: 250ms status: code: 204 message: No Content - url: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 - request: body: null headers: @@ -307,9 +311,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:54 GMT + - Tue, 07 Sep 2021 21:45:25 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -319,11 +323,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:54:54 GMT + - Tue, 07 Sep 2021 21:45:25 GMT ms-cv: - - Sf5Or/RWBEGpB2hKq0oo5w.0 + - CsEvbPEteEq1Sln3hrgteg.0 request-context: - appId= strict-transport-security: @@ -331,7 +336,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 588ms + - 814ms status: code: 204 message: No Content @@ -347,9 +352,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:54 GMT + - Tue, 07 Sep 2021 21:45:26 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -359,11 +364,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:54:55 GMT + - Tue, 07 Sep 2021 21:45:26 GMT ms-cv: - - w92WNoXjZEeYpHIgqWMXfw.0 + - gOFeG8vLBk6juo/C4J9t1g.0 request-context: - appId= strict-transport-security: @@ -371,7 +377,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 708ms + - 434ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_update_topic.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_update_topic.yaml index 7dcd8b626c8e..63205494db9f 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_update_topic.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_update_topic.yaml @@ -13,24 +13,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:55 GMT + - Tue, 07 Sep 2021 21:45:26 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d562-d5cb-570c-113a0d00178f"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-bc72-b271-254822001112"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:54:57 GMT + - Tue, 07 Sep 2021 21:45:26 GMT ms-cv: - - d7cDl24Vn0iuYgLfRNVBoA.0 + - xkiw1wBHAU6EiLqjM40q2Q.0 request-context: - appId= strict-transport-security: @@ -40,7 +41,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 83ms + - 87ms status: code: 201 message: Created @@ -58,24 +59,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:57 GMT + - Tue, 07 Sep 2021 21:45:27 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:54:56.6651919+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:45:27.2236807+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:54:57 GMT + - Tue, 07 Sep 2021 21:45:26 GMT ms-cv: - - TF1wdnaLl0imD9GGQ0rsKw.0 + - B1vx+93pZk28SKmVdagJVg.0 request-context: - appId= strict-transport-security: @@ -85,7 +87,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 162ms + - 154ms status: code: 200 message: OK @@ -103,24 +105,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:57 GMT + - Tue, 07 Sep 2021 21:45:27 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities?api-version=2021-03-07 response: - body: '{"identity": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d562-d8d4-570c-113a0d001791"}}' + body: '{"identity": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-be32-b271-254822001113"}}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:54:57 GMT + - Tue, 07 Sep 2021 21:45:26 GMT ms-cv: - - VAWDijDsqU+M2PbTCZ6gFw.0 + - pJl0c4hTlEOdzw6qni3++Q.0 request-context: - appId= strict-transport-security: @@ -148,24 +151,25 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:54:58 GMT + - Tue, 07 Sep 2021 21:45:27 GMT x-ms-return-client-request-id: - 'true' method: POST uri: https://sanitized.communication.azure.com/identities/sanitized/:issueAccessToken?api-version=2021-03-07 response: - body: '{"token": "sanitized", "expiresOn": "2021-06-23T20:54:57.7524043+00:00"}' + body: '{"token": "sanitized", "expiresOn": "2021-09-08T21:45:27.7610074+00:00"}' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview content-type: - application/json; charset=utf-8 date: - - Tue, 22 Jun 2021 20:54:58 GMT + - Tue, 07 Sep 2021 21:45:27 GMT ms-cv: - - 2/nGLYVsdEWTBNEVFvw8wg.0 + - j8p//39/UUqVHIg61ZvTdQ.0 request-context: - appId= strict-transport-security: @@ -175,7 +179,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 217ms + - 239ms status: code: 200 message: OK @@ -189,30 +193,30 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) repeatability-request-id: - - 1e455e28-a94f-4cd1-ae4b-30f60276ec0a + - 61f794d6-b80c-4bca-8d6b-7a4e786856da method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 response: - body: '{"chatThread": {"id": "19:CaKyZFIDA9YYOhv2UkyImFQ5A0NJI133NHLUGcD7ypE1@thread.v2", - "topic": "test topic", "createdOn": "2021-06-22T20:54:59Z", "createdByCommunicationIdentifier": - {"rawId": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d562-d5cb-570c-113a0d00178f", - "communicationUser": {"id": "8:acs:ac80d96a-85de-48b1-995d-a3a3fa3627c8_0000000a-d562-d5cb-570c-113a0d00178f"}}}}' + body: '{"chatThread": {"id": "19:clOhFYEo_r-HtrRKIlggxVS6TZbOsEQBZidWPeruvos1@thread.v2", + "topic": "test topic", "createdOn": "2021-09-07T21:45:28Z", "createdByCommunicationIdentifier": + {"rawId": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-bc72-b271-254822001112", + "communicationUser": {"id": "8:acs:fa5c4fc3-a269-43e2-9eb6-0ca17b388993_0000000c-621a-bc72-b271-254822001112"}}}}' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 content-type: application/json; charset=utf-8 - date: Tue, 22 Jun 2021 20:54:59 GMT - ms-cv: 10CBOcI3Sk+cD7apl2KD4w.0 + date: Tue, 07 Sep 2021 21:45:28 GMT + ms-cv: K33ot+D28UaUyQVMfO3+lg.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked x-cache: CONFIG_NOCACHE - x-processing-time: 453ms + x-processing-time: 859ms status: code: 201 message: Created - url: https://sanitized.communication.azure.com/chat/threads?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads?api-version=2021-09-07 - request: body: '{"topic": "update topic"}' headers: @@ -223,48 +227,48 @@ interactions: Content-Type: - application/merge-patch+json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: PATCH - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 response: body: string: '' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 - date: Tue, 22 Jun 2021 20:55:01 GMT - ms-cv: b7xy7EWFgE6lTlT3Ek1vag.0 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 + date: Tue, 07 Sep 2021 21:45:28 GMT + ms-cv: glEUVcWE7kifpYUcSGCd5A.0 strict-transport-security: max-age=2592000 x-cache: CONFIG_NOCACHE - x-processing-time: 275ms + x-processing-time: 298ms status: code: 204 message: No Content - url: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.1.0b1 Python/3.9.5 (Windows-10-10.0.19043-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 response: body: string: '' headers: api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4, - 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6 - date: Tue, 22 Jun 2021 20:55:01 GMT - ms-cv: 9nW1AUfRAUCQqESp3XiTbA.0 + 2021-03-01-preview5, 2021-03-07, 2021-04-05-preview6, 2021-09-07 + date: Tue, 07 Sep 2021 21:45:28 GMT + ms-cv: De3Nk+S+8ku/GfOUkz38jA.0 strict-transport-security: max-age=2592000 x-cache: CONFIG_NOCACHE - x-processing-time: 244ms + x-processing-time: 199ms status: code: 204 message: No Content - url: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2021-09-07 - request: body: null headers: @@ -277,9 +281,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:55:02 GMT + - Tue, 07 Sep 2021 21:45:29 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -289,11 +293,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:55:03 GMT + - Tue, 07 Sep 2021 21:45:29 GMT ms-cv: - - UISdDH9xH0mSFJcmdo8nbw.0 + - kp8UzPKJi0Sx9SI27G5viw.0 request-context: - appId= strict-transport-security: @@ -301,7 +306,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 1046ms + - 518ms status: code: 204 message: No Content @@ -317,9 +322,9 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-identity/1.0.1 Python/3.8.6rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.1 Python/3.9.5 (Windows-10-10.0.19043-SP0) x-ms-date: - - Tue, 22 Jun 2021 20:55:03 GMT + - Tue, 07 Sep 2021 21:45:30 GMT x-ms-return-client-request-id: - 'true' method: DELETE @@ -329,11 +334,12 @@ interactions: string: '' headers: api-supported-versions: - - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1 + - 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1, + 2021-10-31-preview date: - - Tue, 22 Jun 2021 20:55:04 GMT + - Tue, 07 Sep 2021 21:45:29 GMT ms-cv: - - QqT2UWjvQE655NpiLEzjEg.0 + - cIqybrhW8EeIGrsTTr05Dg.0 request-context: - appId= strict-transport-security: @@ -341,7 +347,7 @@ interactions: x-cache: - CONFIG_NOCACHE x-processing-time: - - 861ms + - 400ms status: code: 204 message: No Content From cd459a75da31a484bfdaf5d6c0ad972e4f5a8bad Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Thu, 9 Sep 2021 17:21:31 -0700 Subject: [PATCH 34/85] Increment version for keyvault releases (#20638) Increment package version after release of azure-keyvault-administration --- .../azure-keyvault-administration/CHANGELOG.md | 10 ++++++++++ .../azure/keyvault/administration/_version.py | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/sdk/keyvault/azure-keyvault-administration/CHANGELOG.md b/sdk/keyvault/azure-keyvault-administration/CHANGELOG.md index 0ff44de895ac..5bbecd93b402 100644 --- a/sdk/keyvault/azure-keyvault-administration/CHANGELOG.md +++ b/sdk/keyvault/azure-keyvault-administration/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 4.1.0b2 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 4.1.0b1 (2021-09-09) ### Features Added diff --git a/sdk/keyvault/azure-keyvault-administration/azure/keyvault/administration/_version.py b/sdk/keyvault/azure-keyvault-administration/azure/keyvault/administration/_version.py index 25a24cab1be5..e63ceb9d4426 100644 --- a/sdk/keyvault/azure-keyvault-administration/azure/keyvault/administration/_version.py +++ b/sdk/keyvault/azure-keyvault-administration/azure/keyvault/administration/_version.py @@ -3,4 +3,4 @@ # Licensed under the MIT License. # ------------------------------------ -VERSION = "4.1.0b1" +VERSION = "4.1.0b2" From 6a9cb862d21bf704023a9692e3915fe9a8dda7b3 Mon Sep 17 00:00:00 2001 From: Xiang Yan Date: Thu, 9 Sep 2021 18:30:08 -0700 Subject: [PATCH 35/85] Update to latest swagger (#20642) --- .../azure/ai/metricsadvisor/_generated/__init__.py | 4 ++-- .../ai/metricsadvisor/_generated/_configuration.py | 6 +++--- ...isor_restapi_open_ap_iv2.py => _metrics_advisor.py} | 10 +++++----- .../azure/ai/metricsadvisor/_generated/aio/__init__.py | 4 ++-- .../ai/metricsadvisor/_generated/aio/_configuration.py | 6 +++--- ...isor_restapi_open_ap_iv2.py => _metrics_advisor.py} | 10 +++++----- .../_generated/aio/operations/__init__.py | 4 ++-- ...v2_operations.py => _metrics_advisor_operations.py} | 2 +- .../ai/metricsadvisor/_generated/models/__init__.py | 2 +- ..._open_ap_iv2_enums.py => _metrics_advisor_enums.py} | 0 .../ai/metricsadvisor/_generated/models/_models_py3.py | 2 +- .../metricsadvisor/_generated/operations/__init__.py | 4 ++-- ...v2_operations.py => _metrics_advisor_operations.py} | 2 +- .../_metrics_advisor_administration_client.py | 4 +--- .../azure/ai/metricsadvisor/_metrics_advisor_client.py | 2 +- .../_metrics_advisor_administration_client_async.py | 2 +- .../aio/_metrics_advisor_client_async.py | 4 +--- .../azure/ai/metricsadvisor/models/__init__.py | 2 +- 18 files changed, 33 insertions(+), 37 deletions(-) rename sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/{_microsoft_azure_metrics_advisor_restapi_open_ap_iv2.py => _metrics_advisor.py} (87%) rename sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/aio/{_microsoft_azure_metrics_advisor_restapi_open_ap_iv2.py => _metrics_advisor.py} (86%) rename sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/aio/operations/{_microsoft_azure_metrics_advisor_restapi_open_ap_iv2_operations.py => _metrics_advisor_operations.py} (99%) rename sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/models/{_microsoft_azure_metrics_advisor_restapi_open_ap_iv2_enums.py => _metrics_advisor_enums.py} (100%) rename sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/operations/{_microsoft_azure_metrics_advisor_restapi_open_ap_iv2_operations.py => _metrics_advisor_operations.py} (99%) diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/__init__.py b/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/__init__.py index 9ba14ee8d728..67546426ab3d 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/__init__.py +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/__init__.py @@ -6,8 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._microsoft_azure_metrics_advisor_restapi_open_ap_iv2 import MicrosoftAzureMetricsAdvisorRESTAPIOpenAPIV2 -__all__ = ['MicrosoftAzureMetricsAdvisorRESTAPIOpenAPIV2'] +from ._metrics_advisor import MetricsAdvisor +__all__ = ['MetricsAdvisor'] try: from ._patch import patch_sdk # type: ignore diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/_configuration.py b/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/_configuration.py index 482bc4973fe9..4ab4b4596b3e 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/_configuration.py +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/_configuration.py @@ -19,8 +19,8 @@ VERSION = "unknown" -class MicrosoftAzureMetricsAdvisorRESTAPIOpenAPIV2Configuration(Configuration): - """Configuration for MicrosoftAzureMetricsAdvisorRESTAPIOpenAPIV2. +class MetricsAdvisorConfiguration(Configuration): + """Configuration for MetricsAdvisor. Note that all parameters used to create this instance are saved as instance attributes. @@ -42,7 +42,7 @@ def __init__( raise ValueError("Parameter 'credential' must not be None.") if endpoint is None: raise ValueError("Parameter 'endpoint' must not be None.") - super(MicrosoftAzureMetricsAdvisorRESTAPIOpenAPIV2Configuration, self).__init__(**kwargs) + super(MetricsAdvisorConfiguration, self).__init__(**kwargs) self.credential = credential self.endpoint = endpoint diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/_microsoft_azure_metrics_advisor_restapi_open_ap_iv2.py b/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/_metrics_advisor.py similarity index 87% rename from sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/_microsoft_azure_metrics_advisor_restapi_open_ap_iv2.py rename to sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/_metrics_advisor.py index 564113cfdead..fb7543c69aee 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/_microsoft_azure_metrics_advisor_restapi_open_ap_iv2.py +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/_metrics_advisor.py @@ -18,12 +18,12 @@ from azure.core.credentials import TokenCredential from azure.core.pipeline.transport import HttpRequest, HttpResponse -from ._configuration import MicrosoftAzureMetricsAdvisorRESTAPIOpenAPIV2Configuration -from .operations import MicrosoftAzureMetricsAdvisorRESTAPIOpenAPIV2OperationsMixin +from ._configuration import MetricsAdvisorConfiguration +from .operations import MetricsAdvisorOperationsMixin from . import models -class MicrosoftAzureMetricsAdvisorRESTAPIOpenAPIV2(MicrosoftAzureMetricsAdvisorRESTAPIOpenAPIV2OperationsMixin): +class MetricsAdvisor(MetricsAdvisorOperationsMixin): """Microsoft Azure Metrics Advisor REST API (OpenAPI v2). :param credential: Credential needed for the client to connect to Azure. @@ -40,7 +40,7 @@ def __init__( ): # type: (...) -> None base_url = '{endpoint}/metricsadvisor/v1.0' - self._config = MicrosoftAzureMetricsAdvisorRESTAPIOpenAPIV2Configuration(credential, endpoint, **kwargs) + self._config = MetricsAdvisorConfiguration(credential, endpoint, **kwargs) self._client = PipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} @@ -72,7 +72,7 @@ def close(self): self._client.close() def __enter__(self): - # type: () -> MicrosoftAzureMetricsAdvisorRESTAPIOpenAPIV2 + # type: () -> MetricsAdvisor self._client.__enter__() return self diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/aio/__init__.py b/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/aio/__init__.py index 5110d588a403..e72d372fbd25 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/aio/__init__.py +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/aio/__init__.py @@ -6,5 +6,5 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._microsoft_azure_metrics_advisor_restapi_open_ap_iv2 import MicrosoftAzureMetricsAdvisorRESTAPIOpenAPIV2 -__all__ = ['MicrosoftAzureMetricsAdvisorRESTAPIOpenAPIV2'] +from ._metrics_advisor import MetricsAdvisor +__all__ = ['MetricsAdvisor'] diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/aio/_configuration.py b/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/aio/_configuration.py index f3d8f5c3fe54..de14ef321746 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/aio/_configuration.py +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/aio/_configuration.py @@ -17,8 +17,8 @@ VERSION = "unknown" -class MicrosoftAzureMetricsAdvisorRESTAPIOpenAPIV2Configuration(Configuration): - """Configuration for MicrosoftAzureMetricsAdvisorRESTAPIOpenAPIV2. +class MetricsAdvisorConfiguration(Configuration): + """Configuration for MetricsAdvisor. Note that all parameters used to create this instance are saved as instance attributes. @@ -39,7 +39,7 @@ def __init__( raise ValueError("Parameter 'credential' must not be None.") if endpoint is None: raise ValueError("Parameter 'endpoint' must not be None.") - super(MicrosoftAzureMetricsAdvisorRESTAPIOpenAPIV2Configuration, self).__init__(**kwargs) + super(MetricsAdvisorConfiguration, self).__init__(**kwargs) self.credential = credential self.endpoint = endpoint diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/aio/_microsoft_azure_metrics_advisor_restapi_open_ap_iv2.py b/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/aio/_metrics_advisor.py similarity index 86% rename from sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/aio/_microsoft_azure_metrics_advisor_restapi_open_ap_iv2.py rename to sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/aio/_metrics_advisor.py index 64c6f317b1f7..c11dca3e827c 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/aio/_microsoft_azure_metrics_advisor_restapi_open_ap_iv2.py +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/aio/_metrics_advisor.py @@ -16,12 +16,12 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration import MicrosoftAzureMetricsAdvisorRESTAPIOpenAPIV2Configuration -from .operations import MicrosoftAzureMetricsAdvisorRESTAPIOpenAPIV2OperationsMixin +from ._configuration import MetricsAdvisorConfiguration +from .operations import MetricsAdvisorOperationsMixin from .. import models -class MicrosoftAzureMetricsAdvisorRESTAPIOpenAPIV2(MicrosoftAzureMetricsAdvisorRESTAPIOpenAPIV2OperationsMixin): +class MetricsAdvisor(MetricsAdvisorOperationsMixin): """Microsoft Azure Metrics Advisor REST API (OpenAPI v2). :param credential: Credential needed for the client to connect to Azure. @@ -37,7 +37,7 @@ def __init__( **kwargs: Any ) -> None: base_url = '{endpoint}/metricsadvisor/v1.0' - self._config = MicrosoftAzureMetricsAdvisorRESTAPIOpenAPIV2Configuration(credential, endpoint, **kwargs) + self._config = MetricsAdvisorConfiguration(credential, endpoint, **kwargs) self._client = AsyncPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} @@ -66,7 +66,7 @@ async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> Async async def close(self) -> None: await self._client.close() - async def __aenter__(self) -> "MicrosoftAzureMetricsAdvisorRESTAPIOpenAPIV2": + async def __aenter__(self) -> "MetricsAdvisor": await self._client.__aenter__() return self diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/aio/operations/__init__.py b/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/aio/operations/__init__.py index d301f3c2c9f8..7c5eb5aab483 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/aio/operations/__init__.py +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/aio/operations/__init__.py @@ -6,8 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._microsoft_azure_metrics_advisor_restapi_open_ap_iv2_operations import MicrosoftAzureMetricsAdvisorRESTAPIOpenAPIV2OperationsMixin +from ._metrics_advisor_operations import MetricsAdvisorOperationsMixin __all__ = [ - 'MicrosoftAzureMetricsAdvisorRESTAPIOpenAPIV2OperationsMixin', + 'MetricsAdvisorOperationsMixin', ] diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/aio/operations/_microsoft_azure_metrics_advisor_restapi_open_ap_iv2_operations.py b/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/aio/operations/_metrics_advisor_operations.py similarity index 99% rename from sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/aio/operations/_microsoft_azure_metrics_advisor_restapi_open_ap_iv2_operations.py rename to sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/aio/operations/_metrics_advisor_operations.py index 62c6c834d229..5c0aa1b0101f 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/aio/operations/_microsoft_azure_metrics_advisor_restapi_open_ap_iv2_operations.py +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/aio/operations/_metrics_advisor_operations.py @@ -18,7 +18,7 @@ T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] -class MicrosoftAzureMetricsAdvisorRESTAPIOpenAPIV2OperationsMixin: +class MetricsAdvisorOperationsMixin: async def get_active_series_count( self, diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/models/__init__.py b/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/models/__init__.py index 4f426ed14666..20230fbb7248 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/models/__init__.py +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/models/__init__.py @@ -323,7 +323,7 @@ from ._models import WholeMetricConfiguration # type: ignore from ._models import WholeMetricConfigurationPatch # type: ignore -from ._microsoft_azure_metrics_advisor_restapi_open_ap_iv2_enums import ( +from ._metrics_advisor_enums import ( AnomalyAlertingConfigurationLogicType, AnomalyDetectionConfigurationLogicType, AnomalyDetectorDirection, diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/models/_microsoft_azure_metrics_advisor_restapi_open_ap_iv2_enums.py b/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/models/_metrics_advisor_enums.py similarity index 100% rename from sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/models/_microsoft_azure_metrics_advisor_restapi_open_ap_iv2_enums.py rename to sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/models/_metrics_advisor_enums.py diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/models/_models_py3.py b/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/models/_models_py3.py index 621077cd6989..1be5f016122d 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/models/_models_py3.py +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/models/_models_py3.py @@ -12,7 +12,7 @@ from azure.core.exceptions import HttpResponseError import msrest.serialization -from ._microsoft_azure_metrics_advisor_restapi_open_ap_iv2_enums import * +from ._metrics_advisor_enums import * class AlertingResultQuery(msrest.serialization.Model): diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/operations/__init__.py b/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/operations/__init__.py index d301f3c2c9f8..7c5eb5aab483 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/operations/__init__.py +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/operations/__init__.py @@ -6,8 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._microsoft_azure_metrics_advisor_restapi_open_ap_iv2_operations import MicrosoftAzureMetricsAdvisorRESTAPIOpenAPIV2OperationsMixin +from ._metrics_advisor_operations import MetricsAdvisorOperationsMixin __all__ = [ - 'MicrosoftAzureMetricsAdvisorRESTAPIOpenAPIV2OperationsMixin', + 'MetricsAdvisorOperationsMixin', ] diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/operations/_microsoft_azure_metrics_advisor_restapi_open_ap_iv2_operations.py b/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/operations/_metrics_advisor_operations.py similarity index 99% rename from sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/operations/_microsoft_azure_metrics_advisor_restapi_open_ap_iv2_operations.py rename to sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/operations/_metrics_advisor_operations.py index 73b02ed9e7b0..5673e69d71fb 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/operations/_microsoft_azure_metrics_advisor_restapi_open_ap_iv2_operations.py +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_generated/operations/_metrics_advisor_operations.py @@ -22,7 +22,7 @@ T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] -class MicrosoftAzureMetricsAdvisorRESTAPIOpenAPIV2OperationsMixin(object): +class MetricsAdvisorOperationsMixin(object): def get_active_series_count( self, diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_metrics_advisor_administration_client.py b/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_metrics_advisor_administration_client.py index 1955c77ffcb7..78d68d1441b8 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_metrics_advisor_administration_client.py +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_metrics_advisor_administration_client.py @@ -11,9 +11,7 @@ import datetime import six from azure.core.tracing.decorator import distributed_trace -from ._generated._microsoft_azure_metrics_advisor_restapi_open_ap_iv2 import ( - MicrosoftAzureMetricsAdvisorRESTAPIOpenAPIV2 as _Client, -) +from ._generated import MetricsAdvisor as _Client from ._generated.models import ( AnomalyAlertingConfiguration as _AnomalyAlertingConfiguration, AzureApplicationInsightsDataFeed as _AzureApplicationInsightsDataFeed, diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_metrics_advisor_client.py b/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_metrics_advisor_client.py index 0d5078054bf7..4cc124819353 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_metrics_advisor_client.py +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/_metrics_advisor_client.py @@ -24,7 +24,7 @@ FeedbackDimensionFilter, DimensionGroupIdentity, ) -from ._generated import MicrosoftAzureMetricsAdvisorRESTAPIOpenAPIV2 as _Client +from ._generated import MetricsAdvisor as _Client from ._helpers import ( convert_to_sub_feedback, convert_datetime, diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/aio/_metrics_advisor_administration_client_async.py b/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/aio/_metrics_advisor_administration_client_async.py index 3b244b261c7b..6cc73ab99813 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/aio/_metrics_advisor_administration_client_async.py +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/aio/_metrics_advisor_administration_client_async.py @@ -20,7 +20,7 @@ from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.async_paging import AsyncItemPaged from .._generated.aio import ( - MicrosoftAzureMetricsAdvisorRESTAPIOpenAPIV2 as _ClientAsync, + MetricsAdvisor as _ClientAsync, ) from .._generated.models import ( AnomalyAlertingConfiguration as _AnomalyAlertingConfiguration, diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/aio/_metrics_advisor_client_async.py b/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/aio/_metrics_advisor_client_async.py index f527793546c3..8313ad5b45b1 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/aio/_metrics_advisor_client_async.py +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/aio/_metrics_advisor_client_async.py @@ -28,9 +28,7 @@ FeedbackDimensionFilter, DimensionGroupIdentity, ) -from .._generated.aio import ( - MicrosoftAzureMetricsAdvisorRESTAPIOpenAPIV2 as _ClientAsync, -) +from .._generated.aio import MetricsAdvisor as _ClientAsync from .._helpers import ( convert_to_sub_feedback, convert_datetime, diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/models/__init__.py b/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/models/__init__.py index 0829ccf4eb18..a5bc331ead11 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/models/__init__.py +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/azure/ai/metricsadvisor/models/__init__.py @@ -24,7 +24,7 @@ # # -------------------------------------------------------------------------- -from .._generated.models._microsoft_azure_metrics_advisor_restapi_open_ap_iv2_enums import ( +from .._generated.models import ( SnoozeScope, Severity as AnomalySeverity, DataSourceType as DatasourceType, From 05aec3dd91394cbc6517a5dbab7a91bfffba3446 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?McCoy=20Pati=C3=B1o?= <39780829+mccoyp@users.noreply.github.com> Date: Thu, 9 Sep 2021 18:41:31 -0700 Subject: [PATCH 36/85] Redact account keys in recordings (#20537) --- ...st_mgmt_batch.test_mgmt_batch_account.yaml | 4 +-- .../azure-mgmt-batch/tests/test_mgmt_batch.py | 35 +++++++++++++++++++ 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/sdk/batch/azure-mgmt-batch/tests/recordings/test_mgmt_batch.test_mgmt_batch_account.yaml b/sdk/batch/azure-mgmt-batch/tests/recordings/test_mgmt_batch.test_mgmt_batch_account.yaml index af80a5165f48..a9c6fc3d27ee 100644 --- a/sdk/batch/azure-mgmt-batch/tests/recordings/test_mgmt_batch.test_mgmt_batch_account.yaml +++ b/sdk/batch/azure-mgmt-batch/tests/recordings/test_mgmt_batch.test_mgmt_batch_account.yaml @@ -200,7 +200,7 @@ interactions: uri: https://centraluseuap.management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_batch_test_mgmt_batch_account3e1b0fe5/providers/Microsoft.Batch/batchAccounts/batch3e1b0fe5/listKeys?api-version=2021-06-01 response: body: - string: '{"accountName":"batch3e1b0fe5","primary":"3UQ9ry1mRmgftC37/IOylMEnaC713zLTXoMqp/zBQZ1ANY8eLsv1j5lkvN3PnaSevqoKjtfjKFyJ5Vsc6SGA0w==","secondary":"6dM/Myi6VRmOwbqgMjcIv4lSS7SQvlSTCmQX3RiwLvbivKU9oFi5zgdx7oNtOATEbB9rYO8oDkYVwn8PJLaTcg=="}' + string: '{"accountName":"batch3e1b0fe5","primary":"redacted6f7d7a","secondary":"redacted59d978"}' headers: cache-control: - no-cache @@ -248,7 +248,7 @@ interactions: uri: https://centraluseuap.management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_batch_test_mgmt_batch_account3e1b0fe5/providers/Microsoft.Batch/batchAccounts/batch3e1b0fe5/regenerateKeys?api-version=2021-06-01 response: body: - string: '{"accountName":"batch3e1b0fe5","primary":"3UQ9ry1mRmgftC37/IOylMEnaC713zLTXoMqp/zBQZ1ANY8eLsv1j5lkvN3PnaSevqoKjtfjKFyJ5Vsc6SGA0w==","secondary":"Q3pqv2ncSAxxnhTR14lumWnq9GRUVvy8exfqF2q5x6SZYGpregob+HI5eehGuFusbCaHLdzdzr3ZqBKXY3Qtyw=="}' + string: '{"accountName":"batch3e1b0fe5","primary":"redacted6f7d7a","secondary":"redactedebdb55"}' headers: cache-control: - no-cache diff --git a/sdk/batch/azure-mgmt-batch/tests/test_mgmt_batch.py b/sdk/batch/azure-mgmt-batch/tests/test_mgmt_batch.py index b2ee86ecd5c4..64a66f5aa55b 100644 --- a/sdk/batch/azure-mgmt-batch/tests/test_mgmt_batch.py +++ b/sdk/batch/azure-mgmt-batch/tests/test_mgmt_batch.py @@ -5,18 +5,23 @@ # Licensed under the MIT License. See License.txt in the project root for # license information. #-------------------------------------------------------------------------- +import binascii +import hashlib import io +import json import logging import time import unittest import requests +import six import azure.mgmt.batch from azure.mgmt.batch import models import azure.mgmt.network.models from mgmt_batch_preparers import KeyVaultPreparer, SimpleBatchPreparer +from azure_devtools.scenario_tests.recording_processors import GeneralNameReplacer, RecordingProcessor from devtools_testutils import ( AzureMgmtTestCase, ResourceGroupPreparer, @@ -32,10 +37,40 @@ EXPECTED_DEDICATED_CORE_QUOTA = 500 EXPECTED_LOW_PRIO_CORE_QUOTA = 500 EXPECTED_POOL_QUOTA = 100 +SECRET_FIELDS = ["primary", "secondary"] + + +def get_redacted_key(key): + redacted_value = "redacted" + digest = hashlib.sha256(six.ensure_binary(key)).digest() + redacted_value += six.ensure_str(binascii.hexlify(digest))[:6] + return redacted_value + + +class RecordingRedactor(RecordingProcessor): + """Removes keys from test recordings""" + + def process_response(self, response): + try: + body = json.loads(response["body"]["string"]) + except (KeyError, ValueError): + return response + + for field in body: + if field in SECRET_FIELDS: + body[field] = get_redacted_key(body[field]) + + response["body"]["string"] = json.dumps(body) + return response class MgmtBatchTest(AzureMgmtTestCase): + def __init__(self, *args, **kwargs): + scrubber = GeneralNameReplacer() + redactor = RecordingRedactor() + super(MgmtBatchTest, self).__init__(*args, recording_processors=[redactor, scrubber], **kwargs) + def setUp(self): super(MgmtBatchTest, self).setUp() self.mgmt_batch_client = self.create_mgmt_client( From acfb309c07413919786c2652928d34e96038834c Mon Sep 17 00:00:00 2001 From: Azure CLI Bot Date: Fri, 10 Sep 2021 11:28:30 +0800 Subject: [PATCH 37/85] [AutoRelease] t2-containerservice-2021-09-09-17236 (#20614) * CodeGen from PR 15954 in Azure/azure-rest-api-specs Merge Dev-containerservice-microsoft.containerservice-2021-08-01 branch to main (#15954) * Adds base for updating Microsoft.ContainerService from version stable/2021-07-01 to version 2021-08-01 * Updates readme * Updates API version in new specs and examples * add publicNetworkAccess property per network platform's request (#15489) * add publicNetworkAccess per network platform's request * fix quota Co-authored-by: Li Ma * update readme for 2021-08-01 sdk generation (#15476) * update readme for sdk generation * update readme for sdk generation Co-authored-by: Charlie Li * allow disabling of runcommand (#15481) * allow disabling of runcommand * rename file * another rename * fix prittier check * fix stupid prettier check * change publicNetworkAccess to enum (#15564) Co-authored-by: Li Ma * Add CreationData property to Agentpool level in 2021-08-01 API (#15563) * Add CreationData property to Agentpool level in 2021-08-01 API * fix json format * fix swagger spell check Co-authored-by: Charlie Li * chore: add enableMultipleStandardLoadBalancers to loadBalancerProfile (#15579) * Add snapshot related new APIs and properties to AKS 2021-08-01 swagger (#15586) * Add CreationData property to Agentpool level in 2021-08-01 API * Add snapshot related APIs and properties to AKS 2021-08-01 swagger * fix lint and spell checks * fix lint and spell checks * fix PrettierCheck * Change some Nodepool to NodePool * some changes according to ARM team's review comments Co-authored-by: Charlie Li * fix tag typo to match tag convention (#15683) * add workload runtime to agent pool api (#15726) * add workload runtime to agent pool api * reference example * add custom words * fix: workload runtime description (#15782) * fix: workload runtime description * add wasmtime to custom words * clarify single workload type per node Co-authored-by: Matthew Christopher Co-authored-by: Matthew Christopher * fix typo in readme.python.md (#15903) * Add CreationData property to Agentpool level in 2021-08-01 API * fix typos in readme.python.md Co-authored-by: Charlie Li * merge recent custom-words.txt changes from main branch to resolve conflicts (#15938) * Add CreationData property to Agentpool level in 2021-08-01 API * merge recent custom-words.txt changes from main branch to resolve conflicts Co-authored-by: Charlie Li * pull custom-words.txt from main * add a new word - NodePool * add two more words Co-authored-by: Super Co-authored-by: Li Ma Co-authored-by: Charlie Li Co-authored-by: Haitao Chen Co-authored-by: Qi Ni Co-authored-by: Ariel Silverman Co-authored-by: Ace Eldeib Co-authored-by: Matthew Christopher * version,CHANGELOG Co-authored-by: SDKAuto Co-authored-by: Super Co-authored-by: Li Ma Co-authored-by: Charlie Li Co-authored-by: Haitao Chen Co-authored-by: Qi Ni Co-authored-by: Ariel Silverman Co-authored-by: Ace Eldeib Co-authored-by: Matthew Christopher Co-authored-by: PythonSdkPipelines --- .../azure-mgmt-containerservice/CHANGELOG.md | 15 + .../azure-mgmt-containerservice/_meta.json | 2 +- .../_container_service_client.py | 40 +- .../azure/mgmt/containerservice/_version.py | 2 +- .../aio/_container_service_client.py | 40 +- .../azure/mgmt/containerservice/models.py | 2 +- .../containerservice/v2021_08_01/__init__.py | 16 + .../v2021_08_01/_configuration.py | 70 + .../v2021_08_01/_container_service_client.py | 124 + .../v2021_08_01/_metadata.json | 110 + .../v2021_08_01/aio/__init__.py | 10 + .../v2021_08_01/aio/_configuration.py | 66 + .../aio/_container_service_client.py | 117 + .../v2021_08_01/aio/operations/__init__.py | 27 + .../aio/operations/_agent_pools_operations.py | 691 +++ .../_maintenance_configurations_operations.py | 315 ++ .../_managed_clusters_operations.py | 1842 +++++++ .../v2021_08_01/aio/operations/_operations.py | 106 + ...private_endpoint_connections_operations.py | 358 ++ .../_private_link_resources_operations.py | 102 + ...olve_private_link_service_id_operations.py | 109 + .../aio/operations/_snapshots_operations.py | 439 ++ .../v2021_08_01/models/__init__.py | 339 ++ .../models/_container_service_client_enums.py | 584 +++ .../v2021_08_01/models/_models.py | 3826 +++++++++++++++ .../v2021_08_01/models/_models_py3.py | 4281 +++++++++++++++++ .../v2021_08_01/operations/__init__.py | 27 + .../operations/_agent_pools_operations.py | 705 +++ .../_maintenance_configurations_operations.py | 323 ++ .../_managed_clusters_operations.py | 1875 ++++++++ .../v2021_08_01/operations/_operations.py | 111 + ...private_endpoint_connections_operations.py | 367 ++ .../_private_link_resources_operations.py | 107 + ...olve_private_link_service_id_operations.py | 114 + .../operations/_snapshots_operations.py | 449 ++ .../containerservice/v2021_08_01/py.typed | 1 + 36 files changed, 17707 insertions(+), 5 deletions(-) create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/_configuration.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/_container_service_client.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/_metadata.json create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/_configuration.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/_container_service_client.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_agent_pools_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_maintenance_configurations_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_managed_clusters_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_private_endpoint_connections_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_private_link_resources_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_resolve_private_link_service_id_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_snapshots_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/models/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/models/_container_service_client_enums.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/models/_models.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/models/_models_py3.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_agent_pools_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_maintenance_configurations_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_managed_clusters_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_private_endpoint_connections_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_private_link_resources_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_resolve_private_link_service_id_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_snapshots_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/py.typed diff --git a/sdk/containerservice/azure-mgmt-containerservice/CHANGELOG.md b/sdk/containerservice/azure-mgmt-containerservice/CHANGELOG.md index 0f98e3139183..852f055f5628 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/CHANGELOG.md +++ b/sdk/containerservice/azure-mgmt-containerservice/CHANGELOG.md @@ -1,5 +1,20 @@ # Release History +## 16.2.0 (2021-09-09) + +**Features** + + - Model ManagedClusterAgentPoolProfileProperties has a new parameter creation_data + - Model ManagedClusterAgentPoolProfileProperties has a new parameter workload_runtime + - Model ManagedClusterLoadBalancerProfile has a new parameter enable_multiple_standard_load_balancers + - Model ManagedClusterAgentPoolProfile has a new parameter creation_data + - Model ManagedClusterAgentPoolProfile has a new parameter workload_runtime + - Model ManagedCluster has a new parameter public_network_access + - Model ManagedClusterAPIServerAccessProfile has a new parameter disable_run_command + - Model AgentPool has a new parameter creation_data + - Model AgentPool has a new parameter workload_runtime + - Added operation group SnapshotsOperations + ## 16.1.0 (2021-08-06) **Features** diff --git a/sdk/containerservice/azure-mgmt-containerservice/_meta.json b/sdk/containerservice/azure-mgmt-containerservice/_meta.json index 0dbdcb5c2e19..b3b1f583ddc1 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/_meta.json +++ b/sdk/containerservice/azure-mgmt-containerservice/_meta.json @@ -4,7 +4,7 @@ "@autorest/python@5.8.4", "@autorest/modelerfour@4.19.2" ], - "commit": "f528ab6315c8d4dd4c36f363851d491798a78146", + "commit": "c800afa8bcc12ee1c3df0ec26fb012d48b93ce0c", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest_command": "autorest specification/containerservice/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.4 --use=@autorest/modelerfour@4.19.2 --version=3.4.5", "readme": "specification/containerservice/resource-manager/readme.md" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_container_service_client.py index 7c3ce487fc0e..0ff066541854 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_container_service_client.py @@ -56,7 +56,7 @@ class ContainerServiceClient(MultiApiClientMixin, _SDKClient): :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ - DEFAULT_API_VERSION = '2021-07-01' + DEFAULT_API_VERSION = '2021-08-01' _PROFILE_TAG = "azure.mgmt.containerservice.ContainerServiceClient" LATEST_PROFILE = ProfileDefinition({ _PROFILE_TAG: { @@ -119,6 +119,7 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2021-03-01: :mod:`v2021_03_01.models` * 2021-05-01: :mod:`v2021_05_01.models` * 2021-07-01: :mod:`v2021_07_01.models` + * 2021-08-01: :mod:`v2021_08_01.models` """ if api_version == '2017-07-01': from .v2017_07_01 import models @@ -198,6 +199,9 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2021-07-01': from .v2021_07_01 import models return models + elif api_version == '2021-08-01': + from .v2021_08_01 import models + return models raise ValueError("API version {} is not available".format(api_version)) @property @@ -223,6 +227,7 @@ def agent_pools(self): * 2021-03-01: :class:`AgentPoolsOperations` * 2021-05-01: :class:`AgentPoolsOperations` * 2021-07-01: :class:`AgentPoolsOperations` + * 2021-08-01: :class:`AgentPoolsOperations` """ api_version = self._get_api_version('agent_pools') if api_version == '2019-02-01': @@ -263,6 +268,8 @@ def agent_pools(self): from .v2021_05_01.operations import AgentPoolsOperations as OperationClass elif api_version == '2021-07-01': from .v2021_07_01.operations import AgentPoolsOperations as OperationClass + elif api_version == '2021-08-01': + from .v2021_08_01.operations import AgentPoolsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'agent_pools'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -289,6 +296,7 @@ def maintenance_configurations(self): * 2021-03-01: :class:`MaintenanceConfigurationsOperations` * 2021-05-01: :class:`MaintenanceConfigurationsOperations` * 2021-07-01: :class:`MaintenanceConfigurationsOperations` + * 2021-08-01: :class:`MaintenanceConfigurationsOperations` """ api_version = self._get_api_version('maintenance_configurations') if api_version == '2020-12-01': @@ -301,6 +309,8 @@ def maintenance_configurations(self): from .v2021_05_01.operations import MaintenanceConfigurationsOperations as OperationClass elif api_version == '2021-07-01': from .v2021_07_01.operations import MaintenanceConfigurationsOperations as OperationClass + elif api_version == '2021-08-01': + from .v2021_08_01.operations import MaintenanceConfigurationsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'maintenance_configurations'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -330,6 +340,7 @@ def managed_clusters(self): * 2021-03-01: :class:`ManagedClustersOperations` * 2021-05-01: :class:`ManagedClustersOperations` * 2021-07-01: :class:`ManagedClustersOperations` + * 2021-08-01: :class:`ManagedClustersOperations` """ api_version = self._get_api_version('managed_clusters') if api_version == '2018-03-31': @@ -374,6 +385,8 @@ def managed_clusters(self): from .v2021_05_01.operations import ManagedClustersOperations as OperationClass elif api_version == '2021-07-01': from .v2021_07_01.operations import ManagedClustersOperations as OperationClass + elif api_version == '2021-08-01': + from .v2021_08_01.operations import ManagedClustersOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'managed_clusters'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -425,6 +438,7 @@ def operations(self): * 2021-03-01: :class:`Operations` * 2021-05-01: :class:`Operations` * 2021-07-01: :class:`Operations` + * 2021-08-01: :class:`Operations` """ api_version = self._get_api_version('operations') if api_version == '2018-03-31': @@ -469,6 +483,8 @@ def operations(self): from .v2021_05_01.operations import Operations as OperationClass elif api_version == '2021-07-01': from .v2021_07_01.operations import Operations as OperationClass + elif api_version == '2021-08-01': + from .v2021_08_01.operations import Operations as OperationClass else: raise ValueError("API version {} does not have operation group 'operations'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -486,6 +502,7 @@ def private_endpoint_connections(self): * 2021-03-01: :class:`PrivateEndpointConnectionsOperations` * 2021-05-01: :class:`PrivateEndpointConnectionsOperations` * 2021-07-01: :class:`PrivateEndpointConnectionsOperations` + * 2021-08-01: :class:`PrivateEndpointConnectionsOperations` """ api_version = self._get_api_version('private_endpoint_connections') if api_version == '2020-06-01': @@ -506,6 +523,8 @@ def private_endpoint_connections(self): from .v2021_05_01.operations import PrivateEndpointConnectionsOperations as OperationClass elif api_version == '2021-07-01': from .v2021_07_01.operations import PrivateEndpointConnectionsOperations as OperationClass + elif api_version == '2021-08-01': + from .v2021_08_01.operations import PrivateEndpointConnectionsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'private_endpoint_connections'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -521,6 +540,7 @@ def private_link_resources(self): * 2021-03-01: :class:`PrivateLinkResourcesOperations` * 2021-05-01: :class:`PrivateLinkResourcesOperations` * 2021-07-01: :class:`PrivateLinkResourcesOperations` + * 2021-08-01: :class:`PrivateLinkResourcesOperations` """ api_version = self._get_api_version('private_link_resources') if api_version == '2020-09-01': @@ -537,6 +557,8 @@ def private_link_resources(self): from .v2021_05_01.operations import PrivateLinkResourcesOperations as OperationClass elif api_version == '2021-07-01': from .v2021_07_01.operations import PrivateLinkResourcesOperations as OperationClass + elif api_version == '2021-08-01': + from .v2021_08_01.operations import PrivateLinkResourcesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'private_link_resources'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -552,6 +574,7 @@ def resolve_private_link_service_id(self): * 2021-03-01: :class:`ResolvePrivateLinkServiceIdOperations` * 2021-05-01: :class:`ResolvePrivateLinkServiceIdOperations` * 2021-07-01: :class:`ResolvePrivateLinkServiceIdOperations` + * 2021-08-01: :class:`ResolvePrivateLinkServiceIdOperations` """ api_version = self._get_api_version('resolve_private_link_service_id') if api_version == '2020-09-01': @@ -568,10 +591,25 @@ def resolve_private_link_service_id(self): from .v2021_05_01.operations import ResolvePrivateLinkServiceIdOperations as OperationClass elif api_version == '2021-07-01': from .v2021_07_01.operations import ResolvePrivateLinkServiceIdOperations as OperationClass + elif api_version == '2021-08-01': + from .v2021_08_01.operations import ResolvePrivateLinkServiceIdOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'resolve_private_link_service_id'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property + def snapshots(self): + """Instance depends on the API version: + + * 2021-08-01: :class:`SnapshotsOperations` + """ + api_version = self._get_api_version('snapshots') + if api_version == '2021-08-01': + from .v2021_08_01.operations import SnapshotsOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'snapshots'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + def close(self): self._client.close() def __enter__(self): diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_version.py index 8beed36ef7e5..b3440cace716 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_version.py @@ -9,4 +9,4 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "16.1.0" +VERSION = "16.2.0" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/_container_service_client.py index 3453c79346be..ff3a561414fb 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/_container_service_client.py @@ -54,7 +54,7 @@ class ContainerServiceClient(MultiApiClientMixin, _SDKClient): :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ - DEFAULT_API_VERSION = '2021-07-01' + DEFAULT_API_VERSION = '2021-08-01' _PROFILE_TAG = "azure.mgmt.containerservice.ContainerServiceClient" LATEST_PROFILE = ProfileDefinition({ _PROFILE_TAG: { @@ -117,6 +117,7 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2021-03-01: :mod:`v2021_03_01.models` * 2021-05-01: :mod:`v2021_05_01.models` * 2021-07-01: :mod:`v2021_07_01.models` + * 2021-08-01: :mod:`v2021_08_01.models` """ if api_version == '2017-07-01': from ..v2017_07_01 import models @@ -196,6 +197,9 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2021-07-01': from ..v2021_07_01 import models return models + elif api_version == '2021-08-01': + from ..v2021_08_01 import models + return models raise ValueError("API version {} is not available".format(api_version)) @property @@ -221,6 +225,7 @@ def agent_pools(self): * 2021-03-01: :class:`AgentPoolsOperations` * 2021-05-01: :class:`AgentPoolsOperations` * 2021-07-01: :class:`AgentPoolsOperations` + * 2021-08-01: :class:`AgentPoolsOperations` """ api_version = self._get_api_version('agent_pools') if api_version == '2019-02-01': @@ -261,6 +266,8 @@ def agent_pools(self): from ..v2021_05_01.aio.operations import AgentPoolsOperations as OperationClass elif api_version == '2021-07-01': from ..v2021_07_01.aio.operations import AgentPoolsOperations as OperationClass + elif api_version == '2021-08-01': + from ..v2021_08_01.aio.operations import AgentPoolsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'agent_pools'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -287,6 +294,7 @@ def maintenance_configurations(self): * 2021-03-01: :class:`MaintenanceConfigurationsOperations` * 2021-05-01: :class:`MaintenanceConfigurationsOperations` * 2021-07-01: :class:`MaintenanceConfigurationsOperations` + * 2021-08-01: :class:`MaintenanceConfigurationsOperations` """ api_version = self._get_api_version('maintenance_configurations') if api_version == '2020-12-01': @@ -299,6 +307,8 @@ def maintenance_configurations(self): from ..v2021_05_01.aio.operations import MaintenanceConfigurationsOperations as OperationClass elif api_version == '2021-07-01': from ..v2021_07_01.aio.operations import MaintenanceConfigurationsOperations as OperationClass + elif api_version == '2021-08-01': + from ..v2021_08_01.aio.operations import MaintenanceConfigurationsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'maintenance_configurations'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -328,6 +338,7 @@ def managed_clusters(self): * 2021-03-01: :class:`ManagedClustersOperations` * 2021-05-01: :class:`ManagedClustersOperations` * 2021-07-01: :class:`ManagedClustersOperations` + * 2021-08-01: :class:`ManagedClustersOperations` """ api_version = self._get_api_version('managed_clusters') if api_version == '2018-03-31': @@ -372,6 +383,8 @@ def managed_clusters(self): from ..v2021_05_01.aio.operations import ManagedClustersOperations as OperationClass elif api_version == '2021-07-01': from ..v2021_07_01.aio.operations import ManagedClustersOperations as OperationClass + elif api_version == '2021-08-01': + from ..v2021_08_01.aio.operations import ManagedClustersOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'managed_clusters'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -423,6 +436,7 @@ def operations(self): * 2021-03-01: :class:`Operations` * 2021-05-01: :class:`Operations` * 2021-07-01: :class:`Operations` + * 2021-08-01: :class:`Operations` """ api_version = self._get_api_version('operations') if api_version == '2018-03-31': @@ -467,6 +481,8 @@ def operations(self): from ..v2021_05_01.aio.operations import Operations as OperationClass elif api_version == '2021-07-01': from ..v2021_07_01.aio.operations import Operations as OperationClass + elif api_version == '2021-08-01': + from ..v2021_08_01.aio.operations import Operations as OperationClass else: raise ValueError("API version {} does not have operation group 'operations'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -484,6 +500,7 @@ def private_endpoint_connections(self): * 2021-03-01: :class:`PrivateEndpointConnectionsOperations` * 2021-05-01: :class:`PrivateEndpointConnectionsOperations` * 2021-07-01: :class:`PrivateEndpointConnectionsOperations` + * 2021-08-01: :class:`PrivateEndpointConnectionsOperations` """ api_version = self._get_api_version('private_endpoint_connections') if api_version == '2020-06-01': @@ -504,6 +521,8 @@ def private_endpoint_connections(self): from ..v2021_05_01.aio.operations import PrivateEndpointConnectionsOperations as OperationClass elif api_version == '2021-07-01': from ..v2021_07_01.aio.operations import PrivateEndpointConnectionsOperations as OperationClass + elif api_version == '2021-08-01': + from ..v2021_08_01.aio.operations import PrivateEndpointConnectionsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'private_endpoint_connections'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -519,6 +538,7 @@ def private_link_resources(self): * 2021-03-01: :class:`PrivateLinkResourcesOperations` * 2021-05-01: :class:`PrivateLinkResourcesOperations` * 2021-07-01: :class:`PrivateLinkResourcesOperations` + * 2021-08-01: :class:`PrivateLinkResourcesOperations` """ api_version = self._get_api_version('private_link_resources') if api_version == '2020-09-01': @@ -535,6 +555,8 @@ def private_link_resources(self): from ..v2021_05_01.aio.operations import PrivateLinkResourcesOperations as OperationClass elif api_version == '2021-07-01': from ..v2021_07_01.aio.operations import PrivateLinkResourcesOperations as OperationClass + elif api_version == '2021-08-01': + from ..v2021_08_01.aio.operations import PrivateLinkResourcesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'private_link_resources'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -550,6 +572,7 @@ def resolve_private_link_service_id(self): * 2021-03-01: :class:`ResolvePrivateLinkServiceIdOperations` * 2021-05-01: :class:`ResolvePrivateLinkServiceIdOperations` * 2021-07-01: :class:`ResolvePrivateLinkServiceIdOperations` + * 2021-08-01: :class:`ResolvePrivateLinkServiceIdOperations` """ api_version = self._get_api_version('resolve_private_link_service_id') if api_version == '2020-09-01': @@ -566,10 +589,25 @@ def resolve_private_link_service_id(self): from ..v2021_05_01.aio.operations import ResolvePrivateLinkServiceIdOperations as OperationClass elif api_version == '2021-07-01': from ..v2021_07_01.aio.operations import ResolvePrivateLinkServiceIdOperations as OperationClass + elif api_version == '2021-08-01': + from ..v2021_08_01.aio.operations import ResolvePrivateLinkServiceIdOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'resolve_private_link_service_id'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property + def snapshots(self): + """Instance depends on the API version: + + * 2021-08-01: :class:`SnapshotsOperations` + """ + api_version = self._get_api_version('snapshots') + if api_version == '2021-08-01': + from ..v2021_08_01.aio.operations import SnapshotsOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'snapshots'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + async def close(self): await self._client.close() async def __aenter__(self): diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/models.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/models.py index 32c068dc4ded..127a073e5bf5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/models.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/models.py @@ -6,4 +6,4 @@ # -------------------------------------------------------------------------- from .v2017_07_01.models import * from .v2019_04_30.models import * -from .v2021_07_01.models import * +from .v2021_08_01.models import * diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/__init__.py new file mode 100644 index 000000000000..eb3d7ba7a265 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/__init__.py @@ -0,0 +1,16 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._container_service_client import ContainerServiceClient +__all__ = ['ContainerServiceClient'] + +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/_configuration.py new file mode 100644 index 000000000000..36777d882373 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/_configuration.py @@ -0,0 +1,70 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + +VERSION = "unknown" + +class ContainerServiceClientConfiguration(Configuration): + """Configuration for ContainerServiceClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :type subscription_id: str + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2021-08-01" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-containerservice/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/_container_service_client.py new file mode 100644 index 000000000000..5827c29f4681 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/_container_service_client.py @@ -0,0 +1,124 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + from azure.core.credentials import TokenCredential + from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from ._configuration import ContainerServiceClientConfiguration +from .operations import Operations +from .operations import ManagedClustersOperations +from .operations import MaintenanceConfigurationsOperations +from .operations import AgentPoolsOperations +from .operations import PrivateEndpointConnectionsOperations +from .operations import PrivateLinkResourcesOperations +from .operations import ResolvePrivateLinkServiceIdOperations +from .operations import SnapshotsOperations +from . import models + + +class ContainerServiceClient(object): + """The Container Service Client. + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.containerservice.v2021_08_01.operations.Operations + :ivar managed_clusters: ManagedClustersOperations operations + :vartype managed_clusters: azure.mgmt.containerservice.v2021_08_01.operations.ManagedClustersOperations + :ivar maintenance_configurations: MaintenanceConfigurationsOperations operations + :vartype maintenance_configurations: azure.mgmt.containerservice.v2021_08_01.operations.MaintenanceConfigurationsOperations + :ivar agent_pools: AgentPoolsOperations operations + :vartype agent_pools: azure.mgmt.containerservice.v2021_08_01.operations.AgentPoolsOperations + :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations + :vartype private_endpoint_connections: azure.mgmt.containerservice.v2021_08_01.operations.PrivateEndpointConnectionsOperations + :ivar private_link_resources: PrivateLinkResourcesOperations operations + :vartype private_link_resources: azure.mgmt.containerservice.v2021_08_01.operations.PrivateLinkResourcesOperations + :ivar resolve_private_link_service_id: ResolvePrivateLinkServiceIdOperations operations + :vartype resolve_private_link_service_id: azure.mgmt.containerservice.v2021_08_01.operations.ResolvePrivateLinkServiceIdOperations + :ivar snapshots: SnapshotsOperations operations + :vartype snapshots: azure.mgmt.containerservice.v2021_08_01.operations.SnapshotsOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.managed_clusters = ManagedClustersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.maintenance_configurations = MaintenanceConfigurationsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.agent_pools = AgentPoolsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations( + self._client, self._config, self._serialize, self._deserialize) + self.snapshots = SnapshotsOperations( + self._client, self._config, self._serialize, self._deserialize) + + def _send_request(self, http_request, **kwargs): + # type: (HttpRequest, Any) -> HttpResponse + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.HttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> ContainerServiceClient + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/_metadata.json new file mode 100644 index 000000000000..cc02a82d3151 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/_metadata.json @@ -0,0 +1,110 @@ +{ + "chosen_version": "2021-08-01", + "total_api_version_list": ["2021-08-01"], + "client": { + "name": "ContainerServiceClient", + "filename": "_container_service_client", + "description": "The Container Service Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true, + "client_side_validation": false, + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + }, + "global_parameters": { + "sync": { + "credential": { + "signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + "docstring_type": "str", + "required": true + } + }, + "async": { + "credential": { + "signature": "credential: \"AsyncTokenCredential\",", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id: str,", + "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + "docstring_type": "str", + "required": true + } + }, + "constant": { + }, + "call": "credential, subscription_id", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url=None, # type: Optional[str]", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "async": { + "api_version": { + "signature": "api_version: Optional[str] = None,", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url: Optional[str] = None,", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } + }, + "config": { + "credential": true, + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null, + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" + }, + "operation_groups": { + "operations": "Operations", + "managed_clusters": "ManagedClustersOperations", + "maintenance_configurations": "MaintenanceConfigurationsOperations", + "agent_pools": "AgentPoolsOperations", + "private_endpoint_connections": "PrivateEndpointConnectionsOperations", + "private_link_resources": "PrivateLinkResourcesOperations", + "resolve_private_link_service_id": "ResolvePrivateLinkServiceIdOperations", + "snapshots": "SnapshotsOperations" + } +} \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/__init__.py new file mode 100644 index 000000000000..4ad2bb20096a --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/__init__.py @@ -0,0 +1,10 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._container_service_client import ContainerServiceClient +__all__ = ['ContainerServiceClient'] diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/_configuration.py new file mode 100644 index 000000000000..b848bd081877 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/_configuration.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +VERSION = "unknown" + +class ContainerServiceClientConfiguration(Configuration): + """Configuration for ContainerServiceClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :type subscription_id: str + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2021-08-01" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-containerservice/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs: Any + ) -> None: + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/_container_service_client.py new file mode 100644 index 000000000000..c160224555c8 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/_container_service_client.py @@ -0,0 +1,117 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional, TYPE_CHECKING + +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +from ._configuration import ContainerServiceClientConfiguration +from .operations import Operations +from .operations import ManagedClustersOperations +from .operations import MaintenanceConfigurationsOperations +from .operations import AgentPoolsOperations +from .operations import PrivateEndpointConnectionsOperations +from .operations import PrivateLinkResourcesOperations +from .operations import ResolvePrivateLinkServiceIdOperations +from .operations import SnapshotsOperations +from .. import models + + +class ContainerServiceClient(object): + """The Container Service Client. + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.containerservice.v2021_08_01.aio.operations.Operations + :ivar managed_clusters: ManagedClustersOperations operations + :vartype managed_clusters: azure.mgmt.containerservice.v2021_08_01.aio.operations.ManagedClustersOperations + :ivar maintenance_configurations: MaintenanceConfigurationsOperations operations + :vartype maintenance_configurations: azure.mgmt.containerservice.v2021_08_01.aio.operations.MaintenanceConfigurationsOperations + :ivar agent_pools: AgentPoolsOperations operations + :vartype agent_pools: azure.mgmt.containerservice.v2021_08_01.aio.operations.AgentPoolsOperations + :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations + :vartype private_endpoint_connections: azure.mgmt.containerservice.v2021_08_01.aio.operations.PrivateEndpointConnectionsOperations + :ivar private_link_resources: PrivateLinkResourcesOperations operations + :vartype private_link_resources: azure.mgmt.containerservice.v2021_08_01.aio.operations.PrivateLinkResourcesOperations + :ivar resolve_private_link_service_id: ResolvePrivateLinkServiceIdOperations operations + :vartype resolve_private_link_service_id: azure.mgmt.containerservice.v2021_08_01.aio.operations.ResolvePrivateLinkServiceIdOperations + :ivar snapshots: SnapshotsOperations operations + :vartype snapshots: azure.mgmt.containerservice.v2021_08_01.aio.operations.SnapshotsOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = ContainerServiceClientConfiguration(credential, subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.managed_clusters = ManagedClustersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.maintenance_configurations = MaintenanceConfigurationsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.agent_pools = AgentPoolsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations( + self._client, self._config, self._serialize, self._deserialize) + self.snapshots = SnapshotsOperations( + self._client, self._config, self._serialize, self._deserialize) + + async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "ContainerServiceClient": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/__init__.py new file mode 100644 index 000000000000..5e1e5e72fa59 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/__init__.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operations import Operations +from ._managed_clusters_operations import ManagedClustersOperations +from ._maintenance_configurations_operations import MaintenanceConfigurationsOperations +from ._agent_pools_operations import AgentPoolsOperations +from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._private_link_resources_operations import PrivateLinkResourcesOperations +from ._resolve_private_link_service_id_operations import ResolvePrivateLinkServiceIdOperations +from ._snapshots_operations import SnapshotsOperations + +__all__ = [ + 'Operations', + 'ManagedClustersOperations', + 'MaintenanceConfigurationsOperations', + 'AgentPoolsOperations', + 'PrivateEndpointConnectionsOperations', + 'PrivateLinkResourcesOperations', + 'ResolvePrivateLinkServiceIdOperations', + 'SnapshotsOperations', +] diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_agent_pools_operations.py new file mode 100644 index 000000000000..35246f92999e --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_agent_pools_operations.py @@ -0,0 +1,691 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class AgentPoolsOperations: + """AgentPoolsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.containerservice.v2021_08_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.AgentPoolListResult"]: + """Gets a list of agent pools in the specified managed cluster. + + Gets a list of agent pools in the specified managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AgentPoolListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPoolListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AgentPoolListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools'} # type: ignore + + async def get( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> "_models.AgentPool": + """Gets the specified managed cluster agent pool. + + Gets the specified managed cluster agent pool. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. + :type agent_pool_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AgentPool, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.AgentPool + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AgentPool', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: "_models.AgentPool", + **kwargs: Any + ) -> "_models.AgentPool": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'AgentPool') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AgentPool', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('AgentPool', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: "_models.AgentPool", + **kwargs: Any + ) -> AsyncLROPoller["_models.AgentPool"]: + """Creates or updates an agent pool in the specified managed cluster. + + Creates or updates an agent pool in the specified managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. + :type agent_pool_name: str + :param parameters: The agent pool to create or update. + :type parameters: ~azure.mgmt.containerservice.v2021_08_01.models.AgentPool + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either AgentPool or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_08_01.models.AgentPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AgentPool', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes an agent pool in the specified managed cluster. + + Deletes an agent pool in the specified managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. + :type agent_pool_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + async def get_upgrade_profile( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> "_models.AgentPoolUpgradeProfile": + """Gets the upgrade profile for an agent pool. + + Gets the upgrade profile for an agent pool. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. + :type agent_pool_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AgentPoolUpgradeProfile, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolUpgradeProfile + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPoolUpgradeProfile"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.get_upgrade_profile.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AgentPoolUpgradeProfile', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default'} # type: ignore + + async def get_available_agent_pool_versions( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.AgentPoolAvailableVersions": + """Gets a list of supported Kubernetes versions for the specified agent pool. + + See `supported Kubernetes versions + `_ for more details about + the version lifecycle. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AgentPoolAvailableVersions, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolAvailableVersions + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPoolAvailableVersions"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.get_available_agent_pool_versions.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AgentPoolAvailableVersions', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_available_agent_pool_versions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions'} # type: ignore + + async def _upgrade_node_image_version_initial( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> Optional["_models.AgentPool"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AgentPool"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self._upgrade_node_image_version_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 202: + deserialized = self._deserialize('AgentPool', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _upgrade_node_image_version_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion'} # type: ignore + + async def begin_upgrade_node_image_version( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + **kwargs: Any + ) -> AsyncLROPoller["_models.AgentPool"]: + """Upgrades the node image version of an agent pool to the latest. + + Upgrading the node image version of an agent pool applies the newest OS and runtime updates to + the nodes. AKS provides one new image per week with the latest updates. For more details on + node image versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. + :type agent_pool_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._upgrade_node_image_version_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AgentPool', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_upgrade_node_image_version.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_maintenance_configurations_operations.py new file mode 100644 index 000000000000..665aa8a3b8cd --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_maintenance_configurations_operations.py @@ -0,0 +1,315 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class MaintenanceConfigurationsOperations: + """MaintenanceConfigurationsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.containerservice.v2021_08_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_managed_cluster( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.MaintenanceConfigurationListResult"]: + """Gets a list of maintenance configurations in the specified managed cluster. + + Gets a list of maintenance configurations in the specified managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either MaintenanceConfigurationListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_08_01.models.MaintenanceConfigurationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MaintenanceConfigurationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_managed_cluster.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('MaintenanceConfigurationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_managed_cluster.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations'} # type: ignore + + async def get( + self, + resource_group_name: str, + resource_name: str, + config_name: str, + **kwargs: Any + ) -> "_models.MaintenanceConfiguration": + """Gets the specified maintenance configuration of a managed cluster. + + Gets the specified maintenance configuration of a managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param config_name: The name of the maintenance configuration. + :type config_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MaintenanceConfiguration, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.MaintenanceConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MaintenanceConfiguration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'configName': self._serialize.url("config_name", config_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MaintenanceConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + + async def create_or_update( + self, + resource_group_name: str, + resource_name: str, + config_name: str, + parameters: "_models.MaintenanceConfiguration", + **kwargs: Any + ) -> "_models.MaintenanceConfiguration": + """Creates or updates a maintenance configuration in the specified managed cluster. + + Creates or updates a maintenance configuration in the specified managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param config_name: The name of the maintenance configuration. + :type config_name: str + :param parameters: The maintenance configuration to create or update. + :type parameters: ~azure.mgmt.containerservice.v2021_08_01.models.MaintenanceConfiguration + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MaintenanceConfiguration, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.MaintenanceConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MaintenanceConfiguration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'configName': self._serialize.url("config_name", config_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'MaintenanceConfiguration') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MaintenanceConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + resource_name: str, + config_name: str, + **kwargs: Any + ) -> None: + """Deletes a maintenance configuration. + + Deletes a maintenance configuration. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param config_name: The name of the maintenance configuration. + :type config_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'configName': self._serialize.url("config_name", config_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_managed_clusters_operations.py new file mode 100644 index 000000000000..9a7cbf8d7f64 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_managed_clusters_operations.py @@ -0,0 +1,1842 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ManagedClustersOperations: + """ManagedClustersOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.containerservice.v2021_08_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get_os_options( + self, + location: str, + resource_type: Optional[str] = None, + **kwargs: Any + ) -> "_models.OSOptionProfile": + """Gets supported OS options in the specified subscription. + + Gets supported OS options in the specified subscription. + + :param location: The name of a supported Azure region. + :type location: str + :param resource_type: The resource type for which the OS options needs to be returned. + :type resource_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OSOptionProfile, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.OSOptionProfile + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OSOptionProfile"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.get_os_options.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if resource_type is not None: + query_parameters['resource-type'] = self._serialize.query("resource_type", resource_type, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('OSOptionProfile', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_os_options.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/osOptions/default'} # type: ignore + + def list( + self, + **kwargs: Any + ) -> AsyncIterable["_models.ManagedClusterListResult"]: + """Gets a list of managed clusters in the specified subscription. + + Gets a list of managed clusters in the specified subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ManagedClusterListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.ManagedClusterListResult"]: + """Lists managed clusters in the specified subscription and resource group. + + Lists managed clusters in the specified subscription and resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ManagedClusterListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + + async def get_upgrade_profile( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.ManagedClusterUpgradeProfile": + """Gets the upgrade profile of a managed cluster. + + Gets the upgrade profile of a managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ManagedClusterUpgradeProfile, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterUpgradeProfile + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterUpgradeProfile"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.get_upgrade_profile.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ManagedClusterUpgradeProfile', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore + + async def get_access_profile( + self, + resource_group_name: str, + resource_name: str, + role_name: str, + **kwargs: Any + ) -> "_models.ManagedClusterAccessProfile": + """Gets an access profile of a managed cluster. + + **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + `_ or + `ListClusterAdminCredentials + `_ . + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param role_name: The name of the role for managed cluster accessProfile resource. + :type role_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ManagedClusterAccessProfile, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterAccessProfile + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterAccessProfile"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.get_access_profile.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ManagedClusterAccessProfile', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore + + async def list_cluster_admin_credentials( + self, + resource_group_name: str, + resource_name: str, + server_fqdn: Optional[str] = None, + **kwargs: Any + ) -> "_models.CredentialResults": + """Lists the admin credentials of a managed cluster. + + Lists the admin credentials of a managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param server_fqdn: server fqdn type for credentials to be returned. + :type server_fqdn: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.CredentialResults + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CredentialResults"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.list_cluster_admin_credentials.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if server_fqdn is not None: + query_parameters['server-fqdn'] = self._serialize.query("server_fqdn", server_fqdn, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CredentialResults', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore + + async def list_cluster_user_credentials( + self, + resource_group_name: str, + resource_name: str, + server_fqdn: Optional[str] = None, + **kwargs: Any + ) -> "_models.CredentialResults": + """Lists the user credentials of a managed cluster. + + Lists the user credentials of a managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param server_fqdn: server fqdn type for credentials to be returned. + :type server_fqdn: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.CredentialResults + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CredentialResults"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.list_cluster_user_credentials.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if server_fqdn is not None: + query_parameters['server-fqdn'] = self._serialize.query("server_fqdn", server_fqdn, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CredentialResults', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore + + async def list_cluster_monitoring_user_credentials( + self, + resource_group_name: str, + resource_name: str, + server_fqdn: Optional[str] = None, + **kwargs: Any + ) -> "_models.CredentialResults": + """Lists the cluster monitoring user credentials of a managed cluster. + + Lists the cluster monitoring user credentials of a managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param server_fqdn: server fqdn type for credentials to be returned. + :type server_fqdn: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.CredentialResults + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CredentialResults"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.list_cluster_monitoring_user_credentials.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if server_fqdn is not None: + query_parameters['server-fqdn'] = self._serialize.query("server_fqdn", server_fqdn, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CredentialResults', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_cluster_monitoring_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential'} # type: ignore + + async def get( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.ManagedCluster": + """Gets a managed cluster. + + Gets a managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ManagedCluster, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedCluster + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ManagedCluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedCluster", + **kwargs: Any + ) -> "_models.ManagedCluster": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ManagedCluster') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('ManagedCluster', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ManagedCluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedCluster", + **kwargs: Any + ) -> AsyncLROPoller["_models.ManagedCluster"]: + """Creates or updates a managed cluster. + + Creates or updates a managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param parameters: The managed cluster to create or update. + :type parameters: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedCluster + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_08_01.models.ManagedCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ManagedCluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + async def _update_tags_initial( + self, + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> "_models.ManagedCluster": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_tags_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ManagedCluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + async def begin_update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> AsyncLROPoller["_models.ManagedCluster"]: + """Updates tags on a managed cluster. + + Updates tags on a managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param parameters: Parameters supplied to the Update Managed Cluster Tags operation. + :type parameters: ~azure.mgmt.containerservice.v2021_08_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_08_01.models.ManagedCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_tags_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ManagedCluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a managed cluster. + + Deletes a managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + async def _reset_service_principal_profile_initial( + self, + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterServicePrincipalProfile", + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._reset_service_principal_profile_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _reset_service_principal_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore + + async def begin_reset_service_principal_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterServicePrincipalProfile", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Reset the Service Principal Profile of a managed cluster. + + This action cannot be performed on a cluster that is not using a service principal. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param parameters: The service principal profile to set on the managed cluster. + :type parameters: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterServicePrincipalProfile + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._reset_service_principal_profile_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore + + async def _reset_aad_profile_initial( + self, + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterAADProfile", + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._reset_aad_profile_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _reset_aad_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore + + async def begin_reset_aad_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: "_models.ManagedClusterAADProfile", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Reset the AAD Profile of a managed cluster. + + Reset the AAD Profile of a managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param parameters: The AAD profile to set on the Managed Cluster. + :type parameters: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterAADProfile + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._reset_aad_profile_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore + + async def _rotate_cluster_certificates_initial( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self._rotate_cluster_certificates_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _rotate_cluster_certificates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore + + async def begin_rotate_cluster_certificates( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Rotates the certificates of a managed cluster. + + See `Certificate rotation `_ for + more details about rotating managed cluster certificates. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._rotate_cluster_certificates_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_rotate_cluster_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore + + async def _stop_initial( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self._stop_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _stop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop'} # type: ignore + + async def begin_stop( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Stops a Managed Cluster. + + This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a + cluster stops the control plane and agent nodes entirely, while maintaining all object and + cluster state. A cluster does not accrue charges while it is stopped. See `stopping a cluster + `_ for more details about stopping a + cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._stop_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop'} # type: ignore + + async def _start_initial( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self._start_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _start_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start'} # type: ignore + + async def begin_start( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Starts a previously stopped Managed Cluster. + + See `starting a cluster `_ for more + details about starting a cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._start_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start'} # type: ignore + + async def _run_command_initial( + self, + resource_group_name: str, + resource_name: str, + request_payload: "_models.RunCommandRequest", + **kwargs: Any + ) -> Optional["_models.RunCommandResult"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RunCommandResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._run_command_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request_payload, 'RunCommandRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('RunCommandResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _run_command_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand'} # type: ignore + + async def begin_run_command( + self, + resource_group_name: str, + resource_name: str, + request_payload: "_models.RunCommandRequest", + **kwargs: Any + ) -> AsyncLROPoller["_models.RunCommandResult"]: + """Submits a command to run against the Managed Cluster. + + AKS will create a pod to run the command. This is primarily useful for private clusters. For + more information see `AKS Run Command + `_. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param request_payload: The run command request. + :type request_payload: ~azure.mgmt.containerservice.v2021_08_01.models.RunCommandRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either RunCommandResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2021_08_01.models.RunCommandResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandResult"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._run_command_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + request_payload=request_payload, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('RunCommandResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_run_command.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand'} # type: ignore + + async def get_command_result( + self, + resource_group_name: str, + resource_name: str, + command_id: str, + **kwargs: Any + ) -> Optional["_models.RunCommandResult"]: + """Gets the results of a command which has been run on the Managed Cluster. + + Gets the results of a command which has been run on the Managed Cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param command_id: Id of the command. + :type command_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RunCommandResult, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.RunCommandResult or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RunCommandResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.get_command_result.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'commandId': self._serialize.url("command_id", command_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('RunCommandResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_command_result.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/commandResults/{commandId}'} # type: ignore + + def list_outbound_network_dependencies_endpoints( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.OutboundEnvironmentEndpointCollection"]: + """Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. + + Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the + specified managed cluster. The operation returns properties of each egress endpoint. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OutboundEnvironmentEndpointCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_08_01.models.OutboundEnvironmentEndpointCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundEnvironmentEndpointCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_outbound_network_dependencies_endpoints.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('OutboundEnvironmentEndpointCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_outbound_network_dependencies_endpoints.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/outboundNetworkDependenciesEndpoints'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_operations.py new file mode 100644 index 000000000000..0d3ad21a22b0 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_operations.py @@ -0,0 +1,106 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class Operations: + """Operations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.containerservice.v2021_08_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs: Any + ) -> AsyncIterable["_models.OperationListResult"]: + """Gets a list of operations. + + Gets a list of operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_08_01.models.OperationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('OperationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.ContainerService/operations'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_private_endpoint_connections_operations.py new file mode 100644 index 000000000000..db60eeac5c58 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_private_endpoint_connections_operations.py @@ -0,0 +1,358 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class PrivateEndpointConnectionsOperations: + """PrivateEndpointConnectionsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.containerservice.v2021_08_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def list( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.PrivateEndpointConnectionListResult": + """Gets a list of private endpoint connections in the specified managed cluster. + + To learn more about private clusters, see: + https://docs.microsoft.com/azure/aks/private-clusters. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnectionListResult, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.PrivateEndpointConnectionListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnectionListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections'} # type: ignore + + async def get( + self, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> "_models.PrivateEndpointConnection": + """Gets the specified private endpoint connection. + + To learn more about private clusters, see: + https://docs.microsoft.com/azure/aks/private-clusters. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def update( + self, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + parameters: "_models.PrivateEndpointConnection", + **kwargs: Any + ) -> "_models.PrivateEndpointConnection": + """Updates a private endpoint connection. + + Updates a private endpoint connection. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. + :type private_endpoint_connection_name: str + :param parameters: The updated private endpoint connection. + :type parameters: ~azure.mgmt.containerservice.v2021_08_01.models.PrivateEndpointConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'PrivateEndpointConnection') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a private endpoint connection. + + Deletes a private endpoint connection. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_private_link_resources_operations.py new file mode 100644 index 000000000000..7a5893b6c4aa --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_private_link_resources_operations.py @@ -0,0 +1,102 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class PrivateLinkResourcesOperations: + """PrivateLinkResourcesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.containerservice.v2021_08_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def list( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.PrivateLinkResourcesListResult": + """Gets a list of private link resources in the specified managed cluster. + + To learn more about private clusters, see: + https://docs.microsoft.com/azure/aks/private-clusters. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkResourcesListResult, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.PrivateLinkResourcesListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourcesListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateLinkResourcesListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateLinkResources'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_resolve_private_link_service_id_operations.py new file mode 100644 index 000000000000..848874421313 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_resolve_private_link_service_id_operations.py @@ -0,0 +1,109 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ResolvePrivateLinkServiceIdOperations: + """ResolvePrivateLinkServiceIdOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.containerservice.v2021_08_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def post( + self, + resource_group_name: str, + resource_name: str, + parameters: "_models.PrivateLinkResource", + **kwargs: Any + ) -> "_models.PrivateLinkResource": + """Gets the private link service ID for the specified managed cluster. + + Gets the private link service ID for the specified managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param parameters: Parameters required in order to resolve a private link service ID. + :type parameters: ~azure.mgmt.containerservice.v2021_08_01.models.PrivateLinkResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkResource, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.PrivateLinkResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.post.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'PrivateLinkResource') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateLinkResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + post.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_snapshots_operations.py new file mode 100644 index 000000000000..164d57e3b7bf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_snapshots_operations.py @@ -0,0 +1,439 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class SnapshotsOperations: + """SnapshotsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.containerservice.v2021_08_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs: Any + ) -> AsyncIterable["_models.SnapshotListResult"]: + """Gets a list of snapshots in the specified subscription. + + Gets a list of snapshots in the specified subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SnapshotListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_08_01.models.SnapshotListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SnapshotListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/snapshots'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.SnapshotListResult"]: + """Lists snapshots in the specified subscription and resource group. + + Lists snapshots in the specified subscription and resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SnapshotListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2021_08_01.models.SnapshotListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SnapshotListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots'} # type: ignore + + async def get( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.Snapshot": + """Gets a snapshot. + + Gets a snapshot. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Snapshot, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.Snapshot + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Snapshot', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}'} # type: ignore + + async def create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: "_models.Snapshot", + **kwargs: Any + ) -> "_models.Snapshot": + """Creates or updates a snapshot. + + Creates or updates a snapshot. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param parameters: The snapshot to create or update. + :type parameters: ~azure.mgmt.containerservice.v2021_08_01.models.Snapshot + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Snapshot, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.Snapshot + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'Snapshot') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Snapshot', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Snapshot', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}'} # type: ignore + + async def update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> "_models.Snapshot": + """Updates tags on a snapshot. + + Updates tags on a snapshot. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param parameters: Parameters supplied to the Update snapshot Tags operation. + :type parameters: ~azure.mgmt.containerservice.v2021_08_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Snapshot, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.Snapshot + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Snapshot', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> None: + """Deletes a snapshot. + + Deletes a snapshot. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/models/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/models/__init__.py new file mode 100644 index 000000000000..ae984aa96041 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/models/__init__.py @@ -0,0 +1,339 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import AgentPool + from ._models_py3 import AgentPoolAvailableVersions + from ._models_py3 import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem + from ._models_py3 import AgentPoolListResult + from ._models_py3 import AgentPoolUpgradeProfile + from ._models_py3 import AgentPoolUpgradeProfilePropertiesUpgradesItem + from ._models_py3 import AgentPoolUpgradeSettings + from ._models_py3 import CloudErrorBody + from ._models_py3 import ContainerServiceDiagnosticsProfile + from ._models_py3 import ContainerServiceLinuxProfile + from ._models_py3 import ContainerServiceMasterProfile + from ._models_py3 import ContainerServiceNetworkProfile + from ._models_py3 import ContainerServiceSshConfiguration + from ._models_py3 import ContainerServiceSshPublicKey + from ._models_py3 import ContainerServiceVMDiagnostics + from ._models_py3 import CreationData + from ._models_py3 import CredentialResult + from ._models_py3 import CredentialResults + from ._models_py3 import EndpointDependency + from ._models_py3 import EndpointDetail + from ._models_py3 import ExtendedLocation + from ._models_py3 import KubeletConfig + from ._models_py3 import LinuxOSConfig + from ._models_py3 import MaintenanceConfiguration + from ._models_py3 import MaintenanceConfigurationListResult + from ._models_py3 import ManagedCluster + from ._models_py3 import ManagedClusterAADProfile + from ._models_py3 import ManagedClusterAPIServerAccessProfile + from ._models_py3 import ManagedClusterAccessProfile + from ._models_py3 import ManagedClusterAddonProfile + from ._models_py3 import ManagedClusterAddonProfileIdentity + from ._models_py3 import ManagedClusterAgentPoolProfile + from ._models_py3 import ManagedClusterAgentPoolProfileProperties + from ._models_py3 import ManagedClusterAutoUpgradeProfile + from ._models_py3 import ManagedClusterHTTPProxyConfig + from ._models_py3 import ManagedClusterIdentity + from ._models_py3 import ManagedClusterListResult + from ._models_py3 import ManagedClusterLoadBalancerProfile + from ._models_py3 import ManagedClusterLoadBalancerProfileManagedOutboundIPs + from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPPrefixes + from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPs + from ._models_py3 import ManagedClusterManagedOutboundIPProfile + from ._models_py3 import ManagedClusterNATGatewayProfile + from ._models_py3 import ManagedClusterPodIdentity + from ._models_py3 import ManagedClusterPodIdentityException + from ._models_py3 import ManagedClusterPodIdentityProfile + from ._models_py3 import ManagedClusterPodIdentityProvisioningError + from ._models_py3 import ManagedClusterPodIdentityProvisioningErrorBody + from ._models_py3 import ManagedClusterPodIdentityProvisioningInfo + from ._models_py3 import ManagedClusterPoolUpgradeProfile + from ._models_py3 import ManagedClusterPoolUpgradeProfileUpgradesItem + from ._models_py3 import ManagedClusterPropertiesAutoScalerProfile + from ._models_py3 import ManagedClusterSKU + from ._models_py3 import ManagedClusterSecurityProfile + from ._models_py3 import ManagedClusterSecurityProfileAzureDefender + from ._models_py3 import ManagedClusterServicePrincipalProfile + from ._models_py3 import ManagedClusterUpgradeProfile + from ._models_py3 import ManagedClusterWindowsProfile + from ._models_py3 import ManagedServiceIdentityUserAssignedIdentitiesValue + from ._models_py3 import OSOptionProfile + from ._models_py3 import OSOptionProperty + from ._models_py3 import OperationListResult + from ._models_py3 import OperationValue + from ._models_py3 import OutboundEnvironmentEndpoint + from ._models_py3 import OutboundEnvironmentEndpointCollection + from ._models_py3 import PowerState + from ._models_py3 import PrivateEndpoint + from ._models_py3 import PrivateEndpointConnection + from ._models_py3 import PrivateEndpointConnectionListResult + from ._models_py3 import PrivateLinkResource + from ._models_py3 import PrivateLinkResourcesListResult + from ._models_py3 import PrivateLinkServiceConnectionState + from ._models_py3 import Resource + from ._models_py3 import ResourceReference + from ._models_py3 import RunCommandRequest + from ._models_py3 import RunCommandResult + from ._models_py3 import Snapshot + from ._models_py3 import SnapshotListResult + from ._models_py3 import SubResource + from ._models_py3 import SysctlConfig + from ._models_py3 import SystemData + from ._models_py3 import TagsObject + from ._models_py3 import TimeInWeek + from ._models_py3 import TimeSpan + from ._models_py3 import UserAssignedIdentity +except (SyntaxError, ImportError): + from ._models import AgentPool # type: ignore + from ._models import AgentPoolAvailableVersions # type: ignore + from ._models import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem # type: ignore + from ._models import AgentPoolListResult # type: ignore + from ._models import AgentPoolUpgradeProfile # type: ignore + from ._models import AgentPoolUpgradeProfilePropertiesUpgradesItem # type: ignore + from ._models import AgentPoolUpgradeSettings # type: ignore + from ._models import CloudErrorBody # type: ignore + from ._models import ContainerServiceDiagnosticsProfile # type: ignore + from ._models import ContainerServiceLinuxProfile # type: ignore + from ._models import ContainerServiceMasterProfile # type: ignore + from ._models import ContainerServiceNetworkProfile # type: ignore + from ._models import ContainerServiceSshConfiguration # type: ignore + from ._models import ContainerServiceSshPublicKey # type: ignore + from ._models import ContainerServiceVMDiagnostics # type: ignore + from ._models import CreationData # type: ignore + from ._models import CredentialResult # type: ignore + from ._models import CredentialResults # type: ignore + from ._models import EndpointDependency # type: ignore + from ._models import EndpointDetail # type: ignore + from ._models import ExtendedLocation # type: ignore + from ._models import KubeletConfig # type: ignore + from ._models import LinuxOSConfig # type: ignore + from ._models import MaintenanceConfiguration # type: ignore + from ._models import MaintenanceConfigurationListResult # type: ignore + from ._models import ManagedCluster # type: ignore + from ._models import ManagedClusterAADProfile # type: ignore + from ._models import ManagedClusterAPIServerAccessProfile # type: ignore + from ._models import ManagedClusterAccessProfile # type: ignore + from ._models import ManagedClusterAddonProfile # type: ignore + from ._models import ManagedClusterAddonProfileIdentity # type: ignore + from ._models import ManagedClusterAgentPoolProfile # type: ignore + from ._models import ManagedClusterAgentPoolProfileProperties # type: ignore + from ._models import ManagedClusterAutoUpgradeProfile # type: ignore + from ._models import ManagedClusterHTTPProxyConfig # type: ignore + from ._models import ManagedClusterIdentity # type: ignore + from ._models import ManagedClusterListResult # type: ignore + from ._models import ManagedClusterLoadBalancerProfile # type: ignore + from ._models import ManagedClusterLoadBalancerProfileManagedOutboundIPs # type: ignore + from ._models import ManagedClusterLoadBalancerProfileOutboundIPPrefixes # type: ignore + from ._models import ManagedClusterLoadBalancerProfileOutboundIPs # type: ignore + from ._models import ManagedClusterManagedOutboundIPProfile # type: ignore + from ._models import ManagedClusterNATGatewayProfile # type: ignore + from ._models import ManagedClusterPodIdentity # type: ignore + from ._models import ManagedClusterPodIdentityException # type: ignore + from ._models import ManagedClusterPodIdentityProfile # type: ignore + from ._models import ManagedClusterPodIdentityProvisioningError # type: ignore + from ._models import ManagedClusterPodIdentityProvisioningErrorBody # type: ignore + from ._models import ManagedClusterPodIdentityProvisioningInfo # type: ignore + from ._models import ManagedClusterPoolUpgradeProfile # type: ignore + from ._models import ManagedClusterPoolUpgradeProfileUpgradesItem # type: ignore + from ._models import ManagedClusterPropertiesAutoScalerProfile # type: ignore + from ._models import ManagedClusterSKU # type: ignore + from ._models import ManagedClusterSecurityProfile # type: ignore + from ._models import ManagedClusterSecurityProfileAzureDefender # type: ignore + from ._models import ManagedClusterServicePrincipalProfile # type: ignore + from ._models import ManagedClusterUpgradeProfile # type: ignore + from ._models import ManagedClusterWindowsProfile # type: ignore + from ._models import ManagedServiceIdentityUserAssignedIdentitiesValue # type: ignore + from ._models import OSOptionProfile # type: ignore + from ._models import OSOptionProperty # type: ignore + from ._models import OperationListResult # type: ignore + from ._models import OperationValue # type: ignore + from ._models import OutboundEnvironmentEndpoint # type: ignore + from ._models import OutboundEnvironmentEndpointCollection # type: ignore + from ._models import PowerState # type: ignore + from ._models import PrivateEndpoint # type: ignore + from ._models import PrivateEndpointConnection # type: ignore + from ._models import PrivateEndpointConnectionListResult # type: ignore + from ._models import PrivateLinkResource # type: ignore + from ._models import PrivateLinkResourcesListResult # type: ignore + from ._models import PrivateLinkServiceConnectionState # type: ignore + from ._models import Resource # type: ignore + from ._models import ResourceReference # type: ignore + from ._models import RunCommandRequest # type: ignore + from ._models import RunCommandResult # type: ignore + from ._models import Snapshot # type: ignore + from ._models import SnapshotListResult # type: ignore + from ._models import SubResource # type: ignore + from ._models import SysctlConfig # type: ignore + from ._models import SystemData # type: ignore + from ._models import TagsObject # type: ignore + from ._models import TimeInWeek # type: ignore + from ._models import TimeSpan # type: ignore + from ._models import UserAssignedIdentity # type: ignore + +from ._container_service_client_enums import ( + AgentPoolMode, + AgentPoolType, + Code, + ConnectionStatus, + ContainerServiceStorageProfileTypes, + ContainerServiceVMSizeTypes, + Count, + CreatedByType, + Expander, + ExtendedLocationTypes, + GPUInstanceProfile, + KubeletDiskType, + LicenseType, + LoadBalancerSku, + ManagedClusterPodIdentityProvisioningState, + ManagedClusterSKUName, + ManagedClusterSKUTier, + NetworkMode, + NetworkPlugin, + NetworkPolicy, + OSDiskType, + OSSKU, + OSType, + OutboundType, + PrivateEndpointConnectionProvisioningState, + PublicNetworkAccess, + ResourceIdentityType, + ScaleDownMode, + ScaleSetEvictionPolicy, + ScaleSetPriority, + SnapshotType, + UpgradeChannel, + WeekDay, + WorkloadRuntime, +) + +__all__ = [ + 'AgentPool', + 'AgentPoolAvailableVersions', + 'AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem', + 'AgentPoolListResult', + 'AgentPoolUpgradeProfile', + 'AgentPoolUpgradeProfilePropertiesUpgradesItem', + 'AgentPoolUpgradeSettings', + 'CloudErrorBody', + 'ContainerServiceDiagnosticsProfile', + 'ContainerServiceLinuxProfile', + 'ContainerServiceMasterProfile', + 'ContainerServiceNetworkProfile', + 'ContainerServiceSshConfiguration', + 'ContainerServiceSshPublicKey', + 'ContainerServiceVMDiagnostics', + 'CreationData', + 'CredentialResult', + 'CredentialResults', + 'EndpointDependency', + 'EndpointDetail', + 'ExtendedLocation', + 'KubeletConfig', + 'LinuxOSConfig', + 'MaintenanceConfiguration', + 'MaintenanceConfigurationListResult', + 'ManagedCluster', + 'ManagedClusterAADProfile', + 'ManagedClusterAPIServerAccessProfile', + 'ManagedClusterAccessProfile', + 'ManagedClusterAddonProfile', + 'ManagedClusterAddonProfileIdentity', + 'ManagedClusterAgentPoolProfile', + 'ManagedClusterAgentPoolProfileProperties', + 'ManagedClusterAutoUpgradeProfile', + 'ManagedClusterHTTPProxyConfig', + 'ManagedClusterIdentity', + 'ManagedClusterListResult', + 'ManagedClusterLoadBalancerProfile', + 'ManagedClusterLoadBalancerProfileManagedOutboundIPs', + 'ManagedClusterLoadBalancerProfileOutboundIPPrefixes', + 'ManagedClusterLoadBalancerProfileOutboundIPs', + 'ManagedClusterManagedOutboundIPProfile', + 'ManagedClusterNATGatewayProfile', + 'ManagedClusterPodIdentity', + 'ManagedClusterPodIdentityException', + 'ManagedClusterPodIdentityProfile', + 'ManagedClusterPodIdentityProvisioningError', + 'ManagedClusterPodIdentityProvisioningErrorBody', + 'ManagedClusterPodIdentityProvisioningInfo', + 'ManagedClusterPoolUpgradeProfile', + 'ManagedClusterPoolUpgradeProfileUpgradesItem', + 'ManagedClusterPropertiesAutoScalerProfile', + 'ManagedClusterSKU', + 'ManagedClusterSecurityProfile', + 'ManagedClusterSecurityProfileAzureDefender', + 'ManagedClusterServicePrincipalProfile', + 'ManagedClusterUpgradeProfile', + 'ManagedClusterWindowsProfile', + 'ManagedServiceIdentityUserAssignedIdentitiesValue', + 'OSOptionProfile', + 'OSOptionProperty', + 'OperationListResult', + 'OperationValue', + 'OutboundEnvironmentEndpoint', + 'OutboundEnvironmentEndpointCollection', + 'PowerState', + 'PrivateEndpoint', + 'PrivateEndpointConnection', + 'PrivateEndpointConnectionListResult', + 'PrivateLinkResource', + 'PrivateLinkResourcesListResult', + 'PrivateLinkServiceConnectionState', + 'Resource', + 'ResourceReference', + 'RunCommandRequest', + 'RunCommandResult', + 'Snapshot', + 'SnapshotListResult', + 'SubResource', + 'SysctlConfig', + 'SystemData', + 'TagsObject', + 'TimeInWeek', + 'TimeSpan', + 'UserAssignedIdentity', + 'AgentPoolMode', + 'AgentPoolType', + 'Code', + 'ConnectionStatus', + 'ContainerServiceStorageProfileTypes', + 'ContainerServiceVMSizeTypes', + 'Count', + 'CreatedByType', + 'Expander', + 'ExtendedLocationTypes', + 'GPUInstanceProfile', + 'KubeletDiskType', + 'LicenseType', + 'LoadBalancerSku', + 'ManagedClusterPodIdentityProvisioningState', + 'ManagedClusterSKUName', + 'ManagedClusterSKUTier', + 'NetworkMode', + 'NetworkPlugin', + 'NetworkPolicy', + 'OSDiskType', + 'OSSKU', + 'OSType', + 'OutboundType', + 'PrivateEndpointConnectionProvisioningState', + 'PublicNetworkAccess', + 'ResourceIdentityType', + 'ScaleDownMode', + 'ScaleSetEvictionPolicy', + 'ScaleSetPriority', + 'SnapshotType', + 'UpgradeChannel', + 'WeekDay', + 'WorkloadRuntime', +] diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/models/_container_service_client_enums.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/models/_container_service_client_enums.py new file mode 100644 index 000000000000..9eeb9d5f0677 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/models/_container_service_client_enums.py @@ -0,0 +1,584 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class AgentPoolMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """A cluster must have at least one 'System' Agent Pool at all times. For additional information + on agent pool restrictions and best practices, see: + https://docs.microsoft.com/azure/aks/use-system-pools + """ + + #: System agent pools are primarily for hosting critical system pods such as CoreDNS and + #: metrics-server. System agent pools osType must be Linux. System agent pools VM SKU must have at + #: least 2vCPUs and 4GB of memory. + SYSTEM = "System" + #: User agent pools are primarily for hosting your application pods. + USER = "User" + +class AgentPoolType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of Agent Pool. + """ + + #: Create an Agent Pool backed by a Virtual Machine Scale Set. + VIRTUAL_MACHINE_SCALE_SETS = "VirtualMachineScaleSets" + #: Use of this is strongly discouraged. + AVAILABILITY_SET = "AvailabilitySet" + +class Code(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Tells whether the cluster is Running or Stopped + """ + + #: The cluster is running. + RUNNING = "Running" + #: The cluster is stopped. + STOPPED = "Stopped" + +class ConnectionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The private link service connection status. + """ + + PENDING = "Pending" + APPROVED = "Approved" + REJECTED = "Rejected" + DISCONNECTED = "Disconnected" + +class ContainerServiceStorageProfileTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies what kind of storage to use. If omitted, the default will be chosen on your behalf + based on the choice of orchestrator. + """ + + STORAGE_ACCOUNT = "StorageAccount" + MANAGED_DISKS = "ManagedDisks" + +class ContainerServiceVMSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Size of agent VMs. Note: This is no longer maintained. + """ + + STANDARD_A1 = "Standard_A1" + STANDARD_A10 = "Standard_A10" + STANDARD_A11 = "Standard_A11" + STANDARD_A1_V2 = "Standard_A1_v2" + STANDARD_A2 = "Standard_A2" + STANDARD_A2_V2 = "Standard_A2_v2" + STANDARD_A2_M_V2 = "Standard_A2m_v2" + STANDARD_A3 = "Standard_A3" + STANDARD_A4 = "Standard_A4" + STANDARD_A4_V2 = "Standard_A4_v2" + STANDARD_A4_M_V2 = "Standard_A4m_v2" + STANDARD_A5 = "Standard_A5" + STANDARD_A6 = "Standard_A6" + STANDARD_A7 = "Standard_A7" + STANDARD_A8 = "Standard_A8" + STANDARD_A8_V2 = "Standard_A8_v2" + STANDARD_A8_M_V2 = "Standard_A8m_v2" + STANDARD_A9 = "Standard_A9" + STANDARD_B2_MS = "Standard_B2ms" + STANDARD_B2_S = "Standard_B2s" + STANDARD_B4_MS = "Standard_B4ms" + STANDARD_B8_MS = "Standard_B8ms" + STANDARD_D1 = "Standard_D1" + STANDARD_D11 = "Standard_D11" + STANDARD_D11_V2 = "Standard_D11_v2" + STANDARD_D11_V2_PROMO = "Standard_D11_v2_Promo" + STANDARD_D12 = "Standard_D12" + STANDARD_D12_V2 = "Standard_D12_v2" + STANDARD_D12_V2_PROMO = "Standard_D12_v2_Promo" + STANDARD_D13 = "Standard_D13" + STANDARD_D13_V2 = "Standard_D13_v2" + STANDARD_D13_V2_PROMO = "Standard_D13_v2_Promo" + STANDARD_D14 = "Standard_D14" + STANDARD_D14_V2 = "Standard_D14_v2" + STANDARD_D14_V2_PROMO = "Standard_D14_v2_Promo" + STANDARD_D15_V2 = "Standard_D15_v2" + STANDARD_D16_V3 = "Standard_D16_v3" + STANDARD_D16_S_V3 = "Standard_D16s_v3" + STANDARD_D1_V2 = "Standard_D1_v2" + STANDARD_D2 = "Standard_D2" + STANDARD_D2_V2 = "Standard_D2_v2" + STANDARD_D2_V2_PROMO = "Standard_D2_v2_Promo" + STANDARD_D2_V3 = "Standard_D2_v3" + STANDARD_D2_S_V3 = "Standard_D2s_v3" + STANDARD_D3 = "Standard_D3" + STANDARD_D32_V3 = "Standard_D32_v3" + STANDARD_D32_S_V3 = "Standard_D32s_v3" + STANDARD_D3_V2 = "Standard_D3_v2" + STANDARD_D3_V2_PROMO = "Standard_D3_v2_Promo" + STANDARD_D4 = "Standard_D4" + STANDARD_D4_V2 = "Standard_D4_v2" + STANDARD_D4_V2_PROMO = "Standard_D4_v2_Promo" + STANDARD_D4_V3 = "Standard_D4_v3" + STANDARD_D4_S_V3 = "Standard_D4s_v3" + STANDARD_D5_V2 = "Standard_D5_v2" + STANDARD_D5_V2_PROMO = "Standard_D5_v2_Promo" + STANDARD_D64_V3 = "Standard_D64_v3" + STANDARD_D64_S_V3 = "Standard_D64s_v3" + STANDARD_D8_V3 = "Standard_D8_v3" + STANDARD_D8_S_V3 = "Standard_D8s_v3" + STANDARD_DS1 = "Standard_DS1" + STANDARD_DS11 = "Standard_DS11" + STANDARD_DS11_V2 = "Standard_DS11_v2" + STANDARD_DS11_V2_PROMO = "Standard_DS11_v2_Promo" + STANDARD_DS12 = "Standard_DS12" + STANDARD_DS12_V2 = "Standard_DS12_v2" + STANDARD_DS12_V2_PROMO = "Standard_DS12_v2_Promo" + STANDARD_DS13 = "Standard_DS13" + STANDARD_DS13_2_V2 = "Standard_DS13-2_v2" + STANDARD_DS13_4_V2 = "Standard_DS13-4_v2" + STANDARD_DS13_V2 = "Standard_DS13_v2" + STANDARD_DS13_V2_PROMO = "Standard_DS13_v2_Promo" + STANDARD_DS14 = "Standard_DS14" + STANDARD_DS14_4_V2 = "Standard_DS14-4_v2" + STANDARD_DS14_8_V2 = "Standard_DS14-8_v2" + STANDARD_DS14_V2 = "Standard_DS14_v2" + STANDARD_DS14_V2_PROMO = "Standard_DS14_v2_Promo" + STANDARD_DS15_V2 = "Standard_DS15_v2" + STANDARD_DS1_V2 = "Standard_DS1_v2" + STANDARD_DS2 = "Standard_DS2" + STANDARD_DS2_V2 = "Standard_DS2_v2" + STANDARD_DS2_V2_PROMO = "Standard_DS2_v2_Promo" + STANDARD_DS3 = "Standard_DS3" + STANDARD_DS3_V2 = "Standard_DS3_v2" + STANDARD_DS3_V2_PROMO = "Standard_DS3_v2_Promo" + STANDARD_DS4 = "Standard_DS4" + STANDARD_DS4_V2 = "Standard_DS4_v2" + STANDARD_DS4_V2_PROMO = "Standard_DS4_v2_Promo" + STANDARD_DS5_V2 = "Standard_DS5_v2" + STANDARD_DS5_V2_PROMO = "Standard_DS5_v2_Promo" + STANDARD_E16_V3 = "Standard_E16_v3" + STANDARD_E16_S_V3 = "Standard_E16s_v3" + STANDARD_E2_V3 = "Standard_E2_v3" + STANDARD_E2_S_V3 = "Standard_E2s_v3" + STANDARD_E32_16_S_V3 = "Standard_E32-16s_v3" + STANDARD_E32_8_S_V3 = "Standard_E32-8s_v3" + STANDARD_E32_V3 = "Standard_E32_v3" + STANDARD_E32_S_V3 = "Standard_E32s_v3" + STANDARD_E4_V3 = "Standard_E4_v3" + STANDARD_E4_S_V3 = "Standard_E4s_v3" + STANDARD_E64_16_S_V3 = "Standard_E64-16s_v3" + STANDARD_E64_32_S_V3 = "Standard_E64-32s_v3" + STANDARD_E64_V3 = "Standard_E64_v3" + STANDARD_E64_S_V3 = "Standard_E64s_v3" + STANDARD_E8_V3 = "Standard_E8_v3" + STANDARD_E8_S_V3 = "Standard_E8s_v3" + STANDARD_F1 = "Standard_F1" + STANDARD_F16 = "Standard_F16" + STANDARD_F16_S = "Standard_F16s" + STANDARD_F16_S_V2 = "Standard_F16s_v2" + STANDARD_F1_S = "Standard_F1s" + STANDARD_F2 = "Standard_F2" + STANDARD_F2_S = "Standard_F2s" + STANDARD_F2_S_V2 = "Standard_F2s_v2" + STANDARD_F32_S_V2 = "Standard_F32s_v2" + STANDARD_F4 = "Standard_F4" + STANDARD_F4_S = "Standard_F4s" + STANDARD_F4_S_V2 = "Standard_F4s_v2" + STANDARD_F64_S_V2 = "Standard_F64s_v2" + STANDARD_F72_S_V2 = "Standard_F72s_v2" + STANDARD_F8 = "Standard_F8" + STANDARD_F8_S = "Standard_F8s" + STANDARD_F8_S_V2 = "Standard_F8s_v2" + STANDARD_G1 = "Standard_G1" + STANDARD_G2 = "Standard_G2" + STANDARD_G3 = "Standard_G3" + STANDARD_G4 = "Standard_G4" + STANDARD_G5 = "Standard_G5" + STANDARD_GS1 = "Standard_GS1" + STANDARD_GS2 = "Standard_GS2" + STANDARD_GS3 = "Standard_GS3" + STANDARD_GS4 = "Standard_GS4" + STANDARD_GS4_4 = "Standard_GS4-4" + STANDARD_GS4_8 = "Standard_GS4-8" + STANDARD_GS5 = "Standard_GS5" + STANDARD_GS5_16 = "Standard_GS5-16" + STANDARD_GS5_8 = "Standard_GS5-8" + STANDARD_H16 = "Standard_H16" + STANDARD_H16_M = "Standard_H16m" + STANDARD_H16_MR = "Standard_H16mr" + STANDARD_H16_R = "Standard_H16r" + STANDARD_H8 = "Standard_H8" + STANDARD_H8_M = "Standard_H8m" + STANDARD_L16_S = "Standard_L16s" + STANDARD_L32_S = "Standard_L32s" + STANDARD_L4_S = "Standard_L4s" + STANDARD_L8_S = "Standard_L8s" + STANDARD_M128_32_MS = "Standard_M128-32ms" + STANDARD_M128_64_MS = "Standard_M128-64ms" + STANDARD_M128_MS = "Standard_M128ms" + STANDARD_M128_S = "Standard_M128s" + STANDARD_M64_16_MS = "Standard_M64-16ms" + STANDARD_M64_32_MS = "Standard_M64-32ms" + STANDARD_M64_MS = "Standard_M64ms" + STANDARD_M64_S = "Standard_M64s" + STANDARD_NC12 = "Standard_NC12" + STANDARD_NC12_S_V2 = "Standard_NC12s_v2" + STANDARD_NC12_S_V3 = "Standard_NC12s_v3" + STANDARD_NC24 = "Standard_NC24" + STANDARD_NC24_R = "Standard_NC24r" + STANDARD_NC24_RS_V2 = "Standard_NC24rs_v2" + STANDARD_NC24_RS_V3 = "Standard_NC24rs_v3" + STANDARD_NC24_S_V2 = "Standard_NC24s_v2" + STANDARD_NC24_S_V3 = "Standard_NC24s_v3" + STANDARD_NC6 = "Standard_NC6" + STANDARD_NC6_S_V2 = "Standard_NC6s_v2" + STANDARD_NC6_S_V3 = "Standard_NC6s_v3" + STANDARD_ND12_S = "Standard_ND12s" + STANDARD_ND24_RS = "Standard_ND24rs" + STANDARD_ND24_S = "Standard_ND24s" + STANDARD_ND6_S = "Standard_ND6s" + STANDARD_NV12 = "Standard_NV12" + STANDARD_NV24 = "Standard_NV24" + STANDARD_NV6 = "Standard_NV6" + +class Count(with_metaclass(_CaseInsensitiveEnumMeta, int, Enum)): + """Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. The + default value is 1. + """ + + ONE = 1 + THREE = 3 + FIVE = 5 + +class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of identity that created the resource. + """ + + USER = "User" + APPLICATION = "Application" + MANAGED_IDENTITY = "ManagedIdentity" + KEY = "Key" + +class Expander(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """If not specified, the default is 'random'. See `expanders + `_ + for more information. + """ + + #: Selects the node group that will have the least idle CPU (if tied, unused memory) after + #: scale-up. This is useful when you have different classes of nodes, for example, high CPU or + #: high memory nodes, and only want to expand those when there are pending pods that need a lot of + #: those resources. + LEAST_WASTE = "least-waste" + #: Selects the node group that would be able to schedule the most pods when scaling up. This is + #: useful when you are using nodeSelector to make sure certain pods land on certain nodes. Note + #: that this won't cause the autoscaler to select bigger nodes vs. smaller, as it can add multiple + #: smaller nodes at once. + MOST_PODS = "most-pods" + #: Selects the node group that has the highest priority assigned by the user. It's configuration + #: is described in more details `here + #: `_. + PRIORITY = "priority" + #: Used when you don't have a particular need for the node groups to scale differently. + RANDOM = "random" + +class ExtendedLocationTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of extendedLocation. + """ + + EDGE_ZONE = "EdgeZone" + +class GPUInstanceProfile(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. + """ + + MIG1_G = "MIG1g" + MIG2_G = "MIG2g" + MIG3_G = "MIG3g" + MIG4_G = "MIG4g" + MIG7_G = "MIG7g" + +class KubeletDiskType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Determines the placement of emptyDir volumes, container runtime data root, and Kubelet + ephemeral storage. + """ + + #: Kubelet will use the OS disk for its data. + OS = "OS" + #: Kubelet will use the temporary disk for its data. + TEMPORARY = "Temporary" + +class LicenseType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The license type to use for Windows VMs. See `Azure Hybrid User Benefits + `_ for more details. + """ + + #: No additional licensing is applied. + NONE = "None" + #: Enables Azure Hybrid User Benefits for Windows VMs. + WINDOWS_SERVER = "Windows_Server" + +class LoadBalancerSku(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The default is 'standard'. See `Azure Load Balancer SKUs + `_ for more information about the + differences between load balancer SKUs. + """ + + #: Use a a standard Load Balancer. This is the recommended Load Balancer SKU. For more information + #: about on working with the load balancer in the managed cluster, see the `standard Load Balancer + #: `_ article. + STANDARD = "standard" + #: Use a basic Load Balancer with limited functionality. + BASIC = "basic" + +class ManagedClusterPodIdentityProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The current provisioning state of the pod identity. + """ + + ASSIGNED = "Assigned" + UPDATING = "Updating" + DELETING = "Deleting" + FAILED = "Failed" + +class ManagedClusterSKUName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The name of a managed cluster SKU. + """ + + BASIC = "Basic" + +class ManagedClusterSKUTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """If not specified, the default is 'Free'. See `uptime SLA + `_ for more details. + """ + + #: Guarantees 99.95% availability of the Kubernetes API server endpoint for clusters that use + #: Availability Zones and 99.9% of availability for clusters that don't use Availability Zones. + PAID = "Paid" + #: No guaranteed SLA, no additional charges. Free tier clusters have an SLO of 99.5%. + FREE = "Free" + +class NetworkMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """This cannot be specified if networkPlugin is anything other than 'azure'. + """ + + #: No bridge is created. Intra-VM Pod to Pod communication is through IP routes created by Azure + #: CNI. See `Transparent Mode `_ for + #: more information. + TRANSPARENT = "transparent" + #: This is no longer supported. + BRIDGE = "bridge" + +class NetworkPlugin(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Network plugin used for building the Kubernetes network. + """ + + #: Use the Azure CNI network plugin. See `Azure CNI (advanced) networking + #: `_ for + #: more information. + AZURE = "azure" + #: Use the Kubenet network plugin. See `Kubenet (basic) networking + #: `_ for more + #: information. + KUBENET = "kubenet" + +class NetworkPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Network policy used for building the Kubernetes network. + """ + + #: Use Calico network policies. See `differences between Azure and Calico policies + #: `_ + #: for more information. + CALICO = "calico" + #: Use Azure network policies. See `differences between Azure and Calico policies + #: `_ + #: for more information. + AZURE = "azure" + +class OSDiskType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested + OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more + information see `Ephemeral OS + `_. + """ + + #: Azure replicates the operating system disk for a virtual machine to Azure storage to avoid data + #: loss should the VM need to be relocated to another host. Since containers aren't designed to + #: have local state persisted, this behavior offers limited value while providing some drawbacks, + #: including slower node provisioning and higher read/write latency. + MANAGED = "Managed" + #: Ephemeral OS disks are stored only on the host machine, just like a temporary disk. This + #: provides lower read/write latency, along with faster node scaling and cluster upgrades. + EPHEMERAL = "Ephemeral" + +class OSSKU(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies an OS SKU. This value must not be specified if OSType is Windows. + """ + + UBUNTU = "Ubuntu" + CBL_MARINER = "CBLMariner" + +class OSType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The operating system type. The default is Linux. + """ + + #: Use Linux. + LINUX = "Linux" + #: Use Windows. + WINDOWS = "Windows" + +class OutboundType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """This can only be set at cluster creation time and cannot be changed later. For more information + see `egress outbound type `_. + """ + + #: The load balancer is used for egress through an AKS assigned public IP. This supports + #: Kubernetes services of type 'loadBalancer'. For more information see `outbound type + #: loadbalancer + #: `_. + LOAD_BALANCER = "loadBalancer" + #: Egress paths must be defined by the user. This is an advanced scenario and requires proper + #: network configuration. For more information see `outbound type userDefinedRouting + #: `_. + USER_DEFINED_ROUTING = "userDefinedRouting" + #: The AKS-managed NAT gateway is used for egress. + MANAGED_NAT_GATEWAY = "managedNATGateway" + #: The user-assigned NAT gateway associated to the cluster subnet is used for egress. This is an + #: advanced scenario and requires proper network configuration. + USER_ASSIGNED_NAT_GATEWAY = "userAssignedNATGateway" + +class PrivateEndpointConnectionProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The current provisioning state. + """ + + SUCCEEDED = "Succeeded" + CREATING = "Creating" + DELETING = "Deleting" + FAILED = "Failed" + +class PublicNetworkAccess(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Default value is 'Enabled' (case insensitive). Could be set to 'Disabled' to enable private + cluster + """ + + ENABLED = "Enabled" + DISABLED = "Disabled" + +class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """For more information see `use managed identities in AKS + `_. + """ + + #: Use an implicitly created system assigned managed identity to manage cluster resources. Master + #: components in the control plane such as kube-controller-manager will use the system assigned + #: managed identity to manipulate Azure resources. + SYSTEM_ASSIGNED = "SystemAssigned" + #: Use a user-specified identity to manage cluster resources. Master components in the control + #: plane such as kube-controller-manager will use the specified user assigned managed identity to + #: manipulate Azure resources. + USER_ASSIGNED = "UserAssigned" + #: Do not use a managed identity for the Managed Cluster, service principal will be used instead. + NONE = "None" + +class ScaleDownMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Describes how VMs are added to or removed from Agent Pools. See `billing states + `_. + """ + + #: Create new instances during scale up and remove instances during scale down. + DELETE = "Delete" + #: Attempt to start deallocated instances (if they exist) during scale up and deallocate instances + #: during scale down. + DEALLOCATE = "Deallocate" + +class ScaleSetEvictionPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The eviction policy specifies what to do with the VM when it is evicted. The default is Delete. + For more information about eviction see `spot VMs + `_ + """ + + #: Nodes in the underlying Scale Set of the node pool are deleted when they're evicted. + DELETE = "Delete" + #: Nodes in the underlying Scale Set of the node pool are set to the stopped-deallocated state + #: upon eviction. Nodes in the stopped-deallocated state count against your compute quota and can + #: cause issues with cluster scaling or upgrading. + DEALLOCATE = "Deallocate" + +class ScaleSetPriority(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The Virtual Machine Scale Set priority. + """ + + #: Spot priority VMs will be used. There is no SLA for spot nodes. See `spot on AKS + #: `_ for more information. + SPOT = "Spot" + #: Regular VMs will be used. + REGULAR = "Regular" + +class SnapshotType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of a snapshot. The default is NodePool. + """ + + #: The snapshot is a snapshot of a node pool. + NODE_POOL = "NodePool" + +class UpgradeChannel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """For more information see `setting the AKS cluster auto-upgrade channel + `_. + """ + + #: Automatically upgrade the cluster to the latest supported patch release on the latest supported + #: minor version. In cases where the cluster is at a version of Kubernetes that is at an N-2 minor + #: version where N is the latest supported minor version, the cluster first upgrades to the latest + #: supported patch version on N-1 minor version. For example, if a cluster is running version + #: 1.17.7 and versions 1.17.9, 1.18.4, 1.18.6, and 1.19.1 are available, your cluster first is + #: upgraded to 1.18.6, then is upgraded to 1.19.1. + RAPID = "rapid" + #: Automatically upgrade the cluster to the latest supported patch release on minor version N-1, + #: where N is the latest supported minor version. For example, if a cluster is running version + #: 1.17.7 and versions 1.17.9, 1.18.4, 1.18.6, and 1.19.1 are available, your cluster is upgraded + #: to 1.18.6. + STABLE = "stable" + #: Automatically upgrade the cluster to the latest supported patch version when it becomes + #: available while keeping the minor version the same. For example, if a cluster is running + #: version 1.17.7 and versions 1.17.9, 1.18.4, 1.18.6, and 1.19.1 are available, your cluster is + #: upgraded to 1.17.9. + PATCH = "patch" + #: Automatically upgrade the node image to the latest version available. Microsoft provides + #: patches and new images for image nodes frequently (usually weekly), but your running nodes + #: won't get the new images unless you do a node image upgrade. Turning on the node-image channel + #: will automatically update your node images whenever a new version is available. + NODE_IMAGE = "node-image" + #: Disables auto-upgrades and keeps the cluster at its current version of Kubernetes. + NONE = "none" + +class WeekDay(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The weekday enum. + """ + + SUNDAY = "Sunday" + MONDAY = "Monday" + TUESDAY = "Tuesday" + WEDNESDAY = "Wednesday" + THURSDAY = "Thursday" + FRIDAY = "Friday" + SATURDAY = "Saturday" + +class WorkloadRuntime(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Determines the type of workload a node can run. + """ + + #: Nodes will use Kubelet to run standard OCI container workloads. + OCI_CONTAINER = "OCIContainer" + #: Nodes will use Krustlet to run WASM workloads using the WASI provider (Preview). + WASM_WASI = "WasmWasi" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/models/_models.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/models/_models.py new file mode 100644 index 000000000000..5e46c3f29cab --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/models/_models.py @@ -0,0 +1,3826 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +import msrest.serialization + + +class SubResource(msrest.serialization.Model): + """Reference to another subresource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SubResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class AgentPool(SubResource): + """Agent Pool. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for + system pools. The default value is 1. + :type count: int + :param vm_size: VM size availability varies by region. If a node contains insufficient compute + resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted + VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + :type vm_size: str + :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in the master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :type os_disk_size_gb: int + :param os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk + larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed + after creation. For more information see `Ephemeral OS + `_. Possible values + include: "Managed", "Ephemeral". + :type os_disk_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSDiskType + :param kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data + root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". + :type kubelet_disk_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.KubeletDiskType + :param workload_runtime: Determines the type of workload a node can run. Possible values + include: "OCIContainer", "WasmWasi". + :type workload_runtime: str or ~azure.mgmt.containerservice.v2021_08_01.models.WorkloadRuntime + :param vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. + If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just + nodes. This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :type vnet_subnet_id: str + :param pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see + vnetSubnetID for more details). This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :type pod_subnet_id: str + :param max_pods: The maximum number of pods that can run on a node. + :type max_pods: int + :param os_type: The operating system type. The default is Linux. Possible values include: + "Linux", "Windows". Default value: "Linux". + :type os_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSType + :param os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. + Possible values include: "Ubuntu", "CBLMariner". + :type os_sku: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSSKU + :param max_count: The maximum number of nodes for auto-scaling. + :type max_count: int + :param min_count: The minimum number of nodes for auto-scaling. + :type min_count: int + :param enable_auto_scaling: Whether to enable auto-scaler. + :type enable_auto_scaling: bool + :param scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it + defaults to Delete. Possible values include: "Delete", "Deallocate". + :type scale_down_mode: str or ~azure.mgmt.containerservice.v2021_08_01.models.ScaleDownMode + :param type_properties_type: The type of Agent Pool. Possible values include: + "VirtualMachineScaleSets", "AvailabilitySet". + :type type_properties_type: str or + ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolType + :param mode: A cluster must have at least one 'System' Agent Pool at all times. For additional + information on agent pool restrictions and best practices, see: + https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", + "User". + :type mode: str or ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolMode + :param orchestrator_version: As a best practice, you should upgrade all node pools in an AKS + cluster to the same Kubernetes version. The node pool version must have the same major version + as the control plane. The node pool minor version must be within two minor versions of the + control plane version. The node pool version cannot be greater than the control plane version. + For more information see `upgrading a node pool + `_. + :type orchestrator_version: str + :ivar node_image_version: The version of node image. + :vartype node_image_version: str + :param upgrade_settings: Settings for upgrading the agentpool. + :type upgrade_settings: + ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolUpgradeSettings + :ivar provisioning_state: The current deployment or provisioning state. + :vartype provisioning_state: str + :ivar power_state: Describes whether the Agent Pool is Running or Stopped. + :vartype power_state: ~azure.mgmt.containerservice.v2021_08_01.models.PowerState + :param availability_zones: The list of Availability zones to use for nodes. This can only be + specified if the AgentPoolType property is 'VirtualMachineScaleSets'. + :type availability_zones: list[str] + :param enable_node_public_ip: Some scenarios may require nodes in a node pool to receive their + own dedicated public IP addresses. A common scenario is for gaming workloads, where a console + needs to make a direct connection to a cloud virtual machine to minimize hops. For more + information see `assigning a public IP per node + `_. + The default is false. + :type enable_node_public_ip: bool + :param node_public_ip_prefix_id: This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. + :type node_public_ip_prefix_id: str + :param scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the + default is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". + :type scale_set_priority: str or + ~azure.mgmt.containerservice.v2021_08_01.models.ScaleSetPriority + :param scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is + 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", + "Deallocate". Default value: "Delete". + :type scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2021_08_01.models.ScaleSetEvictionPolicy + :param spot_max_price: Possible values are any decimal value greater than zero or -1 which + indicates the willingness to pay any on-demand price. For more details on spot pricing, see + `spot VMs pricing `_. + :type spot_max_price: float + :param tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale + set. + :type tags: dict[str, str] + :param node_labels: The node labels to be persisted across all nodes in agent pool. + :type node_labels: dict[str, str] + :param node_taints: The taints added to new nodes during node pool create and scale. For + example, key=value:NoSchedule. + :type node_taints: list[str] + :param proximity_placement_group_id: The ID for Proximity Placement Group. + :type proximity_placement_group_id: str + :param kubelet_config: The Kubelet configuration on the agent pool nodes. + :type kubelet_config: ~azure.mgmt.containerservice.v2021_08_01.models.KubeletConfig + :param linux_os_config: The OS configuration of Linux agent nodes. + :type linux_os_config: ~azure.mgmt.containerservice.v2021_08_01.models.LinuxOSConfig + :param enable_encryption_at_host: This is only supported on certain VM sizes and in certain + Azure regions. For more information, see: + https://docs.microsoft.com/azure/aks/enable-host-encryption. + :type enable_encryption_at_host: bool + :param enable_ultra_ssd: Whether to enable UltraSSD. + :type enable_ultra_ssd: bool + :param enable_fips: See `Add a FIPS-enabled node pool + `_ + for more details. + :type enable_fips: bool + :param gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile + for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", "MIG7g". + :type gpu_instance_profile: str or + ~azure.mgmt.containerservice.v2021_08_01.models.GPUInstanceProfile + :param creation_data: CreationData to be used to specify the source Snapshot ID if the node + pool will be created/upgraded using a snapshot. + :type creation_data: ~azure.mgmt.containerservice.v2021_08_01.models.CreationData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'os_disk_size_gb': {'maximum': 2048, 'minimum': 0}, + 'node_image_version': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'power_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'count': {'key': 'properties.count', 'type': 'int'}, + 'vm_size': {'key': 'properties.vmSize', 'type': 'str'}, + 'os_disk_size_gb': {'key': 'properties.osDiskSizeGB', 'type': 'int'}, + 'os_disk_type': {'key': 'properties.osDiskType', 'type': 'str'}, + 'kubelet_disk_type': {'key': 'properties.kubeletDiskType', 'type': 'str'}, + 'workload_runtime': {'key': 'properties.workloadRuntime', 'type': 'str'}, + 'vnet_subnet_id': {'key': 'properties.vnetSubnetID', 'type': 'str'}, + 'pod_subnet_id': {'key': 'properties.podSubnetID', 'type': 'str'}, + 'max_pods': {'key': 'properties.maxPods', 'type': 'int'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'os_sku': {'key': 'properties.osSKU', 'type': 'str'}, + 'max_count': {'key': 'properties.maxCount', 'type': 'int'}, + 'min_count': {'key': 'properties.minCount', 'type': 'int'}, + 'enable_auto_scaling': {'key': 'properties.enableAutoScaling', 'type': 'bool'}, + 'scale_down_mode': {'key': 'properties.scaleDownMode', 'type': 'str'}, + 'type_properties_type': {'key': 'properties.type', 'type': 'str'}, + 'mode': {'key': 'properties.mode', 'type': 'str'}, + 'orchestrator_version': {'key': 'properties.orchestratorVersion', 'type': 'str'}, + 'node_image_version': {'key': 'properties.nodeImageVersion', 'type': 'str'}, + 'upgrade_settings': {'key': 'properties.upgradeSettings', 'type': 'AgentPoolUpgradeSettings'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'power_state': {'key': 'properties.powerState', 'type': 'PowerState'}, + 'availability_zones': {'key': 'properties.availabilityZones', 'type': '[str]'}, + 'enable_node_public_ip': {'key': 'properties.enableNodePublicIP', 'type': 'bool'}, + 'node_public_ip_prefix_id': {'key': 'properties.nodePublicIPPrefixID', 'type': 'str'}, + 'scale_set_priority': {'key': 'properties.scaleSetPriority', 'type': 'str'}, + 'scale_set_eviction_policy': {'key': 'properties.scaleSetEvictionPolicy', 'type': 'str'}, + 'spot_max_price': {'key': 'properties.spotMaxPrice', 'type': 'float'}, + 'tags': {'key': 'properties.tags', 'type': '{str}'}, + 'node_labels': {'key': 'properties.nodeLabels', 'type': '{str}'}, + 'node_taints': {'key': 'properties.nodeTaints', 'type': '[str]'}, + 'proximity_placement_group_id': {'key': 'properties.proximityPlacementGroupID', 'type': 'str'}, + 'kubelet_config': {'key': 'properties.kubeletConfig', 'type': 'KubeletConfig'}, + 'linux_os_config': {'key': 'properties.linuxOSConfig', 'type': 'LinuxOSConfig'}, + 'enable_encryption_at_host': {'key': 'properties.enableEncryptionAtHost', 'type': 'bool'}, + 'enable_ultra_ssd': {'key': 'properties.enableUltraSSD', 'type': 'bool'}, + 'enable_fips': {'key': 'properties.enableFIPS', 'type': 'bool'}, + 'gpu_instance_profile': {'key': 'properties.gpuInstanceProfile', 'type': 'str'}, + 'creation_data': {'key': 'properties.creationData', 'type': 'CreationData'}, + } + + def __init__( + self, + **kwargs + ): + super(AgentPool, self).__init__(**kwargs) + self.count = kwargs.get('count', None) + self.vm_size = kwargs.get('vm_size', None) + self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) + self.os_disk_type = kwargs.get('os_disk_type', None) + self.kubelet_disk_type = kwargs.get('kubelet_disk_type', None) + self.workload_runtime = kwargs.get('workload_runtime', None) + self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) + self.pod_subnet_id = kwargs.get('pod_subnet_id', None) + self.max_pods = kwargs.get('max_pods', None) + self.os_type = kwargs.get('os_type', "Linux") + self.os_sku = kwargs.get('os_sku', None) + self.max_count = kwargs.get('max_count', None) + self.min_count = kwargs.get('min_count', None) + self.enable_auto_scaling = kwargs.get('enable_auto_scaling', None) + self.scale_down_mode = kwargs.get('scale_down_mode', None) + self.type_properties_type = kwargs.get('type_properties_type', None) + self.mode = kwargs.get('mode', None) + self.orchestrator_version = kwargs.get('orchestrator_version', None) + self.node_image_version = None + self.upgrade_settings = kwargs.get('upgrade_settings', None) + self.provisioning_state = None + self.power_state = None + self.availability_zones = kwargs.get('availability_zones', None) + self.enable_node_public_ip = kwargs.get('enable_node_public_ip', None) + self.node_public_ip_prefix_id = kwargs.get('node_public_ip_prefix_id', None) + self.scale_set_priority = kwargs.get('scale_set_priority', "Regular") + self.scale_set_eviction_policy = kwargs.get('scale_set_eviction_policy', "Delete") + self.spot_max_price = kwargs.get('spot_max_price', -1) + self.tags = kwargs.get('tags', None) + self.node_labels = kwargs.get('node_labels', None) + self.node_taints = kwargs.get('node_taints', None) + self.proximity_placement_group_id = kwargs.get('proximity_placement_group_id', None) + self.kubelet_config = kwargs.get('kubelet_config', None) + self.linux_os_config = kwargs.get('linux_os_config', None) + self.enable_encryption_at_host = kwargs.get('enable_encryption_at_host', None) + self.enable_ultra_ssd = kwargs.get('enable_ultra_ssd', None) + self.enable_fips = kwargs.get('enable_fips', None) + self.gpu_instance_profile = kwargs.get('gpu_instance_profile', None) + self.creation_data = kwargs.get('creation_data', None) + + +class AgentPoolAvailableVersions(msrest.serialization.Model): + """The list of available versions for an agent pool. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The ID of the agent pool version list. + :vartype id: str + :ivar name: The name of the agent pool version list. + :vartype name: str + :ivar type: Type of the agent pool version list. + :vartype type: str + :param agent_pool_versions: List of versions available for agent pool. + :type agent_pool_versions: + list[~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'agent_pool_versions': {'key': 'properties.agentPoolVersions', 'type': '[AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem]'}, + } + + def __init__( + self, + **kwargs + ): + super(AgentPoolAvailableVersions, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.agent_pool_versions = kwargs.get('agent_pool_versions', None) + + +class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(msrest.serialization.Model): + """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. + + :param default: Whether this version is the default agent pool version. + :type default: bool + :param kubernetes_version: The Kubernetes version (major.minor.patch). + :type kubernetes_version: str + :param is_preview: Whether Kubernetes version is currently in preview. + :type is_preview: bool + """ + + _attribute_map = { + 'default': {'key': 'default', 'type': 'bool'}, + 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, + 'is_preview': {'key': 'isPreview', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem, self).__init__(**kwargs) + self.default = kwargs.get('default', None) + self.kubernetes_version = kwargs.get('kubernetes_version', None) + self.is_preview = kwargs.get('is_preview', None) + + +class AgentPoolListResult(msrest.serialization.Model): + """The response from the List Agent Pools operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: The list of agent pools. + :type value: list[~azure.mgmt.containerservice.v2021_08_01.models.AgentPool] + :ivar next_link: The URL to get the next set of agent pool results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AgentPool]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AgentPoolListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class AgentPoolUpgradeProfile(msrest.serialization.Model): + """The list of available upgrades for an agent pool. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The ID of the agent pool upgrade profile. + :vartype id: str + :ivar name: The name of the agent pool upgrade profile. + :vartype name: str + :ivar type: The type of the agent pool upgrade profile. + :vartype type: str + :param kubernetes_version: Required. The Kubernetes version (major.minor.patch). + :type kubernetes_version: str + :param os_type: Required. The operating system type. The default is Linux. Possible values + include: "Linux", "Windows". Default value: "Linux". + :type os_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSType + :param upgrades: List of orchestrator types and versions available for upgrade. + :type upgrades: + list[~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] + :param latest_node_image_version: The latest AKS supported node image version. + :type latest_node_image_version: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kubernetes_version': {'required': True}, + 'os_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'upgrades': {'key': 'properties.upgrades', 'type': '[AgentPoolUpgradeProfilePropertiesUpgradesItem]'}, + 'latest_node_image_version': {'key': 'properties.latestNodeImageVersion', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AgentPoolUpgradeProfile, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.kubernetes_version = kwargs['kubernetes_version'] + self.os_type = kwargs.get('os_type', "Linux") + self.upgrades = kwargs.get('upgrades', None) + self.latest_node_image_version = kwargs.get('latest_node_image_version', None) + + +class AgentPoolUpgradeProfilePropertiesUpgradesItem(msrest.serialization.Model): + """AgentPoolUpgradeProfilePropertiesUpgradesItem. + + :param kubernetes_version: The Kubernetes version (major.minor.patch). + :type kubernetes_version: str + :param is_preview: Whether the Kubernetes version is currently in preview. + :type is_preview: bool + """ + + _attribute_map = { + 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, + 'is_preview': {'key': 'isPreview', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(AgentPoolUpgradeProfilePropertiesUpgradesItem, self).__init__(**kwargs) + self.kubernetes_version = kwargs.get('kubernetes_version', None) + self.is_preview = kwargs.get('is_preview', None) + + +class AgentPoolUpgradeSettings(msrest.serialization.Model): + """Settings for upgrading an agentpool. + + :param max_surge: This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). + If a percentage is specified, it is the percentage of the total agent pool size at the time of + the upgrade. For percentages, fractional nodes are rounded up. If not specified, the default is + 1. For more information, including best practices, see: + https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade. + :type max_surge: str + """ + + _attribute_map = { + 'max_surge': {'key': 'maxSurge', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AgentPoolUpgradeSettings, self).__init__(**kwargs) + self.max_surge = kwargs.get('max_surge', None) + + +class CloudErrorBody(msrest.serialization.Model): + """An error response from the Container service. + + :param code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable for display in a user + interface. + :type message: str + :param target: The target of the particular error. For example, the name of the property in + error. + :type target: str + :param details: A list of additional details about the error. + :type details: list[~azure.mgmt.containerservice.v2021_08_01.models.CloudErrorBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, + } + + def __init__( + self, + **kwargs + ): + super(CloudErrorBody, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) + self.details = kwargs.get('details', None) + + +class ContainerServiceDiagnosticsProfile(msrest.serialization.Model): + """Profile for diagnostics on the container service cluster. + + All required parameters must be populated in order to send to Azure. + + :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. + :type vm_diagnostics: + ~azure.mgmt.containerservice.v2021_08_01.models.ContainerServiceVMDiagnostics + """ + + _validation = { + 'vm_diagnostics': {'required': True}, + } + + _attribute_map = { + 'vm_diagnostics': {'key': 'vmDiagnostics', 'type': 'ContainerServiceVMDiagnostics'}, + } + + def __init__( + self, + **kwargs + ): + super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) + self.vm_diagnostics = kwargs['vm_diagnostics'] + + +class ContainerServiceLinuxProfile(msrest.serialization.Model): + """Profile for Linux VMs in the container service cluster. + + All required parameters must be populated in order to send to Azure. + + :param admin_username: Required. The administrator username to use for Linux VMs. + :type admin_username: str + :param ssh: Required. The SSH configuration for Linux-based VMs running on Azure. + :type ssh: ~azure.mgmt.containerservice.v2021_08_01.models.ContainerServiceSshConfiguration + """ + + _validation = { + 'admin_username': {'required': True, 'pattern': r'^[A-Za-z][-A-Za-z0-9_]*$'}, + 'ssh': {'required': True}, + } + + _attribute_map = { + 'admin_username': {'key': 'adminUsername', 'type': 'str'}, + 'ssh': {'key': 'ssh', 'type': 'ContainerServiceSshConfiguration'}, + } + + def __init__( + self, + **kwargs + ): + super(ContainerServiceLinuxProfile, self).__init__(**kwargs) + self.admin_username = kwargs['admin_username'] + self.ssh = kwargs['ssh'] + + +class ContainerServiceMasterProfile(msrest.serialization.Model): + """Profile for the container service master. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param count: Number of masters (VMs) in the container service cluster. Allowed values are 1, + 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". + :type count: str or ~azure.mgmt.containerservice.v2021_08_01.models.Count + :param dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. + :type dns_prefix: str + :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", + "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", + "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", + "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", + "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", + "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :type vm_size: str or + ~azure.mgmt.containerservice.v2021_08_01.models.ContainerServiceVMSizeTypes + :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :type os_disk_size_gb: int + :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :type vnet_subnet_id: str + :param first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static + ip of masters. + :type first_consecutive_static_ip: str + :param storage_profile: Storage profile specifies what kind of storage used. Choose from + StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the + orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". + :type storage_profile: str or + ~azure.mgmt.containerservice.v2021_08_01.models.ContainerServiceStorageProfileTypes + :ivar fqdn: FQDN for the master pool. + :vartype fqdn: str + """ + + _validation = { + 'dns_prefix': {'required': True}, + 'vm_size': {'required': True}, + 'os_disk_size_gb': {'maximum': 2048, 'minimum': 0}, + 'fqdn': {'readonly': True}, + } + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + 'dns_prefix': {'key': 'dnsPrefix', 'type': 'str'}, + 'vm_size': {'key': 'vmSize', 'type': 'str'}, + 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, + 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, + 'first_consecutive_static_ip': {'key': 'firstConsecutiveStaticIP', 'type': 'str'}, + 'storage_profile': {'key': 'storageProfile', 'type': 'str'}, + 'fqdn': {'key': 'fqdn', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ContainerServiceMasterProfile, self).__init__(**kwargs) + self.count = kwargs.get('count', "1") + self.dns_prefix = kwargs['dns_prefix'] + self.vm_size = kwargs['vm_size'] + self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) + self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) + self.first_consecutive_static_ip = kwargs.get('first_consecutive_static_ip', "10.240.255.5") + self.storage_profile = kwargs.get('storage_profile', None) + self.fqdn = None + + +class ContainerServiceNetworkProfile(msrest.serialization.Model): + """Profile of network configuration. + + :param network_plugin: Network plugin used for building the Kubernetes network. Possible values + include: "azure", "kubenet". Default value: "kubenet". + :type network_plugin: str or ~azure.mgmt.containerservice.v2021_08_01.models.NetworkPlugin + :param network_policy: Network policy used for building the Kubernetes network. Possible values + include: "calico", "azure". + :type network_policy: str or ~azure.mgmt.containerservice.v2021_08_01.models.NetworkPolicy + :param network_mode: This cannot be specified if networkPlugin is anything other than 'azure'. + Possible values include: "transparent", "bridge". + :type network_mode: str or ~azure.mgmt.containerservice.v2021_08_01.models.NetworkMode + :param pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + :type pod_cidr: str + :param service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must + not overlap with any Subnet IP ranges. + :type service_cidr: str + :param dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within + the Kubernetes service address range specified in serviceCidr. + :type dns_service_ip: str + :param docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It + must not overlap with any Subnet IP ranges or the Kubernetes service address range. + :type docker_bridge_cidr: str + :param outbound_type: This can only be set at cluster creation time and cannot be changed + later. For more information see `egress outbound type + `_. Possible values include: + "loadBalancer", "userDefinedRouting", "managedNATGateway", "userAssignedNATGateway". Default + value: "loadBalancer". + :type outbound_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OutboundType + :param load_balancer_sku: The default is 'standard'. See `Azure Load Balancer SKUs + `_ for more information about the + differences between load balancer SKUs. Possible values include: "standard", "basic". + :type load_balancer_sku: str or ~azure.mgmt.containerservice.v2021_08_01.models.LoadBalancerSku + :param load_balancer_profile: Profile of the cluster load balancer. + :type load_balancer_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterLoadBalancerProfile + :param nat_gateway_profile: Profile of the cluster NAT gateway. + :type nat_gateway_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterNATGatewayProfile + """ + + _validation = { + 'pod_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, + 'service_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, + 'dns_service_ip': {'pattern': r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'}, + 'docker_bridge_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, + } + + _attribute_map = { + 'network_plugin': {'key': 'networkPlugin', 'type': 'str'}, + 'network_policy': {'key': 'networkPolicy', 'type': 'str'}, + 'network_mode': {'key': 'networkMode', 'type': 'str'}, + 'pod_cidr': {'key': 'podCidr', 'type': 'str'}, + 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, + 'dns_service_ip': {'key': 'dnsServiceIP', 'type': 'str'}, + 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, + 'outbound_type': {'key': 'outboundType', 'type': 'str'}, + 'load_balancer_sku': {'key': 'loadBalancerSku', 'type': 'str'}, + 'load_balancer_profile': {'key': 'loadBalancerProfile', 'type': 'ManagedClusterLoadBalancerProfile'}, + 'nat_gateway_profile': {'key': 'natGatewayProfile', 'type': 'ManagedClusterNATGatewayProfile'}, + } + + def __init__( + self, + **kwargs + ): + super(ContainerServiceNetworkProfile, self).__init__(**kwargs) + self.network_plugin = kwargs.get('network_plugin', "kubenet") + self.network_policy = kwargs.get('network_policy', None) + self.network_mode = kwargs.get('network_mode', None) + self.pod_cidr = kwargs.get('pod_cidr', "10.244.0.0/16") + self.service_cidr = kwargs.get('service_cidr', "10.0.0.0/16") + self.dns_service_ip = kwargs.get('dns_service_ip', "10.0.0.10") + self.docker_bridge_cidr = kwargs.get('docker_bridge_cidr', "172.17.0.1/16") + self.outbound_type = kwargs.get('outbound_type', "loadBalancer") + self.load_balancer_sku = kwargs.get('load_balancer_sku', None) + self.load_balancer_profile = kwargs.get('load_balancer_profile', None) + self.nat_gateway_profile = kwargs.get('nat_gateway_profile', None) + + +class ContainerServiceSshConfiguration(msrest.serialization.Model): + """SSH configuration for Linux-based VMs running on Azure. + + All required parameters must be populated in order to send to Azure. + + :param public_keys: Required. The list of SSH public keys used to authenticate with Linux-based + VMs. A maximum of 1 key may be specified. + :type public_keys: + list[~azure.mgmt.containerservice.v2021_08_01.models.ContainerServiceSshPublicKey] + """ + + _validation = { + 'public_keys': {'required': True}, + } + + _attribute_map = { + 'public_keys': {'key': 'publicKeys', 'type': '[ContainerServiceSshPublicKey]'}, + } + + def __init__( + self, + **kwargs + ): + super(ContainerServiceSshConfiguration, self).__init__(**kwargs) + self.public_keys = kwargs['public_keys'] + + +class ContainerServiceSshPublicKey(msrest.serialization.Model): + """Contains information about SSH certificate public key data. + + All required parameters must be populated in order to send to Azure. + + :param key_data: Required. Certificate public key used to authenticate with VMs through SSH. + The certificate must be in PEM format with or without headers. + :type key_data: str + """ + + _validation = { + 'key_data': {'required': True}, + } + + _attribute_map = { + 'key_data': {'key': 'keyData', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ContainerServiceSshPublicKey, self).__init__(**kwargs) + self.key_data = kwargs['key_data'] + + +class ContainerServiceVMDiagnostics(msrest.serialization.Model): + """Profile for diagnostics on the container service VMs. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. + :type enabled: bool + :ivar storage_uri: The URI of the storage account where diagnostics are stored. + :vartype storage_uri: str + """ + + _validation = { + 'enabled': {'required': True}, + 'storage_uri': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'storage_uri': {'key': 'storageUri', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) + self.enabled = kwargs['enabled'] + self.storage_uri = None + + +class CreationData(msrest.serialization.Model): + """Data used when creating a target resource from a source resource. + + :param source_resource_id: This is the ARM ID of the source object to be used to create the + target object. + :type source_resource_id: str + """ + + _attribute_map = { + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CreationData, self).__init__(**kwargs) + self.source_resource_id = kwargs.get('source_resource_id', None) + + +class CredentialResult(msrest.serialization.Model): + """The credential result response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The name of the credential. + :vartype name: str + :ivar value: Base64-encoded Kubernetes configuration file. + :vartype value: bytearray + """ + + _validation = { + 'name': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'bytearray'}, + } + + def __init__( + self, + **kwargs + ): + super(CredentialResult, self).__init__(**kwargs) + self.name = None + self.value = None + + +class CredentialResults(msrest.serialization.Model): + """The list credential result response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar kubeconfigs: Base64-encoded Kubernetes configuration file. + :vartype kubeconfigs: list[~azure.mgmt.containerservice.v2021_08_01.models.CredentialResult] + """ + + _validation = { + 'kubeconfigs': {'readonly': True}, + } + + _attribute_map = { + 'kubeconfigs': {'key': 'kubeconfigs', 'type': '[CredentialResult]'}, + } + + def __init__( + self, + **kwargs + ): + super(CredentialResults, self).__init__(**kwargs) + self.kubeconfigs = None + + +class EndpointDependency(msrest.serialization.Model): + """A domain name that AKS agent nodes are reaching at. + + :param domain_name: The domain name of the dependency. + :type domain_name: str + :param endpoint_details: The Ports and Protocols used when connecting to domainName. + :type endpoint_details: list[~azure.mgmt.containerservice.v2021_08_01.models.EndpointDetail] + """ + + _attribute_map = { + 'domain_name': {'key': 'domainName', 'type': 'str'}, + 'endpoint_details': {'key': 'endpointDetails', 'type': '[EndpointDetail]'}, + } + + def __init__( + self, + **kwargs + ): + super(EndpointDependency, self).__init__(**kwargs) + self.domain_name = kwargs.get('domain_name', None) + self.endpoint_details = kwargs.get('endpoint_details', None) + + +class EndpointDetail(msrest.serialization.Model): + """connect information from the AKS agent nodes to a single endpoint. + + :param ip_address: An IP Address that Domain Name currently resolves to. + :type ip_address: str + :param port: The port an endpoint is connected to. + :type port: int + :param protocol: The protocol used for connection. + :type protocol: str + :param description: Description of the detail. + :type description: str + """ + + _attribute_map = { + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EndpointDetail, self).__init__(**kwargs) + self.ip_address = kwargs.get('ip_address', None) + self.port = kwargs.get('port', None) + self.protocol = kwargs.get('protocol', None) + self.description = kwargs.get('description', None) + + +class ExtendedLocation(msrest.serialization.Model): + """The complex type of the extended location. + + :param name: The name of the extended location. + :type name: str + :param type: The type of the extended location. Possible values include: "EdgeZone". + :type type: str or ~azure.mgmt.containerservice.v2021_08_01.models.ExtendedLocationTypes + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExtendedLocation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + + +class KubeletConfig(msrest.serialization.Model): + """See `AKS custom node configuration `_ for more details. + + :param cpu_manager_policy: The default is 'none'. See `Kubernetes CPU management policies + `_ + for more information. Allowed values are 'none' and 'static'. + :type cpu_manager_policy: str + :param cpu_cfs_quota: The default is true. + :type cpu_cfs_quota: bool + :param cpu_cfs_quota_period: The default is '100ms.' Valid values are a sequence of decimal + numbers with an optional fraction and a unit suffix. For example: '300ms', '2h45m'. Supported + units are 'ns', 'us', 'ms', 's', 'm', and 'h'. + :type cpu_cfs_quota_period: str + :param image_gc_high_threshold: To disable image garbage collection, set to 100. The default is + 85%. + :type image_gc_high_threshold: int + :param image_gc_low_threshold: This cannot be set higher than imageGcHighThreshold. The default + is 80%. + :type image_gc_low_threshold: int + :param topology_manager_policy: For more information see `Kubernetes Topology Manager + `_. The default is + 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. + :type topology_manager_policy: str + :param allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending + in ``*``\ ). + :type allowed_unsafe_sysctls: list[str] + :param fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled + on the node. + :type fail_swap_on: bool + :param container_log_max_size_mb: The maximum size (e.g. 10Mi) of container log file before it + is rotated. + :type container_log_max_size_mb: int + :param container_log_max_files: The maximum number of container log files that can be present + for a container. The number must be ≥ 2. + :type container_log_max_files: int + :param pod_max_pids: The maximum number of processes per pod. + :type pod_max_pids: int + """ + + _validation = { + 'container_log_max_files': {'minimum': 2}, + } + + _attribute_map = { + 'cpu_manager_policy': {'key': 'cpuManagerPolicy', 'type': 'str'}, + 'cpu_cfs_quota': {'key': 'cpuCfsQuota', 'type': 'bool'}, + 'cpu_cfs_quota_period': {'key': 'cpuCfsQuotaPeriod', 'type': 'str'}, + 'image_gc_high_threshold': {'key': 'imageGcHighThreshold', 'type': 'int'}, + 'image_gc_low_threshold': {'key': 'imageGcLowThreshold', 'type': 'int'}, + 'topology_manager_policy': {'key': 'topologyManagerPolicy', 'type': 'str'}, + 'allowed_unsafe_sysctls': {'key': 'allowedUnsafeSysctls', 'type': '[str]'}, + 'fail_swap_on': {'key': 'failSwapOn', 'type': 'bool'}, + 'container_log_max_size_mb': {'key': 'containerLogMaxSizeMB', 'type': 'int'}, + 'container_log_max_files': {'key': 'containerLogMaxFiles', 'type': 'int'}, + 'pod_max_pids': {'key': 'podMaxPids', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(KubeletConfig, self).__init__(**kwargs) + self.cpu_manager_policy = kwargs.get('cpu_manager_policy', None) + self.cpu_cfs_quota = kwargs.get('cpu_cfs_quota', None) + self.cpu_cfs_quota_period = kwargs.get('cpu_cfs_quota_period', None) + self.image_gc_high_threshold = kwargs.get('image_gc_high_threshold', None) + self.image_gc_low_threshold = kwargs.get('image_gc_low_threshold', None) + self.topology_manager_policy = kwargs.get('topology_manager_policy', None) + self.allowed_unsafe_sysctls = kwargs.get('allowed_unsafe_sysctls', None) + self.fail_swap_on = kwargs.get('fail_swap_on', None) + self.container_log_max_size_mb = kwargs.get('container_log_max_size_mb', None) + self.container_log_max_files = kwargs.get('container_log_max_files', None) + self.pod_max_pids = kwargs.get('pod_max_pids', None) + + +class LinuxOSConfig(msrest.serialization.Model): + """See `AKS custom node configuration `_ for more details. + + :param sysctls: Sysctl settings for Linux agent nodes. + :type sysctls: ~azure.mgmt.containerservice.v2021_08_01.models.SysctlConfig + :param transparent_huge_page_enabled: Valid values are 'always', 'madvise', and 'never'. The + default is 'always'. For more information see `Transparent Hugepages + `_. + :type transparent_huge_page_enabled: str + :param transparent_huge_page_defrag: Valid values are 'always', 'defer', 'defer+madvise', + 'madvise' and 'never'. The default is 'madvise'. For more information see `Transparent + Hugepages + `_. + :type transparent_huge_page_defrag: str + :param swap_file_size_mb: The size in MB of a swap file that will be created on each node. + :type swap_file_size_mb: int + """ + + _attribute_map = { + 'sysctls': {'key': 'sysctls', 'type': 'SysctlConfig'}, + 'transparent_huge_page_enabled': {'key': 'transparentHugePageEnabled', 'type': 'str'}, + 'transparent_huge_page_defrag': {'key': 'transparentHugePageDefrag', 'type': 'str'}, + 'swap_file_size_mb': {'key': 'swapFileSizeMB', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(LinuxOSConfig, self).__init__(**kwargs) + self.sysctls = kwargs.get('sysctls', None) + self.transparent_huge_page_enabled = kwargs.get('transparent_huge_page_enabled', None) + self.transparent_huge_page_defrag = kwargs.get('transparent_huge_page_defrag', None) + self.swap_file_size_mb = kwargs.get('swap_file_size_mb', None) + + +class MaintenanceConfiguration(SubResource): + """See `planned maintenance `_ for more information about planned maintenance. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.containerservice.v2021_08_01.models.SystemData + :param time_in_week: If two array entries specify the same day of the week, the applied + configuration is the union of times in both entries. + :type time_in_week: list[~azure.mgmt.containerservice.v2021_08_01.models.TimeInWeek] + :param not_allowed_time: Time slots on which upgrade is not allowed. + :type not_allowed_time: list[~azure.mgmt.containerservice.v2021_08_01.models.TimeSpan] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'time_in_week': {'key': 'properties.timeInWeek', 'type': '[TimeInWeek]'}, + 'not_allowed_time': {'key': 'properties.notAllowedTime', 'type': '[TimeSpan]'}, + } + + def __init__( + self, + **kwargs + ): + super(MaintenanceConfiguration, self).__init__(**kwargs) + self.system_data = None + self.time_in_week = kwargs.get('time_in_week', None) + self.not_allowed_time = kwargs.get('not_allowed_time', None) + + +class MaintenanceConfigurationListResult(msrest.serialization.Model): + """The response from the List maintenance configurations operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: The list of maintenance configurations. + :type value: list[~azure.mgmt.containerservice.v2021_08_01.models.MaintenanceConfiguration] + :ivar next_link: The URL to get the next set of maintenance configuration results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[MaintenanceConfiguration]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MaintenanceConfigurationListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class Resource(msrest.serialization.Model): + """The Resource model definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = kwargs['location'] + self.tags = kwargs.get('tags', None) + + +class ManagedCluster(Resource): + """Managed cluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param sku: The managed cluster SKU. + :type sku: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterSKU + :param extended_location: The extended location of the Virtual Machine. + :type extended_location: ~azure.mgmt.containerservice.v2021_08_01.models.ExtendedLocation + :param identity: The identity of the managed cluster, if configured. + :type identity: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterIdentity + :ivar provisioning_state: The current provisioning state. + :vartype provisioning_state: str + :ivar power_state: The Power State of the cluster. + :vartype power_state: ~azure.mgmt.containerservice.v2021_08_01.models.PowerState + :ivar max_agent_pools: The max number of agent pools for the managed cluster. + :vartype max_agent_pools: int + :param kubernetes_version: When you upgrade a supported AKS cluster, Kubernetes minor versions + cannot be skipped. All upgrades must be performed sequentially by major version number. For + example, upgrades between 1.14.x -> 1.15.x or 1.15.x -> 1.16.x are allowed, however 1.14.x -> + 1.16.x is not allowed. See `upgrading an AKS cluster + `_ for more details. + :type kubernetes_version: str + :param dns_prefix: This cannot be updated once the Managed Cluster has been created. + :type dns_prefix: str + :param fqdn_subdomain: This cannot be updated once the Managed Cluster has been created. + :type fqdn_subdomain: str + :ivar fqdn: The FQDN of the master pool. + :vartype fqdn: str + :ivar private_fqdn: The FQDN of private cluster. + :vartype private_fqdn: str + :ivar azure_portal_fqdn: The Azure Portal requires certain Cross-Origin Resource Sharing (CORS) + headers to be sent in some responses, which Kubernetes APIServer doesn't handle by default. + This special FQDN supports CORS, allowing the Azure Portal to function properly. + :vartype azure_portal_fqdn: str + :param agent_pool_profiles: The agent pool properties. + :type agent_pool_profiles: + list[~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterAgentPoolProfile] + :param linux_profile: The profile for Linux VMs in the Managed Cluster. + :type linux_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ContainerServiceLinuxProfile + :param windows_profile: The profile for Windows VMs in the Managed Cluster. + :type windows_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterWindowsProfile + :param service_principal_profile: Information about a service principal identity for the + cluster to use for manipulating Azure APIs. + :type service_principal_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterServicePrincipalProfile + :param addon_profiles: The profile of managed cluster add-on. + :type addon_profiles: dict[str, + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterAddonProfile] + :param pod_identity_profile: See `use AAD pod identity + `_ for more details on AAD pod + identity integration. + :type pod_identity_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPodIdentityProfile + :param node_resource_group: The name of the resource group containing agent pool nodes. + :type node_resource_group: str + :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :type enable_rbac: bool + :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + policy (preview). This feature is set for removal on October 15th, 2020. Learn more at + aka.ms/aks/azpodpolicy. + :type enable_pod_security_policy: bool + :param network_profile: The network configuration profile. + :type network_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ContainerServiceNetworkProfile + :param aad_profile: The Azure Active Directory configuration. + :type aad_profile: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterAADProfile + :param auto_upgrade_profile: The auto upgrade configuration. + :type auto_upgrade_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterAutoUpgradeProfile + :param auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. + :type auto_scaler_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPropertiesAutoScalerProfile + :param api_server_access_profile: The access profile for managed cluster API server. + :type api_server_access_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterAPIServerAccessProfile + :param disk_encryption_set_id: This is of the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'. + :type disk_encryption_set_id: str + :param identity_profile: Identities associated with the cluster. + :type identity_profile: dict[str, + ~azure.mgmt.containerservice.v2021_08_01.models.UserAssignedIdentity] + :param private_link_resources: Private link resources associated with the cluster. + :type private_link_resources: + list[~azure.mgmt.containerservice.v2021_08_01.models.PrivateLinkResource] + :param disable_local_accounts: If set to true, getting static credentials will be disabled for + this cluster. This must only be used on Managed Clusters that are AAD enabled. For more details + see `disable local accounts + `_. + :type disable_local_accounts: bool + :param http_proxy_config: Configurations for provisioning the cluster with HTTP proxy servers. + :type http_proxy_config: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterHTTPProxyConfig + :param security_profile: Security profile for the managed cluster. + :type security_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterSecurityProfile + :param public_network_access: Default value is 'Enabled' (case insensitive). Could be set to + 'Disabled' to enable private cluster. Possible values include: "Enabled", "Disabled". + :type public_network_access: str or + ~azure.mgmt.containerservice.v2021_08_01.models.PublicNetworkAccess + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'power_state': {'readonly': True}, + 'max_agent_pools': {'readonly': True}, + 'fqdn': {'readonly': True}, + 'private_fqdn': {'readonly': True}, + 'azure_portal_fqdn': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'ManagedClusterSKU'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'identity': {'key': 'identity', 'type': 'ManagedClusterIdentity'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'power_state': {'key': 'properties.powerState', 'type': 'PowerState'}, + 'max_agent_pools': {'key': 'properties.maxAgentPools', 'type': 'int'}, + 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, + 'dns_prefix': {'key': 'properties.dnsPrefix', 'type': 'str'}, + 'fqdn_subdomain': {'key': 'properties.fqdnSubdomain', 'type': 'str'}, + 'fqdn': {'key': 'properties.fqdn', 'type': 'str'}, + 'private_fqdn': {'key': 'properties.privateFQDN', 'type': 'str'}, + 'azure_portal_fqdn': {'key': 'properties.azurePortalFQDN', 'type': 'str'}, + 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterAgentPoolProfile]'}, + 'linux_profile': {'key': 'properties.linuxProfile', 'type': 'ContainerServiceLinuxProfile'}, + 'windows_profile': {'key': 'properties.windowsProfile', 'type': 'ManagedClusterWindowsProfile'}, + 'service_principal_profile': {'key': 'properties.servicePrincipalProfile', 'type': 'ManagedClusterServicePrincipalProfile'}, + 'addon_profiles': {'key': 'properties.addonProfiles', 'type': '{ManagedClusterAddonProfile}'}, + 'pod_identity_profile': {'key': 'properties.podIdentityProfile', 'type': 'ManagedClusterPodIdentityProfile'}, + 'node_resource_group': {'key': 'properties.nodeResourceGroup', 'type': 'str'}, + 'enable_rbac': {'key': 'properties.enableRBAC', 'type': 'bool'}, + 'enable_pod_security_policy': {'key': 'properties.enablePodSecurityPolicy', 'type': 'bool'}, + 'network_profile': {'key': 'properties.networkProfile', 'type': 'ContainerServiceNetworkProfile'}, + 'aad_profile': {'key': 'properties.aadProfile', 'type': 'ManagedClusterAADProfile'}, + 'auto_upgrade_profile': {'key': 'properties.autoUpgradeProfile', 'type': 'ManagedClusterAutoUpgradeProfile'}, + 'auto_scaler_profile': {'key': 'properties.autoScalerProfile', 'type': 'ManagedClusterPropertiesAutoScalerProfile'}, + 'api_server_access_profile': {'key': 'properties.apiServerAccessProfile', 'type': 'ManagedClusterAPIServerAccessProfile'}, + 'disk_encryption_set_id': {'key': 'properties.diskEncryptionSetID', 'type': 'str'}, + 'identity_profile': {'key': 'properties.identityProfile', 'type': '{UserAssignedIdentity}'}, + 'private_link_resources': {'key': 'properties.privateLinkResources', 'type': '[PrivateLinkResource]'}, + 'disable_local_accounts': {'key': 'properties.disableLocalAccounts', 'type': 'bool'}, + 'http_proxy_config': {'key': 'properties.httpProxyConfig', 'type': 'ManagedClusterHTTPProxyConfig'}, + 'security_profile': {'key': 'properties.securityProfile', 'type': 'ManagedClusterSecurityProfile'}, + 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedCluster, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.extended_location = kwargs.get('extended_location', None) + self.identity = kwargs.get('identity', None) + self.provisioning_state = None + self.power_state = None + self.max_agent_pools = None + self.kubernetes_version = kwargs.get('kubernetes_version', None) + self.dns_prefix = kwargs.get('dns_prefix', None) + self.fqdn_subdomain = kwargs.get('fqdn_subdomain', None) + self.fqdn = None + self.private_fqdn = None + self.azure_portal_fqdn = None + self.agent_pool_profiles = kwargs.get('agent_pool_profiles', None) + self.linux_profile = kwargs.get('linux_profile', None) + self.windows_profile = kwargs.get('windows_profile', None) + self.service_principal_profile = kwargs.get('service_principal_profile', None) + self.addon_profiles = kwargs.get('addon_profiles', None) + self.pod_identity_profile = kwargs.get('pod_identity_profile', None) + self.node_resource_group = kwargs.get('node_resource_group', None) + self.enable_rbac = kwargs.get('enable_rbac', None) + self.enable_pod_security_policy = kwargs.get('enable_pod_security_policy', None) + self.network_profile = kwargs.get('network_profile', None) + self.aad_profile = kwargs.get('aad_profile', None) + self.auto_upgrade_profile = kwargs.get('auto_upgrade_profile', None) + self.auto_scaler_profile = kwargs.get('auto_scaler_profile', None) + self.api_server_access_profile = kwargs.get('api_server_access_profile', None) + self.disk_encryption_set_id = kwargs.get('disk_encryption_set_id', None) + self.identity_profile = kwargs.get('identity_profile', None) + self.private_link_resources = kwargs.get('private_link_resources', None) + self.disable_local_accounts = kwargs.get('disable_local_accounts', None) + self.http_proxy_config = kwargs.get('http_proxy_config', None) + self.security_profile = kwargs.get('security_profile', None) + self.public_network_access = kwargs.get('public_network_access', None) + + +class ManagedClusterAADProfile(msrest.serialization.Model): + """For more details see `managed AAD on AKS `_. + + :param managed: Whether to enable managed AAD. + :type managed: bool + :param enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. + :type enable_azure_rbac: bool + :param admin_group_object_i_ds: The list of AAD group object IDs that will have admin role of + the cluster. + :type admin_group_object_i_ds: list[str] + :param client_app_id: The client AAD application ID. + :type client_app_id: str + :param server_app_id: The server AAD application ID. + :type server_app_id: str + :param server_app_secret: The server AAD application secret. + :type server_app_secret: str + :param tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + tenant of the deployment subscription. + :type tenant_id: str + """ + + _attribute_map = { + 'managed': {'key': 'managed', 'type': 'bool'}, + 'enable_azure_rbac': {'key': 'enableAzureRBAC', 'type': 'bool'}, + 'admin_group_object_i_ds': {'key': 'adminGroupObjectIDs', 'type': '[str]'}, + 'client_app_id': {'key': 'clientAppID', 'type': 'str'}, + 'server_app_id': {'key': 'serverAppID', 'type': 'str'}, + 'server_app_secret': {'key': 'serverAppSecret', 'type': 'str'}, + 'tenant_id': {'key': 'tenantID', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterAADProfile, self).__init__(**kwargs) + self.managed = kwargs.get('managed', None) + self.enable_azure_rbac = kwargs.get('enable_azure_rbac', None) + self.admin_group_object_i_ds = kwargs.get('admin_group_object_i_ds', None) + self.client_app_id = kwargs.get('client_app_id', None) + self.server_app_id = kwargs.get('server_app_id', None) + self.server_app_secret = kwargs.get('server_app_secret', None) + self.tenant_id = kwargs.get('tenant_id', None) + + +class ManagedClusterAccessProfile(Resource): + """Managed cluster Access Profile. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param kube_config: Base64-encoded Kubernetes configuration file. + :type kube_config: bytearray + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'kube_config': {'key': 'properties.kubeConfig', 'type': 'bytearray'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterAccessProfile, self).__init__(**kwargs) + self.kube_config = kwargs.get('kube_config', None) + + +class ManagedClusterAddonProfile(msrest.serialization.Model): + """A Kubernetes add-on profile for a managed cluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. Whether the add-on is enabled or not. + :type enabled: bool + :param config: Key-value pairs for configuring an add-on. + :type config: dict[str, str] + :ivar identity: Information of user assigned identity used by this add-on. + :vartype identity: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterAddonProfileIdentity + """ + + _validation = { + 'enabled': {'required': True}, + 'identity': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'config': {'key': 'config', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'ManagedClusterAddonProfileIdentity'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterAddonProfile, self).__init__(**kwargs) + self.enabled = kwargs['enabled'] + self.config = kwargs.get('config', None) + self.identity = None + + +class UserAssignedIdentity(msrest.serialization.Model): + """Details about a user assigned identity. + + :param resource_id: The resource ID of the user assigned identity. + :type resource_id: str + :param client_id: The client ID of the user assigned identity. + :type client_id: str + :param object_id: The object ID of the user assigned identity. + :type object_id: str + """ + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'object_id': {'key': 'objectId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UserAssignedIdentity, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) + self.client_id = kwargs.get('client_id', None) + self.object_id = kwargs.get('object_id', None) + + +class ManagedClusterAddonProfileIdentity(UserAssignedIdentity): + """Information of user assigned identity used by this add-on. + + :param resource_id: The resource ID of the user assigned identity. + :type resource_id: str + :param client_id: The client ID of the user assigned identity. + :type client_id: str + :param object_id: The object ID of the user assigned identity. + :type object_id: str + """ + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'object_id': {'key': 'objectId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterAddonProfileIdentity, self).__init__(**kwargs) + + +class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): + """Properties for the container service agent pool profile. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for + system pools. The default value is 1. + :type count: int + :param vm_size: VM size availability varies by region. If a node contains insufficient compute + resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted + VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + :type vm_size: str + :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in the master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :type os_disk_size_gb: int + :param os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk + larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed + after creation. For more information see `Ephemeral OS + `_. Possible values + include: "Managed", "Ephemeral". + :type os_disk_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSDiskType + :param kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data + root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". + :type kubelet_disk_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.KubeletDiskType + :param workload_runtime: Determines the type of workload a node can run. Possible values + include: "OCIContainer", "WasmWasi". + :type workload_runtime: str or ~azure.mgmt.containerservice.v2021_08_01.models.WorkloadRuntime + :param vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. + If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just + nodes. This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :type vnet_subnet_id: str + :param pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see + vnetSubnetID for more details). This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :type pod_subnet_id: str + :param max_pods: The maximum number of pods that can run on a node. + :type max_pods: int + :param os_type: The operating system type. The default is Linux. Possible values include: + "Linux", "Windows". Default value: "Linux". + :type os_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSType + :param os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. + Possible values include: "Ubuntu", "CBLMariner". + :type os_sku: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSSKU + :param max_count: The maximum number of nodes for auto-scaling. + :type max_count: int + :param min_count: The minimum number of nodes for auto-scaling. + :type min_count: int + :param enable_auto_scaling: Whether to enable auto-scaler. + :type enable_auto_scaling: bool + :param scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it + defaults to Delete. Possible values include: "Delete", "Deallocate". + :type scale_down_mode: str or ~azure.mgmt.containerservice.v2021_08_01.models.ScaleDownMode + :param type: The type of Agent Pool. Possible values include: "VirtualMachineScaleSets", + "AvailabilitySet". + :type type: str or ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolType + :param mode: A cluster must have at least one 'System' Agent Pool at all times. For additional + information on agent pool restrictions and best practices, see: + https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", + "User". + :type mode: str or ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolMode + :param orchestrator_version: As a best practice, you should upgrade all node pools in an AKS + cluster to the same Kubernetes version. The node pool version must have the same major version + as the control plane. The node pool minor version must be within two minor versions of the + control plane version. The node pool version cannot be greater than the control plane version. + For more information see `upgrading a node pool + `_. + :type orchestrator_version: str + :ivar node_image_version: The version of node image. + :vartype node_image_version: str + :param upgrade_settings: Settings for upgrading the agentpool. + :type upgrade_settings: + ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolUpgradeSettings + :ivar provisioning_state: The current deployment or provisioning state. + :vartype provisioning_state: str + :ivar power_state: Describes whether the Agent Pool is Running or Stopped. + :vartype power_state: ~azure.mgmt.containerservice.v2021_08_01.models.PowerState + :param availability_zones: The list of Availability zones to use for nodes. This can only be + specified if the AgentPoolType property is 'VirtualMachineScaleSets'. + :type availability_zones: list[str] + :param enable_node_public_ip: Some scenarios may require nodes in a node pool to receive their + own dedicated public IP addresses. A common scenario is for gaming workloads, where a console + needs to make a direct connection to a cloud virtual machine to minimize hops. For more + information see `assigning a public IP per node + `_. + The default is false. + :type enable_node_public_ip: bool + :param node_public_ip_prefix_id: This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. + :type node_public_ip_prefix_id: str + :param scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the + default is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". + :type scale_set_priority: str or + ~azure.mgmt.containerservice.v2021_08_01.models.ScaleSetPriority + :param scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is + 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", + "Deallocate". Default value: "Delete". + :type scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2021_08_01.models.ScaleSetEvictionPolicy + :param spot_max_price: Possible values are any decimal value greater than zero or -1 which + indicates the willingness to pay any on-demand price. For more details on spot pricing, see + `spot VMs pricing `_. + :type spot_max_price: float + :param tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale + set. + :type tags: dict[str, str] + :param node_labels: The node labels to be persisted across all nodes in agent pool. + :type node_labels: dict[str, str] + :param node_taints: The taints added to new nodes during node pool create and scale. For + example, key=value:NoSchedule. + :type node_taints: list[str] + :param proximity_placement_group_id: The ID for Proximity Placement Group. + :type proximity_placement_group_id: str + :param kubelet_config: The Kubelet configuration on the agent pool nodes. + :type kubelet_config: ~azure.mgmt.containerservice.v2021_08_01.models.KubeletConfig + :param linux_os_config: The OS configuration of Linux agent nodes. + :type linux_os_config: ~azure.mgmt.containerservice.v2021_08_01.models.LinuxOSConfig + :param enable_encryption_at_host: This is only supported on certain VM sizes and in certain + Azure regions. For more information, see: + https://docs.microsoft.com/azure/aks/enable-host-encryption. + :type enable_encryption_at_host: bool + :param enable_ultra_ssd: Whether to enable UltraSSD. + :type enable_ultra_ssd: bool + :param enable_fips: See `Add a FIPS-enabled node pool + `_ + for more details. + :type enable_fips: bool + :param gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile + for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", "MIG7g". + :type gpu_instance_profile: str or + ~azure.mgmt.containerservice.v2021_08_01.models.GPUInstanceProfile + :param creation_data: CreationData to be used to specify the source Snapshot ID if the node + pool will be created/upgraded using a snapshot. + :type creation_data: ~azure.mgmt.containerservice.v2021_08_01.models.CreationData + """ + + _validation = { + 'os_disk_size_gb': {'maximum': 2048, 'minimum': 0}, + 'node_image_version': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'power_state': {'readonly': True}, + } + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + 'vm_size': {'key': 'vmSize', 'type': 'str'}, + 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, + 'os_disk_type': {'key': 'osDiskType', 'type': 'str'}, + 'kubelet_disk_type': {'key': 'kubeletDiskType', 'type': 'str'}, + 'workload_runtime': {'key': 'workloadRuntime', 'type': 'str'}, + 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, + 'pod_subnet_id': {'key': 'podSubnetID', 'type': 'str'}, + 'max_pods': {'key': 'maxPods', 'type': 'int'}, + 'os_type': {'key': 'osType', 'type': 'str'}, + 'os_sku': {'key': 'osSKU', 'type': 'str'}, + 'max_count': {'key': 'maxCount', 'type': 'int'}, + 'min_count': {'key': 'minCount', 'type': 'int'}, + 'enable_auto_scaling': {'key': 'enableAutoScaling', 'type': 'bool'}, + 'scale_down_mode': {'key': 'scaleDownMode', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'mode': {'key': 'mode', 'type': 'str'}, + 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, + 'node_image_version': {'key': 'nodeImageVersion', 'type': 'str'}, + 'upgrade_settings': {'key': 'upgradeSettings', 'type': 'AgentPoolUpgradeSettings'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'power_state': {'key': 'powerState', 'type': 'PowerState'}, + 'availability_zones': {'key': 'availabilityZones', 'type': '[str]'}, + 'enable_node_public_ip': {'key': 'enableNodePublicIP', 'type': 'bool'}, + 'node_public_ip_prefix_id': {'key': 'nodePublicIPPrefixID', 'type': 'str'}, + 'scale_set_priority': {'key': 'scaleSetPriority', 'type': 'str'}, + 'scale_set_eviction_policy': {'key': 'scaleSetEvictionPolicy', 'type': 'str'}, + 'spot_max_price': {'key': 'spotMaxPrice', 'type': 'float'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'node_labels': {'key': 'nodeLabels', 'type': '{str}'}, + 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, + 'proximity_placement_group_id': {'key': 'proximityPlacementGroupID', 'type': 'str'}, + 'kubelet_config': {'key': 'kubeletConfig', 'type': 'KubeletConfig'}, + 'linux_os_config': {'key': 'linuxOSConfig', 'type': 'LinuxOSConfig'}, + 'enable_encryption_at_host': {'key': 'enableEncryptionAtHost', 'type': 'bool'}, + 'enable_ultra_ssd': {'key': 'enableUltraSSD', 'type': 'bool'}, + 'enable_fips': {'key': 'enableFIPS', 'type': 'bool'}, + 'gpu_instance_profile': {'key': 'gpuInstanceProfile', 'type': 'str'}, + 'creation_data': {'key': 'creationData', 'type': 'CreationData'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) + self.count = kwargs.get('count', None) + self.vm_size = kwargs.get('vm_size', None) + self.os_disk_size_gb = kwargs.get('os_disk_size_gb', None) + self.os_disk_type = kwargs.get('os_disk_type', None) + self.kubelet_disk_type = kwargs.get('kubelet_disk_type', None) + self.workload_runtime = kwargs.get('workload_runtime', None) + self.vnet_subnet_id = kwargs.get('vnet_subnet_id', None) + self.pod_subnet_id = kwargs.get('pod_subnet_id', None) + self.max_pods = kwargs.get('max_pods', None) + self.os_type = kwargs.get('os_type', "Linux") + self.os_sku = kwargs.get('os_sku', None) + self.max_count = kwargs.get('max_count', None) + self.min_count = kwargs.get('min_count', None) + self.enable_auto_scaling = kwargs.get('enable_auto_scaling', None) + self.scale_down_mode = kwargs.get('scale_down_mode', None) + self.type = kwargs.get('type', None) + self.mode = kwargs.get('mode', None) + self.orchestrator_version = kwargs.get('orchestrator_version', None) + self.node_image_version = None + self.upgrade_settings = kwargs.get('upgrade_settings', None) + self.provisioning_state = None + self.power_state = None + self.availability_zones = kwargs.get('availability_zones', None) + self.enable_node_public_ip = kwargs.get('enable_node_public_ip', None) + self.node_public_ip_prefix_id = kwargs.get('node_public_ip_prefix_id', None) + self.scale_set_priority = kwargs.get('scale_set_priority', "Regular") + self.scale_set_eviction_policy = kwargs.get('scale_set_eviction_policy', "Delete") + self.spot_max_price = kwargs.get('spot_max_price', -1) + self.tags = kwargs.get('tags', None) + self.node_labels = kwargs.get('node_labels', None) + self.node_taints = kwargs.get('node_taints', None) + self.proximity_placement_group_id = kwargs.get('proximity_placement_group_id', None) + self.kubelet_config = kwargs.get('kubelet_config', None) + self.linux_os_config = kwargs.get('linux_os_config', None) + self.enable_encryption_at_host = kwargs.get('enable_encryption_at_host', None) + self.enable_ultra_ssd = kwargs.get('enable_ultra_ssd', None) + self.enable_fips = kwargs.get('enable_fips', None) + self.gpu_instance_profile = kwargs.get('gpu_instance_profile', None) + self.creation_data = kwargs.get('creation_data', None) + + +class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): + """Profile for the container service agent pool. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for + system pools. The default value is 1. + :type count: int + :param vm_size: VM size availability varies by region. If a node contains insufficient compute + resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted + VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + :type vm_size: str + :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in the master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :type os_disk_size_gb: int + :param os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk + larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed + after creation. For more information see `Ephemeral OS + `_. Possible values + include: "Managed", "Ephemeral". + :type os_disk_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSDiskType + :param kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data + root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". + :type kubelet_disk_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.KubeletDiskType + :param workload_runtime: Determines the type of workload a node can run. Possible values + include: "OCIContainer", "WasmWasi". + :type workload_runtime: str or ~azure.mgmt.containerservice.v2021_08_01.models.WorkloadRuntime + :param vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. + If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just + nodes. This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :type vnet_subnet_id: str + :param pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see + vnetSubnetID for more details). This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :type pod_subnet_id: str + :param max_pods: The maximum number of pods that can run on a node. + :type max_pods: int + :param os_type: The operating system type. The default is Linux. Possible values include: + "Linux", "Windows". Default value: "Linux". + :type os_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSType + :param os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. + Possible values include: "Ubuntu", "CBLMariner". + :type os_sku: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSSKU + :param max_count: The maximum number of nodes for auto-scaling. + :type max_count: int + :param min_count: The minimum number of nodes for auto-scaling. + :type min_count: int + :param enable_auto_scaling: Whether to enable auto-scaler. + :type enable_auto_scaling: bool + :param scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it + defaults to Delete. Possible values include: "Delete", "Deallocate". + :type scale_down_mode: str or ~azure.mgmt.containerservice.v2021_08_01.models.ScaleDownMode + :param type: The type of Agent Pool. Possible values include: "VirtualMachineScaleSets", + "AvailabilitySet". + :type type: str or ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolType + :param mode: A cluster must have at least one 'System' Agent Pool at all times. For additional + information on agent pool restrictions and best practices, see: + https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", + "User". + :type mode: str or ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolMode + :param orchestrator_version: As a best practice, you should upgrade all node pools in an AKS + cluster to the same Kubernetes version. The node pool version must have the same major version + as the control plane. The node pool minor version must be within two minor versions of the + control plane version. The node pool version cannot be greater than the control plane version. + For more information see `upgrading a node pool + `_. + :type orchestrator_version: str + :ivar node_image_version: The version of node image. + :vartype node_image_version: str + :param upgrade_settings: Settings for upgrading the agentpool. + :type upgrade_settings: + ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolUpgradeSettings + :ivar provisioning_state: The current deployment or provisioning state. + :vartype provisioning_state: str + :ivar power_state: Describes whether the Agent Pool is Running or Stopped. + :vartype power_state: ~azure.mgmt.containerservice.v2021_08_01.models.PowerState + :param availability_zones: The list of Availability zones to use for nodes. This can only be + specified if the AgentPoolType property is 'VirtualMachineScaleSets'. + :type availability_zones: list[str] + :param enable_node_public_ip: Some scenarios may require nodes in a node pool to receive their + own dedicated public IP addresses. A common scenario is for gaming workloads, where a console + needs to make a direct connection to a cloud virtual machine to minimize hops. For more + information see `assigning a public IP per node + `_. + The default is false. + :type enable_node_public_ip: bool + :param node_public_ip_prefix_id: This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. + :type node_public_ip_prefix_id: str + :param scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the + default is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". + :type scale_set_priority: str or + ~azure.mgmt.containerservice.v2021_08_01.models.ScaleSetPriority + :param scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is + 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", + "Deallocate". Default value: "Delete". + :type scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2021_08_01.models.ScaleSetEvictionPolicy + :param spot_max_price: Possible values are any decimal value greater than zero or -1 which + indicates the willingness to pay any on-demand price. For more details on spot pricing, see + `spot VMs pricing `_. + :type spot_max_price: float + :param tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale + set. + :type tags: dict[str, str] + :param node_labels: The node labels to be persisted across all nodes in agent pool. + :type node_labels: dict[str, str] + :param node_taints: The taints added to new nodes during node pool create and scale. For + example, key=value:NoSchedule. + :type node_taints: list[str] + :param proximity_placement_group_id: The ID for Proximity Placement Group. + :type proximity_placement_group_id: str + :param kubelet_config: The Kubelet configuration on the agent pool nodes. + :type kubelet_config: ~azure.mgmt.containerservice.v2021_08_01.models.KubeletConfig + :param linux_os_config: The OS configuration of Linux agent nodes. + :type linux_os_config: ~azure.mgmt.containerservice.v2021_08_01.models.LinuxOSConfig + :param enable_encryption_at_host: This is only supported on certain VM sizes and in certain + Azure regions. For more information, see: + https://docs.microsoft.com/azure/aks/enable-host-encryption. + :type enable_encryption_at_host: bool + :param enable_ultra_ssd: Whether to enable UltraSSD. + :type enable_ultra_ssd: bool + :param enable_fips: See `Add a FIPS-enabled node pool + `_ + for more details. + :type enable_fips: bool + :param gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile + for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", "MIG7g". + :type gpu_instance_profile: str or + ~azure.mgmt.containerservice.v2021_08_01.models.GPUInstanceProfile + :param creation_data: CreationData to be used to specify the source Snapshot ID if the node + pool will be created/upgraded using a snapshot. + :type creation_data: ~azure.mgmt.containerservice.v2021_08_01.models.CreationData + :param name: Required. Windows agent pool names must be 6 characters or less. + :type name: str + """ + + _validation = { + 'os_disk_size_gb': {'maximum': 2048, 'minimum': 0}, + 'node_image_version': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'power_state': {'readonly': True}, + 'name': {'required': True, 'pattern': r'^[a-z][a-z0-9]{0,11}$'}, + } + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + 'vm_size': {'key': 'vmSize', 'type': 'str'}, + 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, + 'os_disk_type': {'key': 'osDiskType', 'type': 'str'}, + 'kubelet_disk_type': {'key': 'kubeletDiskType', 'type': 'str'}, + 'workload_runtime': {'key': 'workloadRuntime', 'type': 'str'}, + 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, + 'pod_subnet_id': {'key': 'podSubnetID', 'type': 'str'}, + 'max_pods': {'key': 'maxPods', 'type': 'int'}, + 'os_type': {'key': 'osType', 'type': 'str'}, + 'os_sku': {'key': 'osSKU', 'type': 'str'}, + 'max_count': {'key': 'maxCount', 'type': 'int'}, + 'min_count': {'key': 'minCount', 'type': 'int'}, + 'enable_auto_scaling': {'key': 'enableAutoScaling', 'type': 'bool'}, + 'scale_down_mode': {'key': 'scaleDownMode', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'mode': {'key': 'mode', 'type': 'str'}, + 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, + 'node_image_version': {'key': 'nodeImageVersion', 'type': 'str'}, + 'upgrade_settings': {'key': 'upgradeSettings', 'type': 'AgentPoolUpgradeSettings'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'power_state': {'key': 'powerState', 'type': 'PowerState'}, + 'availability_zones': {'key': 'availabilityZones', 'type': '[str]'}, + 'enable_node_public_ip': {'key': 'enableNodePublicIP', 'type': 'bool'}, + 'node_public_ip_prefix_id': {'key': 'nodePublicIPPrefixID', 'type': 'str'}, + 'scale_set_priority': {'key': 'scaleSetPriority', 'type': 'str'}, + 'scale_set_eviction_policy': {'key': 'scaleSetEvictionPolicy', 'type': 'str'}, + 'spot_max_price': {'key': 'spotMaxPrice', 'type': 'float'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'node_labels': {'key': 'nodeLabels', 'type': '{str}'}, + 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, + 'proximity_placement_group_id': {'key': 'proximityPlacementGroupID', 'type': 'str'}, + 'kubelet_config': {'key': 'kubeletConfig', 'type': 'KubeletConfig'}, + 'linux_os_config': {'key': 'linuxOSConfig', 'type': 'LinuxOSConfig'}, + 'enable_encryption_at_host': {'key': 'enableEncryptionAtHost', 'type': 'bool'}, + 'enable_ultra_ssd': {'key': 'enableUltraSSD', 'type': 'bool'}, + 'enable_fips': {'key': 'enableFIPS', 'type': 'bool'}, + 'gpu_instance_profile': {'key': 'gpuInstanceProfile', 'type': 'str'}, + 'creation_data': {'key': 'creationData', 'type': 'CreationData'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterAgentPoolProfile, self).__init__(**kwargs) + self.name = kwargs['name'] + + +class ManagedClusterAPIServerAccessProfile(msrest.serialization.Model): + """Access profile for managed cluster API server. + + :param authorized_ip_ranges: IP ranges are specified in CIDR format, e.g. 137.117.106.88/29. + This feature is not compatible with clusters that use Public IP Per Node, or clusters that are + using a Basic Load Balancer. For more information see `API server authorized IP ranges + `_. + :type authorized_ip_ranges: list[str] + :param enable_private_cluster: For more details, see `Creating a private AKS cluster + `_. + :type enable_private_cluster: bool + :param private_dns_zone: The default is System. For more details see `configure private DNS + zone `_. + Allowed values are 'system' and 'none'. + :type private_dns_zone: str + :param enable_private_cluster_public_fqdn: Whether to create additional public FQDN for private + cluster or not. + :type enable_private_cluster_public_fqdn: bool + :param disable_run_command: Whether to disable run command for the cluster or not. + :type disable_run_command: bool + """ + + _attribute_map = { + 'authorized_ip_ranges': {'key': 'authorizedIPRanges', 'type': '[str]'}, + 'enable_private_cluster': {'key': 'enablePrivateCluster', 'type': 'bool'}, + 'private_dns_zone': {'key': 'privateDNSZone', 'type': 'str'}, + 'enable_private_cluster_public_fqdn': {'key': 'enablePrivateClusterPublicFQDN', 'type': 'bool'}, + 'disable_run_command': {'key': 'disableRunCommand', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterAPIServerAccessProfile, self).__init__(**kwargs) + self.authorized_ip_ranges = kwargs.get('authorized_ip_ranges', None) + self.enable_private_cluster = kwargs.get('enable_private_cluster', None) + self.private_dns_zone = kwargs.get('private_dns_zone', None) + self.enable_private_cluster_public_fqdn = kwargs.get('enable_private_cluster_public_fqdn', None) + self.disable_run_command = kwargs.get('disable_run_command', None) + + +class ManagedClusterAutoUpgradeProfile(msrest.serialization.Model): + """Auto upgrade profile for a managed cluster. + + :param upgrade_channel: For more information see `setting the AKS cluster auto-upgrade channel + `_. Possible + values include: "rapid", "stable", "patch", "node-image", "none". + :type upgrade_channel: str or ~azure.mgmt.containerservice.v2021_08_01.models.UpgradeChannel + """ + + _attribute_map = { + 'upgrade_channel': {'key': 'upgradeChannel', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterAutoUpgradeProfile, self).__init__(**kwargs) + self.upgrade_channel = kwargs.get('upgrade_channel', None) + + +class ManagedClusterHTTPProxyConfig(msrest.serialization.Model): + """Cluster HTTP proxy configuration. + + :param http_proxy: The HTTP proxy server endpoint to use. + :type http_proxy: str + :param https_proxy: The HTTPS proxy server endpoint to use. + :type https_proxy: str + :param no_proxy: The endpoints that should not go through proxy. + :type no_proxy: list[str] + :param trusted_ca: Alternative CA cert to use for connecting to proxy servers. + :type trusted_ca: str + """ + + _attribute_map = { + 'http_proxy': {'key': 'httpProxy', 'type': 'str'}, + 'https_proxy': {'key': 'httpsProxy', 'type': 'str'}, + 'no_proxy': {'key': 'noProxy', 'type': '[str]'}, + 'trusted_ca': {'key': 'trustedCa', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterHTTPProxyConfig, self).__init__(**kwargs) + self.http_proxy = kwargs.get('http_proxy', None) + self.https_proxy = kwargs.get('https_proxy', None) + self.no_proxy = kwargs.get('no_proxy', None) + self.trusted_ca = kwargs.get('trusted_ca', None) + + +class ManagedClusterIdentity(msrest.serialization.Model): + """Identity for the managed cluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of the system assigned identity which is used by master + components. + :vartype principal_id: str + :ivar tenant_id: The tenant id of the system assigned identity which is used by master + components. + :vartype tenant_id: str + :param type: For more information see `use managed identities in AKS + `_. Possible values include: + "SystemAssigned", "UserAssigned", "None". + :type type: str or ~azure.mgmt.containerservice.v2021_08_01.models.ResourceIdentityType + :param user_assigned_identities: The keys must be ARM resource IDs in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :type user_assigned_identities: dict[str, + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedServiceIdentityUserAssignedIdentitiesValue] + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{ManagedServiceIdentityUserAssignedIdentitiesValue}'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterIdentity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = kwargs.get('type', None) + self.user_assigned_identities = kwargs.get('user_assigned_identities', None) + + +class ManagedClusterListResult(msrest.serialization.Model): + """The response from the List Managed Clusters operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: The list of managed clusters. + :type value: list[~azure.mgmt.containerservice.v2021_08_01.models.ManagedCluster] + :ivar next_link: The URL to get the next set of managed cluster results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ManagedCluster]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class ManagedClusterLoadBalancerProfile(msrest.serialization.Model): + """Profile of the managed cluster load balancer. + + :param managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. + :type managed_outbound_i_ps: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs + :param outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load + balancer. + :type outbound_ip_prefixes: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes + :param outbound_i_ps: Desired outbound IP resources for the cluster load balancer. + :type outbound_i_ps: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterLoadBalancerProfileOutboundIPs + :param effective_outbound_i_ps: The effective outbound IP resources of the cluster load + balancer. + :type effective_outbound_i_ps: + list[~azure.mgmt.containerservice.v2021_08_01.models.ResourceReference] + :param allocated_outbound_ports: The desired number of allocated SNAT ports per VM. Allowed + values are in the range of 0 to 64000 (inclusive). The default value is 0 which results in + Azure dynamically allocating ports. + :type allocated_outbound_ports: int + :param idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values + are in the range of 4 to 120 (inclusive). The default value is 30 minutes. + :type idle_timeout_in_minutes: int + :param enable_multiple_standard_load_balancers: Enable multiple standard load balancers per AKS + cluster or not. + :type enable_multiple_standard_load_balancers: bool + """ + + _validation = { + 'allocated_outbound_ports': {'maximum': 64000, 'minimum': 0}, + 'idle_timeout_in_minutes': {'maximum': 120, 'minimum': 4}, + } + + _attribute_map = { + 'managed_outbound_i_ps': {'key': 'managedOutboundIPs', 'type': 'ManagedClusterLoadBalancerProfileManagedOutboundIPs'}, + 'outbound_ip_prefixes': {'key': 'outboundIPPrefixes', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPPrefixes'}, + 'outbound_i_ps': {'key': 'outboundIPs', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPs'}, + 'effective_outbound_i_ps': {'key': 'effectiveOutboundIPs', 'type': '[ResourceReference]'}, + 'allocated_outbound_ports': {'key': 'allocatedOutboundPorts', 'type': 'int'}, + 'idle_timeout_in_minutes': {'key': 'idleTimeoutInMinutes', 'type': 'int'}, + 'enable_multiple_standard_load_balancers': {'key': 'enableMultipleStandardLoadBalancers', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterLoadBalancerProfile, self).__init__(**kwargs) + self.managed_outbound_i_ps = kwargs.get('managed_outbound_i_ps', None) + self.outbound_ip_prefixes = kwargs.get('outbound_ip_prefixes', None) + self.outbound_i_ps = kwargs.get('outbound_i_ps', None) + self.effective_outbound_i_ps = kwargs.get('effective_outbound_i_ps', None) + self.allocated_outbound_ports = kwargs.get('allocated_outbound_ports', 0) + self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', 30) + self.enable_multiple_standard_load_balancers = kwargs.get('enable_multiple_standard_load_balancers', None) + + +class ManagedClusterLoadBalancerProfileManagedOutboundIPs(msrest.serialization.Model): + """Desired managed outbound IPs for the cluster load balancer. + + :param count: The desired number of outbound IPs created/managed by Azure for the cluster load + balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. + :type count: int + """ + + _validation = { + 'count': {'maximum': 100, 'minimum': 1}, + } + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterLoadBalancerProfileManagedOutboundIPs, self).__init__(**kwargs) + self.count = kwargs.get('count', 1) + + +class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(msrest.serialization.Model): + """Desired outbound IP Prefix resources for the cluster load balancer. + + :param public_ip_prefixes: A list of public IP prefix resources. + :type public_ip_prefixes: + list[~azure.mgmt.containerservice.v2021_08_01.models.ResourceReference] + """ + + _attribute_map = { + 'public_ip_prefixes': {'key': 'publicIPPrefixes', 'type': '[ResourceReference]'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterLoadBalancerProfileOutboundIPPrefixes, self).__init__(**kwargs) + self.public_ip_prefixes = kwargs.get('public_ip_prefixes', None) + + +class ManagedClusterLoadBalancerProfileOutboundIPs(msrest.serialization.Model): + """Desired outbound IP resources for the cluster load balancer. + + :param public_i_ps: A list of public IP resources. + :type public_i_ps: list[~azure.mgmt.containerservice.v2021_08_01.models.ResourceReference] + """ + + _attribute_map = { + 'public_i_ps': {'key': 'publicIPs', 'type': '[ResourceReference]'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterLoadBalancerProfileOutboundIPs, self).__init__(**kwargs) + self.public_i_ps = kwargs.get('public_i_ps', None) + + +class ManagedClusterManagedOutboundIPProfile(msrest.serialization.Model): + """Profile of the managed outbound IP resources of the managed cluster. + + :param count: The desired number of outbound IPs created/managed by Azure. Allowed values must + be in the range of 1 to 16 (inclusive). The default value is 1. + :type count: int + """ + + _validation = { + 'count': {'maximum': 16, 'minimum': 1}, + } + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterManagedOutboundIPProfile, self).__init__(**kwargs) + self.count = kwargs.get('count', 1) + + +class ManagedClusterNATGatewayProfile(msrest.serialization.Model): + """Profile of the managed cluster NAT gateway. + + :param managed_outbound_ip_profile: Profile of the managed outbound IP resources of the cluster + NAT gateway. + :type managed_outbound_ip_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterManagedOutboundIPProfile + :param effective_outbound_i_ps: The effective outbound IP resources of the cluster NAT gateway. + :type effective_outbound_i_ps: + list[~azure.mgmt.containerservice.v2021_08_01.models.ResourceReference] + :param idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values + are in the range of 4 to 120 (inclusive). The default value is 4 minutes. + :type idle_timeout_in_minutes: int + """ + + _validation = { + 'idle_timeout_in_minutes': {'maximum': 120, 'minimum': 4}, + } + + _attribute_map = { + 'managed_outbound_ip_profile': {'key': 'managedOutboundIPProfile', 'type': 'ManagedClusterManagedOutboundIPProfile'}, + 'effective_outbound_i_ps': {'key': 'effectiveOutboundIPs', 'type': '[ResourceReference]'}, + 'idle_timeout_in_minutes': {'key': 'idleTimeoutInMinutes', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterNATGatewayProfile, self).__init__(**kwargs) + self.managed_outbound_ip_profile = kwargs.get('managed_outbound_ip_profile', None) + self.effective_outbound_i_ps = kwargs.get('effective_outbound_i_ps', None) + self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', 4) + + +class ManagedClusterPodIdentity(msrest.serialization.Model): + """Details about the pod identity assigned to the Managed Cluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the pod identity. + :type name: str + :param namespace: Required. The namespace of the pod identity. + :type namespace: str + :param binding_selector: The binding selector to use for the AzureIdentityBinding resource. + :type binding_selector: str + :param identity: Required. The user assigned identity details. + :type identity: ~azure.mgmt.containerservice.v2021_08_01.models.UserAssignedIdentity + :ivar provisioning_state: The current provisioning state of the pod identity. Possible values + include: "Assigned", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPodIdentityProvisioningState + :ivar provisioning_info: + :vartype provisioning_info: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPodIdentityProvisioningInfo + """ + + _validation = { + 'name': {'required': True}, + 'namespace': {'required': True}, + 'identity': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'provisioning_info': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'namespace': {'key': 'namespace', 'type': 'str'}, + 'binding_selector': {'key': 'bindingSelector', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'UserAssignedIdentity'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'provisioning_info': {'key': 'provisioningInfo', 'type': 'ManagedClusterPodIdentityProvisioningInfo'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterPodIdentity, self).__init__(**kwargs) + self.name = kwargs['name'] + self.namespace = kwargs['namespace'] + self.binding_selector = kwargs.get('binding_selector', None) + self.identity = kwargs['identity'] + self.provisioning_state = None + self.provisioning_info = None + + +class ManagedClusterPodIdentityException(msrest.serialization.Model): + """See `disable AAD Pod Identity for a specific Pod/Application `_ for more details. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the pod identity exception. + :type name: str + :param namespace: Required. The namespace of the pod identity exception. + :type namespace: str + :param pod_labels: Required. The pod labels to match. + :type pod_labels: dict[str, str] + """ + + _validation = { + 'name': {'required': True}, + 'namespace': {'required': True}, + 'pod_labels': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'namespace': {'key': 'namespace', 'type': 'str'}, + 'pod_labels': {'key': 'podLabels', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterPodIdentityException, self).__init__(**kwargs) + self.name = kwargs['name'] + self.namespace = kwargs['namespace'] + self.pod_labels = kwargs['pod_labels'] + + +class ManagedClusterPodIdentityProfile(msrest.serialization.Model): + """See `use AAD pod identity `_ for more details on pod identity integration. + + :param enabled: Whether the pod identity addon is enabled. + :type enabled: bool + :param allow_network_plugin_kubenet: Running in Kubenet is disabled by default due to the + security related nature of AAD Pod Identity and the risks of IP spoofing. See `using Kubenet + network plugin with AAD Pod Identity + `_ + for more information. + :type allow_network_plugin_kubenet: bool + :param user_assigned_identities: The pod identities to use in the cluster. + :type user_assigned_identities: + list[~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPodIdentity] + :param user_assigned_identity_exceptions: The pod identity exceptions to allow. + :type user_assigned_identity_exceptions: + list[~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPodIdentityException] + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'allow_network_plugin_kubenet': {'key': 'allowNetworkPluginKubenet', 'type': 'bool'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '[ManagedClusterPodIdentity]'}, + 'user_assigned_identity_exceptions': {'key': 'userAssignedIdentityExceptions', 'type': '[ManagedClusterPodIdentityException]'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterPodIdentityProfile, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.allow_network_plugin_kubenet = kwargs.get('allow_network_plugin_kubenet', None) + self.user_assigned_identities = kwargs.get('user_assigned_identities', None) + self.user_assigned_identity_exceptions = kwargs.get('user_assigned_identity_exceptions', None) + + +class ManagedClusterPodIdentityProvisioningError(msrest.serialization.Model): + """An error response from the pod identity provisioning. + + :param error: Details about the error. + :type error: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPodIdentityProvisioningErrorBody + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ManagedClusterPodIdentityProvisioningErrorBody'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterPodIdentityProvisioningError, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class ManagedClusterPodIdentityProvisioningErrorBody(msrest.serialization.Model): + """An error response from the pod identity provisioning. + + :param code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable for display in a user + interface. + :type message: str + :param target: The target of the particular error. For example, the name of the property in + error. + :type target: str + :param details: A list of additional details about the error. + :type details: + list[~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPodIdentityProvisioningErrorBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ManagedClusterPodIdentityProvisioningErrorBody]'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterPodIdentityProvisioningErrorBody, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) + self.details = kwargs.get('details', None) + + +class ManagedClusterPodIdentityProvisioningInfo(msrest.serialization.Model): + """ManagedClusterPodIdentityProvisioningInfo. + + :param error: Pod identity assignment error (if any). + :type error: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPodIdentityProvisioningError + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ManagedClusterPodIdentityProvisioningError'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterPodIdentityProvisioningInfo, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class ManagedClusterPoolUpgradeProfile(msrest.serialization.Model): + """The list of available upgrade versions. + + All required parameters must be populated in order to send to Azure. + + :param kubernetes_version: Required. The Kubernetes version (major.minor.patch). + :type kubernetes_version: str + :param name: The Agent Pool name. + :type name: str + :param os_type: Required. The operating system type. The default is Linux. Possible values + include: "Linux", "Windows". Default value: "Linux". + :type os_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSType + :param upgrades: List of orchestrator types and versions available for upgrade. + :type upgrades: + list[~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] + """ + + _validation = { + 'kubernetes_version': {'required': True}, + 'os_type': {'required': True}, + } + + _attribute_map = { + 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'os_type': {'key': 'osType', 'type': 'str'}, + 'upgrades': {'key': 'upgrades', 'type': '[ManagedClusterPoolUpgradeProfileUpgradesItem]'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) + self.kubernetes_version = kwargs['kubernetes_version'] + self.name = kwargs.get('name', None) + self.os_type = kwargs.get('os_type', "Linux") + self.upgrades = kwargs.get('upgrades', None) + + +class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): + """ManagedClusterPoolUpgradeProfileUpgradesItem. + + :param kubernetes_version: The Kubernetes version (major.minor.patch). + :type kubernetes_version: str + :param is_preview: Whether the Kubernetes version is currently in preview. + :type is_preview: bool + """ + + _attribute_map = { + 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, + 'is_preview': {'key': 'isPreview', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterPoolUpgradeProfileUpgradesItem, self).__init__(**kwargs) + self.kubernetes_version = kwargs.get('kubernetes_version', None) + self.is_preview = kwargs.get('is_preview', None) + + +class ManagedClusterPropertiesAutoScalerProfile(msrest.serialization.Model): + """Parameters to be applied to the cluster-autoscaler when enabled. + + :param balance_similar_node_groups: Valid values are 'true' and 'false'. + :type balance_similar_node_groups: str + :param expander: If not specified, the default is 'random'. See `expanders + `_ + for more information. Possible values include: "least-waste", "most-pods", "priority", + "random". + :type expander: str or ~azure.mgmt.containerservice.v2021_08_01.models.Expander + :param max_empty_bulk_delete: The default is 10. + :type max_empty_bulk_delete: str + :param max_graceful_termination_sec: The default is 600. + :type max_graceful_termination_sec: str + :param max_node_provision_time: The default is '15m'. Values must be an integer followed by an + 'm'. No unit of time other than minutes (m) is supported. + :type max_node_provision_time: str + :param max_total_unready_percentage: The default is 45. The maximum is 100 and the minimum is + 0. + :type max_total_unready_percentage: str + :param new_pod_scale_up_delay: For scenarios like burst/batch scale where you don't want CA to + act before the kubernetes scheduler could schedule all the pods, you can tell CA to ignore + unscheduled pods before they're a certain age. The default is '0s'. Values must be an integer + followed by a unit ('s' for seconds, 'm' for minutes, 'h' for hours, etc). + :type new_pod_scale_up_delay: str + :param ok_total_unready_count: This must be an integer. The default is 3. + :type ok_total_unready_count: str + :param scan_interval: The default is '10'. Values must be an integer number of seconds. + :type scan_interval: str + :param scale_down_delay_after_add: The default is '10m'. Values must be an integer followed by + an 'm'. No unit of time other than minutes (m) is supported. + :type scale_down_delay_after_add: str + :param scale_down_delay_after_delete: The default is the scan-interval. Values must be an + integer followed by an 'm'. No unit of time other than minutes (m) is supported. + :type scale_down_delay_after_delete: str + :param scale_down_delay_after_failure: The default is '3m'. Values must be an integer followed + by an 'm'. No unit of time other than minutes (m) is supported. + :type scale_down_delay_after_failure: str + :param scale_down_unneeded_time: The default is '10m'. Values must be an integer followed by an + 'm'. No unit of time other than minutes (m) is supported. + :type scale_down_unneeded_time: str + :param scale_down_unready_time: The default is '20m'. Values must be an integer followed by an + 'm'. No unit of time other than minutes (m) is supported. + :type scale_down_unready_time: str + :param scale_down_utilization_threshold: The default is '0.5'. + :type scale_down_utilization_threshold: str + :param skip_nodes_with_local_storage: The default is true. + :type skip_nodes_with_local_storage: str + :param skip_nodes_with_system_pods: The default is true. + :type skip_nodes_with_system_pods: str + """ + + _attribute_map = { + 'balance_similar_node_groups': {'key': 'balance-similar-node-groups', 'type': 'str'}, + 'expander': {'key': 'expander', 'type': 'str'}, + 'max_empty_bulk_delete': {'key': 'max-empty-bulk-delete', 'type': 'str'}, + 'max_graceful_termination_sec': {'key': 'max-graceful-termination-sec', 'type': 'str'}, + 'max_node_provision_time': {'key': 'max-node-provision-time', 'type': 'str'}, + 'max_total_unready_percentage': {'key': 'max-total-unready-percentage', 'type': 'str'}, + 'new_pod_scale_up_delay': {'key': 'new-pod-scale-up-delay', 'type': 'str'}, + 'ok_total_unready_count': {'key': 'ok-total-unready-count', 'type': 'str'}, + 'scan_interval': {'key': 'scan-interval', 'type': 'str'}, + 'scale_down_delay_after_add': {'key': 'scale-down-delay-after-add', 'type': 'str'}, + 'scale_down_delay_after_delete': {'key': 'scale-down-delay-after-delete', 'type': 'str'}, + 'scale_down_delay_after_failure': {'key': 'scale-down-delay-after-failure', 'type': 'str'}, + 'scale_down_unneeded_time': {'key': 'scale-down-unneeded-time', 'type': 'str'}, + 'scale_down_unready_time': {'key': 'scale-down-unready-time', 'type': 'str'}, + 'scale_down_utilization_threshold': {'key': 'scale-down-utilization-threshold', 'type': 'str'}, + 'skip_nodes_with_local_storage': {'key': 'skip-nodes-with-local-storage', 'type': 'str'}, + 'skip_nodes_with_system_pods': {'key': 'skip-nodes-with-system-pods', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterPropertiesAutoScalerProfile, self).__init__(**kwargs) + self.balance_similar_node_groups = kwargs.get('balance_similar_node_groups', None) + self.expander = kwargs.get('expander', None) + self.max_empty_bulk_delete = kwargs.get('max_empty_bulk_delete', None) + self.max_graceful_termination_sec = kwargs.get('max_graceful_termination_sec', None) + self.max_node_provision_time = kwargs.get('max_node_provision_time', None) + self.max_total_unready_percentage = kwargs.get('max_total_unready_percentage', None) + self.new_pod_scale_up_delay = kwargs.get('new_pod_scale_up_delay', None) + self.ok_total_unready_count = kwargs.get('ok_total_unready_count', None) + self.scan_interval = kwargs.get('scan_interval', None) + self.scale_down_delay_after_add = kwargs.get('scale_down_delay_after_add', None) + self.scale_down_delay_after_delete = kwargs.get('scale_down_delay_after_delete', None) + self.scale_down_delay_after_failure = kwargs.get('scale_down_delay_after_failure', None) + self.scale_down_unneeded_time = kwargs.get('scale_down_unneeded_time', None) + self.scale_down_unready_time = kwargs.get('scale_down_unready_time', None) + self.scale_down_utilization_threshold = kwargs.get('scale_down_utilization_threshold', None) + self.skip_nodes_with_local_storage = kwargs.get('skip_nodes_with_local_storage', None) + self.skip_nodes_with_system_pods = kwargs.get('skip_nodes_with_system_pods', None) + + +class ManagedClusterSecurityProfile(msrest.serialization.Model): + """Security profile for the container service cluster. + + :param azure_defender: Azure Defender settings for the security profile. + :type azure_defender: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterSecurityProfileAzureDefender + """ + + _attribute_map = { + 'azure_defender': {'key': 'azureDefender', 'type': 'ManagedClusterSecurityProfileAzureDefender'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterSecurityProfile, self).__init__(**kwargs) + self.azure_defender = kwargs.get('azure_defender', None) + + +class ManagedClusterSecurityProfileAzureDefender(msrest.serialization.Model): + """Azure Defender settings for the security profile. + + :param enabled: Whether to enable Azure Defender. + :type enabled: bool + :param log_analytics_workspace_resource_id: Resource ID of the Log Analytics workspace to be + associated with Azure Defender. When Azure Defender is enabled, this field is required and + must be a valid workspace resource ID. When Azure Defender is disabled, leave the field empty. + :type log_analytics_workspace_resource_id: str + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'log_analytics_workspace_resource_id': {'key': 'logAnalyticsWorkspaceResourceId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterSecurityProfileAzureDefender, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.log_analytics_workspace_resource_id = kwargs.get('log_analytics_workspace_resource_id', None) + + +class ManagedClusterServicePrincipalProfile(msrest.serialization.Model): + """Information about a service principal identity for the cluster to use for manipulating Azure APIs. + + All required parameters must be populated in order to send to Azure. + + :param client_id: Required. The ID for the service principal. + :type client_id: str + :param secret: The secret password associated with the service principal in plain text. + :type secret: str + """ + + _validation = { + 'client_id': {'required': True}, + } + + _attribute_map = { + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'secret': {'key': 'secret', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) + self.client_id = kwargs['client_id'] + self.secret = kwargs.get('secret', None) + + +class ManagedClusterSKU(msrest.serialization.Model): + """The SKU of a Managed Cluster. + + :param name: The name of a managed cluster SKU. Possible values include: "Basic". + :type name: str or ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterSKUName + :param tier: If not specified, the default is 'Free'. See `uptime SLA + `_ for more details. Possible values include: + "Paid", "Free". + :type tier: str or ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterSKUTier + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterSKU, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + + +class ManagedClusterUpgradeProfile(msrest.serialization.Model): + """The list of available upgrades for compute pools. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The ID of the upgrade profile. + :vartype id: str + :ivar name: The name of the upgrade profile. + :vartype name: str + :ivar type: The type of the upgrade profile. + :vartype type: str + :param control_plane_profile: Required. The list of available upgrade versions for the control + plane. + :type control_plane_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPoolUpgradeProfile + :param agent_pool_profiles: Required. The list of available upgrade versions for agent pools. + :type agent_pool_profiles: + list[~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPoolUpgradeProfile] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'control_plane_profile': {'required': True}, + 'agent_pool_profiles': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'control_plane_profile': {'key': 'properties.controlPlaneProfile', 'type': 'ManagedClusterPoolUpgradeProfile'}, + 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterPoolUpgradeProfile]'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.control_plane_profile = kwargs['control_plane_profile'] + self.agent_pool_profiles = kwargs['agent_pool_profiles'] + + +class ManagedClusterWindowsProfile(msrest.serialization.Model): + """Profile for Windows VMs in the managed cluster. + + All required parameters must be populated in order to send to Azure. + + :param admin_username: Required. Specifies the name of the administrator account. + :code:`
`:code:`
` **Restriction:** Cannot end in "." :code:`
`:code:`
` + **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", + "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", + "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", + "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 + character :code:`
`:code:`
` **Max-length:** 20 characters. + :type admin_username: str + :param admin_password: Specifies the password of the administrator account. + :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` + **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 + conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", + "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". + :type admin_password: str + :param license_type: The license type to use for Windows VMs. See `Azure Hybrid User Benefits + `_ for more details. Possible values + include: "None", "Windows_Server". + :type license_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.LicenseType + :param enable_csi_proxy: For more details on CSI proxy, see the `CSI proxy GitHub repo + `_. + :type enable_csi_proxy: bool + """ + + _validation = { + 'admin_username': {'required': True}, + } + + _attribute_map = { + 'admin_username': {'key': 'adminUsername', 'type': 'str'}, + 'admin_password': {'key': 'adminPassword', 'type': 'str'}, + 'license_type': {'key': 'licenseType', 'type': 'str'}, + 'enable_csi_proxy': {'key': 'enableCSIProxy', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedClusterWindowsProfile, self).__init__(**kwargs) + self.admin_username = kwargs['admin_username'] + self.admin_password = kwargs.get('admin_password', None) + self.license_type = kwargs.get('license_type', None) + self.enable_csi_proxy = kwargs.get('enable_csi_proxy', None) + + +class ManagedServiceIdentityUserAssignedIdentitiesValue(msrest.serialization.Model): + """ManagedServiceIdentityUserAssignedIdentitiesValue. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedServiceIdentityUserAssignedIdentitiesValue, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + +class OperationListResult(msrest.serialization.Model): + """The List Operation response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of operations. + :vartype value: list[~azure.mgmt.containerservice.v2021_08_01.models.OperationValue] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[OperationValue]'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationListResult, self).__init__(**kwargs) + self.value = None + + +class OperationValue(msrest.serialization.Model): + """Describes the properties of a Operation value. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar origin: The origin of the operation. + :vartype origin: str + :ivar name: The name of the operation. + :vartype name: str + :ivar operation: The display name of the operation. + :vartype operation: str + :ivar resource: The display name of the resource the operation applies to. + :vartype resource: str + :ivar description: The description of the operation. + :vartype description: str + :ivar provider: The resource provider for the operation. + :vartype provider: str + """ + + _validation = { + 'origin': {'readonly': True}, + 'name': {'readonly': True}, + 'operation': {'readonly': True}, + 'resource': {'readonly': True}, + 'description': {'readonly': True}, + 'provider': {'readonly': True}, + } + + _attribute_map = { + 'origin': {'key': 'origin', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'operation': {'key': 'display.operation', 'type': 'str'}, + 'resource': {'key': 'display.resource', 'type': 'str'}, + 'description': {'key': 'display.description', 'type': 'str'}, + 'provider': {'key': 'display.provider', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationValue, self).__init__(**kwargs) + self.origin = None + self.name = None + self.operation = None + self.resource = None + self.description = None + self.provider = None + + +class OSOptionProfile(msrest.serialization.Model): + """The OS option profile. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The ID of the OS option resource. + :vartype id: str + :ivar name: The name of the OS option resource. + :vartype name: str + :ivar type: The type of the OS option resource. + :vartype type: str + :param os_option_property_list: Required. The list of OS options. + :type os_option_property_list: + list[~azure.mgmt.containerservice.v2021_08_01.models.OSOptionProperty] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'os_option_property_list': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'os_option_property_list': {'key': 'properties.osOptionPropertyList', 'type': '[OSOptionProperty]'}, + } + + def __init__( + self, + **kwargs + ): + super(OSOptionProfile, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.os_option_property_list = kwargs['os_option_property_list'] + + +class OSOptionProperty(msrest.serialization.Model): + """OS option property. + + All required parameters must be populated in order to send to Azure. + + :param os_type: Required. The OS type. + :type os_type: str + :param enable_fips_image: Required. Whether the image is FIPS-enabled. + :type enable_fips_image: bool + """ + + _validation = { + 'os_type': {'required': True}, + 'enable_fips_image': {'required': True}, + } + + _attribute_map = { + 'os_type': {'key': 'os-type', 'type': 'str'}, + 'enable_fips_image': {'key': 'enable-fips-image', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(OSOptionProperty, self).__init__(**kwargs) + self.os_type = kwargs['os_type'] + self.enable_fips_image = kwargs['enable_fips_image'] + + +class OutboundEnvironmentEndpoint(msrest.serialization.Model): + """Egress endpoints which AKS agent nodes connect to for common purpose. + + :param category: The category of endpoints accessed by the AKS agent node, e.g. + azure-resource-management, apiserver, etc. + :type category: str + :param endpoints: The endpoints that AKS agent nodes connect to. + :type endpoints: list[~azure.mgmt.containerservice.v2021_08_01.models.EndpointDependency] + """ + + _attribute_map = { + 'category': {'key': 'category', 'type': 'str'}, + 'endpoints': {'key': 'endpoints', 'type': '[EndpointDependency]'}, + } + + def __init__( + self, + **kwargs + ): + super(OutboundEnvironmentEndpoint, self).__init__(**kwargs) + self.category = kwargs.get('category', None) + self.endpoints = kwargs.get('endpoints', None) + + +class OutboundEnvironmentEndpointCollection(msrest.serialization.Model): + """Collection of OutboundEnvironmentEndpoint. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.containerservice.v2021_08_01.models.OutboundEnvironmentEndpoint] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[OutboundEnvironmentEndpoint]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OutboundEnvironmentEndpointCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class PowerState(msrest.serialization.Model): + """Describes the Power State of the cluster. + + :param code: Tells whether the cluster is Running or Stopped. Possible values include: + "Running", "Stopped". + :type code: str or ~azure.mgmt.containerservice.v2021_08_01.models.Code + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PowerState, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + + +class PrivateEndpoint(msrest.serialization.Model): + """Private endpoint which a connection belongs to. + + :param id: The resource ID of the private endpoint. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpoint, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + +class PrivateEndpointConnection(msrest.serialization.Model): + """A private endpoint connection. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The ID of the private endpoint connection. + :vartype id: str + :ivar name: The name of the private endpoint connection. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :ivar provisioning_state: The current provisioning state. Possible values include: "Succeeded", + "Creating", "Deleting", "Failed". + :vartype provisioning_state: str or + ~azure.mgmt.containerservice.v2021_08_01.models.PrivateEndpointConnectionProvisioningState + :param private_endpoint: The resource of private endpoint. + :type private_endpoint: ~azure.mgmt.containerservice.v2021_08_01.models.PrivateEndpoint + :param private_link_service_connection_state: A collection of information about the state of + the connection between service consumer and provider. + :type private_link_service_connection_state: + ~azure.mgmt.containerservice.v2021_08_01.models.PrivateLinkServiceConnectionState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.provisioning_state = None + self.private_endpoint = kwargs.get('private_endpoint', None) + self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) + + +class PrivateEndpointConnectionListResult(msrest.serialization.Model): + """A list of private endpoint connections. + + :param value: The collection value. + :type value: list[~azure.mgmt.containerservice.v2021_08_01.models.PrivateEndpointConnection] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class PrivateLinkResource(msrest.serialization.Model): + """A private link resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: The ID of the private link resource. + :type id: str + :param name: The name of the private link resource. + :type name: str + :param type: The resource type. + :type type: str + :param group_id: The group ID of the resource. + :type group_id: str + :param required_members: The RequiredMembers of the resource. + :type required_members: list[str] + :ivar private_link_service_id: The private link service ID of the resource, this field is + exposed only to NRP internally. + :vartype private_link_service_id: str + """ + + _validation = { + 'private_link_service_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'group_id': {'key': 'groupId', 'type': 'str'}, + 'required_members': {'key': 'requiredMembers', 'type': '[str]'}, + 'private_link_service_id': {'key': 'privateLinkServiceID', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkResource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + self.group_id = kwargs.get('group_id', None) + self.required_members = kwargs.get('required_members', None) + self.private_link_service_id = None + + +class PrivateLinkResourcesListResult(msrest.serialization.Model): + """A list of private link resources. + + :param value: The collection value. + :type value: list[~azure.mgmt.containerservice.v2021_08_01.models.PrivateLinkResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkResourcesListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class PrivateLinkServiceConnectionState(msrest.serialization.Model): + """The state of a private link service connection. + + :param status: The private link service connection status. Possible values include: "Pending", + "Approved", "Rejected", "Disconnected". + :type status: str or ~azure.mgmt.containerservice.v2021_08_01.models.ConnectionStatus + :param description: The private link service connection description. + :type description: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.description = kwargs.get('description', None) + + +class ResourceReference(msrest.serialization.Model): + """A reference to an Azure resource. + + :param id: The fully qualified Azure resource id. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceReference, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + +class RunCommandRequest(msrest.serialization.Model): + """A run command request. + + All required parameters must be populated in order to send to Azure. + + :param command: Required. The command to run. + :type command: str + :param context: A base64 encoded zip file containing the files required by the command. + :type context: str + :param cluster_token: AuthToken issued for AKS AAD Server App. + :type cluster_token: str + """ + + _validation = { + 'command': {'required': True}, + } + + _attribute_map = { + 'command': {'key': 'command', 'type': 'str'}, + 'context': {'key': 'context', 'type': 'str'}, + 'cluster_token': {'key': 'clusterToken', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RunCommandRequest, self).__init__(**kwargs) + self.command = kwargs['command'] + self.context = kwargs.get('context', None) + self.cluster_token = kwargs.get('cluster_token', None) + + +class RunCommandResult(msrest.serialization.Model): + """run command result. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The command id. + :vartype id: str + :ivar provisioning_state: provisioning State. + :vartype provisioning_state: str + :ivar exit_code: The exit code of the command. + :vartype exit_code: int + :ivar started_at: The time when the command started. + :vartype started_at: ~datetime.datetime + :ivar finished_at: The time when the command finished. + :vartype finished_at: ~datetime.datetime + :ivar logs: The command output. + :vartype logs: str + :ivar reason: An explanation of why provisioningState is set to failed (if so). + :vartype reason: str + """ + + _validation = { + 'id': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'exit_code': {'readonly': True}, + 'started_at': {'readonly': True}, + 'finished_at': {'readonly': True}, + 'logs': {'readonly': True}, + 'reason': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'exit_code': {'key': 'properties.exitCode', 'type': 'int'}, + 'started_at': {'key': 'properties.startedAt', 'type': 'iso-8601'}, + 'finished_at': {'key': 'properties.finishedAt', 'type': 'iso-8601'}, + 'logs': {'key': 'properties.logs', 'type': 'str'}, + 'reason': {'key': 'properties.reason', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RunCommandResult, self).__init__(**kwargs) + self.id = None + self.provisioning_state = None + self.exit_code = None + self.started_at = None + self.finished_at = None + self.logs = None + self.reason = None + + +class Snapshot(Resource): + """A node pool snapshot resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar system_data: The system metadata relating to this snapshot. + :vartype system_data: ~azure.mgmt.containerservice.v2021_08_01.models.SystemData + :param creation_data: CreationData to be used to specify the source agent pool resource ID to + create this snapshot. + :type creation_data: ~azure.mgmt.containerservice.v2021_08_01.models.CreationData + :param snapshot_type: The type of a snapshot. The default is NodePool. Possible values include: + "NodePool". Default value: "NodePool". + :type snapshot_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.SnapshotType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'creation_data': {'key': 'properties.creationData', 'type': 'CreationData'}, + 'snapshot_type': {'key': 'properties.snapshotType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Snapshot, self).__init__(**kwargs) + self.system_data = None + self.creation_data = kwargs.get('creation_data', None) + self.snapshot_type = kwargs.get('snapshot_type', "NodePool") + + +class SnapshotListResult(msrest.serialization.Model): + """The response from the List Snapshots operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: The list of snapshots. + :type value: list[~azure.mgmt.containerservice.v2021_08_01.models.Snapshot] + :ivar next_link: The URL to get the next set of snapshot results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Snapshot]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SnapshotListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class SysctlConfig(msrest.serialization.Model): + """Sysctl settings for Linux agent nodes. + + :param net_core_somaxconn: Sysctl setting net.core.somaxconn. + :type net_core_somaxconn: int + :param net_core_netdev_max_backlog: Sysctl setting net.core.netdev_max_backlog. + :type net_core_netdev_max_backlog: int + :param net_core_rmem_default: Sysctl setting net.core.rmem_default. + :type net_core_rmem_default: int + :param net_core_rmem_max: Sysctl setting net.core.rmem_max. + :type net_core_rmem_max: int + :param net_core_wmem_default: Sysctl setting net.core.wmem_default. + :type net_core_wmem_default: int + :param net_core_wmem_max: Sysctl setting net.core.wmem_max. + :type net_core_wmem_max: int + :param net_core_optmem_max: Sysctl setting net.core.optmem_max. + :type net_core_optmem_max: int + :param net_ipv4_tcp_max_syn_backlog: Sysctl setting net.ipv4.tcp_max_syn_backlog. + :type net_ipv4_tcp_max_syn_backlog: int + :param net_ipv4_tcp_max_tw_buckets: Sysctl setting net.ipv4.tcp_max_tw_buckets. + :type net_ipv4_tcp_max_tw_buckets: int + :param net_ipv4_tcp_fin_timeout: Sysctl setting net.ipv4.tcp_fin_timeout. + :type net_ipv4_tcp_fin_timeout: int + :param net_ipv4_tcp_keepalive_time: Sysctl setting net.ipv4.tcp_keepalive_time. + :type net_ipv4_tcp_keepalive_time: int + :param net_ipv4_tcp_keepalive_probes: Sysctl setting net.ipv4.tcp_keepalive_probes. + :type net_ipv4_tcp_keepalive_probes: int + :param net_ipv4_tcpkeepalive_intvl: Sysctl setting net.ipv4.tcp_keepalive_intvl. + :type net_ipv4_tcpkeepalive_intvl: int + :param net_ipv4_tcp_tw_reuse: Sysctl setting net.ipv4.tcp_tw_reuse. + :type net_ipv4_tcp_tw_reuse: bool + :param net_ipv4_ip_local_port_range: Sysctl setting net.ipv4.ip_local_port_range. + :type net_ipv4_ip_local_port_range: str + :param net_ipv4_neigh_default_gc_thresh1: Sysctl setting net.ipv4.neigh.default.gc_thresh1. + :type net_ipv4_neigh_default_gc_thresh1: int + :param net_ipv4_neigh_default_gc_thresh2: Sysctl setting net.ipv4.neigh.default.gc_thresh2. + :type net_ipv4_neigh_default_gc_thresh2: int + :param net_ipv4_neigh_default_gc_thresh3: Sysctl setting net.ipv4.neigh.default.gc_thresh3. + :type net_ipv4_neigh_default_gc_thresh3: int + :param net_netfilter_nf_conntrack_max: Sysctl setting net.netfilter.nf_conntrack_max. + :type net_netfilter_nf_conntrack_max: int + :param net_netfilter_nf_conntrack_buckets: Sysctl setting net.netfilter.nf_conntrack_buckets. + :type net_netfilter_nf_conntrack_buckets: int + :param fs_inotify_max_user_watches: Sysctl setting fs.inotify.max_user_watches. + :type fs_inotify_max_user_watches: int + :param fs_file_max: Sysctl setting fs.file-max. + :type fs_file_max: int + :param fs_aio_max_nr: Sysctl setting fs.aio-max-nr. + :type fs_aio_max_nr: int + :param fs_nr_open: Sysctl setting fs.nr_open. + :type fs_nr_open: int + :param kernel_threads_max: Sysctl setting kernel.threads-max. + :type kernel_threads_max: int + :param vm_max_map_count: Sysctl setting vm.max_map_count. + :type vm_max_map_count: int + :param vm_swappiness: Sysctl setting vm.swappiness. + :type vm_swappiness: int + :param vm_vfs_cache_pressure: Sysctl setting vm.vfs_cache_pressure. + :type vm_vfs_cache_pressure: int + """ + + _attribute_map = { + 'net_core_somaxconn': {'key': 'netCoreSomaxconn', 'type': 'int'}, + 'net_core_netdev_max_backlog': {'key': 'netCoreNetdevMaxBacklog', 'type': 'int'}, + 'net_core_rmem_default': {'key': 'netCoreRmemDefault', 'type': 'int'}, + 'net_core_rmem_max': {'key': 'netCoreRmemMax', 'type': 'int'}, + 'net_core_wmem_default': {'key': 'netCoreWmemDefault', 'type': 'int'}, + 'net_core_wmem_max': {'key': 'netCoreWmemMax', 'type': 'int'}, + 'net_core_optmem_max': {'key': 'netCoreOptmemMax', 'type': 'int'}, + 'net_ipv4_tcp_max_syn_backlog': {'key': 'netIpv4TcpMaxSynBacklog', 'type': 'int'}, + 'net_ipv4_tcp_max_tw_buckets': {'key': 'netIpv4TcpMaxTwBuckets', 'type': 'int'}, + 'net_ipv4_tcp_fin_timeout': {'key': 'netIpv4TcpFinTimeout', 'type': 'int'}, + 'net_ipv4_tcp_keepalive_time': {'key': 'netIpv4TcpKeepaliveTime', 'type': 'int'}, + 'net_ipv4_tcp_keepalive_probes': {'key': 'netIpv4TcpKeepaliveProbes', 'type': 'int'}, + 'net_ipv4_tcpkeepalive_intvl': {'key': 'netIpv4TcpkeepaliveIntvl', 'type': 'int'}, + 'net_ipv4_tcp_tw_reuse': {'key': 'netIpv4TcpTwReuse', 'type': 'bool'}, + 'net_ipv4_ip_local_port_range': {'key': 'netIpv4IpLocalPortRange', 'type': 'str'}, + 'net_ipv4_neigh_default_gc_thresh1': {'key': 'netIpv4NeighDefaultGcThresh1', 'type': 'int'}, + 'net_ipv4_neigh_default_gc_thresh2': {'key': 'netIpv4NeighDefaultGcThresh2', 'type': 'int'}, + 'net_ipv4_neigh_default_gc_thresh3': {'key': 'netIpv4NeighDefaultGcThresh3', 'type': 'int'}, + 'net_netfilter_nf_conntrack_max': {'key': 'netNetfilterNfConntrackMax', 'type': 'int'}, + 'net_netfilter_nf_conntrack_buckets': {'key': 'netNetfilterNfConntrackBuckets', 'type': 'int'}, + 'fs_inotify_max_user_watches': {'key': 'fsInotifyMaxUserWatches', 'type': 'int'}, + 'fs_file_max': {'key': 'fsFileMax', 'type': 'int'}, + 'fs_aio_max_nr': {'key': 'fsAioMaxNr', 'type': 'int'}, + 'fs_nr_open': {'key': 'fsNrOpen', 'type': 'int'}, + 'kernel_threads_max': {'key': 'kernelThreadsMax', 'type': 'int'}, + 'vm_max_map_count': {'key': 'vmMaxMapCount', 'type': 'int'}, + 'vm_swappiness': {'key': 'vmSwappiness', 'type': 'int'}, + 'vm_vfs_cache_pressure': {'key': 'vmVfsCachePressure', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(SysctlConfig, self).__init__(**kwargs) + self.net_core_somaxconn = kwargs.get('net_core_somaxconn', None) + self.net_core_netdev_max_backlog = kwargs.get('net_core_netdev_max_backlog', None) + self.net_core_rmem_default = kwargs.get('net_core_rmem_default', None) + self.net_core_rmem_max = kwargs.get('net_core_rmem_max', None) + self.net_core_wmem_default = kwargs.get('net_core_wmem_default', None) + self.net_core_wmem_max = kwargs.get('net_core_wmem_max', None) + self.net_core_optmem_max = kwargs.get('net_core_optmem_max', None) + self.net_ipv4_tcp_max_syn_backlog = kwargs.get('net_ipv4_tcp_max_syn_backlog', None) + self.net_ipv4_tcp_max_tw_buckets = kwargs.get('net_ipv4_tcp_max_tw_buckets', None) + self.net_ipv4_tcp_fin_timeout = kwargs.get('net_ipv4_tcp_fin_timeout', None) + self.net_ipv4_tcp_keepalive_time = kwargs.get('net_ipv4_tcp_keepalive_time', None) + self.net_ipv4_tcp_keepalive_probes = kwargs.get('net_ipv4_tcp_keepalive_probes', None) + self.net_ipv4_tcpkeepalive_intvl = kwargs.get('net_ipv4_tcpkeepalive_intvl', None) + self.net_ipv4_tcp_tw_reuse = kwargs.get('net_ipv4_tcp_tw_reuse', None) + self.net_ipv4_ip_local_port_range = kwargs.get('net_ipv4_ip_local_port_range', None) + self.net_ipv4_neigh_default_gc_thresh1 = kwargs.get('net_ipv4_neigh_default_gc_thresh1', None) + self.net_ipv4_neigh_default_gc_thresh2 = kwargs.get('net_ipv4_neigh_default_gc_thresh2', None) + self.net_ipv4_neigh_default_gc_thresh3 = kwargs.get('net_ipv4_neigh_default_gc_thresh3', None) + self.net_netfilter_nf_conntrack_max = kwargs.get('net_netfilter_nf_conntrack_max', None) + self.net_netfilter_nf_conntrack_buckets = kwargs.get('net_netfilter_nf_conntrack_buckets', None) + self.fs_inotify_max_user_watches = kwargs.get('fs_inotify_max_user_watches', None) + self.fs_file_max = kwargs.get('fs_file_max', None) + self.fs_aio_max_nr = kwargs.get('fs_aio_max_nr', None) + self.fs_nr_open = kwargs.get('fs_nr_open', None) + self.kernel_threads_max = kwargs.get('kernel_threads_max', None) + self.vm_max_map_count = kwargs.get('vm_max_map_count', None) + self.vm_swappiness = kwargs.get('vm_swappiness', None) + self.vm_vfs_cache_pressure = kwargs.get('vm_vfs_cache_pressure', None) + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.CreatedByType + :param created_at: The UTC timestamp of resource creation. + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or + ~azure.mgmt.containerservice.v2021_08_01.models.CreatedByType + :param last_modified_at: The type of identity that last modified the resource. + :type last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(SystemData, self).__init__(**kwargs) + self.created_by = kwargs.get('created_by', None) + self.created_by_type = kwargs.get('created_by_type', None) + self.created_at = kwargs.get('created_at', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.last_modified_by_type = kwargs.get('last_modified_by_type', None) + self.last_modified_at = kwargs.get('last_modified_at', None) + + +class TagsObject(msrest.serialization.Model): + """Tags object for patch operations. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(TagsObject, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + + +class TimeInWeek(msrest.serialization.Model): + """Time in a week. + + :param day: The day of the week. Possible values include: "Sunday", "Monday", "Tuesday", + "Wednesday", "Thursday", "Friday", "Saturday". + :type day: str or ~azure.mgmt.containerservice.v2021_08_01.models.WeekDay + :param hour_slots: Each integer hour represents a time range beginning at 0m after the hour + ending at the next hour (non-inclusive). 0 corresponds to 00:00 UTC, 23 corresponds to 23:00 + UTC. Specifying [0, 1] means the 00:00 - 02:00 UTC time range. + :type hour_slots: list[int] + """ + + _attribute_map = { + 'day': {'key': 'day', 'type': 'str'}, + 'hour_slots': {'key': 'hourSlots', 'type': '[int]'}, + } + + def __init__( + self, + **kwargs + ): + super(TimeInWeek, self).__init__(**kwargs) + self.day = kwargs.get('day', None) + self.hour_slots = kwargs.get('hour_slots', None) + + +class TimeSpan(msrest.serialization.Model): + """For example, between 2021-05-25T13:00:00Z and 2021-05-25T14:00:00Z. + + :param start: The start of a time span. + :type start: ~datetime.datetime + :param end: The end of a time span. + :type end: ~datetime.datetime + """ + + _attribute_map = { + 'start': {'key': 'start', 'type': 'iso-8601'}, + 'end': {'key': 'end', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(TimeSpan, self).__init__(**kwargs) + self.start = kwargs.get('start', None) + self.end = kwargs.get('end', None) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/models/_models_py3.py new file mode 100644 index 000000000000..0086dd7d2680 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/models/_models_py3.py @@ -0,0 +1,4281 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +import datetime +from typing import Dict, List, Optional, Union + +import msrest.serialization + +from ._container_service_client_enums import * + + +class SubResource(msrest.serialization.Model): + """Reference to another subresource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SubResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class AgentPool(SubResource): + """Agent Pool. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for + system pools. The default value is 1. + :type count: int + :param vm_size: VM size availability varies by region. If a node contains insufficient compute + resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted + VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + :type vm_size: str + :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in the master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :type os_disk_size_gb: int + :param os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk + larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed + after creation. For more information see `Ephemeral OS + `_. Possible values + include: "Managed", "Ephemeral". + :type os_disk_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSDiskType + :param kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data + root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". + :type kubelet_disk_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.KubeletDiskType + :param workload_runtime: Determines the type of workload a node can run. Possible values + include: "OCIContainer", "WasmWasi". + :type workload_runtime: str or ~azure.mgmt.containerservice.v2021_08_01.models.WorkloadRuntime + :param vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. + If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just + nodes. This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :type vnet_subnet_id: str + :param pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see + vnetSubnetID for more details). This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :type pod_subnet_id: str + :param max_pods: The maximum number of pods that can run on a node. + :type max_pods: int + :param os_type: The operating system type. The default is Linux. Possible values include: + "Linux", "Windows". Default value: "Linux". + :type os_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSType + :param os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. + Possible values include: "Ubuntu", "CBLMariner". + :type os_sku: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSSKU + :param max_count: The maximum number of nodes for auto-scaling. + :type max_count: int + :param min_count: The minimum number of nodes for auto-scaling. + :type min_count: int + :param enable_auto_scaling: Whether to enable auto-scaler. + :type enable_auto_scaling: bool + :param scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it + defaults to Delete. Possible values include: "Delete", "Deallocate". + :type scale_down_mode: str or ~azure.mgmt.containerservice.v2021_08_01.models.ScaleDownMode + :param type_properties_type: The type of Agent Pool. Possible values include: + "VirtualMachineScaleSets", "AvailabilitySet". + :type type_properties_type: str or + ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolType + :param mode: A cluster must have at least one 'System' Agent Pool at all times. For additional + information on agent pool restrictions and best practices, see: + https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", + "User". + :type mode: str or ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolMode + :param orchestrator_version: As a best practice, you should upgrade all node pools in an AKS + cluster to the same Kubernetes version. The node pool version must have the same major version + as the control plane. The node pool minor version must be within two minor versions of the + control plane version. The node pool version cannot be greater than the control plane version. + For more information see `upgrading a node pool + `_. + :type orchestrator_version: str + :ivar node_image_version: The version of node image. + :vartype node_image_version: str + :param upgrade_settings: Settings for upgrading the agentpool. + :type upgrade_settings: + ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolUpgradeSettings + :ivar provisioning_state: The current deployment or provisioning state. + :vartype provisioning_state: str + :ivar power_state: Describes whether the Agent Pool is Running or Stopped. + :vartype power_state: ~azure.mgmt.containerservice.v2021_08_01.models.PowerState + :param availability_zones: The list of Availability zones to use for nodes. This can only be + specified if the AgentPoolType property is 'VirtualMachineScaleSets'. + :type availability_zones: list[str] + :param enable_node_public_ip: Some scenarios may require nodes in a node pool to receive their + own dedicated public IP addresses. A common scenario is for gaming workloads, where a console + needs to make a direct connection to a cloud virtual machine to minimize hops. For more + information see `assigning a public IP per node + `_. + The default is false. + :type enable_node_public_ip: bool + :param node_public_ip_prefix_id: This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. + :type node_public_ip_prefix_id: str + :param scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the + default is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". + :type scale_set_priority: str or + ~azure.mgmt.containerservice.v2021_08_01.models.ScaleSetPriority + :param scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is + 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", + "Deallocate". Default value: "Delete". + :type scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2021_08_01.models.ScaleSetEvictionPolicy + :param spot_max_price: Possible values are any decimal value greater than zero or -1 which + indicates the willingness to pay any on-demand price. For more details on spot pricing, see + `spot VMs pricing `_. + :type spot_max_price: float + :param tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale + set. + :type tags: dict[str, str] + :param node_labels: The node labels to be persisted across all nodes in agent pool. + :type node_labels: dict[str, str] + :param node_taints: The taints added to new nodes during node pool create and scale. For + example, key=value:NoSchedule. + :type node_taints: list[str] + :param proximity_placement_group_id: The ID for Proximity Placement Group. + :type proximity_placement_group_id: str + :param kubelet_config: The Kubelet configuration on the agent pool nodes. + :type kubelet_config: ~azure.mgmt.containerservice.v2021_08_01.models.KubeletConfig + :param linux_os_config: The OS configuration of Linux agent nodes. + :type linux_os_config: ~azure.mgmt.containerservice.v2021_08_01.models.LinuxOSConfig + :param enable_encryption_at_host: This is only supported on certain VM sizes and in certain + Azure regions. For more information, see: + https://docs.microsoft.com/azure/aks/enable-host-encryption. + :type enable_encryption_at_host: bool + :param enable_ultra_ssd: Whether to enable UltraSSD. + :type enable_ultra_ssd: bool + :param enable_fips: See `Add a FIPS-enabled node pool + `_ + for more details. + :type enable_fips: bool + :param gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile + for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", "MIG7g". + :type gpu_instance_profile: str or + ~azure.mgmt.containerservice.v2021_08_01.models.GPUInstanceProfile + :param creation_data: CreationData to be used to specify the source Snapshot ID if the node + pool will be created/upgraded using a snapshot. + :type creation_data: ~azure.mgmt.containerservice.v2021_08_01.models.CreationData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'os_disk_size_gb': {'maximum': 2048, 'minimum': 0}, + 'node_image_version': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'power_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'count': {'key': 'properties.count', 'type': 'int'}, + 'vm_size': {'key': 'properties.vmSize', 'type': 'str'}, + 'os_disk_size_gb': {'key': 'properties.osDiskSizeGB', 'type': 'int'}, + 'os_disk_type': {'key': 'properties.osDiskType', 'type': 'str'}, + 'kubelet_disk_type': {'key': 'properties.kubeletDiskType', 'type': 'str'}, + 'workload_runtime': {'key': 'properties.workloadRuntime', 'type': 'str'}, + 'vnet_subnet_id': {'key': 'properties.vnetSubnetID', 'type': 'str'}, + 'pod_subnet_id': {'key': 'properties.podSubnetID', 'type': 'str'}, + 'max_pods': {'key': 'properties.maxPods', 'type': 'int'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'os_sku': {'key': 'properties.osSKU', 'type': 'str'}, + 'max_count': {'key': 'properties.maxCount', 'type': 'int'}, + 'min_count': {'key': 'properties.minCount', 'type': 'int'}, + 'enable_auto_scaling': {'key': 'properties.enableAutoScaling', 'type': 'bool'}, + 'scale_down_mode': {'key': 'properties.scaleDownMode', 'type': 'str'}, + 'type_properties_type': {'key': 'properties.type', 'type': 'str'}, + 'mode': {'key': 'properties.mode', 'type': 'str'}, + 'orchestrator_version': {'key': 'properties.orchestratorVersion', 'type': 'str'}, + 'node_image_version': {'key': 'properties.nodeImageVersion', 'type': 'str'}, + 'upgrade_settings': {'key': 'properties.upgradeSettings', 'type': 'AgentPoolUpgradeSettings'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'power_state': {'key': 'properties.powerState', 'type': 'PowerState'}, + 'availability_zones': {'key': 'properties.availabilityZones', 'type': '[str]'}, + 'enable_node_public_ip': {'key': 'properties.enableNodePublicIP', 'type': 'bool'}, + 'node_public_ip_prefix_id': {'key': 'properties.nodePublicIPPrefixID', 'type': 'str'}, + 'scale_set_priority': {'key': 'properties.scaleSetPriority', 'type': 'str'}, + 'scale_set_eviction_policy': {'key': 'properties.scaleSetEvictionPolicy', 'type': 'str'}, + 'spot_max_price': {'key': 'properties.spotMaxPrice', 'type': 'float'}, + 'tags': {'key': 'properties.tags', 'type': '{str}'}, + 'node_labels': {'key': 'properties.nodeLabels', 'type': '{str}'}, + 'node_taints': {'key': 'properties.nodeTaints', 'type': '[str]'}, + 'proximity_placement_group_id': {'key': 'properties.proximityPlacementGroupID', 'type': 'str'}, + 'kubelet_config': {'key': 'properties.kubeletConfig', 'type': 'KubeletConfig'}, + 'linux_os_config': {'key': 'properties.linuxOSConfig', 'type': 'LinuxOSConfig'}, + 'enable_encryption_at_host': {'key': 'properties.enableEncryptionAtHost', 'type': 'bool'}, + 'enable_ultra_ssd': {'key': 'properties.enableUltraSSD', 'type': 'bool'}, + 'enable_fips': {'key': 'properties.enableFIPS', 'type': 'bool'}, + 'gpu_instance_profile': {'key': 'properties.gpuInstanceProfile', 'type': 'str'}, + 'creation_data': {'key': 'properties.creationData', 'type': 'CreationData'}, + } + + def __init__( + self, + *, + count: Optional[int] = None, + vm_size: Optional[str] = None, + os_disk_size_gb: Optional[int] = None, + os_disk_type: Optional[Union[str, "OSDiskType"]] = None, + kubelet_disk_type: Optional[Union[str, "KubeletDiskType"]] = None, + workload_runtime: Optional[Union[str, "WorkloadRuntime"]] = None, + vnet_subnet_id: Optional[str] = None, + pod_subnet_id: Optional[str] = None, + max_pods: Optional[int] = None, + os_type: Optional[Union[str, "OSType"]] = "Linux", + os_sku: Optional[Union[str, "OSSKU"]] = None, + max_count: Optional[int] = None, + min_count: Optional[int] = None, + enable_auto_scaling: Optional[bool] = None, + scale_down_mode: Optional[Union[str, "ScaleDownMode"]] = None, + type_properties_type: Optional[Union[str, "AgentPoolType"]] = None, + mode: Optional[Union[str, "AgentPoolMode"]] = None, + orchestrator_version: Optional[str] = None, + upgrade_settings: Optional["AgentPoolUpgradeSettings"] = None, + availability_zones: Optional[List[str]] = None, + enable_node_public_ip: Optional[bool] = None, + node_public_ip_prefix_id: Optional[str] = None, + scale_set_priority: Optional[Union[str, "ScaleSetPriority"]] = "Regular", + scale_set_eviction_policy: Optional[Union[str, "ScaleSetEvictionPolicy"]] = "Delete", + spot_max_price: Optional[float] = -1, + tags: Optional[Dict[str, str]] = None, + node_labels: Optional[Dict[str, str]] = None, + node_taints: Optional[List[str]] = None, + proximity_placement_group_id: Optional[str] = None, + kubelet_config: Optional["KubeletConfig"] = None, + linux_os_config: Optional["LinuxOSConfig"] = None, + enable_encryption_at_host: Optional[bool] = None, + enable_ultra_ssd: Optional[bool] = None, + enable_fips: Optional[bool] = None, + gpu_instance_profile: Optional[Union[str, "GPUInstanceProfile"]] = None, + creation_data: Optional["CreationData"] = None, + **kwargs + ): + super(AgentPool, self).__init__(**kwargs) + self.count = count + self.vm_size = vm_size + self.os_disk_size_gb = os_disk_size_gb + self.os_disk_type = os_disk_type + self.kubelet_disk_type = kubelet_disk_type + self.workload_runtime = workload_runtime + self.vnet_subnet_id = vnet_subnet_id + self.pod_subnet_id = pod_subnet_id + self.max_pods = max_pods + self.os_type = os_type + self.os_sku = os_sku + self.max_count = max_count + self.min_count = min_count + self.enable_auto_scaling = enable_auto_scaling + self.scale_down_mode = scale_down_mode + self.type_properties_type = type_properties_type + self.mode = mode + self.orchestrator_version = orchestrator_version + self.node_image_version = None + self.upgrade_settings = upgrade_settings + self.provisioning_state = None + self.power_state = None + self.availability_zones = availability_zones + self.enable_node_public_ip = enable_node_public_ip + self.node_public_ip_prefix_id = node_public_ip_prefix_id + self.scale_set_priority = scale_set_priority + self.scale_set_eviction_policy = scale_set_eviction_policy + self.spot_max_price = spot_max_price + self.tags = tags + self.node_labels = node_labels + self.node_taints = node_taints + self.proximity_placement_group_id = proximity_placement_group_id + self.kubelet_config = kubelet_config + self.linux_os_config = linux_os_config + self.enable_encryption_at_host = enable_encryption_at_host + self.enable_ultra_ssd = enable_ultra_ssd + self.enable_fips = enable_fips + self.gpu_instance_profile = gpu_instance_profile + self.creation_data = creation_data + + +class AgentPoolAvailableVersions(msrest.serialization.Model): + """The list of available versions for an agent pool. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The ID of the agent pool version list. + :vartype id: str + :ivar name: The name of the agent pool version list. + :vartype name: str + :ivar type: Type of the agent pool version list. + :vartype type: str + :param agent_pool_versions: List of versions available for agent pool. + :type agent_pool_versions: + list[~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'agent_pool_versions': {'key': 'properties.agentPoolVersions', 'type': '[AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem]'}, + } + + def __init__( + self, + *, + agent_pool_versions: Optional[List["AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem"]] = None, + **kwargs + ): + super(AgentPoolAvailableVersions, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.agent_pool_versions = agent_pool_versions + + +class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(msrest.serialization.Model): + """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. + + :param default: Whether this version is the default agent pool version. + :type default: bool + :param kubernetes_version: The Kubernetes version (major.minor.patch). + :type kubernetes_version: str + :param is_preview: Whether Kubernetes version is currently in preview. + :type is_preview: bool + """ + + _attribute_map = { + 'default': {'key': 'default', 'type': 'bool'}, + 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, + 'is_preview': {'key': 'isPreview', 'type': 'bool'}, + } + + def __init__( + self, + *, + default: Optional[bool] = None, + kubernetes_version: Optional[str] = None, + is_preview: Optional[bool] = None, + **kwargs + ): + super(AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem, self).__init__(**kwargs) + self.default = default + self.kubernetes_version = kubernetes_version + self.is_preview = is_preview + + +class AgentPoolListResult(msrest.serialization.Model): + """The response from the List Agent Pools operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: The list of agent pools. + :type value: list[~azure.mgmt.containerservice.v2021_08_01.models.AgentPool] + :ivar next_link: The URL to get the next set of agent pool results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AgentPool]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["AgentPool"]] = None, + **kwargs + ): + super(AgentPoolListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class AgentPoolUpgradeProfile(msrest.serialization.Model): + """The list of available upgrades for an agent pool. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The ID of the agent pool upgrade profile. + :vartype id: str + :ivar name: The name of the agent pool upgrade profile. + :vartype name: str + :ivar type: The type of the agent pool upgrade profile. + :vartype type: str + :param kubernetes_version: Required. The Kubernetes version (major.minor.patch). + :type kubernetes_version: str + :param os_type: Required. The operating system type. The default is Linux. Possible values + include: "Linux", "Windows". Default value: "Linux". + :type os_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSType + :param upgrades: List of orchestrator types and versions available for upgrade. + :type upgrades: + list[~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] + :param latest_node_image_version: The latest AKS supported node image version. + :type latest_node_image_version: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kubernetes_version': {'required': True}, + 'os_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'upgrades': {'key': 'properties.upgrades', 'type': '[AgentPoolUpgradeProfilePropertiesUpgradesItem]'}, + 'latest_node_image_version': {'key': 'properties.latestNodeImageVersion', 'type': 'str'}, + } + + def __init__( + self, + *, + kubernetes_version: str, + os_type: Union[str, "OSType"] = "Linux", + upgrades: Optional[List["AgentPoolUpgradeProfilePropertiesUpgradesItem"]] = None, + latest_node_image_version: Optional[str] = None, + **kwargs + ): + super(AgentPoolUpgradeProfile, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.kubernetes_version = kubernetes_version + self.os_type = os_type + self.upgrades = upgrades + self.latest_node_image_version = latest_node_image_version + + +class AgentPoolUpgradeProfilePropertiesUpgradesItem(msrest.serialization.Model): + """AgentPoolUpgradeProfilePropertiesUpgradesItem. + + :param kubernetes_version: The Kubernetes version (major.minor.patch). + :type kubernetes_version: str + :param is_preview: Whether the Kubernetes version is currently in preview. + :type is_preview: bool + """ + + _attribute_map = { + 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, + 'is_preview': {'key': 'isPreview', 'type': 'bool'}, + } + + def __init__( + self, + *, + kubernetes_version: Optional[str] = None, + is_preview: Optional[bool] = None, + **kwargs + ): + super(AgentPoolUpgradeProfilePropertiesUpgradesItem, self).__init__(**kwargs) + self.kubernetes_version = kubernetes_version + self.is_preview = is_preview + + +class AgentPoolUpgradeSettings(msrest.serialization.Model): + """Settings for upgrading an agentpool. + + :param max_surge: This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). + If a percentage is specified, it is the percentage of the total agent pool size at the time of + the upgrade. For percentages, fractional nodes are rounded up. If not specified, the default is + 1. For more information, including best practices, see: + https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade. + :type max_surge: str + """ + + _attribute_map = { + 'max_surge': {'key': 'maxSurge', 'type': 'str'}, + } + + def __init__( + self, + *, + max_surge: Optional[str] = None, + **kwargs + ): + super(AgentPoolUpgradeSettings, self).__init__(**kwargs) + self.max_surge = max_surge + + +class CloudErrorBody(msrest.serialization.Model): + """An error response from the Container service. + + :param code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable for display in a user + interface. + :type message: str + :param target: The target of the particular error. For example, the name of the property in + error. + :type target: str + :param details: A list of additional details about the error. + :type details: list[~azure.mgmt.containerservice.v2021_08_01.models.CloudErrorBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + target: Optional[str] = None, + details: Optional[List["CloudErrorBody"]] = None, + **kwargs + ): + super(CloudErrorBody, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + + +class ContainerServiceDiagnosticsProfile(msrest.serialization.Model): + """Profile for diagnostics on the container service cluster. + + All required parameters must be populated in order to send to Azure. + + :param vm_diagnostics: Required. Profile for diagnostics on the container service VMs. + :type vm_diagnostics: + ~azure.mgmt.containerservice.v2021_08_01.models.ContainerServiceVMDiagnostics + """ + + _validation = { + 'vm_diagnostics': {'required': True}, + } + + _attribute_map = { + 'vm_diagnostics': {'key': 'vmDiagnostics', 'type': 'ContainerServiceVMDiagnostics'}, + } + + def __init__( + self, + *, + vm_diagnostics: "ContainerServiceVMDiagnostics", + **kwargs + ): + super(ContainerServiceDiagnosticsProfile, self).__init__(**kwargs) + self.vm_diagnostics = vm_diagnostics + + +class ContainerServiceLinuxProfile(msrest.serialization.Model): + """Profile for Linux VMs in the container service cluster. + + All required parameters must be populated in order to send to Azure. + + :param admin_username: Required. The administrator username to use for Linux VMs. + :type admin_username: str + :param ssh: Required. The SSH configuration for Linux-based VMs running on Azure. + :type ssh: ~azure.mgmt.containerservice.v2021_08_01.models.ContainerServiceSshConfiguration + """ + + _validation = { + 'admin_username': {'required': True, 'pattern': r'^[A-Za-z][-A-Za-z0-9_]*$'}, + 'ssh': {'required': True}, + } + + _attribute_map = { + 'admin_username': {'key': 'adminUsername', 'type': 'str'}, + 'ssh': {'key': 'ssh', 'type': 'ContainerServiceSshConfiguration'}, + } + + def __init__( + self, + *, + admin_username: str, + ssh: "ContainerServiceSshConfiguration", + **kwargs + ): + super(ContainerServiceLinuxProfile, self).__init__(**kwargs) + self.admin_username = admin_username + self.ssh = ssh + + +class ContainerServiceMasterProfile(msrest.serialization.Model): + """Profile for the container service master. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param count: Number of masters (VMs) in the container service cluster. Allowed values are 1, + 3, and 5. The default value is 1. Possible values include: 1, 3, 5. Default value: "1". + :type count: str or ~azure.mgmt.containerservice.v2021_08_01.models.Count + :param dns_prefix: Required. DNS prefix to be used to create the FQDN for the master pool. + :type dns_prefix: str + :param vm_size: Required. Size of agent VMs. Possible values include: "Standard_A1", + "Standard_A10", "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", + "Standard_A2m_v2", "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", + "Standard_A5", "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", + "Standard_A8m_v2", "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", + "Standard_B8ms", "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", + "Standard_D12", "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", "Standard_NV6". + :type vm_size: str or + ~azure.mgmt.containerservice.v2021_08_01.models.ContainerServiceVMSizeTypes + :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :type os_disk_size_gb: int + :param vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :type vnet_subnet_id: str + :param first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static + ip of masters. + :type first_consecutive_static_ip: str + :param storage_profile: Storage profile specifies what kind of storage used. Choose from + StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the + orchestrator choice. Possible values include: "StorageAccount", "ManagedDisks". + :type storage_profile: str or + ~azure.mgmt.containerservice.v2021_08_01.models.ContainerServiceStorageProfileTypes + :ivar fqdn: FQDN for the master pool. + :vartype fqdn: str + """ + + _validation = { + 'dns_prefix': {'required': True}, + 'vm_size': {'required': True}, + 'os_disk_size_gb': {'maximum': 2048, 'minimum': 0}, + 'fqdn': {'readonly': True}, + } + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + 'dns_prefix': {'key': 'dnsPrefix', 'type': 'str'}, + 'vm_size': {'key': 'vmSize', 'type': 'str'}, + 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, + 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, + 'first_consecutive_static_ip': {'key': 'firstConsecutiveStaticIP', 'type': 'str'}, + 'storage_profile': {'key': 'storageProfile', 'type': 'str'}, + 'fqdn': {'key': 'fqdn', 'type': 'str'}, + } + + def __init__( + self, + *, + dns_prefix: str, + vm_size: Union[str, "ContainerServiceVMSizeTypes"], + count: Optional[Union[int, "Count"]] = "1", + os_disk_size_gb: Optional[int] = None, + vnet_subnet_id: Optional[str] = None, + first_consecutive_static_ip: Optional[str] = "10.240.255.5", + storage_profile: Optional[Union[str, "ContainerServiceStorageProfileTypes"]] = None, + **kwargs + ): + super(ContainerServiceMasterProfile, self).__init__(**kwargs) + self.count = count + self.dns_prefix = dns_prefix + self.vm_size = vm_size + self.os_disk_size_gb = os_disk_size_gb + self.vnet_subnet_id = vnet_subnet_id + self.first_consecutive_static_ip = first_consecutive_static_ip + self.storage_profile = storage_profile + self.fqdn = None + + +class ContainerServiceNetworkProfile(msrest.serialization.Model): + """Profile of network configuration. + + :param network_plugin: Network plugin used for building the Kubernetes network. Possible values + include: "azure", "kubenet". Default value: "kubenet". + :type network_plugin: str or ~azure.mgmt.containerservice.v2021_08_01.models.NetworkPlugin + :param network_policy: Network policy used for building the Kubernetes network. Possible values + include: "calico", "azure". + :type network_policy: str or ~azure.mgmt.containerservice.v2021_08_01.models.NetworkPolicy + :param network_mode: This cannot be specified if networkPlugin is anything other than 'azure'. + Possible values include: "transparent", "bridge". + :type network_mode: str or ~azure.mgmt.containerservice.v2021_08_01.models.NetworkMode + :param pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + :type pod_cidr: str + :param service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must + not overlap with any Subnet IP ranges. + :type service_cidr: str + :param dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within + the Kubernetes service address range specified in serviceCidr. + :type dns_service_ip: str + :param docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It + must not overlap with any Subnet IP ranges or the Kubernetes service address range. + :type docker_bridge_cidr: str + :param outbound_type: This can only be set at cluster creation time and cannot be changed + later. For more information see `egress outbound type + `_. Possible values include: + "loadBalancer", "userDefinedRouting", "managedNATGateway", "userAssignedNATGateway". Default + value: "loadBalancer". + :type outbound_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OutboundType + :param load_balancer_sku: The default is 'standard'. See `Azure Load Balancer SKUs + `_ for more information about the + differences between load balancer SKUs. Possible values include: "standard", "basic". + :type load_balancer_sku: str or ~azure.mgmt.containerservice.v2021_08_01.models.LoadBalancerSku + :param load_balancer_profile: Profile of the cluster load balancer. + :type load_balancer_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterLoadBalancerProfile + :param nat_gateway_profile: Profile of the cluster NAT gateway. + :type nat_gateway_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterNATGatewayProfile + """ + + _validation = { + 'pod_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, + 'service_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, + 'dns_service_ip': {'pattern': r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'}, + 'docker_bridge_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, + } + + _attribute_map = { + 'network_plugin': {'key': 'networkPlugin', 'type': 'str'}, + 'network_policy': {'key': 'networkPolicy', 'type': 'str'}, + 'network_mode': {'key': 'networkMode', 'type': 'str'}, + 'pod_cidr': {'key': 'podCidr', 'type': 'str'}, + 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, + 'dns_service_ip': {'key': 'dnsServiceIP', 'type': 'str'}, + 'docker_bridge_cidr': {'key': 'dockerBridgeCidr', 'type': 'str'}, + 'outbound_type': {'key': 'outboundType', 'type': 'str'}, + 'load_balancer_sku': {'key': 'loadBalancerSku', 'type': 'str'}, + 'load_balancer_profile': {'key': 'loadBalancerProfile', 'type': 'ManagedClusterLoadBalancerProfile'}, + 'nat_gateway_profile': {'key': 'natGatewayProfile', 'type': 'ManagedClusterNATGatewayProfile'}, + } + + def __init__( + self, + *, + network_plugin: Optional[Union[str, "NetworkPlugin"]] = "kubenet", + network_policy: Optional[Union[str, "NetworkPolicy"]] = None, + network_mode: Optional[Union[str, "NetworkMode"]] = None, + pod_cidr: Optional[str] = "10.244.0.0/16", + service_cidr: Optional[str] = "10.0.0.0/16", + dns_service_ip: Optional[str] = "10.0.0.10", + docker_bridge_cidr: Optional[str] = "172.17.0.1/16", + outbound_type: Optional[Union[str, "OutboundType"]] = "loadBalancer", + load_balancer_sku: Optional[Union[str, "LoadBalancerSku"]] = None, + load_balancer_profile: Optional["ManagedClusterLoadBalancerProfile"] = None, + nat_gateway_profile: Optional["ManagedClusterNATGatewayProfile"] = None, + **kwargs + ): + super(ContainerServiceNetworkProfile, self).__init__(**kwargs) + self.network_plugin = network_plugin + self.network_policy = network_policy + self.network_mode = network_mode + self.pod_cidr = pod_cidr + self.service_cidr = service_cidr + self.dns_service_ip = dns_service_ip + self.docker_bridge_cidr = docker_bridge_cidr + self.outbound_type = outbound_type + self.load_balancer_sku = load_balancer_sku + self.load_balancer_profile = load_balancer_profile + self.nat_gateway_profile = nat_gateway_profile + + +class ContainerServiceSshConfiguration(msrest.serialization.Model): + """SSH configuration for Linux-based VMs running on Azure. + + All required parameters must be populated in order to send to Azure. + + :param public_keys: Required. The list of SSH public keys used to authenticate with Linux-based + VMs. A maximum of 1 key may be specified. + :type public_keys: + list[~azure.mgmt.containerservice.v2021_08_01.models.ContainerServiceSshPublicKey] + """ + + _validation = { + 'public_keys': {'required': True}, + } + + _attribute_map = { + 'public_keys': {'key': 'publicKeys', 'type': '[ContainerServiceSshPublicKey]'}, + } + + def __init__( + self, + *, + public_keys: List["ContainerServiceSshPublicKey"], + **kwargs + ): + super(ContainerServiceSshConfiguration, self).__init__(**kwargs) + self.public_keys = public_keys + + +class ContainerServiceSshPublicKey(msrest.serialization.Model): + """Contains information about SSH certificate public key data. + + All required parameters must be populated in order to send to Azure. + + :param key_data: Required. Certificate public key used to authenticate with VMs through SSH. + The certificate must be in PEM format with or without headers. + :type key_data: str + """ + + _validation = { + 'key_data': {'required': True}, + } + + _attribute_map = { + 'key_data': {'key': 'keyData', 'type': 'str'}, + } + + def __init__( + self, + *, + key_data: str, + **kwargs + ): + super(ContainerServiceSshPublicKey, self).__init__(**kwargs) + self.key_data = key_data + + +class ContainerServiceVMDiagnostics(msrest.serialization.Model): + """Profile for diagnostics on the container service VMs. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. Whether the VM diagnostic agent is provisioned on the VM. + :type enabled: bool + :ivar storage_uri: The URI of the storage account where diagnostics are stored. + :vartype storage_uri: str + """ + + _validation = { + 'enabled': {'required': True}, + 'storage_uri': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'storage_uri': {'key': 'storageUri', 'type': 'str'}, + } + + def __init__( + self, + *, + enabled: bool, + **kwargs + ): + super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) + self.enabled = enabled + self.storage_uri = None + + +class CreationData(msrest.serialization.Model): + """Data used when creating a target resource from a source resource. + + :param source_resource_id: This is the ARM ID of the source object to be used to create the + target object. + :type source_resource_id: str + """ + + _attribute_map = { + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + } + + def __init__( + self, + *, + source_resource_id: Optional[str] = None, + **kwargs + ): + super(CreationData, self).__init__(**kwargs) + self.source_resource_id = source_resource_id + + +class CredentialResult(msrest.serialization.Model): + """The credential result response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The name of the credential. + :vartype name: str + :ivar value: Base64-encoded Kubernetes configuration file. + :vartype value: bytearray + """ + + _validation = { + 'name': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'bytearray'}, + } + + def __init__( + self, + **kwargs + ): + super(CredentialResult, self).__init__(**kwargs) + self.name = None + self.value = None + + +class CredentialResults(msrest.serialization.Model): + """The list credential result response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar kubeconfigs: Base64-encoded Kubernetes configuration file. + :vartype kubeconfigs: list[~azure.mgmt.containerservice.v2021_08_01.models.CredentialResult] + """ + + _validation = { + 'kubeconfigs': {'readonly': True}, + } + + _attribute_map = { + 'kubeconfigs': {'key': 'kubeconfigs', 'type': '[CredentialResult]'}, + } + + def __init__( + self, + **kwargs + ): + super(CredentialResults, self).__init__(**kwargs) + self.kubeconfigs = None + + +class EndpointDependency(msrest.serialization.Model): + """A domain name that AKS agent nodes are reaching at. + + :param domain_name: The domain name of the dependency. + :type domain_name: str + :param endpoint_details: The Ports and Protocols used when connecting to domainName. + :type endpoint_details: list[~azure.mgmt.containerservice.v2021_08_01.models.EndpointDetail] + """ + + _attribute_map = { + 'domain_name': {'key': 'domainName', 'type': 'str'}, + 'endpoint_details': {'key': 'endpointDetails', 'type': '[EndpointDetail]'}, + } + + def __init__( + self, + *, + domain_name: Optional[str] = None, + endpoint_details: Optional[List["EndpointDetail"]] = None, + **kwargs + ): + super(EndpointDependency, self).__init__(**kwargs) + self.domain_name = domain_name + self.endpoint_details = endpoint_details + + +class EndpointDetail(msrest.serialization.Model): + """connect information from the AKS agent nodes to a single endpoint. + + :param ip_address: An IP Address that Domain Name currently resolves to. + :type ip_address: str + :param port: The port an endpoint is connected to. + :type port: int + :param protocol: The protocol used for connection. + :type protocol: str + :param description: Description of the detail. + :type description: str + """ + + _attribute_map = { + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + *, + ip_address: Optional[str] = None, + port: Optional[int] = None, + protocol: Optional[str] = None, + description: Optional[str] = None, + **kwargs + ): + super(EndpointDetail, self).__init__(**kwargs) + self.ip_address = ip_address + self.port = port + self.protocol = protocol + self.description = description + + +class ExtendedLocation(msrest.serialization.Model): + """The complex type of the extended location. + + :param name: The name of the extended location. + :type name: str + :param type: The type of the extended location. Possible values include: "EdgeZone". + :type type: str or ~azure.mgmt.containerservice.v2021_08_01.models.ExtendedLocationTypes + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + type: Optional[Union[str, "ExtendedLocationTypes"]] = None, + **kwargs + ): + super(ExtendedLocation, self).__init__(**kwargs) + self.name = name + self.type = type + + +class KubeletConfig(msrest.serialization.Model): + """See `AKS custom node configuration `_ for more details. + + :param cpu_manager_policy: The default is 'none'. See `Kubernetes CPU management policies + `_ + for more information. Allowed values are 'none' and 'static'. + :type cpu_manager_policy: str + :param cpu_cfs_quota: The default is true. + :type cpu_cfs_quota: bool + :param cpu_cfs_quota_period: The default is '100ms.' Valid values are a sequence of decimal + numbers with an optional fraction and a unit suffix. For example: '300ms', '2h45m'. Supported + units are 'ns', 'us', 'ms', 's', 'm', and 'h'. + :type cpu_cfs_quota_period: str + :param image_gc_high_threshold: To disable image garbage collection, set to 100. The default is + 85%. + :type image_gc_high_threshold: int + :param image_gc_low_threshold: This cannot be set higher than imageGcHighThreshold. The default + is 80%. + :type image_gc_low_threshold: int + :param topology_manager_policy: For more information see `Kubernetes Topology Manager + `_. The default is + 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. + :type topology_manager_policy: str + :param allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending + in ``*``\ ). + :type allowed_unsafe_sysctls: list[str] + :param fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled + on the node. + :type fail_swap_on: bool + :param container_log_max_size_mb: The maximum size (e.g. 10Mi) of container log file before it + is rotated. + :type container_log_max_size_mb: int + :param container_log_max_files: The maximum number of container log files that can be present + for a container. The number must be ≥ 2. + :type container_log_max_files: int + :param pod_max_pids: The maximum number of processes per pod. + :type pod_max_pids: int + """ + + _validation = { + 'container_log_max_files': {'minimum': 2}, + } + + _attribute_map = { + 'cpu_manager_policy': {'key': 'cpuManagerPolicy', 'type': 'str'}, + 'cpu_cfs_quota': {'key': 'cpuCfsQuota', 'type': 'bool'}, + 'cpu_cfs_quota_period': {'key': 'cpuCfsQuotaPeriod', 'type': 'str'}, + 'image_gc_high_threshold': {'key': 'imageGcHighThreshold', 'type': 'int'}, + 'image_gc_low_threshold': {'key': 'imageGcLowThreshold', 'type': 'int'}, + 'topology_manager_policy': {'key': 'topologyManagerPolicy', 'type': 'str'}, + 'allowed_unsafe_sysctls': {'key': 'allowedUnsafeSysctls', 'type': '[str]'}, + 'fail_swap_on': {'key': 'failSwapOn', 'type': 'bool'}, + 'container_log_max_size_mb': {'key': 'containerLogMaxSizeMB', 'type': 'int'}, + 'container_log_max_files': {'key': 'containerLogMaxFiles', 'type': 'int'}, + 'pod_max_pids': {'key': 'podMaxPids', 'type': 'int'}, + } + + def __init__( + self, + *, + cpu_manager_policy: Optional[str] = None, + cpu_cfs_quota: Optional[bool] = None, + cpu_cfs_quota_period: Optional[str] = None, + image_gc_high_threshold: Optional[int] = None, + image_gc_low_threshold: Optional[int] = None, + topology_manager_policy: Optional[str] = None, + allowed_unsafe_sysctls: Optional[List[str]] = None, + fail_swap_on: Optional[bool] = None, + container_log_max_size_mb: Optional[int] = None, + container_log_max_files: Optional[int] = None, + pod_max_pids: Optional[int] = None, + **kwargs + ): + super(KubeletConfig, self).__init__(**kwargs) + self.cpu_manager_policy = cpu_manager_policy + self.cpu_cfs_quota = cpu_cfs_quota + self.cpu_cfs_quota_period = cpu_cfs_quota_period + self.image_gc_high_threshold = image_gc_high_threshold + self.image_gc_low_threshold = image_gc_low_threshold + self.topology_manager_policy = topology_manager_policy + self.allowed_unsafe_sysctls = allowed_unsafe_sysctls + self.fail_swap_on = fail_swap_on + self.container_log_max_size_mb = container_log_max_size_mb + self.container_log_max_files = container_log_max_files + self.pod_max_pids = pod_max_pids + + +class LinuxOSConfig(msrest.serialization.Model): + """See `AKS custom node configuration `_ for more details. + + :param sysctls: Sysctl settings for Linux agent nodes. + :type sysctls: ~azure.mgmt.containerservice.v2021_08_01.models.SysctlConfig + :param transparent_huge_page_enabled: Valid values are 'always', 'madvise', and 'never'. The + default is 'always'. For more information see `Transparent Hugepages + `_. + :type transparent_huge_page_enabled: str + :param transparent_huge_page_defrag: Valid values are 'always', 'defer', 'defer+madvise', + 'madvise' and 'never'. The default is 'madvise'. For more information see `Transparent + Hugepages + `_. + :type transparent_huge_page_defrag: str + :param swap_file_size_mb: The size in MB of a swap file that will be created on each node. + :type swap_file_size_mb: int + """ + + _attribute_map = { + 'sysctls': {'key': 'sysctls', 'type': 'SysctlConfig'}, + 'transparent_huge_page_enabled': {'key': 'transparentHugePageEnabled', 'type': 'str'}, + 'transparent_huge_page_defrag': {'key': 'transparentHugePageDefrag', 'type': 'str'}, + 'swap_file_size_mb': {'key': 'swapFileSizeMB', 'type': 'int'}, + } + + def __init__( + self, + *, + sysctls: Optional["SysctlConfig"] = None, + transparent_huge_page_enabled: Optional[str] = None, + transparent_huge_page_defrag: Optional[str] = None, + swap_file_size_mb: Optional[int] = None, + **kwargs + ): + super(LinuxOSConfig, self).__init__(**kwargs) + self.sysctls = sysctls + self.transparent_huge_page_enabled = transparent_huge_page_enabled + self.transparent_huge_page_defrag = transparent_huge_page_defrag + self.swap_file_size_mb = swap_file_size_mb + + +class MaintenanceConfiguration(SubResource): + """See `planned maintenance `_ for more information about planned maintenance. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: The name of the resource that is unique within a resource group. This name can be + used to access the resource. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.containerservice.v2021_08_01.models.SystemData + :param time_in_week: If two array entries specify the same day of the week, the applied + configuration is the union of times in both entries. + :type time_in_week: list[~azure.mgmt.containerservice.v2021_08_01.models.TimeInWeek] + :param not_allowed_time: Time slots on which upgrade is not allowed. + :type not_allowed_time: list[~azure.mgmt.containerservice.v2021_08_01.models.TimeSpan] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'time_in_week': {'key': 'properties.timeInWeek', 'type': '[TimeInWeek]'}, + 'not_allowed_time': {'key': 'properties.notAllowedTime', 'type': '[TimeSpan]'}, + } + + def __init__( + self, + *, + time_in_week: Optional[List["TimeInWeek"]] = None, + not_allowed_time: Optional[List["TimeSpan"]] = None, + **kwargs + ): + super(MaintenanceConfiguration, self).__init__(**kwargs) + self.system_data = None + self.time_in_week = time_in_week + self.not_allowed_time = not_allowed_time + + +class MaintenanceConfigurationListResult(msrest.serialization.Model): + """The response from the List maintenance configurations operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: The list of maintenance configurations. + :type value: list[~azure.mgmt.containerservice.v2021_08_01.models.MaintenanceConfiguration] + :ivar next_link: The URL to get the next set of maintenance configuration results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[MaintenanceConfiguration]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["MaintenanceConfiguration"]] = None, + **kwargs + ): + super(MaintenanceConfigurationListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class Resource(msrest.serialization.Model): + """The Resource model definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags + + +class ManagedCluster(Resource): + """Managed cluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param sku: The managed cluster SKU. + :type sku: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterSKU + :param extended_location: The extended location of the Virtual Machine. + :type extended_location: ~azure.mgmt.containerservice.v2021_08_01.models.ExtendedLocation + :param identity: The identity of the managed cluster, if configured. + :type identity: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterIdentity + :ivar provisioning_state: The current provisioning state. + :vartype provisioning_state: str + :ivar power_state: The Power State of the cluster. + :vartype power_state: ~azure.mgmt.containerservice.v2021_08_01.models.PowerState + :ivar max_agent_pools: The max number of agent pools for the managed cluster. + :vartype max_agent_pools: int + :param kubernetes_version: When you upgrade a supported AKS cluster, Kubernetes minor versions + cannot be skipped. All upgrades must be performed sequentially by major version number. For + example, upgrades between 1.14.x -> 1.15.x or 1.15.x -> 1.16.x are allowed, however 1.14.x -> + 1.16.x is not allowed. See `upgrading an AKS cluster + `_ for more details. + :type kubernetes_version: str + :param dns_prefix: This cannot be updated once the Managed Cluster has been created. + :type dns_prefix: str + :param fqdn_subdomain: This cannot be updated once the Managed Cluster has been created. + :type fqdn_subdomain: str + :ivar fqdn: The FQDN of the master pool. + :vartype fqdn: str + :ivar private_fqdn: The FQDN of private cluster. + :vartype private_fqdn: str + :ivar azure_portal_fqdn: The Azure Portal requires certain Cross-Origin Resource Sharing (CORS) + headers to be sent in some responses, which Kubernetes APIServer doesn't handle by default. + This special FQDN supports CORS, allowing the Azure Portal to function properly. + :vartype azure_portal_fqdn: str + :param agent_pool_profiles: The agent pool properties. + :type agent_pool_profiles: + list[~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterAgentPoolProfile] + :param linux_profile: The profile for Linux VMs in the Managed Cluster. + :type linux_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ContainerServiceLinuxProfile + :param windows_profile: The profile for Windows VMs in the Managed Cluster. + :type windows_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterWindowsProfile + :param service_principal_profile: Information about a service principal identity for the + cluster to use for manipulating Azure APIs. + :type service_principal_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterServicePrincipalProfile + :param addon_profiles: The profile of managed cluster add-on. + :type addon_profiles: dict[str, + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterAddonProfile] + :param pod_identity_profile: See `use AAD pod identity + `_ for more details on AAD pod + identity integration. + :type pod_identity_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPodIdentityProfile + :param node_resource_group: The name of the resource group containing agent pool nodes. + :type node_resource_group: str + :param enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :type enable_rbac: bool + :param enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + policy (preview). This feature is set for removal on October 15th, 2020. Learn more at + aka.ms/aks/azpodpolicy. + :type enable_pod_security_policy: bool + :param network_profile: The network configuration profile. + :type network_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ContainerServiceNetworkProfile + :param aad_profile: The Azure Active Directory configuration. + :type aad_profile: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterAADProfile + :param auto_upgrade_profile: The auto upgrade configuration. + :type auto_upgrade_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterAutoUpgradeProfile + :param auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. + :type auto_scaler_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPropertiesAutoScalerProfile + :param api_server_access_profile: The access profile for managed cluster API server. + :type api_server_access_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterAPIServerAccessProfile + :param disk_encryption_set_id: This is of the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'. + :type disk_encryption_set_id: str + :param identity_profile: Identities associated with the cluster. + :type identity_profile: dict[str, + ~azure.mgmt.containerservice.v2021_08_01.models.UserAssignedIdentity] + :param private_link_resources: Private link resources associated with the cluster. + :type private_link_resources: + list[~azure.mgmt.containerservice.v2021_08_01.models.PrivateLinkResource] + :param disable_local_accounts: If set to true, getting static credentials will be disabled for + this cluster. This must only be used on Managed Clusters that are AAD enabled. For more details + see `disable local accounts + `_. + :type disable_local_accounts: bool + :param http_proxy_config: Configurations for provisioning the cluster with HTTP proxy servers. + :type http_proxy_config: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterHTTPProxyConfig + :param security_profile: Security profile for the managed cluster. + :type security_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterSecurityProfile + :param public_network_access: Default value is 'Enabled' (case insensitive). Could be set to + 'Disabled' to enable private cluster. Possible values include: "Enabled", "Disabled". + :type public_network_access: str or + ~azure.mgmt.containerservice.v2021_08_01.models.PublicNetworkAccess + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'power_state': {'readonly': True}, + 'max_agent_pools': {'readonly': True}, + 'fqdn': {'readonly': True}, + 'private_fqdn': {'readonly': True}, + 'azure_portal_fqdn': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'ManagedClusterSKU'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'identity': {'key': 'identity', 'type': 'ManagedClusterIdentity'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'power_state': {'key': 'properties.powerState', 'type': 'PowerState'}, + 'max_agent_pools': {'key': 'properties.maxAgentPools', 'type': 'int'}, + 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, + 'dns_prefix': {'key': 'properties.dnsPrefix', 'type': 'str'}, + 'fqdn_subdomain': {'key': 'properties.fqdnSubdomain', 'type': 'str'}, + 'fqdn': {'key': 'properties.fqdn', 'type': 'str'}, + 'private_fqdn': {'key': 'properties.privateFQDN', 'type': 'str'}, + 'azure_portal_fqdn': {'key': 'properties.azurePortalFQDN', 'type': 'str'}, + 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterAgentPoolProfile]'}, + 'linux_profile': {'key': 'properties.linuxProfile', 'type': 'ContainerServiceLinuxProfile'}, + 'windows_profile': {'key': 'properties.windowsProfile', 'type': 'ManagedClusterWindowsProfile'}, + 'service_principal_profile': {'key': 'properties.servicePrincipalProfile', 'type': 'ManagedClusterServicePrincipalProfile'}, + 'addon_profiles': {'key': 'properties.addonProfiles', 'type': '{ManagedClusterAddonProfile}'}, + 'pod_identity_profile': {'key': 'properties.podIdentityProfile', 'type': 'ManagedClusterPodIdentityProfile'}, + 'node_resource_group': {'key': 'properties.nodeResourceGroup', 'type': 'str'}, + 'enable_rbac': {'key': 'properties.enableRBAC', 'type': 'bool'}, + 'enable_pod_security_policy': {'key': 'properties.enablePodSecurityPolicy', 'type': 'bool'}, + 'network_profile': {'key': 'properties.networkProfile', 'type': 'ContainerServiceNetworkProfile'}, + 'aad_profile': {'key': 'properties.aadProfile', 'type': 'ManagedClusterAADProfile'}, + 'auto_upgrade_profile': {'key': 'properties.autoUpgradeProfile', 'type': 'ManagedClusterAutoUpgradeProfile'}, + 'auto_scaler_profile': {'key': 'properties.autoScalerProfile', 'type': 'ManagedClusterPropertiesAutoScalerProfile'}, + 'api_server_access_profile': {'key': 'properties.apiServerAccessProfile', 'type': 'ManagedClusterAPIServerAccessProfile'}, + 'disk_encryption_set_id': {'key': 'properties.diskEncryptionSetID', 'type': 'str'}, + 'identity_profile': {'key': 'properties.identityProfile', 'type': '{UserAssignedIdentity}'}, + 'private_link_resources': {'key': 'properties.privateLinkResources', 'type': '[PrivateLinkResource]'}, + 'disable_local_accounts': {'key': 'properties.disableLocalAccounts', 'type': 'bool'}, + 'http_proxy_config': {'key': 'properties.httpProxyConfig', 'type': 'ManagedClusterHTTPProxyConfig'}, + 'security_profile': {'key': 'properties.securityProfile', 'type': 'ManagedClusterSecurityProfile'}, + 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + sku: Optional["ManagedClusterSKU"] = None, + extended_location: Optional["ExtendedLocation"] = None, + identity: Optional["ManagedClusterIdentity"] = None, + kubernetes_version: Optional[str] = None, + dns_prefix: Optional[str] = None, + fqdn_subdomain: Optional[str] = None, + agent_pool_profiles: Optional[List["ManagedClusterAgentPoolProfile"]] = None, + linux_profile: Optional["ContainerServiceLinuxProfile"] = None, + windows_profile: Optional["ManagedClusterWindowsProfile"] = None, + service_principal_profile: Optional["ManagedClusterServicePrincipalProfile"] = None, + addon_profiles: Optional[Dict[str, "ManagedClusterAddonProfile"]] = None, + pod_identity_profile: Optional["ManagedClusterPodIdentityProfile"] = None, + node_resource_group: Optional[str] = None, + enable_rbac: Optional[bool] = None, + enable_pod_security_policy: Optional[bool] = None, + network_profile: Optional["ContainerServiceNetworkProfile"] = None, + aad_profile: Optional["ManagedClusterAADProfile"] = None, + auto_upgrade_profile: Optional["ManagedClusterAutoUpgradeProfile"] = None, + auto_scaler_profile: Optional["ManagedClusterPropertiesAutoScalerProfile"] = None, + api_server_access_profile: Optional["ManagedClusterAPIServerAccessProfile"] = None, + disk_encryption_set_id: Optional[str] = None, + identity_profile: Optional[Dict[str, "UserAssignedIdentity"]] = None, + private_link_resources: Optional[List["PrivateLinkResource"]] = None, + disable_local_accounts: Optional[bool] = None, + http_proxy_config: Optional["ManagedClusterHTTPProxyConfig"] = None, + security_profile: Optional["ManagedClusterSecurityProfile"] = None, + public_network_access: Optional[Union[str, "PublicNetworkAccess"]] = None, + **kwargs + ): + super(ManagedCluster, self).__init__(location=location, tags=tags, **kwargs) + self.sku = sku + self.extended_location = extended_location + self.identity = identity + self.provisioning_state = None + self.power_state = None + self.max_agent_pools = None + self.kubernetes_version = kubernetes_version + self.dns_prefix = dns_prefix + self.fqdn_subdomain = fqdn_subdomain + self.fqdn = None + self.private_fqdn = None + self.azure_portal_fqdn = None + self.agent_pool_profiles = agent_pool_profiles + self.linux_profile = linux_profile + self.windows_profile = windows_profile + self.service_principal_profile = service_principal_profile + self.addon_profiles = addon_profiles + self.pod_identity_profile = pod_identity_profile + self.node_resource_group = node_resource_group + self.enable_rbac = enable_rbac + self.enable_pod_security_policy = enable_pod_security_policy + self.network_profile = network_profile + self.aad_profile = aad_profile + self.auto_upgrade_profile = auto_upgrade_profile + self.auto_scaler_profile = auto_scaler_profile + self.api_server_access_profile = api_server_access_profile + self.disk_encryption_set_id = disk_encryption_set_id + self.identity_profile = identity_profile + self.private_link_resources = private_link_resources + self.disable_local_accounts = disable_local_accounts + self.http_proxy_config = http_proxy_config + self.security_profile = security_profile + self.public_network_access = public_network_access + + +class ManagedClusterAADProfile(msrest.serialization.Model): + """For more details see `managed AAD on AKS `_. + + :param managed: Whether to enable managed AAD. + :type managed: bool + :param enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. + :type enable_azure_rbac: bool + :param admin_group_object_i_ds: The list of AAD group object IDs that will have admin role of + the cluster. + :type admin_group_object_i_ds: list[str] + :param client_app_id: The client AAD application ID. + :type client_app_id: str + :param server_app_id: The server AAD application ID. + :type server_app_id: str + :param server_app_secret: The server AAD application secret. + :type server_app_secret: str + :param tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + tenant of the deployment subscription. + :type tenant_id: str + """ + + _attribute_map = { + 'managed': {'key': 'managed', 'type': 'bool'}, + 'enable_azure_rbac': {'key': 'enableAzureRBAC', 'type': 'bool'}, + 'admin_group_object_i_ds': {'key': 'adminGroupObjectIDs', 'type': '[str]'}, + 'client_app_id': {'key': 'clientAppID', 'type': 'str'}, + 'server_app_id': {'key': 'serverAppID', 'type': 'str'}, + 'server_app_secret': {'key': 'serverAppSecret', 'type': 'str'}, + 'tenant_id': {'key': 'tenantID', 'type': 'str'}, + } + + def __init__( + self, + *, + managed: Optional[bool] = None, + enable_azure_rbac: Optional[bool] = None, + admin_group_object_i_ds: Optional[List[str]] = None, + client_app_id: Optional[str] = None, + server_app_id: Optional[str] = None, + server_app_secret: Optional[str] = None, + tenant_id: Optional[str] = None, + **kwargs + ): + super(ManagedClusterAADProfile, self).__init__(**kwargs) + self.managed = managed + self.enable_azure_rbac = enable_azure_rbac + self.admin_group_object_i_ds = admin_group_object_i_ds + self.client_app_id = client_app_id + self.server_app_id = server_app_id + self.server_app_secret = server_app_secret + self.tenant_id = tenant_id + + +class ManagedClusterAccessProfile(Resource): + """Managed cluster Access Profile. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param kube_config: Base64-encoded Kubernetes configuration file. + :type kube_config: bytearray + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'kube_config': {'key': 'properties.kubeConfig', 'type': 'bytearray'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + kube_config: Optional[bytearray] = None, + **kwargs + ): + super(ManagedClusterAccessProfile, self).__init__(location=location, tags=tags, **kwargs) + self.kube_config = kube_config + + +class ManagedClusterAddonProfile(msrest.serialization.Model): + """A Kubernetes add-on profile for a managed cluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. Whether the add-on is enabled or not. + :type enabled: bool + :param config: Key-value pairs for configuring an add-on. + :type config: dict[str, str] + :ivar identity: Information of user assigned identity used by this add-on. + :vartype identity: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterAddonProfileIdentity + """ + + _validation = { + 'enabled': {'required': True}, + 'identity': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'config': {'key': 'config', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'ManagedClusterAddonProfileIdentity'}, + } + + def __init__( + self, + *, + enabled: bool, + config: Optional[Dict[str, str]] = None, + **kwargs + ): + super(ManagedClusterAddonProfile, self).__init__(**kwargs) + self.enabled = enabled + self.config = config + self.identity = None + + +class UserAssignedIdentity(msrest.serialization.Model): + """Details about a user assigned identity. + + :param resource_id: The resource ID of the user assigned identity. + :type resource_id: str + :param client_id: The client ID of the user assigned identity. + :type client_id: str + :param object_id: The object ID of the user assigned identity. + :type object_id: str + """ + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'object_id': {'key': 'objectId', 'type': 'str'}, + } + + def __init__( + self, + *, + resource_id: Optional[str] = None, + client_id: Optional[str] = None, + object_id: Optional[str] = None, + **kwargs + ): + super(UserAssignedIdentity, self).__init__(**kwargs) + self.resource_id = resource_id + self.client_id = client_id + self.object_id = object_id + + +class ManagedClusterAddonProfileIdentity(UserAssignedIdentity): + """Information of user assigned identity used by this add-on. + + :param resource_id: The resource ID of the user assigned identity. + :type resource_id: str + :param client_id: The client ID of the user assigned identity. + :type client_id: str + :param object_id: The object ID of the user assigned identity. + :type object_id: str + """ + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'object_id': {'key': 'objectId', 'type': 'str'}, + } + + def __init__( + self, + *, + resource_id: Optional[str] = None, + client_id: Optional[str] = None, + object_id: Optional[str] = None, + **kwargs + ): + super(ManagedClusterAddonProfileIdentity, self).__init__(resource_id=resource_id, client_id=client_id, object_id=object_id, **kwargs) + + +class ManagedClusterAgentPoolProfileProperties(msrest.serialization.Model): + """Properties for the container service agent pool profile. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for + system pools. The default value is 1. + :type count: int + :param vm_size: VM size availability varies by region. If a node contains insufficient compute + resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted + VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + :type vm_size: str + :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in the master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :type os_disk_size_gb: int + :param os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk + larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed + after creation. For more information see `Ephemeral OS + `_. Possible values + include: "Managed", "Ephemeral". + :type os_disk_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSDiskType + :param kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data + root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". + :type kubelet_disk_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.KubeletDiskType + :param workload_runtime: Determines the type of workload a node can run. Possible values + include: "OCIContainer", "WasmWasi". + :type workload_runtime: str or ~azure.mgmt.containerservice.v2021_08_01.models.WorkloadRuntime + :param vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. + If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just + nodes. This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :type vnet_subnet_id: str + :param pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see + vnetSubnetID for more details). This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :type pod_subnet_id: str + :param max_pods: The maximum number of pods that can run on a node. + :type max_pods: int + :param os_type: The operating system type. The default is Linux. Possible values include: + "Linux", "Windows". Default value: "Linux". + :type os_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSType + :param os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. + Possible values include: "Ubuntu", "CBLMariner". + :type os_sku: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSSKU + :param max_count: The maximum number of nodes for auto-scaling. + :type max_count: int + :param min_count: The minimum number of nodes for auto-scaling. + :type min_count: int + :param enable_auto_scaling: Whether to enable auto-scaler. + :type enable_auto_scaling: bool + :param scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it + defaults to Delete. Possible values include: "Delete", "Deallocate". + :type scale_down_mode: str or ~azure.mgmt.containerservice.v2021_08_01.models.ScaleDownMode + :param type: The type of Agent Pool. Possible values include: "VirtualMachineScaleSets", + "AvailabilitySet". + :type type: str or ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolType + :param mode: A cluster must have at least one 'System' Agent Pool at all times. For additional + information on agent pool restrictions and best practices, see: + https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", + "User". + :type mode: str or ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolMode + :param orchestrator_version: As a best practice, you should upgrade all node pools in an AKS + cluster to the same Kubernetes version. The node pool version must have the same major version + as the control plane. The node pool minor version must be within two minor versions of the + control plane version. The node pool version cannot be greater than the control plane version. + For more information see `upgrading a node pool + `_. + :type orchestrator_version: str + :ivar node_image_version: The version of node image. + :vartype node_image_version: str + :param upgrade_settings: Settings for upgrading the agentpool. + :type upgrade_settings: + ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolUpgradeSettings + :ivar provisioning_state: The current deployment or provisioning state. + :vartype provisioning_state: str + :ivar power_state: Describes whether the Agent Pool is Running or Stopped. + :vartype power_state: ~azure.mgmt.containerservice.v2021_08_01.models.PowerState + :param availability_zones: The list of Availability zones to use for nodes. This can only be + specified if the AgentPoolType property is 'VirtualMachineScaleSets'. + :type availability_zones: list[str] + :param enable_node_public_ip: Some scenarios may require nodes in a node pool to receive their + own dedicated public IP addresses. A common scenario is for gaming workloads, where a console + needs to make a direct connection to a cloud virtual machine to minimize hops. For more + information see `assigning a public IP per node + `_. + The default is false. + :type enable_node_public_ip: bool + :param node_public_ip_prefix_id: This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. + :type node_public_ip_prefix_id: str + :param scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the + default is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". + :type scale_set_priority: str or + ~azure.mgmt.containerservice.v2021_08_01.models.ScaleSetPriority + :param scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is + 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", + "Deallocate". Default value: "Delete". + :type scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2021_08_01.models.ScaleSetEvictionPolicy + :param spot_max_price: Possible values are any decimal value greater than zero or -1 which + indicates the willingness to pay any on-demand price. For more details on spot pricing, see + `spot VMs pricing `_. + :type spot_max_price: float + :param tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale + set. + :type tags: dict[str, str] + :param node_labels: The node labels to be persisted across all nodes in agent pool. + :type node_labels: dict[str, str] + :param node_taints: The taints added to new nodes during node pool create and scale. For + example, key=value:NoSchedule. + :type node_taints: list[str] + :param proximity_placement_group_id: The ID for Proximity Placement Group. + :type proximity_placement_group_id: str + :param kubelet_config: The Kubelet configuration on the agent pool nodes. + :type kubelet_config: ~azure.mgmt.containerservice.v2021_08_01.models.KubeletConfig + :param linux_os_config: The OS configuration of Linux agent nodes. + :type linux_os_config: ~azure.mgmt.containerservice.v2021_08_01.models.LinuxOSConfig + :param enable_encryption_at_host: This is only supported on certain VM sizes and in certain + Azure regions. For more information, see: + https://docs.microsoft.com/azure/aks/enable-host-encryption. + :type enable_encryption_at_host: bool + :param enable_ultra_ssd: Whether to enable UltraSSD. + :type enable_ultra_ssd: bool + :param enable_fips: See `Add a FIPS-enabled node pool + `_ + for more details. + :type enable_fips: bool + :param gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile + for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", "MIG7g". + :type gpu_instance_profile: str or + ~azure.mgmt.containerservice.v2021_08_01.models.GPUInstanceProfile + :param creation_data: CreationData to be used to specify the source Snapshot ID if the node + pool will be created/upgraded using a snapshot. + :type creation_data: ~azure.mgmt.containerservice.v2021_08_01.models.CreationData + """ + + _validation = { + 'os_disk_size_gb': {'maximum': 2048, 'minimum': 0}, + 'node_image_version': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'power_state': {'readonly': True}, + } + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + 'vm_size': {'key': 'vmSize', 'type': 'str'}, + 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, + 'os_disk_type': {'key': 'osDiskType', 'type': 'str'}, + 'kubelet_disk_type': {'key': 'kubeletDiskType', 'type': 'str'}, + 'workload_runtime': {'key': 'workloadRuntime', 'type': 'str'}, + 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, + 'pod_subnet_id': {'key': 'podSubnetID', 'type': 'str'}, + 'max_pods': {'key': 'maxPods', 'type': 'int'}, + 'os_type': {'key': 'osType', 'type': 'str'}, + 'os_sku': {'key': 'osSKU', 'type': 'str'}, + 'max_count': {'key': 'maxCount', 'type': 'int'}, + 'min_count': {'key': 'minCount', 'type': 'int'}, + 'enable_auto_scaling': {'key': 'enableAutoScaling', 'type': 'bool'}, + 'scale_down_mode': {'key': 'scaleDownMode', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'mode': {'key': 'mode', 'type': 'str'}, + 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, + 'node_image_version': {'key': 'nodeImageVersion', 'type': 'str'}, + 'upgrade_settings': {'key': 'upgradeSettings', 'type': 'AgentPoolUpgradeSettings'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'power_state': {'key': 'powerState', 'type': 'PowerState'}, + 'availability_zones': {'key': 'availabilityZones', 'type': '[str]'}, + 'enable_node_public_ip': {'key': 'enableNodePublicIP', 'type': 'bool'}, + 'node_public_ip_prefix_id': {'key': 'nodePublicIPPrefixID', 'type': 'str'}, + 'scale_set_priority': {'key': 'scaleSetPriority', 'type': 'str'}, + 'scale_set_eviction_policy': {'key': 'scaleSetEvictionPolicy', 'type': 'str'}, + 'spot_max_price': {'key': 'spotMaxPrice', 'type': 'float'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'node_labels': {'key': 'nodeLabels', 'type': '{str}'}, + 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, + 'proximity_placement_group_id': {'key': 'proximityPlacementGroupID', 'type': 'str'}, + 'kubelet_config': {'key': 'kubeletConfig', 'type': 'KubeletConfig'}, + 'linux_os_config': {'key': 'linuxOSConfig', 'type': 'LinuxOSConfig'}, + 'enable_encryption_at_host': {'key': 'enableEncryptionAtHost', 'type': 'bool'}, + 'enable_ultra_ssd': {'key': 'enableUltraSSD', 'type': 'bool'}, + 'enable_fips': {'key': 'enableFIPS', 'type': 'bool'}, + 'gpu_instance_profile': {'key': 'gpuInstanceProfile', 'type': 'str'}, + 'creation_data': {'key': 'creationData', 'type': 'CreationData'}, + } + + def __init__( + self, + *, + count: Optional[int] = None, + vm_size: Optional[str] = None, + os_disk_size_gb: Optional[int] = None, + os_disk_type: Optional[Union[str, "OSDiskType"]] = None, + kubelet_disk_type: Optional[Union[str, "KubeletDiskType"]] = None, + workload_runtime: Optional[Union[str, "WorkloadRuntime"]] = None, + vnet_subnet_id: Optional[str] = None, + pod_subnet_id: Optional[str] = None, + max_pods: Optional[int] = None, + os_type: Optional[Union[str, "OSType"]] = "Linux", + os_sku: Optional[Union[str, "OSSKU"]] = None, + max_count: Optional[int] = None, + min_count: Optional[int] = None, + enable_auto_scaling: Optional[bool] = None, + scale_down_mode: Optional[Union[str, "ScaleDownMode"]] = None, + type: Optional[Union[str, "AgentPoolType"]] = None, + mode: Optional[Union[str, "AgentPoolMode"]] = None, + orchestrator_version: Optional[str] = None, + upgrade_settings: Optional["AgentPoolUpgradeSettings"] = None, + availability_zones: Optional[List[str]] = None, + enable_node_public_ip: Optional[bool] = None, + node_public_ip_prefix_id: Optional[str] = None, + scale_set_priority: Optional[Union[str, "ScaleSetPriority"]] = "Regular", + scale_set_eviction_policy: Optional[Union[str, "ScaleSetEvictionPolicy"]] = "Delete", + spot_max_price: Optional[float] = -1, + tags: Optional[Dict[str, str]] = None, + node_labels: Optional[Dict[str, str]] = None, + node_taints: Optional[List[str]] = None, + proximity_placement_group_id: Optional[str] = None, + kubelet_config: Optional["KubeletConfig"] = None, + linux_os_config: Optional["LinuxOSConfig"] = None, + enable_encryption_at_host: Optional[bool] = None, + enable_ultra_ssd: Optional[bool] = None, + enable_fips: Optional[bool] = None, + gpu_instance_profile: Optional[Union[str, "GPUInstanceProfile"]] = None, + creation_data: Optional["CreationData"] = None, + **kwargs + ): + super(ManagedClusterAgentPoolProfileProperties, self).__init__(**kwargs) + self.count = count + self.vm_size = vm_size + self.os_disk_size_gb = os_disk_size_gb + self.os_disk_type = os_disk_type + self.kubelet_disk_type = kubelet_disk_type + self.workload_runtime = workload_runtime + self.vnet_subnet_id = vnet_subnet_id + self.pod_subnet_id = pod_subnet_id + self.max_pods = max_pods + self.os_type = os_type + self.os_sku = os_sku + self.max_count = max_count + self.min_count = min_count + self.enable_auto_scaling = enable_auto_scaling + self.scale_down_mode = scale_down_mode + self.type = type + self.mode = mode + self.orchestrator_version = orchestrator_version + self.node_image_version = None + self.upgrade_settings = upgrade_settings + self.provisioning_state = None + self.power_state = None + self.availability_zones = availability_zones + self.enable_node_public_ip = enable_node_public_ip + self.node_public_ip_prefix_id = node_public_ip_prefix_id + self.scale_set_priority = scale_set_priority + self.scale_set_eviction_policy = scale_set_eviction_policy + self.spot_max_price = spot_max_price + self.tags = tags + self.node_labels = node_labels + self.node_taints = node_taints + self.proximity_placement_group_id = proximity_placement_group_id + self.kubelet_config = kubelet_config + self.linux_os_config = linux_os_config + self.enable_encryption_at_host = enable_encryption_at_host + self.enable_ultra_ssd = enable_ultra_ssd + self.enable_fips = enable_fips + self.gpu_instance_profile = gpu_instance_profile + self.creation_data = creation_data + + +class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): + """Profile for the container service agent pool. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for + system pools. The default value is 1. + :type count: int + :param vm_size: VM size availability varies by region. If a node contains insufficient compute + resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted + VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + :type vm_size: str + :param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in the master/agent pool. If you specify 0, it will apply the default osDisk size + according to the vmSize specified. + :type os_disk_size_gb: int + :param os_disk_type: The default is 'Ephemeral' if the VM supports it and has a cache disk + larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed + after creation. For more information see `Ephemeral OS + `_. Possible values + include: "Managed", "Ephemeral". + :type os_disk_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSDiskType + :param kubelet_disk_type: Determines the placement of emptyDir volumes, container runtime data + root, and Kubelet ephemeral storage. Possible values include: "OS", "Temporary". + :type kubelet_disk_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.KubeletDiskType + :param workload_runtime: Determines the type of workload a node can run. Possible values + include: "OCIContainer", "WasmWasi". + :type workload_runtime: str or ~azure.mgmt.containerservice.v2021_08_01.models.WorkloadRuntime + :param vnet_subnet_id: If this is not specified, a VNET and subnet will be generated and used. + If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just + nodes. This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :type vnet_subnet_id: str + :param pod_subnet_id: If omitted, pod IPs are statically assigned on the node subnet (see + vnetSubnetID for more details). This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :type pod_subnet_id: str + :param max_pods: The maximum number of pods that can run on a node. + :type max_pods: int + :param os_type: The operating system type. The default is Linux. Possible values include: + "Linux", "Windows". Default value: "Linux". + :type os_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSType + :param os_sku: Specifies an OS SKU. This value must not be specified if OSType is Windows. + Possible values include: "Ubuntu", "CBLMariner". + :type os_sku: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSSKU + :param max_count: The maximum number of nodes for auto-scaling. + :type max_count: int + :param min_count: The minimum number of nodes for auto-scaling. + :type min_count: int + :param enable_auto_scaling: Whether to enable auto-scaler. + :type enable_auto_scaling: bool + :param scale_down_mode: This also effects the cluster autoscaler behavior. If not specified, it + defaults to Delete. Possible values include: "Delete", "Deallocate". + :type scale_down_mode: str or ~azure.mgmt.containerservice.v2021_08_01.models.ScaleDownMode + :param type: The type of Agent Pool. Possible values include: "VirtualMachineScaleSets", + "AvailabilitySet". + :type type: str or ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolType + :param mode: A cluster must have at least one 'System' Agent Pool at all times. For additional + information on agent pool restrictions and best practices, see: + https://docs.microsoft.com/azure/aks/use-system-pools. Possible values include: "System", + "User". + :type mode: str or ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolMode + :param orchestrator_version: As a best practice, you should upgrade all node pools in an AKS + cluster to the same Kubernetes version. The node pool version must have the same major version + as the control plane. The node pool minor version must be within two minor versions of the + control plane version. The node pool version cannot be greater than the control plane version. + For more information see `upgrading a node pool + `_. + :type orchestrator_version: str + :ivar node_image_version: The version of node image. + :vartype node_image_version: str + :param upgrade_settings: Settings for upgrading the agentpool. + :type upgrade_settings: + ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolUpgradeSettings + :ivar provisioning_state: The current deployment or provisioning state. + :vartype provisioning_state: str + :ivar power_state: Describes whether the Agent Pool is Running or Stopped. + :vartype power_state: ~azure.mgmt.containerservice.v2021_08_01.models.PowerState + :param availability_zones: The list of Availability zones to use for nodes. This can only be + specified if the AgentPoolType property is 'VirtualMachineScaleSets'. + :type availability_zones: list[str] + :param enable_node_public_ip: Some scenarios may require nodes in a node pool to receive their + own dedicated public IP addresses. A common scenario is for gaming workloads, where a console + needs to make a direct connection to a cloud virtual machine to minimize hops. For more + information see `assigning a public IP per node + `_. + The default is false. + :type enable_node_public_ip: bool + :param node_public_ip_prefix_id: This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. + :type node_public_ip_prefix_id: str + :param scale_set_priority: The Virtual Machine Scale Set priority. If not specified, the + default is 'Regular'. Possible values include: "Spot", "Regular". Default value: "Regular". + :type scale_set_priority: str or + ~azure.mgmt.containerservice.v2021_08_01.models.ScaleSetPriority + :param scale_set_eviction_policy: This cannot be specified unless the scaleSetPriority is + 'Spot'. If not specified, the default is 'Delete'. Possible values include: "Delete", + "Deallocate". Default value: "Delete". + :type scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.v2021_08_01.models.ScaleSetEvictionPolicy + :param spot_max_price: Possible values are any decimal value greater than zero or -1 which + indicates the willingness to pay any on-demand price. For more details on spot pricing, see + `spot VMs pricing `_. + :type spot_max_price: float + :param tags: A set of tags. The tags to be persisted on the agent pool virtual machine scale + set. + :type tags: dict[str, str] + :param node_labels: The node labels to be persisted across all nodes in agent pool. + :type node_labels: dict[str, str] + :param node_taints: The taints added to new nodes during node pool create and scale. For + example, key=value:NoSchedule. + :type node_taints: list[str] + :param proximity_placement_group_id: The ID for Proximity Placement Group. + :type proximity_placement_group_id: str + :param kubelet_config: The Kubelet configuration on the agent pool nodes. + :type kubelet_config: ~azure.mgmt.containerservice.v2021_08_01.models.KubeletConfig + :param linux_os_config: The OS configuration of Linux agent nodes. + :type linux_os_config: ~azure.mgmt.containerservice.v2021_08_01.models.LinuxOSConfig + :param enable_encryption_at_host: This is only supported on certain VM sizes and in certain + Azure regions. For more information, see: + https://docs.microsoft.com/azure/aks/enable-host-encryption. + :type enable_encryption_at_host: bool + :param enable_ultra_ssd: Whether to enable UltraSSD. + :type enable_ultra_ssd: bool + :param enable_fips: See `Add a FIPS-enabled node pool + `_ + for more details. + :type enable_fips: bool + :param gpu_instance_profile: GPUInstanceProfile to be used to specify GPU MIG instance profile + for supported GPU VM SKU. Possible values include: "MIG1g", "MIG2g", "MIG3g", "MIG4g", "MIG7g". + :type gpu_instance_profile: str or + ~azure.mgmt.containerservice.v2021_08_01.models.GPUInstanceProfile + :param creation_data: CreationData to be used to specify the source Snapshot ID if the node + pool will be created/upgraded using a snapshot. + :type creation_data: ~azure.mgmt.containerservice.v2021_08_01.models.CreationData + :param name: Required. Windows agent pool names must be 6 characters or less. + :type name: str + """ + + _validation = { + 'os_disk_size_gb': {'maximum': 2048, 'minimum': 0}, + 'node_image_version': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'power_state': {'readonly': True}, + 'name': {'required': True, 'pattern': r'^[a-z][a-z0-9]{0,11}$'}, + } + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + 'vm_size': {'key': 'vmSize', 'type': 'str'}, + 'os_disk_size_gb': {'key': 'osDiskSizeGB', 'type': 'int'}, + 'os_disk_type': {'key': 'osDiskType', 'type': 'str'}, + 'kubelet_disk_type': {'key': 'kubeletDiskType', 'type': 'str'}, + 'workload_runtime': {'key': 'workloadRuntime', 'type': 'str'}, + 'vnet_subnet_id': {'key': 'vnetSubnetID', 'type': 'str'}, + 'pod_subnet_id': {'key': 'podSubnetID', 'type': 'str'}, + 'max_pods': {'key': 'maxPods', 'type': 'int'}, + 'os_type': {'key': 'osType', 'type': 'str'}, + 'os_sku': {'key': 'osSKU', 'type': 'str'}, + 'max_count': {'key': 'maxCount', 'type': 'int'}, + 'min_count': {'key': 'minCount', 'type': 'int'}, + 'enable_auto_scaling': {'key': 'enableAutoScaling', 'type': 'bool'}, + 'scale_down_mode': {'key': 'scaleDownMode', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'mode': {'key': 'mode', 'type': 'str'}, + 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, + 'node_image_version': {'key': 'nodeImageVersion', 'type': 'str'}, + 'upgrade_settings': {'key': 'upgradeSettings', 'type': 'AgentPoolUpgradeSettings'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'power_state': {'key': 'powerState', 'type': 'PowerState'}, + 'availability_zones': {'key': 'availabilityZones', 'type': '[str]'}, + 'enable_node_public_ip': {'key': 'enableNodePublicIP', 'type': 'bool'}, + 'node_public_ip_prefix_id': {'key': 'nodePublicIPPrefixID', 'type': 'str'}, + 'scale_set_priority': {'key': 'scaleSetPriority', 'type': 'str'}, + 'scale_set_eviction_policy': {'key': 'scaleSetEvictionPolicy', 'type': 'str'}, + 'spot_max_price': {'key': 'spotMaxPrice', 'type': 'float'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'node_labels': {'key': 'nodeLabels', 'type': '{str}'}, + 'node_taints': {'key': 'nodeTaints', 'type': '[str]'}, + 'proximity_placement_group_id': {'key': 'proximityPlacementGroupID', 'type': 'str'}, + 'kubelet_config': {'key': 'kubeletConfig', 'type': 'KubeletConfig'}, + 'linux_os_config': {'key': 'linuxOSConfig', 'type': 'LinuxOSConfig'}, + 'enable_encryption_at_host': {'key': 'enableEncryptionAtHost', 'type': 'bool'}, + 'enable_ultra_ssd': {'key': 'enableUltraSSD', 'type': 'bool'}, + 'enable_fips': {'key': 'enableFIPS', 'type': 'bool'}, + 'gpu_instance_profile': {'key': 'gpuInstanceProfile', 'type': 'str'}, + 'creation_data': {'key': 'creationData', 'type': 'CreationData'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + *, + name: str, + count: Optional[int] = None, + vm_size: Optional[str] = None, + os_disk_size_gb: Optional[int] = None, + os_disk_type: Optional[Union[str, "OSDiskType"]] = None, + kubelet_disk_type: Optional[Union[str, "KubeletDiskType"]] = None, + workload_runtime: Optional[Union[str, "WorkloadRuntime"]] = None, + vnet_subnet_id: Optional[str] = None, + pod_subnet_id: Optional[str] = None, + max_pods: Optional[int] = None, + os_type: Optional[Union[str, "OSType"]] = "Linux", + os_sku: Optional[Union[str, "OSSKU"]] = None, + max_count: Optional[int] = None, + min_count: Optional[int] = None, + enable_auto_scaling: Optional[bool] = None, + scale_down_mode: Optional[Union[str, "ScaleDownMode"]] = None, + type: Optional[Union[str, "AgentPoolType"]] = None, + mode: Optional[Union[str, "AgentPoolMode"]] = None, + orchestrator_version: Optional[str] = None, + upgrade_settings: Optional["AgentPoolUpgradeSettings"] = None, + availability_zones: Optional[List[str]] = None, + enable_node_public_ip: Optional[bool] = None, + node_public_ip_prefix_id: Optional[str] = None, + scale_set_priority: Optional[Union[str, "ScaleSetPriority"]] = "Regular", + scale_set_eviction_policy: Optional[Union[str, "ScaleSetEvictionPolicy"]] = "Delete", + spot_max_price: Optional[float] = -1, + tags: Optional[Dict[str, str]] = None, + node_labels: Optional[Dict[str, str]] = None, + node_taints: Optional[List[str]] = None, + proximity_placement_group_id: Optional[str] = None, + kubelet_config: Optional["KubeletConfig"] = None, + linux_os_config: Optional["LinuxOSConfig"] = None, + enable_encryption_at_host: Optional[bool] = None, + enable_ultra_ssd: Optional[bool] = None, + enable_fips: Optional[bool] = None, + gpu_instance_profile: Optional[Union[str, "GPUInstanceProfile"]] = None, + creation_data: Optional["CreationData"] = None, + **kwargs + ): + super(ManagedClusterAgentPoolProfile, self).__init__(count=count, vm_size=vm_size, os_disk_size_gb=os_disk_size_gb, os_disk_type=os_disk_type, kubelet_disk_type=kubelet_disk_type, workload_runtime=workload_runtime, vnet_subnet_id=vnet_subnet_id, pod_subnet_id=pod_subnet_id, max_pods=max_pods, os_type=os_type, os_sku=os_sku, max_count=max_count, min_count=min_count, enable_auto_scaling=enable_auto_scaling, scale_down_mode=scale_down_mode, type=type, mode=mode, orchestrator_version=orchestrator_version, upgrade_settings=upgrade_settings, availability_zones=availability_zones, enable_node_public_ip=enable_node_public_ip, node_public_ip_prefix_id=node_public_ip_prefix_id, scale_set_priority=scale_set_priority, scale_set_eviction_policy=scale_set_eviction_policy, spot_max_price=spot_max_price, tags=tags, node_labels=node_labels, node_taints=node_taints, proximity_placement_group_id=proximity_placement_group_id, kubelet_config=kubelet_config, linux_os_config=linux_os_config, enable_encryption_at_host=enable_encryption_at_host, enable_ultra_ssd=enable_ultra_ssd, enable_fips=enable_fips, gpu_instance_profile=gpu_instance_profile, creation_data=creation_data, **kwargs) + self.name = name + + +class ManagedClusterAPIServerAccessProfile(msrest.serialization.Model): + """Access profile for managed cluster API server. + + :param authorized_ip_ranges: IP ranges are specified in CIDR format, e.g. 137.117.106.88/29. + This feature is not compatible with clusters that use Public IP Per Node, or clusters that are + using a Basic Load Balancer. For more information see `API server authorized IP ranges + `_. + :type authorized_ip_ranges: list[str] + :param enable_private_cluster: For more details, see `Creating a private AKS cluster + `_. + :type enable_private_cluster: bool + :param private_dns_zone: The default is System. For more details see `configure private DNS + zone `_. + Allowed values are 'system' and 'none'. + :type private_dns_zone: str + :param enable_private_cluster_public_fqdn: Whether to create additional public FQDN for private + cluster or not. + :type enable_private_cluster_public_fqdn: bool + :param disable_run_command: Whether to disable run command for the cluster or not. + :type disable_run_command: bool + """ + + _attribute_map = { + 'authorized_ip_ranges': {'key': 'authorizedIPRanges', 'type': '[str]'}, + 'enable_private_cluster': {'key': 'enablePrivateCluster', 'type': 'bool'}, + 'private_dns_zone': {'key': 'privateDNSZone', 'type': 'str'}, + 'enable_private_cluster_public_fqdn': {'key': 'enablePrivateClusterPublicFQDN', 'type': 'bool'}, + 'disable_run_command': {'key': 'disableRunCommand', 'type': 'bool'}, + } + + def __init__( + self, + *, + authorized_ip_ranges: Optional[List[str]] = None, + enable_private_cluster: Optional[bool] = None, + private_dns_zone: Optional[str] = None, + enable_private_cluster_public_fqdn: Optional[bool] = None, + disable_run_command: Optional[bool] = None, + **kwargs + ): + super(ManagedClusterAPIServerAccessProfile, self).__init__(**kwargs) + self.authorized_ip_ranges = authorized_ip_ranges + self.enable_private_cluster = enable_private_cluster + self.private_dns_zone = private_dns_zone + self.enable_private_cluster_public_fqdn = enable_private_cluster_public_fqdn + self.disable_run_command = disable_run_command + + +class ManagedClusterAutoUpgradeProfile(msrest.serialization.Model): + """Auto upgrade profile for a managed cluster. + + :param upgrade_channel: For more information see `setting the AKS cluster auto-upgrade channel + `_. Possible + values include: "rapid", "stable", "patch", "node-image", "none". + :type upgrade_channel: str or ~azure.mgmt.containerservice.v2021_08_01.models.UpgradeChannel + """ + + _attribute_map = { + 'upgrade_channel': {'key': 'upgradeChannel', 'type': 'str'}, + } + + def __init__( + self, + *, + upgrade_channel: Optional[Union[str, "UpgradeChannel"]] = None, + **kwargs + ): + super(ManagedClusterAutoUpgradeProfile, self).__init__(**kwargs) + self.upgrade_channel = upgrade_channel + + +class ManagedClusterHTTPProxyConfig(msrest.serialization.Model): + """Cluster HTTP proxy configuration. + + :param http_proxy: The HTTP proxy server endpoint to use. + :type http_proxy: str + :param https_proxy: The HTTPS proxy server endpoint to use. + :type https_proxy: str + :param no_proxy: The endpoints that should not go through proxy. + :type no_proxy: list[str] + :param trusted_ca: Alternative CA cert to use for connecting to proxy servers. + :type trusted_ca: str + """ + + _attribute_map = { + 'http_proxy': {'key': 'httpProxy', 'type': 'str'}, + 'https_proxy': {'key': 'httpsProxy', 'type': 'str'}, + 'no_proxy': {'key': 'noProxy', 'type': '[str]'}, + 'trusted_ca': {'key': 'trustedCa', 'type': 'str'}, + } + + def __init__( + self, + *, + http_proxy: Optional[str] = None, + https_proxy: Optional[str] = None, + no_proxy: Optional[List[str]] = None, + trusted_ca: Optional[str] = None, + **kwargs + ): + super(ManagedClusterHTTPProxyConfig, self).__init__(**kwargs) + self.http_proxy = http_proxy + self.https_proxy = https_proxy + self.no_proxy = no_proxy + self.trusted_ca = trusted_ca + + +class ManagedClusterIdentity(msrest.serialization.Model): + """Identity for the managed cluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of the system assigned identity which is used by master + components. + :vartype principal_id: str + :ivar tenant_id: The tenant id of the system assigned identity which is used by master + components. + :vartype tenant_id: str + :param type: For more information see `use managed identities in AKS + `_. Possible values include: + "SystemAssigned", "UserAssigned", "None". + :type type: str or ~azure.mgmt.containerservice.v2021_08_01.models.ResourceIdentityType + :param user_assigned_identities: The keys must be ARM resource IDs in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :type user_assigned_identities: dict[str, + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedServiceIdentityUserAssignedIdentitiesValue] + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{ManagedServiceIdentityUserAssignedIdentitiesValue}'}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "ResourceIdentityType"]] = None, + user_assigned_identities: Optional[Dict[str, "ManagedServiceIdentityUserAssignedIdentitiesValue"]] = None, + **kwargs + ): + super(ManagedClusterIdentity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type + self.user_assigned_identities = user_assigned_identities + + +class ManagedClusterListResult(msrest.serialization.Model): + """The response from the List Managed Clusters operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: The list of managed clusters. + :type value: list[~azure.mgmt.containerservice.v2021_08_01.models.ManagedCluster] + :ivar next_link: The URL to get the next set of managed cluster results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ManagedCluster]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["ManagedCluster"]] = None, + **kwargs + ): + super(ManagedClusterListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class ManagedClusterLoadBalancerProfile(msrest.serialization.Model): + """Profile of the managed cluster load balancer. + + :param managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. + :type managed_outbound_i_ps: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs + :param outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load + balancer. + :type outbound_ip_prefixes: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes + :param outbound_i_ps: Desired outbound IP resources for the cluster load balancer. + :type outbound_i_ps: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterLoadBalancerProfileOutboundIPs + :param effective_outbound_i_ps: The effective outbound IP resources of the cluster load + balancer. + :type effective_outbound_i_ps: + list[~azure.mgmt.containerservice.v2021_08_01.models.ResourceReference] + :param allocated_outbound_ports: The desired number of allocated SNAT ports per VM. Allowed + values are in the range of 0 to 64000 (inclusive). The default value is 0 which results in + Azure dynamically allocating ports. + :type allocated_outbound_ports: int + :param idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values + are in the range of 4 to 120 (inclusive). The default value is 30 minutes. + :type idle_timeout_in_minutes: int + :param enable_multiple_standard_load_balancers: Enable multiple standard load balancers per AKS + cluster or not. + :type enable_multiple_standard_load_balancers: bool + """ + + _validation = { + 'allocated_outbound_ports': {'maximum': 64000, 'minimum': 0}, + 'idle_timeout_in_minutes': {'maximum': 120, 'minimum': 4}, + } + + _attribute_map = { + 'managed_outbound_i_ps': {'key': 'managedOutboundIPs', 'type': 'ManagedClusterLoadBalancerProfileManagedOutboundIPs'}, + 'outbound_ip_prefixes': {'key': 'outboundIPPrefixes', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPPrefixes'}, + 'outbound_i_ps': {'key': 'outboundIPs', 'type': 'ManagedClusterLoadBalancerProfileOutboundIPs'}, + 'effective_outbound_i_ps': {'key': 'effectiveOutboundIPs', 'type': '[ResourceReference]'}, + 'allocated_outbound_ports': {'key': 'allocatedOutboundPorts', 'type': 'int'}, + 'idle_timeout_in_minutes': {'key': 'idleTimeoutInMinutes', 'type': 'int'}, + 'enable_multiple_standard_load_balancers': {'key': 'enableMultipleStandardLoadBalancers', 'type': 'bool'}, + } + + def __init__( + self, + *, + managed_outbound_i_ps: Optional["ManagedClusterLoadBalancerProfileManagedOutboundIPs"] = None, + outbound_ip_prefixes: Optional["ManagedClusterLoadBalancerProfileOutboundIPPrefixes"] = None, + outbound_i_ps: Optional["ManagedClusterLoadBalancerProfileOutboundIPs"] = None, + effective_outbound_i_ps: Optional[List["ResourceReference"]] = None, + allocated_outbound_ports: Optional[int] = 0, + idle_timeout_in_minutes: Optional[int] = 30, + enable_multiple_standard_load_balancers: Optional[bool] = None, + **kwargs + ): + super(ManagedClusterLoadBalancerProfile, self).__init__(**kwargs) + self.managed_outbound_i_ps = managed_outbound_i_ps + self.outbound_ip_prefixes = outbound_ip_prefixes + self.outbound_i_ps = outbound_i_ps + self.effective_outbound_i_ps = effective_outbound_i_ps + self.allocated_outbound_ports = allocated_outbound_ports + self.idle_timeout_in_minutes = idle_timeout_in_minutes + self.enable_multiple_standard_load_balancers = enable_multiple_standard_load_balancers + + +class ManagedClusterLoadBalancerProfileManagedOutboundIPs(msrest.serialization.Model): + """Desired managed outbound IPs for the cluster load balancer. + + :param count: The desired number of outbound IPs created/managed by Azure for the cluster load + balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. + :type count: int + """ + + _validation = { + 'count': {'maximum': 100, 'minimum': 1}, + } + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + } + + def __init__( + self, + *, + count: Optional[int] = 1, + **kwargs + ): + super(ManagedClusterLoadBalancerProfileManagedOutboundIPs, self).__init__(**kwargs) + self.count = count + + +class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(msrest.serialization.Model): + """Desired outbound IP Prefix resources for the cluster load balancer. + + :param public_ip_prefixes: A list of public IP prefix resources. + :type public_ip_prefixes: + list[~azure.mgmt.containerservice.v2021_08_01.models.ResourceReference] + """ + + _attribute_map = { + 'public_ip_prefixes': {'key': 'publicIPPrefixes', 'type': '[ResourceReference]'}, + } + + def __init__( + self, + *, + public_ip_prefixes: Optional[List["ResourceReference"]] = None, + **kwargs + ): + super(ManagedClusterLoadBalancerProfileOutboundIPPrefixes, self).__init__(**kwargs) + self.public_ip_prefixes = public_ip_prefixes + + +class ManagedClusterLoadBalancerProfileOutboundIPs(msrest.serialization.Model): + """Desired outbound IP resources for the cluster load balancer. + + :param public_i_ps: A list of public IP resources. + :type public_i_ps: list[~azure.mgmt.containerservice.v2021_08_01.models.ResourceReference] + """ + + _attribute_map = { + 'public_i_ps': {'key': 'publicIPs', 'type': '[ResourceReference]'}, + } + + def __init__( + self, + *, + public_i_ps: Optional[List["ResourceReference"]] = None, + **kwargs + ): + super(ManagedClusterLoadBalancerProfileOutboundIPs, self).__init__(**kwargs) + self.public_i_ps = public_i_ps + + +class ManagedClusterManagedOutboundIPProfile(msrest.serialization.Model): + """Profile of the managed outbound IP resources of the managed cluster. + + :param count: The desired number of outbound IPs created/managed by Azure. Allowed values must + be in the range of 1 to 16 (inclusive). The default value is 1. + :type count: int + """ + + _validation = { + 'count': {'maximum': 16, 'minimum': 1}, + } + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + } + + def __init__( + self, + *, + count: Optional[int] = 1, + **kwargs + ): + super(ManagedClusterManagedOutboundIPProfile, self).__init__(**kwargs) + self.count = count + + +class ManagedClusterNATGatewayProfile(msrest.serialization.Model): + """Profile of the managed cluster NAT gateway. + + :param managed_outbound_ip_profile: Profile of the managed outbound IP resources of the cluster + NAT gateway. + :type managed_outbound_ip_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterManagedOutboundIPProfile + :param effective_outbound_i_ps: The effective outbound IP resources of the cluster NAT gateway. + :type effective_outbound_i_ps: + list[~azure.mgmt.containerservice.v2021_08_01.models.ResourceReference] + :param idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values + are in the range of 4 to 120 (inclusive). The default value is 4 minutes. + :type idle_timeout_in_minutes: int + """ + + _validation = { + 'idle_timeout_in_minutes': {'maximum': 120, 'minimum': 4}, + } + + _attribute_map = { + 'managed_outbound_ip_profile': {'key': 'managedOutboundIPProfile', 'type': 'ManagedClusterManagedOutboundIPProfile'}, + 'effective_outbound_i_ps': {'key': 'effectiveOutboundIPs', 'type': '[ResourceReference]'}, + 'idle_timeout_in_minutes': {'key': 'idleTimeoutInMinutes', 'type': 'int'}, + } + + def __init__( + self, + *, + managed_outbound_ip_profile: Optional["ManagedClusterManagedOutboundIPProfile"] = None, + effective_outbound_i_ps: Optional[List["ResourceReference"]] = None, + idle_timeout_in_minutes: Optional[int] = 4, + **kwargs + ): + super(ManagedClusterNATGatewayProfile, self).__init__(**kwargs) + self.managed_outbound_ip_profile = managed_outbound_ip_profile + self.effective_outbound_i_ps = effective_outbound_i_ps + self.idle_timeout_in_minutes = idle_timeout_in_minutes + + +class ManagedClusterPodIdentity(msrest.serialization.Model): + """Details about the pod identity assigned to the Managed Cluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the pod identity. + :type name: str + :param namespace: Required. The namespace of the pod identity. + :type namespace: str + :param binding_selector: The binding selector to use for the AzureIdentityBinding resource. + :type binding_selector: str + :param identity: Required. The user assigned identity details. + :type identity: ~azure.mgmt.containerservice.v2021_08_01.models.UserAssignedIdentity + :ivar provisioning_state: The current provisioning state of the pod identity. Possible values + include: "Assigned", "Updating", "Deleting", "Failed". + :vartype provisioning_state: str or + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPodIdentityProvisioningState + :ivar provisioning_info: + :vartype provisioning_info: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPodIdentityProvisioningInfo + """ + + _validation = { + 'name': {'required': True}, + 'namespace': {'required': True}, + 'identity': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'provisioning_info': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'namespace': {'key': 'namespace', 'type': 'str'}, + 'binding_selector': {'key': 'bindingSelector', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'UserAssignedIdentity'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'provisioning_info': {'key': 'provisioningInfo', 'type': 'ManagedClusterPodIdentityProvisioningInfo'}, + } + + def __init__( + self, + *, + name: str, + namespace: str, + identity: "UserAssignedIdentity", + binding_selector: Optional[str] = None, + **kwargs + ): + super(ManagedClusterPodIdentity, self).__init__(**kwargs) + self.name = name + self.namespace = namespace + self.binding_selector = binding_selector + self.identity = identity + self.provisioning_state = None + self.provisioning_info = None + + +class ManagedClusterPodIdentityException(msrest.serialization.Model): + """See `disable AAD Pod Identity for a specific Pod/Application `_ for more details. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the pod identity exception. + :type name: str + :param namespace: Required. The namespace of the pod identity exception. + :type namespace: str + :param pod_labels: Required. The pod labels to match. + :type pod_labels: dict[str, str] + """ + + _validation = { + 'name': {'required': True}, + 'namespace': {'required': True}, + 'pod_labels': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'namespace': {'key': 'namespace', 'type': 'str'}, + 'pod_labels': {'key': 'podLabels', 'type': '{str}'}, + } + + def __init__( + self, + *, + name: str, + namespace: str, + pod_labels: Dict[str, str], + **kwargs + ): + super(ManagedClusterPodIdentityException, self).__init__(**kwargs) + self.name = name + self.namespace = namespace + self.pod_labels = pod_labels + + +class ManagedClusterPodIdentityProfile(msrest.serialization.Model): + """See `use AAD pod identity `_ for more details on pod identity integration. + + :param enabled: Whether the pod identity addon is enabled. + :type enabled: bool + :param allow_network_plugin_kubenet: Running in Kubenet is disabled by default due to the + security related nature of AAD Pod Identity and the risks of IP spoofing. See `using Kubenet + network plugin with AAD Pod Identity + `_ + for more information. + :type allow_network_plugin_kubenet: bool + :param user_assigned_identities: The pod identities to use in the cluster. + :type user_assigned_identities: + list[~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPodIdentity] + :param user_assigned_identity_exceptions: The pod identity exceptions to allow. + :type user_assigned_identity_exceptions: + list[~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPodIdentityException] + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'allow_network_plugin_kubenet': {'key': 'allowNetworkPluginKubenet', 'type': 'bool'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '[ManagedClusterPodIdentity]'}, + 'user_assigned_identity_exceptions': {'key': 'userAssignedIdentityExceptions', 'type': '[ManagedClusterPodIdentityException]'}, + } + + def __init__( + self, + *, + enabled: Optional[bool] = None, + allow_network_plugin_kubenet: Optional[bool] = None, + user_assigned_identities: Optional[List["ManagedClusterPodIdentity"]] = None, + user_assigned_identity_exceptions: Optional[List["ManagedClusterPodIdentityException"]] = None, + **kwargs + ): + super(ManagedClusterPodIdentityProfile, self).__init__(**kwargs) + self.enabled = enabled + self.allow_network_plugin_kubenet = allow_network_plugin_kubenet + self.user_assigned_identities = user_assigned_identities + self.user_assigned_identity_exceptions = user_assigned_identity_exceptions + + +class ManagedClusterPodIdentityProvisioningError(msrest.serialization.Model): + """An error response from the pod identity provisioning. + + :param error: Details about the error. + :type error: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPodIdentityProvisioningErrorBody + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ManagedClusterPodIdentityProvisioningErrorBody'}, + } + + def __init__( + self, + *, + error: Optional["ManagedClusterPodIdentityProvisioningErrorBody"] = None, + **kwargs + ): + super(ManagedClusterPodIdentityProvisioningError, self).__init__(**kwargs) + self.error = error + + +class ManagedClusterPodIdentityProvisioningErrorBody(msrest.serialization.Model): + """An error response from the pod identity provisioning. + + :param code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable for display in a user + interface. + :type message: str + :param target: The target of the particular error. For example, the name of the property in + error. + :type target: str + :param details: A list of additional details about the error. + :type details: + list[~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPodIdentityProvisioningErrorBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ManagedClusterPodIdentityProvisioningErrorBody]'}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + target: Optional[str] = None, + details: Optional[List["ManagedClusterPodIdentityProvisioningErrorBody"]] = None, + **kwargs + ): + super(ManagedClusterPodIdentityProvisioningErrorBody, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + + +class ManagedClusterPodIdentityProvisioningInfo(msrest.serialization.Model): + """ManagedClusterPodIdentityProvisioningInfo. + + :param error: Pod identity assignment error (if any). + :type error: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPodIdentityProvisioningError + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ManagedClusterPodIdentityProvisioningError'}, + } + + def __init__( + self, + *, + error: Optional["ManagedClusterPodIdentityProvisioningError"] = None, + **kwargs + ): + super(ManagedClusterPodIdentityProvisioningInfo, self).__init__(**kwargs) + self.error = error + + +class ManagedClusterPoolUpgradeProfile(msrest.serialization.Model): + """The list of available upgrade versions. + + All required parameters must be populated in order to send to Azure. + + :param kubernetes_version: Required. The Kubernetes version (major.minor.patch). + :type kubernetes_version: str + :param name: The Agent Pool name. + :type name: str + :param os_type: Required. The operating system type. The default is Linux. Possible values + include: "Linux", "Windows". Default value: "Linux". + :type os_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.OSType + :param upgrades: List of orchestrator types and versions available for upgrade. + :type upgrades: + list[~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPoolUpgradeProfileUpgradesItem] + """ + + _validation = { + 'kubernetes_version': {'required': True}, + 'os_type': {'required': True}, + } + + _attribute_map = { + 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'os_type': {'key': 'osType', 'type': 'str'}, + 'upgrades': {'key': 'upgrades', 'type': '[ManagedClusterPoolUpgradeProfileUpgradesItem]'}, + } + + def __init__( + self, + *, + kubernetes_version: str, + os_type: Union[str, "OSType"] = "Linux", + name: Optional[str] = None, + upgrades: Optional[List["ManagedClusterPoolUpgradeProfileUpgradesItem"]] = None, + **kwargs + ): + super(ManagedClusterPoolUpgradeProfile, self).__init__(**kwargs) + self.kubernetes_version = kubernetes_version + self.name = name + self.os_type = os_type + self.upgrades = upgrades + + +class ManagedClusterPoolUpgradeProfileUpgradesItem(msrest.serialization.Model): + """ManagedClusterPoolUpgradeProfileUpgradesItem. + + :param kubernetes_version: The Kubernetes version (major.minor.patch). + :type kubernetes_version: str + :param is_preview: Whether the Kubernetes version is currently in preview. + :type is_preview: bool + """ + + _attribute_map = { + 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, + 'is_preview': {'key': 'isPreview', 'type': 'bool'}, + } + + def __init__( + self, + *, + kubernetes_version: Optional[str] = None, + is_preview: Optional[bool] = None, + **kwargs + ): + super(ManagedClusterPoolUpgradeProfileUpgradesItem, self).__init__(**kwargs) + self.kubernetes_version = kubernetes_version + self.is_preview = is_preview + + +class ManagedClusterPropertiesAutoScalerProfile(msrest.serialization.Model): + """Parameters to be applied to the cluster-autoscaler when enabled. + + :param balance_similar_node_groups: Valid values are 'true' and 'false'. + :type balance_similar_node_groups: str + :param expander: If not specified, the default is 'random'. See `expanders + `_ + for more information. Possible values include: "least-waste", "most-pods", "priority", + "random". + :type expander: str or ~azure.mgmt.containerservice.v2021_08_01.models.Expander + :param max_empty_bulk_delete: The default is 10. + :type max_empty_bulk_delete: str + :param max_graceful_termination_sec: The default is 600. + :type max_graceful_termination_sec: str + :param max_node_provision_time: The default is '15m'. Values must be an integer followed by an + 'm'. No unit of time other than minutes (m) is supported. + :type max_node_provision_time: str + :param max_total_unready_percentage: The default is 45. The maximum is 100 and the minimum is + 0. + :type max_total_unready_percentage: str + :param new_pod_scale_up_delay: For scenarios like burst/batch scale where you don't want CA to + act before the kubernetes scheduler could schedule all the pods, you can tell CA to ignore + unscheduled pods before they're a certain age. The default is '0s'. Values must be an integer + followed by a unit ('s' for seconds, 'm' for minutes, 'h' for hours, etc). + :type new_pod_scale_up_delay: str + :param ok_total_unready_count: This must be an integer. The default is 3. + :type ok_total_unready_count: str + :param scan_interval: The default is '10'. Values must be an integer number of seconds. + :type scan_interval: str + :param scale_down_delay_after_add: The default is '10m'. Values must be an integer followed by + an 'm'. No unit of time other than minutes (m) is supported. + :type scale_down_delay_after_add: str + :param scale_down_delay_after_delete: The default is the scan-interval. Values must be an + integer followed by an 'm'. No unit of time other than minutes (m) is supported. + :type scale_down_delay_after_delete: str + :param scale_down_delay_after_failure: The default is '3m'. Values must be an integer followed + by an 'm'. No unit of time other than minutes (m) is supported. + :type scale_down_delay_after_failure: str + :param scale_down_unneeded_time: The default is '10m'. Values must be an integer followed by an + 'm'. No unit of time other than minutes (m) is supported. + :type scale_down_unneeded_time: str + :param scale_down_unready_time: The default is '20m'. Values must be an integer followed by an + 'm'. No unit of time other than minutes (m) is supported. + :type scale_down_unready_time: str + :param scale_down_utilization_threshold: The default is '0.5'. + :type scale_down_utilization_threshold: str + :param skip_nodes_with_local_storage: The default is true. + :type skip_nodes_with_local_storage: str + :param skip_nodes_with_system_pods: The default is true. + :type skip_nodes_with_system_pods: str + """ + + _attribute_map = { + 'balance_similar_node_groups': {'key': 'balance-similar-node-groups', 'type': 'str'}, + 'expander': {'key': 'expander', 'type': 'str'}, + 'max_empty_bulk_delete': {'key': 'max-empty-bulk-delete', 'type': 'str'}, + 'max_graceful_termination_sec': {'key': 'max-graceful-termination-sec', 'type': 'str'}, + 'max_node_provision_time': {'key': 'max-node-provision-time', 'type': 'str'}, + 'max_total_unready_percentage': {'key': 'max-total-unready-percentage', 'type': 'str'}, + 'new_pod_scale_up_delay': {'key': 'new-pod-scale-up-delay', 'type': 'str'}, + 'ok_total_unready_count': {'key': 'ok-total-unready-count', 'type': 'str'}, + 'scan_interval': {'key': 'scan-interval', 'type': 'str'}, + 'scale_down_delay_after_add': {'key': 'scale-down-delay-after-add', 'type': 'str'}, + 'scale_down_delay_after_delete': {'key': 'scale-down-delay-after-delete', 'type': 'str'}, + 'scale_down_delay_after_failure': {'key': 'scale-down-delay-after-failure', 'type': 'str'}, + 'scale_down_unneeded_time': {'key': 'scale-down-unneeded-time', 'type': 'str'}, + 'scale_down_unready_time': {'key': 'scale-down-unready-time', 'type': 'str'}, + 'scale_down_utilization_threshold': {'key': 'scale-down-utilization-threshold', 'type': 'str'}, + 'skip_nodes_with_local_storage': {'key': 'skip-nodes-with-local-storage', 'type': 'str'}, + 'skip_nodes_with_system_pods': {'key': 'skip-nodes-with-system-pods', 'type': 'str'}, + } + + def __init__( + self, + *, + balance_similar_node_groups: Optional[str] = None, + expander: Optional[Union[str, "Expander"]] = None, + max_empty_bulk_delete: Optional[str] = None, + max_graceful_termination_sec: Optional[str] = None, + max_node_provision_time: Optional[str] = None, + max_total_unready_percentage: Optional[str] = None, + new_pod_scale_up_delay: Optional[str] = None, + ok_total_unready_count: Optional[str] = None, + scan_interval: Optional[str] = None, + scale_down_delay_after_add: Optional[str] = None, + scale_down_delay_after_delete: Optional[str] = None, + scale_down_delay_after_failure: Optional[str] = None, + scale_down_unneeded_time: Optional[str] = None, + scale_down_unready_time: Optional[str] = None, + scale_down_utilization_threshold: Optional[str] = None, + skip_nodes_with_local_storage: Optional[str] = None, + skip_nodes_with_system_pods: Optional[str] = None, + **kwargs + ): + super(ManagedClusterPropertiesAutoScalerProfile, self).__init__(**kwargs) + self.balance_similar_node_groups = balance_similar_node_groups + self.expander = expander + self.max_empty_bulk_delete = max_empty_bulk_delete + self.max_graceful_termination_sec = max_graceful_termination_sec + self.max_node_provision_time = max_node_provision_time + self.max_total_unready_percentage = max_total_unready_percentage + self.new_pod_scale_up_delay = new_pod_scale_up_delay + self.ok_total_unready_count = ok_total_unready_count + self.scan_interval = scan_interval + self.scale_down_delay_after_add = scale_down_delay_after_add + self.scale_down_delay_after_delete = scale_down_delay_after_delete + self.scale_down_delay_after_failure = scale_down_delay_after_failure + self.scale_down_unneeded_time = scale_down_unneeded_time + self.scale_down_unready_time = scale_down_unready_time + self.scale_down_utilization_threshold = scale_down_utilization_threshold + self.skip_nodes_with_local_storage = skip_nodes_with_local_storage + self.skip_nodes_with_system_pods = skip_nodes_with_system_pods + + +class ManagedClusterSecurityProfile(msrest.serialization.Model): + """Security profile for the container service cluster. + + :param azure_defender: Azure Defender settings for the security profile. + :type azure_defender: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterSecurityProfileAzureDefender + """ + + _attribute_map = { + 'azure_defender': {'key': 'azureDefender', 'type': 'ManagedClusterSecurityProfileAzureDefender'}, + } + + def __init__( + self, + *, + azure_defender: Optional["ManagedClusterSecurityProfileAzureDefender"] = None, + **kwargs + ): + super(ManagedClusterSecurityProfile, self).__init__(**kwargs) + self.azure_defender = azure_defender + + +class ManagedClusterSecurityProfileAzureDefender(msrest.serialization.Model): + """Azure Defender settings for the security profile. + + :param enabled: Whether to enable Azure Defender. + :type enabled: bool + :param log_analytics_workspace_resource_id: Resource ID of the Log Analytics workspace to be + associated with Azure Defender. When Azure Defender is enabled, this field is required and + must be a valid workspace resource ID. When Azure Defender is disabled, leave the field empty. + :type log_analytics_workspace_resource_id: str + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'log_analytics_workspace_resource_id': {'key': 'logAnalyticsWorkspaceResourceId', 'type': 'str'}, + } + + def __init__( + self, + *, + enabled: Optional[bool] = None, + log_analytics_workspace_resource_id: Optional[str] = None, + **kwargs + ): + super(ManagedClusterSecurityProfileAzureDefender, self).__init__(**kwargs) + self.enabled = enabled + self.log_analytics_workspace_resource_id = log_analytics_workspace_resource_id + + +class ManagedClusterServicePrincipalProfile(msrest.serialization.Model): + """Information about a service principal identity for the cluster to use for manipulating Azure APIs. + + All required parameters must be populated in order to send to Azure. + + :param client_id: Required. The ID for the service principal. + :type client_id: str + :param secret: The secret password associated with the service principal in plain text. + :type secret: str + """ + + _validation = { + 'client_id': {'required': True}, + } + + _attribute_map = { + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'secret': {'key': 'secret', 'type': 'str'}, + } + + def __init__( + self, + *, + client_id: str, + secret: Optional[str] = None, + **kwargs + ): + super(ManagedClusterServicePrincipalProfile, self).__init__(**kwargs) + self.client_id = client_id + self.secret = secret + + +class ManagedClusterSKU(msrest.serialization.Model): + """The SKU of a Managed Cluster. + + :param name: The name of a managed cluster SKU. Possible values include: "Basic". + :type name: str or ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterSKUName + :param tier: If not specified, the default is 'Free'. See `uptime SLA + `_ for more details. Possible values include: + "Paid", "Free". + :type tier: str or ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterSKUTier + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[Union[str, "ManagedClusterSKUName"]] = None, + tier: Optional[Union[str, "ManagedClusterSKUTier"]] = None, + **kwargs + ): + super(ManagedClusterSKU, self).__init__(**kwargs) + self.name = name + self.tier = tier + + +class ManagedClusterUpgradeProfile(msrest.serialization.Model): + """The list of available upgrades for compute pools. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The ID of the upgrade profile. + :vartype id: str + :ivar name: The name of the upgrade profile. + :vartype name: str + :ivar type: The type of the upgrade profile. + :vartype type: str + :param control_plane_profile: Required. The list of available upgrade versions for the control + plane. + :type control_plane_profile: + ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPoolUpgradeProfile + :param agent_pool_profiles: Required. The list of available upgrade versions for agent pools. + :type agent_pool_profiles: + list[~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterPoolUpgradeProfile] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'control_plane_profile': {'required': True}, + 'agent_pool_profiles': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'control_plane_profile': {'key': 'properties.controlPlaneProfile', 'type': 'ManagedClusterPoolUpgradeProfile'}, + 'agent_pool_profiles': {'key': 'properties.agentPoolProfiles', 'type': '[ManagedClusterPoolUpgradeProfile]'}, + } + + def __init__( + self, + *, + control_plane_profile: "ManagedClusterPoolUpgradeProfile", + agent_pool_profiles: List["ManagedClusterPoolUpgradeProfile"], + **kwargs + ): + super(ManagedClusterUpgradeProfile, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.control_plane_profile = control_plane_profile + self.agent_pool_profiles = agent_pool_profiles + + +class ManagedClusterWindowsProfile(msrest.serialization.Model): + """Profile for Windows VMs in the managed cluster. + + All required parameters must be populated in order to send to Azure. + + :param admin_username: Required. Specifies the name of the administrator account. + :code:`
`:code:`
` **Restriction:** Cannot end in "." :code:`
`:code:`
` + **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", + "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", + "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", + "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 + character :code:`
`:code:`
` **Max-length:** 20 characters. + :type admin_username: str + :param admin_password: Specifies the password of the administrator account. + :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` + **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 + conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", + "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". + :type admin_password: str + :param license_type: The license type to use for Windows VMs. See `Azure Hybrid User Benefits + `_ for more details. Possible values + include: "None", "Windows_Server". + :type license_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.LicenseType + :param enable_csi_proxy: For more details on CSI proxy, see the `CSI proxy GitHub repo + `_. + :type enable_csi_proxy: bool + """ + + _validation = { + 'admin_username': {'required': True}, + } + + _attribute_map = { + 'admin_username': {'key': 'adminUsername', 'type': 'str'}, + 'admin_password': {'key': 'adminPassword', 'type': 'str'}, + 'license_type': {'key': 'licenseType', 'type': 'str'}, + 'enable_csi_proxy': {'key': 'enableCSIProxy', 'type': 'bool'}, + } + + def __init__( + self, + *, + admin_username: str, + admin_password: Optional[str] = None, + license_type: Optional[Union[str, "LicenseType"]] = None, + enable_csi_proxy: Optional[bool] = None, + **kwargs + ): + super(ManagedClusterWindowsProfile, self).__init__(**kwargs) + self.admin_username = admin_username + self.admin_password = admin_password + self.license_type = license_type + self.enable_csi_proxy = enable_csi_proxy + + +class ManagedServiceIdentityUserAssignedIdentitiesValue(msrest.serialization.Model): + """ManagedServiceIdentityUserAssignedIdentitiesValue. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedServiceIdentityUserAssignedIdentitiesValue, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + +class OperationListResult(msrest.serialization.Model): + """The List Operation response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of operations. + :vartype value: list[~azure.mgmt.containerservice.v2021_08_01.models.OperationValue] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[OperationValue]'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationListResult, self).__init__(**kwargs) + self.value = None + + +class OperationValue(msrest.serialization.Model): + """Describes the properties of a Operation value. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar origin: The origin of the operation. + :vartype origin: str + :ivar name: The name of the operation. + :vartype name: str + :ivar operation: The display name of the operation. + :vartype operation: str + :ivar resource: The display name of the resource the operation applies to. + :vartype resource: str + :ivar description: The description of the operation. + :vartype description: str + :ivar provider: The resource provider for the operation. + :vartype provider: str + """ + + _validation = { + 'origin': {'readonly': True}, + 'name': {'readonly': True}, + 'operation': {'readonly': True}, + 'resource': {'readonly': True}, + 'description': {'readonly': True}, + 'provider': {'readonly': True}, + } + + _attribute_map = { + 'origin': {'key': 'origin', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'operation': {'key': 'display.operation', 'type': 'str'}, + 'resource': {'key': 'display.resource', 'type': 'str'}, + 'description': {'key': 'display.description', 'type': 'str'}, + 'provider': {'key': 'display.provider', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationValue, self).__init__(**kwargs) + self.origin = None + self.name = None + self.operation = None + self.resource = None + self.description = None + self.provider = None + + +class OSOptionProfile(msrest.serialization.Model): + """The OS option profile. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The ID of the OS option resource. + :vartype id: str + :ivar name: The name of the OS option resource. + :vartype name: str + :ivar type: The type of the OS option resource. + :vartype type: str + :param os_option_property_list: Required. The list of OS options. + :type os_option_property_list: + list[~azure.mgmt.containerservice.v2021_08_01.models.OSOptionProperty] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'os_option_property_list': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'os_option_property_list': {'key': 'properties.osOptionPropertyList', 'type': '[OSOptionProperty]'}, + } + + def __init__( + self, + *, + os_option_property_list: List["OSOptionProperty"], + **kwargs + ): + super(OSOptionProfile, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.os_option_property_list = os_option_property_list + + +class OSOptionProperty(msrest.serialization.Model): + """OS option property. + + All required parameters must be populated in order to send to Azure. + + :param os_type: Required. The OS type. + :type os_type: str + :param enable_fips_image: Required. Whether the image is FIPS-enabled. + :type enable_fips_image: bool + """ + + _validation = { + 'os_type': {'required': True}, + 'enable_fips_image': {'required': True}, + } + + _attribute_map = { + 'os_type': {'key': 'os-type', 'type': 'str'}, + 'enable_fips_image': {'key': 'enable-fips-image', 'type': 'bool'}, + } + + def __init__( + self, + *, + os_type: str, + enable_fips_image: bool, + **kwargs + ): + super(OSOptionProperty, self).__init__(**kwargs) + self.os_type = os_type + self.enable_fips_image = enable_fips_image + + +class OutboundEnvironmentEndpoint(msrest.serialization.Model): + """Egress endpoints which AKS agent nodes connect to for common purpose. + + :param category: The category of endpoints accessed by the AKS agent node, e.g. + azure-resource-management, apiserver, etc. + :type category: str + :param endpoints: The endpoints that AKS agent nodes connect to. + :type endpoints: list[~azure.mgmt.containerservice.v2021_08_01.models.EndpointDependency] + """ + + _attribute_map = { + 'category': {'key': 'category', 'type': 'str'}, + 'endpoints': {'key': 'endpoints', 'type': '[EndpointDependency]'}, + } + + def __init__( + self, + *, + category: Optional[str] = None, + endpoints: Optional[List["EndpointDependency"]] = None, + **kwargs + ): + super(OutboundEnvironmentEndpoint, self).__init__(**kwargs) + self.category = category + self.endpoints = endpoints + + +class OutboundEnvironmentEndpointCollection(msrest.serialization.Model): + """Collection of OutboundEnvironmentEndpoint. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of resources. + :type value: list[~azure.mgmt.containerservice.v2021_08_01.models.OutboundEnvironmentEndpoint] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[OutboundEnvironmentEndpoint]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["OutboundEnvironmentEndpoint"], + **kwargs + ): + super(OutboundEnvironmentEndpointCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class PowerState(msrest.serialization.Model): + """Describes the Power State of the cluster. + + :param code: Tells whether the cluster is Running or Stopped. Possible values include: + "Running", "Stopped". + :type code: str or ~azure.mgmt.containerservice.v2021_08_01.models.Code + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + } + + def __init__( + self, + *, + code: Optional[Union[str, "Code"]] = None, + **kwargs + ): + super(PowerState, self).__init__(**kwargs) + self.code = code + + +class PrivateEndpoint(msrest.serialization.Model): + """Private endpoint which a connection belongs to. + + :param id: The resource ID of the private endpoint. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + **kwargs + ): + super(PrivateEndpoint, self).__init__(**kwargs) + self.id = id + + +class PrivateEndpointConnection(msrest.serialization.Model): + """A private endpoint connection. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The ID of the private endpoint connection. + :vartype id: str + :ivar name: The name of the private endpoint connection. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :ivar provisioning_state: The current provisioning state. Possible values include: "Succeeded", + "Creating", "Deleting", "Failed". + :vartype provisioning_state: str or + ~azure.mgmt.containerservice.v2021_08_01.models.PrivateEndpointConnectionProvisioningState + :param private_endpoint: The resource of private endpoint. + :type private_endpoint: ~azure.mgmt.containerservice.v2021_08_01.models.PrivateEndpoint + :param private_link_service_connection_state: A collection of information about the state of + the connection between service consumer and provider. + :type private_link_service_connection_state: + ~azure.mgmt.containerservice.v2021_08_01.models.PrivateLinkServiceConnectionState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, + } + + def __init__( + self, + *, + private_endpoint: Optional["PrivateEndpoint"] = None, + private_link_service_connection_state: Optional["PrivateLinkServiceConnectionState"] = None, + **kwargs + ): + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.provisioning_state = None + self.private_endpoint = private_endpoint + self.private_link_service_connection_state = private_link_service_connection_state + + +class PrivateEndpointConnectionListResult(msrest.serialization.Model): + """A list of private endpoint connections. + + :param value: The collection value. + :type value: list[~azure.mgmt.containerservice.v2021_08_01.models.PrivateEndpointConnection] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, + } + + def __init__( + self, + *, + value: Optional[List["PrivateEndpointConnection"]] = None, + **kwargs + ): + super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) + self.value = value + + +class PrivateLinkResource(msrest.serialization.Model): + """A private link resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: The ID of the private link resource. + :type id: str + :param name: The name of the private link resource. + :type name: str + :param type: The resource type. + :type type: str + :param group_id: The group ID of the resource. + :type group_id: str + :param required_members: The RequiredMembers of the resource. + :type required_members: list[str] + :ivar private_link_service_id: The private link service ID of the resource, this field is + exposed only to NRP internally. + :vartype private_link_service_id: str + """ + + _validation = { + 'private_link_service_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'group_id': {'key': 'groupId', 'type': 'str'}, + 'required_members': {'key': 'requiredMembers', 'type': '[str]'}, + 'private_link_service_id': {'key': 'privateLinkServiceID', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + type: Optional[str] = None, + group_id: Optional[str] = None, + required_members: Optional[List[str]] = None, + **kwargs + ): + super(PrivateLinkResource, self).__init__(**kwargs) + self.id = id + self.name = name + self.type = type + self.group_id = group_id + self.required_members = required_members + self.private_link_service_id = None + + +class PrivateLinkResourcesListResult(msrest.serialization.Model): + """A list of private link resources. + + :param value: The collection value. + :type value: list[~azure.mgmt.containerservice.v2021_08_01.models.PrivateLinkResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + } + + def __init__( + self, + *, + value: Optional[List["PrivateLinkResource"]] = None, + **kwargs + ): + super(PrivateLinkResourcesListResult, self).__init__(**kwargs) + self.value = value + + +class PrivateLinkServiceConnectionState(msrest.serialization.Model): + """The state of a private link service connection. + + :param status: The private link service connection status. Possible values include: "Pending", + "Approved", "Rejected", "Disconnected". + :type status: str or ~azure.mgmt.containerservice.v2021_08_01.models.ConnectionStatus + :param description: The private link service connection description. + :type description: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + *, + status: Optional[Union[str, "ConnectionStatus"]] = None, + description: Optional[str] = None, + **kwargs + ): + super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.status = status + self.description = description + + +class ResourceReference(msrest.serialization.Model): + """A reference to an Azure resource. + + :param id: The fully qualified Azure resource id. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + **kwargs + ): + super(ResourceReference, self).__init__(**kwargs) + self.id = id + + +class RunCommandRequest(msrest.serialization.Model): + """A run command request. + + All required parameters must be populated in order to send to Azure. + + :param command: Required. The command to run. + :type command: str + :param context: A base64 encoded zip file containing the files required by the command. + :type context: str + :param cluster_token: AuthToken issued for AKS AAD Server App. + :type cluster_token: str + """ + + _validation = { + 'command': {'required': True}, + } + + _attribute_map = { + 'command': {'key': 'command', 'type': 'str'}, + 'context': {'key': 'context', 'type': 'str'}, + 'cluster_token': {'key': 'clusterToken', 'type': 'str'}, + } + + def __init__( + self, + *, + command: str, + context: Optional[str] = None, + cluster_token: Optional[str] = None, + **kwargs + ): + super(RunCommandRequest, self).__init__(**kwargs) + self.command = command + self.context = context + self.cluster_token = cluster_token + + +class RunCommandResult(msrest.serialization.Model): + """run command result. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The command id. + :vartype id: str + :ivar provisioning_state: provisioning State. + :vartype provisioning_state: str + :ivar exit_code: The exit code of the command. + :vartype exit_code: int + :ivar started_at: The time when the command started. + :vartype started_at: ~datetime.datetime + :ivar finished_at: The time when the command finished. + :vartype finished_at: ~datetime.datetime + :ivar logs: The command output. + :vartype logs: str + :ivar reason: An explanation of why provisioningState is set to failed (if so). + :vartype reason: str + """ + + _validation = { + 'id': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'exit_code': {'readonly': True}, + 'started_at': {'readonly': True}, + 'finished_at': {'readonly': True}, + 'logs': {'readonly': True}, + 'reason': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'exit_code': {'key': 'properties.exitCode', 'type': 'int'}, + 'started_at': {'key': 'properties.startedAt', 'type': 'iso-8601'}, + 'finished_at': {'key': 'properties.finishedAt', 'type': 'iso-8601'}, + 'logs': {'key': 'properties.logs', 'type': 'str'}, + 'reason': {'key': 'properties.reason', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RunCommandResult, self).__init__(**kwargs) + self.id = None + self.provisioning_state = None + self.exit_code = None + self.started_at = None + self.finished_at = None + self.logs = None + self.reason = None + + +class Snapshot(Resource): + """A node pool snapshot resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar system_data: The system metadata relating to this snapshot. + :vartype system_data: ~azure.mgmt.containerservice.v2021_08_01.models.SystemData + :param creation_data: CreationData to be used to specify the source agent pool resource ID to + create this snapshot. + :type creation_data: ~azure.mgmt.containerservice.v2021_08_01.models.CreationData + :param snapshot_type: The type of a snapshot. The default is NodePool. Possible values include: + "NodePool". Default value: "NodePool". + :type snapshot_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.SnapshotType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'creation_data': {'key': 'properties.creationData', 'type': 'CreationData'}, + 'snapshot_type': {'key': 'properties.snapshotType', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + creation_data: Optional["CreationData"] = None, + snapshot_type: Optional[Union[str, "SnapshotType"]] = "NodePool", + **kwargs + ): + super(Snapshot, self).__init__(location=location, tags=tags, **kwargs) + self.system_data = None + self.creation_data = creation_data + self.snapshot_type = snapshot_type + + +class SnapshotListResult(msrest.serialization.Model): + """The response from the List Snapshots operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: The list of snapshots. + :type value: list[~azure.mgmt.containerservice.v2021_08_01.models.Snapshot] + :ivar next_link: The URL to get the next set of snapshot results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Snapshot]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["Snapshot"]] = None, + **kwargs + ): + super(SnapshotListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class SysctlConfig(msrest.serialization.Model): + """Sysctl settings for Linux agent nodes. + + :param net_core_somaxconn: Sysctl setting net.core.somaxconn. + :type net_core_somaxconn: int + :param net_core_netdev_max_backlog: Sysctl setting net.core.netdev_max_backlog. + :type net_core_netdev_max_backlog: int + :param net_core_rmem_default: Sysctl setting net.core.rmem_default. + :type net_core_rmem_default: int + :param net_core_rmem_max: Sysctl setting net.core.rmem_max. + :type net_core_rmem_max: int + :param net_core_wmem_default: Sysctl setting net.core.wmem_default. + :type net_core_wmem_default: int + :param net_core_wmem_max: Sysctl setting net.core.wmem_max. + :type net_core_wmem_max: int + :param net_core_optmem_max: Sysctl setting net.core.optmem_max. + :type net_core_optmem_max: int + :param net_ipv4_tcp_max_syn_backlog: Sysctl setting net.ipv4.tcp_max_syn_backlog. + :type net_ipv4_tcp_max_syn_backlog: int + :param net_ipv4_tcp_max_tw_buckets: Sysctl setting net.ipv4.tcp_max_tw_buckets. + :type net_ipv4_tcp_max_tw_buckets: int + :param net_ipv4_tcp_fin_timeout: Sysctl setting net.ipv4.tcp_fin_timeout. + :type net_ipv4_tcp_fin_timeout: int + :param net_ipv4_tcp_keepalive_time: Sysctl setting net.ipv4.tcp_keepalive_time. + :type net_ipv4_tcp_keepalive_time: int + :param net_ipv4_tcp_keepalive_probes: Sysctl setting net.ipv4.tcp_keepalive_probes. + :type net_ipv4_tcp_keepalive_probes: int + :param net_ipv4_tcpkeepalive_intvl: Sysctl setting net.ipv4.tcp_keepalive_intvl. + :type net_ipv4_tcpkeepalive_intvl: int + :param net_ipv4_tcp_tw_reuse: Sysctl setting net.ipv4.tcp_tw_reuse. + :type net_ipv4_tcp_tw_reuse: bool + :param net_ipv4_ip_local_port_range: Sysctl setting net.ipv4.ip_local_port_range. + :type net_ipv4_ip_local_port_range: str + :param net_ipv4_neigh_default_gc_thresh1: Sysctl setting net.ipv4.neigh.default.gc_thresh1. + :type net_ipv4_neigh_default_gc_thresh1: int + :param net_ipv4_neigh_default_gc_thresh2: Sysctl setting net.ipv4.neigh.default.gc_thresh2. + :type net_ipv4_neigh_default_gc_thresh2: int + :param net_ipv4_neigh_default_gc_thresh3: Sysctl setting net.ipv4.neigh.default.gc_thresh3. + :type net_ipv4_neigh_default_gc_thresh3: int + :param net_netfilter_nf_conntrack_max: Sysctl setting net.netfilter.nf_conntrack_max. + :type net_netfilter_nf_conntrack_max: int + :param net_netfilter_nf_conntrack_buckets: Sysctl setting net.netfilter.nf_conntrack_buckets. + :type net_netfilter_nf_conntrack_buckets: int + :param fs_inotify_max_user_watches: Sysctl setting fs.inotify.max_user_watches. + :type fs_inotify_max_user_watches: int + :param fs_file_max: Sysctl setting fs.file-max. + :type fs_file_max: int + :param fs_aio_max_nr: Sysctl setting fs.aio-max-nr. + :type fs_aio_max_nr: int + :param fs_nr_open: Sysctl setting fs.nr_open. + :type fs_nr_open: int + :param kernel_threads_max: Sysctl setting kernel.threads-max. + :type kernel_threads_max: int + :param vm_max_map_count: Sysctl setting vm.max_map_count. + :type vm_max_map_count: int + :param vm_swappiness: Sysctl setting vm.swappiness. + :type vm_swappiness: int + :param vm_vfs_cache_pressure: Sysctl setting vm.vfs_cache_pressure. + :type vm_vfs_cache_pressure: int + """ + + _attribute_map = { + 'net_core_somaxconn': {'key': 'netCoreSomaxconn', 'type': 'int'}, + 'net_core_netdev_max_backlog': {'key': 'netCoreNetdevMaxBacklog', 'type': 'int'}, + 'net_core_rmem_default': {'key': 'netCoreRmemDefault', 'type': 'int'}, + 'net_core_rmem_max': {'key': 'netCoreRmemMax', 'type': 'int'}, + 'net_core_wmem_default': {'key': 'netCoreWmemDefault', 'type': 'int'}, + 'net_core_wmem_max': {'key': 'netCoreWmemMax', 'type': 'int'}, + 'net_core_optmem_max': {'key': 'netCoreOptmemMax', 'type': 'int'}, + 'net_ipv4_tcp_max_syn_backlog': {'key': 'netIpv4TcpMaxSynBacklog', 'type': 'int'}, + 'net_ipv4_tcp_max_tw_buckets': {'key': 'netIpv4TcpMaxTwBuckets', 'type': 'int'}, + 'net_ipv4_tcp_fin_timeout': {'key': 'netIpv4TcpFinTimeout', 'type': 'int'}, + 'net_ipv4_tcp_keepalive_time': {'key': 'netIpv4TcpKeepaliveTime', 'type': 'int'}, + 'net_ipv4_tcp_keepalive_probes': {'key': 'netIpv4TcpKeepaliveProbes', 'type': 'int'}, + 'net_ipv4_tcpkeepalive_intvl': {'key': 'netIpv4TcpkeepaliveIntvl', 'type': 'int'}, + 'net_ipv4_tcp_tw_reuse': {'key': 'netIpv4TcpTwReuse', 'type': 'bool'}, + 'net_ipv4_ip_local_port_range': {'key': 'netIpv4IpLocalPortRange', 'type': 'str'}, + 'net_ipv4_neigh_default_gc_thresh1': {'key': 'netIpv4NeighDefaultGcThresh1', 'type': 'int'}, + 'net_ipv4_neigh_default_gc_thresh2': {'key': 'netIpv4NeighDefaultGcThresh2', 'type': 'int'}, + 'net_ipv4_neigh_default_gc_thresh3': {'key': 'netIpv4NeighDefaultGcThresh3', 'type': 'int'}, + 'net_netfilter_nf_conntrack_max': {'key': 'netNetfilterNfConntrackMax', 'type': 'int'}, + 'net_netfilter_nf_conntrack_buckets': {'key': 'netNetfilterNfConntrackBuckets', 'type': 'int'}, + 'fs_inotify_max_user_watches': {'key': 'fsInotifyMaxUserWatches', 'type': 'int'}, + 'fs_file_max': {'key': 'fsFileMax', 'type': 'int'}, + 'fs_aio_max_nr': {'key': 'fsAioMaxNr', 'type': 'int'}, + 'fs_nr_open': {'key': 'fsNrOpen', 'type': 'int'}, + 'kernel_threads_max': {'key': 'kernelThreadsMax', 'type': 'int'}, + 'vm_max_map_count': {'key': 'vmMaxMapCount', 'type': 'int'}, + 'vm_swappiness': {'key': 'vmSwappiness', 'type': 'int'}, + 'vm_vfs_cache_pressure': {'key': 'vmVfsCachePressure', 'type': 'int'}, + } + + def __init__( + self, + *, + net_core_somaxconn: Optional[int] = None, + net_core_netdev_max_backlog: Optional[int] = None, + net_core_rmem_default: Optional[int] = None, + net_core_rmem_max: Optional[int] = None, + net_core_wmem_default: Optional[int] = None, + net_core_wmem_max: Optional[int] = None, + net_core_optmem_max: Optional[int] = None, + net_ipv4_tcp_max_syn_backlog: Optional[int] = None, + net_ipv4_tcp_max_tw_buckets: Optional[int] = None, + net_ipv4_tcp_fin_timeout: Optional[int] = None, + net_ipv4_tcp_keepalive_time: Optional[int] = None, + net_ipv4_tcp_keepalive_probes: Optional[int] = None, + net_ipv4_tcpkeepalive_intvl: Optional[int] = None, + net_ipv4_tcp_tw_reuse: Optional[bool] = None, + net_ipv4_ip_local_port_range: Optional[str] = None, + net_ipv4_neigh_default_gc_thresh1: Optional[int] = None, + net_ipv4_neigh_default_gc_thresh2: Optional[int] = None, + net_ipv4_neigh_default_gc_thresh3: Optional[int] = None, + net_netfilter_nf_conntrack_max: Optional[int] = None, + net_netfilter_nf_conntrack_buckets: Optional[int] = None, + fs_inotify_max_user_watches: Optional[int] = None, + fs_file_max: Optional[int] = None, + fs_aio_max_nr: Optional[int] = None, + fs_nr_open: Optional[int] = None, + kernel_threads_max: Optional[int] = None, + vm_max_map_count: Optional[int] = None, + vm_swappiness: Optional[int] = None, + vm_vfs_cache_pressure: Optional[int] = None, + **kwargs + ): + super(SysctlConfig, self).__init__(**kwargs) + self.net_core_somaxconn = net_core_somaxconn + self.net_core_netdev_max_backlog = net_core_netdev_max_backlog + self.net_core_rmem_default = net_core_rmem_default + self.net_core_rmem_max = net_core_rmem_max + self.net_core_wmem_default = net_core_wmem_default + self.net_core_wmem_max = net_core_wmem_max + self.net_core_optmem_max = net_core_optmem_max + self.net_ipv4_tcp_max_syn_backlog = net_ipv4_tcp_max_syn_backlog + self.net_ipv4_tcp_max_tw_buckets = net_ipv4_tcp_max_tw_buckets + self.net_ipv4_tcp_fin_timeout = net_ipv4_tcp_fin_timeout + self.net_ipv4_tcp_keepalive_time = net_ipv4_tcp_keepalive_time + self.net_ipv4_tcp_keepalive_probes = net_ipv4_tcp_keepalive_probes + self.net_ipv4_tcpkeepalive_intvl = net_ipv4_tcpkeepalive_intvl + self.net_ipv4_tcp_tw_reuse = net_ipv4_tcp_tw_reuse + self.net_ipv4_ip_local_port_range = net_ipv4_ip_local_port_range + self.net_ipv4_neigh_default_gc_thresh1 = net_ipv4_neigh_default_gc_thresh1 + self.net_ipv4_neigh_default_gc_thresh2 = net_ipv4_neigh_default_gc_thresh2 + self.net_ipv4_neigh_default_gc_thresh3 = net_ipv4_neigh_default_gc_thresh3 + self.net_netfilter_nf_conntrack_max = net_netfilter_nf_conntrack_max + self.net_netfilter_nf_conntrack_buckets = net_netfilter_nf_conntrack_buckets + self.fs_inotify_max_user_watches = fs_inotify_max_user_watches + self.fs_file_max = fs_file_max + self.fs_aio_max_nr = fs_aio_max_nr + self.fs_nr_open = fs_nr_open + self.kernel_threads_max = kernel_threads_max + self.vm_max_map_count = vm_max_map_count + self.vm_swappiness = vm_swappiness + self.vm_vfs_cache_pressure = vm_vfs_cache_pressure + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or ~azure.mgmt.containerservice.v2021_08_01.models.CreatedByType + :param created_at: The UTC timestamp of resource creation. + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or + ~azure.mgmt.containerservice.v2021_08_01.models.CreatedByType + :param last_modified_at: The type of identity that last modified the resource. + :type last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "CreatedByType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "CreatedByType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, + **kwargs + ): + super(SystemData, self).__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at + + +class TagsObject(msrest.serialization.Model): + """Tags object for patch operations. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(TagsObject, self).__init__(**kwargs) + self.tags = tags + + +class TimeInWeek(msrest.serialization.Model): + """Time in a week. + + :param day: The day of the week. Possible values include: "Sunday", "Monday", "Tuesday", + "Wednesday", "Thursday", "Friday", "Saturday". + :type day: str or ~azure.mgmt.containerservice.v2021_08_01.models.WeekDay + :param hour_slots: Each integer hour represents a time range beginning at 0m after the hour + ending at the next hour (non-inclusive). 0 corresponds to 00:00 UTC, 23 corresponds to 23:00 + UTC. Specifying [0, 1] means the 00:00 - 02:00 UTC time range. + :type hour_slots: list[int] + """ + + _attribute_map = { + 'day': {'key': 'day', 'type': 'str'}, + 'hour_slots': {'key': 'hourSlots', 'type': '[int]'}, + } + + def __init__( + self, + *, + day: Optional[Union[str, "WeekDay"]] = None, + hour_slots: Optional[List[int]] = None, + **kwargs + ): + super(TimeInWeek, self).__init__(**kwargs) + self.day = day + self.hour_slots = hour_slots + + +class TimeSpan(msrest.serialization.Model): + """For example, between 2021-05-25T13:00:00Z and 2021-05-25T14:00:00Z. + + :param start: The start of a time span. + :type start: ~datetime.datetime + :param end: The end of a time span. + :type end: ~datetime.datetime + """ + + _attribute_map = { + 'start': {'key': 'start', 'type': 'iso-8601'}, + 'end': {'key': 'end', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + start: Optional[datetime.datetime] = None, + end: Optional[datetime.datetime] = None, + **kwargs + ): + super(TimeSpan, self).__init__(**kwargs) + self.start = start + self.end = end diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/__init__.py new file mode 100644 index 000000000000..5e1e5e72fa59 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/__init__.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operations import Operations +from ._managed_clusters_operations import ManagedClustersOperations +from ._maintenance_configurations_operations import MaintenanceConfigurationsOperations +from ._agent_pools_operations import AgentPoolsOperations +from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._private_link_resources_operations import PrivateLinkResourcesOperations +from ._resolve_private_link_service_id_operations import ResolvePrivateLinkServiceIdOperations +from ._snapshots_operations import SnapshotsOperations + +__all__ = [ + 'Operations', + 'ManagedClustersOperations', + 'MaintenanceConfigurationsOperations', + 'AgentPoolsOperations', + 'PrivateEndpointConnectionsOperations', + 'PrivateLinkResourcesOperations', + 'ResolvePrivateLinkServiceIdOperations', + 'SnapshotsOperations', +] diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_agent_pools_operations.py new file mode 100644 index 000000000000..d83f6642250f --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_agent_pools_operations.py @@ -0,0 +1,705 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class AgentPoolsOperations(object): + """AgentPoolsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.containerservice.v2021_08_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.AgentPoolListResult"] + """Gets a list of agent pools in the specified managed cluster. + + Gets a list of agent pools in the specified managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AgentPoolListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPoolListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AgentPoolListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools'} # type: ignore + + def get( + self, + resource_group_name, # type: str + resource_name, # type: str + agent_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.AgentPool" + """Gets the specified managed cluster agent pool. + + Gets the specified managed cluster agent pool. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. + :type agent_pool_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AgentPool, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.AgentPool + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AgentPool', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + resource_name, # type: str + agent_pool_name, # type: str + parameters, # type: "_models.AgentPool" + **kwargs # type: Any + ): + # type: (...) -> "_models.AgentPool" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'AgentPool') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AgentPool', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('AgentPool', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + resource_name, # type: str + agent_pool_name, # type: str + parameters, # type: "_models.AgentPool" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.AgentPool"] + """Creates or updates an agent pool in the specified managed cluster. + + Creates or updates an agent pool in the specified managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. + :type agent_pool_name: str + :param parameters: The agent pool to create or update. + :type parameters: ~azure.mgmt.containerservice.v2021_08_01.models.AgentPool + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either AgentPool or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_08_01.models.AgentPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AgentPool', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + resource_name, # type: str + agent_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + resource_name, # type: str + agent_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes an agent pool in the specified managed cluster. + + Deletes an agent pool in the specified managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. + :type agent_pool_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}'} # type: ignore + + def get_upgrade_profile( + self, + resource_group_name, # type: str + resource_name, # type: str + agent_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.AgentPoolUpgradeProfile" + """Gets the upgrade profile for an agent pool. + + Gets the upgrade profile for an agent pool. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. + :type agent_pool_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AgentPoolUpgradeProfile, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolUpgradeProfile + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPoolUpgradeProfile"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.get_upgrade_profile.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AgentPoolUpgradeProfile', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default'} # type: ignore + + def get_available_agent_pool_versions( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.AgentPoolAvailableVersions" + """Gets a list of supported Kubernetes versions for the specified agent pool. + + See `supported Kubernetes versions + `_ for more details about + the version lifecycle. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AgentPoolAvailableVersions, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolAvailableVersions + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPoolAvailableVersions"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.get_available_agent_pool_versions.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AgentPoolAvailableVersions', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_available_agent_pool_versions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions'} # type: ignore + + def _upgrade_node_image_version_initial( + self, + resource_group_name, # type: str + resource_name, # type: str + agent_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.AgentPool"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AgentPool"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self._upgrade_node_image_version_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 202: + deserialized = self._deserialize('AgentPool', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _upgrade_node_image_version_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion'} # type: ignore + + def begin_upgrade_node_image_version( + self, + resource_group_name, # type: str + resource_name, # type: str + agent_pool_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.AgentPool"] + """Upgrades the node image version of an agent pool to the latest. + + Upgrading the node image version of an agent pool applies the newest OS and runtime updates to + the nodes. AKS provides one new image per week with the latest updates. For more details on + node image versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. + :type agent_pool_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AgentPool"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._upgrade_node_image_version_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AgentPool', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_upgrade_node_image_version.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_maintenance_configurations_operations.py new file mode 100644 index 000000000000..9e5a0bf49af2 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_maintenance_configurations_operations.py @@ -0,0 +1,323 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class MaintenanceConfigurationsOperations(object): + """MaintenanceConfigurationsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.containerservice.v2021_08_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_managed_cluster( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.MaintenanceConfigurationListResult"] + """Gets a list of maintenance configurations in the specified managed cluster. + + Gets a list of maintenance configurations in the specified managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either MaintenanceConfigurationListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_08_01.models.MaintenanceConfigurationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MaintenanceConfigurationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_managed_cluster.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('MaintenanceConfigurationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_managed_cluster.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations'} # type: ignore + + def get( + self, + resource_group_name, # type: str + resource_name, # type: str + config_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.MaintenanceConfiguration" + """Gets the specified maintenance configuration of a managed cluster. + + Gets the specified maintenance configuration of a managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param config_name: The name of the maintenance configuration. + :type config_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MaintenanceConfiguration, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.MaintenanceConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MaintenanceConfiguration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'configName': self._serialize.url("config_name", config_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MaintenanceConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + + def create_or_update( + self, + resource_group_name, # type: str + resource_name, # type: str + config_name, # type: str + parameters, # type: "_models.MaintenanceConfiguration" + **kwargs # type: Any + ): + # type: (...) -> "_models.MaintenanceConfiguration" + """Creates or updates a maintenance configuration in the specified managed cluster. + + Creates or updates a maintenance configuration in the specified managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param config_name: The name of the maintenance configuration. + :type config_name: str + :param parameters: The maintenance configuration to create or update. + :type parameters: ~azure.mgmt.containerservice.v2021_08_01.models.MaintenanceConfiguration + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MaintenanceConfiguration, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.MaintenanceConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MaintenanceConfiguration"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'configName': self._serialize.url("config_name", config_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'MaintenanceConfiguration') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MaintenanceConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + resource_name, # type: str + config_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a maintenance configuration. + + Deletes a maintenance configuration. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param config_name: The name of the maintenance configuration. + :type config_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'configName': self._serialize.url("config_name", config_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_managed_clusters_operations.py new file mode 100644 index 000000000000..e031f202d911 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_managed_clusters_operations.py @@ -0,0 +1,1875 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ManagedClustersOperations(object): + """ManagedClustersOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.containerservice.v2021_08_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get_os_options( + self, + location, # type: str + resource_type=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.OSOptionProfile" + """Gets supported OS options in the specified subscription. + + Gets supported OS options in the specified subscription. + + :param location: The name of a supported Azure region. + :type location: str + :param resource_type: The resource type for which the OS options needs to be returned. + :type resource_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OSOptionProfile, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.OSOptionProfile + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OSOptionProfile"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.get_os_options.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if resource_type is not None: + query_parameters['resource-type'] = self._serialize.query("resource_type", resource_type, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('OSOptionProfile', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_os_options.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/osOptions/default'} # type: ignore + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ManagedClusterListResult"] + """Gets a list of managed clusters in the specified subscription. + + Gets a list of managed clusters in the specified subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ManagedClusterListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ManagedClusterListResult"] + """Lists managed clusters in the specified subscription and resource group. + + Lists managed clusters in the specified subscription and resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ManagedClusterListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ManagedClusterListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters'} # type: ignore + + def get_upgrade_profile( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ManagedClusterUpgradeProfile" + """Gets the upgrade profile of a managed cluster. + + Gets the upgrade profile of a managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ManagedClusterUpgradeProfile, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterUpgradeProfile + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterUpgradeProfile"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.get_upgrade_profile.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ManagedClusterUpgradeProfile', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} # type: ignore + + def get_access_profile( + self, + resource_group_name, # type: str + resource_name, # type: str + role_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ManagedClusterAccessProfile" + """Gets an access profile of a managed cluster. + + **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + `_ or + `ListClusterAdminCredentials + `_ . + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param role_name: The name of the role for managed cluster accessProfile resource. + :type role_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ManagedClusterAccessProfile, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterAccessProfile + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedClusterAccessProfile"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.get_access_profile.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'roleName': self._serialize.url("role_name", role_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ManagedClusterAccessProfile', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} # type: ignore + + def list_cluster_admin_credentials( + self, + resource_group_name, # type: str + resource_name, # type: str + server_fqdn=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.CredentialResults" + """Lists the admin credentials of a managed cluster. + + Lists the admin credentials of a managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param server_fqdn: server fqdn type for credentials to be returned. + :type server_fqdn: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.CredentialResults + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CredentialResults"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.list_cluster_admin_credentials.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if server_fqdn is not None: + query_parameters['server-fqdn'] = self._serialize.query("server_fqdn", server_fqdn, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CredentialResults', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_cluster_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential'} # type: ignore + + def list_cluster_user_credentials( + self, + resource_group_name, # type: str + resource_name, # type: str + server_fqdn=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.CredentialResults" + """Lists the user credentials of a managed cluster. + + Lists the user credentials of a managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param server_fqdn: server fqdn type for credentials to be returned. + :type server_fqdn: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.CredentialResults + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CredentialResults"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.list_cluster_user_credentials.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if server_fqdn is not None: + query_parameters['server-fqdn'] = self._serialize.query("server_fqdn", server_fqdn, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CredentialResults', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_cluster_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential'} # type: ignore + + def list_cluster_monitoring_user_credentials( + self, + resource_group_name, # type: str + resource_name, # type: str + server_fqdn=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.CredentialResults" + """Lists the cluster monitoring user credentials of a managed cluster. + + Lists the cluster monitoring user credentials of a managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param server_fqdn: server fqdn type for credentials to be returned. + :type server_fqdn: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CredentialResults, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.CredentialResults + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CredentialResults"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.list_cluster_monitoring_user_credentials.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if server_fqdn is not None: + query_parameters['server-fqdn'] = self._serialize.query("server_fqdn", server_fqdn, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CredentialResults', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_cluster_monitoring_user_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential'} # type: ignore + + def get( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ManagedCluster" + """Gets a managed cluster. + + Gets a managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ManagedCluster, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedCluster + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ManagedCluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "_models.ManagedCluster" + **kwargs # type: Any + ): + # type: (...) -> "_models.ManagedCluster" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ManagedCluster') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('ManagedCluster', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ManagedCluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "_models.ManagedCluster" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.ManagedCluster"] + """Creates or updates a managed cluster. + + Creates or updates a managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param parameters: The managed cluster to create or update. + :type parameters: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedCluster + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either ManagedCluster or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_08_01.models.ManagedCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ManagedCluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + def _update_tags_initial( + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "_models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "_models.ManagedCluster" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_tags_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ManagedCluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_tags_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + def begin_update_tags( + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "_models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.ManagedCluster"] + """Updates tags on a managed cluster. + + Updates tags on a managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param parameters: Parameters supplied to the Update Managed Cluster Tags operation. + :type parameters: ~azure.mgmt.containerservice.v2021_08_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either ManagedCluster or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_08_01.models.ManagedCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagedCluster"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_tags_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ManagedCluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes a managed cluster. + + Deletes a managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}'} # type: ignore + + def _reset_service_principal_profile_initial( + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "_models.ManagedClusterServicePrincipalProfile" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._reset_service_principal_profile_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _reset_service_principal_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore + + def begin_reset_service_principal_profile( + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "_models.ManagedClusterServicePrincipalProfile" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Reset the Service Principal Profile of a managed cluster. + + This action cannot be performed on a cluster that is not using a service principal. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param parameters: The service principal profile to set on the managed cluster. + :type parameters: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterServicePrincipalProfile + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._reset_service_principal_profile_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_service_principal_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'} # type: ignore + + def _reset_aad_profile_initial( + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "_models.ManagedClusterAADProfile" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._reset_aad_profile_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ManagedClusterAADProfile') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _reset_aad_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore + + def begin_reset_aad_profile( + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "_models.ManagedClusterAADProfile" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Reset the AAD Profile of a managed cluster. + + Reset the AAD Profile of a managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param parameters: The AAD profile to set on the Managed Cluster. + :type parameters: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterAADProfile + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._reset_aad_profile_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'} # type: ignore + + def _rotate_cluster_certificates_initial( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self._rotate_cluster_certificates_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _rotate_cluster_certificates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore + + def begin_rotate_cluster_certificates( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Rotates the certificates of a managed cluster. + + See `Certificate rotation `_ for + more details about rotating managed cluster certificates. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._rotate_cluster_certificates_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_rotate_cluster_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'} # type: ignore + + def _stop_initial( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self._stop_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _stop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop'} # type: ignore + + def begin_stop( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Stops a Managed Cluster. + + This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a + cluster stops the control plane and agent nodes entirely, while maintaining all object and + cluster state. A cluster does not accrue charges while it is stopped. See `stopping a cluster + `_ for more details about stopping a + cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._stop_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop'} # type: ignore + + def _start_initial( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self._start_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _start_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start'} # type: ignore + + def begin_start( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Starts a previously stopped Managed Cluster. + + See `starting a cluster `_ for more + details about starting a cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._start_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start'} # type: ignore + + def _run_command_initial( + self, + resource_group_name, # type: str + resource_name, # type: str + request_payload, # type: "_models.RunCommandRequest" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.RunCommandResult"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RunCommandResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._run_command_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(request_payload, 'RunCommandRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('RunCommandResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _run_command_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand'} # type: ignore + + def begin_run_command( + self, + resource_group_name, # type: str + resource_name, # type: str + request_payload, # type: "_models.RunCommandRequest" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.RunCommandResult"] + """Submits a command to run against the Managed Cluster. + + AKS will create a pod to run the command. This is primarily useful for private clusters. For + more information see `AKS Run Command + `_. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param request_payload: The run command request. + :type request_payload: ~azure.mgmt.containerservice.v2021_08_01.models.RunCommandRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either RunCommandResult or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2021_08_01.models.RunCommandResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.RunCommandResult"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._run_command_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + request_payload=request_payload, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('RunCommandResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_run_command.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand'} # type: ignore + + def get_command_result( + self, + resource_group_name, # type: str + resource_name, # type: str + command_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.RunCommandResult"] + """Gets the results of a command which has been run on the Managed Cluster. + + Gets the results of a command which has been run on the Managed Cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param command_id: Id of the command. + :type command_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RunCommandResult, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.RunCommandResult or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RunCommandResult"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.get_command_result.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'commandId': self._serialize.url("command_id", command_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('RunCommandResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_command_result.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/commandResults/{commandId}'} # type: ignore + + def list_outbound_network_dependencies_endpoints( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.OutboundEnvironmentEndpointCollection"] + """Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. + + Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the + specified managed cluster. The operation returns properties of each egress endpoint. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OutboundEnvironmentEndpointCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_08_01.models.OutboundEnvironmentEndpointCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundEnvironmentEndpointCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_outbound_network_dependencies_endpoints.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('OutboundEnvironmentEndpointCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_outbound_network_dependencies_endpoints.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/outboundNetworkDependenciesEndpoints'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_operations.py new file mode 100644 index 000000000000..82667caa7f0d --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_operations.py @@ -0,0 +1,111 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class Operations(object): + """Operations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.containerservice.v2021_08_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.OperationListResult"] + """Gets a list of operations. + + Gets a list of operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_08_01.models.OperationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('OperationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.ContainerService/operations'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_private_endpoint_connections_operations.py new file mode 100644 index 000000000000..a30cbec19e12 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_private_endpoint_connections_operations.py @@ -0,0 +1,367 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class PrivateEndpointConnectionsOperations(object): + """PrivateEndpointConnectionsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.containerservice.v2021_08_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateEndpointConnectionListResult" + """Gets a list of private endpoint connections in the specified managed cluster. + + To learn more about private clusters, see: + https://docs.microsoft.com/azure/aks/private-clusters. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnectionListResult, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.PrivateEndpointConnectionListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnectionListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections'} # type: ignore + + def get( + self, + resource_group_name, # type: str + resource_name, # type: str + private_endpoint_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateEndpointConnection" + """Gets the specified private endpoint connection. + + To learn more about private clusters, see: + https://docs.microsoft.com/azure/aks/private-clusters. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + resource_name, # type: str + private_endpoint_connection_name, # type: str + parameters, # type: "_models.PrivateEndpointConnection" + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateEndpointConnection" + """Updates a private endpoint connection. + + Updates a private endpoint connection. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. + :type private_endpoint_connection_name: str + :param parameters: The updated private endpoint connection. + :type parameters: ~azure.mgmt.containerservice.v2021_08_01.models.PrivateEndpointConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'PrivateEndpointConnection') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + resource_name, # type: str + private_endpoint_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + resource_name, # type: str + private_endpoint_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes a private endpoint connection. + + Deletes a private endpoint connection. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_private_link_resources_operations.py new file mode 100644 index 000000000000..9daaf5960b07 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_private_link_resources_operations.py @@ -0,0 +1,107 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class PrivateLinkResourcesOperations(object): + """PrivateLinkResourcesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.containerservice.v2021_08_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateLinkResourcesListResult" + """Gets a list of private link resources in the specified managed cluster. + + To learn more about private clusters, see: + https://docs.microsoft.com/azure/aks/private-clusters. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkResourcesListResult, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.PrivateLinkResourcesListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourcesListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateLinkResourcesListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateLinkResources'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_resolve_private_link_service_id_operations.py new file mode 100644 index 000000000000..652ce0ee7d87 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_resolve_private_link_service_id_operations.py @@ -0,0 +1,114 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ResolvePrivateLinkServiceIdOperations(object): + """ResolvePrivateLinkServiceIdOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.containerservice.v2021_08_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def post( + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "_models.PrivateLinkResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateLinkResource" + """Gets the private link service ID for the specified managed cluster. + + Gets the private link service ID for the specified managed cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param parameters: Parameters required in order to resolve a private link service ID. + :type parameters: ~azure.mgmt.containerservice.v2021_08_01.models.PrivateLinkResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkResource, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.PrivateLinkResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.post.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'PrivateLinkResource') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateLinkResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + post.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_snapshots_operations.py new file mode 100644 index 000000000000..fdbe3b380e0f --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_snapshots_operations.py @@ -0,0 +1,449 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class SnapshotsOperations(object): + """SnapshotsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.containerservice.v2021_08_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SnapshotListResult"] + """Gets a list of snapshots in the specified subscription. + + Gets a list of snapshots in the specified subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SnapshotListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_08_01.models.SnapshotListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SnapshotListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/snapshots'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SnapshotListResult"] + """Lists snapshots in the specified subscription and resource group. + + Lists snapshots in the specified subscription and resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SnapshotListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2021_08_01.models.SnapshotListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SnapshotListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots'} # type: ignore + + def get( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Snapshot" + """Gets a snapshot. + + Gets a snapshot. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Snapshot, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.Snapshot + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Snapshot', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}'} # type: ignore + + def create_or_update( + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "_models.Snapshot" + **kwargs # type: Any + ): + # type: (...) -> "_models.Snapshot" + """Creates or updates a snapshot. + + Creates or updates a snapshot. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param parameters: The snapshot to create or update. + :type parameters: ~azure.mgmt.containerservice.v2021_08_01.models.Snapshot + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Snapshot, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.Snapshot + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'Snapshot') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Snapshot', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Snapshot', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}'} # type: ignore + + def update_tags( + self, + resource_group_name, # type: str + resource_name, # type: str + parameters, # type: "_models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "_models.Snapshot" + """Updates tags on a snapshot. + + Updates tags on a snapshot. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param parameters: Parameters supplied to the Update snapshot Tags operation. + :type parameters: ~azure.mgmt.containerservice.v2021_08_01.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Snapshot, or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.Snapshot + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update_tags.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TagsObject') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Snapshot', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a snapshot. + + Deletes a snapshot. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}'} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/py.typed b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file From 53ea0c01543fcc7e1c62edf344ef8aaf53f62f84 Mon Sep 17 00:00:00 2001 From: Jiefeng Chen <51037443+BigCat20196@users.noreply.github.com> Date: Fri, 10 Sep 2021 16:30:02 +0800 Subject: [PATCH 38/85] Add auto-close and auto-run-pipline (#20516) * release_iseus_status_auto_reply * issue_aoto_close_revert * Update main.py * Update main.py * Update update_issue_body.py * Update reply_generator.py * Update reply_generator.py * Update update_issue_body.py * Update main.py * Update update_issue_body.py * Update update_issue_body.py * Update main.py * Update reply_generator.py * Update main.py * Update update_issue_body.py * Update main.py * Update scripts/release_issue_status/update_issue_body.py * Update update_issue_body.py * Update main.py * Update reply_generator.py * Update update_issue_body.py * Update main.py * Update scripts/release_issue_status/main.py * Update main.py * Update scripts/release_issue_status/main.py * Update scripts/release_issue_status/main.py * Update scripts/release_issue_status/main.py * Update scripts/release_issue_status/update_issue_body.py * Update scripts/release_issue_status/main.py * Update scripts/release_issue_status/update_issue_body.py * Update reply_generator.py * Update main.py * Update scripts/release_issue_status/update_issue_body.py Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com> * Update scripts/release_issue_status/update_issue_body.py Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com> * Update reply_generator.py * Update update_issue_body.py * Update main.py * Update main.py * Update update_issue_body.py * Update main.py * Update scripts/release_issue_status/main.py * Update main.py * Update reply_generator.py * Update main.py * Update main.py * Update main.py * Update main.py * Update main.py * Update main.py * Update main.py * Update main.py * Update main.py * Update update_issue_body.py * Update main.py * Update update_issue_body.py * Update reply_generator.py * Update update_issue_body.py * Update main.py * Update update_issue_body.py * Update update_issue_body.py * Update update_issue_body.py * Update update_issue_body.py * Update update_issue_body.py * Update main.py * Update main.py * Update release_issue_status.yml for Azure Pipelines * Update main.py * Update reply_generator.py * Add files via upload * Update reply_generator.py * Update update_issue_body.py * Update reply_generator.py * Update auto_pipeline_run.py * Update auto_pipeline_run.py * add auto-close * Update release_issue_status.yml for Azure Pipelines * Update auto_close.py * Update main.py * Update release_issue_status.yml for Azure Pipelines * Update auto_pipeline_run.py * fix bug * Update main.py * Update auto_close.py * Update auto_close.py * Update main.py * Update reply_generator.py * Update main.py * Update main.py * Update auto_close.py * Update main.py * Update auto-close * Update auto_pipeline_run.py * Update update_issue_body.py * Update auto_pipeline_run.py * Update release_issue_status.yml for Azure Pipelines * Update auto_pipeline_run.py * Update release_issue_status.yml for Azure Pipelines * Update auto_pipeline_run.py * Update auto_pipeline_run.py * Add pipeline link * Update pipeline link * Update auto_pipeline_run.py * Update release_issue_status.yml for Azure Pipelines * Update auto_pipeline_run.py * Update requirement.txt * Update auto_pipeline_run.py * Add get_python_pipeline * Update auto_pipeline_run.py * test * test * add outputfolder * add label * Update main.py * Update get_python_pipeline.py * Update main.py * Update auto_pipeline_run.py Co-authored-by: Zed <601306339@qq.com> Co-authored-by: Zed Lei <59104634+RAY-316@users.noreply.github.com> Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com> --- scripts/release_issue_status/auto_close.py | 36 +++++++++++ .../release_issue_status/auto_pipeline_run.py | 47 ++++++++++++++ .../get_python_pipeline.py | 27 ++++++++ scripts/release_issue_status/main.py | 62 +++++++++++++------ .../release_issue_status.yml | 3 + .../release_issue_status/reply_generator.py | 27 +++++--- scripts/release_issue_status/requirement.txt | 6 +- .../release_issue_status/update_issue_body.py | 21 +++++-- 8 files changed, 195 insertions(+), 34 deletions(-) create mode 100644 scripts/release_issue_status/auto_close.py create mode 100644 scripts/release_issue_status/auto_pipeline_run.py create mode 100644 scripts/release_issue_status/get_python_pipeline.py diff --git a/scripts/release_issue_status/auto_close.py b/scripts/release_issue_status/auto_close.py new file mode 100644 index 000000000000..ca439398aa59 --- /dev/null +++ b/scripts/release_issue_status/auto_close.py @@ -0,0 +1,36 @@ +import datetime + +import requests +from bs4 import BeautifulSoup + + +def auto_close_issue(sdk_repo, item): + issue_number, package_name = item.issue_object.number, item.package + issue_info = sdk_repo.get_issue(number=issue_number) + issue_author = issue_info.user.login + last_comment = list(issue_info.get_comments())[-1] + last_comment_date = last_comment.created_at + last_version, last_time = get_last_released_date(package_name) + if last_time and last_time > last_comment_date: + comment = f'Hi @{issue_author}, pypi link: https://pypi.org/project/{package_name}/{last_version}/' + issue_info.create_comment(body=comment) + issue_info.edit(state='closed') + item.labels.append('auto-closed') + item.issue_object.set_labels(*item.labels) + print(f"issue number:{issue_number} has been closed!") + + +def get_last_released_date(package_name): + pypi_link = f'https://pypi.org/project/{package_name}/#history' + res = requests.get(pypi_link) + soup = BeautifulSoup(res.text, 'html.parser') + # find top div from
+ try: + package_info = soup.select('div[class="release-timeline"]')[0].find_all('div')[0] + last_version_mix = package_info.find_all('p', class_="release__version")[0].contents[0] + except IndexError as e: + return '', '' + last_version = last_version_mix.replace(' ', '').replace('\n', '') + last_version_date_str = package_info.time.attrs['datetime'].split('+')[0] + last_version_date = datetime.datetime.strptime(last_version_date_str, '%Y-%m-%dT%H:%M:%S') + return last_version, last_version_date diff --git a/scripts/release_issue_status/auto_pipeline_run.py b/scripts/release_issue_status/auto_pipeline_run.py new file mode 100644 index 000000000000..ef35ee2612fe --- /dev/null +++ b/scripts/release_issue_status/auto_pipeline_run.py @@ -0,0 +1,47 @@ +import json +import os +import re +from msrest.authentication import BasicAuthentication +from azure.devops.v6_0.pipelines.pipelines_client import PipelinesClient +from azure.devops.v6_0.pipelines import models +import requests + + +def run_pipeline(issue_link, sdk_issue_object, pipeline_url): + paramaters = { + "stages_to_skip": [], + "resources": { + "repositories": { + "self": { + "refName": "refs/heads/main" + } + } + }, + "variables": { + "BASE_BRANCH": { + "value": f"{sdk_issue_object.head.label}", + "isSecret": False + }, + "ISSUE_LINK": { + "value": f"{issue_link}", + "isSecret": False + }, + "PIPELINE_LINK": { + "value": f"{pipeline_url}", + "isSecret": False + } + } + } + # Fill in with your personal access token and org URL + personal_access_token = os.getenv('PIPELINE_TOKEN') + organization_url = 'https://dev.azure.com/azure-sdk' + + # Create a connection to the org + credentials = BasicAuthentication('', personal_access_token) + run_parameters = models.RunPipelineParameters(**paramaters) + client = PipelinesClient(base_url=organization_url, creds=credentials) + result = client.run_pipeline(project='internal',pipeline_id=2500,run_parameters=run_parameters) + if result.state == 'inProgress': + return True + else: + return False diff --git a/scripts/release_issue_status/get_python_pipeline.py b/scripts/release_issue_status/get_python_pipeline.py new file mode 100644 index 000000000000..5b0939a704d2 --- /dev/null +++ b/scripts/release_issue_status/get_python_pipeline.py @@ -0,0 +1,27 @@ +import os +import re + +from msrest.authentication import BasicAuthentication +from azure.devops.v6_0.pipelines.pipelines_client import PipelinesClient + + +def get_python_pipelines(): + python_piplines = {} + pipeline_client = PipelinesClient(base_url='https://dev.azure.com/azure-sdk', + creds=BasicAuthentication('', os.getenv('PIPELINE_TOKEN'))) + pipelines = pipeline_client.list_pipelines(project='internal') + for pipeline in pipelines: + if re.findall('^python - \w*$', pipeline.name): + key = pipeline.name.replace('python - ', '') + python_piplines[key] = pipeline.id + return python_piplines + + +def get_pipeline_url(python_piplines, output_folder): + definitionId = python_piplines.get(output_folder) + if definitionId: + pipeline_url = 'https://dev.azure.com/azure-sdk/internal/_build?definitionId={}'.format(definitionId) + else: + print('Cannot find definitionId, Do not display pipeline_url') + pipeline_url = '' + return pipeline_url diff --git a/scripts/release_issue_status/main.py b/scripts/release_issue_status/main.py index 6bdf38279c4f..64c5d1ac4bd5 100644 --- a/scripts/release_issue_status/main.py +++ b/scripts/release_issue_status/main.py @@ -1,13 +1,18 @@ import time import os import re -from github import Github from datetime import date, datetime import subprocess as sp +import traceback + +from github import Github from azure.storage.blob import BlobClient + import reply_generator as rg -from update_issue_body import update_issue_body, find_readme_link -import traceback +from update_issue_body import update_issue_body, find_readme_and_output_folder +from auto_close import auto_close_issue +from get_python_pipeline import get_python_pipelines, get_pipeline_url + _NULL = ' ' _FILE_OUT = 'release_issue_status.csv' @@ -121,11 +126,16 @@ def _latest_comment_time(comments, delay_from_create_date): return delay_from_create_date if not q else int((time.time() - q[-1][0]) / 3600 / 24) -def auto_reply(item, sdk_repo, rest_repo, duplicated_issue): +def auto_reply(item, request_repo, rest_repo, sdk_repo, duplicated_issue, python_piplines): print("==========new issue number: {}".format(item.issue_object.number)) + if 'Configured' in item.labels: + item.labels.remove('Configured') + if 'auto-link' not in item.labels: + item.labels.append('auto-link') + item.issue_object.set_labels(*item.labels) try: - package_name, readme_link = update_issue_body(sdk_repo, rest_repo, item.issue_object.number) + package_name, readme_link, output_folder = update_issue_body(request_repo, rest_repo, item.issue_object.number) print("pkname, readme", package_name, readme_link) item.package = package_name key = ('Python', item.package) @@ -133,20 +143,24 @@ def auto_reply(item, sdk_repo, rest_repo, duplicated_issue): except Exception as e: item.bot_advice = 'failed to modify the body of the new issue. Please modify manually' item.labels.append('attention') + item.issue_object.set_labels(*item.labels) print(e) raise - item.labels.append('auto-link') - item.issue_object.set_labels(*item.labels) else: try: - readme_link = find_readme_link(sdk_repo, item.issue_object.number) + readme_link, output_folder = find_readme_and_output_folder(request_repo, rest_repo, item.issue_object.number) except Exception as e: print('Issue: {} updates body failed'.format(item.issue_object.number)) item.bot_advice = 'failed to find Readme link, Please check !!' item.labels.append('attention') + item.issue_object.set_labels(*item.labels) raise try: - reply = rg.begin_reply_generate(item=item, rest_repo=rest_repo, readme_link=readme_link) + print("*********************") + print(python_piplines) + pipeline_url = get_pipeline_url(python_piplines, output_folder) + rg.begin_reply_generate(item=item, rest_repo=rest_repo, readme_link=readme_link, + sdk_repo=sdk_repo, pipeline_url=pipeline_url) except Exception as e: item.bot_advice = 'auto reply failed, Please intervene manually !!' print('Error from auto reply ========================') @@ -158,14 +172,18 @@ def auto_reply(item, sdk_repo, rest_repo, duplicated_issue): def main(): # get latest issue status g = Github(os.getenv('TOKEN')) # please fill user_token - sdk_repo = g.get_repo('Azure/sdk-release-request') - rest_repo = g.get_repo('Azure/azure-rest-api-specs') - label1 = sdk_repo.get_label('ManagementPlane') - open_issues = sdk_repo.get_issues(state='open', labels=[label1]) + request_repo = g.get_repo('Azure/sdk-release-request') + rest_repo = g.get_repo('Azure/azure-rest-api-specs') + sdk_repo = g.get_repo('Azure/azure-sdk-for-python') + label1 = request_repo.get_label('ManagementPlane') + open_issues = request_repo.get_issues(state='open', labels=[label1]) issue_status = [] issue_status_python = [] duplicated_issue = dict() start_time = time.time() + # get pipeline definitionid + python_piplines = get_python_pipelines() + for item in open_issues: if not item.number: continue @@ -204,16 +222,22 @@ def main(): for item in issue_status: if item.status == 'release': item.bot_advice = 'better to release asap.' - elif item.comment_num == 0 and 'Python' in item.labels: + elif (item.comment_num == 0 or 'Configured' in item.labels) and 'Python' in item.labels: item.bot_advice = 'new issue and better to confirm quickly.' try: - auto_reply(item, sdk_repo, rest_repo, duplicated_issue) + auto_reply(item, request_repo, rest_repo, sdk_repo, duplicated_issue, python_piplines) except Exception as e: continue elif not item.author_latest_comment in _PYTHON_SDK_ADMINISTRATORS: item.bot_advice = 'new comment for author.' elif item.delay_from_latest_update >= 7: item.bot_advice = 'delay for a long time and better to handle now.' + if item.comment_num > 1 and item.language == 'Python': + try: + auto_close_issue(request_repo, item) + except Exception as e: + item.bot_advice = 'auto-close failed, please check!' + print(f"=====issue: {item.issue_object.number}, {e}") if item.days_from_latest_commit >= 30 and item.language == 'Python' and '30days attention' not in item.labels: item.labels.append('30days attention') @@ -243,10 +267,10 @@ def main(): print_check('git push -f origin HEAD') # upload to storage account(it is created in advance) - blob = BlobClient.from_connection_string(conn_str=os.getenv('CONN_STR'), container_name=os.getenv('FILE'), - blob_name=_FILE_OUT) - with open(_FILE_OUT, 'rb') as data: - blob.upload_blob(data, overwrite=True) +# blob = BlobClient.from_connection_string(conn_str=os.getenv('CONN_STR'), container_name=os.getenv('FILE'), +# blob_name=_FILE_OUT) +# with open(_FILE_OUT, 'rb') as data: +# blob.upload_blob(data, overwrite=True) if __name__ == '__main__': diff --git a/scripts/release_issue_status/release_issue_status.yml b/scripts/release_issue_status/release_issue_status.yml index 3d4fd02b66ad..0e3146fdee9e 100644 --- a/scripts/release_issue_status/release_issue_status.yml +++ b/scripts/release_issue_status/release_issue_status.yml @@ -36,6 +36,9 @@ jobs: export CONN_STR=$(ENV_CONN_STR) export FILE=$(ENV_FILE) export TOKEN=$(USR_TOKEN) + export HEADERS=$(PIPELINE_HEADERS) + export URL=$(PIPELINE_URL) + export PIPELINE_TOKEN = $(PIPELINE_TOKEN) # create virtual env python -m venv venv-sdk diff --git a/scripts/release_issue_status/reply_generator.py b/scripts/release_issue_status/reply_generator.py index dbe6494bd7d1..eddf8a9fee02 100644 --- a/scripts/release_issue_status/reply_generator.py +++ b/scripts/release_issue_status/reply_generator.py @@ -1,3 +1,4 @@ +import auto_pipeline_run as apr import re issue_object_rg = None @@ -7,11 +8,10 @@ def weather_change_readme(rest_repo, link_dict, labels): # to see whether need change readme contents = str(rest_repo.get_contents(link_dict['readme_path']).decoded_content) pattern_tag = re.compile(r'tag: package-[\w+-.]+') - package_tag = pattern_tag.search(contents).group() - package_tag = package_tag.split(':')[1].strip() + package_tag = pattern_tag.findall(contents) readme_python_contents = str(rest_repo.get_contents(link_dict['readme_python_path']).decoded_content) whether_multi_api = 'multi-api' in readme_python_contents - whether_same_tag = package_tag == link_dict['readme_tag'] + whether_same_tag = link_dict['readme_tag'] in package_tag whether_change_readme = not whether_same_tag or whether_multi_api and not 'MultiAPI' in labels return whether_change_readme @@ -28,7 +28,7 @@ def get_links(readme_link): resource_manager = pattern_resource_manager.search(readme_link).group() link_dict['readme_path'] = readme_path link_dict['readme_python_path'] = readme_path[:readme_path.rfind('/')] + '/readme.python.md' - link_dict['readme_tag'] = readme_tag + link_dict['readme_tag'] = 'tag: ' + readme_tag link_dict['resource_manager'] = resource_manager return link_dict @@ -76,13 +76,16 @@ def swagger_generator_parse(context, latest_pr_number): python_track2_info = re.search(pattern_python_track2, python).group() track2_info_model = '
python-track2{}
'.format( python_track2_info) + pattern_sdk_changes = re.compile('/azure-sdk-for-python/pull/\d*">Release SDK Changes', re.DOTALL) + sdk_link = re.search(pattern_sdk_changes, python_track2_info).group() + sdk_link_number = re.search(re.compile('[0-9]+'), sdk_link).group() info_model = 'hi @{} Please check the package whether works well and the changelog info is as below:\n' \ '{}\n{}\n' \ '\n* (The version of the package is only a temporary version for testing)\n' \ '\nhttps://github.com/Azure/azure-rest-api-specs/pull/{}\n' \ .format(issue_object_rg.user.login, track1_info_model, track2_info_model, str(latest_pr_number)) - return info_model + return info_model, sdk_link_number def reply_owner(reply_content): @@ -95,7 +98,7 @@ def add_label(label_name, labels): issue_object_rg.set_labels(*labels) -def begin_reply_generate(item, rest_repo, readme_link): +def begin_reply_generate(item, rest_repo, readme_link, sdk_repo, pipeline_url): global issue_object_rg issue_object_rg = item.issue_object link_dict = get_links(readme_link) @@ -103,8 +106,16 @@ def begin_reply_generate(item, rest_repo, readme_link): whether_change_readme = weather_change_readme(rest_repo, link_dict, labels) if not whether_change_readme: - latest_pr_number = get_latest_pr_from_readme(rest_repo,link_dict) - reply_content = latest_pr_parse(rest_repo, latest_pr_number) + latest_pr_number = get_latest_pr_from_readme(rest_repo, link_dict) + reply_content, sdk_link_number = latest_pr_parse(rest_repo, latest_pr_number) + run_pipeline = apr.run_pipeline(issue_link=issue_object_rg.html_url, + sdk_issue_object=sdk_repo.get_pull(int(sdk_link_number)), + pipeline_url=pipeline_url + ) + if run_pipeline: + print(f'{issue_object_rg.number} run pipeline successfully') + else: + print(f'{issue_object_rg.number} run pipeline fail') reply_owner(reply_content) add_label('auto-ask-check', labels) else: diff --git a/scripts/release_issue_status/requirement.txt b/scripts/release_issue_status/requirement.txt index 13781556dd42..512d9702666a 100644 --- a/scripts/release_issue_status/requirement.txt +++ b/scripts/release_issue_status/requirement.txt @@ -1,3 +1,7 @@ PyGithub datetime -azure.storage.blob==12.8.1 \ No newline at end of file +requests +bs4 +azure.storage.blob==12.8.1 +azure-devops +msrest diff --git a/scripts/release_issue_status/update_issue_body.py b/scripts/release_issue_status/update_issue_body.py index 718bc906fc80..b96a25daec92 100644 --- a/scripts/release_issue_status/update_issue_body.py +++ b/scripts/release_issue_status/update_issue_body.py @@ -20,7 +20,7 @@ def update_issue_body(sdk_repo, rest_repo, issue_number): link = link.split(']')[0] link = link.replace('[', "").replace(']', "").replace('(', "").replace(')', "") - package_name, readme_link = get_pkname_and_readme_link(rest_repo, link) + package_name, readme_link, output_folder = get_pkname_and_readme_link(rest_repo, link) # Check readme tag format if 'package' not in readme_tag: @@ -36,7 +36,7 @@ def update_issue_body(sdk_repo, rest_repo, issue_number): issue_body_up += raw + '\n' issue_info.edit(body=issue_body_up) - return package_name, readme_link + return package_name, readme_link, output_folder def get_pkname_and_readme_link(rest_repo, link): @@ -46,6 +46,7 @@ def get_pkname_and_readme_link(rest_repo, link): commit_sha = link.split('commit/')[-1] commit = rest_repo.get_commit(commit_sha) link = commit.files[0].blob_url + link = re.sub('blob/(.*?)/specification', 'blob/main/specification', link) # if link is a pr, it can get both pakeage name and readme link. if 'pull' in link: @@ -79,18 +80,26 @@ def get_pkname_and_readme_link(rest_repo, link): readme_link_part = '/specification' + readme_link.split('/specification')[-1] readme_contents = str(rest_repo.get_contents(readme_link_part).decoded_content) pk_name = re.findall(r'package-name: (.*?)\\n', readme_contents)[0] + out_folder = re.findall(r'\$\(python-sdks-folder\)/(.*?)/azure-', readme_contents)[0] readme_link = readme_link.replace('python.', '') - return pk_name, readme_link + return pk_name, readme_link, out_folder -def find_readme_link(sdk_repo, issue_number): +def find_readme_and_output_folder(sdk_repo, rest_repo, issue_number): # Get Issue Number issue_info = sdk_repo.get_issue(number=issue_number) issue_body = issue_info.body issue_body_list = issue_body.split("\n") for row in issue_body_list: if 'resource-manager' in row: - readme_link = row + '/readme.md' - return readme_link + readme_link = '{}/readme.md'.format(row.strip("\r")) + # Get output folder from readme.python.md + readme_python_link = readme_link.split('/resource-manager')[0] + '/resource-manager/readme.python.md' + readme_python_link_part = '/specification' + readme_python_link.split('/specification')[-1] + readme_contents = str(rest_repo.get_contents(readme_python_link_part).decoded_content) + output_folder = re.findall(r'\$\(python-sdks-folder\)/(.*?)/azure-', readme_contents)[0] + + return readme_link, output_folder raise Exception('Not find readme link,please check') + From b2bdfe659210998d6d479e73b133b6c51eb2c009 Mon Sep 17 00:00:00 2001 From: Travis Prescott Date: Fri, 10 Sep 2021 11:48:44 -0700 Subject: [PATCH 39/85] [Search] Regenerate with latest autorest (#20597) * Regenerate with latest autorest. * Bump azure.core dependency to resolve CI issues. --- .../documents/_generated/_search_client.py | 58 +- .../_generated/aio/_search_client.py | 54 +- .../aio/operations/_documents_operations.py | 507 ++- .../documents/_generated/models/_models.py | 432 +-- .../_generated/models/_models_py3.py | 432 +-- .../_generated/models/_search_client_enums.py | 37 +- .../operations/_documents_operations.py | 933 +++-- .../indexes/_generated/_search_client.py | 75 +- .../indexes/_generated/aio/_search_client.py | 71 +- .../operations/_data_sources_operations.py | 213 +- .../aio/operations/_indexers_operations.py | 377 +- .../aio/operations/_indexes_operations.py | 323 +- .../operations/_search_client_operations.py | 36 +- .../aio/operations/_skillsets_operations.py | 216 +- .../operations/_synonym_maps_operations.py | 210 +- .../indexes/_generated/models/__init__.py | 10 + .../indexes/_generated/models/_models.py | 3050 ++++++++-------- .../indexes/_generated/models/_models_py3.py | 3053 +++++++++-------- .../_generated/models/_search_client_enums.py | 116 +- .../operations/_data_sources_operations.py | 411 ++- .../operations/_indexers_operations.py | 729 +++- .../operations/_indexes_operations.py | 592 +++- .../operations/_search_client_operations.py | 69 +- .../operations/_skillsets_operations.py | 417 ++- .../operations/_synonym_maps_operations.py | 405 ++- sdk/search/azure-search-documents/setup.py | 2 +- shared_requirements.txt | 2 +- 27 files changed, 7100 insertions(+), 5730 deletions(-) diff --git a/sdk/search/azure-search-documents/azure/search/documents/_generated/_search_client.py b/sdk/search/azure-search-documents/azure/search/documents/_generated/_search_client.py index cf5857632715..05cb393cb3eb 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/_generated/_search_client.py +++ b/sdk/search/azure-search-documents/azure/search/documents/_generated/_search_client.py @@ -6,21 +6,21 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from copy import deepcopy from typing import TYPE_CHECKING from azure.core import PipelineClient from msrest import Deserializer, Serializer +from . import models +from ._configuration import SearchClientConfiguration +from .operations import DocumentsOperations + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any - from azure.core.pipeline.transport import HttpRequest, HttpResponse - -from ._configuration import SearchClientConfiguration -from .operations import DocumentsOperations -from . import models - + from azure.core.rest import HttpRequest, HttpResponse class SearchClient(object): """Client that can be used to query an index and upload, merge, or delete documents. @@ -40,36 +40,48 @@ def __init__( **kwargs # type: Any ): # type: (...) -> None - base_url = '{endpoint}/indexes(\'{indexName}\')' + _base_url = '{endpoint}/indexes(\'{indexName}\')' self._config = SearchClientConfiguration(endpoint, index_name, **kwargs) - self._client = PipelineClient(base_url=base_url, config=self._config, **kwargs) + self._client = PipelineClient(base_url=_base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) + self._serialize.client_side_validation = False + self.documents = DocumentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.documents = DocumentsOperations( - self._client, self._config, self._serialize, self._deserialize) - def _send_request(self, http_request, **kwargs): - # type: (HttpRequest, Any) -> HttpResponse + def _send_request( + self, + request, # type: HttpRequest + **kwargs # type: Any + ): + # type: (...) -> HttpResponse """Runs the network request through the client's chained policies. - :param http_request: The network request you want to make. Required. - :type http_request: ~azure.core.pipeline.transport.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.HttpResponse + :rtype: ~azure.core.rest.HttpResponse """ + + request_copy = deepcopy(request) path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexName': self._serialize.url("self._config.index_name", self._config.index_name, 'str'), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "indexName": self._serialize.url("self._config.index_name", self._config.index_name, 'str'), } - http_request.url = self._client.format_url(http_request.url, **path_format_arguments) - stream = kwargs.pop("stream", True) - pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) - return pipeline_response.http_response + + request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) + return self._client.send_request(request_copy, **kwargs) def close(self): # type: () -> None diff --git a/sdk/search/azure-search-documents/azure/search/documents/_generated/aio/_search_client.py b/sdk/search/azure-search-documents/azure/search/documents/_generated/aio/_search_client.py index 7799d633940a..5bea0add9b2b 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/_generated/aio/_search_client.py +++ b/sdk/search/azure-search-documents/azure/search/documents/_generated/aio/_search_client.py @@ -6,18 +6,18 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any +from copy import deepcopy +from typing import Any, Awaitable from azure.core import AsyncPipelineClient -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.rest import AsyncHttpResponse, HttpRequest from msrest import Deserializer, Serializer +from .. import models from ._configuration import SearchClientConfiguration from .operations import DocumentsOperations -from .. import models - -class SearchClient(object): +class SearchClient: """Client that can be used to query an index and upload, merge, or delete documents. :ivar documents: DocumentsOperations operations @@ -34,35 +34,47 @@ def __init__( index_name: str, **kwargs: Any ) -> None: - base_url = '{endpoint}/indexes(\'{indexName}\')' + _base_url = '{endpoint}/indexes(\'{indexName}\')' self._config = SearchClientConfiguration(endpoint, index_name, **kwargs) - self._client = AsyncPipelineClient(base_url=base_url, config=self._config, **kwargs) + self._client = AsyncPipelineClient(base_url=_base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) + self._serialize.client_side_validation = False + self.documents = DocumentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.documents = DocumentsOperations( - self._client, self._config, self._serialize, self._deserialize) - async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + def _send_request( + self, + request: HttpRequest, + **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. - :param http_request: The network request you want to make. Required. - :type http_request: ~azure.core.pipeline.transport.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + :rtype: ~azure.core.rest.AsyncHttpResponse """ + + request_copy = deepcopy(request) path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexName': self._serialize.url("self._config.index_name", self._config.index_name, 'str'), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "indexName": self._serialize.url("self._config.index_name", self._config.index_name, 'str'), } - http_request.url = self._client.format_url(http_request.url, **path_format_arguments) - stream = kwargs.pop("stream", True) - pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) - return pipeline_response.http_response + + request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) + return self._client.send_request(request_copy, **kwargs) async def close(self) -> None: await self._client.close() diff --git a/sdk/search/azure-search-documents/azure/search/documents/_generated/aio/operations/_documents_operations.py b/sdk/search/azure-search-documents/azure/search/documents/_generated/aio/operations/_documents_operations.py index 58668b2ccdef..bd89a2bfee90 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/_generated/aio/operations/_documents_operations.py +++ b/sdk/search/azure-search-documents/azure/search/documents/_generated/aio/operations/_documents_operations.py @@ -5,14 +5,18 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async from ... import models as _models +from ...operations._documents_operations import build_autocomplete_get_request, build_autocomplete_post_request, build_count_request, build_get_request, build_index_request, build_search_get_request, build_search_post_request, build_suggest_get_request, build_suggest_post_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -39,6 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def count( self, request_options: Optional["_models.RequestOptions"] = None, @@ -58,33 +63,22 @@ async def count( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - accept = "application/json" - # Construct URL - url = self.count.metadata['url'] # type: ignore + request = build_count_request( + x_ms_client_request_id=_x_ms_client_request_id, + template_url=self.count.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexName': self._serialize.url("self._config.index_name", self._config.index_name, 'str'), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "indexName": self._serialize.url("self._config.index_name", self._config.index_name, 'str'), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request.url = self._client.format_url(request.url, **path_format_arguments) - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: @@ -98,8 +92,11 @@ async def count( return cls(pipeline_response, deserialized, {}) return deserialized + count.metadata = {'url': '/docs/$count'} # type: ignore + + @distributed_trace_async async def search_get( self, search_text: Optional[str] = None, @@ -126,7 +123,7 @@ async def search_get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + _include_total_result_count = None _facets = None _filter = None @@ -151,8 +148,6 @@ async def search_get( _captions = None _semantic_fields = None _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id if search_options is not None: _include_total_result_count = search_options.include_total_result_count _facets = search_options.facets @@ -177,77 +172,44 @@ async def search_get( _top = search_options.top _captions = search_options.captions _semantic_fields = search_options.semantic_fields - api_version = "2021-04-30-Preview" - accept = "application/json" + if request_options is not None: + _x_ms_client_request_id = request_options.x_ms_client_request_id - # Construct URL - url = self.search_get.metadata['url'] # type: ignore + request = build_search_get_request( + search_text=search_text, + include_total_result_count=_include_total_result_count, + facets=_facets, + filter=_filter, + highlight_fields=_highlight_fields, + highlight_post_tag=_highlight_post_tag, + highlight_pre_tag=_highlight_pre_tag, + minimum_coverage=_minimum_coverage, + order_by=_order_by, + query_type=_query_type, + scoring_parameters=_scoring_parameters, + scoring_profile=_scoring_profile, + search_fields=_search_fields, + query_language=_query_language, + speller=_speller, + answers=_answers, + search_mode=_search_mode, + scoring_statistics=_scoring_statistics, + session_id=_session_id, + select=_select, + skip=_skip, + top=_top, + captions=_captions, + semantic_fields=_semantic_fields, + x_ms_client_request_id=_x_ms_client_request_id, + template_url=self.search_get.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexName': self._serialize.url("self._config.index_name", self._config.index_name, 'str'), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "indexName": self._serialize.url("self._config.index_name", self._config.index_name, 'str'), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if search_text is not None: - query_parameters['search'] = self._serialize.query("search_text", search_text, 'str') - if _include_total_result_count is not None: - query_parameters['$count'] = self._serialize.query("include_total_result_count", _include_total_result_count, 'bool') - if _facets is not None: - query_parameters['facet'] = [self._serialize.query("facets", q, 'str') if q is not None else '' for q in _facets] - if _filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", _filter, 'str') - if _highlight_fields is not None: - query_parameters['highlight'] = self._serialize.query("highlight_fields", _highlight_fields, '[str]', div=',') - if _highlight_post_tag is not None: - query_parameters['highlightPostTag'] = self._serialize.query("highlight_post_tag", _highlight_post_tag, 'str') - if _highlight_pre_tag is not None: - query_parameters['highlightPreTag'] = self._serialize.query("highlight_pre_tag", _highlight_pre_tag, 'str') - if _minimum_coverage is not None: - query_parameters['minimumCoverage'] = self._serialize.query("minimum_coverage", _minimum_coverage, 'float') - if _order_by is not None: - query_parameters['$orderby'] = self._serialize.query("order_by", _order_by, '[str]', div=',') - if _query_type is not None: - query_parameters['queryType'] = self._serialize.query("query_type", _query_type, 'str') - if _scoring_parameters is not None: - query_parameters['scoringParameter'] = [self._serialize.query("scoring_parameters", q, 'str') if q is not None else '' for q in _scoring_parameters] - if _scoring_profile is not None: - query_parameters['scoringProfile'] = self._serialize.query("scoring_profile", _scoring_profile, 'str') - if _search_fields is not None: - query_parameters['searchFields'] = self._serialize.query("search_fields", _search_fields, '[str]', div=',') - if _query_language is not None: - query_parameters['queryLanguage'] = self._serialize.query("query_language", _query_language, 'str') - if _speller is not None: - query_parameters['speller'] = self._serialize.query("speller", _speller, 'str') - if _answers is not None: - query_parameters['answers'] = self._serialize.query("answers", _answers, 'str') - if _search_mode is not None: - query_parameters['searchMode'] = self._serialize.query("search_mode", _search_mode, 'str') - if _scoring_statistics is not None: - query_parameters['scoringStatistics'] = self._serialize.query("scoring_statistics", _scoring_statistics, 'str') - if _session_id is not None: - query_parameters['sessionId'] = self._serialize.query("session_id", _session_id, 'str') - if _select is not None: - query_parameters['$select'] = self._serialize.query("select", _select, '[str]', div=',') - if _skip is not None: - query_parameters['$skip'] = self._serialize.query("skip", _skip, 'int') - if _top is not None: - query_parameters['$top'] = self._serialize.query("top", _top, 'int') - if _captions is not None: - query_parameters['captions'] = self._serialize.query("captions", _captions, 'str') - if _semantic_fields is not None: - query_parameters['semanticFields'] = self._serialize.query("semantic_fields", _semantic_fields, '[str]', div=',') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = await self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: @@ -261,8 +223,11 @@ async def search_get( return cls(pipeline_response, deserialized, {}) return deserialized + search_get.metadata = {'url': '/docs'} # type: ignore + + @distributed_trace_async async def search_post( self, search_request: "_models.SearchRequest", @@ -285,38 +250,27 @@ async def search_post( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.search_post.metadata['url'] # type: ignore + json = self._serialize.body(search_request, 'SearchRequest') + + request = build_search_post_request( + content_type=content_type, + x_ms_client_request_id=_x_ms_client_request_id, + json=json, + template_url=self.search_post.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexName': self._serialize.url("self._config.index_name", self._config.index_name, 'str'), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "indexName": self._serialize.url("self._config.index_name", self._config.index_name, 'str'), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(search_request, 'SearchRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = await self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: @@ -330,8 +284,11 @@ async def search_post( return cls(pipeline_response, deserialized, {}) return deserialized + search_post.metadata = {'url': '/docs/search.post.search'} # type: ignore + + @distributed_trace_async async def get( self, key: str, @@ -358,36 +315,24 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - accept = "application/json" - # Construct URL - url = self.get.metadata['url'] # type: ignore + request = build_get_request( + key=key, + selected_fields=selected_fields, + x_ms_client_request_id=_x_ms_client_request_id, + template_url=self.get.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexName': self._serialize.url("self._config.index_name", self._config.index_name, 'str'), - 'key': self._serialize.url("key", key, 'str'), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "indexName": self._serialize.url("self._config.index_name", self._config.index_name, 'str'), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if selected_fields is not None: - query_parameters['$select'] = self._serialize.query("selected_fields", selected_fields, '[str]', div=',') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = await self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: @@ -401,8 +346,11 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/docs(\'{key}\')'} # type: ignore + + @distributed_trace_async async def suggest_get( self, search_text: str, @@ -433,7 +381,7 @@ async def suggest_get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + _filter = None _use_fuzzy_matching = None _highlight_post_tag = None @@ -444,8 +392,6 @@ async def suggest_get( _select = None _top = None _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id if suggest_options is not None: _filter = suggest_options.filter _use_fuzzy_matching = suggest_options.use_fuzzy_matching @@ -456,49 +402,31 @@ async def suggest_get( _search_fields = suggest_options.search_fields _select = suggest_options.select _top = suggest_options.top - api_version = "2021-04-30-Preview" - accept = "application/json" + if request_options is not None: + _x_ms_client_request_id = request_options.x_ms_client_request_id - # Construct URL - url = self.suggest_get.metadata['url'] # type: ignore + request = build_suggest_get_request( + search_text=search_text, + suggester_name=suggester_name, + filter=_filter, + use_fuzzy_matching=_use_fuzzy_matching, + highlight_post_tag=_highlight_post_tag, + highlight_pre_tag=_highlight_pre_tag, + minimum_coverage=_minimum_coverage, + order_by=_order_by, + search_fields=_search_fields, + select=_select, + top=_top, + x_ms_client_request_id=_x_ms_client_request_id, + template_url=self.suggest_get.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexName': self._serialize.url("self._config.index_name", self._config.index_name, 'str'), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "indexName": self._serialize.url("self._config.index_name", self._config.index_name, 'str'), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['search'] = self._serialize.query("search_text", search_text, 'str') - query_parameters['suggesterName'] = self._serialize.query("suggester_name", suggester_name, 'str') - if _filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", _filter, 'str') - if _use_fuzzy_matching is not None: - query_parameters['fuzzy'] = self._serialize.query("use_fuzzy_matching", _use_fuzzy_matching, 'bool') - if _highlight_post_tag is not None: - query_parameters['highlightPostTag'] = self._serialize.query("highlight_post_tag", _highlight_post_tag, 'str') - if _highlight_pre_tag is not None: - query_parameters['highlightPreTag'] = self._serialize.query("highlight_pre_tag", _highlight_pre_tag, 'str') - if _minimum_coverage is not None: - query_parameters['minimumCoverage'] = self._serialize.query("minimum_coverage", _minimum_coverage, 'float') - if _order_by is not None: - query_parameters['$orderby'] = self._serialize.query("order_by", _order_by, '[str]', div=',') - if _search_fields is not None: - query_parameters['searchFields'] = self._serialize.query("search_fields", _search_fields, '[str]', div=',') - if _select is not None: - query_parameters['$select'] = self._serialize.query("select", _select, '[str]', div=',') - if _top is not None: - query_parameters['$top'] = self._serialize.query("top", _top, 'int') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = await self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: @@ -512,8 +440,11 @@ async def suggest_get( return cls(pipeline_response, deserialized, {}) return deserialized + suggest_get.metadata = {'url': '/docs/search.suggest'} # type: ignore + + @distributed_trace_async async def suggest_post( self, suggest_request: "_models.SuggestRequest", @@ -536,38 +467,27 @@ async def suggest_post( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.suggest_post.metadata['url'] # type: ignore + json = self._serialize.body(suggest_request, 'SuggestRequest') + + request = build_suggest_post_request( + content_type=content_type, + x_ms_client_request_id=_x_ms_client_request_id, + json=json, + template_url=self.suggest_post.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexName': self._serialize.url("self._config.index_name", self._config.index_name, 'str'), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "indexName": self._serialize.url("self._config.index_name", self._config.index_name, 'str'), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(suggest_request, 'SuggestRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = await self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: @@ -581,8 +501,11 @@ async def suggest_post( return cls(pipeline_response, deserialized, {}) return deserialized + suggest_post.metadata = {'url': '/docs/search.post.suggest'} # type: ignore + + @distributed_trace_async async def index( self, actions: List["_models.IndexAction"], @@ -605,40 +528,28 @@ async def index( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - _batch = _models.IndexBatch(actions=actions) - api_version = "2021-04-30-Preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.index.metadata['url'] # type: ignore + json = self._serialize.body(_batch, 'IndexBatch') + + request = build_index_request( + content_type=content_type, + x_ms_client_request_id=_x_ms_client_request_id, + json=json, + template_url=self.index.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexName': self._serialize.url("self._config.index_name", self._config.index_name, 'str'), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "indexName": self._serialize.url("self._config.index_name", self._config.index_name, 'str'), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(_batch, 'IndexBatch') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = await self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 207]: @@ -656,8 +567,11 @@ async def index( return cls(pipeline_response, deserialized, {}) return deserialized + index.metadata = {'url': '/docs/search.index'} # type: ignore + + @distributed_trace_async async def autocomplete_get( self, search_text: str, @@ -687,7 +601,7 @@ async def autocomplete_get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + _x_ms_client_request_id = None _autocomplete_mode = None _filter = None @@ -697,6 +611,8 @@ async def autocomplete_get( _minimum_coverage = None _search_fields = None _top = None + if request_options is not None: + _x_ms_client_request_id = request_options.x_ms_client_request_id if autocomplete_options is not None: _autocomplete_mode = autocomplete_options.autocomplete_mode _filter = autocomplete_options.filter @@ -706,49 +622,28 @@ async def autocomplete_get( _minimum_coverage = autocomplete_options.minimum_coverage _search_fields = autocomplete_options.search_fields _top = autocomplete_options.top - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - accept = "application/json" - # Construct URL - url = self.autocomplete_get.metadata['url'] # type: ignore + request = build_autocomplete_get_request( + search_text=search_text, + suggester_name=suggester_name, + x_ms_client_request_id=_x_ms_client_request_id, + autocomplete_mode=_autocomplete_mode, + filter=_filter, + use_fuzzy_matching=_use_fuzzy_matching, + highlight_post_tag=_highlight_post_tag, + highlight_pre_tag=_highlight_pre_tag, + minimum_coverage=_minimum_coverage, + search_fields=_search_fields, + top=_top, + template_url=self.autocomplete_get.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexName': self._serialize.url("self._config.index_name", self._config.index_name, 'str'), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "indexName": self._serialize.url("self._config.index_name", self._config.index_name, 'str'), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - query_parameters['search'] = self._serialize.query("search_text", search_text, 'str') - query_parameters['suggesterName'] = self._serialize.query("suggester_name", suggester_name, 'str') - if _autocomplete_mode is not None: - query_parameters['autocompleteMode'] = self._serialize.query("autocomplete_mode", _autocomplete_mode, 'str') - if _filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", _filter, 'str') - if _use_fuzzy_matching is not None: - query_parameters['fuzzy'] = self._serialize.query("use_fuzzy_matching", _use_fuzzy_matching, 'bool') - if _highlight_post_tag is not None: - query_parameters['highlightPostTag'] = self._serialize.query("highlight_post_tag", _highlight_post_tag, 'str') - if _highlight_pre_tag is not None: - query_parameters['highlightPreTag'] = self._serialize.query("highlight_pre_tag", _highlight_pre_tag, 'str') - if _minimum_coverage is not None: - query_parameters['minimumCoverage'] = self._serialize.query("minimum_coverage", _minimum_coverage, 'float') - if _search_fields is not None: - query_parameters['searchFields'] = self._serialize.query("search_fields", _search_fields, '[str]', div=',') - if _top is not None: - query_parameters['$top'] = self._serialize.query("top", _top, 'int') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = await self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: @@ -762,8 +657,11 @@ async def autocomplete_get( return cls(pipeline_response, deserialized, {}) return deserialized + autocomplete_get.metadata = {'url': '/docs/search.autocomplete'} # type: ignore + + @distributed_trace_async async def autocomplete_post( self, autocomplete_request: "_models.AutocompleteRequest", @@ -786,38 +684,27 @@ async def autocomplete_post( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.autocomplete_post.metadata['url'] # type: ignore + json = self._serialize.body(autocomplete_request, 'AutocompleteRequest') + + request = build_autocomplete_post_request( + content_type=content_type, + x_ms_client_request_id=_x_ms_client_request_id, + json=json, + template_url=self.autocomplete_post.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexName': self._serialize.url("self._config.index_name", self._config.index_name, 'str'), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "indexName": self._serialize.url("self._config.index_name", self._config.index_name, 'str'), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(autocomplete_request, 'AutocompleteRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = await self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: @@ -831,4 +718,6 @@ async def autocomplete_post( return cls(pipeline_response, deserialized, {}) return deserialized + autocomplete_post.metadata = {'url': '/docs/search.post.autocomplete'} # type: ignore + diff --git a/sdk/search/azure-search-documents/azure/search/documents/_generated/models/_models.py b/sdk/search/azure-search-documents/azure/search/documents/_generated/models/_models.py index 3c18d1464a26..7993e91f7cfe 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/_generated/models/_models.py +++ b/sdk/search/azure-search-documents/azure/search/documents/_generated/models/_models.py @@ -15,9 +15,9 @@ class AnswerResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param additional_properties: Unmatched properties from the message are deserialized to this + :keyword additional_properties: Unmatched properties from the message are deserialized to this collection. - :type additional_properties: dict[str, any] + :paramtype additional_properties: dict[str, any] :ivar score: The score value represents how relevant the answer is to the the query relative to other answers returned for the query. :vartype score: float @@ -92,36 +92,36 @@ def __init__( class AutocompleteOptions(msrest.serialization.Model): """Parameter group. - :param autocomplete_mode: Specifies the mode for Autocomplete. The default is 'oneTerm'. Use + :keyword autocomplete_mode: Specifies the mode for Autocomplete. The default is 'oneTerm'. Use 'twoTerms' to get shingles and 'oneTermWithContext' to use the current context while producing auto-completed terms. Possible values include: "oneTerm", "twoTerms", "oneTermWithContext". - :type autocomplete_mode: str or ~azure.search.documents.models.AutocompleteMode - :param filter: An OData expression that filters the documents used to produce completed terms + :paramtype autocomplete_mode: str or ~azure.search.documents.models.AutocompleteMode + :keyword filter: An OData expression that filters the documents used to produce completed terms for the Autocomplete result. - :type filter: str - :param use_fuzzy_matching: A value indicating whether to use fuzzy matching for the + :paramtype filter: str + :keyword use_fuzzy_matching: A value indicating whether to use fuzzy matching for the autocomplete query. Default is false. When set to true, the query will find terms even if there's a substituted or missing character in the search text. While this provides a better experience in some scenarios, it comes at a performance cost as fuzzy autocomplete queries are slower and consume more resources. - :type use_fuzzy_matching: bool - :param highlight_post_tag: A string tag that is appended to hit highlights. Must be set with + :paramtype use_fuzzy_matching: bool + :keyword highlight_post_tag: A string tag that is appended to hit highlights. Must be set with highlightPreTag. If omitted, hit highlighting is disabled. - :type highlight_post_tag: str - :param highlight_pre_tag: A string tag that is prepended to hit highlights. Must be set with + :paramtype highlight_post_tag: str + :keyword highlight_pre_tag: A string tag that is prepended to hit highlights. Must be set with highlightPostTag. If omitted, hit highlighting is disabled. - :type highlight_pre_tag: str - :param minimum_coverage: A number between 0 and 100 indicating the percentage of the index that - must be covered by an autocomplete query in order for the query to be reported as a success. - This parameter can be useful for ensuring search availability even for services with only one - replica. The default is 80. - :type minimum_coverage: float - :param search_fields: The list of field names to consider when querying for auto-completed + :paramtype highlight_pre_tag: str + :keyword minimum_coverage: A number between 0 and 100 indicating the percentage of the index + that must be covered by an autocomplete query in order for the query to be reported as a + success. This parameter can be useful for ensuring search availability even for services with + only one replica. The default is 80. + :paramtype minimum_coverage: float + :keyword search_fields: The list of field names to consider when querying for auto-completed terms. Target fields must be included in the specified suggester. - :type search_fields: list[str] - :param top: The number of auto-completed terms to retrieve. This must be a value between 1 and - 100. The default is 5. - :type top: int + :paramtype search_fields: list[str] + :keyword top: The number of auto-completed terms to retrieve. This must be a value between 1 + and 100. The default is 5. + :paramtype top: int """ _attribute_map = { @@ -155,41 +155,41 @@ class AutocompleteRequest(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param search_text: Required. The search text on which to base autocomplete results. - :type search_text: str - :param autocomplete_mode: Specifies the mode for Autocomplete. The default is 'oneTerm'. Use + :keyword search_text: Required. The search text on which to base autocomplete results. + :paramtype search_text: str + :keyword autocomplete_mode: Specifies the mode for Autocomplete. The default is 'oneTerm'. Use 'twoTerms' to get shingles and 'oneTermWithContext' to use the current context while producing auto-completed terms. Possible values include: "oneTerm", "twoTerms", "oneTermWithContext". - :type autocomplete_mode: str or ~azure.search.documents.models.AutocompleteMode - :param filter: An OData expression that filters the documents used to produce completed terms + :paramtype autocomplete_mode: str or ~azure.search.documents.models.AutocompleteMode + :keyword filter: An OData expression that filters the documents used to produce completed terms for the Autocomplete result. - :type filter: str - :param use_fuzzy_matching: A value indicating whether to use fuzzy matching for the + :paramtype filter: str + :keyword use_fuzzy_matching: A value indicating whether to use fuzzy matching for the autocomplete query. Default is false. When set to true, the query will autocomplete terms even if there's a substituted or missing character in the search text. While this provides a better experience in some scenarios, it comes at a performance cost as fuzzy autocomplete queries are slower and consume more resources. - :type use_fuzzy_matching: bool - :param highlight_post_tag: A string tag that is appended to hit highlights. Must be set with + :paramtype use_fuzzy_matching: bool + :keyword highlight_post_tag: A string tag that is appended to hit highlights. Must be set with highlightPreTag. If omitted, hit highlighting is disabled. - :type highlight_post_tag: str - :param highlight_pre_tag: A string tag that is prepended to hit highlights. Must be set with + :paramtype highlight_post_tag: str + :keyword highlight_pre_tag: A string tag that is prepended to hit highlights. Must be set with highlightPostTag. If omitted, hit highlighting is disabled. - :type highlight_pre_tag: str - :param minimum_coverage: A number between 0 and 100 indicating the percentage of the index that - must be covered by an autocomplete query in order for the query to be reported as a success. - This parameter can be useful for ensuring search availability even for services with only one - replica. The default is 80. - :type minimum_coverage: float - :param search_fields: The comma-separated list of field names to consider when querying for + :paramtype highlight_pre_tag: str + :keyword minimum_coverage: A number between 0 and 100 indicating the percentage of the index + that must be covered by an autocomplete query in order for the query to be reported as a + success. This parameter can be useful for ensuring search availability even for services with + only one replica. The default is 80. + :paramtype minimum_coverage: float + :keyword search_fields: The comma-separated list of field names to consider when querying for auto-completed terms. Target fields must be included in the specified suggester. - :type search_fields: str - :param suggester_name: Required. The name of the suggester as specified in the suggesters + :paramtype search_fields: str + :keyword suggester_name: Required. The name of the suggester as specified in the suggesters collection that's part of the index definition. - :type suggester_name: str - :param top: The number of auto-completed terms to retrieve. This must be a value between 1 and - 100. The default is 5. - :type top: int + :paramtype suggester_name: str + :keyword top: The number of auto-completed terms to retrieve. This must be a value between 1 + and 100. The default is 5. + :paramtype top: int """ _validation = { @@ -265,9 +265,9 @@ class CaptionResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param additional_properties: Unmatched properties from the message are deserialized to this + :keyword additional_properties: Unmatched properties from the message are deserialized to this collection. - :type additional_properties: dict[str, any] + :paramtype additional_properties: dict[str, any] :ivar text: A representative text passage extracted from the document most relevant to the search query. :vartype text: str @@ -302,9 +302,9 @@ class FacetResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param additional_properties: Unmatched properties from the message are deserialized to this + :keyword additional_properties: Unmatched properties from the message are deserialized to this collection. - :type additional_properties: dict[str, any] + :paramtype additional_properties: dict[str, any] :ivar count: The approximate count of documents falling within the bucket described by this facet. :vartype count: long @@ -331,12 +331,12 @@ def __init__( class IndexAction(msrest.serialization.Model): """Represents an index action that operates on a document. - :param additional_properties: Unmatched properties from the message are deserialized to this + :keyword additional_properties: Unmatched properties from the message are deserialized to this collection. - :type additional_properties: dict[str, any] - :param action_type: The operation to perform on a document in an indexing batch. Possible + :paramtype additional_properties: dict[str, any] + :keyword action_type: The operation to perform on a document in an indexing batch. Possible values include: "upload", "merge", "mergeOrUpload", "delete". - :type action_type: str or ~azure.search.documents.models.IndexActionType + :paramtype action_type: str or ~azure.search.documents.models.IndexActionType """ _attribute_map = { @@ -358,8 +358,8 @@ class IndexBatch(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param actions: Required. The actions in the batch. - :type actions: list[~azure.search.documents.models.IndexAction] + :keyword actions: Required. The actions in the batch. + :paramtype actions: list[~azure.search.documents.models.IndexAction] """ _validation = { @@ -456,8 +456,8 @@ def __init__( class RequestOptions(msrest.serialization.Model): """Parameter group. - :param x_ms_client_request_id: The tracking ID sent with the request to help with debugging. - :type x_ms_client_request_id: str + :keyword x_ms_client_request_id: The tracking ID sent with the request to help with debugging. + :paramtype x_ms_client_request_id: str """ _attribute_map = { @@ -581,98 +581,98 @@ def __init__( class SearchOptions(msrest.serialization.Model): """Parameter group. - :param include_total_result_count: A value that specifies whether to fetch the total count of + :keyword include_total_result_count: A value that specifies whether to fetch the total count of results. Default is false. Setting this value to true may have a performance impact. Note that the count returned is an approximation. - :type include_total_result_count: bool - :param facets: The list of facet expressions to apply to the search query. Each facet + :paramtype include_total_result_count: bool + :keyword facets: The list of facet expressions to apply to the search query. Each facet expression contains a field name, optionally followed by a comma-separated list of name:value pairs. - :type facets: list[str] - :param filter: The OData $filter expression to apply to the search query. - :type filter: str - :param highlight_fields: The list of field names to use for hit highlights. Only searchable + :paramtype facets: list[str] + :keyword filter: The OData $filter expression to apply to the search query. + :paramtype filter: str + :keyword highlight_fields: The list of field names to use for hit highlights. Only searchable fields can be used for hit highlighting. - :type highlight_fields: list[str] - :param highlight_post_tag: A string tag that is appended to hit highlights. Must be set with + :paramtype highlight_fields: list[str] + :keyword highlight_post_tag: A string tag that is appended to hit highlights. Must be set with highlightPreTag. Default is </em>. - :type highlight_post_tag: str - :param highlight_pre_tag: A string tag that is prepended to hit highlights. Must be set with + :paramtype highlight_post_tag: str + :keyword highlight_pre_tag: A string tag that is prepended to hit highlights. Must be set with highlightPostTag. Default is <em>. - :type highlight_pre_tag: str - :param minimum_coverage: A number between 0 and 100 indicating the percentage of the index that - must be covered by a search query in order for the query to be reported as a success. This + :paramtype highlight_pre_tag: str + :keyword minimum_coverage: A number between 0 and 100 indicating the percentage of the index + that must be covered by a search query in order for the query to be reported as a success. This parameter can be useful for ensuring search availability even for services with only one replica. The default is 100. - :type minimum_coverage: float - :param order_by: The list of OData $orderby expressions by which to sort the results. Each + :paramtype minimum_coverage: float + :keyword order_by: The list of OData $orderby expressions by which to sort the results. Each expression can be either a field name or a call to either the geo.distance() or the search.score() functions. Each expression can be followed by asc to indicate ascending, and desc to indicate descending. The default is ascending order. Ties will be broken by the match scores of documents. If no OrderBy is specified, the default sort order is descending by document match score. There can be at most 32 $orderby clauses. - :type order_by: list[str] - :param query_type: A value that specifies the syntax of the search query. The default is + :paramtype order_by: list[str] + :keyword query_type: A value that specifies the syntax of the search query. The default is 'simple'. Use 'full' if your query uses the Lucene query syntax. Possible values include: "simple", "full", "semantic". - :type query_type: str or ~azure.search.documents.models.QueryType - :param scoring_parameters: The list of parameter values to be used in scoring functions (for + :paramtype query_type: str or ~azure.search.documents.models.QueryType + :keyword scoring_parameters: The list of parameter values to be used in scoring functions (for example, referencePointParameter) using the format name-values. For example, if the scoring profile defines a function with a parameter called 'mylocation' the parameter string would be "mylocation--122.2,44.8" (without the quotes). - :type scoring_parameters: list[str] - :param scoring_profile: The name of a scoring profile to evaluate match scores for matching + :paramtype scoring_parameters: list[str] + :keyword scoring_profile: The name of a scoring profile to evaluate match scores for matching documents in order to sort the results. - :type scoring_profile: str - :param search_fields: The list of field names to which to scope the full-text search. When + :paramtype scoring_profile: str + :keyword search_fields: The list of field names to which to scope the full-text search. When using fielded search (fieldName:searchExpression) in a full Lucene query, the field names of each fielded search expression take precedence over any field names listed in this parameter. - :type search_fields: list[str] - :param query_language: The language of the query. Possible values include: "none", "en-us". - :type query_language: str or ~azure.search.documents.models.QueryLanguage - :param speller: Improve search recall by spell-correcting individual search query terms. + :paramtype search_fields: list[str] + :keyword query_language: The language of the query. Possible values include: "none", "en-us". + :paramtype query_language: str or ~azure.search.documents.models.QueryLanguage + :keyword speller: Improve search recall by spell-correcting individual search query terms. Possible values include: "none", "lexicon". - :type speller: str or ~azure.search.documents.models.Speller - :param answers: This parameter is only valid if the query type is 'semantic'. If set, the query - returns answers extracted from key passages in the highest ranked documents. The number of - answers returned can be configured by appending the pipe character '|' followed by the + :paramtype speller: str or ~azure.search.documents.models.Speller + :keyword answers: This parameter is only valid if the query type is 'semantic'. If set, the + query returns answers extracted from key passages in the highest ranked documents. The number + of answers returned can be configured by appending the pipe character '|' followed by the 'count-:code:``' option after the answers parameter value, such as 'extractive|count-3'. Default count is 1. Possible values include: "none", "extractive". - :type answers: str or ~azure.search.documents.models.Answers - :param search_mode: A value that specifies whether any or all of the search terms must be + :paramtype answers: str or ~azure.search.documents.models.Answers + :keyword search_mode: A value that specifies whether any or all of the search terms must be matched in order to count the document as a match. Possible values include: "any", "all". - :type search_mode: str or ~azure.search.documents.models.SearchMode - :param scoring_statistics: A value that specifies whether we want to calculate scoring + :paramtype search_mode: str or ~azure.search.documents.models.SearchMode + :keyword scoring_statistics: A value that specifies whether we want to calculate scoring statistics (such as document frequency) globally for more consistent scoring, or locally, for lower latency. Possible values include: "local", "global". - :type scoring_statistics: str or ~azure.search.documents.models.ScoringStatistics - :param session_id: A value to be used to create a sticky session, which can help to get more + :paramtype scoring_statistics: str or ~azure.search.documents.models.ScoringStatistics + :keyword session_id: A value to be used to create a sticky session, which can help to get more consistent results. As long as the same sessionId is used, a best-effort attempt will be made to target the same replica set. Be wary that reusing the same sessionID values repeatedly can interfere with the load balancing of the requests across replicas and adversely affect the performance of the search service. The value used as sessionId cannot start with a '_' character. - :type session_id: str - :param select: The list of fields to retrieve. If unspecified, all fields marked as retrievable - in the schema are included. - :type select: list[str] - :param skip: The number of search results to skip. This value cannot be greater than 100,000. + :paramtype session_id: str + :keyword select: The list of fields to retrieve. If unspecified, all fields marked as + retrievable in the schema are included. + :paramtype select: list[str] + :keyword skip: The number of search results to skip. This value cannot be greater than 100,000. If you need to scan documents in sequence, but cannot use $skip due to this limitation, consider using $orderby on a totally-ordered key and $filter with a range query instead. - :type skip: int - :param top: The number of search results to retrieve. This can be used in conjunction with + :paramtype skip: int + :keyword top: The number of search results to retrieve. This can be used in conjunction with $skip to implement client-side paging of search results. If results are truncated due to server-side paging, the response will include a continuation token that can be used to issue another Search request for the next page of results. - :type top: int - :param captions: This parameter is only valid if the query type is 'semantic'. If set, the + :paramtype top: int + :keyword captions: This parameter is only valid if the query type is 'semantic'. If set, the query returns captions extracted from key passages in the highest ranked documents. When Captions is set to 'extractive', highlighting is enabled by default, and can be configured by appending the pipe character '|' followed by the 'highlight-' option, such as 'extractive|highlight-true'. Defaults to 'None'. Possible values include: "none", "extractive". - :type captions: str or ~azure.search.documents.models.Captions - :param semantic_fields: The list of field names used for semantic search. - :type semantic_fields: list[str] + :paramtype captions: str or ~azure.search.documents.models.Captions + :keyword semantic_fields: The list of field names used for semantic search. + :paramtype semantic_fields: list[str] """ _attribute_map = { @@ -734,99 +734,99 @@ def __init__( class SearchRequest(msrest.serialization.Model): """Parameters for filtering, sorting, faceting, paging, and other search query behaviors. - :param include_total_result_count: A value that specifies whether to fetch the total count of + :keyword include_total_result_count: A value that specifies whether to fetch the total count of results. Default is false. Setting this value to true may have a performance impact. Note that the count returned is an approximation. - :type include_total_result_count: bool - :param facets: The list of facet expressions to apply to the search query. Each facet + :paramtype include_total_result_count: bool + :keyword facets: The list of facet expressions to apply to the search query. Each facet expression contains a field name, optionally followed by a comma-separated list of name:value pairs. - :type facets: list[str] - :param filter: The OData $filter expression to apply to the search query. - :type filter: str - :param highlight_fields: The comma-separated list of field names to use for hit highlights. + :paramtype facets: list[str] + :keyword filter: The OData $filter expression to apply to the search query. + :paramtype filter: str + :keyword highlight_fields: The comma-separated list of field names to use for hit highlights. Only searchable fields can be used for hit highlighting. - :type highlight_fields: str - :param highlight_post_tag: A string tag that is appended to hit highlights. Must be set with + :paramtype highlight_fields: str + :keyword highlight_post_tag: A string tag that is appended to hit highlights. Must be set with highlightPreTag. Default is </em>. - :type highlight_post_tag: str - :param highlight_pre_tag: A string tag that is prepended to hit highlights. Must be set with + :paramtype highlight_post_tag: str + :keyword highlight_pre_tag: A string tag that is prepended to hit highlights. Must be set with highlightPostTag. Default is <em>. - :type highlight_pre_tag: str - :param minimum_coverage: A number between 0 and 100 indicating the percentage of the index that - must be covered by a search query in order for the query to be reported as a success. This + :paramtype highlight_pre_tag: str + :keyword minimum_coverage: A number between 0 and 100 indicating the percentage of the index + that must be covered by a search query in order for the query to be reported as a success. This parameter can be useful for ensuring search availability even for services with only one replica. The default is 100. - :type minimum_coverage: float - :param order_by: The comma-separated list of OData $orderby expressions by which to sort the + :paramtype minimum_coverage: float + :keyword order_by: The comma-separated list of OData $orderby expressions by which to sort the results. Each expression can be either a field name or a call to either the geo.distance() or the search.score() functions. Each expression can be followed by asc to indicate ascending, or desc to indicate descending. The default is ascending order. Ties will be broken by the match scores of documents. If no $orderby is specified, the default sort order is descending by document match score. There can be at most 32 $orderby clauses. - :type order_by: str - :param query_type: A value that specifies the syntax of the search query. The default is + :paramtype order_by: str + :keyword query_type: A value that specifies the syntax of the search query. The default is 'simple'. Use 'full' if your query uses the Lucene query syntax. Possible values include: "simple", "full", "semantic". - :type query_type: str or ~azure.search.documents.models.QueryType - :param scoring_statistics: A value that specifies whether we want to calculate scoring + :paramtype query_type: str or ~azure.search.documents.models.QueryType + :keyword scoring_statistics: A value that specifies whether we want to calculate scoring statistics (such as document frequency) globally for more consistent scoring, or locally, for lower latency. The default is 'local'. Use 'global' to aggregate scoring statistics globally before scoring. Using global scoring statistics can increase latency of search queries. Possible values include: "local", "global". - :type scoring_statistics: str or ~azure.search.documents.models.ScoringStatistics - :param session_id: A value to be used to create a sticky session, which can help getting more + :paramtype scoring_statistics: str or ~azure.search.documents.models.ScoringStatistics + :keyword session_id: A value to be used to create a sticky session, which can help getting more consistent results. As long as the same sessionId is used, a best-effort attempt will be made to target the same replica set. Be wary that reusing the same sessionID values repeatedly can interfere with the load balancing of the requests across replicas and adversely affect the performance of the search service. The value used as sessionId cannot start with a '_' character. - :type session_id: str - :param scoring_parameters: The list of parameter values to be used in scoring functions (for + :paramtype session_id: str + :keyword scoring_parameters: The list of parameter values to be used in scoring functions (for example, referencePointParameter) using the format name-values. For example, if the scoring profile defines a function with a parameter called 'mylocation' the parameter string would be "mylocation--122.2,44.8" (without the quotes). - :type scoring_parameters: list[str] - :param scoring_profile: The name of a scoring profile to evaluate match scores for matching + :paramtype scoring_parameters: list[str] + :keyword scoring_profile: The name of a scoring profile to evaluate match scores for matching documents in order to sort the results. - :type scoring_profile: str - :param search_text: A full-text search query expression; Use "*" or omit this parameter to + :paramtype scoring_profile: str + :keyword search_text: A full-text search query expression; Use "*" or omit this parameter to match all documents. - :type search_text: str - :param search_fields: The comma-separated list of field names to which to scope the full-text + :paramtype search_text: str + :keyword search_fields: The comma-separated list of field names to which to scope the full-text search. When using fielded search (fieldName:searchExpression) in a full Lucene query, the field names of each fielded search expression take precedence over any field names listed in this parameter. - :type search_fields: str - :param search_mode: A value that specifies whether any or all of the search terms must be + :paramtype search_fields: str + :keyword search_mode: A value that specifies whether any or all of the search terms must be matched in order to count the document as a match. Possible values include: "any", "all". - :type search_mode: str or ~azure.search.documents.models.SearchMode - :param query_language: A value that specifies the language of the search query. Possible values - include: "none", "en-us". - :type query_language: str or ~azure.search.documents.models.QueryLanguage - :param speller: A value that specified the type of the speller to use to spell-correct + :paramtype search_mode: str or ~azure.search.documents.models.SearchMode + :keyword query_language: A value that specifies the language of the search query. Possible + values include: "none", "en-us". + :paramtype query_language: str or ~azure.search.documents.models.QueryLanguage + :keyword speller: A value that specified the type of the speller to use to spell-correct individual search query terms. Possible values include: "none", "lexicon". - :type speller: str or ~azure.search.documents.models.Speller - :param answers: A value that specifies whether answers should be returned as part of the search - response. Possible values include: "none", "extractive". - :type answers: str or ~azure.search.documents.models.Answers - :param select: The comma-separated list of fields to retrieve. If unspecified, all fields + :paramtype speller: str or ~azure.search.documents.models.Speller + :keyword answers: A value that specifies whether answers should be returned as part of the + search response. Possible values include: "none", "extractive". + :paramtype answers: str or ~azure.search.documents.models.Answers + :keyword select: The comma-separated list of fields to retrieve. If unspecified, all fields marked as retrievable in the schema are included. - :type select: str - :param skip: The number of search results to skip. This value cannot be greater than 100,000. + :paramtype select: str + :keyword skip: The number of search results to skip. This value cannot be greater than 100,000. If you need to scan documents in sequence, but cannot use skip due to this limitation, consider using orderby on a totally-ordered key and filter with a range query instead. - :type skip: int - :param top: The number of search results to retrieve. This can be used in conjunction with + :paramtype skip: int + :keyword top: The number of search results to retrieve. This can be used in conjunction with $skip to implement client-side paging of search results. If results are truncated due to server-side paging, the response will include a continuation token that can be used to issue another Search request for the next page of results. - :type top: int - :param captions: A value that specifies whether captions should be returned as part of the + :paramtype top: int + :keyword captions: A value that specifies whether captions should be returned as part of the search response. Possible values include: "none", "extractive". - :type captions: str or ~azure.search.documents.models.Captions - :param semantic_fields: The comma-separated list of field names used for semantic search. - :type semantic_fields: str + :paramtype captions: str or ~azure.search.documents.models.Captions + :keyword semantic_fields: The comma-separated list of field names used for semantic search. + :paramtype semantic_fields: str """ _attribute_map = { @@ -894,9 +894,9 @@ class SearchResult(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param additional_properties: Unmatched properties from the message are deserialized to this + :keyword additional_properties: Unmatched properties from the message are deserialized to this collection. - :type additional_properties: dict[str, any] + :paramtype additional_properties: dict[str, any] :ivar score: Required. The relevance score of the document compared to other documents returned by the query. :vartype score: float @@ -976,41 +976,41 @@ def __init__( class SuggestOptions(msrest.serialization.Model): """Parameter group. - :param filter: An OData expression that filters the documents considered for suggestions. - :type filter: str - :param use_fuzzy_matching: A value indicating whether to use fuzzy matching for the suggestions - query. Default is false. When set to true, the query will find terms even if there's a - substituted or missing character in the search text. While this provides a better experience in - some scenarios, it comes at a performance cost as fuzzy suggestions queries are slower and - consume more resources. - :type use_fuzzy_matching: bool - :param highlight_post_tag: A string tag that is appended to hit highlights. Must be set with + :keyword filter: An OData expression that filters the documents considered for suggestions. + :paramtype filter: str + :keyword use_fuzzy_matching: A value indicating whether to use fuzzy matching for the + suggestions query. Default is false. When set to true, the query will find terms even if + there's a substituted or missing character in the search text. While this provides a better + experience in some scenarios, it comes at a performance cost as fuzzy suggestions queries are + slower and consume more resources. + :paramtype use_fuzzy_matching: bool + :keyword highlight_post_tag: A string tag that is appended to hit highlights. Must be set with highlightPreTag. If omitted, hit highlighting of suggestions is disabled. - :type highlight_post_tag: str - :param highlight_pre_tag: A string tag that is prepended to hit highlights. Must be set with + :paramtype highlight_post_tag: str + :keyword highlight_pre_tag: A string tag that is prepended to hit highlights. Must be set with highlightPostTag. If omitted, hit highlighting of suggestions is disabled. - :type highlight_pre_tag: str - :param minimum_coverage: A number between 0 and 100 indicating the percentage of the index that - must be covered by a suggestions query in order for the query to be reported as a success. This - parameter can be useful for ensuring search availability even for services with only one + :paramtype highlight_pre_tag: str + :keyword minimum_coverage: A number between 0 and 100 indicating the percentage of the index + that must be covered by a suggestions query in order for the query to be reported as a success. + This parameter can be useful for ensuring search availability even for services with only one replica. The default is 80. - :type minimum_coverage: float - :param order_by: The list of OData $orderby expressions by which to sort the results. Each + :paramtype minimum_coverage: float + :keyword order_by: The list of OData $orderby expressions by which to sort the results. Each expression can be either a field name or a call to either the geo.distance() or the search.score() functions. Each expression can be followed by asc to indicate ascending, or desc to indicate descending. The default is ascending order. Ties will be broken by the match scores of documents. If no $orderby is specified, the default sort order is descending by document match score. There can be at most 32 $orderby clauses. - :type order_by: list[str] - :param search_fields: The list of field names to search for the specified search text. Target + :paramtype order_by: list[str] + :keyword search_fields: The list of field names to search for the specified search text. Target fields must be included in the specified suggester. - :type search_fields: list[str] - :param select: The list of fields to retrieve. If unspecified, only the key field will be + :paramtype search_fields: list[str] + :keyword select: The list of fields to retrieve. If unspecified, only the key field will be included in the results. - :type select: list[str] - :param top: The number of suggestions to retrieve. The value must be a number between 1 and + :paramtype select: list[str] + :keyword top: The number of suggestions to retrieve. The value must be a number between 1 and 100. The default is 5. - :type top: int + :paramtype top: int """ _attribute_map = { @@ -1046,47 +1046,47 @@ class SuggestRequest(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param filter: An OData expression that filters the documents considered for suggestions. - :type filter: str - :param use_fuzzy_matching: A value indicating whether to use fuzzy matching for the suggestion - query. Default is false. When set to true, the query will find suggestions even if there's a - substituted or missing character in the search text. While this provides a better experience in - some scenarios, it comes at a performance cost as fuzzy suggestion searches are slower and - consume more resources. - :type use_fuzzy_matching: bool - :param highlight_post_tag: A string tag that is appended to hit highlights. Must be set with + :keyword filter: An OData expression that filters the documents considered for suggestions. + :paramtype filter: str + :keyword use_fuzzy_matching: A value indicating whether to use fuzzy matching for the + suggestion query. Default is false. When set to true, the query will find suggestions even if + there's a substituted or missing character in the search text. While this provides a better + experience in some scenarios, it comes at a performance cost as fuzzy suggestion searches are + slower and consume more resources. + :paramtype use_fuzzy_matching: bool + :keyword highlight_post_tag: A string tag that is appended to hit highlights. Must be set with highlightPreTag. If omitted, hit highlighting of suggestions is disabled. - :type highlight_post_tag: str - :param highlight_pre_tag: A string tag that is prepended to hit highlights. Must be set with + :paramtype highlight_post_tag: str + :keyword highlight_pre_tag: A string tag that is prepended to hit highlights. Must be set with highlightPostTag. If omitted, hit highlighting of suggestions is disabled. - :type highlight_pre_tag: str - :param minimum_coverage: A number between 0 and 100 indicating the percentage of the index that - must be covered by a suggestion query in order for the query to be reported as a success. This - parameter can be useful for ensuring search availability even for services with only one + :paramtype highlight_pre_tag: str + :keyword minimum_coverage: A number between 0 and 100 indicating the percentage of the index + that must be covered by a suggestion query in order for the query to be reported as a success. + This parameter can be useful for ensuring search availability even for services with only one replica. The default is 80. - :type minimum_coverage: float - :param order_by: The comma-separated list of OData $orderby expressions by which to sort the + :paramtype minimum_coverage: float + :keyword order_by: The comma-separated list of OData $orderby expressions by which to sort the results. Each expression can be either a field name or a call to either the geo.distance() or the search.score() functions. Each expression can be followed by asc to indicate ascending, or desc to indicate descending. The default is ascending order. Ties will be broken by the match scores of documents. If no $orderby is specified, the default sort order is descending by document match score. There can be at most 32 $orderby clauses. - :type order_by: str - :param search_text: Required. The search text to use to suggest documents. Must be at least 1 + :paramtype order_by: str + :keyword search_text: Required. The search text to use to suggest documents. Must be at least 1 character, and no more than 100 characters. - :type search_text: str - :param search_fields: The comma-separated list of field names to search for the specified + :paramtype search_text: str + :keyword search_fields: The comma-separated list of field names to search for the specified search text. Target fields must be included in the specified suggester. - :type search_fields: str - :param select: The comma-separated list of fields to retrieve. If unspecified, only the key + :paramtype search_fields: str + :keyword select: The comma-separated list of fields to retrieve. If unspecified, only the key field will be included in the results. - :type select: str - :param suggester_name: Required. The name of the suggester as specified in the suggesters + :paramtype select: str + :keyword suggester_name: Required. The name of the suggester as specified in the suggesters collection that's part of the index definition. - :type suggester_name: str - :param top: The number of suggestions to retrieve. This must be a value between 1 and 100. The - default is 5. - :type top: int + :paramtype suggester_name: str + :keyword top: The number of suggestions to retrieve. This must be a value between 1 and 100. + The default is 5. + :paramtype top: int """ _validation = { @@ -1133,9 +1133,9 @@ class SuggestResult(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param additional_properties: Unmatched properties from the message are deserialized to this + :keyword additional_properties: Unmatched properties from the message are deserialized to this collection. - :type additional_properties: dict[str, any] + :paramtype additional_properties: dict[str, any] :ivar text: Required. The text of the suggestion result. :vartype text: str """ diff --git a/sdk/search/azure-search-documents/azure/search/documents/_generated/models/_models_py3.py b/sdk/search/azure-search-documents/azure/search/documents/_generated/models/_models_py3.py index 033a095dc8f1..e5e0ece35849 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/_generated/models/_models_py3.py +++ b/sdk/search/azure-search-documents/azure/search/documents/_generated/models/_models_py3.py @@ -19,9 +19,9 @@ class AnswerResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param additional_properties: Unmatched properties from the message are deserialized to this + :keyword additional_properties: Unmatched properties from the message are deserialized to this collection. - :type additional_properties: dict[str, any] + :paramtype additional_properties: dict[str, any] :ivar score: The score value represents how relevant the answer is to the the query relative to other answers returned for the query. :vartype score: float @@ -98,36 +98,36 @@ def __init__( class AutocompleteOptions(msrest.serialization.Model): """Parameter group. - :param autocomplete_mode: Specifies the mode for Autocomplete. The default is 'oneTerm'. Use + :keyword autocomplete_mode: Specifies the mode for Autocomplete. The default is 'oneTerm'. Use 'twoTerms' to get shingles and 'oneTermWithContext' to use the current context while producing auto-completed terms. Possible values include: "oneTerm", "twoTerms", "oneTermWithContext". - :type autocomplete_mode: str or ~azure.search.documents.models.AutocompleteMode - :param filter: An OData expression that filters the documents used to produce completed terms + :paramtype autocomplete_mode: str or ~azure.search.documents.models.AutocompleteMode + :keyword filter: An OData expression that filters the documents used to produce completed terms for the Autocomplete result. - :type filter: str - :param use_fuzzy_matching: A value indicating whether to use fuzzy matching for the + :paramtype filter: str + :keyword use_fuzzy_matching: A value indicating whether to use fuzzy matching for the autocomplete query. Default is false. When set to true, the query will find terms even if there's a substituted or missing character in the search text. While this provides a better experience in some scenarios, it comes at a performance cost as fuzzy autocomplete queries are slower and consume more resources. - :type use_fuzzy_matching: bool - :param highlight_post_tag: A string tag that is appended to hit highlights. Must be set with + :paramtype use_fuzzy_matching: bool + :keyword highlight_post_tag: A string tag that is appended to hit highlights. Must be set with highlightPreTag. If omitted, hit highlighting is disabled. - :type highlight_post_tag: str - :param highlight_pre_tag: A string tag that is prepended to hit highlights. Must be set with + :paramtype highlight_post_tag: str + :keyword highlight_pre_tag: A string tag that is prepended to hit highlights. Must be set with highlightPostTag. If omitted, hit highlighting is disabled. - :type highlight_pre_tag: str - :param minimum_coverage: A number between 0 and 100 indicating the percentage of the index that - must be covered by an autocomplete query in order for the query to be reported as a success. - This parameter can be useful for ensuring search availability even for services with only one - replica. The default is 80. - :type minimum_coverage: float - :param search_fields: The list of field names to consider when querying for auto-completed + :paramtype highlight_pre_tag: str + :keyword minimum_coverage: A number between 0 and 100 indicating the percentage of the index + that must be covered by an autocomplete query in order for the query to be reported as a + success. This parameter can be useful for ensuring search availability even for services with + only one replica. The default is 80. + :paramtype minimum_coverage: float + :keyword search_fields: The list of field names to consider when querying for auto-completed terms. Target fields must be included in the specified suggester. - :type search_fields: list[str] - :param top: The number of auto-completed terms to retrieve. This must be a value between 1 and - 100. The default is 5. - :type top: int + :paramtype search_fields: list[str] + :keyword top: The number of auto-completed terms to retrieve. This must be a value between 1 + and 100. The default is 5. + :paramtype top: int """ _attribute_map = { @@ -170,41 +170,41 @@ class AutocompleteRequest(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param search_text: Required. The search text on which to base autocomplete results. - :type search_text: str - :param autocomplete_mode: Specifies the mode for Autocomplete. The default is 'oneTerm'. Use + :keyword search_text: Required. The search text on which to base autocomplete results. + :paramtype search_text: str + :keyword autocomplete_mode: Specifies the mode for Autocomplete. The default is 'oneTerm'. Use 'twoTerms' to get shingles and 'oneTermWithContext' to use the current context while producing auto-completed terms. Possible values include: "oneTerm", "twoTerms", "oneTermWithContext". - :type autocomplete_mode: str or ~azure.search.documents.models.AutocompleteMode - :param filter: An OData expression that filters the documents used to produce completed terms + :paramtype autocomplete_mode: str or ~azure.search.documents.models.AutocompleteMode + :keyword filter: An OData expression that filters the documents used to produce completed terms for the Autocomplete result. - :type filter: str - :param use_fuzzy_matching: A value indicating whether to use fuzzy matching for the + :paramtype filter: str + :keyword use_fuzzy_matching: A value indicating whether to use fuzzy matching for the autocomplete query. Default is false. When set to true, the query will autocomplete terms even if there's a substituted or missing character in the search text. While this provides a better experience in some scenarios, it comes at a performance cost as fuzzy autocomplete queries are slower and consume more resources. - :type use_fuzzy_matching: bool - :param highlight_post_tag: A string tag that is appended to hit highlights. Must be set with + :paramtype use_fuzzy_matching: bool + :keyword highlight_post_tag: A string tag that is appended to hit highlights. Must be set with highlightPreTag. If omitted, hit highlighting is disabled. - :type highlight_post_tag: str - :param highlight_pre_tag: A string tag that is prepended to hit highlights. Must be set with + :paramtype highlight_post_tag: str + :keyword highlight_pre_tag: A string tag that is prepended to hit highlights. Must be set with highlightPostTag. If omitted, hit highlighting is disabled. - :type highlight_pre_tag: str - :param minimum_coverage: A number between 0 and 100 indicating the percentage of the index that - must be covered by an autocomplete query in order for the query to be reported as a success. - This parameter can be useful for ensuring search availability even for services with only one - replica. The default is 80. - :type minimum_coverage: float - :param search_fields: The comma-separated list of field names to consider when querying for + :paramtype highlight_pre_tag: str + :keyword minimum_coverage: A number between 0 and 100 indicating the percentage of the index + that must be covered by an autocomplete query in order for the query to be reported as a + success. This parameter can be useful for ensuring search availability even for services with + only one replica. The default is 80. + :paramtype minimum_coverage: float + :keyword search_fields: The comma-separated list of field names to consider when querying for auto-completed terms. Target fields must be included in the specified suggester. - :type search_fields: str - :param suggester_name: Required. The name of the suggester as specified in the suggesters + :paramtype search_fields: str + :keyword suggester_name: Required. The name of the suggester as specified in the suggesters collection that's part of the index definition. - :type suggester_name: str - :param top: The number of auto-completed terms to retrieve. This must be a value between 1 and - 100. The default is 5. - :type top: int + :paramtype suggester_name: str + :keyword top: The number of auto-completed terms to retrieve. This must be a value between 1 + and 100. The default is 5. + :paramtype top: int """ _validation = { @@ -291,9 +291,9 @@ class CaptionResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param additional_properties: Unmatched properties from the message are deserialized to this + :keyword additional_properties: Unmatched properties from the message are deserialized to this collection. - :type additional_properties: dict[str, any] + :paramtype additional_properties: dict[str, any] :ivar text: A representative text passage extracted from the document most relevant to the search query. :vartype text: str @@ -330,9 +330,9 @@ class FacetResult(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param additional_properties: Unmatched properties from the message are deserialized to this + :keyword additional_properties: Unmatched properties from the message are deserialized to this collection. - :type additional_properties: dict[str, any] + :paramtype additional_properties: dict[str, any] :ivar count: The approximate count of documents falling within the bucket described by this facet. :vartype count: long @@ -361,12 +361,12 @@ def __init__( class IndexAction(msrest.serialization.Model): """Represents an index action that operates on a document. - :param additional_properties: Unmatched properties from the message are deserialized to this + :keyword additional_properties: Unmatched properties from the message are deserialized to this collection. - :type additional_properties: dict[str, any] - :param action_type: The operation to perform on a document in an indexing batch. Possible + :paramtype additional_properties: dict[str, any] + :keyword action_type: The operation to perform on a document in an indexing batch. Possible values include: "upload", "merge", "mergeOrUpload", "delete". - :type action_type: str or ~azure.search.documents.models.IndexActionType + :paramtype action_type: str or ~azure.search.documents.models.IndexActionType """ _attribute_map = { @@ -391,8 +391,8 @@ class IndexBatch(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param actions: Required. The actions in the batch. - :type actions: list[~azure.search.documents.models.IndexAction] + :keyword actions: Required. The actions in the batch. + :paramtype actions: list[~azure.search.documents.models.IndexAction] """ _validation = { @@ -491,8 +491,8 @@ def __init__( class RequestOptions(msrest.serialization.Model): """Parameter group. - :param x_ms_client_request_id: The tracking ID sent with the request to help with debugging. - :type x_ms_client_request_id: str + :keyword x_ms_client_request_id: The tracking ID sent with the request to help with debugging. + :paramtype x_ms_client_request_id: str """ _attribute_map = { @@ -618,98 +618,98 @@ def __init__( class SearchOptions(msrest.serialization.Model): """Parameter group. - :param include_total_result_count: A value that specifies whether to fetch the total count of + :keyword include_total_result_count: A value that specifies whether to fetch the total count of results. Default is false. Setting this value to true may have a performance impact. Note that the count returned is an approximation. - :type include_total_result_count: bool - :param facets: The list of facet expressions to apply to the search query. Each facet + :paramtype include_total_result_count: bool + :keyword facets: The list of facet expressions to apply to the search query. Each facet expression contains a field name, optionally followed by a comma-separated list of name:value pairs. - :type facets: list[str] - :param filter: The OData $filter expression to apply to the search query. - :type filter: str - :param highlight_fields: The list of field names to use for hit highlights. Only searchable + :paramtype facets: list[str] + :keyword filter: The OData $filter expression to apply to the search query. + :paramtype filter: str + :keyword highlight_fields: The list of field names to use for hit highlights. Only searchable fields can be used for hit highlighting. - :type highlight_fields: list[str] - :param highlight_post_tag: A string tag that is appended to hit highlights. Must be set with + :paramtype highlight_fields: list[str] + :keyword highlight_post_tag: A string tag that is appended to hit highlights. Must be set with highlightPreTag. Default is </em>. - :type highlight_post_tag: str - :param highlight_pre_tag: A string tag that is prepended to hit highlights. Must be set with + :paramtype highlight_post_tag: str + :keyword highlight_pre_tag: A string tag that is prepended to hit highlights. Must be set with highlightPostTag. Default is <em>. - :type highlight_pre_tag: str - :param minimum_coverage: A number between 0 and 100 indicating the percentage of the index that - must be covered by a search query in order for the query to be reported as a success. This + :paramtype highlight_pre_tag: str + :keyword minimum_coverage: A number between 0 and 100 indicating the percentage of the index + that must be covered by a search query in order for the query to be reported as a success. This parameter can be useful for ensuring search availability even for services with only one replica. The default is 100. - :type minimum_coverage: float - :param order_by: The list of OData $orderby expressions by which to sort the results. Each + :paramtype minimum_coverage: float + :keyword order_by: The list of OData $orderby expressions by which to sort the results. Each expression can be either a field name or a call to either the geo.distance() or the search.score() functions. Each expression can be followed by asc to indicate ascending, and desc to indicate descending. The default is ascending order. Ties will be broken by the match scores of documents. If no OrderBy is specified, the default sort order is descending by document match score. There can be at most 32 $orderby clauses. - :type order_by: list[str] - :param query_type: A value that specifies the syntax of the search query. The default is + :paramtype order_by: list[str] + :keyword query_type: A value that specifies the syntax of the search query. The default is 'simple'. Use 'full' if your query uses the Lucene query syntax. Possible values include: "simple", "full", "semantic". - :type query_type: str or ~azure.search.documents.models.QueryType - :param scoring_parameters: The list of parameter values to be used in scoring functions (for + :paramtype query_type: str or ~azure.search.documents.models.QueryType + :keyword scoring_parameters: The list of parameter values to be used in scoring functions (for example, referencePointParameter) using the format name-values. For example, if the scoring profile defines a function with a parameter called 'mylocation' the parameter string would be "mylocation--122.2,44.8" (without the quotes). - :type scoring_parameters: list[str] - :param scoring_profile: The name of a scoring profile to evaluate match scores for matching + :paramtype scoring_parameters: list[str] + :keyword scoring_profile: The name of a scoring profile to evaluate match scores for matching documents in order to sort the results. - :type scoring_profile: str - :param search_fields: The list of field names to which to scope the full-text search. When + :paramtype scoring_profile: str + :keyword search_fields: The list of field names to which to scope the full-text search. When using fielded search (fieldName:searchExpression) in a full Lucene query, the field names of each fielded search expression take precedence over any field names listed in this parameter. - :type search_fields: list[str] - :param query_language: The language of the query. Possible values include: "none", "en-us". - :type query_language: str or ~azure.search.documents.models.QueryLanguage - :param speller: Improve search recall by spell-correcting individual search query terms. + :paramtype search_fields: list[str] + :keyword query_language: The language of the query. Possible values include: "none", "en-us". + :paramtype query_language: str or ~azure.search.documents.models.QueryLanguage + :keyword speller: Improve search recall by spell-correcting individual search query terms. Possible values include: "none", "lexicon". - :type speller: str or ~azure.search.documents.models.Speller - :param answers: This parameter is only valid if the query type is 'semantic'. If set, the query - returns answers extracted from key passages in the highest ranked documents. The number of - answers returned can be configured by appending the pipe character '|' followed by the + :paramtype speller: str or ~azure.search.documents.models.Speller + :keyword answers: This parameter is only valid if the query type is 'semantic'. If set, the + query returns answers extracted from key passages in the highest ranked documents. The number + of answers returned can be configured by appending the pipe character '|' followed by the 'count-:code:``' option after the answers parameter value, such as 'extractive|count-3'. Default count is 1. Possible values include: "none", "extractive". - :type answers: str or ~azure.search.documents.models.Answers - :param search_mode: A value that specifies whether any or all of the search terms must be + :paramtype answers: str or ~azure.search.documents.models.Answers + :keyword search_mode: A value that specifies whether any or all of the search terms must be matched in order to count the document as a match. Possible values include: "any", "all". - :type search_mode: str or ~azure.search.documents.models.SearchMode - :param scoring_statistics: A value that specifies whether we want to calculate scoring + :paramtype search_mode: str or ~azure.search.documents.models.SearchMode + :keyword scoring_statistics: A value that specifies whether we want to calculate scoring statistics (such as document frequency) globally for more consistent scoring, or locally, for lower latency. Possible values include: "local", "global". - :type scoring_statistics: str or ~azure.search.documents.models.ScoringStatistics - :param session_id: A value to be used to create a sticky session, which can help to get more + :paramtype scoring_statistics: str or ~azure.search.documents.models.ScoringStatistics + :keyword session_id: A value to be used to create a sticky session, which can help to get more consistent results. As long as the same sessionId is used, a best-effort attempt will be made to target the same replica set. Be wary that reusing the same sessionID values repeatedly can interfere with the load balancing of the requests across replicas and adversely affect the performance of the search service. The value used as sessionId cannot start with a '_' character. - :type session_id: str - :param select: The list of fields to retrieve. If unspecified, all fields marked as retrievable - in the schema are included. - :type select: list[str] - :param skip: The number of search results to skip. This value cannot be greater than 100,000. + :paramtype session_id: str + :keyword select: The list of fields to retrieve. If unspecified, all fields marked as + retrievable in the schema are included. + :paramtype select: list[str] + :keyword skip: The number of search results to skip. This value cannot be greater than 100,000. If you need to scan documents in sequence, but cannot use $skip due to this limitation, consider using $orderby on a totally-ordered key and $filter with a range query instead. - :type skip: int - :param top: The number of search results to retrieve. This can be used in conjunction with + :paramtype skip: int + :keyword top: The number of search results to retrieve. This can be used in conjunction with $skip to implement client-side paging of search results. If results are truncated due to server-side paging, the response will include a continuation token that can be used to issue another Search request for the next page of results. - :type top: int - :param captions: This parameter is only valid if the query type is 'semantic'. If set, the + :paramtype top: int + :keyword captions: This parameter is only valid if the query type is 'semantic'. If set, the query returns captions extracted from key passages in the highest ranked documents. When Captions is set to 'extractive', highlighting is enabled by default, and can be configured by appending the pipe character '|' followed by the 'highlight-' option, such as 'extractive|highlight-true'. Defaults to 'None'. Possible values include: "none", "extractive". - :type captions: str or ~azure.search.documents.models.Captions - :param semantic_fields: The list of field names used for semantic search. - :type semantic_fields: list[str] + :paramtype captions: str or ~azure.search.documents.models.Captions + :keyword semantic_fields: The list of field names used for semantic search. + :paramtype semantic_fields: list[str] """ _attribute_map = { @@ -795,99 +795,99 @@ def __init__( class SearchRequest(msrest.serialization.Model): """Parameters for filtering, sorting, faceting, paging, and other search query behaviors. - :param include_total_result_count: A value that specifies whether to fetch the total count of + :keyword include_total_result_count: A value that specifies whether to fetch the total count of results. Default is false. Setting this value to true may have a performance impact. Note that the count returned is an approximation. - :type include_total_result_count: bool - :param facets: The list of facet expressions to apply to the search query. Each facet + :paramtype include_total_result_count: bool + :keyword facets: The list of facet expressions to apply to the search query. Each facet expression contains a field name, optionally followed by a comma-separated list of name:value pairs. - :type facets: list[str] - :param filter: The OData $filter expression to apply to the search query. - :type filter: str - :param highlight_fields: The comma-separated list of field names to use for hit highlights. + :paramtype facets: list[str] + :keyword filter: The OData $filter expression to apply to the search query. + :paramtype filter: str + :keyword highlight_fields: The comma-separated list of field names to use for hit highlights. Only searchable fields can be used for hit highlighting. - :type highlight_fields: str - :param highlight_post_tag: A string tag that is appended to hit highlights. Must be set with + :paramtype highlight_fields: str + :keyword highlight_post_tag: A string tag that is appended to hit highlights. Must be set with highlightPreTag. Default is </em>. - :type highlight_post_tag: str - :param highlight_pre_tag: A string tag that is prepended to hit highlights. Must be set with + :paramtype highlight_post_tag: str + :keyword highlight_pre_tag: A string tag that is prepended to hit highlights. Must be set with highlightPostTag. Default is <em>. - :type highlight_pre_tag: str - :param minimum_coverage: A number between 0 and 100 indicating the percentage of the index that - must be covered by a search query in order for the query to be reported as a success. This + :paramtype highlight_pre_tag: str + :keyword minimum_coverage: A number between 0 and 100 indicating the percentage of the index + that must be covered by a search query in order for the query to be reported as a success. This parameter can be useful for ensuring search availability even for services with only one replica. The default is 100. - :type minimum_coverage: float - :param order_by: The comma-separated list of OData $orderby expressions by which to sort the + :paramtype minimum_coverage: float + :keyword order_by: The comma-separated list of OData $orderby expressions by which to sort the results. Each expression can be either a field name or a call to either the geo.distance() or the search.score() functions. Each expression can be followed by asc to indicate ascending, or desc to indicate descending. The default is ascending order. Ties will be broken by the match scores of documents. If no $orderby is specified, the default sort order is descending by document match score. There can be at most 32 $orderby clauses. - :type order_by: str - :param query_type: A value that specifies the syntax of the search query. The default is + :paramtype order_by: str + :keyword query_type: A value that specifies the syntax of the search query. The default is 'simple'. Use 'full' if your query uses the Lucene query syntax. Possible values include: "simple", "full", "semantic". - :type query_type: str or ~azure.search.documents.models.QueryType - :param scoring_statistics: A value that specifies whether we want to calculate scoring + :paramtype query_type: str or ~azure.search.documents.models.QueryType + :keyword scoring_statistics: A value that specifies whether we want to calculate scoring statistics (such as document frequency) globally for more consistent scoring, or locally, for lower latency. The default is 'local'. Use 'global' to aggregate scoring statistics globally before scoring. Using global scoring statistics can increase latency of search queries. Possible values include: "local", "global". - :type scoring_statistics: str or ~azure.search.documents.models.ScoringStatistics - :param session_id: A value to be used to create a sticky session, which can help getting more + :paramtype scoring_statistics: str or ~azure.search.documents.models.ScoringStatistics + :keyword session_id: A value to be used to create a sticky session, which can help getting more consistent results. As long as the same sessionId is used, a best-effort attempt will be made to target the same replica set. Be wary that reusing the same sessionID values repeatedly can interfere with the load balancing of the requests across replicas and adversely affect the performance of the search service. The value used as sessionId cannot start with a '_' character. - :type session_id: str - :param scoring_parameters: The list of parameter values to be used in scoring functions (for + :paramtype session_id: str + :keyword scoring_parameters: The list of parameter values to be used in scoring functions (for example, referencePointParameter) using the format name-values. For example, if the scoring profile defines a function with a parameter called 'mylocation' the parameter string would be "mylocation--122.2,44.8" (without the quotes). - :type scoring_parameters: list[str] - :param scoring_profile: The name of a scoring profile to evaluate match scores for matching + :paramtype scoring_parameters: list[str] + :keyword scoring_profile: The name of a scoring profile to evaluate match scores for matching documents in order to sort the results. - :type scoring_profile: str - :param search_text: A full-text search query expression; Use "*" or omit this parameter to + :paramtype scoring_profile: str + :keyword search_text: A full-text search query expression; Use "*" or omit this parameter to match all documents. - :type search_text: str - :param search_fields: The comma-separated list of field names to which to scope the full-text + :paramtype search_text: str + :keyword search_fields: The comma-separated list of field names to which to scope the full-text search. When using fielded search (fieldName:searchExpression) in a full Lucene query, the field names of each fielded search expression take precedence over any field names listed in this parameter. - :type search_fields: str - :param search_mode: A value that specifies whether any or all of the search terms must be + :paramtype search_fields: str + :keyword search_mode: A value that specifies whether any or all of the search terms must be matched in order to count the document as a match. Possible values include: "any", "all". - :type search_mode: str or ~azure.search.documents.models.SearchMode - :param query_language: A value that specifies the language of the search query. Possible values - include: "none", "en-us". - :type query_language: str or ~azure.search.documents.models.QueryLanguage - :param speller: A value that specified the type of the speller to use to spell-correct + :paramtype search_mode: str or ~azure.search.documents.models.SearchMode + :keyword query_language: A value that specifies the language of the search query. Possible + values include: "none", "en-us". + :paramtype query_language: str or ~azure.search.documents.models.QueryLanguage + :keyword speller: A value that specified the type of the speller to use to spell-correct individual search query terms. Possible values include: "none", "lexicon". - :type speller: str or ~azure.search.documents.models.Speller - :param answers: A value that specifies whether answers should be returned as part of the search - response. Possible values include: "none", "extractive". - :type answers: str or ~azure.search.documents.models.Answers - :param select: The comma-separated list of fields to retrieve. If unspecified, all fields + :paramtype speller: str or ~azure.search.documents.models.Speller + :keyword answers: A value that specifies whether answers should be returned as part of the + search response. Possible values include: "none", "extractive". + :paramtype answers: str or ~azure.search.documents.models.Answers + :keyword select: The comma-separated list of fields to retrieve. If unspecified, all fields marked as retrievable in the schema are included. - :type select: str - :param skip: The number of search results to skip. This value cannot be greater than 100,000. + :paramtype select: str + :keyword skip: The number of search results to skip. This value cannot be greater than 100,000. If you need to scan documents in sequence, but cannot use skip due to this limitation, consider using orderby on a totally-ordered key and filter with a range query instead. - :type skip: int - :param top: The number of search results to retrieve. This can be used in conjunction with + :paramtype skip: int + :keyword top: The number of search results to retrieve. This can be used in conjunction with $skip to implement client-side paging of search results. If results are truncated due to server-side paging, the response will include a continuation token that can be used to issue another Search request for the next page of results. - :type top: int - :param captions: A value that specifies whether captions should be returned as part of the + :paramtype top: int + :keyword captions: A value that specifies whether captions should be returned as part of the search response. Possible values include: "none", "extractive". - :type captions: str or ~azure.search.documents.models.Captions - :param semantic_fields: The comma-separated list of field names used for semantic search. - :type semantic_fields: str + :paramtype captions: str or ~azure.search.documents.models.Captions + :keyword semantic_fields: The comma-separated list of field names used for semantic search. + :paramtype semantic_fields: str """ _attribute_map = { @@ -980,9 +980,9 @@ class SearchResult(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param additional_properties: Unmatched properties from the message are deserialized to this + :keyword additional_properties: Unmatched properties from the message are deserialized to this collection. - :type additional_properties: dict[str, any] + :paramtype additional_properties: dict[str, any] :ivar score: Required. The relevance score of the document compared to other documents returned by the query. :vartype score: float @@ -1064,41 +1064,41 @@ def __init__( class SuggestOptions(msrest.serialization.Model): """Parameter group. - :param filter: An OData expression that filters the documents considered for suggestions. - :type filter: str - :param use_fuzzy_matching: A value indicating whether to use fuzzy matching for the suggestions - query. Default is false. When set to true, the query will find terms even if there's a - substituted or missing character in the search text. While this provides a better experience in - some scenarios, it comes at a performance cost as fuzzy suggestions queries are slower and - consume more resources. - :type use_fuzzy_matching: bool - :param highlight_post_tag: A string tag that is appended to hit highlights. Must be set with + :keyword filter: An OData expression that filters the documents considered for suggestions. + :paramtype filter: str + :keyword use_fuzzy_matching: A value indicating whether to use fuzzy matching for the + suggestions query. Default is false. When set to true, the query will find terms even if + there's a substituted or missing character in the search text. While this provides a better + experience in some scenarios, it comes at a performance cost as fuzzy suggestions queries are + slower and consume more resources. + :paramtype use_fuzzy_matching: bool + :keyword highlight_post_tag: A string tag that is appended to hit highlights. Must be set with highlightPreTag. If omitted, hit highlighting of suggestions is disabled. - :type highlight_post_tag: str - :param highlight_pre_tag: A string tag that is prepended to hit highlights. Must be set with + :paramtype highlight_post_tag: str + :keyword highlight_pre_tag: A string tag that is prepended to hit highlights. Must be set with highlightPostTag. If omitted, hit highlighting of suggestions is disabled. - :type highlight_pre_tag: str - :param minimum_coverage: A number between 0 and 100 indicating the percentage of the index that - must be covered by a suggestions query in order for the query to be reported as a success. This - parameter can be useful for ensuring search availability even for services with only one + :paramtype highlight_pre_tag: str + :keyword minimum_coverage: A number between 0 and 100 indicating the percentage of the index + that must be covered by a suggestions query in order for the query to be reported as a success. + This parameter can be useful for ensuring search availability even for services with only one replica. The default is 80. - :type minimum_coverage: float - :param order_by: The list of OData $orderby expressions by which to sort the results. Each + :paramtype minimum_coverage: float + :keyword order_by: The list of OData $orderby expressions by which to sort the results. Each expression can be either a field name or a call to either the geo.distance() or the search.score() functions. Each expression can be followed by asc to indicate ascending, or desc to indicate descending. The default is ascending order. Ties will be broken by the match scores of documents. If no $orderby is specified, the default sort order is descending by document match score. There can be at most 32 $orderby clauses. - :type order_by: list[str] - :param search_fields: The list of field names to search for the specified search text. Target + :paramtype order_by: list[str] + :keyword search_fields: The list of field names to search for the specified search text. Target fields must be included in the specified suggester. - :type search_fields: list[str] - :param select: The list of fields to retrieve. If unspecified, only the key field will be + :paramtype search_fields: list[str] + :keyword select: The list of fields to retrieve. If unspecified, only the key field will be included in the results. - :type select: list[str] - :param top: The number of suggestions to retrieve. The value must be a number between 1 and + :paramtype select: list[str] + :keyword top: The number of suggestions to retrieve. The value must be a number between 1 and 100. The default is 5. - :type top: int + :paramtype top: int """ _attribute_map = { @@ -1144,47 +1144,47 @@ class SuggestRequest(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param filter: An OData expression that filters the documents considered for suggestions. - :type filter: str - :param use_fuzzy_matching: A value indicating whether to use fuzzy matching for the suggestion - query. Default is false. When set to true, the query will find suggestions even if there's a - substituted or missing character in the search text. While this provides a better experience in - some scenarios, it comes at a performance cost as fuzzy suggestion searches are slower and - consume more resources. - :type use_fuzzy_matching: bool - :param highlight_post_tag: A string tag that is appended to hit highlights. Must be set with + :keyword filter: An OData expression that filters the documents considered for suggestions. + :paramtype filter: str + :keyword use_fuzzy_matching: A value indicating whether to use fuzzy matching for the + suggestion query. Default is false. When set to true, the query will find suggestions even if + there's a substituted or missing character in the search text. While this provides a better + experience in some scenarios, it comes at a performance cost as fuzzy suggestion searches are + slower and consume more resources. + :paramtype use_fuzzy_matching: bool + :keyword highlight_post_tag: A string tag that is appended to hit highlights. Must be set with highlightPreTag. If omitted, hit highlighting of suggestions is disabled. - :type highlight_post_tag: str - :param highlight_pre_tag: A string tag that is prepended to hit highlights. Must be set with + :paramtype highlight_post_tag: str + :keyword highlight_pre_tag: A string tag that is prepended to hit highlights. Must be set with highlightPostTag. If omitted, hit highlighting of suggestions is disabled. - :type highlight_pre_tag: str - :param minimum_coverage: A number between 0 and 100 indicating the percentage of the index that - must be covered by a suggestion query in order for the query to be reported as a success. This - parameter can be useful for ensuring search availability even for services with only one + :paramtype highlight_pre_tag: str + :keyword minimum_coverage: A number between 0 and 100 indicating the percentage of the index + that must be covered by a suggestion query in order for the query to be reported as a success. + This parameter can be useful for ensuring search availability even for services with only one replica. The default is 80. - :type minimum_coverage: float - :param order_by: The comma-separated list of OData $orderby expressions by which to sort the + :paramtype minimum_coverage: float + :keyword order_by: The comma-separated list of OData $orderby expressions by which to sort the results. Each expression can be either a field name or a call to either the geo.distance() or the search.score() functions. Each expression can be followed by asc to indicate ascending, or desc to indicate descending. The default is ascending order. Ties will be broken by the match scores of documents. If no $orderby is specified, the default sort order is descending by document match score. There can be at most 32 $orderby clauses. - :type order_by: str - :param search_text: Required. The search text to use to suggest documents. Must be at least 1 + :paramtype order_by: str + :keyword search_text: Required. The search text to use to suggest documents. Must be at least 1 character, and no more than 100 characters. - :type search_text: str - :param search_fields: The comma-separated list of field names to search for the specified + :paramtype search_text: str + :keyword search_fields: The comma-separated list of field names to search for the specified search text. Target fields must be included in the specified suggester. - :type search_fields: str - :param select: The comma-separated list of fields to retrieve. If unspecified, only the key + :paramtype search_fields: str + :keyword select: The comma-separated list of fields to retrieve. If unspecified, only the key field will be included in the results. - :type select: str - :param suggester_name: Required. The name of the suggester as specified in the suggesters + :paramtype select: str + :keyword suggester_name: Required. The name of the suggester as specified in the suggesters collection that's part of the index definition. - :type suggester_name: str - :param top: The number of suggestions to retrieve. This must be a value between 1 and 100. The - default is 5. - :type top: int + :paramtype suggester_name: str + :keyword top: The number of suggestions to retrieve. This must be a value between 1 and 100. + The default is 5. + :paramtype top: int """ _validation = { @@ -1243,9 +1243,9 @@ class SuggestResult(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param additional_properties: Unmatched properties from the message are deserialized to this + :keyword additional_properties: Unmatched properties from the message are deserialized to this collection. - :type additional_properties: dict[str, any] + :paramtype additional_properties: dict[str, any] :ivar text: Required. The text of the suggestion result. :vartype text: str """ diff --git a/sdk/search/azure-search-documents/azure/search/documents/_generated/models/_search_client_enums.py b/sdk/search/azure-search-documents/azure/search/documents/_generated/models/_search_client_enums.py index c49117818f8e..29a5bdc2c30d 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/_generated/models/_search_client_enums.py +++ b/sdk/search/azure-search-documents/azure/search/documents/_generated/models/_search_client_enums.py @@ -6,27 +6,12 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum, EnumMeta +from enum import Enum from six import with_metaclass +from azure.core import CaseInsensitiveEnumMeta -class _CaseInsensitiveEnumMeta(EnumMeta): - def __getitem__(self, name): - return super().__getitem__(name.upper()) - def __getattr__(cls, name): - """Return the enum member matching `name` - We use __getattr__ instead of descriptors or inserting into the enum - class' __dict__ in order to support `name` and `value` being both - properties for enum members (which live in the class' __dict__) and - enum members themselves. - """ - try: - return cls._member_map_[name.upper()] - except KeyError: - raise AttributeError(name) - - -class Answers(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class Answers(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """This parameter is only valid if the query type is 'semantic'. If set, the query returns answers extracted from key passages in the highest ranked documents. The number of answers returned can be configured by appending the pipe character '|' followed by the 'count-:code:` HttpRequest + x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] + + api_version = "2021-04-30-Preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/docs/$count') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if x_ms_client_request_id is not None: + header_parameters['x-ms-client-request-id'] = _SERIALIZER.header("x_ms_client_request_id", x_ms_client_request_id, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_search_get_request( + **kwargs # type: Any +): + # type: (...) -> HttpRequest + search_text = kwargs.pop('search_text', None) # type: Optional[str] + include_total_result_count = kwargs.pop('include_total_result_count', None) # type: Optional[bool] + facets = kwargs.pop('facets', None) # type: Optional[List[str]] + filter = kwargs.pop('filter', None) # type: Optional[str] + highlight_fields = kwargs.pop('highlight_fields', None) # type: Optional[List[str]] + highlight_post_tag = kwargs.pop('highlight_post_tag', None) # type: Optional[str] + highlight_pre_tag = kwargs.pop('highlight_pre_tag', None) # type: Optional[str] + minimum_coverage = kwargs.pop('minimum_coverage', None) # type: Optional[float] + order_by = kwargs.pop('order_by', None) # type: Optional[List[str]] + query_type = kwargs.pop('query_type', None) # type: Optional[Union[str, "_models.QueryType"]] + scoring_parameters = kwargs.pop('scoring_parameters', None) # type: Optional[List[str]] + scoring_profile = kwargs.pop('scoring_profile', None) # type: Optional[str] + search_fields = kwargs.pop('search_fields', None) # type: Optional[List[str]] + query_language = kwargs.pop('query_language', None) # type: Optional[Union[str, "_models.QueryLanguage"]] + speller = kwargs.pop('speller', None) # type: Optional[Union[str, "_models.Speller"]] + answers = kwargs.pop('answers', None) # type: Optional[Union[str, "_models.Answers"]] + search_mode = kwargs.pop('search_mode', None) # type: Optional[Union[str, "_models.SearchMode"]] + scoring_statistics = kwargs.pop('scoring_statistics', None) # type: Optional[Union[str, "_models.ScoringStatistics"]] + session_id = kwargs.pop('session_id', None) # type: Optional[str] + select = kwargs.pop('select', None) # type: Optional[List[str]] + skip = kwargs.pop('skip', None) # type: Optional[int] + top = kwargs.pop('top', None) # type: Optional[int] + captions = kwargs.pop('captions', None) # type: Optional[Union[str, "_models.Captions"]] + semantic_fields = kwargs.pop('semantic_fields', None) # type: Optional[List[str]] + x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] + + api_version = "2021-04-30-Preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/docs') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + if search_text is not None: + query_parameters['search'] = _SERIALIZER.query("search_text", search_text, 'str') + if include_total_result_count is not None: + query_parameters['$count'] = _SERIALIZER.query("include_total_result_count", include_total_result_count, 'bool') + if facets is not None: + query_parameters['facet'] = [_SERIALIZER.query("facets", q, 'str') if q is not None else '' for q in facets] + if filter is not None: + query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + if highlight_fields is not None: + query_parameters['highlight'] = _SERIALIZER.query("highlight_fields", highlight_fields, '[str]', div=',') + if highlight_post_tag is not None: + query_parameters['highlightPostTag'] = _SERIALIZER.query("highlight_post_tag", highlight_post_tag, 'str') + if highlight_pre_tag is not None: + query_parameters['highlightPreTag'] = _SERIALIZER.query("highlight_pre_tag", highlight_pre_tag, 'str') + if minimum_coverage is not None: + query_parameters['minimumCoverage'] = _SERIALIZER.query("minimum_coverage", minimum_coverage, 'float') + if order_by is not None: + query_parameters['$orderby'] = _SERIALIZER.query("order_by", order_by, '[str]', div=',') + if query_type is not None: + query_parameters['queryType'] = _SERIALIZER.query("query_type", query_type, 'str') + if scoring_parameters is not None: + query_parameters['scoringParameter'] = [_SERIALIZER.query("scoring_parameters", q, 'str') if q is not None else '' for q in scoring_parameters] + if scoring_profile is not None: + query_parameters['scoringProfile'] = _SERIALIZER.query("scoring_profile", scoring_profile, 'str') + if search_fields is not None: + query_parameters['searchFields'] = _SERIALIZER.query("search_fields", search_fields, '[str]', div=',') + if query_language is not None: + query_parameters['queryLanguage'] = _SERIALIZER.query("query_language", query_language, 'str') + if speller is not None: + query_parameters['speller'] = _SERIALIZER.query("speller", speller, 'str') + if answers is not None: + query_parameters['answers'] = _SERIALIZER.query("answers", answers, 'str') + if search_mode is not None: + query_parameters['searchMode'] = _SERIALIZER.query("search_mode", search_mode, 'str') + if scoring_statistics is not None: + query_parameters['scoringStatistics'] = _SERIALIZER.query("scoring_statistics", scoring_statistics, 'str') + if session_id is not None: + query_parameters['sessionId'] = _SERIALIZER.query("session_id", session_id, 'str') + if select is not None: + query_parameters['$select'] = _SERIALIZER.query("select", select, '[str]', div=',') + if skip is not None: + query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int') + if top is not None: + query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') + if captions is not None: + query_parameters['captions'] = _SERIALIZER.query("captions", captions, 'str') + if semantic_fields is not None: + query_parameters['semanticFields'] = _SERIALIZER.query("semantic_fields", semantic_fields, '[str]', div=',') + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if x_ms_client_request_id is not None: + header_parameters['x-ms-client-request-id'] = _SERIALIZER.header("x_ms_client_request_id", x_ms_client_request_id, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_search_post_request( + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] + + api_version = "2021-04-30-Preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/docs/search.post.search') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if x_ms_client_request_id is not None: + header_parameters['x-ms-client-request-id'] = _SERIALIZER.header("x_ms_client_request_id", x_ms_client_request_id, 'str') + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + key, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + selected_fields = kwargs.pop('selected_fields', None) # type: Optional[List[str]] + x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] + + api_version = "2021-04-30-Preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/docs(\'{key}\')') + path_format_arguments = { + "key": _SERIALIZER.url("key", key, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + if selected_fields is not None: + query_parameters['$select'] = _SERIALIZER.query("selected_fields", selected_fields, '[str]', div=',') + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if x_ms_client_request_id is not None: + header_parameters['x-ms-client-request-id'] = _SERIALIZER.header("x_ms_client_request_id", x_ms_client_request_id, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_suggest_get_request( + **kwargs # type: Any +): + # type: (...) -> HttpRequest + search_text = kwargs.pop('search_text') # type: str + suggester_name = kwargs.pop('suggester_name') # type: str + filter = kwargs.pop('filter', None) # type: Optional[str] + use_fuzzy_matching = kwargs.pop('use_fuzzy_matching', None) # type: Optional[bool] + highlight_post_tag = kwargs.pop('highlight_post_tag', None) # type: Optional[str] + highlight_pre_tag = kwargs.pop('highlight_pre_tag', None) # type: Optional[str] + minimum_coverage = kwargs.pop('minimum_coverage', None) # type: Optional[float] + order_by = kwargs.pop('order_by', None) # type: Optional[List[str]] + search_fields = kwargs.pop('search_fields', None) # type: Optional[List[str]] + select = kwargs.pop('select', None) # type: Optional[List[str]] + top = kwargs.pop('top', None) # type: Optional[int] + x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] + + api_version = "2021-04-30-Preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/docs/search.suggest') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['search'] = _SERIALIZER.query("search_text", search_text, 'str') + query_parameters['suggesterName'] = _SERIALIZER.query("suggester_name", suggester_name, 'str') + if filter is not None: + query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + if use_fuzzy_matching is not None: + query_parameters['fuzzy'] = _SERIALIZER.query("use_fuzzy_matching", use_fuzzy_matching, 'bool') + if highlight_post_tag is not None: + query_parameters['highlightPostTag'] = _SERIALIZER.query("highlight_post_tag", highlight_post_tag, 'str') + if highlight_pre_tag is not None: + query_parameters['highlightPreTag'] = _SERIALIZER.query("highlight_pre_tag", highlight_pre_tag, 'str') + if minimum_coverage is not None: + query_parameters['minimumCoverage'] = _SERIALIZER.query("minimum_coverage", minimum_coverage, 'float') + if order_by is not None: + query_parameters['$orderby'] = _SERIALIZER.query("order_by", order_by, '[str]', div=',') + if search_fields is not None: + query_parameters['searchFields'] = _SERIALIZER.query("search_fields", search_fields, '[str]', div=',') + if select is not None: + query_parameters['$select'] = _SERIALIZER.query("select", select, '[str]', div=',') + if top is not None: + query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if x_ms_client_request_id is not None: + header_parameters['x-ms-client-request-id'] = _SERIALIZER.header("x_ms_client_request_id", x_ms_client_request_id, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_suggest_post_request( + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] + + api_version = "2021-04-30-Preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/docs/search.post.suggest') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if x_ms_client_request_id is not None: + header_parameters['x-ms-client-request-id'] = _SERIALIZER.header("x_ms_client_request_id", x_ms_client_request_id, 'str') + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_index_request( + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] + + api_version = "2021-04-30-Preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/docs/search.index') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if x_ms_client_request_id is not None: + header_parameters['x-ms-client-request-id'] = _SERIALIZER.header("x_ms_client_request_id", x_ms_client_request_id, 'str') + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_autocomplete_get_request( + **kwargs # type: Any +): + # type: (...) -> HttpRequest + search_text = kwargs.pop('search_text') # type: str + suggester_name = kwargs.pop('suggester_name') # type: str + x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] + autocomplete_mode = kwargs.pop('autocomplete_mode', None) # type: Optional[Union[str, "_models.AutocompleteMode"]] + filter = kwargs.pop('filter', None) # type: Optional[str] + use_fuzzy_matching = kwargs.pop('use_fuzzy_matching', None) # type: Optional[bool] + highlight_post_tag = kwargs.pop('highlight_post_tag', None) # type: Optional[str] + highlight_pre_tag = kwargs.pop('highlight_pre_tag', None) # type: Optional[str] + minimum_coverage = kwargs.pop('minimum_coverage', None) # type: Optional[float] + search_fields = kwargs.pop('search_fields', None) # type: Optional[List[str]] + top = kwargs.pop('top', None) # type: Optional[int] + + api_version = "2021-04-30-Preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/docs/search.autocomplete') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + query_parameters['search'] = _SERIALIZER.query("search_text", search_text, 'str') + query_parameters['suggesterName'] = _SERIALIZER.query("suggester_name", suggester_name, 'str') + if autocomplete_mode is not None: + query_parameters['autocompleteMode'] = _SERIALIZER.query("autocomplete_mode", autocomplete_mode, 'str') + if filter is not None: + query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + if use_fuzzy_matching is not None: + query_parameters['fuzzy'] = _SERIALIZER.query("use_fuzzy_matching", use_fuzzy_matching, 'bool') + if highlight_post_tag is not None: + query_parameters['highlightPostTag'] = _SERIALIZER.query("highlight_post_tag", highlight_post_tag, 'str') + if highlight_pre_tag is not None: + query_parameters['highlightPreTag'] = _SERIALIZER.query("highlight_pre_tag", highlight_pre_tag, 'str') + if minimum_coverage is not None: + query_parameters['minimumCoverage'] = _SERIALIZER.query("minimum_coverage", minimum_coverage, 'float') + if search_fields is not None: + query_parameters['searchFields'] = _SERIALIZER.query("search_fields", search_fields, '[str]', div=',') + if top is not None: + query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if x_ms_client_request_id is not None: + header_parameters['x-ms-client-request-id'] = _SERIALIZER.header("x_ms_client_request_id", x_ms_client_request_id, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_autocomplete_post_request( + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] + + api_version = "2021-04-30-Preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/docs/search.post.autocomplete') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if x_ms_client_request_id is not None: + header_parameters['x-ms-client-request-id'] = _SERIALIZER.header("x_ms_client_request_id", x_ms_client_request_id, 'str') + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +# fmt: on class DocumentsOperations(object): """DocumentsOperations operations. @@ -43,6 +473,7 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def count( self, request_options=None, # type: Optional["_models.RequestOptions"] @@ -63,33 +494,22 @@ def count( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - accept = "application/json" - # Construct URL - url = self.count.metadata['url'] # type: ignore + request = build_count_request( + x_ms_client_request_id=_x_ms_client_request_id, + template_url=self.count.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexName': self._serialize.url("self._config.index_name", self._config.index_name, 'str'), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "indexName": self._serialize.url("self._config.index_name", self._config.index_name, 'str'), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request.url = self._client.format_url(request.url, **path_format_arguments) - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: @@ -103,8 +523,11 @@ def count( return cls(pipeline_response, deserialized, {}) return deserialized + count.metadata = {'url': '/docs/$count'} # type: ignore + + @distributed_trace def search_get( self, search_text=None, # type: Optional[str] @@ -132,7 +555,7 @@ def search_get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + _include_total_result_count = None _facets = None _filter = None @@ -157,8 +580,6 @@ def search_get( _captions = None _semantic_fields = None _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id if search_options is not None: _include_total_result_count = search_options.include_total_result_count _facets = search_options.facets @@ -183,77 +604,44 @@ def search_get( _top = search_options.top _captions = search_options.captions _semantic_fields = search_options.semantic_fields - api_version = "2021-04-30-Preview" - accept = "application/json" + if request_options is not None: + _x_ms_client_request_id = request_options.x_ms_client_request_id - # Construct URL - url = self.search_get.metadata['url'] # type: ignore + request = build_search_get_request( + search_text=search_text, + include_total_result_count=_include_total_result_count, + facets=_facets, + filter=_filter, + highlight_fields=_highlight_fields, + highlight_post_tag=_highlight_post_tag, + highlight_pre_tag=_highlight_pre_tag, + minimum_coverage=_minimum_coverage, + order_by=_order_by, + query_type=_query_type, + scoring_parameters=_scoring_parameters, + scoring_profile=_scoring_profile, + search_fields=_search_fields, + query_language=_query_language, + speller=_speller, + answers=_answers, + search_mode=_search_mode, + scoring_statistics=_scoring_statistics, + session_id=_session_id, + select=_select, + skip=_skip, + top=_top, + captions=_captions, + semantic_fields=_semantic_fields, + x_ms_client_request_id=_x_ms_client_request_id, + template_url=self.search_get.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexName': self._serialize.url("self._config.index_name", self._config.index_name, 'str'), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "indexName": self._serialize.url("self._config.index_name", self._config.index_name, 'str'), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if search_text is not None: - query_parameters['search'] = self._serialize.query("search_text", search_text, 'str') - if _include_total_result_count is not None: - query_parameters['$count'] = self._serialize.query("include_total_result_count", _include_total_result_count, 'bool') - if _facets is not None: - query_parameters['facet'] = [self._serialize.query("facets", q, 'str') if q is not None else '' for q in _facets] - if _filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", _filter, 'str') - if _highlight_fields is not None: - query_parameters['highlight'] = self._serialize.query("highlight_fields", _highlight_fields, '[str]', div=',') - if _highlight_post_tag is not None: - query_parameters['highlightPostTag'] = self._serialize.query("highlight_post_tag", _highlight_post_tag, 'str') - if _highlight_pre_tag is not None: - query_parameters['highlightPreTag'] = self._serialize.query("highlight_pre_tag", _highlight_pre_tag, 'str') - if _minimum_coverage is not None: - query_parameters['minimumCoverage'] = self._serialize.query("minimum_coverage", _minimum_coverage, 'float') - if _order_by is not None: - query_parameters['$orderby'] = self._serialize.query("order_by", _order_by, '[str]', div=',') - if _query_type is not None: - query_parameters['queryType'] = self._serialize.query("query_type", _query_type, 'str') - if _scoring_parameters is not None: - query_parameters['scoringParameter'] = [self._serialize.query("scoring_parameters", q, 'str') if q is not None else '' for q in _scoring_parameters] - if _scoring_profile is not None: - query_parameters['scoringProfile'] = self._serialize.query("scoring_profile", _scoring_profile, 'str') - if _search_fields is not None: - query_parameters['searchFields'] = self._serialize.query("search_fields", _search_fields, '[str]', div=',') - if _query_language is not None: - query_parameters['queryLanguage'] = self._serialize.query("query_language", _query_language, 'str') - if _speller is not None: - query_parameters['speller'] = self._serialize.query("speller", _speller, 'str') - if _answers is not None: - query_parameters['answers'] = self._serialize.query("answers", _answers, 'str') - if _search_mode is not None: - query_parameters['searchMode'] = self._serialize.query("search_mode", _search_mode, 'str') - if _scoring_statistics is not None: - query_parameters['scoringStatistics'] = self._serialize.query("scoring_statistics", _scoring_statistics, 'str') - if _session_id is not None: - query_parameters['sessionId'] = self._serialize.query("session_id", _session_id, 'str') - if _select is not None: - query_parameters['$select'] = self._serialize.query("select", _select, '[str]', div=',') - if _skip is not None: - query_parameters['$skip'] = self._serialize.query("skip", _skip, 'int') - if _top is not None: - query_parameters['$top'] = self._serialize.query("top", _top, 'int') - if _captions is not None: - query_parameters['captions'] = self._serialize.query("captions", _captions, 'str') - if _semantic_fields is not None: - query_parameters['semanticFields'] = self._serialize.query("semantic_fields", _semantic_fields, '[str]', div=',') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: @@ -267,8 +655,11 @@ def search_get( return cls(pipeline_response, deserialized, {}) return deserialized + search_get.metadata = {'url': '/docs'} # type: ignore + + @distributed_trace def search_post( self, search_request, # type: "_models.SearchRequest" @@ -292,38 +683,27 @@ def search_post( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.search_post.metadata['url'] # type: ignore + json = self._serialize.body(search_request, 'SearchRequest') + + request = build_search_post_request( + content_type=content_type, + x_ms_client_request_id=_x_ms_client_request_id, + json=json, + template_url=self.search_post.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexName': self._serialize.url("self._config.index_name", self._config.index_name, 'str'), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "indexName": self._serialize.url("self._config.index_name", self._config.index_name, 'str'), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(search_request, 'SearchRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: @@ -337,8 +717,11 @@ def search_post( return cls(pipeline_response, deserialized, {}) return deserialized + search_post.metadata = {'url': '/docs/search.post.search'} # type: ignore + + @distributed_trace def get( self, key, # type: str @@ -366,36 +749,24 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - accept = "application/json" - # Construct URL - url = self.get.metadata['url'] # type: ignore + request = build_get_request( + key=key, + selected_fields=selected_fields, + x_ms_client_request_id=_x_ms_client_request_id, + template_url=self.get.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexName': self._serialize.url("self._config.index_name", self._config.index_name, 'str'), - 'key': self._serialize.url("key", key, 'str'), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "indexName": self._serialize.url("self._config.index_name", self._config.index_name, 'str'), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if selected_fields is not None: - query_parameters['$select'] = self._serialize.query("selected_fields", selected_fields, '[str]', div=',') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: @@ -409,8 +780,11 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/docs(\'{key}\')'} # type: ignore + + @distributed_trace def suggest_get( self, search_text, # type: str @@ -442,7 +816,7 @@ def suggest_get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + _filter = None _use_fuzzy_matching = None _highlight_post_tag = None @@ -453,8 +827,6 @@ def suggest_get( _select = None _top = None _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id if suggest_options is not None: _filter = suggest_options.filter _use_fuzzy_matching = suggest_options.use_fuzzy_matching @@ -465,49 +837,31 @@ def suggest_get( _search_fields = suggest_options.search_fields _select = suggest_options.select _top = suggest_options.top - api_version = "2021-04-30-Preview" - accept = "application/json" + if request_options is not None: + _x_ms_client_request_id = request_options.x_ms_client_request_id - # Construct URL - url = self.suggest_get.metadata['url'] # type: ignore + request = build_suggest_get_request( + search_text=search_text, + suggester_name=suggester_name, + filter=_filter, + use_fuzzy_matching=_use_fuzzy_matching, + highlight_post_tag=_highlight_post_tag, + highlight_pre_tag=_highlight_pre_tag, + minimum_coverage=_minimum_coverage, + order_by=_order_by, + search_fields=_search_fields, + select=_select, + top=_top, + x_ms_client_request_id=_x_ms_client_request_id, + template_url=self.suggest_get.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexName': self._serialize.url("self._config.index_name", self._config.index_name, 'str'), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "indexName": self._serialize.url("self._config.index_name", self._config.index_name, 'str'), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['search'] = self._serialize.query("search_text", search_text, 'str') - query_parameters['suggesterName'] = self._serialize.query("suggester_name", suggester_name, 'str') - if _filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", _filter, 'str') - if _use_fuzzy_matching is not None: - query_parameters['fuzzy'] = self._serialize.query("use_fuzzy_matching", _use_fuzzy_matching, 'bool') - if _highlight_post_tag is not None: - query_parameters['highlightPostTag'] = self._serialize.query("highlight_post_tag", _highlight_post_tag, 'str') - if _highlight_pre_tag is not None: - query_parameters['highlightPreTag'] = self._serialize.query("highlight_pre_tag", _highlight_pre_tag, 'str') - if _minimum_coverage is not None: - query_parameters['minimumCoverage'] = self._serialize.query("minimum_coverage", _minimum_coverage, 'float') - if _order_by is not None: - query_parameters['$orderby'] = self._serialize.query("order_by", _order_by, '[str]', div=',') - if _search_fields is not None: - query_parameters['searchFields'] = self._serialize.query("search_fields", _search_fields, '[str]', div=',') - if _select is not None: - query_parameters['$select'] = self._serialize.query("select", _select, '[str]', div=',') - if _top is not None: - query_parameters['$top'] = self._serialize.query("top", _top, 'int') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: @@ -521,8 +875,11 @@ def suggest_get( return cls(pipeline_response, deserialized, {}) return deserialized + suggest_get.metadata = {'url': '/docs/search.suggest'} # type: ignore + + @distributed_trace def suggest_post( self, suggest_request, # type: "_models.SuggestRequest" @@ -546,38 +903,27 @@ def suggest_post( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.suggest_post.metadata['url'] # type: ignore + json = self._serialize.body(suggest_request, 'SuggestRequest') + + request = build_suggest_post_request( + content_type=content_type, + x_ms_client_request_id=_x_ms_client_request_id, + json=json, + template_url=self.suggest_post.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexName': self._serialize.url("self._config.index_name", self._config.index_name, 'str'), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "indexName": self._serialize.url("self._config.index_name", self._config.index_name, 'str'), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(suggest_request, 'SuggestRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: @@ -591,8 +937,11 @@ def suggest_post( return cls(pipeline_response, deserialized, {}) return deserialized + suggest_post.metadata = {'url': '/docs/search.post.suggest'} # type: ignore + + @distributed_trace def index( self, actions, # type: List["_models.IndexAction"] @@ -616,40 +965,28 @@ def index( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - _batch = _models.IndexBatch(actions=actions) - api_version = "2021-04-30-Preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.index.metadata['url'] # type: ignore + json = self._serialize.body(_batch, 'IndexBatch') + + request = build_index_request( + content_type=content_type, + x_ms_client_request_id=_x_ms_client_request_id, + json=json, + template_url=self.index.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexName': self._serialize.url("self._config.index_name", self._config.index_name, 'str'), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "indexName": self._serialize.url("self._config.index_name", self._config.index_name, 'str'), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(_batch, 'IndexBatch') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 207]: @@ -667,8 +1004,11 @@ def index( return cls(pipeline_response, deserialized, {}) return deserialized + index.metadata = {'url': '/docs/search.index'} # type: ignore + + @distributed_trace def autocomplete_get( self, search_text, # type: str @@ -699,7 +1039,7 @@ def autocomplete_get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + _x_ms_client_request_id = None _autocomplete_mode = None _filter = None @@ -709,6 +1049,8 @@ def autocomplete_get( _minimum_coverage = None _search_fields = None _top = None + if request_options is not None: + _x_ms_client_request_id = request_options.x_ms_client_request_id if autocomplete_options is not None: _autocomplete_mode = autocomplete_options.autocomplete_mode _filter = autocomplete_options.filter @@ -718,49 +1060,28 @@ def autocomplete_get( _minimum_coverage = autocomplete_options.minimum_coverage _search_fields = autocomplete_options.search_fields _top = autocomplete_options.top - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - accept = "application/json" - # Construct URL - url = self.autocomplete_get.metadata['url'] # type: ignore + request = build_autocomplete_get_request( + search_text=search_text, + suggester_name=suggester_name, + x_ms_client_request_id=_x_ms_client_request_id, + autocomplete_mode=_autocomplete_mode, + filter=_filter, + use_fuzzy_matching=_use_fuzzy_matching, + highlight_post_tag=_highlight_post_tag, + highlight_pre_tag=_highlight_pre_tag, + minimum_coverage=_minimum_coverage, + search_fields=_search_fields, + top=_top, + template_url=self.autocomplete_get.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexName': self._serialize.url("self._config.index_name", self._config.index_name, 'str'), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "indexName": self._serialize.url("self._config.index_name", self._config.index_name, 'str'), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - query_parameters['search'] = self._serialize.query("search_text", search_text, 'str') - query_parameters['suggesterName'] = self._serialize.query("suggester_name", suggester_name, 'str') - if _autocomplete_mode is not None: - query_parameters['autocompleteMode'] = self._serialize.query("autocomplete_mode", _autocomplete_mode, 'str') - if _filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", _filter, 'str') - if _use_fuzzy_matching is not None: - query_parameters['fuzzy'] = self._serialize.query("use_fuzzy_matching", _use_fuzzy_matching, 'bool') - if _highlight_post_tag is not None: - query_parameters['highlightPostTag'] = self._serialize.query("highlight_post_tag", _highlight_post_tag, 'str') - if _highlight_pre_tag is not None: - query_parameters['highlightPreTag'] = self._serialize.query("highlight_pre_tag", _highlight_pre_tag, 'str') - if _minimum_coverage is not None: - query_parameters['minimumCoverage'] = self._serialize.query("minimum_coverage", _minimum_coverage, 'float') - if _search_fields is not None: - query_parameters['searchFields'] = self._serialize.query("search_fields", _search_fields, '[str]', div=',') - if _top is not None: - query_parameters['$top'] = self._serialize.query("top", _top, 'int') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: @@ -774,8 +1095,11 @@ def autocomplete_get( return cls(pipeline_response, deserialized, {}) return deserialized + autocomplete_get.metadata = {'url': '/docs/search.autocomplete'} # type: ignore + + @distributed_trace def autocomplete_post( self, autocomplete_request, # type: "_models.AutocompleteRequest" @@ -799,38 +1123,27 @@ def autocomplete_post( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.autocomplete_post.metadata['url'] # type: ignore + json = self._serialize.body(autocomplete_request, 'AutocompleteRequest') + + request = build_autocomplete_post_request( + content_type=content_type, + x_ms_client_request_id=_x_ms_client_request_id, + json=json, + template_url=self.autocomplete_post.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexName': self._serialize.url("self._config.index_name", self._config.index_name, 'str'), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "indexName": self._serialize.url("self._config.index_name", self._config.index_name, 'str'), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(autocomplete_request, 'AutocompleteRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: @@ -844,4 +1157,6 @@ def autocomplete_post( return cls(pipeline_response, deserialized, {}) return deserialized + autocomplete_post.metadata = {'url': '/docs/search.post.autocomplete'} # type: ignore + diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/_search_client.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/_search_client.py index 63cfd315c9e9..23bef882f6a4 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/_search_client.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/_search_client.py @@ -6,26 +6,21 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from copy import deepcopy from typing import TYPE_CHECKING from azure.core import PipelineClient from msrest import Deserializer, Serializer +from . import models +from ._configuration import SearchClientConfiguration +from .operations import DataSourcesOperations, IndexersOperations, IndexesOperations, SearchClientOperationsMixin, SkillsetsOperations, SynonymMapsOperations + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any - from azure.core.pipeline.transport import HttpRequest, HttpResponse - -from ._configuration import SearchClientConfiguration -from .operations import DataSourcesOperations -from .operations import IndexersOperations -from .operations import SkillsetsOperations -from .operations import SynonymMapsOperations -from .operations import IndexesOperations -from .operations import SearchClientOperationsMixin -from . import models - + from azure.core.rest import HttpRequest, HttpResponse class SearchClient(SearchClientOperationsMixin): """Client that can be used to manage and query indexes and documents, as well as manage other resources, on a search service. @@ -50,43 +45,51 @@ def __init__( **kwargs # type: Any ): # type: (...) -> None - base_url = '{endpoint}' + _base_url = '{endpoint}' self._config = SearchClientConfiguration(endpoint, **kwargs) - self._client = PipelineClient(base_url=base_url, config=self._config, **kwargs) + self._client = PipelineClient(base_url=_base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) + self._serialize.client_side_validation = False + self.data_sources = DataSourcesOperations(self._client, self._config, self._serialize, self._deserialize) + self.indexers = IndexersOperations(self._client, self._config, self._serialize, self._deserialize) + self.skillsets = SkillsetsOperations(self._client, self._config, self._serialize, self._deserialize) + self.synonym_maps = SynonymMapsOperations(self._client, self._config, self._serialize, self._deserialize) + self.indexes = IndexesOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_sources = DataSourcesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.indexers = IndexersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.skillsets = SkillsetsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.synonym_maps = SynonymMapsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.indexes = IndexesOperations( - self._client, self._config, self._serialize, self._deserialize) - - def _send_request(self, http_request, **kwargs): - # type: (HttpRequest, Any) -> HttpResponse + + def _send_request( + self, + request, # type: HttpRequest + **kwargs # type: Any + ): + # type: (...) -> HttpResponse """Runs the network request through the client's chained policies. - :param http_request: The network request you want to make. Required. - :type http_request: ~azure.core.pipeline.transport.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.HttpResponse + :rtype: ~azure.core.rest.HttpResponse """ + + request_copy = deepcopy(request) path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - http_request.url = self._client.format_url(http_request.url, **path_format_arguments) - stream = kwargs.pop("stream", True) - pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) - return pipeline_response.http_response + + request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) + return self._client.send_request(request_copy, **kwargs) def close(self): # type: () -> None diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/_search_client.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/_search_client.py index b8dfb1e0acc0..98dc5ee13869 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/_search_client.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/_search_client.py @@ -6,21 +6,16 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any +from copy import deepcopy +from typing import Any, Awaitable from azure.core import AsyncPipelineClient -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.rest import AsyncHttpResponse, HttpRequest from msrest import Deserializer, Serializer -from ._configuration import SearchClientConfiguration -from .operations import DataSourcesOperations -from .operations import IndexersOperations -from .operations import SkillsetsOperations -from .operations import SynonymMapsOperations -from .operations import IndexesOperations -from .operations import SearchClientOperationsMixin from .. import models - +from ._configuration import SearchClientConfiguration +from .operations import DataSourcesOperations, IndexersOperations, IndexesOperations, SearchClientOperationsMixin, SkillsetsOperations, SynonymMapsOperations class SearchClient(SearchClientOperationsMixin): """Client that can be used to manage and query indexes and documents, as well as manage other resources, on a search service. @@ -44,42 +39,50 @@ def __init__( endpoint: str, **kwargs: Any ) -> None: - base_url = '{endpoint}' + _base_url = '{endpoint}' self._config = SearchClientConfiguration(endpoint, **kwargs) - self._client = AsyncPipelineClient(base_url=base_url, config=self._config, **kwargs) + self._client = AsyncPipelineClient(base_url=_base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) + self._serialize.client_side_validation = False + self.data_sources = DataSourcesOperations(self._client, self._config, self._serialize, self._deserialize) + self.indexers = IndexersOperations(self._client, self._config, self._serialize, self._deserialize) + self.skillsets = SkillsetsOperations(self._client, self._config, self._serialize, self._deserialize) + self.synonym_maps = SynonymMapsOperations(self._client, self._config, self._serialize, self._deserialize) + self.indexes = IndexesOperations(self._client, self._config, self._serialize, self._deserialize) + - self.data_sources = DataSourcesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.indexers = IndexersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.skillsets = SkillsetsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.synonym_maps = SynonymMapsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.indexes = IndexesOperations( - self._client, self._config, self._serialize, self._deserialize) - - async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + def _send_request( + self, + request: HttpRequest, + **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. - :param http_request: The network request you want to make. Required. - :type http_request: ~azure.core.pipeline.transport.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + :rtype: ~azure.core.rest.AsyncHttpResponse """ + + request_copy = deepcopy(request) path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - http_request.url = self._client.format_url(http_request.url, **path_format_arguments) - stream = kwargs.pop("stream", True) - pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) - return pipeline_response.http_response + + request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) + return self._client.send_request(request_copy, **kwargs) async def close(self) -> None: await self._client.close() diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_data_sources_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_data_sources_operations.py index bc7fb52746b1..8f4a05b35c10 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_data_sources_operations.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_data_sources_operations.py @@ -5,14 +5,18 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async from ... import models as _models +from ...operations._data_sources_operations import build_create_or_update_request, build_create_request, build_delete_request, build_get_request, build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -39,6 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def create_or_update( self, data_source_name: str, @@ -75,46 +80,30 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - prefer = "return=representation" - api_version = "2021-04-30-Preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore + json = self._serialize.body(data_source, 'SearchIndexerDataSource') + + request = build_create_or_update_request( + data_source_name=data_source_name, + content_type=content_type, + x_ms_client_request_id=_x_ms_client_request_id, + if_match=if_match, + if_none_match=if_none_match, + ignore_reset_requirements=ignore_reset_requirements, + json=json, + template_url=self.create_or_update.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'dataSourceName': self._serialize.url("data_source_name", data_source_name, 'str'), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if ignore_reset_requirements is not None: - query_parameters['ignoreResetRequirements'] = self._serialize.query("ignore_reset_requirements", ignore_reset_requirements, 'bool') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - if if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - if if_none_match is not None: - header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') - header_parameters['Prefer'] = self._serialize.header("prefer", prefer, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(data_source, 'SearchIndexerDataSource') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = await self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -132,8 +121,11 @@ async def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized + create_or_update.metadata = {'url': '/datasources(\'{dataSourceName}\')'} # type: ignore + + @distributed_trace_async async def delete( self, data_source_name: str, @@ -164,37 +156,24 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - accept = "application/json" - # Construct URL - url = self.delete.metadata['url'] # type: ignore + request = build_delete_request( + data_source_name=data_source_name, + x_ms_client_request_id=_x_ms_client_request_id, + if_match=if_match, + if_none_match=if_none_match, + template_url=self.delete.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'dataSourceName': self._serialize.url("data_source_name", data_source_name, 'str'), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - if if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - if if_none_match is not None: - header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = await self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [204, 404]: @@ -207,6 +186,8 @@ async def delete( delete.metadata = {'url': '/datasources(\'{dataSourceName}\')'} # type: ignore + + @distributed_trace_async async def get( self, data_source_name: str, @@ -229,33 +210,22 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - accept = "application/json" - # Construct URL - url = self.get.metadata['url'] # type: ignore + request = build_get_request( + data_source_name=data_source_name, + x_ms_client_request_id=_x_ms_client_request_id, + template_url=self.get.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'dataSourceName': self._serialize.url("data_source_name", data_source_name, 'str'), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request.url = self._client.format_url(request.url, **path_format_arguments) - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: @@ -269,8 +239,11 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/datasources(\'{dataSourceName}\')'} # type: ignore + + @distributed_trace_async async def list( self, select: Optional[str] = None, @@ -295,34 +268,22 @@ async def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - accept = "application/json" - # Construct URL - url = self.list.metadata['url'] # type: ignore + request = build_list_request( + select=select, + x_ms_client_request_id=_x_ms_client_request_id, + template_url=self.list.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if select is not None: - query_parameters['$select'] = self._serialize.query("select", select, 'str') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = await self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: @@ -336,8 +297,11 @@ async def list( return cls(pipeline_response, deserialized, {}) return deserialized + list.metadata = {'url': '/datasources'} # type: ignore + + @distributed_trace_async async def create( self, data_source: "_models.SearchIndexerDataSource", @@ -360,37 +324,26 @@ async def create( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create.metadata['url'] # type: ignore + json = self._serialize.body(data_source, 'SearchIndexerDataSource') + + request = build_create_request( + content_type=content_type, + x_ms_client_request_id=_x_ms_client_request_id, + json=json, + template_url=self.create.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(data_source, 'SearchIndexerDataSource') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = await self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [201]: @@ -404,4 +357,6 @@ async def create( return cls(pipeline_response, deserialized, {}) return deserialized + create.metadata = {'url': '/datasources'} # type: ignore + diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_indexers_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_indexers_operations.py index 937c9f038e8b..31bdc5b09925 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_indexers_operations.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_indexers_operations.py @@ -5,14 +5,18 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async from ... import models as _models +from ...operations._indexers_operations import build_create_or_update_request, build_create_request, build_delete_request, build_get_request, build_get_status_request, build_list_request, build_reset_docs_request, build_reset_request, build_run_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -39,6 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def reset( self, indexer_name: str, @@ -61,33 +66,91 @@ async def reset( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - accept = "application/json" - # Construct URL - url = self.reset.metadata['url'] # type: ignore + request = build_reset_request( + indexer_name=indexer_name, + x_ms_client_request_id=_x_ms_client_request_id, + template_url=self.reset.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexerName': self._serialize.url("indexer_name", indexer_name, 'str'), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = await self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.SearchError, response) + raise HttpResponseError(response=response, model=error) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if cls: + return cls(pipeline_response, None, {}) + + reset.metadata = {'url': '/indexers(\'{indexerName}\')/search.reset'} # type: ignore + + + @distributed_trace_async + async def reset_docs( + self, + indexer_name: str, + overwrite: Optional[bool] = False, + keys_or_ids: Optional["_models.Paths1Cj7DxmIndexersIndexernameSearchResetdocsPostRequestbodyContentApplicationJsonSchema"] = None, + request_options: Optional["_models.RequestOptions"] = None, + **kwargs: Any + ) -> None: + """Resets specific documents in the datasource to be selectively re-ingested by the indexer. - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + :param indexer_name: The name of the indexer to reset documents for. + :type indexer_name: str + :param overwrite: If false, keys or ids will be appended to existing ones. If true, only the + keys or ids in this payload will be queued to be re-ingested. + :type overwrite: bool + :param keys_or_ids: + :type keys_or_ids: + ~azure.search.documents.indexes.models.Paths1Cj7DxmIndexersIndexernameSearchResetdocsPostRequestbodyContentApplicationJsonSchema + :param request_options: Parameter group. + :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _x_ms_client_request_id = None + if request_options is not None: + _x_ms_client_request_id = request_options.x_ms_client_request_id + if keys_or_ids is not None: + json = self._serialize.body(keys_or_ids, 'Paths1Cj7DxmIndexersIndexernameSearchResetdocsPostRequestbodyContentApplicationJsonSchema') + else: + json = None + + request = build_reset_docs_request( + indexer_name=indexer_name, + content_type=content_type, + overwrite=overwrite, + x_ms_client_request_id=_x_ms_client_request_id, + json=json, + template_url=self.reset_docs.metadata['url'], + )._to_pipeline_transport_request() + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + request.url = self._client.format_url(request.url, **path_format_arguments) - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [204]: @@ -98,8 +161,10 @@ async def reset( if cls: return cls(pipeline_response, None, {}) - reset.metadata = {'url': '/indexers(\'{indexerName}\')/search.reset'} # type: ignore + reset_docs.metadata = {'url': '/indexers(\'{indexerName}\')/search.resetdocs'} # type: ignore + + @distributed_trace_async async def run( self, indexer_name: str, @@ -122,33 +187,22 @@ async def run( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - accept = "application/json" - # Construct URL - url = self.run.metadata['url'] # type: ignore + request = build_run_request( + indexer_name=indexer_name, + x_ms_client_request_id=_x_ms_client_request_id, + template_url=self.run.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexerName': self._serialize.url("indexer_name", indexer_name, 'str'), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) + request.url = self._client.format_url(request.url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [202]: @@ -161,6 +215,8 @@ async def run( run.metadata = {'url': '/indexers(\'{indexerName}\')/search.run'} # type: ignore + + @distributed_trace_async async def create_or_update( self, indexer_name: str, @@ -201,48 +257,31 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - prefer = "return=representation" - api_version = "2021-04-30-Preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore + json = self._serialize.body(indexer, 'SearchIndexer') + + request = build_create_or_update_request( + indexer_name=indexer_name, + content_type=content_type, + x_ms_client_request_id=_x_ms_client_request_id, + if_match=if_match, + if_none_match=if_none_match, + disable_cache_reprocessing_change_detection=disable_cache_reprocessing_change_detection, + ignore_reset_requirements=ignore_reset_requirements, + json=json, + template_url=self.create_or_update.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexerName': self._serialize.url("indexer_name", indexer_name, 'str'), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if disable_cache_reprocessing_change_detection is not None: - query_parameters['disableCacheReprocessingChangeDetection'] = self._serialize.query("disable_cache_reprocessing_change_detection", disable_cache_reprocessing_change_detection, 'bool') - if ignore_reset_requirements is not None: - query_parameters['ignoreResetRequirements'] = self._serialize.query("ignore_reset_requirements", ignore_reset_requirements, 'bool') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - if if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - if if_none_match is not None: - header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') - header_parameters['Prefer'] = self._serialize.header("prefer", prefer, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(indexer, 'SearchIndexer') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = await self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -260,8 +299,11 @@ async def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized + create_or_update.metadata = {'url': '/indexers(\'{indexerName}\')'} # type: ignore + + @distributed_trace_async async def delete( self, indexer_name: str, @@ -292,37 +334,24 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - accept = "application/json" - # Construct URL - url = self.delete.metadata['url'] # type: ignore + request = build_delete_request( + indexer_name=indexer_name, + x_ms_client_request_id=_x_ms_client_request_id, + if_match=if_match, + if_none_match=if_none_match, + template_url=self.delete.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexerName': self._serialize.url("indexer_name", indexer_name, 'str'), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - if if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - if if_none_match is not None: - header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = await self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [204, 404]: @@ -335,6 +364,8 @@ async def delete( delete.metadata = {'url': '/indexers(\'{indexerName}\')'} # type: ignore + + @distributed_trace_async async def get( self, indexer_name: str, @@ -357,33 +388,22 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - accept = "application/json" - # Construct URL - url = self.get.metadata['url'] # type: ignore + request = build_get_request( + indexer_name=indexer_name, + x_ms_client_request_id=_x_ms_client_request_id, + template_url=self.get.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexerName': self._serialize.url("indexer_name", indexer_name, 'str'), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request.url = self._client.format_url(request.url, **path_format_arguments) - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: @@ -397,8 +417,11 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/indexers(\'{indexerName}\')'} # type: ignore + + @distributed_trace_async async def list( self, select: Optional[str] = None, @@ -423,34 +446,22 @@ async def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - accept = "application/json" - # Construct URL - url = self.list.metadata['url'] # type: ignore + request = build_list_request( + select=select, + x_ms_client_request_id=_x_ms_client_request_id, + template_url=self.list.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if select is not None: - query_parameters['$select'] = self._serialize.query("select", select, 'str') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = await self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: @@ -464,8 +475,11 @@ async def list( return cls(pipeline_response, deserialized, {}) return deserialized + list.metadata = {'url': '/indexers'} # type: ignore + + @distributed_trace_async async def create( self, indexer: "_models.SearchIndexer", @@ -488,37 +502,26 @@ async def create( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create.metadata['url'] # type: ignore + json = self._serialize.body(indexer, 'SearchIndexer') + + request = build_create_request( + content_type=content_type, + x_ms_client_request_id=_x_ms_client_request_id, + json=json, + template_url=self.create.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(indexer, 'SearchIndexer') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = await self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [201]: @@ -532,8 +535,11 @@ async def create( return cls(pipeline_response, deserialized, {}) return deserialized + create.metadata = {'url': '/indexers'} # type: ignore + + @distributed_trace_async async def get_status( self, indexer_name: str, @@ -556,33 +562,22 @@ async def get_status( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - accept = "application/json" - # Construct URL - url = self.get_status.metadata['url'] # type: ignore + request = build_get_status_request( + indexer_name=indexer_name, + x_ms_client_request_id=_x_ms_client_request_id, + template_url=self.get_status.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexerName': self._serialize.url("indexer_name", indexer_name, 'str'), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) + request.url = self._client.format_url(request.url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: @@ -596,4 +591,6 @@ async def get_status( return cls(pipeline_response, deserialized, {}) return deserialized + get_status.metadata = {'url': '/indexers(\'{indexerName}\')/search.status'} # type: ignore + diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_indexes_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_indexes_operations.py index 55cce44a9091..b392a4a7e928 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_indexes_operations.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_indexes_operations.py @@ -5,15 +5,20 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from ... import models as _models +from ...operations._indexes_operations import build_analyze_request, build_create_or_update_request, build_create_request, build_delete_request, build_get_request, build_get_statistics_request, build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -40,6 +45,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def create( self, index: "_models.SearchIndex", @@ -62,37 +68,26 @@ async def create( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create.metadata['url'] # type: ignore + json = self._serialize.body(index, 'SearchIndex') + + request = build_create_request( + content_type=content_type, + x_ms_client_request_id=_x_ms_client_request_id, + json=json, + template_url=self.create.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(index, 'SearchIndex') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = await self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [201]: @@ -106,8 +101,11 @@ async def create( return cls(pipeline_response, deserialized, {}) return deserialized + create.metadata = {'url': '/indexes'} # type: ignore + + @distributed_trace def list( self, select: Optional[str] = None, @@ -124,7 +122,8 @@ def list( :type request_options: ~azure.search.documents.indexes.models.RequestOptions :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ListIndexesResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.search.documents.indexes.models.ListIndexesResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.search.documents.indexes.models.ListIndexesResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ListIndexesResult"] @@ -132,46 +131,45 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore + _x_ms_client_request_id = None + if request_options is not None: + _x_ms_client_request_id = request_options.x_ms_client_request_id + + request = build_list_request( + select=select, + x_ms_client_request_id=_x_ms_client_request_id, + template_url=self.list.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if select is not None: - query_parameters['$select'] = self._serialize.query("select", select, 'str') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + request.url = self._client.format_url(request.url, **path_format_arguments) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] + _x_ms_client_request_id = None + if request_options is not None: + _x_ms_client_request_id = request_options.x_ms_client_request_id + + request = build_list_request( + select=select, + x_ms_client_request_id=_x_ms_client_request_id, + template_url=next_link, + )._to_pipeline_transport_request() + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + request.url = self._client.format_url(request.url, **path_format_arguments) + path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) - request = self._client.get(url, query_parameters, header_parameters) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ListIndexesResult', pipeline_response) + deserialized = self._deserialize("ListIndexesResult", pipeline_response) list_of_elem = deserialized.indexes if cls: list_of_elem = cls(list_of_elem) @@ -184,17 +182,19 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.SearchError, response) raise HttpResponseError(response=response, model=error) return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/indexes'} # type: ignore + @distributed_trace_async async def create_or_update( self, index_name: str, @@ -235,46 +235,30 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - prefer = "return=representation" - api_version = "2021-04-30-Preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore + json = self._serialize.body(index, 'SearchIndex') + + request = build_create_or_update_request( + index_name=index_name, + content_type=content_type, + allow_index_downtime=allow_index_downtime, + x_ms_client_request_id=_x_ms_client_request_id, + if_match=if_match, + if_none_match=if_none_match, + json=json, + template_url=self.create_or_update.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexName': self._serialize.url("index_name", index_name, 'str'), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if allow_index_downtime is not None: - query_parameters['allowIndexDowntime'] = self._serialize.query("allow_index_downtime", allow_index_downtime, 'bool') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - if if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - if if_none_match is not None: - header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') - header_parameters['Prefer'] = self._serialize.header("prefer", prefer, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(index, 'SearchIndex') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = await self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -292,8 +276,11 @@ async def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized + create_or_update.metadata = {'url': '/indexes(\'{indexName}\')'} # type: ignore + + @distributed_trace_async async def delete( self, index_name: str, @@ -326,37 +313,24 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - accept = "application/json" - # Construct URL - url = self.delete.metadata['url'] # type: ignore + request = build_delete_request( + index_name=index_name, + x_ms_client_request_id=_x_ms_client_request_id, + if_match=if_match, + if_none_match=if_none_match, + template_url=self.delete.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexName': self._serialize.url("index_name", index_name, 'str'), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - if if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - if if_none_match is not None: - header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = await self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [204, 404]: @@ -369,6 +343,8 @@ async def delete( delete.metadata = {'url': '/indexes(\'{indexName}\')'} # type: ignore + + @distributed_trace_async async def get( self, index_name: str, @@ -391,33 +367,22 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - accept = "application/json" - # Construct URL - url = self.get.metadata['url'] # type: ignore + request = build_get_request( + index_name=index_name, + x_ms_client_request_id=_x_ms_client_request_id, + template_url=self.get.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexName': self._serialize.url("index_name", index_name, 'str'), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) + request.url = self._client.format_url(request.url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: @@ -431,8 +396,11 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/indexes(\'{indexName}\')'} # type: ignore + + @distributed_trace_async async def get_statistics( self, index_name: str, @@ -455,33 +423,22 @@ async def get_statistics( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - accept = "application/json" - # Construct URL - url = self.get_statistics.metadata['url'] # type: ignore + request = build_get_statistics_request( + index_name=index_name, + x_ms_client_request_id=_x_ms_client_request_id, + template_url=self.get_statistics.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexName': self._serialize.url("index_name", index_name, 'str'), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) + request.url = self._client.format_url(request.url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: @@ -495,8 +452,11 @@ async def get_statistics( return cls(pipeline_response, deserialized, {}) return deserialized + get_statistics.metadata = {'url': '/indexes(\'{indexName}\')/search.stats'} # type: ignore + + @distributed_trace_async async def analyze( self, index_name: str, @@ -522,38 +482,27 @@ async def analyze( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.analyze.metadata['url'] # type: ignore + json = self._serialize.body(request, 'AnalyzeRequest') + + request = build_analyze_request( + index_name=index_name, + content_type=content_type, + x_ms_client_request_id=_x_ms_client_request_id, + json=json, + template_url=self.analyze.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexName': self._serialize.url("index_name", index_name, 'str'), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(request, 'AnalyzeRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = await self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: @@ -567,4 +516,6 @@ async def analyze( return cls(pipeline_response, deserialized, {}) return deserialized + analyze.metadata = {'url': '/indexes(\'{indexName}\')/search.analyze'} # type: ignore + diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_search_client_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_search_client_operations.py index 08508229fda0..259e7f045d3c 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_search_client_operations.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_search_client_operations.py @@ -5,20 +5,25 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async from ... import models as _models +from ...operations._search_client_operations import build_get_service_statistics_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] class SearchClientOperationsMixin: + @distributed_trace_async async def get_service_statistics( self, request_options: Optional["_models.RequestOptions"] = None, @@ -38,32 +43,21 @@ async def get_service_statistics( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - accept = "application/json" - # Construct URL - url = self.get_service_statistics.metadata['url'] # type: ignore + request = build_get_service_statistics_request( + x_ms_client_request_id=_x_ms_client_request_id, + template_url=self.get_service_statistics.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request.url = self._client.format_url(request.url, **path_format_arguments) - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: @@ -77,4 +71,6 @@ async def get_service_statistics( return cls(pipeline_response, deserialized, {}) return deserialized + get_service_statistics.metadata = {'url': '/servicestats'} # type: ignore + diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_skillsets_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_skillsets_operations.py index b210122b0551..23db88c2f37a 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_skillsets_operations.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_skillsets_operations.py @@ -5,14 +5,18 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async from ... import models as _models +from ...operations._skillsets_operations import build_create_or_update_request, build_create_request, build_delete_request, build_get_request, build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -39,6 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def create_or_update( self, skillset_name: str, @@ -80,48 +85,31 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - prefer = "return=representation" - api_version = "2021-04-30-Preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore + json = self._serialize.body(skillset, 'SearchIndexerSkillset') + + request = build_create_or_update_request( + skillset_name=skillset_name, + content_type=content_type, + x_ms_client_request_id=_x_ms_client_request_id, + if_match=if_match, + if_none_match=if_none_match, + disable_cache_reprocessing_change_detection=disable_cache_reprocessing_change_detection, + ignore_reset_requirements=ignore_reset_requirements, + json=json, + template_url=self.create_or_update.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'skillsetName': self._serialize.url("skillset_name", skillset_name, 'str'), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if disable_cache_reprocessing_change_detection is not None: - query_parameters['disableCacheReprocessingChangeDetection'] = self._serialize.query("disable_cache_reprocessing_change_detection", disable_cache_reprocessing_change_detection, 'bool') - if ignore_reset_requirements is not None: - query_parameters['ignoreResetRequirements'] = self._serialize.query("ignore_reset_requirements", ignore_reset_requirements, 'bool') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - if if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - if if_none_match is not None: - header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') - header_parameters['Prefer'] = self._serialize.header("prefer", prefer, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(skillset, 'SearchIndexerSkillset') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = await self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -139,8 +127,11 @@ async def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized + create_or_update.metadata = {'url': '/skillsets(\'{skillsetName}\')'} # type: ignore + + @distributed_trace_async async def delete( self, skillset_name: str, @@ -171,37 +162,24 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - accept = "application/json" - # Construct URL - url = self.delete.metadata['url'] # type: ignore + request = build_delete_request( + skillset_name=skillset_name, + x_ms_client_request_id=_x_ms_client_request_id, + if_match=if_match, + if_none_match=if_none_match, + template_url=self.delete.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'skillsetName': self._serialize.url("skillset_name", skillset_name, 'str'), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - if if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - if if_none_match is not None: - header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = await self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [204, 404]: @@ -214,6 +192,8 @@ async def delete( delete.metadata = {'url': '/skillsets(\'{skillsetName}\')'} # type: ignore + + @distributed_trace_async async def get( self, skillset_name: str, @@ -236,33 +216,22 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - accept = "application/json" - # Construct URL - url = self.get.metadata['url'] # type: ignore + request = build_get_request( + skillset_name=skillset_name, + x_ms_client_request_id=_x_ms_client_request_id, + template_url=self.get.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'skillsetName': self._serialize.url("skillset_name", skillset_name, 'str'), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request.url = self._client.format_url(request.url, **path_format_arguments) - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: @@ -276,8 +245,11 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/skillsets(\'{skillsetName}\')'} # type: ignore + + @distributed_trace_async async def list( self, select: Optional[str] = None, @@ -302,34 +274,22 @@ async def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - accept = "application/json" - # Construct URL - url = self.list.metadata['url'] # type: ignore + request = build_list_request( + select=select, + x_ms_client_request_id=_x_ms_client_request_id, + template_url=self.list.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if select is not None: - query_parameters['$select'] = self._serialize.query("select", select, 'str') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = await self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: @@ -343,8 +303,11 @@ async def list( return cls(pipeline_response, deserialized, {}) return deserialized + list.metadata = {'url': '/skillsets'} # type: ignore + + @distributed_trace_async async def create( self, skillset: "_models.SearchIndexerSkillset", @@ -367,37 +330,26 @@ async def create( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create.metadata['url'] # type: ignore + json = self._serialize.body(skillset, 'SearchIndexerSkillset') + + request = build_create_request( + content_type=content_type, + x_ms_client_request_id=_x_ms_client_request_id, + json=json, + template_url=self.create.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(skillset, 'SearchIndexerSkillset') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = await self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [201]: @@ -411,4 +363,6 @@ async def create( return cls(pipeline_response, deserialized, {}) return deserialized + create.metadata = {'url': '/skillsets'} # type: ignore + diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_synonym_maps_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_synonym_maps_operations.py index 6d1827258fcf..78036d8873d1 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_synonym_maps_operations.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/aio/operations/_synonym_maps_operations.py @@ -5,14 +5,18 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async from ... import models as _models +from ...operations._synonym_maps_operations import build_create_or_update_request, build_create_request, build_delete_request, build_get_request, build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -39,6 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def create_or_update( self, synonym_map_name: str, @@ -72,44 +77,29 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - prefer = "return=representation" - api_version = "2021-04-30-Preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore + json = self._serialize.body(synonym_map, 'SynonymMap') + + request = build_create_or_update_request( + synonym_map_name=synonym_map_name, + content_type=content_type, + x_ms_client_request_id=_x_ms_client_request_id, + if_match=if_match, + if_none_match=if_none_match, + json=json, + template_url=self.create_or_update.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'synonymMapName': self._serialize.url("synonym_map_name", synonym_map_name, 'str'), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - if if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - if if_none_match is not None: - header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') - header_parameters['Prefer'] = self._serialize.header("prefer", prefer, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(synonym_map, 'SynonymMap') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = await self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -127,8 +117,11 @@ async def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized + create_or_update.metadata = {'url': '/synonymmaps(\'{synonymMapName}\')'} # type: ignore + + @distributed_trace_async async def delete( self, synonym_map_name: str, @@ -159,37 +152,24 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - accept = "application/json" - # Construct URL - url = self.delete.metadata['url'] # type: ignore + request = build_delete_request( + synonym_map_name=synonym_map_name, + x_ms_client_request_id=_x_ms_client_request_id, + if_match=if_match, + if_none_match=if_none_match, + template_url=self.delete.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'synonymMapName': self._serialize.url("synonym_map_name", synonym_map_name, 'str'), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - if if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - if if_none_match is not None: - header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = await self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [204, 404]: @@ -202,6 +182,8 @@ async def delete( delete.metadata = {'url': '/synonymmaps(\'{synonymMapName}\')'} # type: ignore + + @distributed_trace_async async def get( self, synonym_map_name: str, @@ -224,33 +206,22 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - accept = "application/json" - # Construct URL - url = self.get.metadata['url'] # type: ignore + request = build_get_request( + synonym_map_name=synonym_map_name, + x_ms_client_request_id=_x_ms_client_request_id, + template_url=self.get.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'synonymMapName': self._serialize.url("synonym_map_name", synonym_map_name, 'str'), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request.url = self._client.format_url(request.url, **path_format_arguments) - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: @@ -264,8 +235,11 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/synonymmaps(\'{synonymMapName}\')'} # type: ignore + + @distributed_trace_async async def list( self, select: Optional[str] = None, @@ -290,34 +264,22 @@ async def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - accept = "application/json" - # Construct URL - url = self.list.metadata['url'] # type: ignore + request = build_list_request( + select=select, + x_ms_client_request_id=_x_ms_client_request_id, + template_url=self.list.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if select is not None: - query_parameters['$select'] = self._serialize.query("select", select, 'str') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = await self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: @@ -331,8 +293,11 @@ async def list( return cls(pipeline_response, deserialized, {}) return deserialized + list.metadata = {'url': '/synonymmaps'} # type: ignore + + @distributed_trace_async async def create( self, synonym_map: "_models.SynonymMap", @@ -355,37 +320,26 @@ async def create( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create.metadata['url'] # type: ignore + json = self._serialize.body(synonym_map, 'SynonymMap') + + request = build_create_request( + content_type=content_type, + x_ms_client_request_id=_x_ms_client_request_id, + json=json, + template_url=self.create.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(synonym_map, 'SynonymMap') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = await self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [201]: @@ -399,4 +353,6 @@ async def create( return cls(pipeline_response, deserialized, {}) return deserialized + create.metadata = {'url': '/synonymmaps'} # type: ignore + diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/models/__init__.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/models/__init__.py index 5e744c700cb1..c358e0dbef5a 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/models/__init__.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/models/__init__.py @@ -49,6 +49,7 @@ from ._models_py3 import GetIndexStatisticsResult from ._models_py3 import HighWaterMarkChangeDetectionPolicy from ._models_py3 import ImageAnalysisSkill + from ._models_py3 import IndexerCurrentState from ._models_py3 import IndexerExecutionResult from ._models_py3 import IndexingParameters from ._models_py3 import IndexingParametersConfiguration @@ -86,6 +87,7 @@ from ._models_py3 import OutputFieldMappingEntry from ._models_py3 import PIIDetectionSkill from ._models_py3 import PathHierarchyTokenizerV2 + from ._models_py3 import Paths1Cj7DxmIndexersIndexernameSearchResetdocsPostRequestbodyContentApplicationJsonSchema from ._models_py3 import PatternAnalyzer from ._models_py3 import PatternCaptureTokenFilter from ._models_py3 import PatternReplaceCharFilter @@ -192,6 +194,7 @@ from ._models import GetIndexStatisticsResult # type: ignore from ._models import HighWaterMarkChangeDetectionPolicy # type: ignore from ._models import ImageAnalysisSkill # type: ignore + from ._models import IndexerCurrentState # type: ignore from ._models import IndexerExecutionResult # type: ignore from ._models import IndexingParameters # type: ignore from ._models import IndexingParametersConfiguration # type: ignore @@ -229,6 +232,7 @@ from ._models import OutputFieldMappingEntry # type: ignore from ._models import PIIDetectionSkill # type: ignore from ._models import PathHierarchyTokenizerV2 # type: ignore + from ._models import Paths1Cj7DxmIndexersIndexernameSearchResetdocsPostRequestbodyContentApplicationJsonSchema # type: ignore from ._models import PatternAnalyzer # type: ignore from ._models import PatternCaptureTokenFilter # type: ignore from ._models import PatternReplaceCharFilter # type: ignore @@ -308,7 +312,9 @@ ImageDetail, IndexerExecutionEnvironment, IndexerExecutionStatus, + IndexerExecutionStatusDetail, IndexerStatus, + IndexingMode, KeyPhraseExtractionSkillLanguage, LexicalAnalyzerName, LexicalNormalizerName, @@ -379,6 +385,7 @@ 'GetIndexStatisticsResult', 'HighWaterMarkChangeDetectionPolicy', 'ImageAnalysisSkill', + 'IndexerCurrentState', 'IndexerExecutionResult', 'IndexingParameters', 'IndexingParametersConfiguration', @@ -416,6 +423,7 @@ 'OutputFieldMappingEntry', 'PIIDetectionSkill', 'PathHierarchyTokenizerV2', + 'Paths1Cj7DxmIndexersIndexernameSearchResetdocsPostRequestbodyContentApplicationJsonSchema', 'PatternAnalyzer', 'PatternCaptureTokenFilter', 'PatternReplaceCharFilter', @@ -493,7 +501,9 @@ 'ImageDetail', 'IndexerExecutionEnvironment', 'IndexerExecutionStatus', + 'IndexerExecutionStatusDetail', 'IndexerStatus', + 'IndexingMode', 'KeyPhraseExtractionSkillLanguage', 'LexicalAnalyzerName', 'LexicalNormalizerName', diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/models/_models.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/models/_models.py index 158157428cc7..a4a0654cb0cc 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/models/_models.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/models/_models.py @@ -60,9 +60,9 @@ class AnalyzeRequest(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param text: Required. The text to break into tokens. - :type text: str - :param analyzer: The name of the analyzer to use to break the given text. Possible values + :keyword text: Required. The text to break into tokens. + :paramtype text: str + :keyword analyzer: The name of the analyzer to use to break the given text. Possible values include: "ar.microsoft", "ar.lucene", "hy.lucene", "bn.microsoft", "eu.lucene", "bg.microsoft", "bg.lucene", "ca.microsoft", "ca.lucene", "zh-Hans.microsoft", "zh-Hans.lucene", "zh-Hant.microsoft", "zh-Hant.lucene", "hr.microsoft", "cs.microsoft", "cs.lucene", @@ -80,19 +80,20 @@ class AnalyzeRequest(msrest.serialization.Model): "th.lucene", "tr.microsoft", "tr.lucene", "uk.microsoft", "ur.microsoft", "vi.microsoft", "standard.lucene", "standardasciifolding.lucene", "keyword", "pattern", "simple", "stop", "whitespace". - :type analyzer: str or ~azure.search.documents.indexes.models.LexicalAnalyzerName - :param tokenizer: The name of the tokenizer to use to break the given text. Possible values + :paramtype analyzer: str or ~azure.search.documents.indexes.models.LexicalAnalyzerName + :keyword tokenizer: The name of the tokenizer to use to break the given text. Possible values include: "classic", "edgeNGram", "keyword_v2", "letter", "lowercase", "microsoft_language_tokenizer", "microsoft_language_stemming_tokenizer", "nGram", "path_hierarchy_v2", "pattern", "standard_v2", "uax_url_email", "whitespace". - :type tokenizer: str or ~azure.search.documents.indexes.models.LexicalTokenizerName - :param normalizer: The name of the normalizer to use to normalize the given text. Possible + :paramtype tokenizer: str or ~azure.search.documents.indexes.models.LexicalTokenizerName + :keyword normalizer: The name of the normalizer to use to normalize the given text. Possible values include: "asciifolding", "elision", "lowercase", "standard", "uppercase". - :type normalizer: str or ~azure.search.documents.indexes.models.LexicalNormalizerName - :param token_filters: An optional list of token filters to use when breaking the given text. - :type token_filters: list[str or ~azure.search.documents.indexes.models.TokenFilterName] - :param char_filters: An optional list of character filters to use when breaking the given text. - :type char_filters: list[str or ~azure.search.documents.indexes.models.CharFilterName] + :paramtype normalizer: str or ~azure.search.documents.indexes.models.LexicalNormalizerName + :keyword token_filters: An optional list of token filters to use when breaking the given text. + :paramtype token_filters: list[str or ~azure.search.documents.indexes.models.TokenFilterName] + :keyword char_filters: An optional list of character filters to use when breaking the given + text. + :paramtype char_filters: list[str or ~azure.search.documents.indexes.models.CharFilterName] """ _validation = { @@ -126,8 +127,9 @@ class AnalyzeResult(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param tokens: Required. The list of tokens returned by the analyzer specified in the request. - :type tokens: list[~azure.search.documents.indexes.models.AnalyzedTokenInfo] + :keyword tokens: Required. The list of tokens returned by the analyzer specified in the + request. + :paramtype tokens: list[~azure.search.documents.indexes.models.AnalyzedTokenInfo] """ _validation = { @@ -154,13 +156,13 @@ class TokenFilter(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled + :keyword odata_type: Required. Identifies the concrete type of the token filter.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, + :paramtype odata_type: str + :keyword name: Required. The name of the token filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str + :paramtype name: str """ _validation = { @@ -191,16 +193,16 @@ class AsciiFoldingTokenFilter(TokenFilter): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled + :keyword odata_type: Required. Identifies the concrete type of the token filter.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, + :paramtype odata_type: str + :keyword name: Required. The name of the token filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str - :param preserve_original: A value indicating whether the original token will be kept. Default + :paramtype name: str + :keyword preserve_original: A value indicating whether the original token will be kept. Default is false. - :type preserve_original: bool + :paramtype preserve_original: bool """ _validation = { @@ -228,12 +230,12 @@ class AzureActiveDirectoryApplicationCredentials(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param application_id: Required. An AAD Application ID that was granted the required access + :keyword application_id: Required. An AAD Application ID that was granted the required access permissions to the Azure Key Vault that is to be used when encrypting your data at rest. The Application ID should not be confused with the Object ID for your AAD Application. - :type application_id: str - :param application_secret: The authentication key of the specified AAD application. - :type application_secret: str + :paramtype application_id: str + :keyword application_secret: The authentication key of the specified AAD application. + :paramtype application_secret: str """ _validation = { @@ -262,8 +264,8 @@ class Similarity(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Constant filled by server. - :type odata_type: str + :keyword odata_type: Required. Constant filled by server. + :paramtype odata_type: str """ _validation = { @@ -291,16 +293,16 @@ class BM25Similarity(Similarity): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Constant filled by server. - :type odata_type: str - :param k1: This property controls the scaling function between the term frequency of each + :keyword odata_type: Required. Constant filled by server. + :paramtype odata_type: str + :keyword k1: This property controls the scaling function between the term frequency of each matching terms and the final relevance score of a document-query pair. By default, a value of 1.2 is used. A value of 0.0 means the score does not scale with an increase in term frequency. - :type k1: float - :param b: This property controls how the length of a document affects the relevance score. By + :paramtype k1: float + :keyword b: This property controls how the length of a document affects the relevance score. By default, a value of 0.75 is used. A value of 0.0 means no length normalization is applied, while a value of 1.0 means the score is fully normalized by the length of the document. - :type b: float + :paramtype b: float """ _validation = { @@ -331,13 +333,13 @@ class CharFilter(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the char filter.Constant filled by - server. - :type odata_type: str - :param name: Required. The name of the char filter. It must only contain letters, digits, + :keyword odata_type: Required. Identifies the concrete type of the char filter.Constant filled + by server. + :paramtype odata_type: str + :keyword name: Required. The name of the char filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str + :paramtype name: str """ _validation = { @@ -368,19 +370,19 @@ class CjkBigramTokenFilter(TokenFilter): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled + :keyword odata_type: Required. Identifies the concrete type of the token filter.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, + :paramtype odata_type: str + :keyword name: Required. The name of the token filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str - :param ignore_scripts: The scripts to ignore. - :type ignore_scripts: list[str or + :paramtype name: str + :keyword ignore_scripts: The scripts to ignore. + :paramtype ignore_scripts: list[str or ~azure.search.documents.indexes.models.CjkBigramTokenFilterScripts] - :param output_unigrams: A value indicating whether to output both unigrams and bigrams (if + :keyword output_unigrams: A value indicating whether to output both unigrams and bigrams (if true), or just bigrams (if false). Default is false. - :type output_unigrams: bool + :paramtype output_unigrams: bool """ _validation = { @@ -410,8 +412,8 @@ class ClassicSimilarity(Similarity): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Constant filled by server. - :type odata_type: str + :keyword odata_type: Required. Constant filled by server. + :paramtype odata_type: str """ _validation = { @@ -438,13 +440,13 @@ class LexicalTokenizer(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the tokenizer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str + :paramtype odata_type: str + :keyword name: Required. The name of the tokenizer. It must only contain letters, digits, + spaces, dashes or underscores, can only start and end with alphanumeric characters, and is + limited to 128 characters. + :paramtype name: str """ _validation = { @@ -475,16 +477,16 @@ class ClassicTokenizer(LexicalTokenizer): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the tokenizer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param max_token_length: The maximum token length. Default is 255. Tokens longer than the + :paramtype odata_type: str + :keyword name: Required. The name of the tokenizer. It must only contain letters, digits, + spaces, dashes or underscores, can only start and end with alphanumeric characters, and is + limited to 128 characters. + :paramtype name: str + :keyword max_token_length: The maximum token length. Default is 255. Tokens longer than the maximum length are split. The maximum token length that can be used is 300 characters. - :type max_token_length: int + :paramtype max_token_length: int """ _validation = { @@ -516,11 +518,11 @@ class CognitiveServicesAccount(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the cognitive service resource + :keyword odata_type: Required. Identifies the concrete type of the cognitive service resource attached to a skillset.Constant filled by server. - :type odata_type: str - :param description: Description of the cognitive service resource attached to a skillset. - :type description: str + :paramtype odata_type: str + :keyword description: Description of the cognitive service resource attached to a skillset. + :paramtype description: str """ _validation = { @@ -550,14 +552,14 @@ class CognitiveServicesAccountKey(CognitiveServicesAccount): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the cognitive service resource + :keyword odata_type: Required. Identifies the concrete type of the cognitive service resource attached to a skillset.Constant filled by server. - :type odata_type: str - :param description: Description of the cognitive service resource attached to a skillset. - :type description: str - :param key: Required. The key used to provision the cognitive service resource attached to a + :paramtype odata_type: str + :keyword description: Description of the cognitive service resource attached to a skillset. + :paramtype description: str + :keyword key: Required. The key used to provision the cognitive service resource attached to a skillset. - :type key: str + :paramtype key: str """ _validation = { @@ -585,22 +587,22 @@ class CommonGramTokenFilter(TokenFilter): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled + :keyword odata_type: Required. Identifies the concrete type of the token filter.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, + :paramtype odata_type: str + :keyword name: Required. The name of the token filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str - :param common_words: Required. The set of common words. - :type common_words: list[str] - :param ignore_case: A value indicating whether common words matching will be case insensitive. - Default is false. - :type ignore_case: bool - :param use_query_mode: A value that indicates whether the token filter is in query mode. When + :paramtype name: str + :keyword common_words: Required. The set of common words. + :paramtype common_words: list[str] + :keyword ignore_case: A value indicating whether common words matching will be case + insensitive. Default is false. + :paramtype ignore_case: bool + :keyword use_query_mode: A value that indicates whether the token filter is in query mode. When in query mode, the token filter generates bigrams and then removes common words and single terms followed by a common word. Default is false. - :type use_query_mode: bool + :paramtype use_query_mode: bool """ _validation = { @@ -636,25 +638,26 @@ class SearchIndexerSkill(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the skill.Constant filled by server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill + :paramtype odata_type: str + :keyword name: The name of the skill which uniquely identifies it within the skillset. A skill with no name defined will be given a default name of its 1-based index in the skills array, prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] + :paramtype name: str + :keyword description: The description of the skill which describes the inputs, outputs, and + usage of the skill. + :paramtype description: str + :keyword context: Represents the level at which operations take place, such as the document + root or document content (for example, /document or /document/content). The default is + /document. + :paramtype context: str + :keyword inputs: Required. Inputs of the skills could be a column in the source data set, or + the output of an upstream skill. + :paramtype inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] + :keyword outputs: Required. The output of a skill is either a field in a search index, or a + value that can be consumed as an input by another skill. + :paramtype outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] """ _validation = { @@ -694,25 +697,26 @@ class ConditionalSkill(SearchIndexerSkill): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the skill.Constant filled by server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill + :paramtype odata_type: str + :keyword name: The name of the skill which uniquely identifies it within the skillset. A skill with no name defined will be given a default name of its 1-based index in the skills array, prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] + :paramtype name: str + :keyword description: The description of the skill which describes the inputs, outputs, and + usage of the skill. + :paramtype description: str + :keyword context: Represents the level at which operations take place, such as the document + root or document content (for example, /document or /document/content). The default is + /document. + :paramtype context: str + :keyword inputs: Required. Inputs of the skills could be a column in the source data set, or + the output of an upstream skill. + :paramtype inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] + :keyword outputs: Required. The output of a skill is either a field in a search index, or a + value that can be consumed as an input by another skill. + :paramtype outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] """ _validation = { @@ -743,14 +747,14 @@ class CorsOptions(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param allowed_origins: Required. The list of origins from which JavaScript code will be + :keyword allowed_origins: Required. The list of origins from which JavaScript code will be granted access to your index. Can contain a list of hosts of the form {protocol}://{fully-qualified-domain-name}[:{port#}], or a single '*' to allow all origins (not recommended). - :type allowed_origins: list[str] - :param max_age_in_seconds: The duration for which browsers should cache CORS preflight + :paramtype allowed_origins: list[str] + :keyword max_age_in_seconds: The duration for which browsers should cache CORS preflight responses. Defaults to 5 minutes. - :type max_age_in_seconds: long + :paramtype max_age_in_seconds: long """ _validation = { @@ -779,13 +783,13 @@ class LexicalAnalyzer(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the analyzer.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the analyzer.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the analyzer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str + :paramtype odata_type: str + :keyword name: Required. The name of the analyzer. It must only contain letters, digits, + spaces, dashes or underscores, can only start and end with alphanumeric characters, and is + limited to 128 characters. + :paramtype name: str """ _validation = { @@ -816,27 +820,27 @@ class CustomAnalyzer(LexicalAnalyzer): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the analyzer.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the analyzer.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the analyzer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param tokenizer: Required. The name of the tokenizer to use to divide continuous text into a + :paramtype odata_type: str + :keyword name: Required. The name of the analyzer. It must only contain letters, digits, + spaces, dashes or underscores, can only start and end with alphanumeric characters, and is + limited to 128 characters. + :paramtype name: str + :keyword tokenizer: Required. The name of the tokenizer to use to divide continuous text into a sequence of tokens, such as breaking a sentence into words. Possible values include: "classic", "edgeNGram", "keyword_v2", "letter", "lowercase", "microsoft_language_tokenizer", "microsoft_language_stemming_tokenizer", "nGram", "path_hierarchy_v2", "pattern", "standard_v2", "uax_url_email", "whitespace". - :type tokenizer: str or ~azure.search.documents.indexes.models.LexicalTokenizerName - :param token_filters: A list of token filters used to filter out or modify the tokens generated - by a tokenizer. For example, you can specify a lowercase filter that converts all characters to - lowercase. The filters are run in the order in which they are listed. - :type token_filters: list[str or ~azure.search.documents.indexes.models.TokenFilterName] - :param char_filters: A list of character filters used to prepare input text before it is + :paramtype tokenizer: str or ~azure.search.documents.indexes.models.LexicalTokenizerName + :keyword token_filters: A list of token filters used to filter out or modify the tokens + generated by a tokenizer. For example, you can specify a lowercase filter that converts all + characters to lowercase. The filters are run in the order in which they are listed. + :paramtype token_filters: list[str or ~azure.search.documents.indexes.models.TokenFilterName] + :keyword char_filters: A list of character filters used to prepare input text before it is processed by the tokenizer. For instance, they can replace certain characters or symbols. The filters are run in the order in which they are listed. - :type char_filters: list[str or ~azure.search.documents.indexes.models.CharFilterName] + :paramtype char_filters: list[str or ~azure.search.documents.indexes.models.CharFilterName] """ _validation = { @@ -869,51 +873,51 @@ class CustomEntity(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The top-level entity descriptor. Matches in the skill output will be + :keyword name: Required. The top-level entity descriptor. Matches in the skill output will be grouped by this name, and it should represent the "normalized" form of the text being found. - :type name: str - :param description: This field can be used as a passthrough for custom metadata about the + :paramtype name: str + :keyword description: This field can be used as a passthrough for custom metadata about the matched text(s). The value of this field will appear with every match of its entity in the skill output. - :type description: str - :param type: This field can be used as a passthrough for custom metadata about the matched + :paramtype description: str + :keyword type: This field can be used as a passthrough for custom metadata about the matched text(s). The value of this field will appear with every match of its entity in the skill output. - :type type: str - :param subtype: This field can be used as a passthrough for custom metadata about the matched + :paramtype type: str + :keyword subtype: This field can be used as a passthrough for custom metadata about the matched text(s). The value of this field will appear with every match of its entity in the skill output. - :type subtype: str - :param id: This field can be used as a passthrough for custom metadata about the matched + :paramtype subtype: str + :keyword id: This field can be used as a passthrough for custom metadata about the matched text(s). The value of this field will appear with every match of its entity in the skill output. - :type id: str - :param case_sensitive: Defaults to false. Boolean value denoting whether comparisons with the + :paramtype id: str + :keyword case_sensitive: Defaults to false. Boolean value denoting whether comparisons with the entity name should be sensitive to character casing. Sample case insensitive matches of "Microsoft" could be: microsoft, microSoft, MICROSOFT. - :type case_sensitive: bool - :param accent_sensitive: Defaults to false. Boolean value denoting whether comparisons with the - entity name should be sensitive to accent. - :type accent_sensitive: bool - :param fuzzy_edit_distance: Defaults to 0. Maximum value of 5. Denotes the acceptable number of - divergent characters that would still constitute a match with the entity name. The smallest + :paramtype case_sensitive: bool + :keyword accent_sensitive: Defaults to false. Boolean value denoting whether comparisons with + the entity name should be sensitive to accent. + :paramtype accent_sensitive: bool + :keyword fuzzy_edit_distance: Defaults to 0. Maximum value of 5. Denotes the acceptable number + of divergent characters that would still constitute a match with the entity name. The smallest possible fuzziness for any given match is returned. For instance, if the edit distance is set to 3, "Windows10" would still match "Windows", "Windows10" and "Windows 7". When case sensitivity is set to false, case differences do NOT count towards fuzziness tolerance, but otherwise do. - :type fuzzy_edit_distance: int - :param default_case_sensitive: Changes the default case sensitivity value for this entity. It + :paramtype fuzzy_edit_distance: int + :keyword default_case_sensitive: Changes the default case sensitivity value for this entity. It be used to change the default value of all aliases caseSensitive values. - :type default_case_sensitive: bool - :param default_accent_sensitive: Changes the default accent sensitivity value for this entity. - It be used to change the default value of all aliases accentSensitive values. - :type default_accent_sensitive: bool - :param default_fuzzy_edit_distance: Changes the default fuzzy edit distance value for this + :paramtype default_case_sensitive: bool + :keyword default_accent_sensitive: Changes the default accent sensitivity value for this + entity. It be used to change the default value of all aliases accentSensitive values. + :paramtype default_accent_sensitive: bool + :keyword default_fuzzy_edit_distance: Changes the default fuzzy edit distance value for this entity. It can be used to change the default value of all aliases fuzzyEditDistance values. - :type default_fuzzy_edit_distance: int - :param aliases: An array of complex objects that can be used to specify alternative spellings + :paramtype default_fuzzy_edit_distance: int + :keyword aliases: An array of complex objects that can be used to specify alternative spellings or synonyms to the root entity name. - :type aliases: list[~azure.search.documents.indexes.models.CustomEntityAlias] + :paramtype aliases: list[~azure.search.documents.indexes.models.CustomEntityAlias] """ _validation = { @@ -959,14 +963,14 @@ class CustomEntityAlias(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param text: Required. The text of the alias. - :type text: str - :param case_sensitive: Determine if the alias is case sensitive. - :type case_sensitive: bool - :param accent_sensitive: Determine if the alias is accent sensitive. - :type accent_sensitive: bool - :param fuzzy_edit_distance: Determine the fuzzy edit distance of the alias. - :type fuzzy_edit_distance: int + :keyword text: Required. The text of the alias. + :paramtype text: str + :keyword case_sensitive: Determine if the alias is case sensitive. + :paramtype case_sensitive: bool + :keyword accent_sensitive: Determine if the alias is accent sensitive. + :paramtype accent_sensitive: bool + :keyword fuzzy_edit_distance: Determine the fuzzy edit distance of the alias. + :paramtype fuzzy_edit_distance: int """ _validation = { @@ -996,45 +1000,47 @@ class CustomEntityLookupSkill(SearchIndexerSkill): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the skill.Constant filled by server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill + :paramtype odata_type: str + :keyword name: The name of the skill which uniquely identifies it within the skillset. A skill with no name defined will be given a default name of its 1-based index in the skills array, prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] - :param default_language_code: A value indicating which language code to use. Default is en. + :paramtype name: str + :keyword description: The description of the skill which describes the inputs, outputs, and + usage of the skill. + :paramtype description: str + :keyword context: Represents the level at which operations take place, such as the document + root or document content (for example, /document or /document/content). The default is + /document. + :paramtype context: str + :keyword inputs: Required. Inputs of the skills could be a column in the source data set, or + the output of an upstream skill. + :paramtype inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] + :keyword outputs: Required. The output of a skill is either a field in a search index, or a + value that can be consumed as an input by another skill. + :paramtype outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] + :keyword default_language_code: A value indicating which language code to use. Default is en. Possible values include: "da", "de", "en", "es", "fi", "fr", "it", "ko", "pt". - :type default_language_code: str or + :paramtype default_language_code: str or ~azure.search.documents.indexes.models.CustomEntityLookupSkillLanguage - :param entities_definition_uri: Path to a JSON or CSV file containing all the target text to + :keyword entities_definition_uri: Path to a JSON or CSV file containing all the target text to match against. This entity definition is read at the beginning of an indexer run. Any updates to this file during an indexer run will not take effect until subsequent runs. This config must be accessible over HTTPS. - :type entities_definition_uri: str - :param inline_entities_definition: The inline CustomEntity definition. - :type inline_entities_definition: list[~azure.search.documents.indexes.models.CustomEntity] - :param global_default_case_sensitive: A global flag for CaseSensitive. If CaseSensitive is not - set in CustomEntity, this value will be the default value. - :type global_default_case_sensitive: bool - :param global_default_accent_sensitive: A global flag for AccentSensitive. If AccentSensitive + :paramtype entities_definition_uri: str + :keyword inline_entities_definition: The inline CustomEntity definition. + :paramtype inline_entities_definition: + list[~azure.search.documents.indexes.models.CustomEntity] + :keyword global_default_case_sensitive: A global flag for CaseSensitive. If CaseSensitive is + not set in CustomEntity, this value will be the default value. + :paramtype global_default_case_sensitive: bool + :keyword global_default_accent_sensitive: A global flag for AccentSensitive. If AccentSensitive is not set in CustomEntity, this value will be the default value. - :type global_default_accent_sensitive: bool - :param global_default_fuzzy_edit_distance: A global flag for FuzzyEditDistance. If + :paramtype global_default_accent_sensitive: bool + :keyword global_default_fuzzy_edit_distance: A global flag for FuzzyEditDistance. If FuzzyEditDistance is not set in CustomEntity, this value will be the default value. - :type global_default_fuzzy_edit_distance: int + :paramtype global_default_fuzzy_edit_distance: int """ _validation = { @@ -1077,13 +1083,13 @@ class LexicalNormalizer(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the normalizer. - :type odata_type: str - :param name: Required. The name of the normalizer. It must only contain letters, digits, + :keyword odata_type: Required. Identifies the concrete type of the normalizer. + :paramtype odata_type: str + :keyword name: Required. The name of the normalizer. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. It cannot end in '.microsoft' nor '.lucene', nor be named 'asciifolding', 'standard', 'lowercase', 'uppercase', or 'elision'. - :type name: str + :paramtype name: str """ _validation = { @@ -1110,21 +1116,21 @@ class CustomNormalizer(LexicalNormalizer): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the normalizer. - :type odata_type: str - :param name: Required. The name of the normalizer. It must only contain letters, digits, + :keyword odata_type: Required. Identifies the concrete type of the normalizer. + :paramtype odata_type: str + :keyword name: Required. The name of the normalizer. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. It cannot end in '.microsoft' nor '.lucene', nor be named 'asciifolding', 'standard', 'lowercase', 'uppercase', or 'elision'. - :type name: str - :param token_filters: A list of token filters used to filter out or modify the input token. For - example, you can specify a lowercase filter that converts all characters to lowercase. The + :paramtype name: str + :keyword token_filters: A list of token filters used to filter out or modify the input token. + For example, you can specify a lowercase filter that converts all characters to lowercase. The filters are run in the order in which they are listed. - :type token_filters: list[str or ~azure.search.documents.indexes.models.TokenFilterName] - :param char_filters: A list of character filters used to prepare input text before it is + :paramtype token_filters: list[str or ~azure.search.documents.indexes.models.TokenFilterName] + :keyword char_filters: A list of character filters used to prepare input text before it is processed. For instance, they can replace certain characters or symbols. The filters are run in the order in which they are listed. - :type char_filters: list[str or ~azure.search.documents.indexes.models.CharFilterName] + :paramtype char_filters: list[str or ~azure.search.documents.indexes.models.CharFilterName] """ _validation = { @@ -1156,9 +1162,9 @@ class DataChangeDetectionPolicy(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the data change detection + :keyword odata_type: Required. Identifies the concrete type of the data change detection policy.Constant filled by server. - :type odata_type: str + :paramtype odata_type: str """ _validation = { @@ -1189,9 +1195,9 @@ class DataDeletionDetectionPolicy(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the data deletion detection + :keyword odata_type: Required. Identifies the concrete type of the data deletion detection policy.Constant filled by server. - :type odata_type: str + :paramtype odata_type: str """ _validation = { @@ -1217,9 +1223,9 @@ def __init__( class DataSourceCredentials(msrest.serialization.Model): """Represents credentials that can be used to connect to a datasource. - :param connection_string: The connection string for the datasource. Set to + :keyword connection_string: The connection string for the datasource. Set to ':code:``' if you do not want the connection string updated. - :type connection_string: str + :paramtype connection_string: str """ _attribute_map = { @@ -1239,11 +1245,11 @@ class DefaultCognitiveServicesAccount(CognitiveServicesAccount): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the cognitive service resource + :keyword odata_type: Required. Identifies the concrete type of the cognitive service resource attached to a skillset.Constant filled by server. - :type odata_type: str - :param description: Description of the cognitive service resource attached to a skillset. - :type description: str + :paramtype odata_type: str + :keyword description: Description of the cognitive service resource attached to a skillset. + :paramtype description: str """ _validation = { @@ -1268,27 +1274,27 @@ class DictionaryDecompounderTokenFilter(TokenFilter): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled + :keyword odata_type: Required. Identifies the concrete type of the token filter.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, + :paramtype odata_type: str + :keyword name: Required. The name of the token filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str - :param word_list: Required. The list of words to match against. - :type word_list: list[str] - :param min_word_size: The minimum word size. Only words longer than this get processed. Default - is 5. Maximum is 300. - :type min_word_size: int - :param min_subword_size: The minimum subword size. Only subwords longer than this are + :paramtype name: str + :keyword word_list: Required. The list of words to match against. + :paramtype word_list: list[str] + :keyword min_word_size: The minimum word size. Only words longer than this get processed. + Default is 5. Maximum is 300. + :paramtype min_word_size: int + :keyword min_subword_size: The minimum subword size. Only subwords longer than this are outputted. Default is 2. Maximum is 300. - :type min_subword_size: int - :param max_subword_size: The maximum subword size. Only subwords shorter than this are + :paramtype min_subword_size: int + :keyword max_subword_size: The maximum subword size. Only subwords shorter than this are outputted. Default is 15. Maximum is 300. - :type max_subword_size: int - :param only_longest_match: A value indicating whether to add only the longest matching subword - to the output. Default is false. - :type only_longest_match: bool + :paramtype max_subword_size: int + :keyword only_longest_match: A value indicating whether to add only the longest matching + subword to the output. Default is false. + :paramtype only_longest_match: bool """ _validation = { @@ -1331,18 +1337,19 @@ class ScoringFunction(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param type: Required. Indicates the type of function to use. Valid values include magnitude, + :keyword type: Required. Indicates the type of function to use. Valid values include magnitude, freshness, distance, and tag. The function type must be lower case.Constant filled by server. - :type type: str - :param field_name: Required. The name of the field used as input to the scoring function. - :type field_name: str - :param boost: Required. A multiplier for the raw score. Must be a positive number not equal to - 1.0. - :type boost: float - :param interpolation: A value indicating how boosting will be interpolated across document + :paramtype type: str + :keyword field_name: Required. The name of the field used as input to the scoring function. + :paramtype field_name: str + :keyword boost: Required. A multiplier for the raw score. Must be a positive number not equal + to 1.0. + :paramtype boost: float + :keyword interpolation: A value indicating how boosting will be interpolated across document scores; defaults to "Linear". Possible values include: "linear", "constant", "quadratic", "logarithmic". - :type interpolation: str or ~azure.search.documents.indexes.models.ScoringFunctionInterpolation + :paramtype interpolation: str or + ~azure.search.documents.indexes.models.ScoringFunctionInterpolation """ _validation = { @@ -1378,20 +1385,21 @@ class DistanceScoringFunction(ScoringFunction): All required parameters must be populated in order to send to Azure. - :param type: Required. Indicates the type of function to use. Valid values include magnitude, + :keyword type: Required. Indicates the type of function to use. Valid values include magnitude, freshness, distance, and tag. The function type must be lower case.Constant filled by server. - :type type: str - :param field_name: Required. The name of the field used as input to the scoring function. - :type field_name: str - :param boost: Required. A multiplier for the raw score. Must be a positive number not equal to - 1.0. - :type boost: float - :param interpolation: A value indicating how boosting will be interpolated across document + :paramtype type: str + :keyword field_name: Required. The name of the field used as input to the scoring function. + :paramtype field_name: str + :keyword boost: Required. A multiplier for the raw score. Must be a positive number not equal + to 1.0. + :paramtype boost: float + :keyword interpolation: A value indicating how boosting will be interpolated across document scores; defaults to "Linear". Possible values include: "linear", "constant", "quadratic", "logarithmic". - :type interpolation: str or ~azure.search.documents.indexes.models.ScoringFunctionInterpolation - :param parameters: Required. Parameter values for the distance scoring function. - :type parameters: ~azure.search.documents.indexes.models.DistanceScoringParameters + :paramtype interpolation: str or + ~azure.search.documents.indexes.models.ScoringFunctionInterpolation + :keyword parameters: Required. Parameter values for the distance scoring function. + :paramtype parameters: ~azure.search.documents.indexes.models.DistanceScoringParameters """ _validation = { @@ -1423,12 +1431,12 @@ class DistanceScoringParameters(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param reference_point_parameter: Required. The name of the parameter passed in search queries - to specify the reference location. - :type reference_point_parameter: str - :param boosting_distance: Required. The distance in kilometers from the reference location + :keyword reference_point_parameter: Required. The name of the parameter passed in search + queries to specify the reference location. + :paramtype reference_point_parameter: str + :keyword boosting_distance: Required. The distance in kilometers from the reference location where the boosting range ends. - :type boosting_distance: float + :paramtype boosting_distance: float """ _validation = { @@ -1455,32 +1463,33 @@ class DocumentExtractionSkill(SearchIndexerSkill): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the skill.Constant filled by server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill + :paramtype odata_type: str + :keyword name: The name of the skill which uniquely identifies it within the skillset. A skill with no name defined will be given a default name of its 1-based index in the skills array, prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] - :param parsing_mode: The parsingMode for the skill. Will be set to 'default' if not defined. - :type parsing_mode: str - :param data_to_extract: The type of data to be extracted for the skill. Will be set to + :paramtype name: str + :keyword description: The description of the skill which describes the inputs, outputs, and + usage of the skill. + :paramtype description: str + :keyword context: Represents the level at which operations take place, such as the document + root or document content (for example, /document or /document/content). The default is + /document. + :paramtype context: str + :keyword inputs: Required. Inputs of the skills could be a column in the source data set, or + the output of an upstream skill. + :paramtype inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] + :keyword outputs: Required. The output of a skill is either a field in a search index, or a + value that can be consumed as an input by another skill. + :paramtype outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] + :keyword parsing_mode: The parsingMode for the skill. Will be set to 'default' if not defined. + :paramtype parsing_mode: str + :keyword data_to_extract: The type of data to be extracted for the skill. Will be set to 'contentAndMetadata' if not defined. - :type data_to_extract: str - :param configuration: A dictionary of configurations for the skill. - :type configuration: dict[str, any] + :paramtype data_to_extract: str + :keyword configuration: A dictionary of configurations for the skill. + :paramtype configuration: dict[str, any] """ _validation = { @@ -1517,21 +1526,21 @@ class EdgeNGramTokenFilter(TokenFilter): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled + :keyword odata_type: Required. Identifies the concrete type of the token filter.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, + :paramtype odata_type: str + :keyword name: Required. The name of the token filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str - :param min_gram: The minimum n-gram length. Default is 1. Must be less than the value of + :paramtype name: str + :keyword min_gram: The minimum n-gram length. Default is 1. Must be less than the value of maxGram. - :type min_gram: int - :param max_gram: The maximum n-gram length. Default is 2. - :type max_gram: int - :param side: Specifies which side of the input the n-gram should be generated from. Default is - "front". Possible values include: "front", "back". - :type side: str or ~azure.search.documents.indexes.models.EdgeNGramTokenFilterSide + :paramtype min_gram: int + :keyword max_gram: The maximum n-gram length. Default is 2. + :paramtype max_gram: int + :keyword side: Specifies which side of the input the n-gram should be generated from. Default + is "front". Possible values include: "front", "back". + :paramtype side: str or ~azure.search.documents.indexes.models.EdgeNGramTokenFilterSide """ _validation = { @@ -1563,21 +1572,21 @@ class EdgeNGramTokenFilterV2(TokenFilter): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled + :keyword odata_type: Required. Identifies the concrete type of the token filter.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, + :paramtype odata_type: str + :keyword name: Required. The name of the token filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str - :param min_gram: The minimum n-gram length. Default is 1. Maximum is 300. Must be less than the - value of maxGram. - :type min_gram: int - :param max_gram: The maximum n-gram length. Default is 2. Maximum is 300. - :type max_gram: int - :param side: Specifies which side of the input the n-gram should be generated from. Default is - "front". Possible values include: "front", "back". - :type side: str or ~azure.search.documents.indexes.models.EdgeNGramTokenFilterSide + :paramtype name: str + :keyword min_gram: The minimum n-gram length. Default is 1. Maximum is 300. Must be less than + the value of maxGram. + :paramtype min_gram: int + :keyword max_gram: The maximum n-gram length. Default is 2. Maximum is 300. + :paramtype max_gram: int + :keyword side: Specifies which side of the input the n-gram should be generated from. Default + is "front". Possible values include: "front", "back". + :paramtype side: str or ~azure.search.documents.indexes.models.EdgeNGramTokenFilterSide """ _validation = { @@ -1611,20 +1620,20 @@ class EdgeNGramTokenizer(LexicalTokenizer): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the tokenizer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param min_gram: The minimum n-gram length. Default is 1. Maximum is 300. Must be less than the - value of maxGram. - :type min_gram: int - :param max_gram: The maximum n-gram length. Default is 2. Maximum is 300. - :type max_gram: int - :param token_chars: Character classes to keep in the tokens. - :type token_chars: list[str or ~azure.search.documents.indexes.models.TokenCharacterKind] + :paramtype odata_type: str + :keyword name: Required. The name of the tokenizer. It must only contain letters, digits, + spaces, dashes or underscores, can only start and end with alphanumeric characters, and is + limited to 128 characters. + :paramtype name: str + :keyword min_gram: The minimum n-gram length. Default is 1. Maximum is 300. Must be less than + the value of maxGram. + :paramtype min_gram: int + :keyword max_gram: The maximum n-gram length. Default is 2. Maximum is 300. + :paramtype max_gram: int + :keyword token_chars: Character classes to keep in the tokens. + :paramtype token_chars: list[str or ~azure.search.documents.indexes.models.TokenCharacterKind] """ _validation = { @@ -1658,15 +1667,15 @@ class ElisionTokenFilter(TokenFilter): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled + :keyword odata_type: Required. Identifies the concrete type of the token filter.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, + :paramtype odata_type: str + :keyword name: Required. The name of the token filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str - :param articles: The set of articles to remove. - :type articles: list[str] + :paramtype name: str + :keyword articles: The set of articles to remove. + :paramtype articles: list[str] """ _validation = { @@ -1694,35 +1703,36 @@ class EntityLinkingSkill(SearchIndexerSkill): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the skill.Constant filled by server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill + :paramtype odata_type: str + :keyword name: The name of the skill which uniquely identifies it within the skillset. A skill with no name defined will be given a default name of its 1-based index in the skills array, prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] - :param default_language_code: A value indicating which language code to use. Default is en. - :type default_language_code: str - :param minimum_precision: A value between 0 and 1 that be used to only include entities whose + :paramtype name: str + :keyword description: The description of the skill which describes the inputs, outputs, and + usage of the skill. + :paramtype description: str + :keyword context: Represents the level at which operations take place, such as the document + root or document content (for example, /document or /document/content). The default is + /document. + :paramtype context: str + :keyword inputs: Required. Inputs of the skills could be a column in the source data set, or + the output of an upstream skill. + :paramtype inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] + :keyword outputs: Required. The output of a skill is either a field in a search index, or a + value that can be consumed as an input by another skill. + :paramtype outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] + :keyword default_language_code: A value indicating which language code to use. Default is en. + :paramtype default_language_code: str + :keyword minimum_precision: A value between 0 and 1 that be used to only include entities whose confidence score is greater than the value specified. If not set (default), or if explicitly set to null, all entities will be included. - :type minimum_precision: float - :param model_version: The version of the model to use when calling the Text Analytics service. - It will default to the latest available when not specified. We recommend you do not specify - this value unless absolutely necessary. - :type model_version: str + :paramtype minimum_precision: float + :keyword model_version: The version of the model to use when calling the Text Analytics + service. It will default to the latest available when not specified. We recommend you do not + specify this value unless absolutely necessary. + :paramtype model_version: str """ _validation = { @@ -1760,41 +1770,42 @@ class EntityRecognitionSkill(SearchIndexerSkill): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the skill.Constant filled by server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill + :paramtype odata_type: str + :keyword name: The name of the skill which uniquely identifies it within the skillset. A skill with no name defined will be given a default name of its 1-based index in the skills array, prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] - :param categories: A list of entity categories that should be extracted. - :type categories: list[str or ~azure.search.documents.indexes.models.EntityCategory] - :param default_language_code: A value indicating which language code to use. Default is en. + :paramtype name: str + :keyword description: The description of the skill which describes the inputs, outputs, and + usage of the skill. + :paramtype description: str + :keyword context: Represents the level at which operations take place, such as the document + root or document content (for example, /document or /document/content). The default is + /document. + :paramtype context: str + :keyword inputs: Required. Inputs of the skills could be a column in the source data set, or + the output of an upstream skill. + :paramtype inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] + :keyword outputs: Required. The output of a skill is either a field in a search index, or a + value that can be consumed as an input by another skill. + :paramtype outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] + :keyword categories: A list of entity categories that should be extracted. + :paramtype categories: list[str or ~azure.search.documents.indexes.models.EntityCategory] + :keyword default_language_code: A value indicating which language code to use. Default is en. Possible values include: "ar", "cs", "zh-Hans", "zh-Hant", "da", "nl", "en", "fi", "fr", "de", "el", "hu", "it", "ja", "ko", "no", "pl", "pt-PT", "pt-BR", "ru", "es", "sv", "tr". - :type default_language_code: str or + :paramtype default_language_code: str or ~azure.search.documents.indexes.models.EntityRecognitionSkillLanguage - :param include_typeless_entities: Determines whether or not to include entities which are well - known but don't conform to a pre-defined type. If this configuration is not set (default), set - to null or set to false, entities which don't conform to one of the pre-defined types will not - be surfaced. - :type include_typeless_entities: bool - :param minimum_precision: A value between 0 and 1 that be used to only include entities whose + :keyword include_typeless_entities: Determines whether or not to include entities which are + well known but don't conform to a pre-defined type. If this configuration is not set (default), + set to null or set to false, entities which don't conform to one of the pre-defined types will + not be surfaced. + :paramtype include_typeless_entities: bool + :keyword minimum_precision: A value between 0 and 1 that be used to only include entities whose confidence score is greater than the value specified. If not set (default), or if explicitly set to null, all entities will be included. - :type minimum_precision: float + :paramtype minimum_precision: float """ _validation = { @@ -1833,37 +1844,38 @@ class EntityRecognitionSkillV3(SearchIndexerSkill): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the skill.Constant filled by server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill + :paramtype odata_type: str + :keyword name: The name of the skill which uniquely identifies it within the skillset. A skill with no name defined will be given a default name of its 1-based index in the skills array, prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] - :param categories: A list of entity categories that should be extracted. - :type categories: list[str] - :param default_language_code: A value indicating which language code to use. Default is en. - :type default_language_code: str - :param minimum_precision: A value between 0 and 1 that be used to only include entities whose + :paramtype name: str + :keyword description: The description of the skill which describes the inputs, outputs, and + usage of the skill. + :paramtype description: str + :keyword context: Represents the level at which operations take place, such as the document + root or document content (for example, /document or /document/content). The default is + /document. + :paramtype context: str + :keyword inputs: Required. Inputs of the skills could be a column in the source data set, or + the output of an upstream skill. + :paramtype inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] + :keyword outputs: Required. The output of a skill is either a field in a search index, or a + value that can be consumed as an input by another skill. + :paramtype outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] + :keyword categories: A list of entity categories that should be extracted. + :paramtype categories: list[str] + :keyword default_language_code: A value indicating which language code to use. Default is en. + :paramtype default_language_code: str + :keyword minimum_precision: A value between 0 and 1 that be used to only include entities whose confidence score is greater than the value specified. If not set (default), or if explicitly set to null, all entities will be included. - :type minimum_precision: float - :param model_version: The version of the model to use when calling the Text Analytics service. - It will default to the latest available when not specified. We recommend you do not specify - this value unless absolutely necessary. - :type model_version: str + :paramtype minimum_precision: float + :keyword model_version: The version of the model to use when calling the Text Analytics + service. It will default to the latest available when not specified. We recommend you do not + specify this value unless absolutely necessary. + :paramtype model_version: str """ _validation = { @@ -1903,13 +1915,13 @@ class FieldMapping(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param source_field_name: Required. The name of the field in the data source. - :type source_field_name: str - :param target_field_name: The name of the target field in the index. Same as the source field + :keyword source_field_name: Required. The name of the field in the data source. + :paramtype source_field_name: str + :keyword target_field_name: The name of the target field in the index. Same as the source field name by default. - :type target_field_name: str - :param mapping_function: A function to apply to each source field value before indexing. - :type mapping_function: ~azure.search.documents.indexes.models.FieldMappingFunction + :paramtype target_field_name: str + :keyword mapping_function: A function to apply to each source field value before indexing. + :paramtype mapping_function: ~azure.search.documents.indexes.models.FieldMappingFunction """ _validation = { @@ -1937,11 +1949,11 @@ class FieldMappingFunction(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the field mapping function. - :type name: str - :param parameters: A dictionary of parameter name/value pairs to pass to the function. Each + :keyword name: Required. The name of the field mapping function. + :paramtype name: str + :keyword parameters: A dictionary of parameter name/value pairs to pass to the function. Each value must be of a primitive type. - :type parameters: dict[str, any] + :paramtype parameters: dict[str, any] """ _validation = { @@ -1967,20 +1979,21 @@ class FreshnessScoringFunction(ScoringFunction): All required parameters must be populated in order to send to Azure. - :param type: Required. Indicates the type of function to use. Valid values include magnitude, + :keyword type: Required. Indicates the type of function to use. Valid values include magnitude, freshness, distance, and tag. The function type must be lower case.Constant filled by server. - :type type: str - :param field_name: Required. The name of the field used as input to the scoring function. - :type field_name: str - :param boost: Required. A multiplier for the raw score. Must be a positive number not equal to - 1.0. - :type boost: float - :param interpolation: A value indicating how boosting will be interpolated across document + :paramtype type: str + :keyword field_name: Required. The name of the field used as input to the scoring function. + :paramtype field_name: str + :keyword boost: Required. A multiplier for the raw score. Must be a positive number not equal + to 1.0. + :paramtype boost: float + :keyword interpolation: A value indicating how boosting will be interpolated across document scores; defaults to "Linear". Possible values include: "linear", "constant", "quadratic", "logarithmic". - :type interpolation: str or ~azure.search.documents.indexes.models.ScoringFunctionInterpolation - :param parameters: Required. Parameter values for the freshness scoring function. - :type parameters: ~azure.search.documents.indexes.models.FreshnessScoringParameters + :paramtype interpolation: str or + ~azure.search.documents.indexes.models.ScoringFunctionInterpolation + :keyword parameters: Required. Parameter values for the freshness scoring function. + :paramtype parameters: ~azure.search.documents.indexes.models.FreshnessScoringParameters """ _validation = { @@ -2012,9 +2025,9 @@ class FreshnessScoringParameters(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param boosting_duration: Required. The expiration period after which boosting will stop for a - particular document. - :type boosting_duration: ~datetime.timedelta + :keyword boosting_duration: Required. The expiration period after which boosting will stop for + a particular document. + :paramtype boosting_duration: ~datetime.timedelta """ _validation = { @@ -2070,11 +2083,11 @@ class HighWaterMarkChangeDetectionPolicy(DataChangeDetectionPolicy): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the data change detection + :keyword odata_type: Required. Identifies the concrete type of the data change detection policy.Constant filled by server. - :type odata_type: str - :param high_water_mark_column_name: Required. The name of the high water mark column. - :type high_water_mark_column_name: str + :paramtype odata_type: str + :keyword high_water_mark_column_name: Required. The name of the high water mark column. + :paramtype high_water_mark_column_name: str """ _validation = { @@ -2101,33 +2114,34 @@ class ImageAnalysisSkill(SearchIndexerSkill): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the skill.Constant filled by server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill + :paramtype odata_type: str + :keyword name: The name of the skill which uniquely identifies it within the skillset. A skill with no name defined will be given a default name of its 1-based index in the skills array, prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] - :param default_language_code: A value indicating which language code to use. Default is en. + :paramtype name: str + :keyword description: The description of the skill which describes the inputs, outputs, and + usage of the skill. + :paramtype description: str + :keyword context: Represents the level at which operations take place, such as the document + root or document content (for example, /document or /document/content). The default is + /document. + :paramtype context: str + :keyword inputs: Required. Inputs of the skills could be a column in the source data set, or + the output of an upstream skill. + :paramtype inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] + :keyword outputs: Required. The output of a skill is either a field in a search index, or a + value that can be consumed as an input by another skill. + :paramtype outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] + :keyword default_language_code: A value indicating which language code to use. Default is en. Possible values include: "en", "es", "ja", "pt", "zh". - :type default_language_code: str or + :paramtype default_language_code: str or ~azure.search.documents.indexes.models.ImageAnalysisSkillLanguage - :param visual_features: A list of visual features. - :type visual_features: list[str or ~azure.search.documents.indexes.models.VisualFeature] - :param details: A string indicating which domain-specific details to return. - :type details: list[str or ~azure.search.documents.indexes.models.ImageDetail] + :keyword visual_features: A list of visual features. + :paramtype visual_features: list[str or ~azure.search.documents.indexes.models.VisualFeature] + :keyword details: A string indicating which domain-specific details to return. + :paramtype details: list[str or ~azure.search.documents.indexes.models.ImageDetail] """ _validation = { @@ -2159,6 +2173,70 @@ def __init__( self.details = kwargs.get('details', None) +class IndexerCurrentState(msrest.serialization.Model): + """Represents all of the state that defines and dictates the indexer's current execution. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar mode: The mode the indexer is running in. Possible values include: "indexingAllDocs", + "indexingResetDocs". + :vartype mode: str or ~azure.search.documents.indexes.models.IndexingMode + :ivar all_docs_initial_change_tracking_state: Change tracking state used when indexing starts + on all documents in the datasource. + :vartype all_docs_initial_change_tracking_state: str + :ivar all_docs_final_change_tracking_state: Change tracking state value when indexing finishes + on all documents in the datasource. + :vartype all_docs_final_change_tracking_state: str + :ivar reset_docs_initial_change_tracking_state: Change tracking state used when indexing starts + on select, reset documents in the datasource. + :vartype reset_docs_initial_change_tracking_state: str + :ivar reset_docs_final_change_tracking_state: Change tracking state value when indexing + finishes on select, reset documents in the datasource. + :vartype reset_docs_final_change_tracking_state: str + :ivar reset_document_keys: The list of document keys that have been reset. The document key is + the document's unique identifier for the data in the search index. The indexer will prioritize + selectively re-ingesting these keys. + :vartype reset_document_keys: list[str] + :ivar reset_datasource_document_ids: The list of datasource document ids that have been reset. + The datasource document id is the unique identifier for the data in the datasource. The indexer + will prioritize selectively re-ingesting these ids. + :vartype reset_datasource_document_ids: list[str] + """ + + _validation = { + 'mode': {'readonly': True}, + 'all_docs_initial_change_tracking_state': {'readonly': True}, + 'all_docs_final_change_tracking_state': {'readonly': True}, + 'reset_docs_initial_change_tracking_state': {'readonly': True}, + 'reset_docs_final_change_tracking_state': {'readonly': True}, + 'reset_document_keys': {'readonly': True}, + 'reset_datasource_document_ids': {'readonly': True}, + } + + _attribute_map = { + 'mode': {'key': 'mode', 'type': 'str'}, + 'all_docs_initial_change_tracking_state': {'key': 'allDocsInitialChangeTrackingState', 'type': 'str'}, + 'all_docs_final_change_tracking_state': {'key': 'allDocsFinalChangeTrackingState', 'type': 'str'}, + 'reset_docs_initial_change_tracking_state': {'key': 'resetDocsInitialChangeTrackingState', 'type': 'str'}, + 'reset_docs_final_change_tracking_state': {'key': 'resetDocsFinalChangeTrackingState', 'type': 'str'}, + 'reset_document_keys': {'key': 'resetDocumentKeys', 'type': '[str]'}, + 'reset_datasource_document_ids': {'key': 'resetDatasourceDocumentIds', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(IndexerCurrentState, self).__init__(**kwargs) + self.mode = None + self.all_docs_initial_change_tracking_state = None + self.all_docs_final_change_tracking_state = None + self.reset_docs_initial_change_tracking_state = None + self.reset_docs_final_change_tracking_state = None + self.reset_document_keys = None + self.reset_datasource_document_ids = None + + class IndexerExecutionResult(msrest.serialization.Model): """Represents the result of an individual indexer execution. @@ -2169,6 +2247,13 @@ class IndexerExecutionResult(msrest.serialization.Model): :ivar status: Required. The outcome of this indexer execution. Possible values include: "transientFailure", "success", "inProgress", "reset". :vartype status: str or ~azure.search.documents.indexes.models.IndexerExecutionStatus + :ivar status_detail: The outcome of this indexer execution. Possible values include: + "resetDocs". + :vartype status_detail: str or + ~azure.search.documents.indexes.models.IndexerExecutionStatusDetail + :ivar current_state: All of the state that defines and dictates the indexer's current + execution. + :vartype current_state: ~azure.search.documents.indexes.models.IndexerCurrentState :ivar error_message: The error message indicating the top-level error, if any. :vartype error_message: str :ivar start_time: The start time of this indexer execution. @@ -2194,6 +2279,8 @@ class IndexerExecutionResult(msrest.serialization.Model): _validation = { 'status': {'required': True, 'readonly': True}, + 'status_detail': {'readonly': True}, + 'current_state': {'readonly': True}, 'error_message': {'readonly': True}, 'start_time': {'readonly': True}, 'end_time': {'readonly': True}, @@ -2207,6 +2294,8 @@ class IndexerExecutionResult(msrest.serialization.Model): _attribute_map = { 'status': {'key': 'status', 'type': 'str'}, + 'status_detail': {'key': 'statusDetail', 'type': 'str'}, + 'current_state': {'key': 'currentState', 'type': 'IndexerCurrentState'}, 'error_message': {'key': 'errorMessage', 'type': 'str'}, 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, @@ -2224,6 +2313,8 @@ def __init__( ): super(IndexerExecutionResult, self).__init__(**kwargs) self.status = None + self.status_detail = None + self.current_state = None self.error_message = None self.start_time = None self.end_time = None @@ -2238,18 +2329,19 @@ def __init__( class IndexingParameters(msrest.serialization.Model): """Represents parameters for indexer execution. - :param batch_size: The number of items that are read from the data source and indexed as a + :keyword batch_size: The number of items that are read from the data source and indexed as a single batch in order to improve performance. The default depends on the data source type. - :type batch_size: int - :param max_failed_items: The maximum number of items that can fail indexing for indexer + :paramtype batch_size: int + :keyword max_failed_items: The maximum number of items that can fail indexing for indexer execution to still be considered successful. -1 means no limit. Default is 0. - :type max_failed_items: int - :param max_failed_items_per_batch: The maximum number of items in a single batch that can fail - indexing for the batch to still be considered successful. -1 means no limit. Default is 0. - :type max_failed_items_per_batch: int - :param configuration: A dictionary of indexer-specific configuration properties. Each name is + :paramtype max_failed_items: int + :keyword max_failed_items_per_batch: The maximum number of items in a single batch that can + fail indexing for the batch to still be considered successful. -1 means no limit. Default is 0. + :paramtype max_failed_items_per_batch: int + :keyword configuration: A dictionary of indexer-specific configuration properties. Each name is the name of a specific property. Each value must be of a primitive type. - :type configuration: ~azure.search.documents.indexes.models.IndexingParametersConfiguration + :paramtype configuration: + ~azure.search.documents.indexes.models.IndexingParametersConfiguration """ _attribute_map = { @@ -2273,72 +2365,73 @@ def __init__( class IndexingParametersConfiguration(msrest.serialization.Model): """A dictionary of indexer-specific configuration properties. Each name is the name of a specific property. Each value must be of a primitive type. - :param additional_properties: Unmatched properties from the message are deserialized to this + :keyword additional_properties: Unmatched properties from the message are deserialized to this collection. - :type additional_properties: dict[str, any] - :param parsing_mode: Represents the parsing mode for indexing from an Azure blob data source. + :paramtype additional_properties: dict[str, any] + :keyword parsing_mode: Represents the parsing mode for indexing from an Azure blob data source. Possible values include: "default", "text", "delimitedText", "json", "jsonArray", "jsonLines". Default value: "default". - :type parsing_mode: str or ~azure.search.documents.indexes.models.BlobIndexerParsingMode - :param excluded_file_name_extensions: Comma-delimited list of filename extensions to ignore + :paramtype parsing_mode: str or ~azure.search.documents.indexes.models.BlobIndexerParsingMode + :keyword excluded_file_name_extensions: Comma-delimited list of filename extensions to ignore when processing from Azure blob storage. For example, you could exclude ".png, .mp4" to skip over those files during indexing. - :type excluded_file_name_extensions: str - :param indexed_file_name_extensions: Comma-delimited list of filename extensions to select when - processing from Azure blob storage. For example, you could focus indexing on specific + :paramtype excluded_file_name_extensions: str + :keyword indexed_file_name_extensions: Comma-delimited list of filename extensions to select + when processing from Azure blob storage. For example, you could focus indexing on specific application files ".docx, .pptx, .msg" to specifically include those file types. - :type indexed_file_name_extensions: str - :param fail_on_unsupported_content_type: For Azure blobs, set to false if you want to continue - indexing when an unsupported content type is encountered, and you don't know all the content - types (file extensions) in advance. - :type fail_on_unsupported_content_type: bool - :param fail_on_unprocessable_document: For Azure blobs, set to false if you want to continue + :paramtype indexed_file_name_extensions: str + :keyword fail_on_unsupported_content_type: For Azure blobs, set to false if you want to + continue indexing when an unsupported content type is encountered, and you don't know all the + content types (file extensions) in advance. + :paramtype fail_on_unsupported_content_type: bool + :keyword fail_on_unprocessable_document: For Azure blobs, set to false if you want to continue indexing if a document fails indexing. - :type fail_on_unprocessable_document: bool - :param index_storage_metadata_only_for_oversized_documents: For Azure blobs, set this property - to true to still index storage metadata for blob content that is too large to process. + :paramtype fail_on_unprocessable_document: bool + :keyword index_storage_metadata_only_for_oversized_documents: For Azure blobs, set this + property to true to still index storage metadata for blob content that is too large to process. Oversized blobs are treated as errors by default. For limits on blob size, see https://docs.microsoft.com/azure/search/search-limits-quotas-capacity. - :type index_storage_metadata_only_for_oversized_documents: bool - :param delimited_text_headers: For CSV blobs, specifies a comma-delimited list of column + :paramtype index_storage_metadata_only_for_oversized_documents: bool + :keyword delimited_text_headers: For CSV blobs, specifies a comma-delimited list of column headers, useful for mapping source fields to destination fields in an index. - :type delimited_text_headers: str - :param delimited_text_delimiter: For CSV blobs, specifies the end-of-line single-character + :paramtype delimited_text_headers: str + :keyword delimited_text_delimiter: For CSV blobs, specifies the end-of-line single-character delimiter for CSV files where each line starts a new document (for example, "|"). - :type delimited_text_delimiter: str - :param first_line_contains_headers: For CSV blobs, indicates that the first (non-blank) line of - each blob contains headers. - :type first_line_contains_headers: bool - :param document_root: For JSON arrays, given a structured or semi-structured document, you can - specify a path to the array using this property. - :type document_root: str - :param data_to_extract: Specifies the data to extract from Azure blob storage and tells the + :paramtype delimited_text_delimiter: str + :keyword first_line_contains_headers: For CSV blobs, indicates that the first (non-blank) line + of each blob contains headers. + :paramtype first_line_contains_headers: bool + :keyword document_root: For JSON arrays, given a structured or semi-structured document, you + can specify a path to the array using this property. + :paramtype document_root: str + :keyword data_to_extract: Specifies the data to extract from Azure blob storage and tells the indexer which data to extract from image content when "imageAction" is set to a value other than "none". This applies to embedded image content in a .PDF or other application, or image files such as .jpg and .png, in Azure blobs. Possible values include: "storageMetadata", "allMetadata", "contentAndMetadata". Default value: "contentAndMetadata". - :type data_to_extract: str or ~azure.search.documents.indexes.models.BlobIndexerDataToExtract - :param image_action: Determines how to process embedded images and image files in Azure blob + :paramtype data_to_extract: str or + ~azure.search.documents.indexes.models.BlobIndexerDataToExtract + :keyword image_action: Determines how to process embedded images and image files in Azure blob storage. Setting the "imageAction" configuration to any value other than "none" requires that a skillset also be attached to that indexer. Possible values include: "none", "generateNormalizedImages", "generateNormalizedImagePerPage". Default value: "none". - :type image_action: str or ~azure.search.documents.indexes.models.BlobIndexerImageAction - :param allow_skillset_to_read_file_data: If true, will create a path //document//file_data that - is an object representing the original file data downloaded from your blob data source. This - allows you to pass the original file data to a custom skill for processing within the + :paramtype image_action: str or ~azure.search.documents.indexes.models.BlobIndexerImageAction + :keyword allow_skillset_to_read_file_data: If true, will create a path //document//file_data + that is an object representing the original file data downloaded from your blob data source. + This allows you to pass the original file data to a custom skill for processing within the enrichment pipeline, or to the Document Extraction skill. - :type allow_skillset_to_read_file_data: bool - :param pdf_text_rotation_algorithm: Determines algorithm for text extraction from PDF files in - Azure blob storage. Possible values include: "none", "detectAngles". Default value: "none". - :type pdf_text_rotation_algorithm: str or + :paramtype allow_skillset_to_read_file_data: bool + :keyword pdf_text_rotation_algorithm: Determines algorithm for text extraction from PDF files + in Azure blob storage. Possible values include: "none", "detectAngles". Default value: "none". + :paramtype pdf_text_rotation_algorithm: str or ~azure.search.documents.indexes.models.BlobIndexerPDFTextRotationAlgorithm - :param execution_environment: Specifies the environment in which the indexer should execute. + :keyword execution_environment: Specifies the environment in which the indexer should execute. Possible values include: "standard", "private". Default value: "standard". - :type execution_environment: str or + :paramtype execution_environment: str or ~azure.search.documents.indexes.models.IndexerExecutionEnvironment - :param query_timeout: Increases the timeout beyond the 5-minute default for Azure SQL database - data sources, specified in the format "hh:mm:ss". - :type query_timeout: str + :keyword query_timeout: Increases the timeout beyond the 5-minute default for Azure SQL + database data sources, specified in the format "hh:mm:ss". + :paramtype query_timeout: str """ _attribute_map = { @@ -2390,10 +2483,10 @@ class IndexingSchedule(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param interval: Required. The interval of time between indexer executions. - :type interval: ~datetime.timedelta - :param start_time: The time when an indexer should start running. - :type start_time: ~datetime.datetime + :keyword interval: Required. The interval of time between indexer executions. + :paramtype interval: ~datetime.timedelta + :keyword start_time: The time when an indexer should start running. + :paramtype start_time: ~datetime.datetime """ _validation = { @@ -2419,14 +2512,14 @@ class InputFieldMappingEntry(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the input. - :type name: str - :param source: The source of the input. - :type source: str - :param source_context: The source context used for selecting recursive inputs. - :type source_context: str - :param inputs: The recursive inputs used when creating a complex type. - :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] + :keyword name: Required. The name of the input. + :paramtype name: str + :keyword source: The source of the input. + :paramtype source: str + :keyword source_context: The source context used for selecting recursive inputs. + :paramtype source_context: str + :keyword inputs: The recursive inputs used when creating a complex type. + :paramtype inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] """ _validation = { @@ -2456,18 +2549,18 @@ class KeepTokenFilter(TokenFilter): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled + :keyword odata_type: Required. Identifies the concrete type of the token filter.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, + :paramtype odata_type: str + :keyword name: Required. The name of the token filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str - :param keep_words: Required. The list of words to keep. - :type keep_words: list[str] - :param lower_case_keep_words: A value indicating whether to lower case all words first. Default - is false. - :type lower_case_keep_words: bool + :paramtype name: str + :keyword keep_words: Required. The list of words to keep. + :paramtype keep_words: list[str] + :keyword lower_case_keep_words: A value indicating whether to lower case all words first. + Default is false. + :paramtype lower_case_keep_words: bool """ _validation = { @@ -2498,37 +2591,38 @@ class KeyPhraseExtractionSkill(SearchIndexerSkill): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the skill.Constant filled by server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill + :paramtype odata_type: str + :keyword name: The name of the skill which uniquely identifies it within the skillset. A skill with no name defined will be given a default name of its 1-based index in the skills array, prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] - :param default_language_code: A value indicating which language code to use. Default is en. + :paramtype name: str + :keyword description: The description of the skill which describes the inputs, outputs, and + usage of the skill. + :paramtype description: str + :keyword context: Represents the level at which operations take place, such as the document + root or document content (for example, /document or /document/content). The default is + /document. + :paramtype context: str + :keyword inputs: Required. Inputs of the skills could be a column in the source data set, or + the output of an upstream skill. + :paramtype inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] + :keyword outputs: Required. The output of a skill is either a field in a search index, or a + value that can be consumed as an input by another skill. + :paramtype outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] + :keyword default_language_code: A value indicating which language code to use. Default is en. Possible values include: "da", "nl", "en", "fi", "fr", "de", "it", "ja", "ko", "no", "pl", "pt-PT", "pt-BR", "ru", "es", "sv". - :type default_language_code: str or + :paramtype default_language_code: str or ~azure.search.documents.indexes.models.KeyPhraseExtractionSkillLanguage - :param max_key_phrase_count: A number indicating how many key phrases to return. If absent, all - identified key phrases will be returned. - :type max_key_phrase_count: int - :param model_version: The version of the model to use when calling the Text Analytics service. - It will default to the latest available when not specified. We recommend you do not specify - this value unless absolutely necessary. - :type model_version: str + :keyword max_key_phrase_count: A number indicating how many key phrases to return. If absent, + all identified key phrases will be returned. + :paramtype max_key_phrase_count: int + :keyword model_version: The version of the model to use when calling the Text Analytics + service. It will default to the latest available when not specified. We recommend you do not + specify this value unless absolutely necessary. + :paramtype model_version: str """ _validation = { @@ -2565,18 +2659,18 @@ class KeywordMarkerTokenFilter(TokenFilter): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled + :keyword odata_type: Required. Identifies the concrete type of the token filter.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, + :paramtype odata_type: str + :keyword name: Required. The name of the token filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str - :param keywords: Required. A list of words to mark as keywords. - :type keywords: list[str] - :param ignore_case: A value indicating whether to ignore case. If true, all words are converted - to lower case first. Default is false. - :type ignore_case: bool + :paramtype name: str + :keyword keywords: Required. A list of words to mark as keywords. + :paramtype keywords: list[str] + :keyword ignore_case: A value indicating whether to ignore case. If true, all words are + converted to lower case first. Default is false. + :paramtype ignore_case: bool """ _validation = { @@ -2607,15 +2701,15 @@ class KeywordTokenizer(LexicalTokenizer): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the tokenizer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param buffer_size: The read buffer size in bytes. Default is 256. - :type buffer_size: int + :paramtype odata_type: str + :keyword name: Required. The name of the tokenizer. It must only contain letters, digits, + spaces, dashes or underscores, can only start and end with alphanumeric characters, and is + limited to 128 characters. + :paramtype name: str + :keyword buffer_size: The read buffer size in bytes. Default is 256. + :paramtype buffer_size: int """ _validation = { @@ -2643,16 +2737,16 @@ class KeywordTokenizerV2(LexicalTokenizer): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the tokenizer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param max_token_length: The maximum token length. Default is 256. Tokens longer than the + :paramtype odata_type: str + :keyword name: Required. The name of the tokenizer. It must only contain letters, digits, + spaces, dashes or underscores, can only start and end with alphanumeric characters, and is + limited to 128 characters. + :paramtype name: str + :keyword max_token_length: The maximum token length. Default is 256. Tokens longer than the maximum length are split. The maximum token length that can be used is 300 characters. - :type max_token_length: int + :paramtype max_token_length: int """ _validation = { @@ -2681,32 +2775,33 @@ class LanguageDetectionSkill(SearchIndexerSkill): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the skill.Constant filled by server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill + :paramtype odata_type: str + :keyword name: The name of the skill which uniquely identifies it within the skillset. A skill with no name defined will be given a default name of its 1-based index in the skills array, prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] - :param default_country_hint: A country code to use as a hint to the language detection model if - it cannot disambiguate the language. - :type default_country_hint: str - :param model_version: The version of the model to use when calling the Text Analytics service. - It will default to the latest available when not specified. We recommend you do not specify - this value unless absolutely necessary. - :type model_version: str + :paramtype name: str + :keyword description: The description of the skill which describes the inputs, outputs, and + usage of the skill. + :paramtype description: str + :keyword context: Represents the level at which operations take place, such as the document + root or document content (for example, /document or /document/content). The default is + /document. + :paramtype context: str + :keyword inputs: Required. Inputs of the skills could be a column in the source data set, or + the output of an upstream skill. + :paramtype inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] + :keyword outputs: Required. The output of a skill is either a field in a search index, or a + value that can be consumed as an input by another skill. + :paramtype outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] + :keyword default_country_hint: A country code to use as a hint to the language detection model + if it cannot disambiguate the language. + :paramtype default_country_hint: str + :keyword model_version: The version of the model to use when calling the Text Analytics + service. It will default to the latest available when not specified. We recommend you do not + specify this value unless absolutely necessary. + :paramtype model_version: str """ _validation = { @@ -2741,18 +2836,18 @@ class LengthTokenFilter(TokenFilter): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled + :keyword odata_type: Required. Identifies the concrete type of the token filter.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, + :paramtype odata_type: str + :keyword name: Required. The name of the token filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str - :param min_length: The minimum length in characters. Default is 0. Maximum is 300. Must be less - than the value of max. - :type min_length: int - :param max_length: The maximum length in characters. Default and maximum is 300. - :type max_length: int + :paramtype name: str + :keyword min_length: The minimum length in characters. Default is 0. Maximum is 300. Must be + less than the value of max. + :paramtype min_length: int + :keyword max_length: The maximum length in characters. Default and maximum is 300. + :paramtype max_length: int """ _validation = { @@ -2784,18 +2879,18 @@ class LimitTokenFilter(TokenFilter): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled + :keyword odata_type: Required. Identifies the concrete type of the token filter.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, + :paramtype odata_type: str + :keyword name: Required. The name of the token filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str - :param max_token_count: The maximum number of tokens to produce. Default is 1. - :type max_token_count: int - :param consume_all_tokens: A value indicating whether all tokens from the input must be + :paramtype name: str + :keyword max_token_count: The maximum number of tokens to produce. Default is 1. + :paramtype max_token_count: int + :keyword consume_all_tokens: A value indicating whether all tokens from the input must be consumed even if maxTokenCount is reached. Default is false. - :type consume_all_tokens: bool + :paramtype consume_all_tokens: bool """ _validation = { @@ -2960,18 +3055,18 @@ class LuceneStandardAnalyzer(LexicalAnalyzer): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the analyzer.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the analyzer.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the analyzer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param max_token_length: The maximum token length. Default is 255. Tokens longer than the + :paramtype odata_type: str + :keyword name: Required. The name of the analyzer. It must only contain letters, digits, + spaces, dashes or underscores, can only start and end with alphanumeric characters, and is + limited to 128 characters. + :paramtype name: str + :keyword max_token_length: The maximum token length. Default is 255. Tokens longer than the maximum length are split. The maximum token length that can be used is 300 characters. - :type max_token_length: int - :param stopwords: A list of stopwords. - :type stopwords: list[str] + :paramtype max_token_length: int + :keyword stopwords: A list of stopwords. + :paramtype stopwords: list[str] """ _validation = { @@ -3002,16 +3097,16 @@ class LuceneStandardTokenizer(LexicalTokenizer): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the tokenizer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param max_token_length: The maximum token length. Default is 255. Tokens longer than the + :paramtype odata_type: str + :keyword name: Required. The name of the tokenizer. It must only contain letters, digits, + spaces, dashes or underscores, can only start and end with alphanumeric characters, and is + limited to 128 characters. + :paramtype name: str + :keyword max_token_length: The maximum token length. Default is 255. Tokens longer than the maximum length are split. - :type max_token_length: int + :paramtype max_token_length: int """ _validation = { @@ -3039,16 +3134,16 @@ class LuceneStandardTokenizerV2(LexicalTokenizer): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the tokenizer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param max_token_length: The maximum token length. Default is 255. Tokens longer than the + :paramtype odata_type: str + :keyword name: Required. The name of the tokenizer. It must only contain letters, digits, + spaces, dashes or underscores, can only start and end with alphanumeric characters, and is + limited to 128 characters. + :paramtype name: str + :keyword max_token_length: The maximum token length. Default is 255. Tokens longer than the maximum length are split. The maximum token length that can be used is 300 characters. - :type max_token_length: int + :paramtype max_token_length: int """ _validation = { @@ -3077,20 +3172,21 @@ class MagnitudeScoringFunction(ScoringFunction): All required parameters must be populated in order to send to Azure. - :param type: Required. Indicates the type of function to use. Valid values include magnitude, + :keyword type: Required. Indicates the type of function to use. Valid values include magnitude, freshness, distance, and tag. The function type must be lower case.Constant filled by server. - :type type: str - :param field_name: Required. The name of the field used as input to the scoring function. - :type field_name: str - :param boost: Required. A multiplier for the raw score. Must be a positive number not equal to - 1.0. - :type boost: float - :param interpolation: A value indicating how boosting will be interpolated across document + :paramtype type: str + :keyword field_name: Required. The name of the field used as input to the scoring function. + :paramtype field_name: str + :keyword boost: Required. A multiplier for the raw score. Must be a positive number not equal + to 1.0. + :paramtype boost: float + :keyword interpolation: A value indicating how boosting will be interpolated across document scores; defaults to "Linear". Possible values include: "linear", "constant", "quadratic", "logarithmic". - :type interpolation: str or ~azure.search.documents.indexes.models.ScoringFunctionInterpolation - :param parameters: Required. Parameter values for the magnitude scoring function. - :type parameters: ~azure.search.documents.indexes.models.MagnitudeScoringParameters + :paramtype interpolation: str or + ~azure.search.documents.indexes.models.ScoringFunctionInterpolation + :keyword parameters: Required. Parameter values for the magnitude scoring function. + :paramtype parameters: ~azure.search.documents.indexes.models.MagnitudeScoringParameters """ _validation = { @@ -3122,13 +3218,13 @@ class MagnitudeScoringParameters(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param boosting_range_start: Required. The field value at which boosting starts. - :type boosting_range_start: float - :param boosting_range_end: Required. The field value at which boosting ends. - :type boosting_range_end: float - :param should_boost_beyond_range_by_constant: A value indicating whether to apply a constant + :keyword boosting_range_start: Required. The field value at which boosting starts. + :paramtype boosting_range_start: float + :keyword boosting_range_end: Required. The field value at which boosting ends. + :paramtype boosting_range_end: float + :keyword should_boost_beyond_range_by_constant: A value indicating whether to apply a constant boost for field values beyond the range end value; default is false. - :type should_boost_beyond_range_by_constant: bool + :paramtype should_boost_beyond_range_by_constant: bool """ _validation = { @@ -3157,16 +3253,16 @@ class MappingCharFilter(CharFilter): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the char filter.Constant filled by - server. - :type odata_type: str - :param name: Required. The name of the char filter. It must only contain letters, digits, + :keyword odata_type: Required. Identifies the concrete type of the char filter.Constant filled + by server. + :paramtype odata_type: str + :keyword name: Required. The name of the char filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str - :param mappings: Required. A list of mappings of the following format: "a=>b" (all occurrences - of the character "a" will be replaced with character "b"). - :type mappings: list[str] + :paramtype name: str + :keyword mappings: Required. A list of mappings of the following format: "a=>b" (all + occurrences of the character "a" will be replaced with character "b"). + :paramtype mappings: list[str] """ _validation = { @@ -3195,31 +3291,32 @@ class MergeSkill(SearchIndexerSkill): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the skill.Constant filled by server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill + :paramtype odata_type: str + :keyword name: The name of the skill which uniquely identifies it within the skillset. A skill with no name defined will be given a default name of its 1-based index in the skills array, prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] - :param insert_pre_tag: The tag indicates the start of the merged text. By default, the tag is + :paramtype name: str + :keyword description: The description of the skill which describes the inputs, outputs, and + usage of the skill. + :paramtype description: str + :keyword context: Represents the level at which operations take place, such as the document + root or document content (for example, /document or /document/content). The default is + /document. + :paramtype context: str + :keyword inputs: Required. Inputs of the skills could be a column in the source data set, or + the output of an upstream skill. + :paramtype inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] + :keyword outputs: Required. The output of a skill is either a field in a search index, or a + value that can be consumed as an input by another skill. + :paramtype outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] + :keyword insert_pre_tag: The tag indicates the start of the merged text. By default, the tag is + an empty space. + :paramtype insert_pre_tag: str + :keyword insert_post_tag: The tag indicates the end of the merged text. By default, the tag is an empty space. - :type insert_pre_tag: str - :param insert_post_tag: The tag indicates the end of the merged text. By default, the tag is an - empty space. - :type insert_post_tag: str + :paramtype insert_post_tag: str """ _validation = { @@ -3254,29 +3351,29 @@ class MicrosoftLanguageStemmingTokenizer(LexicalTokenizer): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the tokenizer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param max_token_length: The maximum token length. Tokens longer than the maximum length are + :paramtype odata_type: str + :keyword name: Required. The name of the tokenizer. It must only contain letters, digits, + spaces, dashes or underscores, can only start and end with alphanumeric characters, and is + limited to 128 characters. + :paramtype name: str + :keyword max_token_length: The maximum token length. Tokens longer than the maximum length are split. Maximum token length that can be used is 300 characters. Tokens longer than 300 characters are first split into tokens of length 300 and then each of those tokens is split based on the max token length set. Default is 255. - :type max_token_length: int - :param is_search_tokenizer: A value indicating how the tokenizer is used. Set to true if used + :paramtype max_token_length: int + :keyword is_search_tokenizer: A value indicating how the tokenizer is used. Set to true if used as the search tokenizer, set to false if used as the indexing tokenizer. Default is false. - :type is_search_tokenizer: bool - :param language: The language to use. The default is English. Possible values include: + :paramtype is_search_tokenizer: bool + :keyword language: The language to use. The default is English. Possible values include: "arabic", "bangla", "bulgarian", "catalan", "croatian", "czech", "danish", "dutch", "english", "estonian", "finnish", "french", "german", "greek", "gujarati", "hebrew", "hindi", "hungarian", "icelandic", "indonesian", "italian", "kannada", "latvian", "lithuanian", "malay", "malayalam", "marathi", "norwegianBokmaal", "polish", "portuguese", "portugueseBrazilian", "punjabi", "romanian", "russian", "serbianCyrillic", "serbianLatin", "slovak", "slovenian", "spanish", "swedish", "tamil", "telugu", "turkish", "ukrainian", "urdu". - :type language: str or + :paramtype language: str or ~azure.search.documents.indexes.models.MicrosoftStemmingTokenizerLanguage """ @@ -3310,29 +3407,29 @@ class MicrosoftLanguageTokenizer(LexicalTokenizer): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the tokenizer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param max_token_length: The maximum token length. Tokens longer than the maximum length are + :paramtype odata_type: str + :keyword name: Required. The name of the tokenizer. It must only contain letters, digits, + spaces, dashes or underscores, can only start and end with alphanumeric characters, and is + limited to 128 characters. + :paramtype name: str + :keyword max_token_length: The maximum token length. Tokens longer than the maximum length are split. Maximum token length that can be used is 300 characters. Tokens longer than 300 characters are first split into tokens of length 300 and then each of those tokens is split based on the max token length set. Default is 255. - :type max_token_length: int - :param is_search_tokenizer: A value indicating how the tokenizer is used. Set to true if used + :paramtype max_token_length: int + :keyword is_search_tokenizer: A value indicating how the tokenizer is used. Set to true if used as the search tokenizer, set to false if used as the indexing tokenizer. Default is false. - :type is_search_tokenizer: bool - :param language: The language to use. The default is English. Possible values include: + :paramtype is_search_tokenizer: bool + :keyword language: The language to use. The default is English. Possible values include: "bangla", "bulgarian", "catalan", "chineseSimplified", "chineseTraditional", "croatian", "czech", "danish", "dutch", "english", "french", "german", "greek", "gujarati", "hindi", "icelandic", "indonesian", "italian", "japanese", "kannada", "korean", "malay", "malayalam", "marathi", "norwegianBokmaal", "polish", "portuguese", "portugueseBrazilian", "punjabi", "romanian", "russian", "serbianCyrillic", "serbianLatin", "slovenian", "spanish", "swedish", "tamil", "telugu", "thai", "ukrainian", "urdu", "vietnamese". - :type language: str or ~azure.search.documents.indexes.models.MicrosoftTokenizerLanguage + :paramtype language: str or ~azure.search.documents.indexes.models.MicrosoftTokenizerLanguage """ _validation = { @@ -3365,18 +3462,18 @@ class NGramTokenFilter(TokenFilter): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled + :keyword odata_type: Required. Identifies the concrete type of the token filter.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, + :paramtype odata_type: str + :keyword name: Required. The name of the token filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str - :param min_gram: The minimum n-gram length. Default is 1. Must be less than the value of + :paramtype name: str + :keyword min_gram: The minimum n-gram length. Default is 1. Must be less than the value of maxGram. - :type min_gram: int - :param max_gram: The maximum n-gram length. Default is 2. - :type max_gram: int + :paramtype min_gram: int + :keyword max_gram: The maximum n-gram length. Default is 2. + :paramtype max_gram: int """ _validation = { @@ -3406,18 +3503,18 @@ class NGramTokenFilterV2(TokenFilter): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled + :keyword odata_type: Required. Identifies the concrete type of the token filter.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, + :paramtype odata_type: str + :keyword name: Required. The name of the token filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str - :param min_gram: The minimum n-gram length. Default is 1. Maximum is 300. Must be less than the - value of maxGram. - :type min_gram: int - :param max_gram: The maximum n-gram length. Default is 2. Maximum is 300. - :type max_gram: int + :paramtype name: str + :keyword min_gram: The minimum n-gram length. Default is 1. Maximum is 300. Must be less than + the value of maxGram. + :paramtype min_gram: int + :keyword max_gram: The maximum n-gram length. Default is 2. Maximum is 300. + :paramtype max_gram: int """ _validation = { @@ -3449,20 +3546,20 @@ class NGramTokenizer(LexicalTokenizer): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the tokenizer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param min_gram: The minimum n-gram length. Default is 1. Maximum is 300. Must be less than the - value of maxGram. - :type min_gram: int - :param max_gram: The maximum n-gram length. Default is 2. Maximum is 300. - :type max_gram: int - :param token_chars: Character classes to keep in the tokens. - :type token_chars: list[str or ~azure.search.documents.indexes.models.TokenCharacterKind] + :paramtype odata_type: str + :keyword name: Required. The name of the tokenizer. It must only contain letters, digits, + spaces, dashes or underscores, can only start and end with alphanumeric characters, and is + limited to 128 characters. + :paramtype name: str + :keyword min_gram: The minimum n-gram length. Default is 1. Maximum is 300. Must be less than + the value of maxGram. + :paramtype min_gram: int + :keyword max_gram: The maximum n-gram length. Default is 2. Maximum is 300. + :paramtype max_gram: int + :keyword token_chars: Character classes to keep in the tokens. + :paramtype token_chars: list[str or ~azure.search.documents.indexes.models.TokenCharacterKind] """ _validation = { @@ -3496,37 +3593,39 @@ class OcrSkill(SearchIndexerSkill): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the skill.Constant filled by server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill + :paramtype odata_type: str + :keyword name: The name of the skill which uniquely identifies it within the skillset. A skill with no name defined will be given a default name of its 1-based index in the skills array, prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] - :param default_language_code: A value indicating which language code to use. Default is en. + :paramtype name: str + :keyword description: The description of the skill which describes the inputs, outputs, and + usage of the skill. + :paramtype description: str + :keyword context: Represents the level at which operations take place, such as the document + root or document content (for example, /document or /document/content). The default is + /document. + :paramtype context: str + :keyword inputs: Required. Inputs of the skills could be a column in the source data set, or + the output of an upstream skill. + :paramtype inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] + :keyword outputs: Required. The output of a skill is either a field in a search index, or a + value that can be consumed as an input by another skill. + :paramtype outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] + :keyword default_language_code: A value indicating which language code to use. Default is en. Possible values include: "zh-Hans", "zh-Hant", "cs", "da", "nl", "en", "fi", "fr", "de", "el", "hu", "it", "ja", "ko", "nb", "pl", "pt", "ru", "es", "sv", "tr", "ar", "ro", "sr-Cyrl", "sr-Latn", "sk". - :type default_language_code: str or ~azure.search.documents.indexes.models.OcrSkillLanguage - :param should_detect_orientation: A value indicating to turn orientation detection on or not. + :paramtype default_language_code: str or + ~azure.search.documents.indexes.models.OcrSkillLanguage + :keyword should_detect_orientation: A value indicating to turn orientation detection on or not. Default is false. - :type should_detect_orientation: bool - :param line_ending: Defines the sequence of characters to use between the lines of text + :paramtype should_detect_orientation: bool + :keyword line_ending: Defines the sequence of characters to use between the lines of text recognized by the OCR skill. The default value is "space". Possible values include: "space", "carriageReturn", "lineFeed", "carriageReturnLineFeed". - :type line_ending: str or ~azure.search.documents.indexes.models.LineEnding + :paramtype line_ending: str or ~azure.search.documents.indexes.models.LineEnding """ _validation = { @@ -3563,10 +3662,10 @@ class OutputFieldMappingEntry(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the output defined by the skill. - :type name: str - :param target_name: The target name of the output. It is optional and default to name. - :type target_name: str + :keyword name: Required. The name of the output defined by the skill. + :paramtype name: str + :keyword target_name: The target name of the output. It is optional and default to name. + :paramtype target_name: str """ _validation = { @@ -3592,24 +3691,24 @@ class PathHierarchyTokenizerV2(LexicalTokenizer): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the tokenizer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param delimiter: The delimiter character to use. Default is "/". - :type delimiter: str - :param replacement: A value that, if set, replaces the delimiter character. Default is "/". - :type replacement: str - :param max_token_length: The maximum token length. Default and maximum is 300. - :type max_token_length: int - :param reverse_token_order: A value indicating whether to generate tokens in reverse order. + :paramtype odata_type: str + :keyword name: Required. The name of the tokenizer. It must only contain letters, digits, + spaces, dashes or underscores, can only start and end with alphanumeric characters, and is + limited to 128 characters. + :paramtype name: str + :keyword delimiter: The delimiter character to use. Default is "/". + :paramtype delimiter: str + :keyword replacement: A value that, if set, replaces the delimiter character. Default is "/". + :paramtype replacement: str + :keyword max_token_length: The maximum token length. Default and maximum is 300. + :paramtype max_token_length: int + :keyword reverse_token_order: A value indicating whether to generate tokens in reverse order. Default is false. - :type reverse_token_order: bool - :param number_of_tokens_to_skip: The number of initial tokens to skip. Default is 0. - :type number_of_tokens_to_skip: int + :paramtype reverse_token_order: bool + :keyword number_of_tokens_to_skip: The number of initial tokens to skip. Default is 0. + :paramtype number_of_tokens_to_skip: int """ _validation = { @@ -3641,29 +3740,52 @@ def __init__( self.number_of_tokens_to_skip = kwargs.get('number_of_tokens_to_skip', 0) +class Paths1Cj7DxmIndexersIndexernameSearchResetdocsPostRequestbodyContentApplicationJsonSchema(msrest.serialization.Model): + """Paths1Cj7DxmIndexersIndexernameSearchResetdocsPostRequestbodyContentApplicationJsonSchema. + + :keyword document_keys: document keys to be reset. + :paramtype document_keys: list[str] + :keyword datasource_document_ids: datasource document identifiers to be reset. + :paramtype datasource_document_ids: list[str] + """ + + _attribute_map = { + 'document_keys': {'key': 'documentKeys', 'type': '[str]'}, + 'datasource_document_ids': {'key': 'datasourceDocumentIds', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(Paths1Cj7DxmIndexersIndexernameSearchResetdocsPostRequestbodyContentApplicationJsonSchema, self).__init__(**kwargs) + self.document_keys = kwargs.get('document_keys', None) + self.datasource_document_ids = kwargs.get('datasource_document_ids', None) + + class PatternAnalyzer(LexicalAnalyzer): """Flexibly separates text into terms via a regular expression pattern. This analyzer is implemented using Apache Lucene. All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the analyzer.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the analyzer.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the analyzer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param lower_case_terms: A value indicating whether terms should be lower-cased. Default is + :paramtype odata_type: str + :keyword name: Required. The name of the analyzer. It must only contain letters, digits, + spaces, dashes or underscores, can only start and end with alphanumeric characters, and is + limited to 128 characters. + :paramtype name: str + :keyword lower_case_terms: A value indicating whether terms should be lower-cased. Default is true. - :type lower_case_terms: bool - :param pattern: A regular expression pattern to match token separators. Default is an + :paramtype lower_case_terms: bool + :keyword pattern: A regular expression pattern to match token separators. Default is an expression that matches one or more non-word characters. - :type pattern: str - :param flags: Regular expression flags. Possible values include: "CANON_EQ", + :paramtype pattern: str + :keyword flags: Regular expression flags. Possible values include: "CANON_EQ", "CASE_INSENSITIVE", "COMMENTS", "DOTALL", "LITERAL", "MULTILINE", "UNICODE_CASE", "UNIX_LINES". - :type flags: str or ~azure.search.documents.indexes.models.RegexFlags - :param stopwords: A list of stopwords. - :type stopwords: list[str] + :paramtype flags: str or ~azure.search.documents.indexes.models.RegexFlags + :keyword stopwords: A list of stopwords. + :paramtype stopwords: list[str] """ _validation = { @@ -3697,18 +3819,18 @@ class PatternCaptureTokenFilter(TokenFilter): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled + :keyword odata_type: Required. Identifies the concrete type of the token filter.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, + :paramtype odata_type: str + :keyword name: Required. The name of the token filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str - :param patterns: Required. A list of patterns to match against each token. - :type patterns: list[str] - :param preserve_original: A value indicating whether to return the original token even if one + :paramtype name: str + :keyword patterns: Required. A list of patterns to match against each token. + :paramtype patterns: list[str] + :keyword preserve_original: A value indicating whether to return the original token even if one of the patterns matches. Default is true. - :type preserve_original: bool + :paramtype preserve_original: bool """ _validation = { @@ -3739,17 +3861,17 @@ class PatternReplaceCharFilter(CharFilter): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the char filter.Constant filled by - server. - :type odata_type: str - :param name: Required. The name of the char filter. It must only contain letters, digits, + :keyword odata_type: Required. Identifies the concrete type of the char filter.Constant filled + by server. + :paramtype odata_type: str + :keyword name: Required. The name of the char filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str - :param pattern: Required. A regular expression pattern. - :type pattern: str - :param replacement: Required. The replacement text. - :type replacement: str + :paramtype name: str + :keyword pattern: Required. A regular expression pattern. + :paramtype pattern: str + :keyword replacement: Required. The replacement text. + :paramtype replacement: str """ _validation = { @@ -3781,17 +3903,17 @@ class PatternReplaceTokenFilter(TokenFilter): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled + :keyword odata_type: Required. Identifies the concrete type of the token filter.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, + :paramtype odata_type: str + :keyword name: Required. The name of the token filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str - :param pattern: Required. A regular expression pattern. - :type pattern: str - :param replacement: Required. The replacement text. - :type replacement: str + :paramtype name: str + :keyword pattern: Required. A regular expression pattern. + :paramtype pattern: str + :keyword replacement: Required. The replacement text. + :paramtype replacement: str """ _validation = { @@ -3823,23 +3945,23 @@ class PatternTokenizer(LexicalTokenizer): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the tokenizer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param pattern: A regular expression pattern to match token separators. Default is an + :paramtype odata_type: str + :keyword name: Required. The name of the tokenizer. It must only contain letters, digits, + spaces, dashes or underscores, can only start and end with alphanumeric characters, and is + limited to 128 characters. + :paramtype name: str + :keyword pattern: A regular expression pattern to match token separators. Default is an expression that matches one or more non-word characters. - :type pattern: str - :param flags: Regular expression flags. Possible values include: "CANON_EQ", + :paramtype pattern: str + :keyword flags: Regular expression flags. Possible values include: "CANON_EQ", "CASE_INSENSITIVE", "COMMENTS", "DOTALL", "LITERAL", "MULTILINE", "UNICODE_CASE", "UNIX_LINES". - :type flags: str or ~azure.search.documents.indexes.models.RegexFlags - :param group: The zero-based ordinal of the matching group in the regular expression pattern to - extract into tokens. Use -1 if you want to use the entire pattern to split the input into + :paramtype flags: str or ~azure.search.documents.indexes.models.RegexFlags + :keyword group: The zero-based ordinal of the matching group in the regular expression pattern + to extract into tokens. Use -1 if you want to use the entire pattern to split the input into tokens, irrespective of matching groups. Default is -1. - :type group: int + :paramtype group: int """ _validation = { @@ -3871,20 +3993,20 @@ class PhoneticTokenFilter(TokenFilter): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled + :keyword odata_type: Required. Identifies the concrete type of the token filter.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, + :paramtype odata_type: str + :keyword name: Required. The name of the token filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str - :param encoder: The phonetic encoder to use. Default is "metaphone". Possible values include: + :paramtype name: str + :keyword encoder: The phonetic encoder to use. Default is "metaphone". Possible values include: "metaphone", "doubleMetaphone", "soundex", "refinedSoundex", "caverphone1", "caverphone2", "cologne", "nysiis", "koelnerPhonetik", "haasePhonetik", "beiderMorse". - :type encoder: str or ~azure.search.documents.indexes.models.PhoneticEncoder - :param replace_original_tokens: A value indicating whether encoded tokens should replace + :paramtype encoder: str or ~azure.search.documents.indexes.models.PhoneticEncoder + :keyword replace_original_tokens: A value indicating whether encoded tokens should replace original tokens. If false, encoded tokens are added as synonyms. Default is true. - :type replace_original_tokens: bool + :paramtype replace_original_tokens: bool """ _validation = { @@ -3914,46 +4036,48 @@ class PIIDetectionSkill(SearchIndexerSkill): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the skill.Constant filled by server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill + :paramtype odata_type: str + :keyword name: The name of the skill which uniquely identifies it within the skillset. A skill with no name defined will be given a default name of its 1-based index in the skills array, prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] - :param default_language_code: A value indicating which language code to use. Default is en. - :type default_language_code: str - :param minimum_precision: A value between 0 and 1 that be used to only include entities whose + :paramtype name: str + :keyword description: The description of the skill which describes the inputs, outputs, and + usage of the skill. + :paramtype description: str + :keyword context: Represents the level at which operations take place, such as the document + root or document content (for example, /document or /document/content). The default is + /document. + :paramtype context: str + :keyword inputs: Required. Inputs of the skills could be a column in the source data set, or + the output of an upstream skill. + :paramtype inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] + :keyword outputs: Required. The output of a skill is either a field in a search index, or a + value that can be consumed as an input by another skill. + :paramtype outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] + :keyword default_language_code: A value indicating which language code to use. Default is en. + :paramtype default_language_code: str + :keyword minimum_precision: A value between 0 and 1 that be used to only include entities whose confidence score is greater than the value specified. If not set (default), or if explicitly set to null, all entities will be included. - :type minimum_precision: float - :param masking_mode: A parameter that provides various ways to mask the personal information + :paramtype minimum_precision: float + :keyword masking_mode: A parameter that provides various ways to mask the personal information detected in the input text. Default is 'none'. Possible values include: "none", "replace". - :type masking_mode: str or ~azure.search.documents.indexes.models.PIIDetectionSkillMaskingMode - :param masking_character: The character used to mask the text if the maskingMode parameter is + :paramtype masking_mode: str or + ~azure.search.documents.indexes.models.PIIDetectionSkillMaskingMode + :keyword masking_character: The character used to mask the text if the maskingMode parameter is set to replace. Default is '*'. - :type masking_character: str - :param model_version: The version of the model to use when calling the Text Analytics service. - It will default to the latest available when not specified. We recommend you do not specify - this value unless absolutely necessary. - :type model_version: str - :param pii_categories: A list of PII entity categories that should be extracted and masked. - :type pii_categories: list[str] - :param domain: If specified, will set the PII domain to include only a subset of the entity + :paramtype masking_character: str + :keyword model_version: The version of the model to use when calling the Text Analytics + service. It will default to the latest available when not specified. We recommend you do not + specify this value unless absolutely necessary. + :paramtype model_version: str + :keyword pii_categories: A list of PII entity categories that should be extracted and masked. + :paramtype pii_categories: list[str] + :keyword domain: If specified, will set the PII domain to include only a subset of the entity categories. Possible values include: 'phi', 'none'. Default is 'none'. - :type domain: str + :paramtype domain: str """ _validation = { @@ -3998,8 +4122,8 @@ def __init__( class RequestOptions(msrest.serialization.Model): """Parameter group. - :param x_ms_client_request_id: The tracking ID sent with the request to help with debugging. - :type x_ms_client_request_id: str + :keyword x_ms_client_request_id: The tracking ID sent with the request to help with debugging. + :paramtype x_ms_client_request_id: str """ _attribute_map = { @@ -4019,10 +4143,10 @@ class ResourceCounter(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param usage: Required. The resource usage amount. - :type usage: long - :param quota: The resource amount quota. - :type quota: long + :keyword usage: Required. The resource usage amount. + :paramtype usage: long + :keyword quota: The resource amount quota. + :paramtype quota: long """ _validation = { @@ -4048,17 +4172,17 @@ class ScoringProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the scoring profile. - :type name: str - :param text_weights: Parameters that boost scoring based on text matches in certain index + :keyword name: Required. The name of the scoring profile. + :paramtype name: str + :keyword text_weights: Parameters that boost scoring based on text matches in certain index fields. - :type text_weights: ~azure.search.documents.indexes.models.TextWeights - :param functions: The collection of functions that influence the scoring of documents. - :type functions: list[~azure.search.documents.indexes.models.ScoringFunction] - :param function_aggregation: A value indicating how the results of individual scoring functions - should be combined. Defaults to "Sum". Ignored if there are no scoring functions. Possible - values include: "sum", "average", "minimum", "maximum", "firstMatching". - :type function_aggregation: str or + :paramtype text_weights: ~azure.search.documents.indexes.models.TextWeights + :keyword functions: The collection of functions that influence the scoring of documents. + :paramtype functions: list[~azure.search.documents.indexes.models.ScoringFunction] + :keyword function_aggregation: A value indicating how the results of individual scoring + functions should be combined. Defaults to "Sum". Ignored if there are no scoring functions. + Possible values include: "sum", "average", "minimum", "maximum", "firstMatching". + :paramtype function_aggregation: str or ~azure.search.documents.indexes.models.ScoringFunctionAggregation """ @@ -4126,43 +4250,43 @@ class SearchField(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the field, which must be unique within the fields collection - of the index or parent field. - :type name: str - :param type: Required. The data type of the field. Possible values include: "Edm.String", + :keyword name: Required. The name of the field, which must be unique within the fields + collection of the index or parent field. + :paramtype name: str + :keyword type: Required. The data type of the field. Possible values include: "Edm.String", "Edm.Int32", "Edm.Int64", "Edm.Double", "Edm.Boolean", "Edm.DateTimeOffset", "Edm.GeographyPoint", "Edm.ComplexType". - :type type: str or ~azure.search.documents.indexes.models.SearchFieldDataType - :param key: A value indicating whether the field uniquely identifies documents in the index. + :paramtype type: str or ~azure.search.documents.indexes.models.SearchFieldDataType + :keyword key: A value indicating whether the field uniquely identifies documents in the index. Exactly one top-level field in each index must be chosen as the key field and it must be of type Edm.String. Key fields can be used to look up documents directly and update or delete specific documents. Default is false for simple fields and null for complex fields. - :type key: bool - :param retrievable: A value indicating whether the field can be returned in a search result. + :paramtype key: bool + :keyword retrievable: A value indicating whether the field can be returned in a search result. You can disable this option if you want to use a field (for example, margin) as a filter, sorting, or scoring mechanism but do not want the field to be visible to the end user. This property must be true for key fields, and it must be null for complex fields. This property can be changed on existing fields. Enabling this property does not cause any increase in index storage requirements. Default is true for simple fields and null for complex fields. - :type retrievable: bool - :param searchable: A value indicating whether the field is full-text searchable. This means it - will undergo analysis such as word-breaking during indexing. If you set a searchable field to a - value like "sunny day", internally it will be split into the individual tokens "sunny" and + :paramtype retrievable: bool + :keyword searchable: A value indicating whether the field is full-text searchable. This means + it will undergo analysis such as word-breaking during indexing. If you set a searchable field + to a value like "sunny day", internally it will be split into the individual tokens "sunny" and "day". This enables full-text searches for these terms. Fields of type Edm.String or Collection(Edm.String) are searchable by default. This property must be false for simple fields of other non-string data types, and it must be null for complex fields. Note: searchable fields consume extra space in your index since Azure Cognitive Search will store an additional tokenized version of the field value for full-text searches. If you want to save space in your index and you don't need a field to be included in searches, set searchable to false. - :type searchable: bool - :param filterable: A value indicating whether to enable the field to be referenced in $filter + :paramtype searchable: bool + :keyword filterable: A value indicating whether to enable the field to be referenced in $filter queries. filterable differs from searchable in how strings are handled. Fields of type Edm.String or Collection(Edm.String) that are filterable do not undergo word-breaking, so comparisons are for exact matches only. For example, if you set such a field f to "sunny day", $filter=f eq 'sunny' will find no matches, but $filter=f eq 'sunny day' will. This property must be null for complex fields. Default is true for simple fields and null for complex fields. - :type filterable: bool - :param sortable: A value indicating whether to enable the field to be referenced in $orderby + :paramtype filterable: bool + :keyword sortable: A value indicating whether to enable the field to be referenced in $orderby expressions. By default Azure Cognitive Search sorts results by score, but in many experiences users will want to sort by fields in the documents. A simple field can be sortable only if it is single-valued (it has a single value in the scope of the parent document). Simple collection @@ -4172,15 +4296,15 @@ class SearchField(msrest.serialization.Model): cannot be sortable and the sortable property must be null for such fields. The default for sortable is true for single-valued simple fields, false for multi-valued simple fields, and null for complex fields. - :type sortable: bool - :param facetable: A value indicating whether to enable the field to be referenced in facet + :paramtype sortable: bool + :keyword facetable: A value indicating whether to enable the field to be referenced in facet queries. Typically used in a presentation of search results that includes hit count by category (for example, search for digital cameras and see hits by brand, by megapixels, by price, and so on). This property must be null for complex fields. Fields of type Edm.GeographyPoint or Collection(Edm.GeographyPoint) cannot be facetable. Default is true for all other simple fields. - :type facetable: bool - :param analyzer: The name of the analyzer to use for the field. This option can be used only + :paramtype facetable: bool + :keyword analyzer: The name of the analyzer to use for the field. This option can be used only with searchable fields and it can't be set together with either searchAnalyzer or indexAnalyzer. Once the analyzer is chosen, it cannot be changed for the field. Must be null for complex fields. Possible values include: "ar.microsoft", "ar.lucene", "hy.lucene", @@ -4200,11 +4324,11 @@ class SearchField(msrest.serialization.Model): "th.microsoft", "th.lucene", "tr.microsoft", "tr.lucene", "uk.microsoft", "ur.microsoft", "vi.microsoft", "standard.lucene", "standardasciifolding.lucene", "keyword", "pattern", "simple", "stop", "whitespace". - :type analyzer: str or ~azure.search.documents.indexes.models.LexicalAnalyzerName - :param search_analyzer: The name of the analyzer used at search time for the field. This option - can be used only with searchable fields. It must be set together with indexAnalyzer and it - cannot be set together with the analyzer option. This property cannot be set to the name of a - language analyzer; use the analyzer property instead if you need a language analyzer. This + :paramtype analyzer: str or ~azure.search.documents.indexes.models.LexicalAnalyzerName + :keyword search_analyzer: The name of the analyzer used at search time for the field. This + option can be used only with searchable fields. It must be set together with indexAnalyzer and + it cannot be set together with the analyzer option. This property cannot be set to the name of + a language analyzer; use the analyzer property instead if you need a language analyzer. This analyzer can be updated on an existing field. Must be null for complex fields. Possible values include: "ar.microsoft", "ar.lucene", "hy.lucene", "bn.microsoft", "eu.lucene", "bg.microsoft", "bg.lucene", "ca.microsoft", "ca.lucene", "zh-Hans.microsoft", "zh-Hans.lucene", @@ -4223,8 +4347,8 @@ class SearchField(msrest.serialization.Model): "th.lucene", "tr.microsoft", "tr.lucene", "uk.microsoft", "ur.microsoft", "vi.microsoft", "standard.lucene", "standardasciifolding.lucene", "keyword", "pattern", "simple", "stop", "whitespace". - :type search_analyzer: str or ~azure.search.documents.indexes.models.LexicalAnalyzerName - :param index_analyzer: The name of the analyzer used at indexing time for the field. This + :paramtype search_analyzer: str or ~azure.search.documents.indexes.models.LexicalAnalyzerName + :keyword index_analyzer: The name of the analyzer used at indexing time for the field. This option can be used only with searchable fields. It must be set together with searchAnalyzer and it cannot be set together with the analyzer option. This property cannot be set to the name of a language analyzer; use the analyzer property instead if you need a language analyzer. Once @@ -4246,21 +4370,21 @@ class SearchField(msrest.serialization.Model): "th.lucene", "tr.microsoft", "tr.lucene", "uk.microsoft", "ur.microsoft", "vi.microsoft", "standard.lucene", "standardasciifolding.lucene", "keyword", "pattern", "simple", "stop", "whitespace". - :type index_analyzer: str or ~azure.search.documents.indexes.models.LexicalAnalyzerName - :param normalizer: The name of the normalizer to use for the field. This option can be used + :paramtype index_analyzer: str or ~azure.search.documents.indexes.models.LexicalAnalyzerName + :keyword normalizer: The name of the normalizer to use for the field. This option can be used only with fields with filterable, sortable, or facetable enabled. Once the normalizer is chosen, it cannot be changed for the field. Must be null for complex fields. Possible values include: "asciifolding", "elision", "lowercase", "standard", "uppercase". - :type normalizer: str or ~azure.search.documents.indexes.models.LexicalNormalizerName - :param synonym_maps: A list of the names of synonym maps to associate with this field. This + :paramtype normalizer: str or ~azure.search.documents.indexes.models.LexicalNormalizerName + :keyword synonym_maps: A list of the names of synonym maps to associate with this field. This option can be used only with searchable fields. Currently only one synonym map per field is supported. Assigning a synonym map to a field ensures that query terms targeting that field are expanded at query-time using the rules in the synonym map. This attribute can be changed on existing fields. Must be null or an empty collection for complex fields. - :type synonym_maps: list[str] - :param fields: A list of sub-fields if this is a field of type Edm.ComplexType or + :paramtype synonym_maps: list[str] + :keyword fields: A list of sub-fields if this is a field of type Edm.ComplexType or Collection(Edm.ComplexType). Must be null or empty for simple fields. - :type fields: list[~azure.search.documents.indexes.models.SearchField] + :paramtype fields: list[~azure.search.documents.indexes.models.SearchField] """ _validation = { @@ -4311,31 +4435,31 @@ class SearchIndex(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the index. - :type name: str - :param fields: Required. The fields of the index. - :type fields: list[~azure.search.documents.indexes.models.SearchField] - :param scoring_profiles: The scoring profiles for the index. - :type scoring_profiles: list[~azure.search.documents.indexes.models.ScoringProfile] - :param default_scoring_profile: The name of the scoring profile to use if none is specified in - the query. If this property is not set and no scoring profile is specified in the query, then - default scoring (tf-idf) will be used. - :type default_scoring_profile: str - :param cors_options: Options to control Cross-Origin Resource Sharing (CORS) for the index. - :type cors_options: ~azure.search.documents.indexes.models.CorsOptions - :param suggesters: The suggesters for the index. - :type suggesters: list[~azure.search.documents.indexes.models.Suggester] - :param analyzers: The analyzers for the index. - :type analyzers: list[~azure.search.documents.indexes.models.LexicalAnalyzer] - :param tokenizers: The tokenizers for the index. - :type tokenizers: list[~azure.search.documents.indexes.models.LexicalTokenizer] - :param token_filters: The token filters for the index. - :type token_filters: list[~azure.search.documents.indexes.models.TokenFilter] - :param char_filters: The character filters for the index. - :type char_filters: list[~azure.search.documents.indexes.models.CharFilter] - :param normalizers: The normalizers for the index. - :type normalizers: list[~azure.search.documents.indexes.models.LexicalNormalizer] - :param encryption_key: A description of an encryption key that you create in Azure Key Vault. + :keyword name: Required. The name of the index. + :paramtype name: str + :keyword fields: Required. The fields of the index. + :paramtype fields: list[~azure.search.documents.indexes.models.SearchField] + :keyword scoring_profiles: The scoring profiles for the index. + :paramtype scoring_profiles: list[~azure.search.documents.indexes.models.ScoringProfile] + :keyword default_scoring_profile: The name of the scoring profile to use if none is specified + in the query. If this property is not set and no scoring profile is specified in the query, + then default scoring (tf-idf) will be used. + :paramtype default_scoring_profile: str + :keyword cors_options: Options to control Cross-Origin Resource Sharing (CORS) for the index. + :paramtype cors_options: ~azure.search.documents.indexes.models.CorsOptions + :keyword suggesters: The suggesters for the index. + :paramtype suggesters: list[~azure.search.documents.indexes.models.Suggester] + :keyword analyzers: The analyzers for the index. + :paramtype analyzers: list[~azure.search.documents.indexes.models.LexicalAnalyzer] + :keyword tokenizers: The tokenizers for the index. + :paramtype tokenizers: list[~azure.search.documents.indexes.models.LexicalTokenizer] + :keyword token_filters: The token filters for the index. + :paramtype token_filters: list[~azure.search.documents.indexes.models.TokenFilter] + :keyword char_filters: The character filters for the index. + :paramtype char_filters: list[~azure.search.documents.indexes.models.CharFilter] + :keyword normalizers: The normalizers for the index. + :paramtype normalizers: list[~azure.search.documents.indexes.models.LexicalNormalizer] + :keyword encryption_key: A description of an encryption key that you create in Azure Key Vault. This key is used to provide an additional level of encryption-at-rest for your data when you want full assurance that no one, not even Microsoft, can decrypt your data in Azure Cognitive Search. Once you have encrypted your data, it will always remain encrypted. Azure Cognitive @@ -4343,14 +4467,14 @@ class SearchIndex(msrest.serialization.Model): needed if you want to rotate your encryption key; Your data will be unaffected. Encryption with customer-managed keys is not available for free search services, and is only available for paid services created on or after January 1, 2019. - :type encryption_key: ~azure.search.documents.indexes.models.SearchResourceEncryptionKey - :param similarity: The type of similarity algorithm to be used when scoring and ranking the + :paramtype encryption_key: ~azure.search.documents.indexes.models.SearchResourceEncryptionKey + :keyword similarity: The type of similarity algorithm to be used when scoring and ranking the documents matching a search query. The similarity algorithm can only be defined at index creation time and cannot be modified on existing indexes. If null, the ClassicSimilarity algorithm is used. - :type similarity: ~azure.search.documents.indexes.models.Similarity - :param e_tag: The ETag of the index. - :type e_tag: str + :paramtype similarity: ~azure.search.documents.indexes.models.Similarity + :keyword e_tag: The ETag of the index. + :paramtype e_tag: str """ _validation = { @@ -4401,32 +4525,32 @@ class SearchIndexer(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the indexer. - :type name: str - :param description: The description of the indexer. - :type description: str - :param data_source_name: Required. The name of the datasource from which this indexer reads + :keyword name: Required. The name of the indexer. + :paramtype name: str + :keyword description: The description of the indexer. + :paramtype description: str + :keyword data_source_name: Required. The name of the datasource from which this indexer reads data. - :type data_source_name: str - :param skillset_name: The name of the skillset executing with this indexer. - :type skillset_name: str - :param target_index_name: Required. The name of the index to which this indexer writes data. - :type target_index_name: str - :param schedule: The schedule for this indexer. - :type schedule: ~azure.search.documents.indexes.models.IndexingSchedule - :param parameters: Parameters for indexer execution. - :type parameters: ~azure.search.documents.indexes.models.IndexingParameters - :param field_mappings: Defines mappings between fields in the data source and corresponding + :paramtype data_source_name: str + :keyword skillset_name: The name of the skillset executing with this indexer. + :paramtype skillset_name: str + :keyword target_index_name: Required. The name of the index to which this indexer writes data. + :paramtype target_index_name: str + :keyword schedule: The schedule for this indexer. + :paramtype schedule: ~azure.search.documents.indexes.models.IndexingSchedule + :keyword parameters: Parameters for indexer execution. + :paramtype parameters: ~azure.search.documents.indexes.models.IndexingParameters + :keyword field_mappings: Defines mappings between fields in the data source and corresponding target fields in the index. - :type field_mappings: list[~azure.search.documents.indexes.models.FieldMapping] - :param output_field_mappings: Output field mappings are applied after enrichment and + :paramtype field_mappings: list[~azure.search.documents.indexes.models.FieldMapping] + :keyword output_field_mappings: Output field mappings are applied after enrichment and immediately before indexing. - :type output_field_mappings: list[~azure.search.documents.indexes.models.FieldMapping] - :param is_disabled: A value indicating whether the indexer is disabled. Default is false. - :type is_disabled: bool - :param e_tag: The ETag of the indexer. - :type e_tag: str - :param encryption_key: A description of an encryption key that you create in Azure Key Vault. + :paramtype output_field_mappings: list[~azure.search.documents.indexes.models.FieldMapping] + :keyword is_disabled: A value indicating whether the indexer is disabled. Default is false. + :paramtype is_disabled: bool + :keyword e_tag: The ETag of the indexer. + :paramtype e_tag: str + :keyword encryption_key: A description of an encryption key that you create in Azure Key Vault. This key is used to provide an additional level of encryption-at-rest for your indexer definition (as well as indexer execution status) when you want full assurance that no one, not even Microsoft, can decrypt them in Azure Cognitive Search. Once you have encrypted your @@ -4435,10 +4559,10 @@ class SearchIndexer(msrest.serialization.Model): rotate your encryption key; Your indexer definition (and indexer execution status) will be unaffected. Encryption with customer-managed keys is not available for free search services, and is only available for paid services created on or after January 1, 2019. - :type encryption_key: ~azure.search.documents.indexes.models.SearchResourceEncryptionKey - :param cache: Adds caching to an enrichment pipeline to allow for incremental modification + :paramtype encryption_key: ~azure.search.documents.indexes.models.SearchResourceEncryptionKey + :keyword cache: Adds caching to an enrichment pipeline to allow for incremental modification steps without having to rebuild the index every time. - :type cache: ~azure.search.documents.indexes.models.SearchIndexerCache + :paramtype cache: ~azure.search.documents.indexes.models.SearchIndexerCache """ _validation = { @@ -4486,11 +4610,11 @@ def __init__( class SearchIndexerCache(msrest.serialization.Model): """SearchIndexerCache. - :param storage_connection_string: The connection string to the storage account where the cache - data will be persisted. - :type storage_connection_string: str - :param enable_reprocessing: Specifies whether incremental reprocessing is enabled. - :type enable_reprocessing: bool + :keyword storage_connection_string: The connection string to the storage account where the + cache data will be persisted. + :paramtype storage_connection_string: str + :keyword enable_reprocessing: Specifies whether incremental reprocessing is enabled. + :paramtype enable_reprocessing: bool """ _attribute_map = { @@ -4512,12 +4636,12 @@ class SearchIndexerDataContainer(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the table or view (for Azure SQL data source) or collection - (for CosmosDB data source) that will be indexed. - :type name: str - :param query: A query that is applied to this data container. The syntax and meaning of this + :keyword name: Required. The name of the table or view (for Azure SQL data source) or + collection (for CosmosDB data source) that will be indexed. + :paramtype name: str + :keyword query: A query that is applied to this data container. The syntax and meaning of this parameter is datasource-specific. Not supported by Azure SQL datasources. - :type query: str + :paramtype query: str """ _validation = { @@ -4546,9 +4670,9 @@ class SearchIndexerDataIdentity(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the identity.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the identity.Constant filled by server. - :type odata_type: str + :paramtype odata_type: str """ _validation = { @@ -4576,9 +4700,9 @@ class SearchIndexerDataNoneIdentity(SearchIndexerDataIdentity): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the identity.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the identity.Constant filled by server. - :type odata_type: str + :paramtype odata_type: str """ _validation = { @@ -4602,31 +4726,31 @@ class SearchIndexerDataSource(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the datasource. - :type name: str - :param description: The description of the datasource. - :type description: str - :param type: Required. The type of the datasource. Possible values include: "azuresql", + :keyword name: Required. The name of the datasource. + :paramtype name: str + :keyword description: The description of the datasource. + :paramtype description: str + :keyword type: Required. The type of the datasource. Possible values include: "azuresql", "cosmosdb", "azureblob", "azuretable", "mysql", "adlsgen2". - :type type: str or ~azure.search.documents.indexes.models.SearchIndexerDataSourceType - :param credentials: Required. Credentials for the datasource. - :type credentials: ~azure.search.documents.indexes.models.DataSourceCredentials - :param container: Required. The data container for the datasource. - :type container: ~azure.search.documents.indexes.models.SearchIndexerDataContainer - :param identity: An explicit managed identity to use for this datasource. If not specified and - the connection string is a managed identity, the system-assigned managed identity is used. If - not specified, the value remains unchanged. If "none" is specified, the value of this property - is cleared. - :type identity: ~azure.search.documents.indexes.models.SearchIndexerDataIdentity - :param data_change_detection_policy: The data change detection policy for the datasource. - :type data_change_detection_policy: + :paramtype type: str or ~azure.search.documents.indexes.models.SearchIndexerDataSourceType + :keyword credentials: Required. Credentials for the datasource. + :paramtype credentials: ~azure.search.documents.indexes.models.DataSourceCredentials + :keyword container: Required. The data container for the datasource. + :paramtype container: ~azure.search.documents.indexes.models.SearchIndexerDataContainer + :keyword identity: An explicit managed identity to use for this datasource. If not specified + and the connection string is a managed identity, the system-assigned managed identity is used. + If not specified, the value remains unchanged. If "none" is specified, the value of this + property is cleared. + :paramtype identity: ~azure.search.documents.indexes.models.SearchIndexerDataIdentity + :keyword data_change_detection_policy: The data change detection policy for the datasource. + :paramtype data_change_detection_policy: ~azure.search.documents.indexes.models.DataChangeDetectionPolicy - :param data_deletion_detection_policy: The data deletion detection policy for the datasource. - :type data_deletion_detection_policy: + :keyword data_deletion_detection_policy: The data deletion detection policy for the datasource. + :paramtype data_deletion_detection_policy: ~azure.search.documents.indexes.models.DataDeletionDetectionPolicy - :param e_tag: The ETag of the data source. - :type e_tag: str - :param encryption_key: A description of an encryption key that you create in Azure Key Vault. + :keyword e_tag: The ETag of the data source. + :paramtype e_tag: str + :keyword encryption_key: A description of an encryption key that you create in Azure Key Vault. This key is used to provide an additional level of encryption-at-rest for your datasource definition when you want full assurance that no one, not even Microsoft, can decrypt your data source definition in Azure Cognitive Search. Once you have encrypted your data source @@ -4635,7 +4759,7 @@ class SearchIndexerDataSource(msrest.serialization.Model): encryption key; Your datasource definition will be unaffected. Encryption with customer-managed keys is not available for free search services, and is only available for paid services created on or after January 1, 2019. - :type encryption_key: ~azure.search.documents.indexes.models.SearchResourceEncryptionKey + :paramtype encryption_key: ~azure.search.documents.indexes.models.SearchResourceEncryptionKey """ _validation = { @@ -4680,14 +4804,14 @@ class SearchIndexerDataUserAssignedIdentity(SearchIndexerDataIdentity): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the identity.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the identity.Constant filled by server. - :type odata_type: str - :param user_assigned_identity: Required. The fully qualified Azure resource Id of a user + :paramtype odata_type: str + :keyword user_assigned_identity: Required. The fully qualified Azure resource Id of a user assigned managed identity typically in the form "/subscriptions/12345678-1234-1234-1234-1234567890ab/resourceGroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId" that should have been assigned to the search service. - :type user_assigned_identity: str + :paramtype user_assigned_identity: str """ _validation = { @@ -4773,11 +4897,11 @@ class SearchIndexerKnowledgeStore(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param storage_connection_string: Required. The connection string to the storage account + :keyword storage_connection_string: Required. The connection string to the storage account projections will be stored in. - :type storage_connection_string: str - :param projections: Required. A list of additional projections to perform during indexing. - :type projections: + :paramtype storage_connection_string: str + :keyword projections: Required. A list of additional projections to perform during indexing. + :paramtype projections: list[~azure.search.documents.indexes.models.SearchIndexerKnowledgeStoreProjection] """ @@ -4803,16 +4927,16 @@ def __init__( class SearchIndexerKnowledgeStoreProjectionSelector(msrest.serialization.Model): """Abstract class to share properties between concrete selectors. - :param reference_key_name: Name of reference key to different projection. - :type reference_key_name: str - :param generated_key_name: Name of generated key to store projection under. - :type generated_key_name: str - :param source: Source data to project. - :type source: str - :param source_context: Source context for complex projections. - :type source_context: str - :param inputs: Nested inputs for complex projections. - :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] + :keyword reference_key_name: Name of reference key to different projection. + :paramtype reference_key_name: str + :keyword generated_key_name: Name of generated key to store projection under. + :paramtype generated_key_name: str + :keyword source: Source data to project. + :paramtype source: str + :keyword source_context: Source context for complex projections. + :paramtype source_context: str + :keyword inputs: Nested inputs for complex projections. + :paramtype inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] """ _attribute_map = { @@ -4840,18 +4964,18 @@ class SearchIndexerKnowledgeStoreBlobProjectionSelector(SearchIndexerKnowledgeSt All required parameters must be populated in order to send to Azure. - :param reference_key_name: Name of reference key to different projection. - :type reference_key_name: str - :param generated_key_name: Name of generated key to store projection under. - :type generated_key_name: str - :param source: Source data to project. - :type source: str - :param source_context: Source context for complex projections. - :type source_context: str - :param inputs: Nested inputs for complex projections. - :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] - :param storage_container: Required. Blob container to store projections in. - :type storage_container: str + :keyword reference_key_name: Name of reference key to different projection. + :paramtype reference_key_name: str + :keyword generated_key_name: Name of generated key to store projection under. + :paramtype generated_key_name: str + :keyword source: Source data to project. + :paramtype source: str + :keyword source_context: Source context for complex projections. + :paramtype source_context: str + :keyword inputs: Nested inputs for complex projections. + :paramtype inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] + :keyword storage_container: Required. Blob container to store projections in. + :paramtype storage_container: str """ _validation = { @@ -4880,18 +5004,18 @@ class SearchIndexerKnowledgeStoreFileProjectionSelector(SearchIndexerKnowledgeSt All required parameters must be populated in order to send to Azure. - :param reference_key_name: Name of reference key to different projection. - :type reference_key_name: str - :param generated_key_name: Name of generated key to store projection under. - :type generated_key_name: str - :param source: Source data to project. - :type source: str - :param source_context: Source context for complex projections. - :type source_context: str - :param inputs: Nested inputs for complex projections. - :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] - :param storage_container: Required. Blob container to store projections in. - :type storage_container: str + :keyword reference_key_name: Name of reference key to different projection. + :paramtype reference_key_name: str + :keyword generated_key_name: Name of generated key to store projection under. + :paramtype generated_key_name: str + :keyword source: Source data to project. + :paramtype source: str + :keyword source_context: Source context for complex projections. + :paramtype source_context: str + :keyword inputs: Nested inputs for complex projections. + :paramtype inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] + :keyword storage_container: Required. Blob container to store projections in. + :paramtype storage_container: str """ _validation = { @@ -4919,18 +5043,18 @@ class SearchIndexerKnowledgeStoreObjectProjectionSelector(SearchIndexerKnowledge All required parameters must be populated in order to send to Azure. - :param reference_key_name: Name of reference key to different projection. - :type reference_key_name: str - :param generated_key_name: Name of generated key to store projection under. - :type generated_key_name: str - :param source: Source data to project. - :type source: str - :param source_context: Source context for complex projections. - :type source_context: str - :param inputs: Nested inputs for complex projections. - :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] - :param storage_container: Required. Blob container to store projections in. - :type storage_container: str + :keyword reference_key_name: Name of reference key to different projection. + :paramtype reference_key_name: str + :keyword generated_key_name: Name of generated key to store projection under. + :paramtype generated_key_name: str + :keyword source: Source data to project. + :paramtype source: str + :keyword source_context: Source context for complex projections. + :paramtype source_context: str + :keyword inputs: Nested inputs for complex projections. + :paramtype inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] + :keyword storage_container: Required. Blob container to store projections in. + :paramtype storage_container: str """ _validation = { @@ -4956,14 +5080,14 @@ def __init__( class SearchIndexerKnowledgeStoreProjection(msrest.serialization.Model): """Container object for various projection selectors. - :param tables: Projections to Azure Table storage. - :type tables: + :keyword tables: Projections to Azure Table storage. + :paramtype tables: list[~azure.search.documents.indexes.models.SearchIndexerKnowledgeStoreTableProjectionSelector] - :param objects: Projections to Azure Blob storage. - :type objects: + :keyword objects: Projections to Azure Blob storage. + :paramtype objects: list[~azure.search.documents.indexes.models.SearchIndexerKnowledgeStoreObjectProjectionSelector] - :param files: Projections to Azure File storage. - :type files: + :keyword files: Projections to Azure File storage. + :paramtype files: list[~azure.search.documents.indexes.models.SearchIndexerKnowledgeStoreFileProjectionSelector] """ @@ -4988,18 +5112,18 @@ class SearchIndexerKnowledgeStoreTableProjectionSelector(SearchIndexerKnowledgeS All required parameters must be populated in order to send to Azure. - :param reference_key_name: Name of reference key to different projection. - :type reference_key_name: str - :param generated_key_name: Name of generated key to store projection under. - :type generated_key_name: str - :param source: Source data to project. - :type source: str - :param source_context: Source context for complex projections. - :type source_context: str - :param inputs: Nested inputs for complex projections. - :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] - :param table_name: Required. Name of the Azure table to store projected data in. - :type table_name: str + :keyword reference_key_name: Name of reference key to different projection. + :paramtype reference_key_name: str + :keyword generated_key_name: Name of generated key to store projection under. + :paramtype generated_key_name: str + :keyword source: Source data to project. + :paramtype source: str + :keyword source_context: Source context for complex projections. + :paramtype source_context: str + :keyword inputs: Nested inputs for complex projections. + :paramtype inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] + :keyword table_name: Required. Name of the Azure table to store projected data in. + :paramtype table_name: str """ _validation = { @@ -5066,22 +5190,22 @@ class SearchIndexerSkillset(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the skillset. - :type name: str - :param description: The description of the skillset. - :type description: str - :param skills: Required. A list of skills in the skillset. - :type skills: list[~azure.search.documents.indexes.models.SearchIndexerSkill] - :param cognitive_services_account: Details about cognitive services to be used when running + :keyword name: Required. The name of the skillset. + :paramtype name: str + :keyword description: The description of the skillset. + :paramtype description: str + :keyword skills: Required. A list of skills in the skillset. + :paramtype skills: list[~azure.search.documents.indexes.models.SearchIndexerSkill] + :keyword cognitive_services_account: Details about cognitive services to be used when running skills. - :type cognitive_services_account: + :paramtype cognitive_services_account: ~azure.search.documents.indexes.models.CognitiveServicesAccount - :param knowledge_store: Definition of additional projections to azure blob, table, or files, of - enriched data. - :type knowledge_store: ~azure.search.documents.indexes.models.SearchIndexerKnowledgeStore - :param e_tag: The ETag of the skillset. - :type e_tag: str - :param encryption_key: A description of an encryption key that you create in Azure Key Vault. + :keyword knowledge_store: Definition of additional projections to azure blob, table, or files, + of enriched data. + :paramtype knowledge_store: ~azure.search.documents.indexes.models.SearchIndexerKnowledgeStore + :keyword e_tag: The ETag of the skillset. + :paramtype e_tag: str + :keyword encryption_key: A description of an encryption key that you create in Azure Key Vault. This key is used to provide an additional level of encryption-at-rest for your skillset definition when you want full assurance that no one, not even Microsoft, can decrypt your skillset definition in Azure Cognitive Search. Once you have encrypted your skillset @@ -5090,7 +5214,7 @@ class SearchIndexerSkillset(msrest.serialization.Model): encryption key; Your skillset definition will be unaffected. Encryption with customer-managed keys is not available for free search services, and is only available for paid services created on or after January 1, 2019. - :type encryption_key: ~azure.search.documents.indexes.models.SearchResourceEncryptionKey + :paramtype encryption_key: ~azure.search.documents.indexes.models.SearchResourceEncryptionKey """ _validation = { @@ -5222,25 +5346,25 @@ class SearchResourceEncryptionKey(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param key_name: Required. The name of your Azure Key Vault key to be used to encrypt your data - at rest. - :type key_name: str - :param key_version: Required. The version of your Azure Key Vault key to be used to encrypt + :keyword key_name: Required. The name of your Azure Key Vault key to be used to encrypt your + data at rest. + :paramtype key_name: str + :keyword key_version: Required. The version of your Azure Key Vault key to be used to encrypt your data at rest. - :type key_version: str - :param vault_uri: Required. The URI of your Azure Key Vault, also referred to as DNS name, that - contains the key to be used to encrypt your data at rest. An example URI might be + :paramtype key_version: str + :keyword vault_uri: Required. The URI of your Azure Key Vault, also referred to as DNS name, + that contains the key to be used to encrypt your data at rest. An example URI might be https://my-keyvault-name.vault.azure.net. - :type vault_uri: str - :param access_credentials: Optional Azure Active Directory credentials used for accessing your - Azure Key Vault. Not required if using managed identity instead. - :type access_credentials: + :paramtype vault_uri: str + :keyword access_credentials: Optional Azure Active Directory credentials used for accessing + your Azure Key Vault. Not required if using managed identity instead. + :paramtype access_credentials: ~azure.search.documents.indexes.models.AzureActiveDirectoryApplicationCredentials - :param identity: An explicit managed identity to use for this encryption key. If not specified - and the access credentials property is null, the system-assigned managed identity is used. On - update to the resource, if the explicit identity is unspecified, it remains unchanged. If - "none" is specified, the value of this property is cleared. - :type identity: ~azure.search.documents.indexes.models.SearchIndexerDataIdentity + :keyword identity: An explicit managed identity to use for this encryption key. If not + specified and the access credentials property is null, the system-assigned managed identity is + used. On update to the resource, if the explicit identity is unspecified, it remains unchanged. + If "none" is specified, the value of this property is cleared. + :paramtype identity: ~azure.search.documents.indexes.models.SearchIndexerDataIdentity """ _validation = { @@ -5274,29 +5398,30 @@ class SentimentSkill(SearchIndexerSkill): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the skill.Constant filled by server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill + :paramtype odata_type: str + :keyword name: The name of the skill which uniquely identifies it within the skillset. A skill with no name defined will be given a default name of its 1-based index in the skills array, prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] - :param default_language_code: A value indicating which language code to use. Default is en. + :paramtype name: str + :keyword description: The description of the skill which describes the inputs, outputs, and + usage of the skill. + :paramtype description: str + :keyword context: Represents the level at which operations take place, such as the document + root or document content (for example, /document or /document/content). The default is + /document. + :paramtype context: str + :keyword inputs: Required. Inputs of the skills could be a column in the source data set, or + the output of an upstream skill. + :paramtype inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] + :keyword outputs: Required. The output of a skill is either a field in a search index, or a + value that can be consumed as an input by another skill. + :paramtype outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] + :keyword default_language_code: A value indicating which language code to use. Default is en. Possible values include: "da", "nl", "en", "fi", "fr", "de", "el", "it", "no", "pl", "pt-PT", "ru", "es", "sv", "tr". - :type default_language_code: str or + :paramtype default_language_code: str or ~azure.search.documents.indexes.models.SentimentSkillLanguage """ @@ -5330,35 +5455,36 @@ class SentimentSkillV3(SearchIndexerSkill): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the skill.Constant filled by server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill + :paramtype odata_type: str + :keyword name: The name of the skill which uniquely identifies it within the skillset. A skill with no name defined will be given a default name of its 1-based index in the skills array, prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] - :param default_language_code: A value indicating which language code to use. Default is en. - :type default_language_code: str - :param include_opinion_mining: If set to true, the skill output will include information from + :paramtype name: str + :keyword description: The description of the skill which describes the inputs, outputs, and + usage of the skill. + :paramtype description: str + :keyword context: Represents the level at which operations take place, such as the document + root or document content (for example, /document or /document/content). The default is + /document. + :paramtype context: str + :keyword inputs: Required. Inputs of the skills could be a column in the source data set, or + the output of an upstream skill. + :paramtype inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] + :keyword outputs: Required. The output of a skill is either a field in a search index, or a + value that can be consumed as an input by another skill. + :paramtype outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] + :keyword default_language_code: A value indicating which language code to use. Default is en. + :paramtype default_language_code: str + :keyword include_opinion_mining: If set to true, the skill output will include information from Text Analytics for opinion mining, namely targets (nouns or verbs) and their associated assessment (adjective) in the text. Default is false. - :type include_opinion_mining: bool - :param model_version: The version of the model to use when calling the Text Analytics service. - It will default to the latest available when not specified. We recommend you do not specify - this value unless absolutely necessary. - :type model_version: str + :paramtype include_opinion_mining: bool + :keyword model_version: The version of the model to use when calling the Text Analytics + service. It will default to the latest available when not specified. We recommend you do not + specify this value unless absolutely necessary. + :paramtype model_version: str """ _validation = { @@ -5395,20 +5521,21 @@ class ServiceCounters(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param document_counter: Required. Total number of documents across all indexes in the service. - :type document_counter: ~azure.search.documents.indexes.models.ResourceCounter - :param index_counter: Required. Total number of indexes. - :type index_counter: ~azure.search.documents.indexes.models.ResourceCounter - :param indexer_counter: Required. Total number of indexers. - :type indexer_counter: ~azure.search.documents.indexes.models.ResourceCounter - :param data_source_counter: Required. Total number of data sources. - :type data_source_counter: ~azure.search.documents.indexes.models.ResourceCounter - :param storage_size_counter: Required. Total size of used storage in bytes. - :type storage_size_counter: ~azure.search.documents.indexes.models.ResourceCounter - :param synonym_map_counter: Required. Total number of synonym maps. - :type synonym_map_counter: ~azure.search.documents.indexes.models.ResourceCounter - :param skillset_counter: Total number of skillsets. - :type skillset_counter: ~azure.search.documents.indexes.models.ResourceCounter + :keyword document_counter: Required. Total number of documents across all indexes in the + service. + :paramtype document_counter: ~azure.search.documents.indexes.models.ResourceCounter + :keyword index_counter: Required. Total number of indexes. + :paramtype index_counter: ~azure.search.documents.indexes.models.ResourceCounter + :keyword indexer_counter: Required. Total number of indexers. + :paramtype indexer_counter: ~azure.search.documents.indexes.models.ResourceCounter + :keyword data_source_counter: Required. Total number of data sources. + :paramtype data_source_counter: ~azure.search.documents.indexes.models.ResourceCounter + :keyword storage_size_counter: Required. Total size of used storage in bytes. + :paramtype storage_size_counter: ~azure.search.documents.indexes.models.ResourceCounter + :keyword synonym_map_counter: Required. Total number of synonym maps. + :paramtype synonym_map_counter: ~azure.search.documents.indexes.models.ResourceCounter + :keyword skillset_counter: Total number of skillsets. + :paramtype skillset_counter: ~azure.search.documents.indexes.models.ResourceCounter """ _validation = { @@ -5447,17 +5574,17 @@ def __init__( class ServiceLimits(msrest.serialization.Model): """Represents various service level limits. - :param max_fields_per_index: The maximum allowed fields per index. - :type max_fields_per_index: int - :param max_field_nesting_depth_per_index: The maximum depth which you can nest sub-fields in an - index, including the top-level complex field. For example, a/b/c has a nesting depth of 3. - :type max_field_nesting_depth_per_index: int - :param max_complex_collection_fields_per_index: The maximum number of fields of type + :keyword max_fields_per_index: The maximum allowed fields per index. + :paramtype max_fields_per_index: int + :keyword max_field_nesting_depth_per_index: The maximum depth which you can nest sub-fields in + an index, including the top-level complex field. For example, a/b/c has a nesting depth of 3. + :paramtype max_field_nesting_depth_per_index: int + :keyword max_complex_collection_fields_per_index: The maximum number of fields of type Collection(Edm.ComplexType) allowed in an index. - :type max_complex_collection_fields_per_index: int - :param max_complex_objects_in_collections_per_document: The maximum number of objects in + :paramtype max_complex_collection_fields_per_index: int + :keyword max_complex_objects_in_collections_per_document: The maximum number of objects in complex collections allowed per document. - :type max_complex_objects_in_collections_per_document: int + :paramtype max_complex_objects_in_collections_per_document: int """ _attribute_map = { @@ -5483,10 +5610,10 @@ class ServiceStatistics(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param counters: Required. Service level resource counters. - :type counters: ~azure.search.documents.indexes.models.ServiceCounters - :param limits: Required. Service level general limits. - :type limits: ~azure.search.documents.indexes.models.ServiceLimits + :keyword counters: Required. Service level resource counters. + :paramtype counters: ~azure.search.documents.indexes.models.ServiceCounters + :keyword limits: Required. Service level general limits. + :paramtype limits: ~azure.search.documents.indexes.models.ServiceLimits """ _validation = { @@ -5513,25 +5640,26 @@ class ShaperSkill(SearchIndexerSkill): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the skill.Constant filled by server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill + :paramtype odata_type: str + :keyword name: The name of the skill which uniquely identifies it within the skillset. A skill with no name defined will be given a default name of its 1-based index in the skills array, prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] + :paramtype name: str + :keyword description: The description of the skill which describes the inputs, outputs, and + usage of the skill. + :paramtype description: str + :keyword context: Represents the level at which operations take place, such as the document + root or document content (for example, /document or /document/content). The default is + /document. + :paramtype context: str + :keyword inputs: Required. Inputs of the skills could be a column in the source data set, or + the output of an upstream skill. + :paramtype inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] + :keyword outputs: Required. The output of a skill is either a field in a search index, or a + value that can be consumed as an input by another skill. + :paramtype outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] """ _validation = { @@ -5562,31 +5690,31 @@ class ShingleTokenFilter(TokenFilter): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled + :keyword odata_type: Required. Identifies the concrete type of the token filter.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, + :paramtype odata_type: str + :keyword name: Required. The name of the token filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str - :param max_shingle_size: The maximum shingle size. Default and minimum value is 2. - :type max_shingle_size: int - :param min_shingle_size: The minimum shingle size. Default and minimum value is 2. Must be less - than the value of maxShingleSize. - :type min_shingle_size: int - :param output_unigrams: A value indicating whether the output stream will contain the input + :paramtype name: str + :keyword max_shingle_size: The maximum shingle size. Default and minimum value is 2. + :paramtype max_shingle_size: int + :keyword min_shingle_size: The minimum shingle size. Default and minimum value is 2. Must be + less than the value of maxShingleSize. + :paramtype min_shingle_size: int + :keyword output_unigrams: A value indicating whether the output stream will contain the input tokens (unigrams) as well as shingles. Default is true. - :type output_unigrams: bool - :param output_unigrams_if_no_shingles: A value indicating whether to output unigrams for those - times when no shingles are available. This property takes precedence when outputUnigrams is set - to false. Default is false. - :type output_unigrams_if_no_shingles: bool - :param token_separator: The string to use when joining adjacent tokens to form a shingle. + :paramtype output_unigrams: bool + :keyword output_unigrams_if_no_shingles: A value indicating whether to output unigrams for + those times when no shingles are available. This property takes precedence when outputUnigrams + is set to false. Default is false. + :paramtype output_unigrams_if_no_shingles: bool + :keyword token_separator: The string to use when joining adjacent tokens to form a shingle. Default is a single space (" "). - :type token_separator: str - :param filter_token: The string to insert for each position at which there is no token. Default - is an underscore ("_"). - :type filter_token: str + :paramtype token_separator: str + :keyword filter_token: The string to insert for each position at which there is no token. + Default is an underscore ("_"). + :paramtype filter_token: str """ _validation = { @@ -5626,18 +5754,18 @@ class SnowballTokenFilter(TokenFilter): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled + :keyword odata_type: Required. Identifies the concrete type of the token filter.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, + :paramtype odata_type: str + :keyword name: Required. The name of the token filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str - :param language: Required. The language to use. Possible values include: "armenian", "basque", - "catalan", "danish", "dutch", "english", "finnish", "french", "german", "german2", "hungarian", - "italian", "kp", "lovins", "norwegian", "porter", "portuguese", "romanian", "russian", - "spanish", "swedish", "turkish". - :type language: str or ~azure.search.documents.indexes.models.SnowballTokenFilterLanguage + :paramtype name: str + :keyword language: Required. The language to use. Possible values include: "armenian", + "basque", "catalan", "danish", "dutch", "english", "finnish", "french", "german", "german2", + "hungarian", "italian", "kp", "lovins", "norwegian", "porter", "portuguese", "romanian", + "russian", "spanish", "swedish", "turkish". + :paramtype language: str or ~azure.search.documents.indexes.models.SnowballTokenFilterLanguage """ _validation = { @@ -5666,13 +5794,13 @@ class SoftDeleteColumnDeletionDetectionPolicy(DataDeletionDetectionPolicy): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the data deletion detection + :keyword odata_type: Required. Identifies the concrete type of the data deletion detection policy.Constant filled by server. - :type odata_type: str - :param soft_delete_column_name: The name of the column to use for soft-deletion detection. - :type soft_delete_column_name: str - :param soft_delete_marker_value: The marker value that identifies an item as deleted. - :type soft_delete_marker_value: str + :paramtype odata_type: str + :keyword soft_delete_column_name: The name of the column to use for soft-deletion detection. + :paramtype soft_delete_column_name: str + :keyword soft_delete_marker_value: The marker value that identifies an item as deleted. + :paramtype soft_delete_marker_value: str """ _validation = { @@ -5700,33 +5828,35 @@ class SplitSkill(SearchIndexerSkill): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the skill.Constant filled by server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill + :paramtype odata_type: str + :keyword name: The name of the skill which uniquely identifies it within the skillset. A skill with no name defined will be given a default name of its 1-based index in the skills array, prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] - :param default_language_code: A value indicating which language code to use. Default is en. + :paramtype name: str + :keyword description: The description of the skill which describes the inputs, outputs, and + usage of the skill. + :paramtype description: str + :keyword context: Represents the level at which operations take place, such as the document + root or document content (for example, /document or /document/content). The default is + /document. + :paramtype context: str + :keyword inputs: Required. Inputs of the skills could be a column in the source data set, or + the output of an upstream skill. + :paramtype inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] + :keyword outputs: Required. The output of a skill is either a field in a search index, or a + value that can be consumed as an input by another skill. + :paramtype outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] + :keyword default_language_code: A value indicating which language code to use. Default is en. Possible values include: "da", "de", "en", "es", "fi", "fr", "it", "ko", "pt". - :type default_language_code: str or ~azure.search.documents.indexes.models.SplitSkillLanguage - :param text_split_mode: A value indicating which split mode to perform. Possible values + :paramtype default_language_code: str or + ~azure.search.documents.indexes.models.SplitSkillLanguage + :keyword text_split_mode: A value indicating which split mode to perform. Possible values include: "pages", "sentences". - :type text_split_mode: str or ~azure.search.documents.indexes.models.TextSplitMode - :param maximum_page_length: The desired maximum page length. Default is 10000. - :type maximum_page_length: int + :paramtype text_split_mode: str or ~azure.search.documents.indexes.models.TextSplitMode + :keyword maximum_page_length: The desired maximum page length. Default is 10000. + :paramtype maximum_page_length: int """ _validation = { @@ -5763,9 +5893,9 @@ class SqlIntegratedChangeTrackingPolicy(DataChangeDetectionPolicy): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the data change detection + :keyword odata_type: Required. Identifies the concrete type of the data change detection policy.Constant filled by server. - :type odata_type: str + :paramtype odata_type: str """ _validation = { @@ -5789,16 +5919,16 @@ class StemmerOverrideTokenFilter(TokenFilter): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled + :keyword odata_type: Required. Identifies the concrete type of the token filter.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, + :paramtype odata_type: str + :keyword name: Required. The name of the token filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str - :param rules: Required. A list of stemming rules in the following format: "word => stem", for + :paramtype name: str + :keyword rules: Required. A list of stemming rules in the following format: "word => stem", for example: "ran => run". - :type rules: list[str] + :paramtype rules: list[str] """ _validation = { @@ -5827,23 +5957,23 @@ class StemmerTokenFilter(TokenFilter): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled + :keyword odata_type: Required. Identifies the concrete type of the token filter.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, + :paramtype odata_type: str + :keyword name: Required. The name of the token filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str - :param language: Required. The language to use. Possible values include: "arabic", "armenian", - "basque", "brazilian", "bulgarian", "catalan", "czech", "danish", "dutch", "dutchKp", - "english", "lightEnglish", "minimalEnglish", "possessiveEnglish", "porter2", "lovins", - "finnish", "lightFinnish", "french", "lightFrench", "minimalFrench", "galician", + :paramtype name: str + :keyword language: Required. The language to use. Possible values include: "arabic", + "armenian", "basque", "brazilian", "bulgarian", "catalan", "czech", "danish", "dutch", + "dutchKp", "english", "lightEnglish", "minimalEnglish", "possessiveEnglish", "porter2", + "lovins", "finnish", "lightFinnish", "french", "lightFrench", "minimalFrench", "galician", "minimalGalician", "german", "german2", "lightGerman", "minimalGerman", "greek", "hindi", "hungarian", "lightHungarian", "indonesian", "irish", "italian", "lightItalian", "sorani", "latvian", "norwegian", "lightNorwegian", "minimalNorwegian", "lightNynorsk", "minimalNynorsk", "portuguese", "lightPortuguese", "minimalPortuguese", "portugueseRslp", "romanian", "russian", "lightRussian", "spanish", "lightSpanish", "swedish", "lightSwedish", "turkish". - :type language: str or ~azure.search.documents.indexes.models.StemmerTokenFilterLanguage + :paramtype language: str or ~azure.search.documents.indexes.models.StemmerTokenFilterLanguage """ _validation = { @@ -5872,15 +6002,15 @@ class StopAnalyzer(LexicalAnalyzer): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the analyzer.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the analyzer.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the analyzer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param stopwords: A list of stopwords. - :type stopwords: list[str] + :paramtype odata_type: str + :keyword name: Required. The name of the analyzer. It must only contain letters, digits, + spaces, dashes or underscores, can only start and end with alphanumeric characters, and is + limited to 128 characters. + :paramtype name: str + :keyword stopwords: A list of stopwords. + :paramtype stopwords: list[str] """ _validation = { @@ -5908,29 +6038,29 @@ class StopwordsTokenFilter(TokenFilter): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled + :keyword odata_type: Required. Identifies the concrete type of the token filter.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, + :paramtype odata_type: str + :keyword name: Required. The name of the token filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str - :param stopwords: The list of stopwords. This property and the stopwords list property cannot + :paramtype name: str + :keyword stopwords: The list of stopwords. This property and the stopwords list property cannot both be set. - :type stopwords: list[str] - :param stopwords_list: A predefined list of stopwords to use. This property and the stopwords + :paramtype stopwords: list[str] + :keyword stopwords_list: A predefined list of stopwords to use. This property and the stopwords property cannot both be set. Default is English. Possible values include: "arabic", "armenian", "basque", "brazilian", "bulgarian", "catalan", "czech", "danish", "dutch", "english", "finnish", "french", "galician", "german", "greek", "hindi", "hungarian", "indonesian", "irish", "italian", "latvian", "norwegian", "persian", "portuguese", "romanian", "russian", "sorani", "spanish", "swedish", "thai", "turkish". - :type stopwords_list: str or ~azure.search.documents.indexes.models.StopwordsList - :param ignore_case: A value indicating whether to ignore case. If true, all words are converted - to lower case first. Default is false. - :type ignore_case: bool - :param remove_trailing_stop_words: A value indicating whether to ignore the last search term if - it's a stop word. Default is true. - :type remove_trailing_stop_words: bool + :paramtype stopwords_list: str or ~azure.search.documents.indexes.models.StopwordsList + :keyword ignore_case: A value indicating whether to ignore case. If true, all words are + converted to lower case first. Default is false. + :paramtype ignore_case: bool + :keyword remove_trailing_stop_words: A value indicating whether to ignore the last search term + if it's a stop word. Default is true. + :paramtype remove_trailing_stop_words: bool """ _validation = { @@ -5966,14 +6096,14 @@ class Suggester(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the suggester. - :type name: str + :keyword name: Required. The name of the suggester. + :paramtype name: str :ivar search_mode: A value indicating the capabilities of the suggester. Has constant value: "analyzingInfixMatching". :vartype search_mode: str - :param source_fields: Required. The list of field names to which the suggester applies. Each + :keyword source_fields: Required. The list of field names to which the suggester applies. Each field must be searchable. - :type source_fields: list[str] + :paramtype source_fields: list[str] """ _validation = { @@ -6006,15 +6136,15 @@ class SynonymMap(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the synonym map. - :type name: str + :keyword name: Required. The name of the synonym map. + :paramtype name: str :ivar format: The format of the synonym map. Only the 'solr' format is currently supported. Has constant value: "solr". :vartype format: str - :param synonyms: Required. A series of synonym rules in the specified synonym map format. The + :keyword synonyms: Required. A series of synonym rules in the specified synonym map format. The rules must be separated by newlines. - :type synonyms: str - :param encryption_key: A description of an encryption key that you create in Azure Key Vault. + :paramtype synonyms: str + :keyword encryption_key: A description of an encryption key that you create in Azure Key Vault. This key is used to provide an additional level of encryption-at-rest for your data when you want full assurance that no one, not even Microsoft, can decrypt your data in Azure Cognitive Search. Once you have encrypted your data, it will always remain encrypted. Azure Cognitive @@ -6022,9 +6152,9 @@ class SynonymMap(msrest.serialization.Model): needed if you want to rotate your encryption key; Your data will be unaffected. Encryption with customer-managed keys is not available for free search services, and is only available for paid services created on or after January 1, 2019. - :type encryption_key: ~azure.search.documents.indexes.models.SearchResourceEncryptionKey - :param e_tag: The ETag of the synonym map. - :type e_tag: str + :paramtype encryption_key: ~azure.search.documents.indexes.models.SearchResourceEncryptionKey + :keyword e_tag: The ETag of the synonym map. + :paramtype e_tag: str """ _validation = { @@ -6059,30 +6189,30 @@ class SynonymTokenFilter(TokenFilter): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled + :keyword odata_type: Required. Identifies the concrete type of the token filter.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, + :paramtype odata_type: str + :keyword name: Required. The name of the token filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str - :param synonyms: Required. A list of synonyms in following one of two formats: 1. incredible, + :paramtype name: str + :keyword synonyms: Required. A list of synonyms in following one of two formats: 1. incredible, unbelievable, fabulous => amazing - all terms on the left side of => symbol will be replaced with all terms on its right side; 2. incredible, unbelievable, fabulous, amazing - comma separated list of equivalent words. Set the expand option to change how this list is interpreted. - :type synonyms: list[str] - :param ignore_case: A value indicating whether to case-fold input for matching. Default is + :paramtype synonyms: list[str] + :keyword ignore_case: A value indicating whether to case-fold input for matching. Default is false. - :type ignore_case: bool - :param expand: A value indicating whether all words in the list of synonyms (if => notation is - not used) will map to one another. If true, all words in the list of synonyms (if => notation - is not used) will map to one another. The following list: incredible, unbelievable, fabulous, - amazing is equivalent to: incredible, unbelievable, fabulous, amazing => incredible, + :paramtype ignore_case: bool + :keyword expand: A value indicating whether all words in the list of synonyms (if => notation + is not used) will map to one another. If true, all words in the list of synonyms (if => + notation is not used) will map to one another. The following list: incredible, unbelievable, + fabulous, amazing is equivalent to: incredible, unbelievable, fabulous, amazing => incredible, unbelievable, fabulous, amazing. If false, the following list: incredible, unbelievable, fabulous, amazing will be equivalent to: incredible, unbelievable, fabulous, amazing => incredible. Default is true. - :type expand: bool + :paramtype expand: bool """ _validation = { @@ -6115,20 +6245,21 @@ class TagScoringFunction(ScoringFunction): All required parameters must be populated in order to send to Azure. - :param type: Required. Indicates the type of function to use. Valid values include magnitude, + :keyword type: Required. Indicates the type of function to use. Valid values include magnitude, freshness, distance, and tag. The function type must be lower case.Constant filled by server. - :type type: str - :param field_name: Required. The name of the field used as input to the scoring function. - :type field_name: str - :param boost: Required. A multiplier for the raw score. Must be a positive number not equal to - 1.0. - :type boost: float - :param interpolation: A value indicating how boosting will be interpolated across document + :paramtype type: str + :keyword field_name: Required. The name of the field used as input to the scoring function. + :paramtype field_name: str + :keyword boost: Required. A multiplier for the raw score. Must be a positive number not equal + to 1.0. + :paramtype boost: float + :keyword interpolation: A value indicating how boosting will be interpolated across document scores; defaults to "Linear". Possible values include: "linear", "constant", "quadratic", "logarithmic". - :type interpolation: str or ~azure.search.documents.indexes.models.ScoringFunctionInterpolation - :param parameters: Required. Parameter values for the tag scoring function. - :type parameters: ~azure.search.documents.indexes.models.TagScoringParameters + :paramtype interpolation: str or + ~azure.search.documents.indexes.models.ScoringFunctionInterpolation + :keyword parameters: Required. Parameter values for the tag scoring function. + :paramtype parameters: ~azure.search.documents.indexes.models.TagScoringParameters """ _validation = { @@ -6160,9 +6291,9 @@ class TagScoringParameters(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param tags_parameter: Required. The name of the parameter passed in search queries to specify - the list of tags to compare against the target field. - :type tags_parameter: str + :keyword tags_parameter: Required. The name of the parameter passed in search queries to + specify the list of tags to compare against the target field. + :paramtype tags_parameter: str """ _validation = { @@ -6186,44 +6317,45 @@ class TextTranslationSkill(SearchIndexerSkill): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the skill.Constant filled by server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill + :paramtype odata_type: str + :keyword name: The name of the skill which uniquely identifies it within the skillset. A skill with no name defined will be given a default name of its 1-based index in the skills array, prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] - :param default_to_language_code: Required. The language code to translate documents into for + :paramtype name: str + :keyword description: The description of the skill which describes the inputs, outputs, and + usage of the skill. + :paramtype description: str + :keyword context: Represents the level at which operations take place, such as the document + root or document content (for example, /document or /document/content). The default is + /document. + :paramtype context: str + :keyword inputs: Required. Inputs of the skills could be a column in the source data set, or + the output of an upstream skill. + :paramtype inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] + :keyword outputs: Required. The output of a skill is either a field in a search index, or a + value that can be consumed as an input by another skill. + :paramtype outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] + :keyword default_to_language_code: Required. The language code to translate documents into for documents that don't specify the to language explicitly. Possible values include: "af", "ar", "bn", "bs", "bg", "yue", "ca", "zh-Hans", "zh-Hant", "hr", "cs", "da", "nl", "en", "et", "fj", "fil", "fi", "fr", "de", "el", "ht", "he", "hi", "mww", "hu", "is", "id", "it", "ja", "sw", "tlh", "tlh-Latn", "tlh-Piqd", "ko", "lv", "lt", "mg", "ms", "mt", "nb", "fa", "pl", "pt", "pt-br", "pt-PT", "otq", "ro", "ru", "sm", "sr-Cyrl", "sr-Latn", "sk", "sl", "es", "sv", "ty", "ta", "te", "th", "to", "tr", "uk", "ur", "vi", "cy", "yua", "ga", "kn", "mi", "ml", "pa". - :type default_to_language_code: str or + :paramtype default_to_language_code: str or ~azure.search.documents.indexes.models.TextTranslationSkillLanguage - :param default_from_language_code: The language code to translate documents from for documents - that don't specify the from language explicitly. Possible values include: "af", "ar", "bn", - "bs", "bg", "yue", "ca", "zh-Hans", "zh-Hant", "hr", "cs", "da", "nl", "en", "et", "fj", "fil", - "fi", "fr", "de", "el", "ht", "he", "hi", "mww", "hu", "is", "id", "it", "ja", "sw", "tlh", - "tlh-Latn", "tlh-Piqd", "ko", "lv", "lt", "mg", "ms", "mt", "nb", "fa", "pl", "pt", "pt-br", - "pt-PT", "otq", "ro", "ru", "sm", "sr-Cyrl", "sr-Latn", "sk", "sl", "es", "sv", "ty", "ta", - "te", "th", "to", "tr", "uk", "ur", "vi", "cy", "yua", "ga", "kn", "mi", "ml", "pa". - :type default_from_language_code: str or + :keyword default_from_language_code: The language code to translate documents from for + documents that don't specify the from language explicitly. Possible values include: "af", "ar", + "bn", "bs", "bg", "yue", "ca", "zh-Hans", "zh-Hant", "hr", "cs", "da", "nl", "en", "et", "fj", + "fil", "fi", "fr", "de", "el", "ht", "he", "hi", "mww", "hu", "is", "id", "it", "ja", "sw", + "tlh", "tlh-Latn", "tlh-Piqd", "ko", "lv", "lt", "mg", "ms", "mt", "nb", "fa", "pl", "pt", + "pt-br", "pt-PT", "otq", "ro", "ru", "sm", "sr-Cyrl", "sr-Latn", "sk", "sl", "es", "sv", "ty", + "ta", "te", "th", "to", "tr", "uk", "ur", "vi", "cy", "yua", "ga", "kn", "mi", "ml", "pa". + :paramtype default_from_language_code: str or ~azure.search.documents.indexes.models.TextTranslationSkillLanguage - :param suggested_from: The language code to translate documents from when neither the + :keyword suggested_from: The language code to translate documents from when neither the fromLanguageCode input nor the defaultFromLanguageCode parameter are provided, and the automatic language detection is unsuccessful. Default is en. Possible values include: "af", "ar", "bn", "bs", "bg", "yue", "ca", "zh-Hans", "zh-Hant", "hr", "cs", "da", "nl", "en", "et", @@ -6232,7 +6364,7 @@ class TextTranslationSkill(SearchIndexerSkill): "pt", "pt-br", "pt-PT", "otq", "ro", "ru", "sm", "sr-Cyrl", "sr-Latn", "sk", "sl", "es", "sv", "ty", "ta", "te", "th", "to", "tr", "uk", "ur", "vi", "cy", "yua", "ga", "kn", "mi", "ml", "pa". - :type suggested_from: str or + :paramtype suggested_from: str or ~azure.search.documents.indexes.models.TextTranslationSkillLanguage """ @@ -6271,9 +6403,9 @@ class TextWeights(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param weights: Required. The dictionary of per-field weights to boost document scoring. The + :keyword weights: Required. The dictionary of per-field weights to boost document scoring. The keys are field names and the values are the weights for each field. - :type weights: dict[str, float] + :paramtype weights: dict[str, float] """ _validation = { @@ -6297,15 +6429,15 @@ class TruncateTokenFilter(TokenFilter): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled + :keyword odata_type: Required. Identifies the concrete type of the token filter.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, + :paramtype odata_type: str + :keyword name: Required. The name of the token filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str - :param length: The length at which terms will be truncated. Default and maximum is 300. - :type length: int + :paramtype name: str + :keyword length: The length at which terms will be truncated. Default and maximum is 300. + :paramtype length: int """ _validation = { @@ -6334,16 +6466,16 @@ class UaxUrlEmailTokenizer(LexicalTokenizer): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the tokenizer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param max_token_length: The maximum token length. Default is 255. Tokens longer than the + :paramtype odata_type: str + :keyword name: Required. The name of the tokenizer. It must only contain letters, digits, + spaces, dashes or underscores, can only start and end with alphanumeric characters, and is + limited to 128 characters. + :paramtype name: str + :keyword max_token_length: The maximum token length. Default is 255. Tokens longer than the maximum length are split. The maximum token length that can be used is 300 characters. - :type max_token_length: int + :paramtype max_token_length: int """ _validation = { @@ -6372,16 +6504,16 @@ class UniqueTokenFilter(TokenFilter): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled + :keyword odata_type: Required. Identifies the concrete type of the token filter.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, + :paramtype odata_type: str + :keyword name: Required. The name of the token filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str - :param only_on_same_position: A value indicating whether to remove duplicates only at the same - position. Default is false. - :type only_on_same_position: bool + :paramtype name: str + :keyword only_on_same_position: A value indicating whether to remove duplicates only at the + same position. Default is false. + :paramtype only_on_same_position: bool """ _validation = { @@ -6409,38 +6541,39 @@ class WebApiSkill(SearchIndexerSkill): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the skill.Constant filled by server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill + :paramtype odata_type: str + :keyword name: The name of the skill which uniquely identifies it within the skillset. A skill with no name defined will be given a default name of its 1-based index in the skills array, prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] - :param uri: Required. The url for the Web API. - :type uri: str - :param http_headers: The headers required to make the http request. - :type http_headers: dict[str, str] - :param http_method: The method for the http request. - :type http_method: str - :param timeout: The desired timeout for the request. Default is 30 seconds. - :type timeout: ~datetime.timedelta - :param batch_size: The desired batch size which indicates number of documents. - :type batch_size: int - :param degree_of_parallelism: If set, the number of parallel calls that can be made to the Web - API. - :type degree_of_parallelism: int + :paramtype name: str + :keyword description: The description of the skill which describes the inputs, outputs, and + usage of the skill. + :paramtype description: str + :keyword context: Represents the level at which operations take place, such as the document + root or document content (for example, /document or /document/content). The default is + /document. + :paramtype context: str + :keyword inputs: Required. Inputs of the skills could be a column in the source data set, or + the output of an upstream skill. + :paramtype inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] + :keyword outputs: Required. The output of a skill is either a field in a search index, or a + value that can be consumed as an input by another skill. + :paramtype outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] + :keyword uri: Required. The url for the Web API. + :paramtype uri: str + :keyword http_headers: The headers required to make the http request. + :paramtype http_headers: dict[str, str] + :keyword http_method: The method for the http request. + :paramtype http_method: str + :keyword timeout: The desired timeout for the request. Default is 30 seconds. + :paramtype timeout: ~datetime.timedelta + :keyword batch_size: The desired batch size which indicates number of documents. + :paramtype batch_size: int + :keyword degree_of_parallelism: If set, the number of parallel calls that can be made to the + Web API. + :paramtype degree_of_parallelism: int """ _validation = { @@ -6484,43 +6617,44 @@ class WordDelimiterTokenFilter(TokenFilter): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled + :keyword odata_type: Required. Identifies the concrete type of the token filter.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, + :paramtype odata_type: str + :keyword name: Required. The name of the token filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str - :param generate_word_parts: A value indicating whether to generate part words. If set, causes + :paramtype name: str + :keyword generate_word_parts: A value indicating whether to generate part words. If set, causes parts of words to be generated; for example "AzureSearch" becomes "Azure" "Search". Default is true. - :type generate_word_parts: bool - :param generate_number_parts: A value indicating whether to generate number subwords. Default + :paramtype generate_word_parts: bool + :keyword generate_number_parts: A value indicating whether to generate number subwords. Default is true. - :type generate_number_parts: bool - :param catenate_words: A value indicating whether maximum runs of word parts will be catenated. - For example, if this is set to true, "Azure-Search" becomes "AzureSearch". Default is false. - :type catenate_words: bool - :param catenate_numbers: A value indicating whether maximum runs of number parts will be + :paramtype generate_number_parts: bool + :keyword catenate_words: A value indicating whether maximum runs of word parts will be + catenated. For example, if this is set to true, "Azure-Search" becomes "AzureSearch". Default + is false. + :paramtype catenate_words: bool + :keyword catenate_numbers: A value indicating whether maximum runs of number parts will be catenated. For example, if this is set to true, "1-2" becomes "12". Default is false. - :type catenate_numbers: bool - :param catenate_all: A value indicating whether all subword parts will be catenated. For + :paramtype catenate_numbers: bool + :keyword catenate_all: A value indicating whether all subword parts will be catenated. For example, if this is set to true, "Azure-Search-1" becomes "AzureSearch1". Default is false. - :type catenate_all: bool - :param split_on_case_change: A value indicating whether to split words on caseChange. For + :paramtype catenate_all: bool + :keyword split_on_case_change: A value indicating whether to split words on caseChange. For example, if this is set to true, "AzureSearch" becomes "Azure" "Search". Default is true. - :type split_on_case_change: bool - :param preserve_original: A value indicating whether original words will be preserved and added - to the subword list. Default is false. - :type preserve_original: bool - :param split_on_numerics: A value indicating whether to split on numbers. For example, if this - is set to true, "Azure1Search" becomes "Azure" "1" "Search". Default is true. - :type split_on_numerics: bool - :param stem_english_possessive: A value indicating whether to remove trailing "'s" for each + :paramtype split_on_case_change: bool + :keyword preserve_original: A value indicating whether original words will be preserved and + added to the subword list. Default is false. + :paramtype preserve_original: bool + :keyword split_on_numerics: A value indicating whether to split on numbers. For example, if + this is set to true, "Azure1Search" becomes "Azure" "1" "Search". Default is true. + :paramtype split_on_numerics: bool + :keyword stem_english_possessive: A value indicating whether to remove trailing "'s" for each subword. Default is true. - :type stem_english_possessive: bool - :param protected_words: A list of tokens to protect from being delimited. - :type protected_words: list[str] + :paramtype stem_english_possessive: bool + :keyword protected_words: A list of tokens to protect from being delimited. + :paramtype protected_words: list[str] """ _validation = { diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/models/_models_py3.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/models/_models_py3.py index ec9c9d4f72ac..21b03c1ff677 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/models/_models_py3.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/models/_models_py3.py @@ -65,9 +65,9 @@ class AnalyzeRequest(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param text: Required. The text to break into tokens. - :type text: str - :param analyzer: The name of the analyzer to use to break the given text. Possible values + :keyword text: Required. The text to break into tokens. + :paramtype text: str + :keyword analyzer: The name of the analyzer to use to break the given text. Possible values include: "ar.microsoft", "ar.lucene", "hy.lucene", "bn.microsoft", "eu.lucene", "bg.microsoft", "bg.lucene", "ca.microsoft", "ca.lucene", "zh-Hans.microsoft", "zh-Hans.lucene", "zh-Hant.microsoft", "zh-Hant.lucene", "hr.microsoft", "cs.microsoft", "cs.lucene", @@ -85,19 +85,20 @@ class AnalyzeRequest(msrest.serialization.Model): "th.lucene", "tr.microsoft", "tr.lucene", "uk.microsoft", "ur.microsoft", "vi.microsoft", "standard.lucene", "standardasciifolding.lucene", "keyword", "pattern", "simple", "stop", "whitespace". - :type analyzer: str or ~azure.search.documents.indexes.models.LexicalAnalyzerName - :param tokenizer: The name of the tokenizer to use to break the given text. Possible values + :paramtype analyzer: str or ~azure.search.documents.indexes.models.LexicalAnalyzerName + :keyword tokenizer: The name of the tokenizer to use to break the given text. Possible values include: "classic", "edgeNGram", "keyword_v2", "letter", "lowercase", "microsoft_language_tokenizer", "microsoft_language_stemming_tokenizer", "nGram", "path_hierarchy_v2", "pattern", "standard_v2", "uax_url_email", "whitespace". - :type tokenizer: str or ~azure.search.documents.indexes.models.LexicalTokenizerName - :param normalizer: The name of the normalizer to use to normalize the given text. Possible + :paramtype tokenizer: str or ~azure.search.documents.indexes.models.LexicalTokenizerName + :keyword normalizer: The name of the normalizer to use to normalize the given text. Possible values include: "asciifolding", "elision", "lowercase", "standard", "uppercase". - :type normalizer: str or ~azure.search.documents.indexes.models.LexicalNormalizerName - :param token_filters: An optional list of token filters to use when breaking the given text. - :type token_filters: list[str or ~azure.search.documents.indexes.models.TokenFilterName] - :param char_filters: An optional list of character filters to use when breaking the given text. - :type char_filters: list[str or ~azure.search.documents.indexes.models.CharFilterName] + :paramtype normalizer: str or ~azure.search.documents.indexes.models.LexicalNormalizerName + :keyword token_filters: An optional list of token filters to use when breaking the given text. + :paramtype token_filters: list[str or ~azure.search.documents.indexes.models.TokenFilterName] + :keyword char_filters: An optional list of character filters to use when breaking the given + text. + :paramtype char_filters: list[str or ~azure.search.documents.indexes.models.CharFilterName] """ _validation = { @@ -138,8 +139,9 @@ class AnalyzeResult(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param tokens: Required. The list of tokens returned by the analyzer specified in the request. - :type tokens: list[~azure.search.documents.indexes.models.AnalyzedTokenInfo] + :keyword tokens: Required. The list of tokens returned by the analyzer specified in the + request. + :paramtype tokens: list[~azure.search.documents.indexes.models.AnalyzedTokenInfo] """ _validation = { @@ -168,13 +170,13 @@ class TokenFilter(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled + :keyword odata_type: Required. Identifies the concrete type of the token filter.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, + :paramtype odata_type: str + :keyword name: Required. The name of the token filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str + :paramtype name: str """ _validation = { @@ -207,16 +209,16 @@ class AsciiFoldingTokenFilter(TokenFilter): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled + :keyword odata_type: Required. Identifies the concrete type of the token filter.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, + :paramtype odata_type: str + :keyword name: Required. The name of the token filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str - :param preserve_original: A value indicating whether the original token will be kept. Default + :paramtype name: str + :keyword preserve_original: A value indicating whether the original token will be kept. Default is false. - :type preserve_original: bool + :paramtype preserve_original: bool """ _validation = { @@ -247,12 +249,12 @@ class AzureActiveDirectoryApplicationCredentials(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param application_id: Required. An AAD Application ID that was granted the required access + :keyword application_id: Required. An AAD Application ID that was granted the required access permissions to the Azure Key Vault that is to be used when encrypting your data at rest. The Application ID should not be confused with the Object ID for your AAD Application. - :type application_id: str - :param application_secret: The authentication key of the specified AAD application. - :type application_secret: str + :paramtype application_id: str + :keyword application_secret: The authentication key of the specified AAD application. + :paramtype application_secret: str """ _validation = { @@ -284,8 +286,8 @@ class Similarity(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Constant filled by server. - :type odata_type: str + :keyword odata_type: Required. Constant filled by server. + :paramtype odata_type: str """ _validation = { @@ -313,16 +315,16 @@ class BM25Similarity(Similarity): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Constant filled by server. - :type odata_type: str - :param k1: This property controls the scaling function between the term frequency of each + :keyword odata_type: Required. Constant filled by server. + :paramtype odata_type: str + :keyword k1: This property controls the scaling function between the term frequency of each matching terms and the final relevance score of a document-query pair. By default, a value of 1.2 is used. A value of 0.0 means the score does not scale with an increase in term frequency. - :type k1: float - :param b: This property controls how the length of a document affects the relevance score. By + :paramtype k1: float + :keyword b: This property controls how the length of a document affects the relevance score. By default, a value of 0.75 is used. A value of 0.0 means no length normalization is applied, while a value of 1.0 means the score is fully normalized by the length of the document. - :type b: float + :paramtype b: float """ _validation = { @@ -356,13 +358,13 @@ class CharFilter(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the char filter.Constant filled by - server. - :type odata_type: str - :param name: Required. The name of the char filter. It must only contain letters, digits, + :keyword odata_type: Required. Identifies the concrete type of the char filter.Constant filled + by server. + :paramtype odata_type: str + :keyword name: Required. The name of the char filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str + :paramtype name: str """ _validation = { @@ -395,19 +397,19 @@ class CjkBigramTokenFilter(TokenFilter): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled + :keyword odata_type: Required. Identifies the concrete type of the token filter.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, + :paramtype odata_type: str + :keyword name: Required. The name of the token filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str - :param ignore_scripts: The scripts to ignore. - :type ignore_scripts: list[str or + :paramtype name: str + :keyword ignore_scripts: The scripts to ignore. + :paramtype ignore_scripts: list[str or ~azure.search.documents.indexes.models.CjkBigramTokenFilterScripts] - :param output_unigrams: A value indicating whether to output both unigrams and bigrams (if + :keyword output_unigrams: A value indicating whether to output both unigrams and bigrams (if true), or just bigrams (if false). Default is false. - :type output_unigrams: bool + :paramtype output_unigrams: bool """ _validation = { @@ -441,8 +443,8 @@ class ClassicSimilarity(Similarity): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Constant filled by server. - :type odata_type: str + :keyword odata_type: Required. Constant filled by server. + :paramtype odata_type: str """ _validation = { @@ -469,13 +471,13 @@ class LexicalTokenizer(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the tokenizer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str + :paramtype odata_type: str + :keyword name: Required. The name of the tokenizer. It must only contain letters, digits, + spaces, dashes or underscores, can only start and end with alphanumeric characters, and is + limited to 128 characters. + :paramtype name: str """ _validation = { @@ -508,16 +510,16 @@ class ClassicTokenizer(LexicalTokenizer): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the tokenizer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param max_token_length: The maximum token length. Default is 255. Tokens longer than the + :paramtype odata_type: str + :keyword name: Required. The name of the tokenizer. It must only contain letters, digits, + spaces, dashes or underscores, can only start and end with alphanumeric characters, and is + limited to 128 characters. + :paramtype name: str + :keyword max_token_length: The maximum token length. Default is 255. Tokens longer than the maximum length are split. The maximum token length that can be used is 300 characters. - :type max_token_length: int + :paramtype max_token_length: int """ _validation = { @@ -552,11 +554,11 @@ class CognitiveServicesAccount(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the cognitive service resource + :keyword odata_type: Required. Identifies the concrete type of the cognitive service resource attached to a skillset.Constant filled by server. - :type odata_type: str - :param description: Description of the cognitive service resource attached to a skillset. - :type description: str + :paramtype odata_type: str + :keyword description: Description of the cognitive service resource attached to a skillset. + :paramtype description: str """ _validation = { @@ -588,14 +590,14 @@ class CognitiveServicesAccountKey(CognitiveServicesAccount): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the cognitive service resource + :keyword odata_type: Required. Identifies the concrete type of the cognitive service resource attached to a skillset.Constant filled by server. - :type odata_type: str - :param description: Description of the cognitive service resource attached to a skillset. - :type description: str - :param key: Required. The key used to provision the cognitive service resource attached to a + :paramtype odata_type: str + :keyword description: Description of the cognitive service resource attached to a skillset. + :paramtype description: str + :keyword key: Required. The key used to provision the cognitive service resource attached to a skillset. - :type key: str + :paramtype key: str """ _validation = { @@ -626,22 +628,22 @@ class CommonGramTokenFilter(TokenFilter): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled + :keyword odata_type: Required. Identifies the concrete type of the token filter.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, + :paramtype odata_type: str + :keyword name: Required. The name of the token filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str - :param common_words: Required. The set of common words. - :type common_words: list[str] - :param ignore_case: A value indicating whether common words matching will be case insensitive. - Default is false. - :type ignore_case: bool - :param use_query_mode: A value that indicates whether the token filter is in query mode. When + :paramtype name: str + :keyword common_words: Required. The set of common words. + :paramtype common_words: list[str] + :keyword ignore_case: A value indicating whether common words matching will be case + insensitive. Default is false. + :paramtype ignore_case: bool + :keyword use_query_mode: A value that indicates whether the token filter is in query mode. When in query mode, the token filter generates bigrams and then removes common words and single terms followed by a common word. Default is false. - :type use_query_mode: bool + :paramtype use_query_mode: bool """ _validation = { @@ -682,25 +684,26 @@ class SearchIndexerSkill(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the skill.Constant filled by server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill + :paramtype odata_type: str + :keyword name: The name of the skill which uniquely identifies it within the skillset. A skill with no name defined will be given a default name of its 1-based index in the skills array, prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] + :paramtype name: str + :keyword description: The description of the skill which describes the inputs, outputs, and + usage of the skill. + :paramtype description: str + :keyword context: Represents the level at which operations take place, such as the document + root or document content (for example, /document or /document/content). The default is + /document. + :paramtype context: str + :keyword inputs: Required. Inputs of the skills could be a column in the source data set, or + the output of an upstream skill. + :paramtype inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] + :keyword outputs: Required. The output of a skill is either a field in a search index, or a + value that can be consumed as an input by another skill. + :paramtype outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] """ _validation = { @@ -746,25 +749,26 @@ class ConditionalSkill(SearchIndexerSkill): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the skill.Constant filled by server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill + :paramtype odata_type: str + :keyword name: The name of the skill which uniquely identifies it within the skillset. A skill with no name defined will be given a default name of its 1-based index in the skills array, prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] + :paramtype name: str + :keyword description: The description of the skill which describes the inputs, outputs, and + usage of the skill. + :paramtype description: str + :keyword context: Represents the level at which operations take place, such as the document + root or document content (for example, /document or /document/content). The default is + /document. + :paramtype context: str + :keyword inputs: Required. Inputs of the skills could be a column in the source data set, or + the output of an upstream skill. + :paramtype inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] + :keyword outputs: Required. The output of a skill is either a field in a search index, or a + value that can be consumed as an input by another skill. + :paramtype outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] """ _validation = { @@ -801,14 +805,14 @@ class CorsOptions(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param allowed_origins: Required. The list of origins from which JavaScript code will be + :keyword allowed_origins: Required. The list of origins from which JavaScript code will be granted access to your index. Can contain a list of hosts of the form {protocol}://{fully-qualified-domain-name}[:{port#}], or a single '*' to allow all origins (not recommended). - :type allowed_origins: list[str] - :param max_age_in_seconds: The duration for which browsers should cache CORS preflight + :paramtype allowed_origins: list[str] + :keyword max_age_in_seconds: The duration for which browsers should cache CORS preflight responses. Defaults to 5 minutes. - :type max_age_in_seconds: long + :paramtype max_age_in_seconds: long """ _validation = { @@ -840,13 +844,13 @@ class LexicalAnalyzer(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the analyzer.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the analyzer.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the analyzer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str + :paramtype odata_type: str + :keyword name: Required. The name of the analyzer. It must only contain letters, digits, + spaces, dashes or underscores, can only start and end with alphanumeric characters, and is + limited to 128 characters. + :paramtype name: str """ _validation = { @@ -879,27 +883,27 @@ class CustomAnalyzer(LexicalAnalyzer): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the analyzer.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the analyzer.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the analyzer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param tokenizer: Required. The name of the tokenizer to use to divide continuous text into a + :paramtype odata_type: str + :keyword name: Required. The name of the analyzer. It must only contain letters, digits, + spaces, dashes or underscores, can only start and end with alphanumeric characters, and is + limited to 128 characters. + :paramtype name: str + :keyword tokenizer: Required. The name of the tokenizer to use to divide continuous text into a sequence of tokens, such as breaking a sentence into words. Possible values include: "classic", "edgeNGram", "keyword_v2", "letter", "lowercase", "microsoft_language_tokenizer", "microsoft_language_stemming_tokenizer", "nGram", "path_hierarchy_v2", "pattern", "standard_v2", "uax_url_email", "whitespace". - :type tokenizer: str or ~azure.search.documents.indexes.models.LexicalTokenizerName - :param token_filters: A list of token filters used to filter out or modify the tokens generated - by a tokenizer. For example, you can specify a lowercase filter that converts all characters to - lowercase. The filters are run in the order in which they are listed. - :type token_filters: list[str or ~azure.search.documents.indexes.models.TokenFilterName] - :param char_filters: A list of character filters used to prepare input text before it is + :paramtype tokenizer: str or ~azure.search.documents.indexes.models.LexicalTokenizerName + :keyword token_filters: A list of token filters used to filter out or modify the tokens + generated by a tokenizer. For example, you can specify a lowercase filter that converts all + characters to lowercase. The filters are run in the order in which they are listed. + :paramtype token_filters: list[str or ~azure.search.documents.indexes.models.TokenFilterName] + :keyword char_filters: A list of character filters used to prepare input text before it is processed by the tokenizer. For instance, they can replace certain characters or symbols. The filters are run in the order in which they are listed. - :type char_filters: list[str or ~azure.search.documents.indexes.models.CharFilterName] + :paramtype char_filters: list[str or ~azure.search.documents.indexes.models.CharFilterName] """ _validation = { @@ -937,51 +941,51 @@ class CustomEntity(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The top-level entity descriptor. Matches in the skill output will be + :keyword name: Required. The top-level entity descriptor. Matches in the skill output will be grouped by this name, and it should represent the "normalized" form of the text being found. - :type name: str - :param description: This field can be used as a passthrough for custom metadata about the + :paramtype name: str + :keyword description: This field can be used as a passthrough for custom metadata about the matched text(s). The value of this field will appear with every match of its entity in the skill output. - :type description: str - :param type: This field can be used as a passthrough for custom metadata about the matched + :paramtype description: str + :keyword type: This field can be used as a passthrough for custom metadata about the matched text(s). The value of this field will appear with every match of its entity in the skill output. - :type type: str - :param subtype: This field can be used as a passthrough for custom metadata about the matched + :paramtype type: str + :keyword subtype: This field can be used as a passthrough for custom metadata about the matched text(s). The value of this field will appear with every match of its entity in the skill output. - :type subtype: str - :param id: This field can be used as a passthrough for custom metadata about the matched + :paramtype subtype: str + :keyword id: This field can be used as a passthrough for custom metadata about the matched text(s). The value of this field will appear with every match of its entity in the skill output. - :type id: str - :param case_sensitive: Defaults to false. Boolean value denoting whether comparisons with the + :paramtype id: str + :keyword case_sensitive: Defaults to false. Boolean value denoting whether comparisons with the entity name should be sensitive to character casing. Sample case insensitive matches of "Microsoft" could be: microsoft, microSoft, MICROSOFT. - :type case_sensitive: bool - :param accent_sensitive: Defaults to false. Boolean value denoting whether comparisons with the - entity name should be sensitive to accent. - :type accent_sensitive: bool - :param fuzzy_edit_distance: Defaults to 0. Maximum value of 5. Denotes the acceptable number of - divergent characters that would still constitute a match with the entity name. The smallest + :paramtype case_sensitive: bool + :keyword accent_sensitive: Defaults to false. Boolean value denoting whether comparisons with + the entity name should be sensitive to accent. + :paramtype accent_sensitive: bool + :keyword fuzzy_edit_distance: Defaults to 0. Maximum value of 5. Denotes the acceptable number + of divergent characters that would still constitute a match with the entity name. The smallest possible fuzziness for any given match is returned. For instance, if the edit distance is set to 3, "Windows10" would still match "Windows", "Windows10" and "Windows 7". When case sensitivity is set to false, case differences do NOT count towards fuzziness tolerance, but otherwise do. - :type fuzzy_edit_distance: int - :param default_case_sensitive: Changes the default case sensitivity value for this entity. It + :paramtype fuzzy_edit_distance: int + :keyword default_case_sensitive: Changes the default case sensitivity value for this entity. It be used to change the default value of all aliases caseSensitive values. - :type default_case_sensitive: bool - :param default_accent_sensitive: Changes the default accent sensitivity value for this entity. - It be used to change the default value of all aliases accentSensitive values. - :type default_accent_sensitive: bool - :param default_fuzzy_edit_distance: Changes the default fuzzy edit distance value for this + :paramtype default_case_sensitive: bool + :keyword default_accent_sensitive: Changes the default accent sensitivity value for this + entity. It be used to change the default value of all aliases accentSensitive values. + :paramtype default_accent_sensitive: bool + :keyword default_fuzzy_edit_distance: Changes the default fuzzy edit distance value for this entity. It can be used to change the default value of all aliases fuzzyEditDistance values. - :type default_fuzzy_edit_distance: int - :param aliases: An array of complex objects that can be used to specify alternative spellings + :paramtype default_fuzzy_edit_distance: int + :keyword aliases: An array of complex objects that can be used to specify alternative spellings or synonyms to the root entity name. - :type aliases: list[~azure.search.documents.indexes.models.CustomEntityAlias] + :paramtype aliases: list[~azure.search.documents.indexes.models.CustomEntityAlias] """ _validation = { @@ -1040,14 +1044,14 @@ class CustomEntityAlias(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param text: Required. The text of the alias. - :type text: str - :param case_sensitive: Determine if the alias is case sensitive. - :type case_sensitive: bool - :param accent_sensitive: Determine if the alias is accent sensitive. - :type accent_sensitive: bool - :param fuzzy_edit_distance: Determine the fuzzy edit distance of the alias. - :type fuzzy_edit_distance: int + :keyword text: Required. The text of the alias. + :paramtype text: str + :keyword case_sensitive: Determine if the alias is case sensitive. + :paramtype case_sensitive: bool + :keyword accent_sensitive: Determine if the alias is accent sensitive. + :paramtype accent_sensitive: bool + :keyword fuzzy_edit_distance: Determine the fuzzy edit distance of the alias. + :paramtype fuzzy_edit_distance: int """ _validation = { @@ -1082,45 +1086,47 @@ class CustomEntityLookupSkill(SearchIndexerSkill): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the skill.Constant filled by server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill + :paramtype odata_type: str + :keyword name: The name of the skill which uniquely identifies it within the skillset. A skill with no name defined will be given a default name of its 1-based index in the skills array, prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] - :param default_language_code: A value indicating which language code to use. Default is en. + :paramtype name: str + :keyword description: The description of the skill which describes the inputs, outputs, and + usage of the skill. + :paramtype description: str + :keyword context: Represents the level at which operations take place, such as the document + root or document content (for example, /document or /document/content). The default is + /document. + :paramtype context: str + :keyword inputs: Required. Inputs of the skills could be a column in the source data set, or + the output of an upstream skill. + :paramtype inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] + :keyword outputs: Required. The output of a skill is either a field in a search index, or a + value that can be consumed as an input by another skill. + :paramtype outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] + :keyword default_language_code: A value indicating which language code to use. Default is en. Possible values include: "da", "de", "en", "es", "fi", "fr", "it", "ko", "pt". - :type default_language_code: str or + :paramtype default_language_code: str or ~azure.search.documents.indexes.models.CustomEntityLookupSkillLanguage - :param entities_definition_uri: Path to a JSON or CSV file containing all the target text to + :keyword entities_definition_uri: Path to a JSON or CSV file containing all the target text to match against. This entity definition is read at the beginning of an indexer run. Any updates to this file during an indexer run will not take effect until subsequent runs. This config must be accessible over HTTPS. - :type entities_definition_uri: str - :param inline_entities_definition: The inline CustomEntity definition. - :type inline_entities_definition: list[~azure.search.documents.indexes.models.CustomEntity] - :param global_default_case_sensitive: A global flag for CaseSensitive. If CaseSensitive is not - set in CustomEntity, this value will be the default value. - :type global_default_case_sensitive: bool - :param global_default_accent_sensitive: A global flag for AccentSensitive. If AccentSensitive + :paramtype entities_definition_uri: str + :keyword inline_entities_definition: The inline CustomEntity definition. + :paramtype inline_entities_definition: + list[~azure.search.documents.indexes.models.CustomEntity] + :keyword global_default_case_sensitive: A global flag for CaseSensitive. If CaseSensitive is + not set in CustomEntity, this value will be the default value. + :paramtype global_default_case_sensitive: bool + :keyword global_default_accent_sensitive: A global flag for AccentSensitive. If AccentSensitive is not set in CustomEntity, this value will be the default value. - :type global_default_accent_sensitive: bool - :param global_default_fuzzy_edit_distance: A global flag for FuzzyEditDistance. If + :paramtype global_default_accent_sensitive: bool + :keyword global_default_fuzzy_edit_distance: A global flag for FuzzyEditDistance. If FuzzyEditDistance is not set in CustomEntity, this value will be the default value. - :type global_default_fuzzy_edit_distance: int + :paramtype global_default_fuzzy_edit_distance: int """ _validation = { @@ -1175,13 +1181,13 @@ class LexicalNormalizer(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the normalizer. - :type odata_type: str - :param name: Required. The name of the normalizer. It must only contain letters, digits, + :keyword odata_type: Required. Identifies the concrete type of the normalizer. + :paramtype odata_type: str + :keyword name: Required. The name of the normalizer. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. It cannot end in '.microsoft' nor '.lucene', nor be named 'asciifolding', 'standard', 'lowercase', 'uppercase', or 'elision'. - :type name: str + :paramtype name: str """ _validation = { @@ -1211,21 +1217,21 @@ class CustomNormalizer(LexicalNormalizer): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the normalizer. - :type odata_type: str - :param name: Required. The name of the normalizer. It must only contain letters, digits, + :keyword odata_type: Required. Identifies the concrete type of the normalizer. + :paramtype odata_type: str + :keyword name: Required. The name of the normalizer. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. It cannot end in '.microsoft' nor '.lucene', nor be named 'asciifolding', 'standard', 'lowercase', 'uppercase', or 'elision'. - :type name: str - :param token_filters: A list of token filters used to filter out or modify the input token. For - example, you can specify a lowercase filter that converts all characters to lowercase. The + :paramtype name: str + :keyword token_filters: A list of token filters used to filter out or modify the input token. + For example, you can specify a lowercase filter that converts all characters to lowercase. The filters are run in the order in which they are listed. - :type token_filters: list[str or ~azure.search.documents.indexes.models.TokenFilterName] - :param char_filters: A list of character filters used to prepare input text before it is + :paramtype token_filters: list[str or ~azure.search.documents.indexes.models.TokenFilterName] + :keyword char_filters: A list of character filters used to prepare input text before it is processed. For instance, they can replace certain characters or symbols. The filters are run in the order in which they are listed. - :type char_filters: list[str or ~azure.search.documents.indexes.models.CharFilterName] + :paramtype char_filters: list[str or ~azure.search.documents.indexes.models.CharFilterName] """ _validation = { @@ -1262,9 +1268,9 @@ class DataChangeDetectionPolicy(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the data change detection + :keyword odata_type: Required. Identifies the concrete type of the data change detection policy.Constant filled by server. - :type odata_type: str + :paramtype odata_type: str """ _validation = { @@ -1295,9 +1301,9 @@ class DataDeletionDetectionPolicy(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the data deletion detection + :keyword odata_type: Required. Identifies the concrete type of the data deletion detection policy.Constant filled by server. - :type odata_type: str + :paramtype odata_type: str """ _validation = { @@ -1323,9 +1329,9 @@ def __init__( class DataSourceCredentials(msrest.serialization.Model): """Represents credentials that can be used to connect to a datasource. - :param connection_string: The connection string for the datasource. Set to + :keyword connection_string: The connection string for the datasource. Set to ':code:``' if you do not want the connection string updated. - :type connection_string: str + :paramtype connection_string: str """ _attribute_map = { @@ -1347,11 +1353,11 @@ class DefaultCognitiveServicesAccount(CognitiveServicesAccount): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the cognitive service resource + :keyword odata_type: Required. Identifies the concrete type of the cognitive service resource attached to a skillset.Constant filled by server. - :type odata_type: str - :param description: Description of the cognitive service resource attached to a skillset. - :type description: str + :paramtype odata_type: str + :keyword description: Description of the cognitive service resource attached to a skillset. + :paramtype description: str """ _validation = { @@ -1378,27 +1384,27 @@ class DictionaryDecompounderTokenFilter(TokenFilter): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled + :keyword odata_type: Required. Identifies the concrete type of the token filter.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, + :paramtype odata_type: str + :keyword name: Required. The name of the token filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str - :param word_list: Required. The list of words to match against. - :type word_list: list[str] - :param min_word_size: The minimum word size. Only words longer than this get processed. Default - is 5. Maximum is 300. - :type min_word_size: int - :param min_subword_size: The minimum subword size. Only subwords longer than this are + :paramtype name: str + :keyword word_list: Required. The list of words to match against. + :paramtype word_list: list[str] + :keyword min_word_size: The minimum word size. Only words longer than this get processed. + Default is 5. Maximum is 300. + :paramtype min_word_size: int + :keyword min_subword_size: The minimum subword size. Only subwords longer than this are outputted. Default is 2. Maximum is 300. - :type min_subword_size: int - :param max_subword_size: The maximum subword size. Only subwords shorter than this are + :paramtype min_subword_size: int + :keyword max_subword_size: The maximum subword size. Only subwords shorter than this are outputted. Default is 15. Maximum is 300. - :type max_subword_size: int - :param only_longest_match: A value indicating whether to add only the longest matching subword - to the output. Default is false. - :type only_longest_match: bool + :paramtype max_subword_size: int + :keyword only_longest_match: A value indicating whether to add only the longest matching + subword to the output. Default is false. + :paramtype only_longest_match: bool """ _validation = { @@ -1448,18 +1454,19 @@ class ScoringFunction(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param type: Required. Indicates the type of function to use. Valid values include magnitude, + :keyword type: Required. Indicates the type of function to use. Valid values include magnitude, freshness, distance, and tag. The function type must be lower case.Constant filled by server. - :type type: str - :param field_name: Required. The name of the field used as input to the scoring function. - :type field_name: str - :param boost: Required. A multiplier for the raw score. Must be a positive number not equal to - 1.0. - :type boost: float - :param interpolation: A value indicating how boosting will be interpolated across document + :paramtype type: str + :keyword field_name: Required. The name of the field used as input to the scoring function. + :paramtype field_name: str + :keyword boost: Required. A multiplier for the raw score. Must be a positive number not equal + to 1.0. + :paramtype boost: float + :keyword interpolation: A value indicating how boosting will be interpolated across document scores; defaults to "Linear". Possible values include: "linear", "constant", "quadratic", "logarithmic". - :type interpolation: str or ~azure.search.documents.indexes.models.ScoringFunctionInterpolation + :paramtype interpolation: str or + ~azure.search.documents.indexes.models.ScoringFunctionInterpolation """ _validation = { @@ -1499,20 +1506,21 @@ class DistanceScoringFunction(ScoringFunction): All required parameters must be populated in order to send to Azure. - :param type: Required. Indicates the type of function to use. Valid values include magnitude, + :keyword type: Required. Indicates the type of function to use. Valid values include magnitude, freshness, distance, and tag. The function type must be lower case.Constant filled by server. - :type type: str - :param field_name: Required. The name of the field used as input to the scoring function. - :type field_name: str - :param boost: Required. A multiplier for the raw score. Must be a positive number not equal to - 1.0. - :type boost: float - :param interpolation: A value indicating how boosting will be interpolated across document + :paramtype type: str + :keyword field_name: Required. The name of the field used as input to the scoring function. + :paramtype field_name: str + :keyword boost: Required. A multiplier for the raw score. Must be a positive number not equal + to 1.0. + :paramtype boost: float + :keyword interpolation: A value indicating how boosting will be interpolated across document scores; defaults to "Linear". Possible values include: "linear", "constant", "quadratic", "logarithmic". - :type interpolation: str or ~azure.search.documents.indexes.models.ScoringFunctionInterpolation - :param parameters: Required. Parameter values for the distance scoring function. - :type parameters: ~azure.search.documents.indexes.models.DistanceScoringParameters + :paramtype interpolation: str or + ~azure.search.documents.indexes.models.ScoringFunctionInterpolation + :keyword parameters: Required. Parameter values for the distance scoring function. + :paramtype parameters: ~azure.search.documents.indexes.models.DistanceScoringParameters """ _validation = { @@ -1549,12 +1557,12 @@ class DistanceScoringParameters(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param reference_point_parameter: Required. The name of the parameter passed in search queries - to specify the reference location. - :type reference_point_parameter: str - :param boosting_distance: Required. The distance in kilometers from the reference location + :keyword reference_point_parameter: Required. The name of the parameter passed in search + queries to specify the reference location. + :paramtype reference_point_parameter: str + :keyword boosting_distance: Required. The distance in kilometers from the reference location where the boosting range ends. - :type boosting_distance: float + :paramtype boosting_distance: float """ _validation = { @@ -1584,32 +1592,33 @@ class DocumentExtractionSkill(SearchIndexerSkill): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the skill.Constant filled by server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill + :paramtype odata_type: str + :keyword name: The name of the skill which uniquely identifies it within the skillset. A skill with no name defined will be given a default name of its 1-based index in the skills array, prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] - :param parsing_mode: The parsingMode for the skill. Will be set to 'default' if not defined. - :type parsing_mode: str - :param data_to_extract: The type of data to be extracted for the skill. Will be set to + :paramtype name: str + :keyword description: The description of the skill which describes the inputs, outputs, and + usage of the skill. + :paramtype description: str + :keyword context: Represents the level at which operations take place, such as the document + root or document content (for example, /document or /document/content). The default is + /document. + :paramtype context: str + :keyword inputs: Required. Inputs of the skills could be a column in the source data set, or + the output of an upstream skill. + :paramtype inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] + :keyword outputs: Required. The output of a skill is either a field in a search index, or a + value that can be consumed as an input by another skill. + :paramtype outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] + :keyword parsing_mode: The parsingMode for the skill. Will be set to 'default' if not defined. + :paramtype parsing_mode: str + :keyword data_to_extract: The type of data to be extracted for the skill. Will be set to 'contentAndMetadata' if not defined. - :type data_to_extract: str - :param configuration: A dictionary of configurations for the skill. - :type configuration: dict[str, any] + :paramtype data_to_extract: str + :keyword configuration: A dictionary of configurations for the skill. + :paramtype configuration: dict[str, any] """ _validation = { @@ -1655,21 +1664,21 @@ class EdgeNGramTokenFilter(TokenFilter): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled + :keyword odata_type: Required. Identifies the concrete type of the token filter.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, + :paramtype odata_type: str + :keyword name: Required. The name of the token filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str - :param min_gram: The minimum n-gram length. Default is 1. Must be less than the value of + :paramtype name: str + :keyword min_gram: The minimum n-gram length. Default is 1. Must be less than the value of maxGram. - :type min_gram: int - :param max_gram: The maximum n-gram length. Default is 2. - :type max_gram: int - :param side: Specifies which side of the input the n-gram should be generated from. Default is - "front". Possible values include: "front", "back". - :type side: str or ~azure.search.documents.indexes.models.EdgeNGramTokenFilterSide + :paramtype min_gram: int + :keyword max_gram: The maximum n-gram length. Default is 2. + :paramtype max_gram: int + :keyword side: Specifies which side of the input the n-gram should be generated from. Default + is "front". Possible values include: "front", "back". + :paramtype side: str or ~azure.search.documents.indexes.models.EdgeNGramTokenFilterSide """ _validation = { @@ -1706,21 +1715,21 @@ class EdgeNGramTokenFilterV2(TokenFilter): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled + :keyword odata_type: Required. Identifies the concrete type of the token filter.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, + :paramtype odata_type: str + :keyword name: Required. The name of the token filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str - :param min_gram: The minimum n-gram length. Default is 1. Maximum is 300. Must be less than the - value of maxGram. - :type min_gram: int - :param max_gram: The maximum n-gram length. Default is 2. Maximum is 300. - :type max_gram: int - :param side: Specifies which side of the input the n-gram should be generated from. Default is - "front". Possible values include: "front", "back". - :type side: str or ~azure.search.documents.indexes.models.EdgeNGramTokenFilterSide + :paramtype name: str + :keyword min_gram: The minimum n-gram length. Default is 1. Maximum is 300. Must be less than + the value of maxGram. + :paramtype min_gram: int + :keyword max_gram: The maximum n-gram length. Default is 2. Maximum is 300. + :paramtype max_gram: int + :keyword side: Specifies which side of the input the n-gram should be generated from. Default + is "front". Possible values include: "front", "back". + :paramtype side: str or ~azure.search.documents.indexes.models.EdgeNGramTokenFilterSide """ _validation = { @@ -1759,20 +1768,20 @@ class EdgeNGramTokenizer(LexicalTokenizer): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the tokenizer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param min_gram: The minimum n-gram length. Default is 1. Maximum is 300. Must be less than the - value of maxGram. - :type min_gram: int - :param max_gram: The maximum n-gram length. Default is 2. Maximum is 300. - :type max_gram: int - :param token_chars: Character classes to keep in the tokens. - :type token_chars: list[str or ~azure.search.documents.indexes.models.TokenCharacterKind] + :paramtype odata_type: str + :keyword name: Required. The name of the tokenizer. It must only contain letters, digits, + spaces, dashes or underscores, can only start and end with alphanumeric characters, and is + limited to 128 characters. + :paramtype name: str + :keyword min_gram: The minimum n-gram length. Default is 1. Maximum is 300. Must be less than + the value of maxGram. + :paramtype min_gram: int + :keyword max_gram: The maximum n-gram length. Default is 2. Maximum is 300. + :paramtype max_gram: int + :keyword token_chars: Character classes to keep in the tokens. + :paramtype token_chars: list[str or ~azure.search.documents.indexes.models.TokenCharacterKind] """ _validation = { @@ -1811,15 +1820,15 @@ class ElisionTokenFilter(TokenFilter): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled + :keyword odata_type: Required. Identifies the concrete type of the token filter.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, + :paramtype odata_type: str + :keyword name: Required. The name of the token filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str - :param articles: The set of articles to remove. - :type articles: list[str] + :paramtype name: str + :keyword articles: The set of articles to remove. + :paramtype articles: list[str] """ _validation = { @@ -1850,35 +1859,36 @@ class EntityLinkingSkill(SearchIndexerSkill): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the skill.Constant filled by server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill + :paramtype odata_type: str + :keyword name: The name of the skill which uniquely identifies it within the skillset. A skill with no name defined will be given a default name of its 1-based index in the skills array, prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] - :param default_language_code: A value indicating which language code to use. Default is en. - :type default_language_code: str - :param minimum_precision: A value between 0 and 1 that be used to only include entities whose + :paramtype name: str + :keyword description: The description of the skill which describes the inputs, outputs, and + usage of the skill. + :paramtype description: str + :keyword context: Represents the level at which operations take place, such as the document + root or document content (for example, /document or /document/content). The default is + /document. + :paramtype context: str + :keyword inputs: Required. Inputs of the skills could be a column in the source data set, or + the output of an upstream skill. + :paramtype inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] + :keyword outputs: Required. The output of a skill is either a field in a search index, or a + value that can be consumed as an input by another skill. + :paramtype outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] + :keyword default_language_code: A value indicating which language code to use. Default is en. + :paramtype default_language_code: str + :keyword minimum_precision: A value between 0 and 1 that be used to only include entities whose confidence score is greater than the value specified. If not set (default), or if explicitly set to null, all entities will be included. - :type minimum_precision: float - :param model_version: The version of the model to use when calling the Text Analytics service. - It will default to the latest available when not specified. We recommend you do not specify - this value unless absolutely necessary. - :type model_version: str + :paramtype minimum_precision: float + :keyword model_version: The version of the model to use when calling the Text Analytics + service. It will default to the latest available when not specified. We recommend you do not + specify this value unless absolutely necessary. + :paramtype model_version: str """ _validation = { @@ -1925,41 +1935,42 @@ class EntityRecognitionSkill(SearchIndexerSkill): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the skill.Constant filled by server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill + :paramtype odata_type: str + :keyword name: The name of the skill which uniquely identifies it within the skillset. A skill with no name defined will be given a default name of its 1-based index in the skills array, prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] - :param categories: A list of entity categories that should be extracted. - :type categories: list[str or ~azure.search.documents.indexes.models.EntityCategory] - :param default_language_code: A value indicating which language code to use. Default is en. + :paramtype name: str + :keyword description: The description of the skill which describes the inputs, outputs, and + usage of the skill. + :paramtype description: str + :keyword context: Represents the level at which operations take place, such as the document + root or document content (for example, /document or /document/content). The default is + /document. + :paramtype context: str + :keyword inputs: Required. Inputs of the skills could be a column in the source data set, or + the output of an upstream skill. + :paramtype inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] + :keyword outputs: Required. The output of a skill is either a field in a search index, or a + value that can be consumed as an input by another skill. + :paramtype outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] + :keyword categories: A list of entity categories that should be extracted. + :paramtype categories: list[str or ~azure.search.documents.indexes.models.EntityCategory] + :keyword default_language_code: A value indicating which language code to use. Default is en. Possible values include: "ar", "cs", "zh-Hans", "zh-Hant", "da", "nl", "en", "fi", "fr", "de", "el", "hu", "it", "ja", "ko", "no", "pl", "pt-PT", "pt-BR", "ru", "es", "sv", "tr". - :type default_language_code: str or + :paramtype default_language_code: str or ~azure.search.documents.indexes.models.EntityRecognitionSkillLanguage - :param include_typeless_entities: Determines whether or not to include entities which are well - known but don't conform to a pre-defined type. If this configuration is not set (default), set - to null or set to false, entities which don't conform to one of the pre-defined types will not - be surfaced. - :type include_typeless_entities: bool - :param minimum_precision: A value between 0 and 1 that be used to only include entities whose + :keyword include_typeless_entities: Determines whether or not to include entities which are + well known but don't conform to a pre-defined type. If this configuration is not set (default), + set to null or set to false, entities which don't conform to one of the pre-defined types will + not be surfaced. + :paramtype include_typeless_entities: bool + :keyword minimum_precision: A value between 0 and 1 that be used to only include entities whose confidence score is greater than the value specified. If not set (default), or if explicitly set to null, all entities will be included. - :type minimum_precision: float + :paramtype minimum_precision: float """ _validation = { @@ -2008,37 +2019,38 @@ class EntityRecognitionSkillV3(SearchIndexerSkill): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the skill.Constant filled by server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill + :paramtype odata_type: str + :keyword name: The name of the skill which uniquely identifies it within the skillset. A skill with no name defined will be given a default name of its 1-based index in the skills array, prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] - :param categories: A list of entity categories that should be extracted. - :type categories: list[str] - :param default_language_code: A value indicating which language code to use. Default is en. - :type default_language_code: str - :param minimum_precision: A value between 0 and 1 that be used to only include entities whose + :paramtype name: str + :keyword description: The description of the skill which describes the inputs, outputs, and + usage of the skill. + :paramtype description: str + :keyword context: Represents the level at which operations take place, such as the document + root or document content (for example, /document or /document/content). The default is + /document. + :paramtype context: str + :keyword inputs: Required. Inputs of the skills could be a column in the source data set, or + the output of an upstream skill. + :paramtype inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] + :keyword outputs: Required. The output of a skill is either a field in a search index, or a + value that can be consumed as an input by another skill. + :paramtype outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] + :keyword categories: A list of entity categories that should be extracted. + :paramtype categories: list[str] + :keyword default_language_code: A value indicating which language code to use. Default is en. + :paramtype default_language_code: str + :keyword minimum_precision: A value between 0 and 1 that be used to only include entities whose confidence score is greater than the value specified. If not set (default), or if explicitly set to null, all entities will be included. - :type minimum_precision: float - :param model_version: The version of the model to use when calling the Text Analytics service. - It will default to the latest available when not specified. We recommend you do not specify - this value unless absolutely necessary. - :type model_version: str + :paramtype minimum_precision: float + :keyword model_version: The version of the model to use when calling the Text Analytics + service. It will default to the latest available when not specified. We recommend you do not + specify this value unless absolutely necessary. + :paramtype model_version: str """ _validation = { @@ -2088,13 +2100,13 @@ class FieldMapping(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param source_field_name: Required. The name of the field in the data source. - :type source_field_name: str - :param target_field_name: The name of the target field in the index. Same as the source field + :keyword source_field_name: Required. The name of the field in the data source. + :paramtype source_field_name: str + :keyword target_field_name: The name of the target field in the index. Same as the source field name by default. - :type target_field_name: str - :param mapping_function: A function to apply to each source field value before indexing. - :type mapping_function: ~azure.search.documents.indexes.models.FieldMappingFunction + :paramtype target_field_name: str + :keyword mapping_function: A function to apply to each source field value before indexing. + :paramtype mapping_function: ~azure.search.documents.indexes.models.FieldMappingFunction """ _validation = { @@ -2126,11 +2138,11 @@ class FieldMappingFunction(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the field mapping function. - :type name: str - :param parameters: A dictionary of parameter name/value pairs to pass to the function. Each + :keyword name: Required. The name of the field mapping function. + :paramtype name: str + :keyword parameters: A dictionary of parameter name/value pairs to pass to the function. Each value must be of a primitive type. - :type parameters: dict[str, any] + :paramtype parameters: dict[str, any] """ _validation = { @@ -2159,20 +2171,21 @@ class FreshnessScoringFunction(ScoringFunction): All required parameters must be populated in order to send to Azure. - :param type: Required. Indicates the type of function to use. Valid values include magnitude, + :keyword type: Required. Indicates the type of function to use. Valid values include magnitude, freshness, distance, and tag. The function type must be lower case.Constant filled by server. - :type type: str - :param field_name: Required. The name of the field used as input to the scoring function. - :type field_name: str - :param boost: Required. A multiplier for the raw score. Must be a positive number not equal to - 1.0. - :type boost: float - :param interpolation: A value indicating how boosting will be interpolated across document + :paramtype type: str + :keyword field_name: Required. The name of the field used as input to the scoring function. + :paramtype field_name: str + :keyword boost: Required. A multiplier for the raw score. Must be a positive number not equal + to 1.0. + :paramtype boost: float + :keyword interpolation: A value indicating how boosting will be interpolated across document scores; defaults to "Linear". Possible values include: "linear", "constant", "quadratic", "logarithmic". - :type interpolation: str or ~azure.search.documents.indexes.models.ScoringFunctionInterpolation - :param parameters: Required. Parameter values for the freshness scoring function. - :type parameters: ~azure.search.documents.indexes.models.FreshnessScoringParameters + :paramtype interpolation: str or + ~azure.search.documents.indexes.models.ScoringFunctionInterpolation + :keyword parameters: Required. Parameter values for the freshness scoring function. + :paramtype parameters: ~azure.search.documents.indexes.models.FreshnessScoringParameters """ _validation = { @@ -2209,9 +2222,9 @@ class FreshnessScoringParameters(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param boosting_duration: Required. The expiration period after which boosting will stop for a - particular document. - :type boosting_duration: ~datetime.timedelta + :keyword boosting_duration: Required. The expiration period after which boosting will stop for + a particular document. + :paramtype boosting_duration: ~datetime.timedelta """ _validation = { @@ -2269,11 +2282,11 @@ class HighWaterMarkChangeDetectionPolicy(DataChangeDetectionPolicy): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the data change detection + :keyword odata_type: Required. Identifies the concrete type of the data change detection policy.Constant filled by server. - :type odata_type: str - :param high_water_mark_column_name: Required. The name of the high water mark column. - :type high_water_mark_column_name: str + :paramtype odata_type: str + :keyword high_water_mark_column_name: Required. The name of the high water mark column. + :paramtype high_water_mark_column_name: str """ _validation = { @@ -2302,33 +2315,34 @@ class ImageAnalysisSkill(SearchIndexerSkill): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the skill.Constant filled by server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill + :paramtype odata_type: str + :keyword name: The name of the skill which uniquely identifies it within the skillset. A skill with no name defined will be given a default name of its 1-based index in the skills array, prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] - :param default_language_code: A value indicating which language code to use. Default is en. + :paramtype name: str + :keyword description: The description of the skill which describes the inputs, outputs, and + usage of the skill. + :paramtype description: str + :keyword context: Represents the level at which operations take place, such as the document + root or document content (for example, /document or /document/content). The default is + /document. + :paramtype context: str + :keyword inputs: Required. Inputs of the skills could be a column in the source data set, or + the output of an upstream skill. + :paramtype inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] + :keyword outputs: Required. The output of a skill is either a field in a search index, or a + value that can be consumed as an input by another skill. + :paramtype outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] + :keyword default_language_code: A value indicating which language code to use. Default is en. Possible values include: "en", "es", "ja", "pt", "zh". - :type default_language_code: str or + :paramtype default_language_code: str or ~azure.search.documents.indexes.models.ImageAnalysisSkillLanguage - :param visual_features: A list of visual features. - :type visual_features: list[str or ~azure.search.documents.indexes.models.VisualFeature] - :param details: A string indicating which domain-specific details to return. - :type details: list[str or ~azure.search.documents.indexes.models.ImageDetail] + :keyword visual_features: A list of visual features. + :paramtype visual_features: list[str or ~azure.search.documents.indexes.models.VisualFeature] + :keyword details: A string indicating which domain-specific details to return. + :paramtype details: list[str or ~azure.search.documents.indexes.models.ImageDetail] """ _validation = { @@ -2369,6 +2383,70 @@ def __init__( self.details = details +class IndexerCurrentState(msrest.serialization.Model): + """Represents all of the state that defines and dictates the indexer's current execution. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar mode: The mode the indexer is running in. Possible values include: "indexingAllDocs", + "indexingResetDocs". + :vartype mode: str or ~azure.search.documents.indexes.models.IndexingMode + :ivar all_docs_initial_change_tracking_state: Change tracking state used when indexing starts + on all documents in the datasource. + :vartype all_docs_initial_change_tracking_state: str + :ivar all_docs_final_change_tracking_state: Change tracking state value when indexing finishes + on all documents in the datasource. + :vartype all_docs_final_change_tracking_state: str + :ivar reset_docs_initial_change_tracking_state: Change tracking state used when indexing starts + on select, reset documents in the datasource. + :vartype reset_docs_initial_change_tracking_state: str + :ivar reset_docs_final_change_tracking_state: Change tracking state value when indexing + finishes on select, reset documents in the datasource. + :vartype reset_docs_final_change_tracking_state: str + :ivar reset_document_keys: The list of document keys that have been reset. The document key is + the document's unique identifier for the data in the search index. The indexer will prioritize + selectively re-ingesting these keys. + :vartype reset_document_keys: list[str] + :ivar reset_datasource_document_ids: The list of datasource document ids that have been reset. + The datasource document id is the unique identifier for the data in the datasource. The indexer + will prioritize selectively re-ingesting these ids. + :vartype reset_datasource_document_ids: list[str] + """ + + _validation = { + 'mode': {'readonly': True}, + 'all_docs_initial_change_tracking_state': {'readonly': True}, + 'all_docs_final_change_tracking_state': {'readonly': True}, + 'reset_docs_initial_change_tracking_state': {'readonly': True}, + 'reset_docs_final_change_tracking_state': {'readonly': True}, + 'reset_document_keys': {'readonly': True}, + 'reset_datasource_document_ids': {'readonly': True}, + } + + _attribute_map = { + 'mode': {'key': 'mode', 'type': 'str'}, + 'all_docs_initial_change_tracking_state': {'key': 'allDocsInitialChangeTrackingState', 'type': 'str'}, + 'all_docs_final_change_tracking_state': {'key': 'allDocsFinalChangeTrackingState', 'type': 'str'}, + 'reset_docs_initial_change_tracking_state': {'key': 'resetDocsInitialChangeTrackingState', 'type': 'str'}, + 'reset_docs_final_change_tracking_state': {'key': 'resetDocsFinalChangeTrackingState', 'type': 'str'}, + 'reset_document_keys': {'key': 'resetDocumentKeys', 'type': '[str]'}, + 'reset_datasource_document_ids': {'key': 'resetDatasourceDocumentIds', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(IndexerCurrentState, self).__init__(**kwargs) + self.mode = None + self.all_docs_initial_change_tracking_state = None + self.all_docs_final_change_tracking_state = None + self.reset_docs_initial_change_tracking_state = None + self.reset_docs_final_change_tracking_state = None + self.reset_document_keys = None + self.reset_datasource_document_ids = None + + class IndexerExecutionResult(msrest.serialization.Model): """Represents the result of an individual indexer execution. @@ -2379,6 +2457,13 @@ class IndexerExecutionResult(msrest.serialization.Model): :ivar status: Required. The outcome of this indexer execution. Possible values include: "transientFailure", "success", "inProgress", "reset". :vartype status: str or ~azure.search.documents.indexes.models.IndexerExecutionStatus + :ivar status_detail: The outcome of this indexer execution. Possible values include: + "resetDocs". + :vartype status_detail: str or + ~azure.search.documents.indexes.models.IndexerExecutionStatusDetail + :ivar current_state: All of the state that defines and dictates the indexer's current + execution. + :vartype current_state: ~azure.search.documents.indexes.models.IndexerCurrentState :ivar error_message: The error message indicating the top-level error, if any. :vartype error_message: str :ivar start_time: The start time of this indexer execution. @@ -2404,6 +2489,8 @@ class IndexerExecutionResult(msrest.serialization.Model): _validation = { 'status': {'required': True, 'readonly': True}, + 'status_detail': {'readonly': True}, + 'current_state': {'readonly': True}, 'error_message': {'readonly': True}, 'start_time': {'readonly': True}, 'end_time': {'readonly': True}, @@ -2417,6 +2504,8 @@ class IndexerExecutionResult(msrest.serialization.Model): _attribute_map = { 'status': {'key': 'status', 'type': 'str'}, + 'status_detail': {'key': 'statusDetail', 'type': 'str'}, + 'current_state': {'key': 'currentState', 'type': 'IndexerCurrentState'}, 'error_message': {'key': 'errorMessage', 'type': 'str'}, 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, @@ -2434,6 +2523,8 @@ def __init__( ): super(IndexerExecutionResult, self).__init__(**kwargs) self.status = None + self.status_detail = None + self.current_state = None self.error_message = None self.start_time = None self.end_time = None @@ -2448,18 +2539,19 @@ def __init__( class IndexingParameters(msrest.serialization.Model): """Represents parameters for indexer execution. - :param batch_size: The number of items that are read from the data source and indexed as a + :keyword batch_size: The number of items that are read from the data source and indexed as a single batch in order to improve performance. The default depends on the data source type. - :type batch_size: int - :param max_failed_items: The maximum number of items that can fail indexing for indexer + :paramtype batch_size: int + :keyword max_failed_items: The maximum number of items that can fail indexing for indexer execution to still be considered successful. -1 means no limit. Default is 0. - :type max_failed_items: int - :param max_failed_items_per_batch: The maximum number of items in a single batch that can fail - indexing for the batch to still be considered successful. -1 means no limit. Default is 0. - :type max_failed_items_per_batch: int - :param configuration: A dictionary of indexer-specific configuration properties. Each name is + :paramtype max_failed_items: int + :keyword max_failed_items_per_batch: The maximum number of items in a single batch that can + fail indexing for the batch to still be considered successful. -1 means no limit. Default is 0. + :paramtype max_failed_items_per_batch: int + :keyword configuration: A dictionary of indexer-specific configuration properties. Each name is the name of a specific property. Each value must be of a primitive type. - :type configuration: ~azure.search.documents.indexes.models.IndexingParametersConfiguration + :paramtype configuration: + ~azure.search.documents.indexes.models.IndexingParametersConfiguration """ _attribute_map = { @@ -2488,72 +2580,73 @@ def __init__( class IndexingParametersConfiguration(msrest.serialization.Model): """A dictionary of indexer-specific configuration properties. Each name is the name of a specific property. Each value must be of a primitive type. - :param additional_properties: Unmatched properties from the message are deserialized to this + :keyword additional_properties: Unmatched properties from the message are deserialized to this collection. - :type additional_properties: dict[str, any] - :param parsing_mode: Represents the parsing mode for indexing from an Azure blob data source. + :paramtype additional_properties: dict[str, any] + :keyword parsing_mode: Represents the parsing mode for indexing from an Azure blob data source. Possible values include: "default", "text", "delimitedText", "json", "jsonArray", "jsonLines". Default value: "default". - :type parsing_mode: str or ~azure.search.documents.indexes.models.BlobIndexerParsingMode - :param excluded_file_name_extensions: Comma-delimited list of filename extensions to ignore + :paramtype parsing_mode: str or ~azure.search.documents.indexes.models.BlobIndexerParsingMode + :keyword excluded_file_name_extensions: Comma-delimited list of filename extensions to ignore when processing from Azure blob storage. For example, you could exclude ".png, .mp4" to skip over those files during indexing. - :type excluded_file_name_extensions: str - :param indexed_file_name_extensions: Comma-delimited list of filename extensions to select when - processing from Azure blob storage. For example, you could focus indexing on specific + :paramtype excluded_file_name_extensions: str + :keyword indexed_file_name_extensions: Comma-delimited list of filename extensions to select + when processing from Azure blob storage. For example, you could focus indexing on specific application files ".docx, .pptx, .msg" to specifically include those file types. - :type indexed_file_name_extensions: str - :param fail_on_unsupported_content_type: For Azure blobs, set to false if you want to continue - indexing when an unsupported content type is encountered, and you don't know all the content - types (file extensions) in advance. - :type fail_on_unsupported_content_type: bool - :param fail_on_unprocessable_document: For Azure blobs, set to false if you want to continue + :paramtype indexed_file_name_extensions: str + :keyword fail_on_unsupported_content_type: For Azure blobs, set to false if you want to + continue indexing when an unsupported content type is encountered, and you don't know all the + content types (file extensions) in advance. + :paramtype fail_on_unsupported_content_type: bool + :keyword fail_on_unprocessable_document: For Azure blobs, set to false if you want to continue indexing if a document fails indexing. - :type fail_on_unprocessable_document: bool - :param index_storage_metadata_only_for_oversized_documents: For Azure blobs, set this property - to true to still index storage metadata for blob content that is too large to process. + :paramtype fail_on_unprocessable_document: bool + :keyword index_storage_metadata_only_for_oversized_documents: For Azure blobs, set this + property to true to still index storage metadata for blob content that is too large to process. Oversized blobs are treated as errors by default. For limits on blob size, see https://docs.microsoft.com/azure/search/search-limits-quotas-capacity. - :type index_storage_metadata_only_for_oversized_documents: bool - :param delimited_text_headers: For CSV blobs, specifies a comma-delimited list of column + :paramtype index_storage_metadata_only_for_oversized_documents: bool + :keyword delimited_text_headers: For CSV blobs, specifies a comma-delimited list of column headers, useful for mapping source fields to destination fields in an index. - :type delimited_text_headers: str - :param delimited_text_delimiter: For CSV blobs, specifies the end-of-line single-character + :paramtype delimited_text_headers: str + :keyword delimited_text_delimiter: For CSV blobs, specifies the end-of-line single-character delimiter for CSV files where each line starts a new document (for example, "|"). - :type delimited_text_delimiter: str - :param first_line_contains_headers: For CSV blobs, indicates that the first (non-blank) line of - each blob contains headers. - :type first_line_contains_headers: bool - :param document_root: For JSON arrays, given a structured or semi-structured document, you can - specify a path to the array using this property. - :type document_root: str - :param data_to_extract: Specifies the data to extract from Azure blob storage and tells the + :paramtype delimited_text_delimiter: str + :keyword first_line_contains_headers: For CSV blobs, indicates that the first (non-blank) line + of each blob contains headers. + :paramtype first_line_contains_headers: bool + :keyword document_root: For JSON arrays, given a structured or semi-structured document, you + can specify a path to the array using this property. + :paramtype document_root: str + :keyword data_to_extract: Specifies the data to extract from Azure blob storage and tells the indexer which data to extract from image content when "imageAction" is set to a value other than "none". This applies to embedded image content in a .PDF or other application, or image files such as .jpg and .png, in Azure blobs. Possible values include: "storageMetadata", "allMetadata", "contentAndMetadata". Default value: "contentAndMetadata". - :type data_to_extract: str or ~azure.search.documents.indexes.models.BlobIndexerDataToExtract - :param image_action: Determines how to process embedded images and image files in Azure blob + :paramtype data_to_extract: str or + ~azure.search.documents.indexes.models.BlobIndexerDataToExtract + :keyword image_action: Determines how to process embedded images and image files in Azure blob storage. Setting the "imageAction" configuration to any value other than "none" requires that a skillset also be attached to that indexer. Possible values include: "none", "generateNormalizedImages", "generateNormalizedImagePerPage". Default value: "none". - :type image_action: str or ~azure.search.documents.indexes.models.BlobIndexerImageAction - :param allow_skillset_to_read_file_data: If true, will create a path //document//file_data that - is an object representing the original file data downloaded from your blob data source. This - allows you to pass the original file data to a custom skill for processing within the + :paramtype image_action: str or ~azure.search.documents.indexes.models.BlobIndexerImageAction + :keyword allow_skillset_to_read_file_data: If true, will create a path //document//file_data + that is an object representing the original file data downloaded from your blob data source. + This allows you to pass the original file data to a custom skill for processing within the enrichment pipeline, or to the Document Extraction skill. - :type allow_skillset_to_read_file_data: bool - :param pdf_text_rotation_algorithm: Determines algorithm for text extraction from PDF files in - Azure blob storage. Possible values include: "none", "detectAngles". Default value: "none". - :type pdf_text_rotation_algorithm: str or + :paramtype allow_skillset_to_read_file_data: bool + :keyword pdf_text_rotation_algorithm: Determines algorithm for text extraction from PDF files + in Azure blob storage. Possible values include: "none", "detectAngles". Default value: "none". + :paramtype pdf_text_rotation_algorithm: str or ~azure.search.documents.indexes.models.BlobIndexerPDFTextRotationAlgorithm - :param execution_environment: Specifies the environment in which the indexer should execute. + :keyword execution_environment: Specifies the environment in which the indexer should execute. Possible values include: "standard", "private". Default value: "standard". - :type execution_environment: str or + :paramtype execution_environment: str or ~azure.search.documents.indexes.models.IndexerExecutionEnvironment - :param query_timeout: Increases the timeout beyond the 5-minute default for Azure SQL database - data sources, specified in the format "hh:mm:ss". - :type query_timeout: str + :keyword query_timeout: Increases the timeout beyond the 5-minute default for Azure SQL + database data sources, specified in the format "hh:mm:ss". + :paramtype query_timeout: str """ _attribute_map = { @@ -2623,10 +2716,10 @@ class IndexingSchedule(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param interval: Required. The interval of time between indexer executions. - :type interval: ~datetime.timedelta - :param start_time: The time when an indexer should start running. - :type start_time: ~datetime.datetime + :keyword interval: Required. The interval of time between indexer executions. + :paramtype interval: ~datetime.timedelta + :keyword start_time: The time when an indexer should start running. + :paramtype start_time: ~datetime.datetime """ _validation = { @@ -2655,14 +2748,14 @@ class InputFieldMappingEntry(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the input. - :type name: str - :param source: The source of the input. - :type source: str - :param source_context: The source context used for selecting recursive inputs. - :type source_context: str - :param inputs: The recursive inputs used when creating a complex type. - :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] + :keyword name: Required. The name of the input. + :paramtype name: str + :keyword source: The source of the input. + :paramtype source: str + :keyword source_context: The source context used for selecting recursive inputs. + :paramtype source_context: str + :keyword inputs: The recursive inputs used when creating a complex type. + :paramtype inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] """ _validation = { @@ -2697,18 +2790,18 @@ class KeepTokenFilter(TokenFilter): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled + :keyword odata_type: Required. Identifies the concrete type of the token filter.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, + :paramtype odata_type: str + :keyword name: Required. The name of the token filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str - :param keep_words: Required. The list of words to keep. - :type keep_words: list[str] - :param lower_case_keep_words: A value indicating whether to lower case all words first. Default - is false. - :type lower_case_keep_words: bool + :paramtype name: str + :keyword keep_words: Required. The list of words to keep. + :paramtype keep_words: list[str] + :keyword lower_case_keep_words: A value indicating whether to lower case all words first. + Default is false. + :paramtype lower_case_keep_words: bool """ _validation = { @@ -2743,37 +2836,38 @@ class KeyPhraseExtractionSkill(SearchIndexerSkill): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the skill.Constant filled by server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill + :paramtype odata_type: str + :keyword name: The name of the skill which uniquely identifies it within the skillset. A skill with no name defined will be given a default name of its 1-based index in the skills array, prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] - :param default_language_code: A value indicating which language code to use. Default is en. + :paramtype name: str + :keyword description: The description of the skill which describes the inputs, outputs, and + usage of the skill. + :paramtype description: str + :keyword context: Represents the level at which operations take place, such as the document + root or document content (for example, /document or /document/content). The default is + /document. + :paramtype context: str + :keyword inputs: Required. Inputs of the skills could be a column in the source data set, or + the output of an upstream skill. + :paramtype inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] + :keyword outputs: Required. The output of a skill is either a field in a search index, or a + value that can be consumed as an input by another skill. + :paramtype outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] + :keyword default_language_code: A value indicating which language code to use. Default is en. Possible values include: "da", "nl", "en", "fi", "fr", "de", "it", "ja", "ko", "no", "pl", "pt-PT", "pt-BR", "ru", "es", "sv". - :type default_language_code: str or + :paramtype default_language_code: str or ~azure.search.documents.indexes.models.KeyPhraseExtractionSkillLanguage - :param max_key_phrase_count: A number indicating how many key phrases to return. If absent, all - identified key phrases will be returned. - :type max_key_phrase_count: int - :param model_version: The version of the model to use when calling the Text Analytics service. - It will default to the latest available when not specified. We recommend you do not specify - this value unless absolutely necessary. - :type model_version: str + :keyword max_key_phrase_count: A number indicating how many key phrases to return. If absent, + all identified key phrases will be returned. + :paramtype max_key_phrase_count: int + :keyword model_version: The version of the model to use when calling the Text Analytics + service. It will default to the latest available when not specified. We recommend you do not + specify this value unless absolutely necessary. + :paramtype model_version: str """ _validation = { @@ -2819,18 +2913,18 @@ class KeywordMarkerTokenFilter(TokenFilter): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled + :keyword odata_type: Required. Identifies the concrete type of the token filter.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, + :paramtype odata_type: str + :keyword name: Required. The name of the token filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str - :param keywords: Required. A list of words to mark as keywords. - :type keywords: list[str] - :param ignore_case: A value indicating whether to ignore case. If true, all words are converted - to lower case first. Default is false. - :type ignore_case: bool + :paramtype name: str + :keyword keywords: Required. A list of words to mark as keywords. + :paramtype keywords: list[str] + :keyword ignore_case: A value indicating whether to ignore case. If true, all words are + converted to lower case first. Default is false. + :paramtype ignore_case: bool """ _validation = { @@ -2865,15 +2959,15 @@ class KeywordTokenizer(LexicalTokenizer): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the tokenizer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param buffer_size: The read buffer size in bytes. Default is 256. - :type buffer_size: int + :paramtype odata_type: str + :keyword name: Required. The name of the tokenizer. It must only contain letters, digits, + spaces, dashes or underscores, can only start and end with alphanumeric characters, and is + limited to 128 characters. + :paramtype name: str + :keyword buffer_size: The read buffer size in bytes. Default is 256. + :paramtype buffer_size: int """ _validation = { @@ -2904,16 +2998,16 @@ class KeywordTokenizerV2(LexicalTokenizer): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the tokenizer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param max_token_length: The maximum token length. Default is 256. Tokens longer than the + :paramtype odata_type: str + :keyword name: Required. The name of the tokenizer. It must only contain letters, digits, + spaces, dashes or underscores, can only start and end with alphanumeric characters, and is + limited to 128 characters. + :paramtype name: str + :keyword max_token_length: The maximum token length. Default is 256. Tokens longer than the maximum length are split. The maximum token length that can be used is 300 characters. - :type max_token_length: int + :paramtype max_token_length: int """ _validation = { @@ -2945,32 +3039,33 @@ class LanguageDetectionSkill(SearchIndexerSkill): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the skill.Constant filled by server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill + :paramtype odata_type: str + :keyword name: The name of the skill which uniquely identifies it within the skillset. A skill with no name defined will be given a default name of its 1-based index in the skills array, prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] - :param default_country_hint: A country code to use as a hint to the language detection model if - it cannot disambiguate the language. - :type default_country_hint: str - :param model_version: The version of the model to use when calling the Text Analytics service. - It will default to the latest available when not specified. We recommend you do not specify - this value unless absolutely necessary. - :type model_version: str + :paramtype name: str + :keyword description: The description of the skill which describes the inputs, outputs, and + usage of the skill. + :paramtype description: str + :keyword context: Represents the level at which operations take place, such as the document + root or document content (for example, /document or /document/content). The default is + /document. + :paramtype context: str + :keyword inputs: Required. Inputs of the skills could be a column in the source data set, or + the output of an upstream skill. + :paramtype inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] + :keyword outputs: Required. The output of a skill is either a field in a search index, or a + value that can be consumed as an input by another skill. + :paramtype outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] + :keyword default_country_hint: A country code to use as a hint to the language detection model + if it cannot disambiguate the language. + :paramtype default_country_hint: str + :keyword model_version: The version of the model to use when calling the Text Analytics + service. It will default to the latest available when not specified. We recommend you do not + specify this value unless absolutely necessary. + :paramtype model_version: str """ _validation = { @@ -3013,18 +3108,18 @@ class LengthTokenFilter(TokenFilter): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled + :keyword odata_type: Required. Identifies the concrete type of the token filter.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, + :paramtype odata_type: str + :keyword name: Required. The name of the token filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str - :param min_length: The minimum length in characters. Default is 0. Maximum is 300. Must be less - than the value of max. - :type min_length: int - :param max_length: The maximum length in characters. Default and maximum is 300. - :type max_length: int + :paramtype name: str + :keyword min_length: The minimum length in characters. Default is 0. Maximum is 300. Must be + less than the value of max. + :paramtype min_length: int + :keyword max_length: The maximum length in characters. Default and maximum is 300. + :paramtype max_length: int """ _validation = { @@ -3060,18 +3155,18 @@ class LimitTokenFilter(TokenFilter): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled + :keyword odata_type: Required. Identifies the concrete type of the token filter.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, + :paramtype odata_type: str + :keyword name: Required. The name of the token filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str - :param max_token_count: The maximum number of tokens to produce. Default is 1. - :type max_token_count: int - :param consume_all_tokens: A value indicating whether all tokens from the input must be + :paramtype name: str + :keyword max_token_count: The maximum number of tokens to produce. Default is 1. + :paramtype max_token_count: int + :keyword consume_all_tokens: A value indicating whether all tokens from the input must be consumed even if maxTokenCount is reached. Default is false. - :type consume_all_tokens: bool + :paramtype consume_all_tokens: bool """ _validation = { @@ -3240,18 +3335,18 @@ class LuceneStandardAnalyzer(LexicalAnalyzer): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the analyzer.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the analyzer.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the analyzer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param max_token_length: The maximum token length. Default is 255. Tokens longer than the + :paramtype odata_type: str + :keyword name: Required. The name of the analyzer. It must only contain letters, digits, + spaces, dashes or underscores, can only start and end with alphanumeric characters, and is + limited to 128 characters. + :paramtype name: str + :keyword max_token_length: The maximum token length. Default is 255. Tokens longer than the maximum length are split. The maximum token length that can be used is 300 characters. - :type max_token_length: int - :param stopwords: A list of stopwords. - :type stopwords: list[str] + :paramtype max_token_length: int + :keyword stopwords: A list of stopwords. + :paramtype stopwords: list[str] """ _validation = { @@ -3286,16 +3381,16 @@ class LuceneStandardTokenizer(LexicalTokenizer): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the tokenizer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param max_token_length: The maximum token length. Default is 255. Tokens longer than the + :paramtype odata_type: str + :keyword name: Required. The name of the tokenizer. It must only contain letters, digits, + spaces, dashes or underscores, can only start and end with alphanumeric characters, and is + limited to 128 characters. + :paramtype name: str + :keyword max_token_length: The maximum token length. Default is 255. Tokens longer than the maximum length are split. - :type max_token_length: int + :paramtype max_token_length: int """ _validation = { @@ -3326,16 +3421,16 @@ class LuceneStandardTokenizerV2(LexicalTokenizer): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the tokenizer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param max_token_length: The maximum token length. Default is 255. Tokens longer than the + :paramtype odata_type: str + :keyword name: Required. The name of the tokenizer. It must only contain letters, digits, + spaces, dashes or underscores, can only start and end with alphanumeric characters, and is + limited to 128 characters. + :paramtype name: str + :keyword max_token_length: The maximum token length. Default is 255. Tokens longer than the maximum length are split. The maximum token length that can be used is 300 characters. - :type max_token_length: int + :paramtype max_token_length: int """ _validation = { @@ -3367,20 +3462,21 @@ class MagnitudeScoringFunction(ScoringFunction): All required parameters must be populated in order to send to Azure. - :param type: Required. Indicates the type of function to use. Valid values include magnitude, + :keyword type: Required. Indicates the type of function to use. Valid values include magnitude, freshness, distance, and tag. The function type must be lower case.Constant filled by server. - :type type: str - :param field_name: Required. The name of the field used as input to the scoring function. - :type field_name: str - :param boost: Required. A multiplier for the raw score. Must be a positive number not equal to - 1.0. - :type boost: float - :param interpolation: A value indicating how boosting will be interpolated across document + :paramtype type: str + :keyword field_name: Required. The name of the field used as input to the scoring function. + :paramtype field_name: str + :keyword boost: Required. A multiplier for the raw score. Must be a positive number not equal + to 1.0. + :paramtype boost: float + :keyword interpolation: A value indicating how boosting will be interpolated across document scores; defaults to "Linear". Possible values include: "linear", "constant", "quadratic", "logarithmic". - :type interpolation: str or ~azure.search.documents.indexes.models.ScoringFunctionInterpolation - :param parameters: Required. Parameter values for the magnitude scoring function. - :type parameters: ~azure.search.documents.indexes.models.MagnitudeScoringParameters + :paramtype interpolation: str or + ~azure.search.documents.indexes.models.ScoringFunctionInterpolation + :keyword parameters: Required. Parameter values for the magnitude scoring function. + :paramtype parameters: ~azure.search.documents.indexes.models.MagnitudeScoringParameters """ _validation = { @@ -3417,13 +3513,13 @@ class MagnitudeScoringParameters(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param boosting_range_start: Required. The field value at which boosting starts. - :type boosting_range_start: float - :param boosting_range_end: Required. The field value at which boosting ends. - :type boosting_range_end: float - :param should_boost_beyond_range_by_constant: A value indicating whether to apply a constant + :keyword boosting_range_start: Required. The field value at which boosting starts. + :paramtype boosting_range_start: float + :keyword boosting_range_end: Required. The field value at which boosting ends. + :paramtype boosting_range_end: float + :keyword should_boost_beyond_range_by_constant: A value indicating whether to apply a constant boost for field values beyond the range end value; default is false. - :type should_boost_beyond_range_by_constant: bool + :paramtype should_boost_beyond_range_by_constant: bool """ _validation = { @@ -3456,16 +3552,16 @@ class MappingCharFilter(CharFilter): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the char filter.Constant filled by - server. - :type odata_type: str - :param name: Required. The name of the char filter. It must only contain letters, digits, + :keyword odata_type: Required. Identifies the concrete type of the char filter.Constant filled + by server. + :paramtype odata_type: str + :keyword name: Required. The name of the char filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str - :param mappings: Required. A list of mappings of the following format: "a=>b" (all occurrences - of the character "a" will be replaced with character "b"). - :type mappings: list[str] + :paramtype name: str + :keyword mappings: Required. A list of mappings of the following format: "a=>b" (all + occurrences of the character "a" will be replaced with character "b"). + :paramtype mappings: list[str] """ _validation = { @@ -3497,31 +3593,32 @@ class MergeSkill(SearchIndexerSkill): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the skill.Constant filled by server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill + :paramtype odata_type: str + :keyword name: The name of the skill which uniquely identifies it within the skillset. A skill with no name defined will be given a default name of its 1-based index in the skills array, prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] - :param insert_pre_tag: The tag indicates the start of the merged text. By default, the tag is + :paramtype name: str + :keyword description: The description of the skill which describes the inputs, outputs, and + usage of the skill. + :paramtype description: str + :keyword context: Represents the level at which operations take place, such as the document + root or document content (for example, /document or /document/content). The default is + /document. + :paramtype context: str + :keyword inputs: Required. Inputs of the skills could be a column in the source data set, or + the output of an upstream skill. + :paramtype inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] + :keyword outputs: Required. The output of a skill is either a field in a search index, or a + value that can be consumed as an input by another skill. + :paramtype outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] + :keyword insert_pre_tag: The tag indicates the start of the merged text. By default, the tag is an empty space. - :type insert_pre_tag: str - :param insert_post_tag: The tag indicates the end of the merged text. By default, the tag is an - empty space. - :type insert_post_tag: str + :paramtype insert_pre_tag: str + :keyword insert_post_tag: The tag indicates the end of the merged text. By default, the tag is + an empty space. + :paramtype insert_post_tag: str """ _validation = { @@ -3564,29 +3661,29 @@ class MicrosoftLanguageStemmingTokenizer(LexicalTokenizer): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the tokenizer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param max_token_length: The maximum token length. Tokens longer than the maximum length are + :paramtype odata_type: str + :keyword name: Required. The name of the tokenizer. It must only contain letters, digits, + spaces, dashes or underscores, can only start and end with alphanumeric characters, and is + limited to 128 characters. + :paramtype name: str + :keyword max_token_length: The maximum token length. Tokens longer than the maximum length are split. Maximum token length that can be used is 300 characters. Tokens longer than 300 characters are first split into tokens of length 300 and then each of those tokens is split based on the max token length set. Default is 255. - :type max_token_length: int - :param is_search_tokenizer: A value indicating how the tokenizer is used. Set to true if used + :paramtype max_token_length: int + :keyword is_search_tokenizer: A value indicating how the tokenizer is used. Set to true if used as the search tokenizer, set to false if used as the indexing tokenizer. Default is false. - :type is_search_tokenizer: bool - :param language: The language to use. The default is English. Possible values include: + :paramtype is_search_tokenizer: bool + :keyword language: The language to use. The default is English. Possible values include: "arabic", "bangla", "bulgarian", "catalan", "croatian", "czech", "danish", "dutch", "english", "estonian", "finnish", "french", "german", "greek", "gujarati", "hebrew", "hindi", "hungarian", "icelandic", "indonesian", "italian", "kannada", "latvian", "lithuanian", "malay", "malayalam", "marathi", "norwegianBokmaal", "polish", "portuguese", "portugueseBrazilian", "punjabi", "romanian", "russian", "serbianCyrillic", "serbianLatin", "slovak", "slovenian", "spanish", "swedish", "tamil", "telugu", "turkish", "ukrainian", "urdu". - :type language: str or + :paramtype language: str or ~azure.search.documents.indexes.models.MicrosoftStemmingTokenizerLanguage """ @@ -3625,29 +3722,29 @@ class MicrosoftLanguageTokenizer(LexicalTokenizer): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the tokenizer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param max_token_length: The maximum token length. Tokens longer than the maximum length are + :paramtype odata_type: str + :keyword name: Required. The name of the tokenizer. It must only contain letters, digits, + spaces, dashes or underscores, can only start and end with alphanumeric characters, and is + limited to 128 characters. + :paramtype name: str + :keyword max_token_length: The maximum token length. Tokens longer than the maximum length are split. Maximum token length that can be used is 300 characters. Tokens longer than 300 characters are first split into tokens of length 300 and then each of those tokens is split based on the max token length set. Default is 255. - :type max_token_length: int - :param is_search_tokenizer: A value indicating how the tokenizer is used. Set to true if used + :paramtype max_token_length: int + :keyword is_search_tokenizer: A value indicating how the tokenizer is used. Set to true if used as the search tokenizer, set to false if used as the indexing tokenizer. Default is false. - :type is_search_tokenizer: bool - :param language: The language to use. The default is English. Possible values include: + :paramtype is_search_tokenizer: bool + :keyword language: The language to use. The default is English. Possible values include: "bangla", "bulgarian", "catalan", "chineseSimplified", "chineseTraditional", "croatian", "czech", "danish", "dutch", "english", "french", "german", "greek", "gujarati", "hindi", "icelandic", "indonesian", "italian", "japanese", "kannada", "korean", "malay", "malayalam", "marathi", "norwegianBokmaal", "polish", "portuguese", "portugueseBrazilian", "punjabi", "romanian", "russian", "serbianCyrillic", "serbianLatin", "slovenian", "spanish", "swedish", "tamil", "telugu", "thai", "ukrainian", "urdu", "vietnamese". - :type language: str or ~azure.search.documents.indexes.models.MicrosoftTokenizerLanguage + :paramtype language: str or ~azure.search.documents.indexes.models.MicrosoftTokenizerLanguage """ _validation = { @@ -3685,18 +3782,18 @@ class NGramTokenFilter(TokenFilter): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled + :keyword odata_type: Required. Identifies the concrete type of the token filter.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, + :paramtype odata_type: str + :keyword name: Required. The name of the token filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str - :param min_gram: The minimum n-gram length. Default is 1. Must be less than the value of + :paramtype name: str + :keyword min_gram: The minimum n-gram length. Default is 1. Must be less than the value of maxGram. - :type min_gram: int - :param max_gram: The maximum n-gram length. Default is 2. - :type max_gram: int + :paramtype min_gram: int + :keyword max_gram: The maximum n-gram length. Default is 2. + :paramtype max_gram: int """ _validation = { @@ -3730,18 +3827,18 @@ class NGramTokenFilterV2(TokenFilter): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled + :keyword odata_type: Required. Identifies the concrete type of the token filter.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, + :paramtype odata_type: str + :keyword name: Required. The name of the token filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str - :param min_gram: The minimum n-gram length. Default is 1. Maximum is 300. Must be less than the - value of maxGram. - :type min_gram: int - :param max_gram: The maximum n-gram length. Default is 2. Maximum is 300. - :type max_gram: int + :paramtype name: str + :keyword min_gram: The minimum n-gram length. Default is 1. Maximum is 300. Must be less than + the value of maxGram. + :paramtype min_gram: int + :keyword max_gram: The maximum n-gram length. Default is 2. Maximum is 300. + :paramtype max_gram: int """ _validation = { @@ -3777,20 +3874,20 @@ class NGramTokenizer(LexicalTokenizer): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the tokenizer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param min_gram: The minimum n-gram length. Default is 1. Maximum is 300. Must be less than the - value of maxGram. - :type min_gram: int - :param max_gram: The maximum n-gram length. Default is 2. Maximum is 300. - :type max_gram: int - :param token_chars: Character classes to keep in the tokens. - :type token_chars: list[str or ~azure.search.documents.indexes.models.TokenCharacterKind] + :paramtype odata_type: str + :keyword name: Required. The name of the tokenizer. It must only contain letters, digits, + spaces, dashes or underscores, can only start and end with alphanumeric characters, and is + limited to 128 characters. + :paramtype name: str + :keyword min_gram: The minimum n-gram length. Default is 1. Maximum is 300. Must be less than + the value of maxGram. + :paramtype min_gram: int + :keyword max_gram: The maximum n-gram length. Default is 2. Maximum is 300. + :paramtype max_gram: int + :keyword token_chars: Character classes to keep in the tokens. + :paramtype token_chars: list[str or ~azure.search.documents.indexes.models.TokenCharacterKind] """ _validation = { @@ -3829,37 +3926,39 @@ class OcrSkill(SearchIndexerSkill): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the skill.Constant filled by server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill + :paramtype odata_type: str + :keyword name: The name of the skill which uniquely identifies it within the skillset. A skill with no name defined will be given a default name of its 1-based index in the skills array, prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] - :param default_language_code: A value indicating which language code to use. Default is en. + :paramtype name: str + :keyword description: The description of the skill which describes the inputs, outputs, and + usage of the skill. + :paramtype description: str + :keyword context: Represents the level at which operations take place, such as the document + root or document content (for example, /document or /document/content). The default is + /document. + :paramtype context: str + :keyword inputs: Required. Inputs of the skills could be a column in the source data set, or + the output of an upstream skill. + :paramtype inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] + :keyword outputs: Required. The output of a skill is either a field in a search index, or a + value that can be consumed as an input by another skill. + :paramtype outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] + :keyword default_language_code: A value indicating which language code to use. Default is en. Possible values include: "zh-Hans", "zh-Hant", "cs", "da", "nl", "en", "fi", "fr", "de", "el", "hu", "it", "ja", "ko", "nb", "pl", "pt", "ru", "es", "sv", "tr", "ar", "ro", "sr-Cyrl", "sr-Latn", "sk". - :type default_language_code: str or ~azure.search.documents.indexes.models.OcrSkillLanguage - :param should_detect_orientation: A value indicating to turn orientation detection on or not. + :paramtype default_language_code: str or + ~azure.search.documents.indexes.models.OcrSkillLanguage + :keyword should_detect_orientation: A value indicating to turn orientation detection on or not. Default is false. - :type should_detect_orientation: bool - :param line_ending: Defines the sequence of characters to use between the lines of text + :paramtype should_detect_orientation: bool + :keyword line_ending: Defines the sequence of characters to use between the lines of text recognized by the OCR skill. The default value is "space". Possible values include: "space", "carriageReturn", "lineFeed", "carriageReturnLineFeed". - :type line_ending: str or ~azure.search.documents.indexes.models.LineEnding + :paramtype line_ending: str or ~azure.search.documents.indexes.models.LineEnding """ _validation = { @@ -3905,10 +4004,10 @@ class OutputFieldMappingEntry(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the output defined by the skill. - :type name: str - :param target_name: The target name of the output. It is optional and default to name. - :type target_name: str + :keyword name: Required. The name of the output defined by the skill. + :paramtype name: str + :keyword target_name: The target name of the output. It is optional and default to name. + :paramtype target_name: str """ _validation = { @@ -3937,24 +4036,24 @@ class PathHierarchyTokenizerV2(LexicalTokenizer): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the tokenizer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param delimiter: The delimiter character to use. Default is "/". - :type delimiter: str - :param replacement: A value that, if set, replaces the delimiter character. Default is "/". - :type replacement: str - :param max_token_length: The maximum token length. Default and maximum is 300. - :type max_token_length: int - :param reverse_token_order: A value indicating whether to generate tokens in reverse order. + :paramtype odata_type: str + :keyword name: Required. The name of the tokenizer. It must only contain letters, digits, + spaces, dashes or underscores, can only start and end with alphanumeric characters, and is + limited to 128 characters. + :paramtype name: str + :keyword delimiter: The delimiter character to use. Default is "/". + :paramtype delimiter: str + :keyword replacement: A value that, if set, replaces the delimiter character. Default is "/". + :paramtype replacement: str + :keyword max_token_length: The maximum token length. Default and maximum is 300. + :paramtype max_token_length: int + :keyword reverse_token_order: A value indicating whether to generate tokens in reverse order. Default is false. - :type reverse_token_order: bool - :param number_of_tokens_to_skip: The number of initial tokens to skip. Default is 0. - :type number_of_tokens_to_skip: int + :paramtype reverse_token_order: bool + :keyword number_of_tokens_to_skip: The number of initial tokens to skip. Default is 0. + :paramtype number_of_tokens_to_skip: int """ _validation = { @@ -3993,29 +4092,55 @@ def __init__( self.number_of_tokens_to_skip = number_of_tokens_to_skip +class Paths1Cj7DxmIndexersIndexernameSearchResetdocsPostRequestbodyContentApplicationJsonSchema(msrest.serialization.Model): + """Paths1Cj7DxmIndexersIndexernameSearchResetdocsPostRequestbodyContentApplicationJsonSchema. + + :keyword document_keys: document keys to be reset. + :paramtype document_keys: list[str] + :keyword datasource_document_ids: datasource document identifiers to be reset. + :paramtype datasource_document_ids: list[str] + """ + + _attribute_map = { + 'document_keys': {'key': 'documentKeys', 'type': '[str]'}, + 'datasource_document_ids': {'key': 'datasourceDocumentIds', 'type': '[str]'}, + } + + def __init__( + self, + *, + document_keys: Optional[List[str]] = None, + datasource_document_ids: Optional[List[str]] = None, + **kwargs + ): + super(Paths1Cj7DxmIndexersIndexernameSearchResetdocsPostRequestbodyContentApplicationJsonSchema, self).__init__(**kwargs) + self.document_keys = document_keys + self.datasource_document_ids = datasource_document_ids + + class PatternAnalyzer(LexicalAnalyzer): """Flexibly separates text into terms via a regular expression pattern. This analyzer is implemented using Apache Lucene. All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the analyzer.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the analyzer.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the analyzer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param lower_case_terms: A value indicating whether terms should be lower-cased. Default is + :paramtype odata_type: str + :keyword name: Required. The name of the analyzer. It must only contain letters, digits, + spaces, dashes or underscores, can only start and end with alphanumeric characters, and is + limited to 128 characters. + :paramtype name: str + :keyword lower_case_terms: A value indicating whether terms should be lower-cased. Default is true. - :type lower_case_terms: bool - :param pattern: A regular expression pattern to match token separators. Default is an + :paramtype lower_case_terms: bool + :keyword pattern: A regular expression pattern to match token separators. Default is an expression that matches one or more non-word characters. - :type pattern: str - :param flags: Regular expression flags. Possible values include: "CANON_EQ", + :paramtype pattern: str + :keyword flags: Regular expression flags. Possible values include: "CANON_EQ", "CASE_INSENSITIVE", "COMMENTS", "DOTALL", "LITERAL", "MULTILINE", "UNICODE_CASE", "UNIX_LINES". - :type flags: str or ~azure.search.documents.indexes.models.RegexFlags - :param stopwords: A list of stopwords. - :type stopwords: list[str] + :paramtype flags: str or ~azure.search.documents.indexes.models.RegexFlags + :keyword stopwords: A list of stopwords. + :paramtype stopwords: list[str] """ _validation = { @@ -4055,18 +4180,18 @@ class PatternCaptureTokenFilter(TokenFilter): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled + :keyword odata_type: Required. Identifies the concrete type of the token filter.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, + :paramtype odata_type: str + :keyword name: Required. The name of the token filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str - :param patterns: Required. A list of patterns to match against each token. - :type patterns: list[str] - :param preserve_original: A value indicating whether to return the original token even if one + :paramtype name: str + :keyword patterns: Required. A list of patterns to match against each token. + :paramtype patterns: list[str] + :keyword preserve_original: A value indicating whether to return the original token even if one of the patterns matches. Default is true. - :type preserve_original: bool + :paramtype preserve_original: bool """ _validation = { @@ -4101,17 +4226,17 @@ class PatternReplaceCharFilter(CharFilter): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the char filter.Constant filled by - server. - :type odata_type: str - :param name: Required. The name of the char filter. It must only contain letters, digits, + :keyword odata_type: Required. Identifies the concrete type of the char filter.Constant filled + by server. + :paramtype odata_type: str + :keyword name: Required. The name of the char filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str - :param pattern: Required. A regular expression pattern. - :type pattern: str - :param replacement: Required. The replacement text. - :type replacement: str + :paramtype name: str + :keyword pattern: Required. A regular expression pattern. + :paramtype pattern: str + :keyword replacement: Required. The replacement text. + :paramtype replacement: str """ _validation = { @@ -4147,17 +4272,17 @@ class PatternReplaceTokenFilter(TokenFilter): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled + :keyword odata_type: Required. Identifies the concrete type of the token filter.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, + :paramtype odata_type: str + :keyword name: Required. The name of the token filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str - :param pattern: Required. A regular expression pattern. - :type pattern: str - :param replacement: Required. The replacement text. - :type replacement: str + :paramtype name: str + :keyword pattern: Required. A regular expression pattern. + :paramtype pattern: str + :keyword replacement: Required. The replacement text. + :paramtype replacement: str """ _validation = { @@ -4193,23 +4318,23 @@ class PatternTokenizer(LexicalTokenizer): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the tokenizer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param pattern: A regular expression pattern to match token separators. Default is an + :paramtype odata_type: str + :keyword name: Required. The name of the tokenizer. It must only contain letters, digits, + spaces, dashes or underscores, can only start and end with alphanumeric characters, and is + limited to 128 characters. + :paramtype name: str + :keyword pattern: A regular expression pattern to match token separators. Default is an expression that matches one or more non-word characters. - :type pattern: str - :param flags: Regular expression flags. Possible values include: "CANON_EQ", + :paramtype pattern: str + :keyword flags: Regular expression flags. Possible values include: "CANON_EQ", "CASE_INSENSITIVE", "COMMENTS", "DOTALL", "LITERAL", "MULTILINE", "UNICODE_CASE", "UNIX_LINES". - :type flags: str or ~azure.search.documents.indexes.models.RegexFlags - :param group: The zero-based ordinal of the matching group in the regular expression pattern to - extract into tokens. Use -1 if you want to use the entire pattern to split the input into + :paramtype flags: str or ~azure.search.documents.indexes.models.RegexFlags + :keyword group: The zero-based ordinal of the matching group in the regular expression pattern + to extract into tokens. Use -1 if you want to use the entire pattern to split the input into tokens, irrespective of matching groups. Default is -1. - :type group: int + :paramtype group: int """ _validation = { @@ -4246,20 +4371,20 @@ class PhoneticTokenFilter(TokenFilter): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled + :keyword odata_type: Required. Identifies the concrete type of the token filter.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, + :paramtype odata_type: str + :keyword name: Required. The name of the token filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str - :param encoder: The phonetic encoder to use. Default is "metaphone". Possible values include: + :paramtype name: str + :keyword encoder: The phonetic encoder to use. Default is "metaphone". Possible values include: "metaphone", "doubleMetaphone", "soundex", "refinedSoundex", "caverphone1", "caverphone2", "cologne", "nysiis", "koelnerPhonetik", "haasePhonetik", "beiderMorse". - :type encoder: str or ~azure.search.documents.indexes.models.PhoneticEncoder - :param replace_original_tokens: A value indicating whether encoded tokens should replace + :paramtype encoder: str or ~azure.search.documents.indexes.models.PhoneticEncoder + :keyword replace_original_tokens: A value indicating whether encoded tokens should replace original tokens. If false, encoded tokens are added as synonyms. Default is true. - :type replace_original_tokens: bool + :paramtype replace_original_tokens: bool """ _validation = { @@ -4293,46 +4418,48 @@ class PIIDetectionSkill(SearchIndexerSkill): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the skill.Constant filled by server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill + :paramtype odata_type: str + :keyword name: The name of the skill which uniquely identifies it within the skillset. A skill with no name defined will be given a default name of its 1-based index in the skills array, prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] - :param default_language_code: A value indicating which language code to use. Default is en. - :type default_language_code: str - :param minimum_precision: A value between 0 and 1 that be used to only include entities whose + :paramtype name: str + :keyword description: The description of the skill which describes the inputs, outputs, and + usage of the skill. + :paramtype description: str + :keyword context: Represents the level at which operations take place, such as the document + root or document content (for example, /document or /document/content). The default is + /document. + :paramtype context: str + :keyword inputs: Required. Inputs of the skills could be a column in the source data set, or + the output of an upstream skill. + :paramtype inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] + :keyword outputs: Required. The output of a skill is either a field in a search index, or a + value that can be consumed as an input by another skill. + :paramtype outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] + :keyword default_language_code: A value indicating which language code to use. Default is en. + :paramtype default_language_code: str + :keyword minimum_precision: A value between 0 and 1 that be used to only include entities whose confidence score is greater than the value specified. If not set (default), or if explicitly set to null, all entities will be included. - :type minimum_precision: float - :param masking_mode: A parameter that provides various ways to mask the personal information + :paramtype minimum_precision: float + :keyword masking_mode: A parameter that provides various ways to mask the personal information detected in the input text. Default is 'none'. Possible values include: "none", "replace". - :type masking_mode: str or ~azure.search.documents.indexes.models.PIIDetectionSkillMaskingMode - :param masking_character: The character used to mask the text if the maskingMode parameter is + :paramtype masking_mode: str or + ~azure.search.documents.indexes.models.PIIDetectionSkillMaskingMode + :keyword masking_character: The character used to mask the text if the maskingMode parameter is set to replace. Default is '*'. - :type masking_character: str - :param model_version: The version of the model to use when calling the Text Analytics service. - It will default to the latest available when not specified. We recommend you do not specify - this value unless absolutely necessary. - :type model_version: str - :param pii_categories: A list of PII entity categories that should be extracted and masked. - :type pii_categories: list[str] - :param domain: If specified, will set the PII domain to include only a subset of the entity + :paramtype masking_character: str + :keyword model_version: The version of the model to use when calling the Text Analytics + service. It will default to the latest available when not specified. We recommend you do not + specify this value unless absolutely necessary. + :paramtype model_version: str + :keyword pii_categories: A list of PII entity categories that should be extracted and masked. + :paramtype pii_categories: list[str] + :keyword domain: If specified, will set the PII domain to include only a subset of the entity categories. Possible values include: 'phi', 'none'. Default is 'none'. - :type domain: str + :paramtype domain: str """ _validation = { @@ -4390,8 +4517,8 @@ def __init__( class RequestOptions(msrest.serialization.Model): """Parameter group. - :param x_ms_client_request_id: The tracking ID sent with the request to help with debugging. - :type x_ms_client_request_id: str + :keyword x_ms_client_request_id: The tracking ID sent with the request to help with debugging. + :paramtype x_ms_client_request_id: str """ _attribute_map = { @@ -4413,10 +4540,10 @@ class ResourceCounter(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param usage: Required. The resource usage amount. - :type usage: long - :param quota: The resource amount quota. - :type quota: long + :keyword usage: Required. The resource usage amount. + :paramtype usage: long + :keyword quota: The resource amount quota. + :paramtype quota: long """ _validation = { @@ -4445,17 +4572,17 @@ class ScoringProfile(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the scoring profile. - :type name: str - :param text_weights: Parameters that boost scoring based on text matches in certain index + :keyword name: Required. The name of the scoring profile. + :paramtype name: str + :keyword text_weights: Parameters that boost scoring based on text matches in certain index fields. - :type text_weights: ~azure.search.documents.indexes.models.TextWeights - :param functions: The collection of functions that influence the scoring of documents. - :type functions: list[~azure.search.documents.indexes.models.ScoringFunction] - :param function_aggregation: A value indicating how the results of individual scoring functions - should be combined. Defaults to "Sum". Ignored if there are no scoring functions. Possible - values include: "sum", "average", "minimum", "maximum", "firstMatching". - :type function_aggregation: str or + :paramtype text_weights: ~azure.search.documents.indexes.models.TextWeights + :keyword functions: The collection of functions that influence the scoring of documents. + :paramtype functions: list[~azure.search.documents.indexes.models.ScoringFunction] + :keyword function_aggregation: A value indicating how the results of individual scoring + functions should be combined. Defaults to "Sum". Ignored if there are no scoring functions. + Possible values include: "sum", "average", "minimum", "maximum", "firstMatching". + :paramtype function_aggregation: str or ~azure.search.documents.indexes.models.ScoringFunctionAggregation """ @@ -4528,43 +4655,43 @@ class SearchField(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the field, which must be unique within the fields collection - of the index or parent field. - :type name: str - :param type: Required. The data type of the field. Possible values include: "Edm.String", + :keyword name: Required. The name of the field, which must be unique within the fields + collection of the index or parent field. + :paramtype name: str + :keyword type: Required. The data type of the field. Possible values include: "Edm.String", "Edm.Int32", "Edm.Int64", "Edm.Double", "Edm.Boolean", "Edm.DateTimeOffset", "Edm.GeographyPoint", "Edm.ComplexType". - :type type: str or ~azure.search.documents.indexes.models.SearchFieldDataType - :param key: A value indicating whether the field uniquely identifies documents in the index. + :paramtype type: str or ~azure.search.documents.indexes.models.SearchFieldDataType + :keyword key: A value indicating whether the field uniquely identifies documents in the index. Exactly one top-level field in each index must be chosen as the key field and it must be of type Edm.String. Key fields can be used to look up documents directly and update or delete specific documents. Default is false for simple fields and null for complex fields. - :type key: bool - :param retrievable: A value indicating whether the field can be returned in a search result. + :paramtype key: bool + :keyword retrievable: A value indicating whether the field can be returned in a search result. You can disable this option if you want to use a field (for example, margin) as a filter, sorting, or scoring mechanism but do not want the field to be visible to the end user. This property must be true for key fields, and it must be null for complex fields. This property can be changed on existing fields. Enabling this property does not cause any increase in index storage requirements. Default is true for simple fields and null for complex fields. - :type retrievable: bool - :param searchable: A value indicating whether the field is full-text searchable. This means it - will undergo analysis such as word-breaking during indexing. If you set a searchable field to a - value like "sunny day", internally it will be split into the individual tokens "sunny" and + :paramtype retrievable: bool + :keyword searchable: A value indicating whether the field is full-text searchable. This means + it will undergo analysis such as word-breaking during indexing. If you set a searchable field + to a value like "sunny day", internally it will be split into the individual tokens "sunny" and "day". This enables full-text searches for these terms. Fields of type Edm.String or Collection(Edm.String) are searchable by default. This property must be false for simple fields of other non-string data types, and it must be null for complex fields. Note: searchable fields consume extra space in your index since Azure Cognitive Search will store an additional tokenized version of the field value for full-text searches. If you want to save space in your index and you don't need a field to be included in searches, set searchable to false. - :type searchable: bool - :param filterable: A value indicating whether to enable the field to be referenced in $filter + :paramtype searchable: bool + :keyword filterable: A value indicating whether to enable the field to be referenced in $filter queries. filterable differs from searchable in how strings are handled. Fields of type Edm.String or Collection(Edm.String) that are filterable do not undergo word-breaking, so comparisons are for exact matches only. For example, if you set such a field f to "sunny day", $filter=f eq 'sunny' will find no matches, but $filter=f eq 'sunny day' will. This property must be null for complex fields. Default is true for simple fields and null for complex fields. - :type filterable: bool - :param sortable: A value indicating whether to enable the field to be referenced in $orderby + :paramtype filterable: bool + :keyword sortable: A value indicating whether to enable the field to be referenced in $orderby expressions. By default Azure Cognitive Search sorts results by score, but in many experiences users will want to sort by fields in the documents. A simple field can be sortable only if it is single-valued (it has a single value in the scope of the parent document). Simple collection @@ -4574,15 +4701,15 @@ class SearchField(msrest.serialization.Model): cannot be sortable and the sortable property must be null for such fields. The default for sortable is true for single-valued simple fields, false for multi-valued simple fields, and null for complex fields. - :type sortable: bool - :param facetable: A value indicating whether to enable the field to be referenced in facet + :paramtype sortable: bool + :keyword facetable: A value indicating whether to enable the field to be referenced in facet queries. Typically used in a presentation of search results that includes hit count by category (for example, search for digital cameras and see hits by brand, by megapixels, by price, and so on). This property must be null for complex fields. Fields of type Edm.GeographyPoint or Collection(Edm.GeographyPoint) cannot be facetable. Default is true for all other simple fields. - :type facetable: bool - :param analyzer: The name of the analyzer to use for the field. This option can be used only + :paramtype facetable: bool + :keyword analyzer: The name of the analyzer to use for the field. This option can be used only with searchable fields and it can't be set together with either searchAnalyzer or indexAnalyzer. Once the analyzer is chosen, it cannot be changed for the field. Must be null for complex fields. Possible values include: "ar.microsoft", "ar.lucene", "hy.lucene", @@ -4602,11 +4729,11 @@ class SearchField(msrest.serialization.Model): "th.microsoft", "th.lucene", "tr.microsoft", "tr.lucene", "uk.microsoft", "ur.microsoft", "vi.microsoft", "standard.lucene", "standardasciifolding.lucene", "keyword", "pattern", "simple", "stop", "whitespace". - :type analyzer: str or ~azure.search.documents.indexes.models.LexicalAnalyzerName - :param search_analyzer: The name of the analyzer used at search time for the field. This option - can be used only with searchable fields. It must be set together with indexAnalyzer and it - cannot be set together with the analyzer option. This property cannot be set to the name of a - language analyzer; use the analyzer property instead if you need a language analyzer. This + :paramtype analyzer: str or ~azure.search.documents.indexes.models.LexicalAnalyzerName + :keyword search_analyzer: The name of the analyzer used at search time for the field. This + option can be used only with searchable fields. It must be set together with indexAnalyzer and + it cannot be set together with the analyzer option. This property cannot be set to the name of + a language analyzer; use the analyzer property instead if you need a language analyzer. This analyzer can be updated on an existing field. Must be null for complex fields. Possible values include: "ar.microsoft", "ar.lucene", "hy.lucene", "bn.microsoft", "eu.lucene", "bg.microsoft", "bg.lucene", "ca.microsoft", "ca.lucene", "zh-Hans.microsoft", "zh-Hans.lucene", @@ -4625,8 +4752,8 @@ class SearchField(msrest.serialization.Model): "th.lucene", "tr.microsoft", "tr.lucene", "uk.microsoft", "ur.microsoft", "vi.microsoft", "standard.lucene", "standardasciifolding.lucene", "keyword", "pattern", "simple", "stop", "whitespace". - :type search_analyzer: str or ~azure.search.documents.indexes.models.LexicalAnalyzerName - :param index_analyzer: The name of the analyzer used at indexing time for the field. This + :paramtype search_analyzer: str or ~azure.search.documents.indexes.models.LexicalAnalyzerName + :keyword index_analyzer: The name of the analyzer used at indexing time for the field. This option can be used only with searchable fields. It must be set together with searchAnalyzer and it cannot be set together with the analyzer option. This property cannot be set to the name of a language analyzer; use the analyzer property instead if you need a language analyzer. Once @@ -4648,21 +4775,21 @@ class SearchField(msrest.serialization.Model): "th.lucene", "tr.microsoft", "tr.lucene", "uk.microsoft", "ur.microsoft", "vi.microsoft", "standard.lucene", "standardasciifolding.lucene", "keyword", "pattern", "simple", "stop", "whitespace". - :type index_analyzer: str or ~azure.search.documents.indexes.models.LexicalAnalyzerName - :param normalizer: The name of the normalizer to use for the field. This option can be used + :paramtype index_analyzer: str or ~azure.search.documents.indexes.models.LexicalAnalyzerName + :keyword normalizer: The name of the normalizer to use for the field. This option can be used only with fields with filterable, sortable, or facetable enabled. Once the normalizer is chosen, it cannot be changed for the field. Must be null for complex fields. Possible values include: "asciifolding", "elision", "lowercase", "standard", "uppercase". - :type normalizer: str or ~azure.search.documents.indexes.models.LexicalNormalizerName - :param synonym_maps: A list of the names of synonym maps to associate with this field. This + :paramtype normalizer: str or ~azure.search.documents.indexes.models.LexicalNormalizerName + :keyword synonym_maps: A list of the names of synonym maps to associate with this field. This option can be used only with searchable fields. Currently only one synonym map per field is supported. Assigning a synonym map to a field ensures that query terms targeting that field are expanded at query-time using the rules in the synonym map. This attribute can be changed on existing fields. Must be null or an empty collection for complex fields. - :type synonym_maps: list[str] - :param fields: A list of sub-fields if this is a field of type Edm.ComplexType or + :paramtype synonym_maps: list[str] + :keyword fields: A list of sub-fields if this is a field of type Edm.ComplexType or Collection(Edm.ComplexType). Must be null or empty for simple fields. - :type fields: list[~azure.search.documents.indexes.models.SearchField] + :paramtype fields: list[~azure.search.documents.indexes.models.SearchField] """ _validation = { @@ -4728,31 +4855,31 @@ class SearchIndex(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the index. - :type name: str - :param fields: Required. The fields of the index. - :type fields: list[~azure.search.documents.indexes.models.SearchField] - :param scoring_profiles: The scoring profiles for the index. - :type scoring_profiles: list[~azure.search.documents.indexes.models.ScoringProfile] - :param default_scoring_profile: The name of the scoring profile to use if none is specified in - the query. If this property is not set and no scoring profile is specified in the query, then - default scoring (tf-idf) will be used. - :type default_scoring_profile: str - :param cors_options: Options to control Cross-Origin Resource Sharing (CORS) for the index. - :type cors_options: ~azure.search.documents.indexes.models.CorsOptions - :param suggesters: The suggesters for the index. - :type suggesters: list[~azure.search.documents.indexes.models.Suggester] - :param analyzers: The analyzers for the index. - :type analyzers: list[~azure.search.documents.indexes.models.LexicalAnalyzer] - :param tokenizers: The tokenizers for the index. - :type tokenizers: list[~azure.search.documents.indexes.models.LexicalTokenizer] - :param token_filters: The token filters for the index. - :type token_filters: list[~azure.search.documents.indexes.models.TokenFilter] - :param char_filters: The character filters for the index. - :type char_filters: list[~azure.search.documents.indexes.models.CharFilter] - :param normalizers: The normalizers for the index. - :type normalizers: list[~azure.search.documents.indexes.models.LexicalNormalizer] - :param encryption_key: A description of an encryption key that you create in Azure Key Vault. + :keyword name: Required. The name of the index. + :paramtype name: str + :keyword fields: Required. The fields of the index. + :paramtype fields: list[~azure.search.documents.indexes.models.SearchField] + :keyword scoring_profiles: The scoring profiles for the index. + :paramtype scoring_profiles: list[~azure.search.documents.indexes.models.ScoringProfile] + :keyword default_scoring_profile: The name of the scoring profile to use if none is specified + in the query. If this property is not set and no scoring profile is specified in the query, + then default scoring (tf-idf) will be used. + :paramtype default_scoring_profile: str + :keyword cors_options: Options to control Cross-Origin Resource Sharing (CORS) for the index. + :paramtype cors_options: ~azure.search.documents.indexes.models.CorsOptions + :keyword suggesters: The suggesters for the index. + :paramtype suggesters: list[~azure.search.documents.indexes.models.Suggester] + :keyword analyzers: The analyzers for the index. + :paramtype analyzers: list[~azure.search.documents.indexes.models.LexicalAnalyzer] + :keyword tokenizers: The tokenizers for the index. + :paramtype tokenizers: list[~azure.search.documents.indexes.models.LexicalTokenizer] + :keyword token_filters: The token filters for the index. + :paramtype token_filters: list[~azure.search.documents.indexes.models.TokenFilter] + :keyword char_filters: The character filters for the index. + :paramtype char_filters: list[~azure.search.documents.indexes.models.CharFilter] + :keyword normalizers: The normalizers for the index. + :paramtype normalizers: list[~azure.search.documents.indexes.models.LexicalNormalizer] + :keyword encryption_key: A description of an encryption key that you create in Azure Key Vault. This key is used to provide an additional level of encryption-at-rest for your data when you want full assurance that no one, not even Microsoft, can decrypt your data in Azure Cognitive Search. Once you have encrypted your data, it will always remain encrypted. Azure Cognitive @@ -4760,14 +4887,14 @@ class SearchIndex(msrest.serialization.Model): needed if you want to rotate your encryption key; Your data will be unaffected. Encryption with customer-managed keys is not available for free search services, and is only available for paid services created on or after January 1, 2019. - :type encryption_key: ~azure.search.documents.indexes.models.SearchResourceEncryptionKey - :param similarity: The type of similarity algorithm to be used when scoring and ranking the + :paramtype encryption_key: ~azure.search.documents.indexes.models.SearchResourceEncryptionKey + :keyword similarity: The type of similarity algorithm to be used when scoring and ranking the documents matching a search query. The similarity algorithm can only be defined at index creation time and cannot be modified on existing indexes. If null, the ClassicSimilarity algorithm is used. - :type similarity: ~azure.search.documents.indexes.models.Similarity - :param e_tag: The ETag of the index. - :type e_tag: str + :paramtype similarity: ~azure.search.documents.indexes.models.Similarity + :keyword e_tag: The ETag of the index. + :paramtype e_tag: str """ _validation = { @@ -4833,32 +4960,32 @@ class SearchIndexer(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the indexer. - :type name: str - :param description: The description of the indexer. - :type description: str - :param data_source_name: Required. The name of the datasource from which this indexer reads + :keyword name: Required. The name of the indexer. + :paramtype name: str + :keyword description: The description of the indexer. + :paramtype description: str + :keyword data_source_name: Required. The name of the datasource from which this indexer reads data. - :type data_source_name: str - :param skillset_name: The name of the skillset executing with this indexer. - :type skillset_name: str - :param target_index_name: Required. The name of the index to which this indexer writes data. - :type target_index_name: str - :param schedule: The schedule for this indexer. - :type schedule: ~azure.search.documents.indexes.models.IndexingSchedule - :param parameters: Parameters for indexer execution. - :type parameters: ~azure.search.documents.indexes.models.IndexingParameters - :param field_mappings: Defines mappings between fields in the data source and corresponding + :paramtype data_source_name: str + :keyword skillset_name: The name of the skillset executing with this indexer. + :paramtype skillset_name: str + :keyword target_index_name: Required. The name of the index to which this indexer writes data. + :paramtype target_index_name: str + :keyword schedule: The schedule for this indexer. + :paramtype schedule: ~azure.search.documents.indexes.models.IndexingSchedule + :keyword parameters: Parameters for indexer execution. + :paramtype parameters: ~azure.search.documents.indexes.models.IndexingParameters + :keyword field_mappings: Defines mappings between fields in the data source and corresponding target fields in the index. - :type field_mappings: list[~azure.search.documents.indexes.models.FieldMapping] - :param output_field_mappings: Output field mappings are applied after enrichment and + :paramtype field_mappings: list[~azure.search.documents.indexes.models.FieldMapping] + :keyword output_field_mappings: Output field mappings are applied after enrichment and immediately before indexing. - :type output_field_mappings: list[~azure.search.documents.indexes.models.FieldMapping] - :param is_disabled: A value indicating whether the indexer is disabled. Default is false. - :type is_disabled: bool - :param e_tag: The ETag of the indexer. - :type e_tag: str - :param encryption_key: A description of an encryption key that you create in Azure Key Vault. + :paramtype output_field_mappings: list[~azure.search.documents.indexes.models.FieldMapping] + :keyword is_disabled: A value indicating whether the indexer is disabled. Default is false. + :paramtype is_disabled: bool + :keyword e_tag: The ETag of the indexer. + :paramtype e_tag: str + :keyword encryption_key: A description of an encryption key that you create in Azure Key Vault. This key is used to provide an additional level of encryption-at-rest for your indexer definition (as well as indexer execution status) when you want full assurance that no one, not even Microsoft, can decrypt them in Azure Cognitive Search. Once you have encrypted your @@ -4867,10 +4994,10 @@ class SearchIndexer(msrest.serialization.Model): rotate your encryption key; Your indexer definition (and indexer execution status) will be unaffected. Encryption with customer-managed keys is not available for free search services, and is only available for paid services created on or after January 1, 2019. - :type encryption_key: ~azure.search.documents.indexes.models.SearchResourceEncryptionKey - :param cache: Adds caching to an enrichment pipeline to allow for incremental modification + :paramtype encryption_key: ~azure.search.documents.indexes.models.SearchResourceEncryptionKey + :keyword cache: Adds caching to an enrichment pipeline to allow for incremental modification steps without having to rebuild the index every time. - :type cache: ~azure.search.documents.indexes.models.SearchIndexerCache + :paramtype cache: ~azure.search.documents.indexes.models.SearchIndexerCache """ _validation = { @@ -4932,11 +5059,11 @@ def __init__( class SearchIndexerCache(msrest.serialization.Model): """SearchIndexerCache. - :param storage_connection_string: The connection string to the storage account where the cache - data will be persisted. - :type storage_connection_string: str - :param enable_reprocessing: Specifies whether incremental reprocessing is enabled. - :type enable_reprocessing: bool + :keyword storage_connection_string: The connection string to the storage account where the + cache data will be persisted. + :paramtype storage_connection_string: str + :keyword enable_reprocessing: Specifies whether incremental reprocessing is enabled. + :paramtype enable_reprocessing: bool """ _attribute_map = { @@ -4961,12 +5088,12 @@ class SearchIndexerDataContainer(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the table or view (for Azure SQL data source) or collection - (for CosmosDB data source) that will be indexed. - :type name: str - :param query: A query that is applied to this data container. The syntax and meaning of this + :keyword name: Required. The name of the table or view (for Azure SQL data source) or + collection (for CosmosDB data source) that will be indexed. + :paramtype name: str + :keyword query: A query that is applied to this data container. The syntax and meaning of this parameter is datasource-specific. Not supported by Azure SQL datasources. - :type query: str + :paramtype query: str """ _validation = { @@ -4998,9 +5125,9 @@ class SearchIndexerDataIdentity(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the identity.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the identity.Constant filled by server. - :type odata_type: str + :paramtype odata_type: str """ _validation = { @@ -5028,9 +5155,9 @@ class SearchIndexerDataNoneIdentity(SearchIndexerDataIdentity): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the identity.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the identity.Constant filled by server. - :type odata_type: str + :paramtype odata_type: str """ _validation = { @@ -5054,31 +5181,31 @@ class SearchIndexerDataSource(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the datasource. - :type name: str - :param description: The description of the datasource. - :type description: str - :param type: Required. The type of the datasource. Possible values include: "azuresql", + :keyword name: Required. The name of the datasource. + :paramtype name: str + :keyword description: The description of the datasource. + :paramtype description: str + :keyword type: Required. The type of the datasource. Possible values include: "azuresql", "cosmosdb", "azureblob", "azuretable", "mysql", "adlsgen2". - :type type: str or ~azure.search.documents.indexes.models.SearchIndexerDataSourceType - :param credentials: Required. Credentials for the datasource. - :type credentials: ~azure.search.documents.indexes.models.DataSourceCredentials - :param container: Required. The data container for the datasource. - :type container: ~azure.search.documents.indexes.models.SearchIndexerDataContainer - :param identity: An explicit managed identity to use for this datasource. If not specified and - the connection string is a managed identity, the system-assigned managed identity is used. If - not specified, the value remains unchanged. If "none" is specified, the value of this property - is cleared. - :type identity: ~azure.search.documents.indexes.models.SearchIndexerDataIdentity - :param data_change_detection_policy: The data change detection policy for the datasource. - :type data_change_detection_policy: + :paramtype type: str or ~azure.search.documents.indexes.models.SearchIndexerDataSourceType + :keyword credentials: Required. Credentials for the datasource. + :paramtype credentials: ~azure.search.documents.indexes.models.DataSourceCredentials + :keyword container: Required. The data container for the datasource. + :paramtype container: ~azure.search.documents.indexes.models.SearchIndexerDataContainer + :keyword identity: An explicit managed identity to use for this datasource. If not specified + and the connection string is a managed identity, the system-assigned managed identity is used. + If not specified, the value remains unchanged. If "none" is specified, the value of this + property is cleared. + :paramtype identity: ~azure.search.documents.indexes.models.SearchIndexerDataIdentity + :keyword data_change_detection_policy: The data change detection policy for the datasource. + :paramtype data_change_detection_policy: ~azure.search.documents.indexes.models.DataChangeDetectionPolicy - :param data_deletion_detection_policy: The data deletion detection policy for the datasource. - :type data_deletion_detection_policy: + :keyword data_deletion_detection_policy: The data deletion detection policy for the datasource. + :paramtype data_deletion_detection_policy: ~azure.search.documents.indexes.models.DataDeletionDetectionPolicy - :param e_tag: The ETag of the data source. - :type e_tag: str - :param encryption_key: A description of an encryption key that you create in Azure Key Vault. + :keyword e_tag: The ETag of the data source. + :paramtype e_tag: str + :keyword encryption_key: A description of an encryption key that you create in Azure Key Vault. This key is used to provide an additional level of encryption-at-rest for your datasource definition when you want full assurance that no one, not even Microsoft, can decrypt your data source definition in Azure Cognitive Search. Once you have encrypted your data source @@ -5087,7 +5214,7 @@ class SearchIndexerDataSource(msrest.serialization.Model): encryption key; Your datasource definition will be unaffected. Encryption with customer-managed keys is not available for free search services, and is only available for paid services created on or after January 1, 2019. - :type encryption_key: ~azure.search.documents.indexes.models.SearchResourceEncryptionKey + :paramtype encryption_key: ~azure.search.documents.indexes.models.SearchResourceEncryptionKey """ _validation = { @@ -5143,14 +5270,14 @@ class SearchIndexerDataUserAssignedIdentity(SearchIndexerDataIdentity): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the identity.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the identity.Constant filled by server. - :type odata_type: str - :param user_assigned_identity: Required. The fully qualified Azure resource Id of a user + :paramtype odata_type: str + :keyword user_assigned_identity: Required. The fully qualified Azure resource Id of a user assigned managed identity typically in the form "/subscriptions/12345678-1234-1234-1234-1234567890ab/resourceGroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId" that should have been assigned to the search service. - :type user_assigned_identity: str + :paramtype user_assigned_identity: str """ _validation = { @@ -5238,11 +5365,11 @@ class SearchIndexerKnowledgeStore(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param storage_connection_string: Required. The connection string to the storage account + :keyword storage_connection_string: Required. The connection string to the storage account projections will be stored in. - :type storage_connection_string: str - :param projections: Required. A list of additional projections to perform during indexing. - :type projections: + :paramtype storage_connection_string: str + :keyword projections: Required. A list of additional projections to perform during indexing. + :paramtype projections: list[~azure.search.documents.indexes.models.SearchIndexerKnowledgeStoreProjection] """ @@ -5271,16 +5398,16 @@ def __init__( class SearchIndexerKnowledgeStoreProjectionSelector(msrest.serialization.Model): """Abstract class to share properties between concrete selectors. - :param reference_key_name: Name of reference key to different projection. - :type reference_key_name: str - :param generated_key_name: Name of generated key to store projection under. - :type generated_key_name: str - :param source: Source data to project. - :type source: str - :param source_context: Source context for complex projections. - :type source_context: str - :param inputs: Nested inputs for complex projections. - :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] + :keyword reference_key_name: Name of reference key to different projection. + :paramtype reference_key_name: str + :keyword generated_key_name: Name of generated key to store projection under. + :paramtype generated_key_name: str + :keyword source: Source data to project. + :paramtype source: str + :keyword source_context: Source context for complex projections. + :paramtype source_context: str + :keyword inputs: Nested inputs for complex projections. + :paramtype inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] """ _attribute_map = { @@ -5314,18 +5441,18 @@ class SearchIndexerKnowledgeStoreBlobProjectionSelector(SearchIndexerKnowledgeSt All required parameters must be populated in order to send to Azure. - :param reference_key_name: Name of reference key to different projection. - :type reference_key_name: str - :param generated_key_name: Name of generated key to store projection under. - :type generated_key_name: str - :param source: Source data to project. - :type source: str - :param source_context: Source context for complex projections. - :type source_context: str - :param inputs: Nested inputs for complex projections. - :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] - :param storage_container: Required. Blob container to store projections in. - :type storage_container: str + :keyword reference_key_name: Name of reference key to different projection. + :paramtype reference_key_name: str + :keyword generated_key_name: Name of generated key to store projection under. + :paramtype generated_key_name: str + :keyword source: Source data to project. + :paramtype source: str + :keyword source_context: Source context for complex projections. + :paramtype source_context: str + :keyword inputs: Nested inputs for complex projections. + :paramtype inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] + :keyword storage_container: Required. Blob container to store projections in. + :paramtype storage_container: str """ _validation = { @@ -5361,18 +5488,18 @@ class SearchIndexerKnowledgeStoreFileProjectionSelector(SearchIndexerKnowledgeSt All required parameters must be populated in order to send to Azure. - :param reference_key_name: Name of reference key to different projection. - :type reference_key_name: str - :param generated_key_name: Name of generated key to store projection under. - :type generated_key_name: str - :param source: Source data to project. - :type source: str - :param source_context: Source context for complex projections. - :type source_context: str - :param inputs: Nested inputs for complex projections. - :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] - :param storage_container: Required. Blob container to store projections in. - :type storage_container: str + :keyword reference_key_name: Name of reference key to different projection. + :paramtype reference_key_name: str + :keyword generated_key_name: Name of generated key to store projection under. + :paramtype generated_key_name: str + :keyword source: Source data to project. + :paramtype source: str + :keyword source_context: Source context for complex projections. + :paramtype source_context: str + :keyword inputs: Nested inputs for complex projections. + :paramtype inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] + :keyword storage_container: Required. Blob container to store projections in. + :paramtype storage_container: str """ _validation = { @@ -5407,18 +5534,18 @@ class SearchIndexerKnowledgeStoreObjectProjectionSelector(SearchIndexerKnowledge All required parameters must be populated in order to send to Azure. - :param reference_key_name: Name of reference key to different projection. - :type reference_key_name: str - :param generated_key_name: Name of generated key to store projection under. - :type generated_key_name: str - :param source: Source data to project. - :type source: str - :param source_context: Source context for complex projections. - :type source_context: str - :param inputs: Nested inputs for complex projections. - :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] - :param storage_container: Required. Blob container to store projections in. - :type storage_container: str + :keyword reference_key_name: Name of reference key to different projection. + :paramtype reference_key_name: str + :keyword generated_key_name: Name of generated key to store projection under. + :paramtype generated_key_name: str + :keyword source: Source data to project. + :paramtype source: str + :keyword source_context: Source context for complex projections. + :paramtype source_context: str + :keyword inputs: Nested inputs for complex projections. + :paramtype inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] + :keyword storage_container: Required. Blob container to store projections in. + :paramtype storage_container: str """ _validation = { @@ -5451,14 +5578,14 @@ def __init__( class SearchIndexerKnowledgeStoreProjection(msrest.serialization.Model): """Container object for various projection selectors. - :param tables: Projections to Azure Table storage. - :type tables: + :keyword tables: Projections to Azure Table storage. + :paramtype tables: list[~azure.search.documents.indexes.models.SearchIndexerKnowledgeStoreTableProjectionSelector] - :param objects: Projections to Azure Blob storage. - :type objects: + :keyword objects: Projections to Azure Blob storage. + :paramtype objects: list[~azure.search.documents.indexes.models.SearchIndexerKnowledgeStoreObjectProjectionSelector] - :param files: Projections to Azure File storage. - :type files: + :keyword files: Projections to Azure File storage. + :paramtype files: list[~azure.search.documents.indexes.models.SearchIndexerKnowledgeStoreFileProjectionSelector] """ @@ -5487,18 +5614,18 @@ class SearchIndexerKnowledgeStoreTableProjectionSelector(SearchIndexerKnowledgeS All required parameters must be populated in order to send to Azure. - :param reference_key_name: Name of reference key to different projection. - :type reference_key_name: str - :param generated_key_name: Name of generated key to store projection under. - :type generated_key_name: str - :param source: Source data to project. - :type source: str - :param source_context: Source context for complex projections. - :type source_context: str - :param inputs: Nested inputs for complex projections. - :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] - :param table_name: Required. Name of the Azure table to store projected data in. - :type table_name: str + :keyword reference_key_name: Name of reference key to different projection. + :paramtype reference_key_name: str + :keyword generated_key_name: Name of generated key to store projection under. + :paramtype generated_key_name: str + :keyword source: Source data to project. + :paramtype source: str + :keyword source_context: Source context for complex projections. + :paramtype source_context: str + :keyword inputs: Nested inputs for complex projections. + :paramtype inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] + :keyword table_name: Required. Name of the Azure table to store projected data in. + :paramtype table_name: str """ _validation = { @@ -5572,22 +5699,22 @@ class SearchIndexerSkillset(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the skillset. - :type name: str - :param description: The description of the skillset. - :type description: str - :param skills: Required. A list of skills in the skillset. - :type skills: list[~azure.search.documents.indexes.models.SearchIndexerSkill] - :param cognitive_services_account: Details about cognitive services to be used when running + :keyword name: Required. The name of the skillset. + :paramtype name: str + :keyword description: The description of the skillset. + :paramtype description: str + :keyword skills: Required. A list of skills in the skillset. + :paramtype skills: list[~azure.search.documents.indexes.models.SearchIndexerSkill] + :keyword cognitive_services_account: Details about cognitive services to be used when running skills. - :type cognitive_services_account: + :paramtype cognitive_services_account: ~azure.search.documents.indexes.models.CognitiveServicesAccount - :param knowledge_store: Definition of additional projections to azure blob, table, or files, of - enriched data. - :type knowledge_store: ~azure.search.documents.indexes.models.SearchIndexerKnowledgeStore - :param e_tag: The ETag of the skillset. - :type e_tag: str - :param encryption_key: A description of an encryption key that you create in Azure Key Vault. + :keyword knowledge_store: Definition of additional projections to azure blob, table, or files, + of enriched data. + :paramtype knowledge_store: ~azure.search.documents.indexes.models.SearchIndexerKnowledgeStore + :keyword e_tag: The ETag of the skillset. + :paramtype e_tag: str + :keyword encryption_key: A description of an encryption key that you create in Azure Key Vault. This key is used to provide an additional level of encryption-at-rest for your skillset definition when you want full assurance that no one, not even Microsoft, can decrypt your skillset definition in Azure Cognitive Search. Once you have encrypted your skillset @@ -5596,7 +5723,7 @@ class SearchIndexerSkillset(msrest.serialization.Model): encryption key; Your skillset definition will be unaffected. Encryption with customer-managed keys is not available for free search services, and is only available for paid services created on or after January 1, 2019. - :type encryption_key: ~azure.search.documents.indexes.models.SearchResourceEncryptionKey + :paramtype encryption_key: ~azure.search.documents.indexes.models.SearchResourceEncryptionKey """ _validation = { @@ -5736,25 +5863,25 @@ class SearchResourceEncryptionKey(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param key_name: Required. The name of your Azure Key Vault key to be used to encrypt your data - at rest. - :type key_name: str - :param key_version: Required. The version of your Azure Key Vault key to be used to encrypt + :keyword key_name: Required. The name of your Azure Key Vault key to be used to encrypt your + data at rest. + :paramtype key_name: str + :keyword key_version: Required. The version of your Azure Key Vault key to be used to encrypt your data at rest. - :type key_version: str - :param vault_uri: Required. The URI of your Azure Key Vault, also referred to as DNS name, that - contains the key to be used to encrypt your data at rest. An example URI might be + :paramtype key_version: str + :keyword vault_uri: Required. The URI of your Azure Key Vault, also referred to as DNS name, + that contains the key to be used to encrypt your data at rest. An example URI might be https://my-keyvault-name.vault.azure.net. - :type vault_uri: str - :param access_credentials: Optional Azure Active Directory credentials used for accessing your - Azure Key Vault. Not required if using managed identity instead. - :type access_credentials: + :paramtype vault_uri: str + :keyword access_credentials: Optional Azure Active Directory credentials used for accessing + your Azure Key Vault. Not required if using managed identity instead. + :paramtype access_credentials: ~azure.search.documents.indexes.models.AzureActiveDirectoryApplicationCredentials - :param identity: An explicit managed identity to use for this encryption key. If not specified - and the access credentials property is null, the system-assigned managed identity is used. On - update to the resource, if the explicit identity is unspecified, it remains unchanged. If - "none" is specified, the value of this property is cleared. - :type identity: ~azure.search.documents.indexes.models.SearchIndexerDataIdentity + :keyword identity: An explicit managed identity to use for this encryption key. If not + specified and the access credentials property is null, the system-assigned managed identity is + used. On update to the resource, if the explicit identity is unspecified, it remains unchanged. + If "none" is specified, the value of this property is cleared. + :paramtype identity: ~azure.search.documents.indexes.models.SearchIndexerDataIdentity """ _validation = { @@ -5794,29 +5921,30 @@ class SentimentSkill(SearchIndexerSkill): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the skill.Constant filled by server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill + :paramtype odata_type: str + :keyword name: The name of the skill which uniquely identifies it within the skillset. A skill with no name defined will be given a default name of its 1-based index in the skills array, prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] - :param default_language_code: A value indicating which language code to use. Default is en. + :paramtype name: str + :keyword description: The description of the skill which describes the inputs, outputs, and + usage of the skill. + :paramtype description: str + :keyword context: Represents the level at which operations take place, such as the document + root or document content (for example, /document or /document/content). The default is + /document. + :paramtype context: str + :keyword inputs: Required. Inputs of the skills could be a column in the source data set, or + the output of an upstream skill. + :paramtype inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] + :keyword outputs: Required. The output of a skill is either a field in a search index, or a + value that can be consumed as an input by another skill. + :paramtype outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] + :keyword default_language_code: A value indicating which language code to use. Default is en. Possible values include: "da", "nl", "en", "fi", "fr", "de", "el", "it", "no", "pl", "pt-PT", "ru", "es", "sv", "tr". - :type default_language_code: str or + :paramtype default_language_code: str or ~azure.search.documents.indexes.models.SentimentSkillLanguage """ @@ -5857,35 +5985,36 @@ class SentimentSkillV3(SearchIndexerSkill): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the skill.Constant filled by server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill + :paramtype odata_type: str + :keyword name: The name of the skill which uniquely identifies it within the skillset. A skill with no name defined will be given a default name of its 1-based index in the skills array, prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] - :param default_language_code: A value indicating which language code to use. Default is en. - :type default_language_code: str - :param include_opinion_mining: If set to true, the skill output will include information from + :paramtype name: str + :keyword description: The description of the skill which describes the inputs, outputs, and + usage of the skill. + :paramtype description: str + :keyword context: Represents the level at which operations take place, such as the document + root or document content (for example, /document or /document/content). The default is + /document. + :paramtype context: str + :keyword inputs: Required. Inputs of the skills could be a column in the source data set, or + the output of an upstream skill. + :paramtype inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] + :keyword outputs: Required. The output of a skill is either a field in a search index, or a + value that can be consumed as an input by another skill. + :paramtype outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] + :keyword default_language_code: A value indicating which language code to use. Default is en. + :paramtype default_language_code: str + :keyword include_opinion_mining: If set to true, the skill output will include information from Text Analytics for opinion mining, namely targets (nouns or verbs) and their associated assessment (adjective) in the text. Default is false. - :type include_opinion_mining: bool - :param model_version: The version of the model to use when calling the Text Analytics service. - It will default to the latest available when not specified. We recommend you do not specify - this value unless absolutely necessary. - :type model_version: str + :paramtype include_opinion_mining: bool + :keyword model_version: The version of the model to use when calling the Text Analytics + service. It will default to the latest available when not specified. We recommend you do not + specify this value unless absolutely necessary. + :paramtype model_version: str """ _validation = { @@ -5931,20 +6060,21 @@ class ServiceCounters(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param document_counter: Required. Total number of documents across all indexes in the service. - :type document_counter: ~azure.search.documents.indexes.models.ResourceCounter - :param index_counter: Required. Total number of indexes. - :type index_counter: ~azure.search.documents.indexes.models.ResourceCounter - :param indexer_counter: Required. Total number of indexers. - :type indexer_counter: ~azure.search.documents.indexes.models.ResourceCounter - :param data_source_counter: Required. Total number of data sources. - :type data_source_counter: ~azure.search.documents.indexes.models.ResourceCounter - :param storage_size_counter: Required. Total size of used storage in bytes. - :type storage_size_counter: ~azure.search.documents.indexes.models.ResourceCounter - :param synonym_map_counter: Required. Total number of synonym maps. - :type synonym_map_counter: ~azure.search.documents.indexes.models.ResourceCounter - :param skillset_counter: Total number of skillsets. - :type skillset_counter: ~azure.search.documents.indexes.models.ResourceCounter + :keyword document_counter: Required. Total number of documents across all indexes in the + service. + :paramtype document_counter: ~azure.search.documents.indexes.models.ResourceCounter + :keyword index_counter: Required. Total number of indexes. + :paramtype index_counter: ~azure.search.documents.indexes.models.ResourceCounter + :keyword indexer_counter: Required. Total number of indexers. + :paramtype indexer_counter: ~azure.search.documents.indexes.models.ResourceCounter + :keyword data_source_counter: Required. Total number of data sources. + :paramtype data_source_counter: ~azure.search.documents.indexes.models.ResourceCounter + :keyword storage_size_counter: Required. Total size of used storage in bytes. + :paramtype storage_size_counter: ~azure.search.documents.indexes.models.ResourceCounter + :keyword synonym_map_counter: Required. Total number of synonym maps. + :paramtype synonym_map_counter: ~azure.search.documents.indexes.models.ResourceCounter + :keyword skillset_counter: Total number of skillsets. + :paramtype skillset_counter: ~azure.search.documents.indexes.models.ResourceCounter """ _validation = { @@ -5991,17 +6121,17 @@ def __init__( class ServiceLimits(msrest.serialization.Model): """Represents various service level limits. - :param max_fields_per_index: The maximum allowed fields per index. - :type max_fields_per_index: int - :param max_field_nesting_depth_per_index: The maximum depth which you can nest sub-fields in an - index, including the top-level complex field. For example, a/b/c has a nesting depth of 3. - :type max_field_nesting_depth_per_index: int - :param max_complex_collection_fields_per_index: The maximum number of fields of type + :keyword max_fields_per_index: The maximum allowed fields per index. + :paramtype max_fields_per_index: int + :keyword max_field_nesting_depth_per_index: The maximum depth which you can nest sub-fields in + an index, including the top-level complex field. For example, a/b/c has a nesting depth of 3. + :paramtype max_field_nesting_depth_per_index: int + :keyword max_complex_collection_fields_per_index: The maximum number of fields of type Collection(Edm.ComplexType) allowed in an index. - :type max_complex_collection_fields_per_index: int - :param max_complex_objects_in_collections_per_document: The maximum number of objects in + :paramtype max_complex_collection_fields_per_index: int + :keyword max_complex_objects_in_collections_per_document: The maximum number of objects in complex collections allowed per document. - :type max_complex_objects_in_collections_per_document: int + :paramtype max_complex_objects_in_collections_per_document: int """ _attribute_map = { @@ -6032,10 +6162,10 @@ class ServiceStatistics(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param counters: Required. Service level resource counters. - :type counters: ~azure.search.documents.indexes.models.ServiceCounters - :param limits: Required. Service level general limits. - :type limits: ~azure.search.documents.indexes.models.ServiceLimits + :keyword counters: Required. Service level resource counters. + :paramtype counters: ~azure.search.documents.indexes.models.ServiceCounters + :keyword limits: Required. Service level general limits. + :paramtype limits: ~azure.search.documents.indexes.models.ServiceLimits """ _validation = { @@ -6065,25 +6195,26 @@ class ShaperSkill(SearchIndexerSkill): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the skill.Constant filled by server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill + :paramtype odata_type: str + :keyword name: The name of the skill which uniquely identifies it within the skillset. A skill with no name defined will be given a default name of its 1-based index in the skills array, prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] + :paramtype name: str + :keyword description: The description of the skill which describes the inputs, outputs, and + usage of the skill. + :paramtype description: str + :keyword context: Represents the level at which operations take place, such as the document + root or document content (for example, /document or /document/content). The default is + /document. + :paramtype context: str + :keyword inputs: Required. Inputs of the skills could be a column in the source data set, or + the output of an upstream skill. + :paramtype inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] + :keyword outputs: Required. The output of a skill is either a field in a search index, or a + value that can be consumed as an input by another skill. + :paramtype outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] """ _validation = { @@ -6120,31 +6251,31 @@ class ShingleTokenFilter(TokenFilter): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled + :keyword odata_type: Required. Identifies the concrete type of the token filter.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, + :paramtype odata_type: str + :keyword name: Required. The name of the token filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str - :param max_shingle_size: The maximum shingle size. Default and minimum value is 2. - :type max_shingle_size: int - :param min_shingle_size: The minimum shingle size. Default and minimum value is 2. Must be less - than the value of maxShingleSize. - :type min_shingle_size: int - :param output_unigrams: A value indicating whether the output stream will contain the input + :paramtype name: str + :keyword max_shingle_size: The maximum shingle size. Default and minimum value is 2. + :paramtype max_shingle_size: int + :keyword min_shingle_size: The minimum shingle size. Default and minimum value is 2. Must be + less than the value of maxShingleSize. + :paramtype min_shingle_size: int + :keyword output_unigrams: A value indicating whether the output stream will contain the input tokens (unigrams) as well as shingles. Default is true. - :type output_unigrams: bool - :param output_unigrams_if_no_shingles: A value indicating whether to output unigrams for those - times when no shingles are available. This property takes precedence when outputUnigrams is set - to false. Default is false. - :type output_unigrams_if_no_shingles: bool - :param token_separator: The string to use when joining adjacent tokens to form a shingle. + :paramtype output_unigrams: bool + :keyword output_unigrams_if_no_shingles: A value indicating whether to output unigrams for + those times when no shingles are available. This property takes precedence when outputUnigrams + is set to false. Default is false. + :paramtype output_unigrams_if_no_shingles: bool + :keyword token_separator: The string to use when joining adjacent tokens to form a shingle. Default is a single space (" "). - :type token_separator: str - :param filter_token: The string to insert for each position at which there is no token. Default - is an underscore ("_"). - :type filter_token: str + :paramtype token_separator: str + :keyword filter_token: The string to insert for each position at which there is no token. + Default is an underscore ("_"). + :paramtype filter_token: str """ _validation = { @@ -6192,18 +6323,18 @@ class SnowballTokenFilter(TokenFilter): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled + :keyword odata_type: Required. Identifies the concrete type of the token filter.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, + :paramtype odata_type: str + :keyword name: Required. The name of the token filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str - :param language: Required. The language to use. Possible values include: "armenian", "basque", - "catalan", "danish", "dutch", "english", "finnish", "french", "german", "german2", "hungarian", - "italian", "kp", "lovins", "norwegian", "porter", "portuguese", "romanian", "russian", - "spanish", "swedish", "turkish". - :type language: str or ~azure.search.documents.indexes.models.SnowballTokenFilterLanguage + :paramtype name: str + :keyword language: Required. The language to use. Possible values include: "armenian", + "basque", "catalan", "danish", "dutch", "english", "finnish", "french", "german", "german2", + "hungarian", "italian", "kp", "lovins", "norwegian", "porter", "portuguese", "romanian", + "russian", "spanish", "swedish", "turkish". + :paramtype language: str or ~azure.search.documents.indexes.models.SnowballTokenFilterLanguage """ _validation = { @@ -6235,13 +6366,13 @@ class SoftDeleteColumnDeletionDetectionPolicy(DataDeletionDetectionPolicy): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the data deletion detection + :keyword odata_type: Required. Identifies the concrete type of the data deletion detection policy.Constant filled by server. - :type odata_type: str - :param soft_delete_column_name: The name of the column to use for soft-deletion detection. - :type soft_delete_column_name: str - :param soft_delete_marker_value: The marker value that identifies an item as deleted. - :type soft_delete_marker_value: str + :paramtype odata_type: str + :keyword soft_delete_column_name: The name of the column to use for soft-deletion detection. + :paramtype soft_delete_column_name: str + :keyword soft_delete_marker_value: The marker value that identifies an item as deleted. + :paramtype soft_delete_marker_value: str """ _validation = { @@ -6272,33 +6403,35 @@ class SplitSkill(SearchIndexerSkill): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the skill.Constant filled by server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill + :paramtype odata_type: str + :keyword name: The name of the skill which uniquely identifies it within the skillset. A skill with no name defined will be given a default name of its 1-based index in the skills array, prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] - :param default_language_code: A value indicating which language code to use. Default is en. + :paramtype name: str + :keyword description: The description of the skill which describes the inputs, outputs, and + usage of the skill. + :paramtype description: str + :keyword context: Represents the level at which operations take place, such as the document + root or document content (for example, /document or /document/content). The default is + /document. + :paramtype context: str + :keyword inputs: Required. Inputs of the skills could be a column in the source data set, or + the output of an upstream skill. + :paramtype inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] + :keyword outputs: Required. The output of a skill is either a field in a search index, or a + value that can be consumed as an input by another skill. + :paramtype outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] + :keyword default_language_code: A value indicating which language code to use. Default is en. Possible values include: "da", "de", "en", "es", "fi", "fr", "it", "ko", "pt". - :type default_language_code: str or ~azure.search.documents.indexes.models.SplitSkillLanguage - :param text_split_mode: A value indicating which split mode to perform. Possible values + :paramtype default_language_code: str or + ~azure.search.documents.indexes.models.SplitSkillLanguage + :keyword text_split_mode: A value indicating which split mode to perform. Possible values include: "pages", "sentences". - :type text_split_mode: str or ~azure.search.documents.indexes.models.TextSplitMode - :param maximum_page_length: The desired maximum page length. Default is 10000. - :type maximum_page_length: int + :paramtype text_split_mode: str or ~azure.search.documents.indexes.models.TextSplitMode + :keyword maximum_page_length: The desired maximum page length. Default is 10000. + :paramtype maximum_page_length: int """ _validation = { @@ -6344,9 +6477,9 @@ class SqlIntegratedChangeTrackingPolicy(DataChangeDetectionPolicy): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the data change detection + :keyword odata_type: Required. Identifies the concrete type of the data change detection policy.Constant filled by server. - :type odata_type: str + :paramtype odata_type: str """ _validation = { @@ -6370,16 +6503,16 @@ class StemmerOverrideTokenFilter(TokenFilter): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled + :keyword odata_type: Required. Identifies the concrete type of the token filter.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, + :paramtype odata_type: str + :keyword name: Required. The name of the token filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str - :param rules: Required. A list of stemming rules in the following format: "word => stem", for + :paramtype name: str + :keyword rules: Required. A list of stemming rules in the following format: "word => stem", for example: "ran => run". - :type rules: list[str] + :paramtype rules: list[str] """ _validation = { @@ -6411,23 +6544,23 @@ class StemmerTokenFilter(TokenFilter): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled + :keyword odata_type: Required. Identifies the concrete type of the token filter.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, + :paramtype odata_type: str + :keyword name: Required. The name of the token filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str - :param language: Required. The language to use. Possible values include: "arabic", "armenian", - "basque", "brazilian", "bulgarian", "catalan", "czech", "danish", "dutch", "dutchKp", - "english", "lightEnglish", "minimalEnglish", "possessiveEnglish", "porter2", "lovins", - "finnish", "lightFinnish", "french", "lightFrench", "minimalFrench", "galician", + :paramtype name: str + :keyword language: Required. The language to use. Possible values include: "arabic", + "armenian", "basque", "brazilian", "bulgarian", "catalan", "czech", "danish", "dutch", + "dutchKp", "english", "lightEnglish", "minimalEnglish", "possessiveEnglish", "porter2", + "lovins", "finnish", "lightFinnish", "french", "lightFrench", "minimalFrench", "galician", "minimalGalician", "german", "german2", "lightGerman", "minimalGerman", "greek", "hindi", "hungarian", "lightHungarian", "indonesian", "irish", "italian", "lightItalian", "sorani", "latvian", "norwegian", "lightNorwegian", "minimalNorwegian", "lightNynorsk", "minimalNynorsk", "portuguese", "lightPortuguese", "minimalPortuguese", "portugueseRslp", "romanian", "russian", "lightRussian", "spanish", "lightSpanish", "swedish", "lightSwedish", "turkish". - :type language: str or ~azure.search.documents.indexes.models.StemmerTokenFilterLanguage + :paramtype language: str or ~azure.search.documents.indexes.models.StemmerTokenFilterLanguage """ _validation = { @@ -6459,15 +6592,15 @@ class StopAnalyzer(LexicalAnalyzer): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the analyzer.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the analyzer.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the analyzer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param stopwords: A list of stopwords. - :type stopwords: list[str] + :paramtype odata_type: str + :keyword name: Required. The name of the analyzer. It must only contain letters, digits, + spaces, dashes or underscores, can only start and end with alphanumeric characters, and is + limited to 128 characters. + :paramtype name: str + :keyword stopwords: A list of stopwords. + :paramtype stopwords: list[str] """ _validation = { @@ -6498,29 +6631,29 @@ class StopwordsTokenFilter(TokenFilter): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled + :keyword odata_type: Required. Identifies the concrete type of the token filter.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, + :paramtype odata_type: str + :keyword name: Required. The name of the token filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str - :param stopwords: The list of stopwords. This property and the stopwords list property cannot + :paramtype name: str + :keyword stopwords: The list of stopwords. This property and the stopwords list property cannot both be set. - :type stopwords: list[str] - :param stopwords_list: A predefined list of stopwords to use. This property and the stopwords + :paramtype stopwords: list[str] + :keyword stopwords_list: A predefined list of stopwords to use. This property and the stopwords property cannot both be set. Default is English. Possible values include: "arabic", "armenian", "basque", "brazilian", "bulgarian", "catalan", "czech", "danish", "dutch", "english", "finnish", "french", "galician", "german", "greek", "hindi", "hungarian", "indonesian", "irish", "italian", "latvian", "norwegian", "persian", "portuguese", "romanian", "russian", "sorani", "spanish", "swedish", "thai", "turkish". - :type stopwords_list: str or ~azure.search.documents.indexes.models.StopwordsList - :param ignore_case: A value indicating whether to ignore case. If true, all words are converted - to lower case first. Default is false. - :type ignore_case: bool - :param remove_trailing_stop_words: A value indicating whether to ignore the last search term if - it's a stop word. Default is true. - :type remove_trailing_stop_words: bool + :paramtype stopwords_list: str or ~azure.search.documents.indexes.models.StopwordsList + :keyword ignore_case: A value indicating whether to ignore case. If true, all words are + converted to lower case first. Default is false. + :paramtype ignore_case: bool + :keyword remove_trailing_stop_words: A value indicating whether to ignore the last search term + if it's a stop word. Default is true. + :paramtype remove_trailing_stop_words: bool """ _validation = { @@ -6562,14 +6695,14 @@ class Suggester(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the suggester. - :type name: str + :keyword name: Required. The name of the suggester. + :paramtype name: str :ivar search_mode: A value indicating the capabilities of the suggester. Has constant value: "analyzingInfixMatching". :vartype search_mode: str - :param source_fields: Required. The list of field names to which the suggester applies. Each + :keyword source_fields: Required. The list of field names to which the suggester applies. Each field must be searchable. - :type source_fields: list[str] + :paramtype source_fields: list[str] """ _validation = { @@ -6605,15 +6738,15 @@ class SynonymMap(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the synonym map. - :type name: str + :keyword name: Required. The name of the synonym map. + :paramtype name: str :ivar format: The format of the synonym map. Only the 'solr' format is currently supported. Has constant value: "solr". :vartype format: str - :param synonyms: Required. A series of synonym rules in the specified synonym map format. The + :keyword synonyms: Required. A series of synonym rules in the specified synonym map format. The rules must be separated by newlines. - :type synonyms: str - :param encryption_key: A description of an encryption key that you create in Azure Key Vault. + :paramtype synonyms: str + :keyword encryption_key: A description of an encryption key that you create in Azure Key Vault. This key is used to provide an additional level of encryption-at-rest for your data when you want full assurance that no one, not even Microsoft, can decrypt your data in Azure Cognitive Search. Once you have encrypted your data, it will always remain encrypted. Azure Cognitive @@ -6621,9 +6754,9 @@ class SynonymMap(msrest.serialization.Model): needed if you want to rotate your encryption key; Your data will be unaffected. Encryption with customer-managed keys is not available for free search services, and is only available for paid services created on or after January 1, 2019. - :type encryption_key: ~azure.search.documents.indexes.models.SearchResourceEncryptionKey - :param e_tag: The ETag of the synonym map. - :type e_tag: str + :paramtype encryption_key: ~azure.search.documents.indexes.models.SearchResourceEncryptionKey + :keyword e_tag: The ETag of the synonym map. + :paramtype e_tag: str """ _validation = { @@ -6663,30 +6796,30 @@ class SynonymTokenFilter(TokenFilter): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled + :keyword odata_type: Required. Identifies the concrete type of the token filter.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, + :paramtype odata_type: str + :keyword name: Required. The name of the token filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str - :param synonyms: Required. A list of synonyms in following one of two formats: 1. incredible, + :paramtype name: str + :keyword synonyms: Required. A list of synonyms in following one of two formats: 1. incredible, unbelievable, fabulous => amazing - all terms on the left side of => symbol will be replaced with all terms on its right side; 2. incredible, unbelievable, fabulous, amazing - comma separated list of equivalent words. Set the expand option to change how this list is interpreted. - :type synonyms: list[str] - :param ignore_case: A value indicating whether to case-fold input for matching. Default is + :paramtype synonyms: list[str] + :keyword ignore_case: A value indicating whether to case-fold input for matching. Default is false. - :type ignore_case: bool - :param expand: A value indicating whether all words in the list of synonyms (if => notation is - not used) will map to one another. If true, all words in the list of synonyms (if => notation - is not used) will map to one another. The following list: incredible, unbelievable, fabulous, - amazing is equivalent to: incredible, unbelievable, fabulous, amazing => incredible, + :paramtype ignore_case: bool + :keyword expand: A value indicating whether all words in the list of synonyms (if => notation + is not used) will map to one another. If true, all words in the list of synonyms (if => + notation is not used) will map to one another. The following list: incredible, unbelievable, + fabulous, amazing is equivalent to: incredible, unbelievable, fabulous, amazing => incredible, unbelievable, fabulous, amazing. If false, the following list: incredible, unbelievable, fabulous, amazing will be equivalent to: incredible, unbelievable, fabulous, amazing => incredible. Default is true. - :type expand: bool + :paramtype expand: bool """ _validation = { @@ -6724,20 +6857,21 @@ class TagScoringFunction(ScoringFunction): All required parameters must be populated in order to send to Azure. - :param type: Required. Indicates the type of function to use. Valid values include magnitude, + :keyword type: Required. Indicates the type of function to use. Valid values include magnitude, freshness, distance, and tag. The function type must be lower case.Constant filled by server. - :type type: str - :param field_name: Required. The name of the field used as input to the scoring function. - :type field_name: str - :param boost: Required. A multiplier for the raw score. Must be a positive number not equal to - 1.0. - :type boost: float - :param interpolation: A value indicating how boosting will be interpolated across document + :paramtype type: str + :keyword field_name: Required. The name of the field used as input to the scoring function. + :paramtype field_name: str + :keyword boost: Required. A multiplier for the raw score. Must be a positive number not equal + to 1.0. + :paramtype boost: float + :keyword interpolation: A value indicating how boosting will be interpolated across document scores; defaults to "Linear". Possible values include: "linear", "constant", "quadratic", "logarithmic". - :type interpolation: str or ~azure.search.documents.indexes.models.ScoringFunctionInterpolation - :param parameters: Required. Parameter values for the tag scoring function. - :type parameters: ~azure.search.documents.indexes.models.TagScoringParameters + :paramtype interpolation: str or + ~azure.search.documents.indexes.models.ScoringFunctionInterpolation + :keyword parameters: Required. Parameter values for the tag scoring function. + :paramtype parameters: ~azure.search.documents.indexes.models.TagScoringParameters """ _validation = { @@ -6774,9 +6908,9 @@ class TagScoringParameters(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param tags_parameter: Required. The name of the parameter passed in search queries to specify - the list of tags to compare against the target field. - :type tags_parameter: str + :keyword tags_parameter: Required. The name of the parameter passed in search queries to + specify the list of tags to compare against the target field. + :paramtype tags_parameter: str """ _validation = { @@ -6802,44 +6936,45 @@ class TextTranslationSkill(SearchIndexerSkill): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the skill.Constant filled by server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill + :paramtype odata_type: str + :keyword name: The name of the skill which uniquely identifies it within the skillset. A skill with no name defined will be given a default name of its 1-based index in the skills array, prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] - :param default_to_language_code: Required. The language code to translate documents into for + :paramtype name: str + :keyword description: The description of the skill which describes the inputs, outputs, and + usage of the skill. + :paramtype description: str + :keyword context: Represents the level at which operations take place, such as the document + root or document content (for example, /document or /document/content). The default is + /document. + :paramtype context: str + :keyword inputs: Required. Inputs of the skills could be a column in the source data set, or + the output of an upstream skill. + :paramtype inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] + :keyword outputs: Required. The output of a skill is either a field in a search index, or a + value that can be consumed as an input by another skill. + :paramtype outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] + :keyword default_to_language_code: Required. The language code to translate documents into for documents that don't specify the to language explicitly. Possible values include: "af", "ar", "bn", "bs", "bg", "yue", "ca", "zh-Hans", "zh-Hant", "hr", "cs", "da", "nl", "en", "et", "fj", "fil", "fi", "fr", "de", "el", "ht", "he", "hi", "mww", "hu", "is", "id", "it", "ja", "sw", "tlh", "tlh-Latn", "tlh-Piqd", "ko", "lv", "lt", "mg", "ms", "mt", "nb", "fa", "pl", "pt", "pt-br", "pt-PT", "otq", "ro", "ru", "sm", "sr-Cyrl", "sr-Latn", "sk", "sl", "es", "sv", "ty", "ta", "te", "th", "to", "tr", "uk", "ur", "vi", "cy", "yua", "ga", "kn", "mi", "ml", "pa". - :type default_to_language_code: str or + :paramtype default_to_language_code: str or ~azure.search.documents.indexes.models.TextTranslationSkillLanguage - :param default_from_language_code: The language code to translate documents from for documents - that don't specify the from language explicitly. Possible values include: "af", "ar", "bn", - "bs", "bg", "yue", "ca", "zh-Hans", "zh-Hant", "hr", "cs", "da", "nl", "en", "et", "fj", "fil", - "fi", "fr", "de", "el", "ht", "he", "hi", "mww", "hu", "is", "id", "it", "ja", "sw", "tlh", - "tlh-Latn", "tlh-Piqd", "ko", "lv", "lt", "mg", "ms", "mt", "nb", "fa", "pl", "pt", "pt-br", - "pt-PT", "otq", "ro", "ru", "sm", "sr-Cyrl", "sr-Latn", "sk", "sl", "es", "sv", "ty", "ta", - "te", "th", "to", "tr", "uk", "ur", "vi", "cy", "yua", "ga", "kn", "mi", "ml", "pa". - :type default_from_language_code: str or + :keyword default_from_language_code: The language code to translate documents from for + documents that don't specify the from language explicitly. Possible values include: "af", "ar", + "bn", "bs", "bg", "yue", "ca", "zh-Hans", "zh-Hant", "hr", "cs", "da", "nl", "en", "et", "fj", + "fil", "fi", "fr", "de", "el", "ht", "he", "hi", "mww", "hu", "is", "id", "it", "ja", "sw", + "tlh", "tlh-Latn", "tlh-Piqd", "ko", "lv", "lt", "mg", "ms", "mt", "nb", "fa", "pl", "pt", + "pt-br", "pt-PT", "otq", "ro", "ru", "sm", "sr-Cyrl", "sr-Latn", "sk", "sl", "es", "sv", "ty", + "ta", "te", "th", "to", "tr", "uk", "ur", "vi", "cy", "yua", "ga", "kn", "mi", "ml", "pa". + :paramtype default_from_language_code: str or ~azure.search.documents.indexes.models.TextTranslationSkillLanguage - :param suggested_from: The language code to translate documents from when neither the + :keyword suggested_from: The language code to translate documents from when neither the fromLanguageCode input nor the defaultFromLanguageCode parameter are provided, and the automatic language detection is unsuccessful. Default is en. Possible values include: "af", "ar", "bn", "bs", "bg", "yue", "ca", "zh-Hans", "zh-Hant", "hr", "cs", "da", "nl", "en", "et", @@ -6848,7 +6983,7 @@ class TextTranslationSkill(SearchIndexerSkill): "pt", "pt-br", "pt-PT", "otq", "ro", "ru", "sm", "sr-Cyrl", "sr-Latn", "sk", "sl", "es", "sv", "ty", "ta", "te", "th", "to", "tr", "uk", "ur", "vi", "cy", "yua", "ga", "kn", "mi", "ml", "pa". - :type suggested_from: str or + :paramtype suggested_from: str or ~azure.search.documents.indexes.models.TextTranslationSkillLanguage """ @@ -6896,9 +7031,9 @@ class TextWeights(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param weights: Required. The dictionary of per-field weights to boost document scoring. The + :keyword weights: Required. The dictionary of per-field weights to boost document scoring. The keys are field names and the values are the weights for each field. - :type weights: dict[str, float] + :paramtype weights: dict[str, float] """ _validation = { @@ -6924,15 +7059,15 @@ class TruncateTokenFilter(TokenFilter): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled + :keyword odata_type: Required. Identifies the concrete type of the token filter.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, + :paramtype odata_type: str + :keyword name: Required. The name of the token filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str - :param length: The length at which terms will be truncated. Default and maximum is 300. - :type length: int + :paramtype name: str + :keyword length: The length at which terms will be truncated. Default and maximum is 300. + :paramtype length: int """ _validation = { @@ -6964,16 +7099,16 @@ class UaxUrlEmailTokenizer(LexicalTokenizer): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the tokenizer.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the tokenizer. It must only contain letters, digits, spaces, - dashes or underscores, can only start and end with alphanumeric characters, and is limited to - 128 characters. - :type name: str - :param max_token_length: The maximum token length. Default is 255. Tokens longer than the + :paramtype odata_type: str + :keyword name: Required. The name of the tokenizer. It must only contain letters, digits, + spaces, dashes or underscores, can only start and end with alphanumeric characters, and is + limited to 128 characters. + :paramtype name: str + :keyword max_token_length: The maximum token length. Default is 255. Tokens longer than the maximum length are split. The maximum token length that can be used is 300 characters. - :type max_token_length: int + :paramtype max_token_length: int """ _validation = { @@ -7005,16 +7140,16 @@ class UniqueTokenFilter(TokenFilter): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled + :keyword odata_type: Required. Identifies the concrete type of the token filter.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, + :paramtype odata_type: str + :keyword name: Required. The name of the token filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str - :param only_on_same_position: A value indicating whether to remove duplicates only at the same - position. Default is false. - :type only_on_same_position: bool + :paramtype name: str + :keyword only_on_same_position: A value indicating whether to remove duplicates only at the + same position. Default is false. + :paramtype only_on_same_position: bool """ _validation = { @@ -7045,38 +7180,39 @@ class WebApiSkill(SearchIndexerSkill): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the skill.Constant filled by server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill + :paramtype odata_type: str + :keyword name: The name of the skill which uniquely identifies it within the skillset. A skill with no name defined will be given a default name of its 1-based index in the skills array, prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage - of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root - or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the - output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value - that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] - :param uri: Required. The url for the Web API. - :type uri: str - :param http_headers: The headers required to make the http request. - :type http_headers: dict[str, str] - :param http_method: The method for the http request. - :type http_method: str - :param timeout: The desired timeout for the request. Default is 30 seconds. - :type timeout: ~datetime.timedelta - :param batch_size: The desired batch size which indicates number of documents. - :type batch_size: int - :param degree_of_parallelism: If set, the number of parallel calls that can be made to the Web - API. - :type degree_of_parallelism: int + :paramtype name: str + :keyword description: The description of the skill which describes the inputs, outputs, and + usage of the skill. + :paramtype description: str + :keyword context: Represents the level at which operations take place, such as the document + root or document content (for example, /document or /document/content). The default is + /document. + :paramtype context: str + :keyword inputs: Required. Inputs of the skills could be a column in the source data set, or + the output of an upstream skill. + :paramtype inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] + :keyword outputs: Required. The output of a skill is either a field in a search index, or a + value that can be consumed as an input by another skill. + :paramtype outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] + :keyword uri: Required. The url for the Web API. + :paramtype uri: str + :keyword http_headers: The headers required to make the http request. + :paramtype http_headers: dict[str, str] + :keyword http_method: The method for the http request. + :paramtype http_method: str + :keyword timeout: The desired timeout for the request. Default is 30 seconds. + :paramtype timeout: ~datetime.timedelta + :keyword batch_size: The desired batch size which indicates number of documents. + :paramtype batch_size: int + :keyword degree_of_parallelism: If set, the number of parallel calls that can be made to the + Web API. + :paramtype degree_of_parallelism: int """ _validation = { @@ -7132,43 +7268,44 @@ class WordDelimiterTokenFilter(TokenFilter): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the token filter.Constant filled + :keyword odata_type: Required. Identifies the concrete type of the token filter.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the token filter. It must only contain letters, digits, + :paramtype odata_type: str + :keyword name: Required. The name of the token filter. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str - :param generate_word_parts: A value indicating whether to generate part words. If set, causes + :paramtype name: str + :keyword generate_word_parts: A value indicating whether to generate part words. If set, causes parts of words to be generated; for example "AzureSearch" becomes "Azure" "Search". Default is true. - :type generate_word_parts: bool - :param generate_number_parts: A value indicating whether to generate number subwords. Default + :paramtype generate_word_parts: bool + :keyword generate_number_parts: A value indicating whether to generate number subwords. Default is true. - :type generate_number_parts: bool - :param catenate_words: A value indicating whether maximum runs of word parts will be catenated. - For example, if this is set to true, "Azure-Search" becomes "AzureSearch". Default is false. - :type catenate_words: bool - :param catenate_numbers: A value indicating whether maximum runs of number parts will be + :paramtype generate_number_parts: bool + :keyword catenate_words: A value indicating whether maximum runs of word parts will be + catenated. For example, if this is set to true, "Azure-Search" becomes "AzureSearch". Default + is false. + :paramtype catenate_words: bool + :keyword catenate_numbers: A value indicating whether maximum runs of number parts will be catenated. For example, if this is set to true, "1-2" becomes "12". Default is false. - :type catenate_numbers: bool - :param catenate_all: A value indicating whether all subword parts will be catenated. For + :paramtype catenate_numbers: bool + :keyword catenate_all: A value indicating whether all subword parts will be catenated. For example, if this is set to true, "Azure-Search-1" becomes "AzureSearch1". Default is false. - :type catenate_all: bool - :param split_on_case_change: A value indicating whether to split words on caseChange. For + :paramtype catenate_all: bool + :keyword split_on_case_change: A value indicating whether to split words on caseChange. For example, if this is set to true, "AzureSearch" becomes "Azure" "Search". Default is true. - :type split_on_case_change: bool - :param preserve_original: A value indicating whether original words will be preserved and added - to the subword list. Default is false. - :type preserve_original: bool - :param split_on_numerics: A value indicating whether to split on numbers. For example, if this - is set to true, "Azure1Search" becomes "Azure" "1" "Search". Default is true. - :type split_on_numerics: bool - :param stem_english_possessive: A value indicating whether to remove trailing "'s" for each + :paramtype split_on_case_change: bool + :keyword preserve_original: A value indicating whether original words will be preserved and + added to the subword list. Default is false. + :paramtype preserve_original: bool + :keyword split_on_numerics: A value indicating whether to split on numbers. For example, if + this is set to true, "Azure1Search" becomes "Azure" "1" "Search". Default is true. + :paramtype split_on_numerics: bool + :keyword stem_english_possessive: A value indicating whether to remove trailing "'s" for each subword. Default is true. - :type stem_english_possessive: bool - :param protected_words: A list of tokens to protect from being delimited. - :type protected_words: list[str] + :paramtype stem_english_possessive: bool + :keyword protected_words: A list of tokens to protect from being delimited. + :paramtype protected_words: list[str] """ _validation = { diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/models/_search_client_enums.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/models/_search_client_enums.py index 77c43a6bebf4..f2833c5a3851 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/models/_search_client_enums.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/models/_search_client_enums.py @@ -6,27 +6,12 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum, EnumMeta +from enum import Enum from six import with_metaclass +from azure.core import CaseInsensitiveEnumMeta -class _CaseInsensitiveEnumMeta(EnumMeta): - def __getitem__(self, name): - return super().__getitem__(name.upper()) - def __getattr__(cls, name): - """Return the enum member matching `name` - We use __getattr__ instead of descriptors or inserting into the enum - class' __dict__ in order to support `name` and `value` being both - properties for enum members (which live in the class' __dict__) and - enum members themselves. - """ - try: - return cls._member_map_[name.upper()] - except KeyError: - raise AttributeError(name) - - -class BlobIndexerDataToExtract(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class BlobIndexerDataToExtract(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Specifies the data to extract from Azure blob storage and tells the indexer which data to extract from image content when "imageAction" is set to a value other than "none". This applies to embedded image content in a .PDF or other application, or image files such as .jpg @@ -41,7 +26,7 @@ class BlobIndexerDataToExtract(with_metaclass(_CaseInsensitiveEnumMeta, str, Enu #: Extracts all metadata and textual content from each blob. CONTENT_AND_METADATA = "contentAndMetadata" -class BlobIndexerImageAction(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class BlobIndexerImageAction(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Determines how to process embedded images and image files in Azure blob storage. Setting the "imageAction" configuration to any value other than "none" requires that a skillset also be attached to that indexer. @@ -61,7 +46,7 @@ class BlobIndexerImageAction(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum) #: types will be treated the same as if "generateNormalizedImages" was set. GENERATE_NORMALIZED_IMAGE_PER_PAGE = "generateNormalizedImagePerPage" -class BlobIndexerParsingMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class BlobIndexerParsingMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Represents the parsing mode for indexing from an Azure blob data source. """ @@ -80,7 +65,7 @@ class BlobIndexerParsingMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum) #: documents in Azure Cognitive Search. JSON_LINES = "jsonLines" -class BlobIndexerPDFTextRotationAlgorithm(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class BlobIndexerPDFTextRotationAlgorithm(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Determines algorithm for text extraction from PDF files in Azure blob storage. """ @@ -92,7 +77,7 @@ class BlobIndexerPDFTextRotationAlgorithm(with_metaclass(_CaseInsensitiveEnumMet #: rotated text appears within an embedded image in the PDF, this parameter does not apply. DETECT_ANGLES = "detectAngles" -class CharFilterName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class CharFilterName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Defines the names of all character filters supported by Azure Cognitive Search. """ @@ -100,7 +85,7 @@ class CharFilterName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: https://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/charfilter/HTMLStripCharFilter.html. HTML_STRIP = "html_strip" -class CjkBigramTokenFilterScripts(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class CjkBigramTokenFilterScripts(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Scripts that can be ignored by CjkBigramTokenFilter. """ @@ -113,7 +98,7 @@ class CjkBigramTokenFilterScripts(with_metaclass(_CaseInsensitiveEnumMeta, str, #: Ignore Hangul script when forming bigrams of CJK terms. HANGUL = "hangul" -class CustomEntityLookupSkillLanguage(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class CustomEntityLookupSkillLanguage(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The language codes supported for input text by CustomEntityLookupSkill. """ @@ -136,7 +121,7 @@ class CustomEntityLookupSkillLanguage(with_metaclass(_CaseInsensitiveEnumMeta, s #: Portuguese. PT = "pt" -class EdgeNGramTokenFilterSide(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class EdgeNGramTokenFilterSide(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Specifies which side of the input an n-gram should be generated from. """ @@ -145,7 +130,7 @@ class EdgeNGramTokenFilterSide(with_metaclass(_CaseInsensitiveEnumMeta, str, Enu #: Specifies that the n-gram should be generated from the back of the input. BACK = "back" -class EntityCategory(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class EntityCategory(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """A string indicating what entity categories to return. """ @@ -164,7 +149,7 @@ class EntityCategory(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Entities describing an email address. EMAIL = "email" -class EntityRecognitionSkillLanguage(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class EntityRecognitionSkillLanguage(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The language codes supported for input text by EntityRecognitionSkill. """ @@ -215,7 +200,7 @@ class EntityRecognitionSkillLanguage(with_metaclass(_CaseInsensitiveEnumMeta, st #: Turkish. TR = "tr" -class ImageAnalysisSkillLanguage(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ImageAnalysisSkillLanguage(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The language codes supported for input by ImageAnalysisSkill. """ @@ -230,7 +215,7 @@ class ImageAnalysisSkillLanguage(with_metaclass(_CaseInsensitiveEnumMeta, str, E #: Chinese. ZH = "zh" -class ImageDetail(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ImageDetail(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """A string indicating which domain-specific details to return. """ @@ -239,7 +224,7 @@ class ImageDetail(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Details recognized as landmarks. LANDMARKS = "landmarks" -class IndexerExecutionEnvironment(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class IndexerExecutionEnvironment(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Specifies the environment in which the indexer should execute. """ @@ -251,7 +236,7 @@ class IndexerExecutionEnvironment(with_metaclass(_CaseInsensitiveEnumMeta, str, #: to access resources securely over shared private link resources. PRIVATE = "private" -class IndexerExecutionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class IndexerExecutionStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Represents the status of an individual indexer execution. """ @@ -265,7 +250,14 @@ class IndexerExecutionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum) #: Indexer has been reset. RESET = "reset" -class IndexerStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class IndexerExecutionStatusDetail(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Details the status of an individual indexer execution. + """ + + #: Indicates that the reset that occurred was for a call to ResetDocs. + RESET_DOCS = "resetDocs" + +class IndexerStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Represents the overall indexer status. """ @@ -277,7 +269,17 @@ class IndexerStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Indicates that the indexer is running normally. RUNNING = "running" -class KeyPhraseExtractionSkillLanguage(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class IndexingMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Represents the mode the indexer is executing in. + """ + + #: The indexer is indexing all documents in the datasource. + INDEXING_ALL_DOCS = "indexingAllDocs" + #: The indexer is indexing selective, reset documents in the datasource. The documents being + #: indexed are defined on indexer status. + INDEXING_RESET_DOCS = "indexingResetDocs" + +class KeyPhraseExtractionSkillLanguage(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The language codes supported for input text by KeyPhraseExtractionSkill. """ @@ -314,7 +316,7 @@ class KeyPhraseExtractionSkillLanguage(with_metaclass(_CaseInsensitiveEnumMeta, #: Swedish. SV = "sv" -class LexicalAnalyzerName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class LexicalAnalyzerName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Defines the names of all text analyzers supported by Azure Cognitive Search. """ @@ -512,7 +514,7 @@ class LexicalAnalyzerName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/core/WhitespaceAnalyzer.html. WHITESPACE = "whitespace" -class LexicalNormalizerName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class LexicalNormalizerName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Defines the names of all text normalizers supported by Azure Cognitive Search. """ @@ -534,7 +536,7 @@ class LexicalNormalizerName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)) #: https://lucene.apache.org/core/6_6_1/analyzers-common/org/apache/lucene/analysis/core/UpperCaseFilter.html. UPPERCASE = "uppercase" -class LexicalTokenizerName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class LexicalTokenizerName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Defines the names of all tokenizers supported by Azure Cognitive Search. """ @@ -577,7 +579,7 @@ class LexicalTokenizerName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/core/WhitespaceTokenizer.html. WHITESPACE = "whitespace" -class LineEnding(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class LineEnding(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Defines the sequence of characters to use between the lines of text recognized by the OCR skill. The default value is "space". """ @@ -591,7 +593,7 @@ class LineEnding(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Lines are separated by a carriage return and a line feed ('\r\n') character. CARRIAGE_RETURN_LINE_FEED = "carriageReturnLineFeed" -class MicrosoftStemmingTokenizerLanguage(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class MicrosoftStemmingTokenizerLanguage(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Lists the languages supported by the Microsoft language stemming tokenizer. """ @@ -686,7 +688,7 @@ class MicrosoftStemmingTokenizerLanguage(with_metaclass(_CaseInsensitiveEnumMeta #: Selects the Microsoft stemming tokenizer for Urdu. URDU = "urdu" -class MicrosoftTokenizerLanguage(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class MicrosoftTokenizerLanguage(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Lists the languages supported by the Microsoft language tokenizer. """ @@ -775,7 +777,7 @@ class MicrosoftTokenizerLanguage(with_metaclass(_CaseInsensitiveEnumMeta, str, E #: Selects the Microsoft tokenizer for Vietnamese. VIETNAMESE = "vietnamese" -class OcrSkillLanguage(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class OcrSkillLanguage(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The language codes supported for input by OcrSkill. """ @@ -832,7 +834,7 @@ class OcrSkillLanguage(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Slovak. SK = "sk" -class PhoneticEncoder(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class PhoneticEncoder(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Identifies the type of phonetic encoder to use with a PhoneticTokenFilter. """ @@ -859,7 +861,7 @@ class PhoneticEncoder(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Encodes a token into a Beider-Morse value. BEIDER_MORSE = "beiderMorse" -class PIIDetectionSkillMaskingMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class PIIDetectionSkillMaskingMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """A string indicating what maskingMode to use to mask the personal information detected in the input text. """ @@ -871,7 +873,7 @@ class PIIDetectionSkillMaskingMode(with_metaclass(_CaseInsensitiveEnumMeta, str, #: correctly correspond to both the input text as well as the output maskedText. REPLACE = "replace" -class RegexFlags(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class RegexFlags(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Defines flags that can be combined to control how regular expressions are used in the pattern analyzer and pattern tokenizer. """ @@ -893,7 +895,7 @@ class RegexFlags(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Enables Unix lines mode. UNIX_LINES = "UNIX_LINES" -class ScoringFunctionAggregation(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ScoringFunctionAggregation(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Defines the aggregation function used to combine the results of all the scoring functions in a scoring profile. """ @@ -909,7 +911,7 @@ class ScoringFunctionAggregation(with_metaclass(_CaseInsensitiveEnumMeta, str, E #: Boost scores using the first applicable scoring function in the scoring profile. FIRST_MATCHING = "firstMatching" -class ScoringFunctionInterpolation(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ScoringFunctionInterpolation(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Defines the function used to interpolate score boosting across a range of documents. """ @@ -927,7 +929,7 @@ class ScoringFunctionInterpolation(with_metaclass(_CaseInsensitiveEnumMeta, str, #: scoring functions. LOGARITHMIC = "logarithmic" -class SearchFieldDataType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class SearchFieldDataType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Defines the data type of a field in a search index. """ @@ -949,7 +951,7 @@ class SearchFieldDataType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: other types. COMPLEX = "Edm.ComplexType" -class SearchIndexerDataSourceType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class SearchIndexerDataSourceType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Defines the type of a datasource. """ @@ -966,7 +968,7 @@ class SearchIndexerDataSourceType(with_metaclass(_CaseInsensitiveEnumMeta, str, #: Indicates an ADLS Gen2 datasource. ADLS_GEN2 = "adlsgen2" -class SentimentSkillLanguage(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class SentimentSkillLanguage(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The language codes supported for input text by SentimentSkill. """ @@ -1001,7 +1003,7 @@ class SentimentSkillLanguage(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum) #: Turkish. TR = "tr" -class SnowballTokenFilterLanguage(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class SnowballTokenFilterLanguage(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The language to use for a Snowball token filter. """ @@ -1053,7 +1055,7 @@ class SnowballTokenFilterLanguage(with_metaclass(_CaseInsensitiveEnumMeta, str, #: Selects the Lucene Snowball stemming tokenizer for Turkish. TURKISH = "turkish" -class SplitSkillLanguage(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class SplitSkillLanguage(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The language codes supported for input text by SplitSkill. """ @@ -1076,7 +1078,7 @@ class SplitSkillLanguage(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Portuguese. PT = "pt" -class StemmerTokenFilterLanguage(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class StemmerTokenFilterLanguage(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The language to use for a stemmer token filter. """ @@ -1190,7 +1192,7 @@ class StemmerTokenFilterLanguage(with_metaclass(_CaseInsensitiveEnumMeta, str, E #: Selects the Lucene stemming tokenizer for Turkish. TURKISH = "turkish" -class StopwordsList(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class StopwordsList(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Identifies a predefined list of language-specific stopwords. """ @@ -1257,7 +1259,7 @@ class StopwordsList(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Selects the stopword list for Turkish. TURKISH = "turkish" -class TextSplitMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class TextSplitMode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """A value indicating which split mode to perform. """ @@ -1266,7 +1268,7 @@ class TextSplitMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Split the text into individual sentences. SENTENCES = "sentences" -class TextTranslationSkillLanguage(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class TextTranslationSkillLanguage(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The language codes supported for input text by TextTranslationSkill. """ @@ -1415,7 +1417,7 @@ class TextTranslationSkillLanguage(with_metaclass(_CaseInsensitiveEnumMeta, str, #: Punjabi. PA = "pa" -class TokenCharacterKind(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class TokenCharacterKind(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Represents classes of characters on which a token filter can operate. """ @@ -1430,7 +1432,7 @@ class TokenCharacterKind(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Keeps symbols in tokens. SYMBOL = "symbol" -class TokenFilterName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class TokenFilterName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Defines the names of all token filters supported by Azure Cognitive Search. """ @@ -1542,7 +1544,7 @@ class TokenFilterName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Splits words into subwords and performs optional transformations on subword groups. WORD_DELIMITER = "word_delimiter" -class VisualFeature(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class VisualFeature(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The strings indicating what visual feature types to return. """ diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_data_sources_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_data_sources_operations.py index 177f5b818a9a..85a4b01663ec 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_data_sources_operations.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_data_sources_operations.py @@ -5,12 +5,17 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import TYPE_CHECKING import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.pipeline.transport._base import _format_url_section +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from msrest import Serializer from .. import models as _models @@ -21,6 +26,203 @@ T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +_SERIALIZER = Serializer() +# fmt: off + +def build_create_or_update_request( + data_source_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] + if_match = kwargs.pop('if_match', None) # type: Optional[str] + if_none_match = kwargs.pop('if_none_match', None) # type: Optional[str] + ignore_reset_requirements = kwargs.pop('ignore_reset_requirements', None) # type: Optional[bool] + + prefer = "return=representation" + api_version = "2021-04-30-Preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/datasources(\'{dataSourceName}\')') + path_format_arguments = { + "dataSourceName": _SERIALIZER.url("data_source_name", data_source_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if ignore_reset_requirements is not None: + query_parameters['ignoreResetRequirements'] = _SERIALIZER.query("ignore_reset_requirements", ignore_reset_requirements, 'bool') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if x_ms_client_request_id is not None: + header_parameters['x-ms-client-request-id'] = _SERIALIZER.header("x_ms_client_request_id", x_ms_client_request_id, 'str') + if if_match is not None: + header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + if if_none_match is not None: + header_parameters['If-None-Match'] = _SERIALIZER.header("if_none_match", if_none_match, 'str') + header_parameters['Prefer'] = _SERIALIZER.header("prefer", prefer, 'str') + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_delete_request( + data_source_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] + if_match = kwargs.pop('if_match', None) # type: Optional[str] + if_none_match = kwargs.pop('if_none_match', None) # type: Optional[str] + + api_version = "2021-04-30-Preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/datasources(\'{dataSourceName}\')') + path_format_arguments = { + "dataSourceName": _SERIALIZER.url("data_source_name", data_source_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if x_ms_client_request_id is not None: + header_parameters['x-ms-client-request-id'] = _SERIALIZER.header("x_ms_client_request_id", x_ms_client_request_id, 'str') + if if_match is not None: + header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + if if_none_match is not None: + header_parameters['If-None-Match'] = _SERIALIZER.header("if_none_match", if_none_match, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + data_source_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] + + api_version = "2021-04-30-Preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/datasources(\'{dataSourceName}\')') + path_format_arguments = { + "dataSourceName": _SERIALIZER.url("data_source_name", data_source_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if x_ms_client_request_id is not None: + header_parameters['x-ms-client-request-id'] = _SERIALIZER.header("x_ms_client_request_id", x_ms_client_request_id, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_request( + **kwargs # type: Any +): + # type: (...) -> HttpRequest + select = kwargs.pop('select', None) # type: Optional[str] + x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] + + api_version = "2021-04-30-Preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/datasources') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + if select is not None: + query_parameters['$select'] = _SERIALIZER.query("select", select, 'str') + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if x_ms_client_request_id is not None: + header_parameters['x-ms-client-request-id'] = _SERIALIZER.header("x_ms_client_request_id", x_ms_client_request_id, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_request( + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] + + api_version = "2021-04-30-Preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/datasources') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if x_ms_client_request_id is not None: + header_parameters['x-ms-client-request-id'] = _SERIALIZER.header("x_ms_client_request_id", x_ms_client_request_id, 'str') + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +# fmt: on class DataSourcesOperations(object): """DataSourcesOperations operations. @@ -43,6 +245,7 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def create_or_update( self, data_source_name, # type: str @@ -80,46 +283,30 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - prefer = "return=representation" - api_version = "2021-04-30-Preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore + json = self._serialize.body(data_source, 'SearchIndexerDataSource') + + request = build_create_or_update_request( + data_source_name=data_source_name, + content_type=content_type, + x_ms_client_request_id=_x_ms_client_request_id, + if_match=if_match, + if_none_match=if_none_match, + ignore_reset_requirements=ignore_reset_requirements, + json=json, + template_url=self.create_or_update.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'dataSourceName': self._serialize.url("data_source_name", data_source_name, 'str'), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if ignore_reset_requirements is not None: - query_parameters['ignoreResetRequirements'] = self._serialize.query("ignore_reset_requirements", ignore_reset_requirements, 'bool') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - if if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - if if_none_match is not None: - header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') - header_parameters['Prefer'] = self._serialize.header("prefer", prefer, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(data_source, 'SearchIndexerDataSource') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -137,8 +324,11 @@ def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized + create_or_update.metadata = {'url': '/datasources(\'{dataSourceName}\')'} # type: ignore + + @distributed_trace def delete( self, data_source_name, # type: str @@ -170,37 +360,24 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - accept = "application/json" - # Construct URL - url = self.delete.metadata['url'] # type: ignore + request = build_delete_request( + data_source_name=data_source_name, + x_ms_client_request_id=_x_ms_client_request_id, + if_match=if_match, + if_none_match=if_none_match, + template_url=self.delete.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'dataSourceName': self._serialize.url("data_source_name", data_source_name, 'str'), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - if if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - if if_none_match is not None: - header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [204, 404]: @@ -213,6 +390,8 @@ def delete( delete.metadata = {'url': '/datasources(\'{dataSourceName}\')'} # type: ignore + + @distributed_trace def get( self, data_source_name, # type: str @@ -236,33 +415,22 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - accept = "application/json" - # Construct URL - url = self.get.metadata['url'] # type: ignore + request = build_get_request( + data_source_name=data_source_name, + x_ms_client_request_id=_x_ms_client_request_id, + template_url=self.get.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'dataSourceName': self._serialize.url("data_source_name", data_source_name, 'str'), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request.url = self._client.format_url(request.url, **path_format_arguments) - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: @@ -276,8 +444,11 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/datasources(\'{dataSourceName}\')'} # type: ignore + + @distributed_trace def list( self, select=None, # type: Optional[str] @@ -303,34 +474,22 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - accept = "application/json" - # Construct URL - url = self.list.metadata['url'] # type: ignore + request = build_list_request( + select=select, + x_ms_client_request_id=_x_ms_client_request_id, + template_url=self.list.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if select is not None: - query_parameters['$select'] = self._serialize.query("select", select, 'str') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: @@ -344,8 +503,11 @@ def list( return cls(pipeline_response, deserialized, {}) return deserialized + list.metadata = {'url': '/datasources'} # type: ignore + + @distributed_trace def create( self, data_source, # type: "_models.SearchIndexerDataSource" @@ -369,37 +531,26 @@ def create( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create.metadata['url'] # type: ignore + json = self._serialize.body(data_source, 'SearchIndexerDataSource') + + request = build_create_request( + content_type=content_type, + x_ms_client_request_id=_x_ms_client_request_id, + json=json, + template_url=self.create.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(data_source, 'SearchIndexerDataSource') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [201]: @@ -413,4 +564,6 @@ def create( return cls(pipeline_response, deserialized, {}) return deserialized + create.metadata = {'url': '/datasources'} # type: ignore + diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_indexers_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_indexers_operations.py index db8baeb1ff2f..ae85d03e1d14 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_indexers_operations.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_indexers_operations.py @@ -5,12 +5,17 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import TYPE_CHECKING import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.pipeline.transport._base import _format_url_section +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from msrest import Serializer from .. import models as _models @@ -21,6 +26,356 @@ T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +_SERIALIZER = Serializer() +# fmt: off + +def build_reset_request( + indexer_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] + + api_version = "2021-04-30-Preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/indexers(\'{indexerName}\')/search.reset') + path_format_arguments = { + "indexerName": _SERIALIZER.url("indexer_name", indexer_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if x_ms_client_request_id is not None: + header_parameters['x-ms-client-request-id'] = _SERIALIZER.header("x_ms_client_request_id", x_ms_client_request_id, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_reset_docs_request( + indexer_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + overwrite = kwargs.pop('overwrite', False) # type: Optional[bool] + x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] + + api_version = "2021-04-30-Preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/indexers(\'{indexerName}\')/search.resetdocs') + path_format_arguments = { + "indexerName": _SERIALIZER.url("indexer_name", indexer_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + if overwrite is not None: + query_parameters['overwrite'] = _SERIALIZER.query("overwrite", overwrite, 'bool') + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if x_ms_client_request_id is not None: + header_parameters['x-ms-client-request-id'] = _SERIALIZER.header("x_ms_client_request_id", x_ms_client_request_id, 'str') + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_run_request( + indexer_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] + + api_version = "2021-04-30-Preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/indexers(\'{indexerName}\')/search.run') + path_format_arguments = { + "indexerName": _SERIALIZER.url("indexer_name", indexer_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if x_ms_client_request_id is not None: + header_parameters['x-ms-client-request-id'] = _SERIALIZER.header("x_ms_client_request_id", x_ms_client_request_id, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request( + indexer_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] + if_match = kwargs.pop('if_match', None) # type: Optional[str] + if_none_match = kwargs.pop('if_none_match', None) # type: Optional[str] + disable_cache_reprocessing_change_detection = kwargs.pop('disable_cache_reprocessing_change_detection', None) # type: Optional[bool] + ignore_reset_requirements = kwargs.pop('ignore_reset_requirements', None) # type: Optional[bool] + + prefer = "return=representation" + api_version = "2021-04-30-Preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/indexers(\'{indexerName}\')') + path_format_arguments = { + "indexerName": _SERIALIZER.url("indexer_name", indexer_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if disable_cache_reprocessing_change_detection is not None: + query_parameters['disableCacheReprocessingChangeDetection'] = _SERIALIZER.query("disable_cache_reprocessing_change_detection", disable_cache_reprocessing_change_detection, 'bool') + if ignore_reset_requirements is not None: + query_parameters['ignoreResetRequirements'] = _SERIALIZER.query("ignore_reset_requirements", ignore_reset_requirements, 'bool') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if x_ms_client_request_id is not None: + header_parameters['x-ms-client-request-id'] = _SERIALIZER.header("x_ms_client_request_id", x_ms_client_request_id, 'str') + if if_match is not None: + header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + if if_none_match is not None: + header_parameters['If-None-Match'] = _SERIALIZER.header("if_none_match", if_none_match, 'str') + header_parameters['Prefer'] = _SERIALIZER.header("prefer", prefer, 'str') + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_delete_request( + indexer_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] + if_match = kwargs.pop('if_match', None) # type: Optional[str] + if_none_match = kwargs.pop('if_none_match', None) # type: Optional[str] + + api_version = "2021-04-30-Preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/indexers(\'{indexerName}\')') + path_format_arguments = { + "indexerName": _SERIALIZER.url("indexer_name", indexer_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if x_ms_client_request_id is not None: + header_parameters['x-ms-client-request-id'] = _SERIALIZER.header("x_ms_client_request_id", x_ms_client_request_id, 'str') + if if_match is not None: + header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + if if_none_match is not None: + header_parameters['If-None-Match'] = _SERIALIZER.header("if_none_match", if_none_match, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + indexer_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] + + api_version = "2021-04-30-Preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/indexers(\'{indexerName}\')') + path_format_arguments = { + "indexerName": _SERIALIZER.url("indexer_name", indexer_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if x_ms_client_request_id is not None: + header_parameters['x-ms-client-request-id'] = _SERIALIZER.header("x_ms_client_request_id", x_ms_client_request_id, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_request( + **kwargs # type: Any +): + # type: (...) -> HttpRequest + select = kwargs.pop('select', None) # type: Optional[str] + x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] + + api_version = "2021-04-30-Preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/indexers') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + if select is not None: + query_parameters['$select'] = _SERIALIZER.query("select", select, 'str') + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if x_ms_client_request_id is not None: + header_parameters['x-ms-client-request-id'] = _SERIALIZER.header("x_ms_client_request_id", x_ms_client_request_id, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_request( + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] + + api_version = "2021-04-30-Preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/indexers') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if x_ms_client_request_id is not None: + header_parameters['x-ms-client-request-id'] = _SERIALIZER.header("x_ms_client_request_id", x_ms_client_request_id, 'str') + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_status_request( + indexer_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] + + api_version = "2021-04-30-Preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/indexers(\'{indexerName}\')/search.status') + path_format_arguments = { + "indexerName": _SERIALIZER.url("indexer_name", indexer_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if x_ms_client_request_id is not None: + header_parameters['x-ms-client-request-id'] = _SERIALIZER.header("x_ms_client_request_id", x_ms_client_request_id, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +# fmt: on class IndexersOperations(object): """IndexersOperations operations. @@ -43,6 +398,7 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def reset( self, indexer_name, # type: str @@ -66,33 +422,92 @@ def reset( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - accept = "application/json" - # Construct URL - url = self.reset.metadata['url'] # type: ignore + request = build_reset_request( + indexer_name=indexer_name, + x_ms_client_request_id=_x_ms_client_request_id, + template_url=self.reset.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexerName': self._serialize.url("indexer_name", indexer_name, 'str'), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.SearchError, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + reset.metadata = {'url': '/indexers(\'{indexerName}\')/search.reset'} # type: ignore + + + @distributed_trace + def reset_docs( + self, + indexer_name, # type: str + overwrite=False, # type: Optional[bool] + keys_or_ids=None, # type: Optional["_models.Paths1Cj7DxmIndexersIndexernameSearchResetdocsPostRequestbodyContentApplicationJsonSchema"] + request_options=None, # type: Optional["_models.RequestOptions"] + **kwargs # type: Any + ): + # type: (...) -> None + """Resets specific documents in the datasource to be selectively re-ingested by the indexer. - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + :param indexer_name: The name of the indexer to reset documents for. + :type indexer_name: str + :param overwrite: If false, keys or ids will be appended to existing ones. If true, only the + keys or ids in this payload will be queued to be re-ingested. + :type overwrite: bool + :param keys_or_ids: + :type keys_or_ids: + ~azure.search.documents.indexes.models.Paths1Cj7DxmIndexersIndexernameSearchResetdocsPostRequestbodyContentApplicationJsonSchema + :param request_options: Parameter group. + :type request_options: ~azure.search.documents.indexes.models.RequestOptions + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + _x_ms_client_request_id = None + if request_options is not None: + _x_ms_client_request_id = request_options.x_ms_client_request_id + if keys_or_ids is not None: + json = self._serialize.body(keys_or_ids, 'Paths1Cj7DxmIndexersIndexernameSearchResetdocsPostRequestbodyContentApplicationJsonSchema') + else: + json = None + + request = build_reset_docs_request( + indexer_name=indexer_name, + content_type=content_type, + overwrite=overwrite, + x_ms_client_request_id=_x_ms_client_request_id, + json=json, + template_url=self.reset_docs.metadata['url'], + )._to_pipeline_transport_request() + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [204]: @@ -103,8 +518,10 @@ def reset( if cls: return cls(pipeline_response, None, {}) - reset.metadata = {'url': '/indexers(\'{indexerName}\')/search.reset'} # type: ignore + reset_docs.metadata = {'url': '/indexers(\'{indexerName}\')/search.resetdocs'} # type: ignore + + @distributed_trace def run( self, indexer_name, # type: str @@ -128,33 +545,22 @@ def run( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - accept = "application/json" - # Construct URL - url = self.run.metadata['url'] # type: ignore + request = build_run_request( + indexer_name=indexer_name, + x_ms_client_request_id=_x_ms_client_request_id, + template_url=self.run.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexerName': self._serialize.url("indexer_name", indexer_name, 'str'), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) + request.url = self._client.format_url(request.url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [202]: @@ -167,6 +573,8 @@ def run( run.metadata = {'url': '/indexers(\'{indexerName}\')/search.run'} # type: ignore + + @distributed_trace def create_or_update( self, indexer_name, # type: str @@ -208,48 +616,31 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - prefer = "return=representation" - api_version = "2021-04-30-Preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore + json = self._serialize.body(indexer, 'SearchIndexer') + + request = build_create_or_update_request( + indexer_name=indexer_name, + content_type=content_type, + x_ms_client_request_id=_x_ms_client_request_id, + if_match=if_match, + if_none_match=if_none_match, + disable_cache_reprocessing_change_detection=disable_cache_reprocessing_change_detection, + ignore_reset_requirements=ignore_reset_requirements, + json=json, + template_url=self.create_or_update.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexerName': self._serialize.url("indexer_name", indexer_name, 'str'), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if disable_cache_reprocessing_change_detection is not None: - query_parameters['disableCacheReprocessingChangeDetection'] = self._serialize.query("disable_cache_reprocessing_change_detection", disable_cache_reprocessing_change_detection, 'bool') - if ignore_reset_requirements is not None: - query_parameters['ignoreResetRequirements'] = self._serialize.query("ignore_reset_requirements", ignore_reset_requirements, 'bool') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - if if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - if if_none_match is not None: - header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') - header_parameters['Prefer'] = self._serialize.header("prefer", prefer, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(indexer, 'SearchIndexer') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -267,8 +658,11 @@ def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized + create_or_update.metadata = {'url': '/indexers(\'{indexerName}\')'} # type: ignore + + @distributed_trace def delete( self, indexer_name, # type: str @@ -300,37 +694,24 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - accept = "application/json" - # Construct URL - url = self.delete.metadata['url'] # type: ignore + request = build_delete_request( + indexer_name=indexer_name, + x_ms_client_request_id=_x_ms_client_request_id, + if_match=if_match, + if_none_match=if_none_match, + template_url=self.delete.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexerName': self._serialize.url("indexer_name", indexer_name, 'str'), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - if if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - if if_none_match is not None: - header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [204, 404]: @@ -343,6 +724,8 @@ def delete( delete.metadata = {'url': '/indexers(\'{indexerName}\')'} # type: ignore + + @distributed_trace def get( self, indexer_name, # type: str @@ -366,33 +749,22 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - accept = "application/json" - # Construct URL - url = self.get.metadata['url'] # type: ignore + request = build_get_request( + indexer_name=indexer_name, + x_ms_client_request_id=_x_ms_client_request_id, + template_url=self.get.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexerName': self._serialize.url("indexer_name", indexer_name, 'str'), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request.url = self._client.format_url(request.url, **path_format_arguments) - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: @@ -406,8 +778,11 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/indexers(\'{indexerName}\')'} # type: ignore + + @distributed_trace def list( self, select=None, # type: Optional[str] @@ -433,34 +808,22 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - accept = "application/json" - # Construct URL - url = self.list.metadata['url'] # type: ignore + request = build_list_request( + select=select, + x_ms_client_request_id=_x_ms_client_request_id, + template_url=self.list.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if select is not None: - query_parameters['$select'] = self._serialize.query("select", select, 'str') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: @@ -474,8 +837,11 @@ def list( return cls(pipeline_response, deserialized, {}) return deserialized + list.metadata = {'url': '/indexers'} # type: ignore + + @distributed_trace def create( self, indexer, # type: "_models.SearchIndexer" @@ -499,37 +865,26 @@ def create( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create.metadata['url'] # type: ignore + json = self._serialize.body(indexer, 'SearchIndexer') + + request = build_create_request( + content_type=content_type, + x_ms_client_request_id=_x_ms_client_request_id, + json=json, + template_url=self.create.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(indexer, 'SearchIndexer') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [201]: @@ -543,8 +898,11 @@ def create( return cls(pipeline_response, deserialized, {}) return deserialized + create.metadata = {'url': '/indexers'} # type: ignore + + @distributed_trace def get_status( self, indexer_name, # type: str @@ -568,33 +926,22 @@ def get_status( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - accept = "application/json" - # Construct URL - url = self.get_status.metadata['url'] # type: ignore + request = build_get_status_request( + indexer_name=indexer_name, + x_ms_client_request_id=_x_ms_client_request_id, + template_url=self.get_status.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexerName': self._serialize.url("indexer_name", indexer_name, 'str'), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) + request.url = self._client.format_url(request.url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: @@ -608,4 +955,6 @@ def get_status( return cls(pipeline_response, deserialized, {}) return deserialized + get_status.metadata = {'url': '/indexers(\'{indexerName}\')/search.status'} # type: ignore + diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_indexes_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_indexes_operations.py index edbae386616f..c5a7e11c1930 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_indexes_operations.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_indexes_operations.py @@ -5,13 +5,18 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import TYPE_CHECKING import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.pipeline.transport._base import _format_url_section +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from msrest import Serializer from .. import models as _models @@ -22,6 +27,278 @@ T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +_SERIALIZER = Serializer() +# fmt: off + +def build_create_request( + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] + + api_version = "2021-04-30-Preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/indexes') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if x_ms_client_request_id is not None: + header_parameters['x-ms-client-request-id'] = _SERIALIZER.header("x_ms_client_request_id", x_ms_client_request_id, 'str') + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_request( + **kwargs # type: Any +): + # type: (...) -> HttpRequest + select = kwargs.pop('select', None) # type: Optional[str] + x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] + + api_version = "2021-04-30-Preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/indexes') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + if select is not None: + query_parameters['$select'] = _SERIALIZER.query("select", select, 'str') + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if x_ms_client_request_id is not None: + header_parameters['x-ms-client-request-id'] = _SERIALIZER.header("x_ms_client_request_id", x_ms_client_request_id, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request( + index_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + allow_index_downtime = kwargs.pop('allow_index_downtime', None) # type: Optional[bool] + x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] + if_match = kwargs.pop('if_match', None) # type: Optional[str] + if_none_match = kwargs.pop('if_none_match', None) # type: Optional[str] + + prefer = "return=representation" + api_version = "2021-04-30-Preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/indexes(\'{indexName}\')') + path_format_arguments = { + "indexName": _SERIALIZER.url("index_name", index_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + if allow_index_downtime is not None: + query_parameters['allowIndexDowntime'] = _SERIALIZER.query("allow_index_downtime", allow_index_downtime, 'bool') + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if x_ms_client_request_id is not None: + header_parameters['x-ms-client-request-id'] = _SERIALIZER.header("x_ms_client_request_id", x_ms_client_request_id, 'str') + if if_match is not None: + header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + if if_none_match is not None: + header_parameters['If-None-Match'] = _SERIALIZER.header("if_none_match", if_none_match, 'str') + header_parameters['Prefer'] = _SERIALIZER.header("prefer", prefer, 'str') + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_delete_request( + index_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] + if_match = kwargs.pop('if_match', None) # type: Optional[str] + if_none_match = kwargs.pop('if_none_match', None) # type: Optional[str] + + api_version = "2021-04-30-Preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/indexes(\'{indexName}\')') + path_format_arguments = { + "indexName": _SERIALIZER.url("index_name", index_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if x_ms_client_request_id is not None: + header_parameters['x-ms-client-request-id'] = _SERIALIZER.header("x_ms_client_request_id", x_ms_client_request_id, 'str') + if if_match is not None: + header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + if if_none_match is not None: + header_parameters['If-None-Match'] = _SERIALIZER.header("if_none_match", if_none_match, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + index_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] + + api_version = "2021-04-30-Preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/indexes(\'{indexName}\')') + path_format_arguments = { + "indexName": _SERIALIZER.url("index_name", index_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if x_ms_client_request_id is not None: + header_parameters['x-ms-client-request-id'] = _SERIALIZER.header("x_ms_client_request_id", x_ms_client_request_id, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_statistics_request( + index_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] + + api_version = "2021-04-30-Preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/indexes(\'{indexName}\')/search.stats') + path_format_arguments = { + "indexName": _SERIALIZER.url("index_name", index_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if x_ms_client_request_id is not None: + header_parameters['x-ms-client-request-id'] = _SERIALIZER.header("x_ms_client_request_id", x_ms_client_request_id, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_analyze_request( + index_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] + + api_version = "2021-04-30-Preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/indexes(\'{indexName}\')/search.analyze') + path_format_arguments = { + "indexName": _SERIALIZER.url("index_name", index_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if x_ms_client_request_id is not None: + header_parameters['x-ms-client-request-id'] = _SERIALIZER.header("x_ms_client_request_id", x_ms_client_request_id, 'str') + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +# fmt: on class IndexesOperations(object): """IndexesOperations operations. @@ -44,6 +321,7 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def create( self, index, # type: "_models.SearchIndex" @@ -67,37 +345,26 @@ def create( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create.metadata['url'] # type: ignore + json = self._serialize.body(index, 'SearchIndex') + + request = build_create_request( + content_type=content_type, + x_ms_client_request_id=_x_ms_client_request_id, + json=json, + template_url=self.create.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(index, 'SearchIndex') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [201]: @@ -111,8 +378,11 @@ def create( return cls(pipeline_response, deserialized, {}) return deserialized + create.metadata = {'url': '/indexes'} # type: ignore + + @distributed_trace def list( self, select=None, # type: Optional[str] @@ -138,46 +408,45 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - - _x_ms_client_request_id = None - if request_options is not None: - _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore + _x_ms_client_request_id = None + if request_options is not None: + _x_ms_client_request_id = request_options.x_ms_client_request_id + + request = build_list_request( + select=select, + x_ms_client_request_id=_x_ms_client_request_id, + template_url=self.list.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if select is not None: - query_parameters['$select'] = self._serialize.query("select", select, 'str') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + request.url = self._client.format_url(request.url, **path_format_arguments) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] + _x_ms_client_request_id = None + if request_options is not None: + _x_ms_client_request_id = request_options.x_ms_client_request_id + + request = build_list_request( + select=select, + x_ms_client_request_id=_x_ms_client_request_id, + template_url=next_link, + )._to_pipeline_transport_request() + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + request.url = self._client.format_url(request.url, **path_format_arguments) + path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) - request = self._client.get(url, query_parameters, header_parameters) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ListIndexesResult', pipeline_response) + deserialized = self._deserialize("ListIndexesResult", pipeline_response) list_of_elem = deserialized.indexes if cls: list_of_elem = cls(list_of_elem) @@ -190,17 +459,19 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.SearchError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.SearchError, response) raise HttpResponseError(response=response, model=error) return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/indexes'} # type: ignore + @distributed_trace def create_or_update( self, index_name, # type: str @@ -242,46 +513,30 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - prefer = "return=representation" - api_version = "2021-04-30-Preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore + json = self._serialize.body(index, 'SearchIndex') + + request = build_create_or_update_request( + index_name=index_name, + content_type=content_type, + allow_index_downtime=allow_index_downtime, + x_ms_client_request_id=_x_ms_client_request_id, + if_match=if_match, + if_none_match=if_none_match, + json=json, + template_url=self.create_or_update.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexName': self._serialize.url("index_name", index_name, 'str'), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if allow_index_downtime is not None: - query_parameters['allowIndexDowntime'] = self._serialize.query("allow_index_downtime", allow_index_downtime, 'bool') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - if if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - if if_none_match is not None: - header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') - header_parameters['Prefer'] = self._serialize.header("prefer", prefer, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(index, 'SearchIndex') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -299,8 +554,11 @@ def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized + create_or_update.metadata = {'url': '/indexes(\'{indexName}\')'} # type: ignore + + @distributed_trace def delete( self, index_name, # type: str @@ -334,37 +592,24 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - accept = "application/json" - # Construct URL - url = self.delete.metadata['url'] # type: ignore + request = build_delete_request( + index_name=index_name, + x_ms_client_request_id=_x_ms_client_request_id, + if_match=if_match, + if_none_match=if_none_match, + template_url=self.delete.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexName': self._serialize.url("index_name", index_name, 'str'), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - if if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - if if_none_match is not None: - header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [204, 404]: @@ -377,6 +622,8 @@ def delete( delete.metadata = {'url': '/indexes(\'{indexName}\')'} # type: ignore + + @distributed_trace def get( self, index_name, # type: str @@ -400,33 +647,22 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - accept = "application/json" - # Construct URL - url = self.get.metadata['url'] # type: ignore + request = build_get_request( + index_name=index_name, + x_ms_client_request_id=_x_ms_client_request_id, + template_url=self.get.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexName': self._serialize.url("index_name", index_name, 'str'), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) + request.url = self._client.format_url(request.url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: @@ -440,8 +676,11 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/indexes(\'{indexName}\')'} # type: ignore + + @distributed_trace def get_statistics( self, index_name, # type: str @@ -465,33 +704,22 @@ def get_statistics( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - accept = "application/json" - # Construct URL - url = self.get_statistics.metadata['url'] # type: ignore + request = build_get_statistics_request( + index_name=index_name, + x_ms_client_request_id=_x_ms_client_request_id, + template_url=self.get_statistics.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexName': self._serialize.url("index_name", index_name, 'str'), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) + request.url = self._client.format_url(request.url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: @@ -505,8 +733,11 @@ def get_statistics( return cls(pipeline_response, deserialized, {}) return deserialized + get_statistics.metadata = {'url': '/indexes(\'{indexName}\')/search.stats'} # type: ignore + + @distributed_trace def analyze( self, index_name, # type: str @@ -533,38 +764,27 @@ def analyze( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.analyze.metadata['url'] # type: ignore + json = self._serialize.body(request, 'AnalyzeRequest') + + request = build_analyze_request( + index_name=index_name, + content_type=content_type, + x_ms_client_request_id=_x_ms_client_request_id, + json=json, + template_url=self.analyze.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'indexName': self._serialize.url("index_name", index_name, 'str'), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(request, 'AnalyzeRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: @@ -578,4 +798,6 @@ def analyze( return cls(pipeline_response, deserialized, {}) return deserialized + analyze.metadata = {'url': '/indexes(\'{indexName}\')/search.analyze'} # type: ignore + diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_search_client_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_search_client_operations.py index 3c79b0d83faa..c717faa75ed0 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_search_client_operations.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_search_client_operations.py @@ -5,12 +5,16 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import TYPE_CHECKING import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from msrest import Serializer from .. import models as _models @@ -21,8 +25,42 @@ T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +_SERIALIZER = Serializer() +# fmt: off + +def build_get_service_statistics_request( + **kwargs # type: Any +): + # type: (...) -> HttpRequest + x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] + + api_version = "2021-04-30-Preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/servicestats') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if x_ms_client_request_id is not None: + header_parameters['x-ms-client-request-id'] = _SERIALIZER.header("x_ms_client_request_id", x_ms_client_request_id, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +# fmt: on class SearchClientOperationsMixin(object): + @distributed_trace def get_service_statistics( self, request_options=None, # type: Optional["_models.RequestOptions"] @@ -43,32 +81,21 @@ def get_service_statistics( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - accept = "application/json" - # Construct URL - url = self.get_service_statistics.metadata['url'] # type: ignore + request = build_get_service_statistics_request( + x_ms_client_request_id=_x_ms_client_request_id, + template_url=self.get_service_statistics.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request.url = self._client.format_url(request.url, **path_format_arguments) - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: @@ -82,4 +109,6 @@ def get_service_statistics( return cls(pipeline_response, deserialized, {}) return deserialized + get_service_statistics.metadata = {'url': '/servicestats'} # type: ignore + diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_skillsets_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_skillsets_operations.py index 5a18fca7d630..55ca1000e361 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_skillsets_operations.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_skillsets_operations.py @@ -5,12 +5,17 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import TYPE_CHECKING import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.pipeline.transport._base import _format_url_section +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from msrest import Serializer from .. import models as _models @@ -21,6 +26,206 @@ T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +_SERIALIZER = Serializer() +# fmt: off + +def build_create_or_update_request( + skillset_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] + if_match = kwargs.pop('if_match', None) # type: Optional[str] + if_none_match = kwargs.pop('if_none_match', None) # type: Optional[str] + disable_cache_reprocessing_change_detection = kwargs.pop('disable_cache_reprocessing_change_detection', None) # type: Optional[bool] + ignore_reset_requirements = kwargs.pop('ignore_reset_requirements', None) # type: Optional[bool] + + prefer = "return=representation" + api_version = "2021-04-30-Preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/skillsets(\'{skillsetName}\')') + path_format_arguments = { + "skillsetName": _SERIALIZER.url("skillset_name", skillset_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if disable_cache_reprocessing_change_detection is not None: + query_parameters['disableCacheReprocessingChangeDetection'] = _SERIALIZER.query("disable_cache_reprocessing_change_detection", disable_cache_reprocessing_change_detection, 'bool') + if ignore_reset_requirements is not None: + query_parameters['ignoreResetRequirements'] = _SERIALIZER.query("ignore_reset_requirements", ignore_reset_requirements, 'bool') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if x_ms_client_request_id is not None: + header_parameters['x-ms-client-request-id'] = _SERIALIZER.header("x_ms_client_request_id", x_ms_client_request_id, 'str') + if if_match is not None: + header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + if if_none_match is not None: + header_parameters['If-None-Match'] = _SERIALIZER.header("if_none_match", if_none_match, 'str') + header_parameters['Prefer'] = _SERIALIZER.header("prefer", prefer, 'str') + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_delete_request( + skillset_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] + if_match = kwargs.pop('if_match', None) # type: Optional[str] + if_none_match = kwargs.pop('if_none_match', None) # type: Optional[str] + + api_version = "2021-04-30-Preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/skillsets(\'{skillsetName}\')') + path_format_arguments = { + "skillsetName": _SERIALIZER.url("skillset_name", skillset_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if x_ms_client_request_id is not None: + header_parameters['x-ms-client-request-id'] = _SERIALIZER.header("x_ms_client_request_id", x_ms_client_request_id, 'str') + if if_match is not None: + header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + if if_none_match is not None: + header_parameters['If-None-Match'] = _SERIALIZER.header("if_none_match", if_none_match, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + skillset_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] + + api_version = "2021-04-30-Preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/skillsets(\'{skillsetName}\')') + path_format_arguments = { + "skillsetName": _SERIALIZER.url("skillset_name", skillset_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if x_ms_client_request_id is not None: + header_parameters['x-ms-client-request-id'] = _SERIALIZER.header("x_ms_client_request_id", x_ms_client_request_id, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_request( + **kwargs # type: Any +): + # type: (...) -> HttpRequest + select = kwargs.pop('select', None) # type: Optional[str] + x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] + + api_version = "2021-04-30-Preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/skillsets') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + if select is not None: + query_parameters['$select'] = _SERIALIZER.query("select", select, 'str') + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if x_ms_client_request_id is not None: + header_parameters['x-ms-client-request-id'] = _SERIALIZER.header("x_ms_client_request_id", x_ms_client_request_id, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_request( + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] + + api_version = "2021-04-30-Preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/skillsets') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if x_ms_client_request_id is not None: + header_parameters['x-ms-client-request-id'] = _SERIALIZER.header("x_ms_client_request_id", x_ms_client_request_id, 'str') + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +# fmt: on class SkillsetsOperations(object): """SkillsetsOperations operations. @@ -43,6 +248,7 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def create_or_update( self, skillset_name, # type: str @@ -85,48 +291,31 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - prefer = "return=representation" - api_version = "2021-04-30-Preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore + json = self._serialize.body(skillset, 'SearchIndexerSkillset') + + request = build_create_or_update_request( + skillset_name=skillset_name, + content_type=content_type, + x_ms_client_request_id=_x_ms_client_request_id, + if_match=if_match, + if_none_match=if_none_match, + disable_cache_reprocessing_change_detection=disable_cache_reprocessing_change_detection, + ignore_reset_requirements=ignore_reset_requirements, + json=json, + template_url=self.create_or_update.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'skillsetName': self._serialize.url("skillset_name", skillset_name, 'str'), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if disable_cache_reprocessing_change_detection is not None: - query_parameters['disableCacheReprocessingChangeDetection'] = self._serialize.query("disable_cache_reprocessing_change_detection", disable_cache_reprocessing_change_detection, 'bool') - if ignore_reset_requirements is not None: - query_parameters['ignoreResetRequirements'] = self._serialize.query("ignore_reset_requirements", ignore_reset_requirements, 'bool') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - if if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - if if_none_match is not None: - header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') - header_parameters['Prefer'] = self._serialize.header("prefer", prefer, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(skillset, 'SearchIndexerSkillset') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -144,8 +333,11 @@ def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized + create_or_update.metadata = {'url': '/skillsets(\'{skillsetName}\')'} # type: ignore + + @distributed_trace def delete( self, skillset_name, # type: str @@ -177,37 +369,24 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - accept = "application/json" - # Construct URL - url = self.delete.metadata['url'] # type: ignore + request = build_delete_request( + skillset_name=skillset_name, + x_ms_client_request_id=_x_ms_client_request_id, + if_match=if_match, + if_none_match=if_none_match, + template_url=self.delete.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'skillsetName': self._serialize.url("skillset_name", skillset_name, 'str'), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - if if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - if if_none_match is not None: - header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [204, 404]: @@ -220,6 +399,8 @@ def delete( delete.metadata = {'url': '/skillsets(\'{skillsetName}\')'} # type: ignore + + @distributed_trace def get( self, skillset_name, # type: str @@ -243,33 +424,22 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - accept = "application/json" - # Construct URL - url = self.get.metadata['url'] # type: ignore + request = build_get_request( + skillset_name=skillset_name, + x_ms_client_request_id=_x_ms_client_request_id, + template_url=self.get.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'skillsetName': self._serialize.url("skillset_name", skillset_name, 'str'), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request.url = self._client.format_url(request.url, **path_format_arguments) - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: @@ -283,8 +453,11 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/skillsets(\'{skillsetName}\')'} # type: ignore + + @distributed_trace def list( self, select=None, # type: Optional[str] @@ -310,34 +483,22 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - accept = "application/json" - # Construct URL - url = self.list.metadata['url'] # type: ignore + request = build_list_request( + select=select, + x_ms_client_request_id=_x_ms_client_request_id, + template_url=self.list.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if select is not None: - query_parameters['$select'] = self._serialize.query("select", select, 'str') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: @@ -351,8 +512,11 @@ def list( return cls(pipeline_response, deserialized, {}) return deserialized + list.metadata = {'url': '/skillsets'} # type: ignore + + @distributed_trace def create( self, skillset, # type: "_models.SearchIndexerSkillset" @@ -376,37 +540,26 @@ def create( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create.metadata['url'] # type: ignore + json = self._serialize.body(skillset, 'SearchIndexerSkillset') + + request = build_create_request( + content_type=content_type, + x_ms_client_request_id=_x_ms_client_request_id, + json=json, + template_url=self.create.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(skillset, 'SearchIndexerSkillset') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [201]: @@ -420,4 +573,6 @@ def create( return cls(pipeline_response, deserialized, {}) return deserialized + create.metadata = {'url': '/skillsets'} # type: ignore + diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_synonym_maps_operations.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_synonym_maps_operations.py index d061bcec2898..0ce0864491c3 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_synonym_maps_operations.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_generated/operations/_synonym_maps_operations.py @@ -5,12 +5,17 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import TYPE_CHECKING import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.pipeline.transport._base import _format_url_section +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from msrest import Serializer from .. import models as _models @@ -21,6 +26,200 @@ T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +_SERIALIZER = Serializer() +# fmt: off + +def build_create_or_update_request( + synonym_map_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] + if_match = kwargs.pop('if_match', None) # type: Optional[str] + if_none_match = kwargs.pop('if_none_match', None) # type: Optional[str] + + prefer = "return=representation" + api_version = "2021-04-30-Preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/synonymmaps(\'{synonymMapName}\')') + path_format_arguments = { + "synonymMapName": _SERIALIZER.url("synonym_map_name", synonym_map_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if x_ms_client_request_id is not None: + header_parameters['x-ms-client-request-id'] = _SERIALIZER.header("x_ms_client_request_id", x_ms_client_request_id, 'str') + if if_match is not None: + header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + if if_none_match is not None: + header_parameters['If-None-Match'] = _SERIALIZER.header("if_none_match", if_none_match, 'str') + header_parameters['Prefer'] = _SERIALIZER.header("prefer", prefer, 'str') + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_delete_request( + synonym_map_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] + if_match = kwargs.pop('if_match', None) # type: Optional[str] + if_none_match = kwargs.pop('if_none_match', None) # type: Optional[str] + + api_version = "2021-04-30-Preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/synonymmaps(\'{synonymMapName}\')') + path_format_arguments = { + "synonymMapName": _SERIALIZER.url("synonym_map_name", synonym_map_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if x_ms_client_request_id is not None: + header_parameters['x-ms-client-request-id'] = _SERIALIZER.header("x_ms_client_request_id", x_ms_client_request_id, 'str') + if if_match is not None: + header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + if if_none_match is not None: + header_parameters['If-None-Match'] = _SERIALIZER.header("if_none_match", if_none_match, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + synonym_map_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] + + api_version = "2021-04-30-Preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/synonymmaps(\'{synonymMapName}\')') + path_format_arguments = { + "synonymMapName": _SERIALIZER.url("synonym_map_name", synonym_map_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if x_ms_client_request_id is not None: + header_parameters['x-ms-client-request-id'] = _SERIALIZER.header("x_ms_client_request_id", x_ms_client_request_id, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_request( + **kwargs # type: Any +): + # type: (...) -> HttpRequest + select = kwargs.pop('select', None) # type: Optional[str] + x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] + + api_version = "2021-04-30-Preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/synonymmaps') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + if select is not None: + query_parameters['$select'] = _SERIALIZER.query("select", select, 'str') + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if x_ms_client_request_id is not None: + header_parameters['x-ms-client-request-id'] = _SERIALIZER.header("x_ms_client_request_id", x_ms_client_request_id, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_request( + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + x_ms_client_request_id = kwargs.pop('x_ms_client_request_id', None) # type: Optional[str] + + api_version = "2021-04-30-Preview" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/synonymmaps') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if x_ms_client_request_id is not None: + header_parameters['x-ms-client-request-id'] = _SERIALIZER.header("x_ms_client_request_id", x_ms_client_request_id, 'str') + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +# fmt: on class SynonymMapsOperations(object): """SynonymMapsOperations operations. @@ -43,6 +242,7 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def create_or_update( self, synonym_map_name, # type: str @@ -77,44 +277,29 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - prefer = "return=representation" - api_version = "2021-04-30-Preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore + json = self._serialize.body(synonym_map, 'SynonymMap') + + request = build_create_or_update_request( + synonym_map_name=synonym_map_name, + content_type=content_type, + x_ms_client_request_id=_x_ms_client_request_id, + if_match=if_match, + if_none_match=if_none_match, + json=json, + template_url=self.create_or_update.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'synonymMapName': self._serialize.url("synonym_map_name", synonym_map_name, 'str'), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - if if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - if if_none_match is not None: - header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') - header_parameters['Prefer'] = self._serialize.header("prefer", prefer, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(synonym_map, 'SynonymMap') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -132,8 +317,11 @@ def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized + create_or_update.metadata = {'url': '/synonymmaps(\'{synonymMapName}\')'} # type: ignore + + @distributed_trace def delete( self, synonym_map_name, # type: str @@ -165,37 +353,24 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - accept = "application/json" - # Construct URL - url = self.delete.metadata['url'] # type: ignore + request = build_delete_request( + synonym_map_name=synonym_map_name, + x_ms_client_request_id=_x_ms_client_request_id, + if_match=if_match, + if_none_match=if_none_match, + template_url=self.delete.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'synonymMapName': self._serialize.url("synonym_map_name", synonym_map_name, 'str'), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - if if_match is not None: - header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') - if if_none_match is not None: - header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [204, 404]: @@ -208,6 +383,8 @@ def delete( delete.metadata = {'url': '/synonymmaps(\'{synonymMapName}\')'} # type: ignore + + @distributed_trace def get( self, synonym_map_name, # type: str @@ -231,33 +408,22 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - accept = "application/json" - # Construct URL - url = self.get.metadata['url'] # type: ignore + request = build_get_request( + synonym_map_name=synonym_map_name, + x_ms_client_request_id=_x_ms_client_request_id, + template_url=self.get.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'synonymMapName': self._serialize.url("synonym_map_name", synonym_map_name, 'str'), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request.url = self._client.format_url(request.url, **path_format_arguments) - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: @@ -271,8 +437,11 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/synonymmaps(\'{synonymMapName}\')'} # type: ignore + + @distributed_trace def list( self, select=None, # type: Optional[str] @@ -298,34 +467,22 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - accept = "application/json" - # Construct URL - url = self.list.metadata['url'] # type: ignore + request = build_list_request( + select=select, + x_ms_client_request_id=_x_ms_client_request_id, + template_url=self.list.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if select is not None: - query_parameters['$select'] = self._serialize.query("select", select, 'str') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: @@ -339,8 +496,11 @@ def list( return cls(pipeline_response, deserialized, {}) return deserialized + list.metadata = {'url': '/synonymmaps'} # type: ignore + + @distributed_trace def create( self, synonym_map, # type: "_models.SynonymMap" @@ -364,37 +524,26 @@ def create( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _x_ms_client_request_id = None if request_options is not None: _x_ms_client_request_id = request_options.x_ms_client_request_id - api_version = "2021-04-30-Preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create.metadata['url'] # type: ignore + json = self._serialize.body(synonym_map, 'SynonymMap') + + request = build_create_request( + content_type=content_type, + x_ms_client_request_id=_x_ms_client_request_id, + json=json, + template_url=self.create.metadata['url'], + )._to_pipeline_transport_request() path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - if _x_ms_client_request_id is not None: - header_parameters['x-ms-client-request-id'] = self._serialize.header("x_ms_client_request_id", _x_ms_client_request_id, 'str') - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(synonym_map, 'SynonymMap') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = self._client.send_request(request, stream=False, _return_pipeline_response=True, **kwargs) response = pipeline_response.http_response if response.status_code not in [201]: @@ -408,4 +557,6 @@ def create( return cls(pipeline_response, deserialized, {}) return deserialized + create.metadata = {'url': '/synonymmaps'} # type: ignore + diff --git a/sdk/search/azure-search-documents/setup.py b/sdk/search/azure-search-documents/setup.py index 53197e7f08a4..446aae1aa38c 100644 --- a/sdk/search/azure-search-documents/setup.py +++ b/sdk/search/azure-search-documents/setup.py @@ -78,7 +78,7 @@ 'azure.search', ]), install_requires=[ - "azure-core<2.0.0,>=1.14.0", + "azure-core<2.0.0,>=1.18.0", "msrest>=0.6.21", "azure-common~=1.1", "typing-extensions" diff --git a/shared_requirements.txt b/shared_requirements.txt index d4abde6017be..bc96cd664b58 100644 --- a/shared_requirements.txt +++ b/shared_requirements.txt @@ -152,7 +152,7 @@ chardet<5,>=3.0.2 #override azure-ai-textanalytics azure-core<2.0.0,>=1.14.0 #override azure-ai-language-questionanswering azure-core<2.0.0,>=1.16.0 #override azure-ai-language-questionanswering msrest>=0.6.21 -#override azure-search-documents azure-core<2.0.0,>=1.14.0 +#override azure-search-documents azure-core<2.0.0,>=1.18.0 #override azure-ai-formrecognizer msrest>=0.6.21 #override azure-ai-formrecognizer azure-core<2.0.0,>=1.13.0 #override azure-storage-blob azure-core<2.0.0,>=1.10.0 From 404868495193cb4ddb5b47c2b7b19535adecf35f Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Sun, 12 Sep 2021 15:49:22 -0700 Subject: [PATCH 40/85] Increment version for monitor releases (#20635) Increment package version after release of azure-monitor-query --- sdk/monitor/azure-monitor-query/CHANGELOG.md | 10 ++++++++++ .../azure/monitor/query/_version.py | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/sdk/monitor/azure-monitor-query/CHANGELOG.md b/sdk/monitor/azure-monitor-query/CHANGELOG.md index 8e847161dfb3..ba96cc2ea4f4 100644 --- a/sdk/monitor/azure-monitor-query/CHANGELOG.md +++ b/sdk/monitor/azure-monitor-query/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.0.0b5 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.0.0b4 (2021-09-09) ### Features Added diff --git a/sdk/monitor/azure-monitor-query/azure/monitor/query/_version.py b/sdk/monitor/azure-monitor-query/azure/monitor/query/_version.py index 3938d6c3e835..9ed953daa8fe 100644 --- a/sdk/monitor/azure-monitor-query/azure/monitor/query/_version.py +++ b/sdk/monitor/azure-monitor-query/azure/monitor/query/_version.py @@ -5,4 +5,4 @@ # license information. # -------------------------------------------------------------------------- -VERSION = "1.0.0b4" +VERSION = "1.0.0b5" From b7b7e36c3a7b54e510f4c49f431c1db7e6cc5d42 Mon Sep 17 00:00:00 2001 From: Travis Prescott Date: Mon, 13 Sep 2021 09:10:38 -0700 Subject: [PATCH 41/85] [Search] Update SearchClient.search API (#20602) * Update SearchClient.search API. * Update CHANGELOG and async SearchClient. * Update parameter parsing for omitted values. * Code review comments and linter fixes. --- .../azure-search-documents/CHANGELOG.md | 6 +++ .../azure/search/documents/_search_client.py | 45 ++++++++++++++---- .../documents/aio/_search_client_async.py | 47 +++++++++++++++---- 3 files changed, 80 insertions(+), 18 deletions(-) diff --git a/sdk/search/azure-search-documents/CHANGELOG.md b/sdk/search/azure-search-documents/CHANGELOG.md index dce720459dba..6d44c481b52e 100644 --- a/sdk/search/azure-search-documents/CHANGELOG.md +++ b/sdk/search/azure-search-documents/CHANGELOG.md @@ -4,8 +4,14 @@ ### Features Added +- Added properties to `SearchClient`: `query_answer`, `query_answer_count`, + `query_caption`, `query_caption_highlight` and `semantic_fields`. + ### Breaking Changes +- Renamed `SearchClient.speller` to `SearchClient.query_speller`. +- Removed keyword arguments from `SearchClient`: `answers` and `captions`. + ### Bugs Fixed ### Other Changes diff --git a/sdk/search/azure-search-documents/azure/search/documents/_search_client.py b/sdk/search/azure-search-documents/azure/search/documents/_search_client.py index 27853cd783cb..68a1e180bb42 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/_search_client.py +++ b/sdk/search/azure-search-documents/azure/search/documents/_search_client.py @@ -152,7 +152,7 @@ def get_document(self, key, selected_fields=None, **kwargs): return cast(dict, result) @distributed_trace - def search(self, search_text, **kwargs): + def search(self, search_text, **kwargs): # pylint:disable=too-many-locals # type: (str, **Any) -> SearchItemPaged[dict] """Search the Azure search index for documents. @@ -200,12 +200,23 @@ def search(self, search_text, **kwargs): :keyword query_language: A value that specifies the language of the search query. Possible values include: "none", "en-us". :paramtype query_language: str or ~azure.search.documents.models.QueryLanguage - :keyword speller: A value that specified the type of the speller to use to spell-correct + :keyword query_speller: A value that specified the type of the speller to use to spell-correct individual search query terms. Possible values include: "none", "lexicon". - :paramtype speller: str or ~azure.search.documents.models.Speller - :keyword answers: A value that specifies whether answers should be returned as part of the search - response. Possible values include: "none", "extractive". - :paramtype answers: str or ~azure.search.documents.models.Answers + :paramtype query_speller: str or ~azure.search.documents.models.Speller + :keyword query_answer: This parameter is only valid if the query type is 'semantic'. If set, + the query returns answers extracted from key passages in the highest ranked documents. + Possible values include: "none", "extractive". + :paramtype query_answer: str or ~azure.search.documents.models.Answers + :keyword int query_answer_count: This parameter is only valid if the query type is 'semantic' and + query answer is 'extractive'. Configures the number of answers returned. Default count is 1. + :keyword query_caption: This parameter is only valid if the query type is 'semantic'. If set, the + query returns captions extracted from key passages in the highest ranked documents. + Defaults to 'None'. Possible values include: "none", "extractive". + :paramtype query_caption: str or ~azure.search.documents.models.Captions + :keyword bool query_caption_highlight: This parameter is only valid if the query type is 'semantic' when + query caption is set to 'extractive'. Determines whether highlighting is enabled. + Defaults to 'true'. + :keyword list[str] semantic_fields: The list of field names used for semantic search. :keyword list[str] select: The list of fields to retrieve. If unspecified, all fields marked as retrievable in the schema are included. :keyword int skip: The number of search results to skip. This value cannot be greater than 100,000. @@ -259,11 +270,25 @@ def search(self, search_text, **kwargs): search_fields_str = ",".join(search_fields) if search_fields else None search_mode = kwargs.pop("search_mode", None) query_language = kwargs.pop("query_language", None) - speller = kwargs.pop("speller", None) - answers = kwargs.pop("answers", None) + query_speller = kwargs.pop("query_speller", None) select = kwargs.pop("select", None) skip = kwargs.pop("skip", None) top = kwargs.pop("top", None) + + query_answer = kwargs.pop("query_answer", None) + query_answer_count = kwargs.pop("query_answer_count", None) + answers = query_answer if not query_answer_count else '{}|count-{}'.format( + query_answer, query_answer_count + ) + + query_caption = kwargs.pop("query_caption", None) + query_caption_highlight = kwargs.pop("query_caption_highlight", None) + captions = query_caption if not query_caption_highlight else '{}|highlight-{}'.format( + query_caption, query_caption_highlight + ) + + semantic_fields = kwargs.pop("semantic_fields", None) + query = SearchQuery( search_text=search_text, include_total_result_count=include_total_result_count, @@ -280,8 +305,10 @@ def search(self, search_text, **kwargs): search_fields=search_fields_str, search_mode=search_mode, query_language=query_language, - speller=speller, + speller=query_speller, answers=answers, + captions=captions, + semantic_fields=",".join(semantic_fields) if semantic_fields else None, select=select if isinstance(select, six.string_types) else None, skip=skip, top=top, diff --git a/sdk/search/azure-search-documents/azure/search/documents/aio/_search_client_async.py b/sdk/search/azure-search-documents/azure/search/documents/aio/_search_client_async.py index 650b62dd1666..e7f66ca59ae0 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/aio/_search_client_async.py +++ b/sdk/search/azure-search-documents/azure/search/documents/aio/_search_client_async.py @@ -128,8 +128,9 @@ async def get_document(self, key, selected_fields=None, **kwargs): ) return cast(dict, result) + @distributed_trace_async - async def search(self, search_text, **kwargs): + async def search(self, search_text, **kwargs): # pylint:disable=too-many-locals # type: (str, **Any) -> AsyncSearchItemPaged[dict] """Search the Azure search index for documents. @@ -177,12 +178,24 @@ async def search(self, search_text, **kwargs): :keyword query_language: A value that specifies the language of the search query. Possible values include: "none", "en-us". :paramtype query_language: str or ~azure.search.documents.models.QueryLanguage - :keyword speller: A value that specified the type of the speller to use to spell-correct + :keyword query_speller: A value that specified the type of the speller to use to spell-correct individual search query terms. Possible values include: "none", "lexicon". - :paramtype speller: str or ~azure.search.documents.models.Speller - :keyword answers: A value that specifies whether answers should be returned as part of the search - response. Possible values include: "none", "extractive". - :paramtype answers: str or ~azure.search.documents.models.Answers + :paramtype query_speller: str or ~azure.search.documents.models.Speller + :keyword query_answer: This parameter is only valid if the query type is 'semantic'. If set, + the query returns answers extracted from key passages in the highest ranked documents. + Possible values include: "none", "extractive". + :paramtype query_answer: str or ~azure.search.documents.models.Answers + :keyword int query_answer_count: This parameter is only valid if the query type is 'semantic' and + query answer is 'extractive'. + Configures the number of answers returned. Default count is 1. + :keyword query_caption: This parameter is only valid if the query type is 'semantic'. If set, the + query returns captions extracted from key passages in the highest ranked documents. + Defaults to 'None'. Possible values include: "none", "extractive". + :paramtype query_caption: str or ~azure.search.documents.models.Captions + :keyword bool query_caption_highlight: This parameter is only valid if the query type is 'semantic' when + query caption is set to 'extractive'. Determines whether highlighting is enabled. + Defaults to 'true'. + :keyword list[str] semantic_fields: The list of field names used for semantic search. :keyword list[str] select: The list of fields to retrieve. If unspecified, all fields marked as retrievable in the schema are included. :keyword int skip: The number of search results to skip. This value cannot be greater than 100,000. @@ -236,11 +249,25 @@ async def search(self, search_text, **kwargs): search_fields_str = ",".join(search_fields) if search_fields else None search_mode = kwargs.pop("search_mode", None) query_language = kwargs.pop("query_language", None) - speller = kwargs.pop("speller", None) - answers = kwargs.pop("answers", None) + query_speller = kwargs.pop("query_speller", None) select = kwargs.pop("select", None) skip = kwargs.pop("skip", None) top = kwargs.pop("top", None) + + query_answer = kwargs.pop("query_answer", None) + query_answer_count = kwargs.pop("query_answer_count", None) + answers = query_answer if not query_answer_count else '{}|count-{}'.format( + query_answer, query_answer_count + ) + + query_caption = kwargs.pop("query_caption", None) + query_caption_highlight = kwargs.pop("query_caption_highlight", None) + captions = query_caption if not query_caption_highlight else '{}|highlight-{}'.format( + query_caption, query_caption_highlight + ) + + semantic_fields = kwargs.pop("semantic_fields", None) + query = SearchQuery( search_text=search_text, include_total_result_count=include_total_result_count, @@ -257,8 +284,10 @@ async def search(self, search_text, **kwargs): search_fields=search_fields_str, search_mode=search_mode, query_language=query_language, - speller=speller, + speller=query_speller, answers=answers, + captions=captions, + semantic_fields=",".join(semantic_fields) if semantic_fields else None, select=select if isinstance(select, six.string_types) else None, skip=skip, top=top, From 545036840224febeb29e8c1d0bd0d0175aef0d88 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Mon, 13 Sep 2021 09:21:54 -0700 Subject: [PATCH 42/85] Sync eng/common directory with azure-sdk-tools for PR 1983 (#20618) * Doc Updates and Revisions for External Use The focus of these changes is to revise the script to better support use by external contributors and others outside of the Azure SDK ecosystem and without access to the Microsoft AAD Tenant. Changes include: - Creation of a new Test Application service principal is now possible from a non-Microsoft AAD tenant. - When a new Test Application principal is created, the principle of least privilege is now applied; the new Test Application is granted ownership of the resource group associated with the test resources and no longer has access to any other resources in the subscription. - If an existing Test Application principal is specified, it will be assigned ownership of the resource group created. This supports using a Test Application principal without privileges at the subscription-level. - When no provisioner is specified, the script is now executed in the context of the caller rather than the Test Application principal. This supports using a Test Application principal that has restricted privileges and better aligns to the purpose of the Test Application principal. - The `$TestApplicationOid` is now explicitly bound at the time a new Test Application principal is created rather than having to query for it later. - Common error scenarios resulting from lack of permissions now provide messaging with more context of why the failure occurred and suggest remediation. - Added new examples to illustrate the common call patterns needed by external contributors running the script, outside of the Microsoft tenant and Azure SDK ecosystem. - Documentation has been enhanced with additional context to detail the permissions and roles assigned by the script. - Added documentation details for Bicep template use. * Add the provisioner OID to the deployment params Key Vault needs this to deploy Managed HSMs. There's a corresponding change necessary in test-resources.json I'll roll out across languages. * Fixing typos and spelling mistakes Co-authored-by: Jesse Squire Co-authored-by: Heath Stewart --- .../TestResources/New-TestResources.ps1 | 297 +++++++++++++----- .../TestResources/New-TestResources.ps1.md | 178 +++++++++-- eng/common/TestResources/README.md | 16 +- 3 files changed, 376 insertions(+), 115 deletions(-) diff --git a/eng/common/TestResources/New-TestResources.ps1 b/eng/common/TestResources/New-TestResources.ps1 index 508b9b693976..efb4796bc521 100644 --- a/eng/common/TestResources/New-TestResources.ps1 +++ b/eng/common/TestResources/New-TestResources.ps1 @@ -36,7 +36,7 @@ param ( [ValidateNotNullOrEmpty()] [string] $TenantId, - # Azure SDK Developer Playground subscription + # Azure SDK Developer Playground subscription is assumed if not set [Parameter()] [ValidatePattern('^[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}$')] [string] $SubscriptionId, @@ -279,46 +279,13 @@ try { if (!$TenantId) { $TenantId = $context.Subscription.TenantId } - - # If no test application ID is specified during an interactive session, create a new service principal. - if (!$TestApplicationId) { - - # Cache the created service principal in this session for frequent reuse. - $servicePrincipal = if ($AzureTestPrincipal -and (Get-AzADServicePrincipal -ApplicationId $AzureTestPrincipal.ApplicationId) -and $AzureTestSubscription -eq $SubscriptionId) { - Log "TestApplicationId was not specified; loading cached service principal '$($AzureTestPrincipal.ApplicationId)'" - $AzureTestPrincipal - } else { - Log "TestApplicationId was not specified; creating a new service principal in subscription '$SubscriptionId'" - $suffix = (New-Guid).ToString('n').Substring(0, 4) - $global:AzureTestPrincipal = New-AzADServicePrincipal -Role Owner -Scope "/subscriptions/$SubscriptionId" -DisplayName "test-resources-$($baseName)$suffix.microsoft.com" - $global:AzureTestSubscription = $SubscriptionId - - Log "Created service principal '$($AzureTestPrincipal.ApplicationId)'" - $AzureTestPrincipal - } - - $TestApplicationId = $servicePrincipal.ApplicationId - $TestApplicationSecret = (ConvertFrom-SecureString $servicePrincipal.Secret -AsPlainText); - - # Make sure pre- and post-scripts are passed formerly required arguments. - $PSBoundParameters['TestApplicationId'] = $TestApplicationId - $PSBoundParameters['TestApplicationSecret'] = $TestApplicationSecret - } - - if (!$ProvisionerApplicationId) { - $ProvisionerApplicationId = $TestApplicationId - $ProvisionerApplicationSecret = $TestApplicationSecret - $TenantId = $context.Tenant.Id - } } - # Log in as and run pre- and post-scripts as the provisioner service principal. + # If a provisioner service principal was provided, log into it to perform the pre- and post-scripts and deployments. if ($ProvisionerApplicationId) { $null = Disable-AzContextAutosave -Scope Process Log "Logging into service principal '$ProvisionerApplicationId'." - Write-Warning 'Logging into service principal may fail until the principal is fully propagated.' - $provisionerSecret = ConvertTo-SecureString -String $ProvisionerApplicationSecret -AsPlainText -Force $provisionerCredential = [System.Management.Automation.PSCredential]::new($ProvisionerApplicationId, $provisionerSecret) @@ -343,20 +310,25 @@ try { } } - # Get test application OID from ID if not already provided. - if ($TestApplicationId -and !$TestApplicationOid) { - $testServicePrincipal = Retry { - Get-AzADServicePrincipal -ApplicationId $TestApplicationId - } + # Determine the Azure context that the script is running in. + $context = Get-AzContext; - if ($testServicePrincipal -and $testServicePrincipal.Id) { - $script:TestApplicationOid = $testServicePrincipal.Id + # Make sure the provisioner OID is set so we can pass it through to the deployment. + $provisionerApplicationOid = if (!$ProvisionerApplicationId) { + if ($context.Account.Type -eq 'User') { + $user = Get-AzADUser -UserPrincipalName $context.Account.Id + $user.Id + } elseif ($context.Account.Type -eq 'ServicePrincipal') { + $sp = Get-AzADServicePrincipal -ApplicationId $context.Account.Id + $sp.Id + } else { + Write-Warning "Getting the OID for provisioner type '$($context.Account.Type)' is not supported and will not be passed to deployments (seldom required)." } + } else { + $sp = Get-AzADServicePrincipal -ApplicationId $ProvisionerApplicationId + $sp.Id } - # Determine the Azure context that the script is running in. - $context = Get-AzContext; - # If the ServiceDirectory is an absolute path use the last directory name # (e.g. D:\foo\bar\ -> bar) $serviceName = if (Split-Path -IsAbsolute $ServiceDirectory) { @@ -426,11 +398,88 @@ try { } } + # If no test application ID was specified during an interactive session, create a new service principal. + if (!$CI -and !$TestApplicationId) { + # Cache the created service principal in this session for frequent reuse. + $servicePrincipal = if ($AzureTestPrincipal -and (Get-AzADServicePrincipal -ApplicationId $AzureTestPrincipal.ApplicationId) -and $AzureTestSubscription -eq $SubscriptionId) { + Log "TestApplicationId was not specified; loading cached service principal '$($AzureTestPrincipal.ApplicationId)'" + $AzureTestPrincipal + } else { + Log "TestApplicationId was not specified; creating a new service principal in subscription '$SubscriptionId'" + $suffix = (New-Guid).ToString('n').Substring(0, 4) + + # Service principals in the Microsoft AAD tenant must end with an @microsoft.com domain; those in other tenants + # are not permitted to do so. Format the non-MS name so there's an assocation with the Azure SDK. + if ($TenantId -eq '72f988bf-86f1-41af-91ab-2d7cd011db47') { + $displayName = "test-resources-$($baseName)$suffix.microsoft.com" + } else { + $displayName = "$($baseName)$suffix.test-resources.azure.sdk" + } + + $servicePrincipal = Retry { + New-AzADServicePrincipal -Role "Owner" -Scope "/subscriptions/$SubscriptionId/resourceGroups/$ResourceGroupName" -DisplayName $displayName + } + + $global:AzureTestPrincipal = $servicePrincipal + $global:AzureTestSubscription = $SubscriptionId + + Log "Created service principal '$($AzureTestPrincipal.ApplicationId)'" + $AzureTestPrincipal + $resourceGroupRoleAssigned = $true + } + + $TestApplicationId = $servicePrincipal.ApplicationId + $TestApplicationOid = $servicePrincipal.Id + $TestApplicationSecret = (ConvertFrom-SecureString $servicePrincipal.Secret -AsPlainText) + } + + # Get test application OID from ID if not already provided. This may fail if the + # provisioner is a service principal without permissions to query AAD. This is a + # critical failure, but we should prompt with possible remediation. + if ($TestApplicationId -and !$TestApplicationOid) { + Log "Attempting to query the Object ID for the test service principal" + + try { + $testServicePrincipal = Retry { + Get-AzADServicePrincipal -ApplicationId $TestApplicationId + } + } + catch { + Write-Warning "The Object ID of the test application was unable to be queried. You may want to consider passing it explicitly with the 'TestApplicationOid` parameter." + throw $_.Exception + } + + if ($testServicePrincipal -and $testServicePrincipal.Id) { + $script:TestApplicationOid = $testServicePrincipal.Id + } + } + + # Make sure pre- and post-scripts are passed formerly required arguments. + $PSBoundParameters['TestApplicationId'] = $TestApplicationId + $PSBoundParameters['TestApplicationOid'] = $TestApplicationOid + $PSBoundParameters['TestApplicationSecret'] = $TestApplicationSecret + + # Grant the test service principal ownership over the resource group. This may fail if the provisioner is a + # service principal without permissions to grant RBAC roles to other service principals. That should not be + # considered a critical failure, as the test application may have subscription-level permissions and not require + # the explicit grant. + if (!$resourceGroupRoleAssigned) { + Log "Attempting to assigning the 'Owner' role for '$ResourceGroupName' to the Test Application '$TestApplicationId'" + $principalOwnerAssignment = New-AzRoleAssignment -RoleDefinitionName "Owner" -ApplicationId "$TestApplicationId" -ResourceGroupName "$ResourceGroupName" -ErrorAction SilentlyContinue + + if ($principalOwnerAssignment.RoleDefinitionName -eq 'Owner') { + Write-Verbose "Successfully assigned ownership of '$ResourceGroupName' to the Test Application '$TestApplicationId'" + } else { + Write-Warning "The 'Owner' role for '$ResourceGroupName' could not be assigned. You may need to manually grant 'Owner' for the resource group to the Test Application '$TestApplicationId' if it does not have subscription-level permissions." + } + } + # Populate the template parameters and merge any additional specified. $templateParameters = @{ baseName = $BaseName testApplicationId = $TestApplicationId testApplicationOid = "$TestApplicationOid" + provisionerApplicationOid = "$provisionerApplicationOid" } if ($TenantId) { @@ -484,7 +533,7 @@ try { "Deployment template $($templateFile.jsonFilePath) to resource group $($resourceGroup.ResourceGroupName)" } Log $msg - + $deployment = Retry { $lastDebugPreference = $DebugPreference try { @@ -609,22 +658,23 @@ if ($CI) { Deploys live test resources defined for a service directory to Azure. .DESCRIPTION -Deploys live test resouces specified in test-resources.json files to a resource -group. +Deploys live test resouces specified in test-resources.json or test-resources.bicep +files to a new resource group. This script searches the directory specified in $ServiceDirectory recursively -for files named test-resources.json. All found test-resources.json files will be -deployed to the test resource group. +for files named test-resources.json or test-resources.bicep. All found test-resources.json +and test-resources.bicep files will be deployed to the test resource group. -If no test-resources.json files are located the script exits without making -changes to the Azure environment. +If no test-resources.json or test-resources.bicep files are located the script +exits without making changes to the Azure environment. -A service principal must first be created before this script is run and passed -to $TestApplicationId and $TestApplicationSecret. Test resources will grant this -service principal access. +A service principal may optionally be passed to $TestApplicationId and $TestApplicationSecret. +Test resources will grant this service principal access to the created resources. +If no service principal is specified, a new one will be created and assigned the +'Owner' role for the resource group associated with the test resources. -This script uses credentials already specified in Connect-AzAccount or those -specified in $ProvisionerApplicationId and $ProvisionerApplicationSecret. +This script runs in the context of credentials already specified in Connect-AzAccount +or those specified in $ProvisionerApplicationId and $ProvisionerApplicationSecret. .PARAMETER BaseName A name to use in the resource group and passed to the ARM template as 'baseName'. @@ -636,16 +686,28 @@ by New-TestResources.ps1 if $CI is specified. .PARAMETER ResourceGroupName Set this value to deploy directly to a Resource Group that has already been -created. +created or to create a new resource group with this name. + +If not specified, the $BaseName will be used to generate name for the resource +group that will be created. .PARAMETER ServiceDirectory A directory under 'sdk' in the repository root - optionally with subdirectories -specified - in which to discover ARM templates named 'test-resources.json'. -This can also be an absolute path or specify parent directories. +specified - in which to discover ARM templates named 'test-resources.json' and +Bicep templates named 'test-resources.bicep'. This can also be an absolute path +or specify parent directories. .PARAMETER TestApplicationId -The AAD Application ID to authenticate the test runner against deployed -resources. Passed to the ARM template as 'testApplicationId'. +Optional Azure Active Directory Application ID to authenticate the test runner +against deployed resources. Passed to the ARM template as 'testApplicationId'. + +If not specified, a new AAD Application will be created and assigned the 'Owner' +role for the resource group associated with the test resources. No permissions +will be granted to the subscription or other resources. + +For those specifying a Provisioner Application principal as 'ProvisionerApplicationId', +it will need the permission 'Application.ReadWrite.OwnedBy' for the Microsoft Graph API +in order to create the Test Application principal. This application is used by the test runner to execute tests against the live test resources. @@ -659,18 +721,24 @@ This application is used by the test runner to execute tests against the live test resources. .PARAMETER TestApplicationOid -Service Principal Object ID of the AAD Test application. This is used to assign +Service Principal Object ID of the AAD Test Application. This is used to assign permissions to the AAD application so it can access tested features on the live test resources (e.g. Role Assignments on resources). It is passed as to the ARM template as 'testApplicationOid' +If not specified, an attempt will be made to query it from the Azure Active Directory +tenant. For those specifying a service principal as 'ProvisionerApplicationId', +it will need the permission 'Application.Read.All' for the Microsoft Graph API +in order to query AAD. + For more information on the relationship between AAD Applications and Service Principals see: https://docs.microsoft.com/azure/active-directory/develop/app-objects-and-service-principals .PARAMETER TenantId The tenant ID of a service principal when a provisioner is specified. The same -Tenant ID is used for Test Application and Provisioner Application. This value -is passed to the ARM template as 'tenantId'. +Tenant ID is used for Test Application and Provisioner Application. + +This value is passed to the ARM template as 'tenantId'. .PARAMETER SubscriptionId Optional subscription ID to use for new resources when logging in as a @@ -683,10 +751,22 @@ Once you are logged in (or were previously), the selected SubscriptionId will be used for subsequent operations that are specific to a subscription. .PARAMETER ProvisionerApplicationId -The AAD Application ID used to provision test resources when a provisioner is -specified. +Optional Application ID of the Azure Active Directory service principal to use for +provisioning the test resources. If not, specified New-TestResources.ps1 uses the +context of the caller to provision. + +If specified, the Provisioner Application principal would benefit from the following +permissions to the Microsoft Graph API: + + - 'Application.Read.All' in order to query AAD to obtain the 'TestApplicaitonOid' + + - 'Application.ReadWrite.OwnedBy' in order to create the Test Application principal + or grant an existing principal ownership of the resource group associated with + the test resources. -If none is specified New-TestResources.ps1 uses the TestApplicationId. +If the provisioner does not have these permissions, it can still be used with +New-TestResources.ps1 by specifying an existing Test Application principal, including +its Object ID, and managing permissions to the resource group manually. This value is not passed to the ARM template. @@ -694,8 +774,6 @@ This value is not passed to the ARM template. A service principal secret (password) used to provision test resources when a provisioner is specified. -If none is specified New-TestResources.ps1 uses the TestApplicationSecret. - This value is not passed to the ARM template. .PARAMETER DeleteAfterHours @@ -718,7 +796,7 @@ is based on the cloud to which the template is being deployed: * Dogfood -> 'westus' .PARAMETER Environment -Name of the cloud environment. The default is the Azure Public Cloud +Optional name of the cloud environment. The default is the Azure Public Cloud ('AzureCloud') .PARAMETER AdditionalParameters @@ -738,15 +816,84 @@ Deployment (CI/CD) build (only Azure Pipelines is currently supported). Force creation of resources instead of being prompted. .PARAMETER OutFile -Save test environment settings into a test-resources.json.env file next to test-resources.json. File is protected via DPAPI. Supported only on windows. -The environment file would be scoped to the current repository directory. +Save test environment settings into a .env file next to test resources template. +The contents of the file are protected via the .NET Data Protection API (DPAPI). +This is supported only on Windows. The environment file is scoped to the current +service directory. + +The environment file will be named for the test resources template that it was +generated for. For ARM templates, it will be test-resources.json.env. For +Bicep templates, test-resources.bicep.env. .EXAMPLE Connect-AzAccount -Subscription 'REPLACE_WITH_SUBSCRIPTION_ID' New-TestResources.ps1 keyvault -Run this in a desktop environment to create new AAD apps and Service Principals -that can be used to provision resources and run live tests. +Run this in a desktop environment to create a new AAD application and Service Principal +for running live tests against the test resources created. The principal will have ownership +rights to the resource group and the resources that it contains, but no other resources in +the subscription. + +Requires PowerShell 7 to use ConvertFrom-SecureString -AsPlainText or convert +the SecureString to plaintext by another means. + +.EXAMPLE +Connect-AzAccount -Subscription 'REPLACE_WITH_SUBSCRIPTION_ID' +New-TestResources.ps1 ` + -BaseName 'azsdk' ` + -ServiceDirectory 'keyvault' ` + -SubscriptionId 'REPLACE_WITH_SUBSCRIPTION_ID' ` + -ResourceGroupName 'REPLACE_WITH_NAME_FOR_RESOURCE_GROUP' ` + -Location 'eastus' + +Run this in a desktop environment to specify the name and location of the resource +group that test resources are being deployed to. This will also create a new AAD +application and Service Principal for running live tests against the rest resources +created. The principal will have ownership rights to the resource group and the +resources that it contains, but no other resources in the subscription. + +Requires PowerShell 7 to use ConvertFrom-SecureString -AsPlainText or convert +the SecureString to plaintext by another means. + +.EXAMPLE +Connect-AzAccount -Subscription 'REPLACE_WITH_SUBSCRIPTION_ID' +New-TestResources.ps1 ` + -BaseName 'azsdk' ` + -ServiceDirectory 'keyvault' ` + -SubscriptionId 'REPLACE_WITH_SUBSCRIPTION_ID' ` + -ResourceGroupName 'REPLACE_WITH_NAME_FOR_RESOURCE_GROUP' ` + -Location 'eastus' ` + -TestApplicationId 'REPLACE_WITH_TEST_APPLICATION_ID' ` + -TestApplicationSecret 'REPLACE_WITH_TEST_APPLICATION_SECRET' + +Run this in a desktop environment to specify the name and location of the resource +group that test resources are being deployed to. This will grant ownership rights +to the 'TestApplicationId' for the resource group and the resources that it contains, +without altering its existing permissions. + +.EXAMPLE +New-TestResources.ps1 ` + -BaseName 'azsdk' ` + -ServiceDirectory 'keyvault' ` + -SubscriptionId 'REPLACE_WITH_SUBSCRIPTION_ID' ` + -ResourceGroupName 'REPLACE_WITH_NAME_FOR_RESOURCE_GROUP' ` + -Location 'eastus' ` + -ProvisionerApplicationId 'REPLACE_WITH_PROVISIONER_APPLICATION_ID' ` + -ProvisionerApplicationSecret 'REPLACE_WITH_PROVISIONER_APPLICATION_ID' ` + -TestApplicationId 'REPLACE_WITH_TEST_APPLICATION_ID' ` + -TestApplicationOid 'REPLACE_WITH_TEST_APPLICATION_OBJECT_ID' ` + -TestApplicationSecret 'REPLACE_WITH_TEST_APPLICATION_SECRET' + +Run this in a desktop environment to specify the name and location of the resource +group that test resources are being deployed to. The script will be executed in the +context of the 'ProvisionerApplicationId' rather than the caller. + +Depending on the permissions of the Provisioner Application principal, the script may +grant ownership rights 'TestApplicationId' for the resource group and the resources +that it contains, or may emit a message indicating that it was unable to perform the grant. + +For the Provisioner Application principal to perform the grant, it will need the +permission 'Application.ReadWrite.OwnedBy' for the Microsoft Graph API. Requires PowerShell 7 to use ConvertFrom-SecureString -AsPlainText or convert the SecureString to plaintext by another means. diff --git a/eng/common/TestResources/New-TestResources.ps1.md b/eng/common/TestResources/New-TestResources.ps1.md index b27dfba8c81a..fd96e71cfdf9 100644 --- a/eng/common/TestResources/New-TestResources.ps1.md +++ b/eng/common/TestResources/New-TestResources.ps1.md @@ -32,24 +32,24 @@ New-TestResources.ps1 [-BaseName ] [-ResourceGroupName ] [-Servi ``` ## DESCRIPTION -Deploys live test resouces specified in test-resources.json files to a resource -group. +Deploys live test resouces specified in test-resources.json or test-resources.bicep +files to a new resource group. This script searches the directory specified in $ServiceDirectory recursively -for files named test-resources.json. -All found test-resources.json files will be -deployed to the test resource group. +for files named test-resources.json or test-resources.bicep. +All found test-resources.json +and test-resources.bicep files will be deployed to the test resource group. -If no test-resources.json files are located the script exits without making -changes to the Azure environment. +If no test-resources.json or test-resources.bicep files are located the script +exits without making changes to the Azure environment. -A service principal must first be created before this script is run and passed -to $TestApplicationId and $TestApplicationSecret. -Test resources will grant this -service principal access. +A service principal may optionally be passed to $TestApplicationId and $TestApplicationSecret. +Test resources will grant this service principal access to the created resources. +If no service principal is specified, a new one will be created and assigned the +'Owner' role for the resource group associated with the test resources. -This script uses credentials already specified in Connect-AzAccount or those -specified in $ProvisionerApplicationId and $ProvisionerApplicationSecret. +This script runs in the context of credentials already specified in Connect-AzAccount +or those specified in $ProvisionerApplicationId and $ProvisionerApplicationSecret. ## EXAMPLES @@ -59,14 +59,88 @@ Connect-AzAccount -Subscription 'REPLACE_WITH_SUBSCRIPTION_ID' New-TestResources.ps1 keyvault ``` -Run this in a desktop environment to create new AAD apps and Service Principals -that can be used to provision resources and run live tests. +Run this in a desktop environment to create a new AAD application and Service Principal +for running live tests against the test resources created. +The principal will have ownership +rights to the resource group and the resources that it contains, but no other resources in +the subscription. Requires PowerShell 7 to use ConvertFrom-SecureString -AsPlainText or convert the SecureString to plaintext by another means. ### EXAMPLE 2 ``` +Connect-AzAccount -Subscription 'REPLACE_WITH_SUBSCRIPTION_ID' +New-TestResources.ps1 ` + -BaseName 'azsdk' ` + -ServiceDirectory 'keyvault' ` + -SubscriptionId 'REPLACE_WITH_SUBSCRIPTION_ID' ` + -ResourceGroupName 'REPLACE_WITH_NAME_FOR_RESOURCE_GROUP' ` + -Location 'eastus' +``` + +Run this in a desktop environment to specify the name and location of the resource +group that test resources are being deployed to. +This will also create a new AAD +application and Service Principal for running live tests against the rest resources +created. +The principal will have ownership rights to the resource group and the +resources that it contains, but no other resources in the subscription. + +Requires PowerShell 7 to use ConvertFrom-SecureString -AsPlainText or convert +the SecureString to plaintext by another means. + +### EXAMPLE 3 +``` +Connect-AzAccount -Subscription 'REPLACE_WITH_SUBSCRIPTION_ID' +New-TestResources.ps1 ` + -BaseName 'azsdk' ` + -ServiceDirectory 'keyvault' ` + -SubscriptionId 'REPLACE_WITH_SUBSCRIPTION_ID' ` + -ResourceGroupName 'REPLACE_WITH_NAME_FOR_RESOURCE_GROUP' ` + -Location 'eastus' ` + -TestApplicationId 'REPLACE_WITH_TEST_APPLICATION_ID' ` + -TestApplicationSecret 'REPLACE_WITH_TEST_APPLICATION_SECRET' +``` + +Run this in a desktop environment to specify the name and location of the resource +group that test resources are being deployed to. +This will grant ownership rights +to the 'TestApplicationId' for the resource group and the resources that it contains, +without altering its existing permissions. + +### EXAMPLE 4 +``` +New-TestResources.ps1 ` + -BaseName 'azsdk' ` + -ServiceDirectory 'keyvault' ` + -SubscriptionId 'REPLACE_WITH_SUBSCRIPTION_ID' ` + -ResourceGroupName 'REPLACE_WITH_NAME_FOR_RESOURCE_GROUP' ` + -Location 'eastus' ` + -ProvisionerApplicationId 'REPLACE_WITH_PROVISIONER_APPLICATION_ID' ` + -ProvisionerApplicationSecret 'REPLACE_WITH_PROVISIONER_APPLICATION_ID' ` + -TestApplicationId 'REPLACE_WITH_TEST_APPLICATION_ID' ` + -TestApplicationOid 'REPLACE_WITH_TEST_APPLICATION_OBJECT_ID' ` + -TestApplicationSecret 'REPLACE_WITH_TEST_APPLICATION_SECRET' +``` + +Run this in a desktop environment to specify the name and location of the resource +group that test resources are being deployed to. +The script will be executed in the +context of the 'ProvisionerApplicationId' rather than the caller. + +Depending on the permissions of the Provisioner Application principal, the script may +grant ownership rights 'TestApplicationId' for the resource group and the resources +that it contains, or may emit a message indicating that it was unable to perform the grant. + +For the Provisioner Application principal to perform the grant, it will need the +permission 'Application.ReadWrite.OwnedBy' for the Microsoft Graph API. + +Requires PowerShell 7 to use ConvertFrom-SecureString -AsPlainText or convert +the SecureString to plaintext by another means. + +### EXAMPLE 5 +``` New-TestResources.ps1 ` -BaseName 'Generated' ` -ServiceDirectory '$(ServiceDirectory)' ` @@ -111,7 +185,10 @@ Accept wildcard characters: False ### -ResourceGroupName Set this value to deploy directly to a Resource Group that has already been -created. +created or to create a new resource group with this name. + +If not specified, the $BaseName will be used to generate name for the resource +group that will be created. ```yaml Type: String @@ -127,8 +204,10 @@ Accept wildcard characters: False ### -ServiceDirectory A directory under 'sdk' in the repository root - optionally with subdirectories -specified - in which to discover ARM templates named 'test-resources.json'. -This can also be an absolute path or specify parent directories. +specified - in which to discover ARM templates named 'test-resources.json' and +Bicep templates named 'test-resources.bicep'. +This can also be an absolute path +or specify parent directories. ```yaml Type: String @@ -143,10 +222,19 @@ Accept wildcard characters: False ``` ### -TestApplicationId -The AAD Application ID to authenticate the test runner against deployed -resources. +Optional Azure Active Directory Application ID to authenticate the test runner +against deployed resources. Passed to the ARM template as 'testApplicationId'. +If not specified, a new AAD Application will be created and assigned the 'Owner' +role for the resource group associated with the test resources. +No permissions +will be granted to the subscription or other resources. + +For those specifying a Provisioner Application principal as 'ProvisionerApplicationId', +it will need the permission 'Application.ReadWrite.OwnedBy' for the Microsoft Graph API +in order to create the Test Application principal. + This application is used by the test runner to execute tests against the live test resources. @@ -184,7 +272,7 @@ Accept wildcard characters: False ``` ### -TestApplicationOid -Service Principal Object ID of the AAD Test application. +Service Principal Object ID of the AAD Test Application. This is used to assign permissions to the AAD application so it can access tested features on the live test resources (e.g. @@ -192,6 +280,12 @@ Role Assignments on resources). It is passed as to the ARM template as 'testApplicationOid' +If not specified, an attempt will be made to query it from the Azure Active Directory +tenant. +For those specifying a service principal as 'ProvisionerApplicationId', +it will need the permission 'Application.Read.All' for the Microsoft Graph API +in order to query AAD. + For more information on the relationship between AAD Applications and Service Principals see: https://docs.microsoft.com/azure/active-directory/develop/app-objects-and-service-principals @@ -211,8 +305,8 @@ Accept wildcard characters: False The tenant ID of a service principal when a provisioner is specified. The same Tenant ID is used for Test Application and Provisioner Application. -This value -is passed to the ARM template as 'tenantId'. + +This value is passed to the ARM template as 'tenantId'. ```yaml Type: String @@ -250,10 +344,23 @@ Accept wildcard characters: False ``` ### -ProvisionerApplicationId -The AAD Application ID used to provision test resources when a provisioner is -specified. +Optional Application ID of the Azure Active Directory service principal to use for +provisioning the test resources. +If not, specified New-TestResources.ps1 uses the +context of the caller to provision. -If none is specified New-TestResources.ps1 uses the TestApplicationId. +If specified, the Provisioner Application principal would benefit from the following +permissions to the Microsoft Graph API: + + - 'Application.Read.All' in order to query AAD to obtain the 'TestApplicaitonOid' + + - 'Application.ReadWrite.OwnedBy' in order to create the Test Application principal + or grant an existing principal ownership of the resource group associated with + the test resources. + +If the provisioner does not have these permissions, it can still be used with +New-TestResources.ps1 by specifying an existing Test Application principal, including +its Object ID, and managing permissions to the resource group manually. This value is not passed to the ARM template. @@ -273,8 +380,6 @@ Accept wildcard characters: False A service principal secret (password) used to provision test resources when a provisioner is specified. -If none is specified New-TestResources.ps1 uses the TestApplicationSecret. - This value is not passed to the ARM template. ```yaml @@ -335,7 +440,7 @@ Accept wildcard characters: False ``` ### -Environment -Name of the cloud environment. +Optional name of the cloud environment. The default is the Azure Public Cloud ('AzureCloud') @@ -428,10 +533,17 @@ Accept wildcard characters: False ``` ### -OutFile -Save test environment settings into a test-resources.json.env file next to test-resources.json. -File is protected via DPAPI. -Supported only on windows. -The environment file would be scoped to the current repository directory. +Save test environment settings into a .env file next to test resources template. +The contents of the file are protected via the .NET Data Protection API (DPAPI). +This is supported only on Windows. +The environment file is scoped to the current +service directory. + +The environment file will be named for the test resources template that it was +generated for. +For ARM templates, it will be test-resources.json.env. +For +Bicep templates, test-resources.bicep.env. ```yaml Type: SwitchParameter diff --git a/eng/common/TestResources/README.md b/eng/common/TestResources/README.md index 59779f9f9898..8463501c0f9a 100644 --- a/eng/common/TestResources/README.md +++ b/eng/common/TestResources/README.md @@ -1,8 +1,8 @@ # Live Test Resource Management Running and recording live tests often requires first creating some resources -in Azure. Service directories that include a test-resources.json file require -running [New-TestResources.ps1][] to create these resources and output +in Azure. Service directories that include a `test-resources.json` or `test-resources.bicep` +file require running [New-TestResources.ps1][] to create these resources and output environment variables you must set. The following scripts can be used both in on your desktop for developer @@ -19,9 +19,10 @@ scenarios as well as on hosted agents for continuous integration testing. ## On the Desktop To set up your Azure account to run live tests, you'll need to log into Azure, -and set up your resources defined in test-resources.json as shown in the following -example using Azure Key Vault. The script will create a service principal automatically, -or you may create a service principal you can save and reuse subsequently. +and create the resources defined in your `test-resources.json` or `test-resources.bicep` +template as shown in the following example using Azure Key Vault. The script will create +a service principal automatically, or you may create a service principal that can be reused +subsequently. Note that `-Subscription` is an optional parameter but recommended if your account is a member of multiple subscriptions. If you didn't specify it when logging in, @@ -33,8 +34,9 @@ Connect-AzAccount -Subscription 'YOUR SUBSCRIPTION ID' eng\common\TestResources\New-TestResources.ps1 keyvault ``` -The `OutFile` switch will be set by default if you are running this for a .NET project on Windows. This will save test environment settings -into a test-resources.json.env file next to test-resources.json. The file is protected via DPAPI. +The `OutFile` switch will be set by default if you are running this for a .NET project on Windows. +This will save test environment settings into a `test-resources.json.env` file next to `test-resources.json` +or a `test-resources.bicep.env` file next to `test-resources.bicep`. The file is protected via DPAPI. The environment file would be scoped to the current repository directory and avoids the need to set environment variables or restart your IDE to recognize them. From 8f28e2af65868850f16fcf70b2dfeb118484451c Mon Sep 17 00:00:00 2001 From: Leighton Chen Date: Mon, 13 Sep 2021 10:37:18 -0700 Subject: [PATCH 43/85] [Monitor exporter] Add OTLP and dual exporter scenario to samples (#20634) * rpc * samples --- .../samples/traces/README.md | 55 +++++++++++++++++++ .../traces/collector/docker-compose.yml | 18 ++++++ .../collector/otel-collector-config.yaml | 21 +++++++ .../traces/collector/sample_collector.py | 35 ++++++++++++ .../samples/traces/sample_jaeger.py | 37 +++++++++++++ 5 files changed, 166 insertions(+) create mode 100644 sdk/monitor/azure-monitor-opentelemetry-exporter/samples/traces/collector/docker-compose.yml create mode 100644 sdk/monitor/azure-monitor-opentelemetry-exporter/samples/traces/collector/otel-collector-config.yaml create mode 100644 sdk/monitor/azure-monitor-opentelemetry-exporter/samples/traces/collector/sample_collector.py create mode 100644 sdk/monitor/azure-monitor-opentelemetry-exporter/samples/traces/sample_jaeger.py diff --git a/sdk/monitor/azure-monitor-opentelemetry-exporter/samples/traces/README.md b/sdk/monitor/azure-monitor-opentelemetry-exporter/samples/traces/README.md index bee877a49cf8..d47b1327cf86 100644 --- a/sdk/monitor/azure-monitor-opentelemetry-exporter/samples/traces/README.md +++ b/sdk/monitor/azure-monitor-opentelemetry-exporter/samples/traces/README.md @@ -14,6 +14,7 @@ These code samples show common champion scenario operations with the AzureMonito * Azure Service Bus Receive: [sample_servicebus_receive.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/monitor/azure-monitor-opentelemetry-exporter/samples/traces/sample_servicebus_receive.py) * Azure Storage Blob Create Container: [sample_storage.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/monitor/azure-monitor-opentelemetry-exporter/samples/traces/sample_storage.py) * Client: [sample_client.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/monitor/azure-monitor-opentelemetry-exporter/samples/traces/sample_client.py) +* Jaeger: [sample_jaeger.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/monitor/azure-monitor-opentelemetry-exporter/samples/traces/sample_jaeger.py) * Trace: [sample_trace.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/monitor/azure-monitor-opentelemetry-exporter/samples/traces/sample_trace.py) * Server: [sample_server.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/monitor/azure-monitor-opentelemetry-exporter/samples/traces/sample_server.py) @@ -63,6 +64,60 @@ $ python sample_server.py * Open http://localhost:8080/ +### Jaeger + +* The Jaeger project provides an all-in-one Docker container with a UI, database, and consumer. Run the following command to start Jaeger: + +```sh +$ docker run -p 16686:16686 -p 6831:6831/udp jaegertracing/all-in-one +``` + +* This command starts Jaeger locally on port 16686 and exposes the Jaeger thrift agent on port 6831. You can visit Jaeger at http://localhost:16686. + +* Install the OpenTelemetry Jaeger Exporter + +```sh +$ pip install opentelemetry-exporter-jaeger +``` + +* Update `APPLICATIONINSIGHTS_CONNECTION_STRING` environment variable + +* Run the sample + +```sh +$ # from this directory +$ python sample_jaeger.py +``` + +* You should be able to see your traces in the Jaeger backend as well as Azure Monitor application insights backend. + +### Collector + +* Start the Collector locally to see how the Collector works in practice. + +* From the same folder as collector/otel-collector-config.yaml and collector/docker-compose.yml, start the Docker container. + +```sh +$ docker-compose up +``` + +* Install the OpenTelemetry OTLP Exporter + +```sh +$ pip install opentelemetry-exporter-otlp +``` + +* Update `APPLICATIONINSIGHTS_CONNECTION_STRING` environment variable + +* Run the sample + +```sh +# from collector directory +$ python sample_collector.py +``` + +* You should be able to see your traces in the Zipkin backend as well as Azure Monitor application insights backend. + ### Azure Service Bus Send The following sample assumes that you have setup an Azure Service Bus [namespace](https://docs.microsoft.com/azure/service-bus-messaging/service-bus-quickstart-portal). diff --git a/sdk/monitor/azure-monitor-opentelemetry-exporter/samples/traces/collector/docker-compose.yml b/sdk/monitor/azure-monitor-opentelemetry-exporter/samples/traces/collector/docker-compose.yml new file mode 100644 index 000000000000..711b913453e8 --- /dev/null +++ b/sdk/monitor/azure-monitor-opentelemetry-exporter/samples/traces/collector/docker-compose.yml @@ -0,0 +1,18 @@ +version: "2" +services: + + # Zipkin + zipkin-all-in-one: + image: openzipkin/zipkin:latest + ports: + - "9411:9411" + + otel-collector: + image: otel/opentelemetry-collector:latest + command: ["--config=/etc/otel-collector-config.yaml", "${OTELCOL_ARGS}"] + volumes: + - ./otel-collector-config.yaml:/etc/otel-collector-config.yaml + ports: + - "4317:4317" # OTLP gRPC receiver + depends_on: + - zipkin-all-in-one diff --git a/sdk/monitor/azure-monitor-opentelemetry-exporter/samples/traces/collector/otel-collector-config.yaml b/sdk/monitor/azure-monitor-opentelemetry-exporter/samples/traces/collector/otel-collector-config.yaml new file mode 100644 index 000000000000..9613f66ada52 --- /dev/null +++ b/sdk/monitor/azure-monitor-opentelemetry-exporter/samples/traces/collector/otel-collector-config.yaml @@ -0,0 +1,21 @@ +receivers: + otlp: + protocols: + grpc: + http: +exporters: + logging: + loglevel: debug + + zipkin: + endpoint: "http://zipkin-all-in-one:9411/api/v2/spans" + format: proto + +processors: + batch: +service: + pipelines: + traces: + receivers: [otlp] + exporters: [logging, zipkin] + processors: [batch] diff --git a/sdk/monitor/azure-monitor-opentelemetry-exporter/samples/traces/collector/sample_collector.py b/sdk/monitor/azure-monitor-opentelemetry-exporter/samples/traces/collector/sample_collector.py new file mode 100644 index 000000000000..a042c120eb48 --- /dev/null +++ b/sdk/monitor/azure-monitor-opentelemetry-exporter/samples/traces/collector/sample_collector.py @@ -0,0 +1,35 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +""" +An example to show an application using Opentelemetry tracing api and sdk with the OpenTelemetry Collector +and the Azure monitor exporter. +Telemetry is exported to application insights with the AzureMonitorTraceExporter and Zipkin with the +OTLP Span exporter. +""" +import os +from opentelemetry import trace + +from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter +from opentelemetry.sdk.resources import SERVICE_NAME, Resource +from opentelemetry.sdk.trace import TracerProvider +from opentelemetry.sdk.trace.export import BatchSpanProcessor + +from azure.monitor.opentelemetry.exporter import AzureMonitorTraceExporter + +trace.set_tracer_provider( + TracerProvider( + resource=Resource.create({SERVICE_NAME: "my-zipkin-service"}) + ) +) +tracer = trace.get_tracer(__name__) + +exporter = AzureMonitorTraceExporter.from_connection_string( + os.environ["APPLICATIONINSIGHTS_CONNECTION_STRING"] +) +otlp_exporter = OTLPSpanExporter(endpoint="http://localhost:4317") +span_processor = BatchSpanProcessor(otlp_exporter) +trace.get_tracer_provider().add_span_processor(span_processor) + +with tracer.start_as_current_span("test"): + print("Hello world!") +input(...) \ No newline at end of file diff --git a/sdk/monitor/azure-monitor-opentelemetry-exporter/samples/traces/sample_jaeger.py b/sdk/monitor/azure-monitor-opentelemetry-exporter/samples/traces/sample_jaeger.py new file mode 100644 index 000000000000..ae6a4f43e764 --- /dev/null +++ b/sdk/monitor/azure-monitor-opentelemetry-exporter/samples/traces/sample_jaeger.py @@ -0,0 +1,37 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +""" +An example to show an application using Opentelemetry tracing api and sdk with multiple exporters. +Telemetry is exported to application insights with the AzureMonitorTraceExporter and Jaeger backend with the JaegerExporter. +""" +import os +from opentelemetry import trace +from opentelemetry.exporter.jaeger.thrift import JaegerExporter +from opentelemetry.sdk.resources import SERVICE_NAME, Resource +from opentelemetry.sdk.trace import TracerProvider +from opentelemetry.sdk.trace.export import BatchSpanProcessor + +from azure.monitor.opentelemetry.exporter import AzureMonitorTraceExporter + + +exporter = AzureMonitorTraceExporter.from_connection_string( + os.environ["APPLICATIONINSIGHTS_CONNECTION_STRING"] +) + +jaeger_exporter = JaegerExporter( + agent_host_name="localhost", + agent_port=6831, +) + +# Service name needs to be populated for Jaeger to see traces +trace.set_tracer_provider( + TracerProvider( + resource=Resource.create({SERVICE_NAME: "my-jaeger-service"}) + ) +) +tracer = trace.get_tracer(__name__) +span_processor = BatchSpanProcessor(exporter) +trace.get_tracer_provider().add_span_processor(span_processor) + +with tracer.start_as_current_span("hello"): + print("Hello, World!") From 7b2aeafa05a857a663c18e80c8eb93cfc0779935 Mon Sep 17 00:00:00 2001 From: swathipil <76007337+swathipil@users.noreply.github.com> Date: Mon, 13 Sep 2021 10:47:42 -0700 Subject: [PATCH 44/85] [EventHubs] update test to test async producer (#19892) - call async Producer for testing/improving code coverage - remove passing in fake kwarg to PartitionContext; untested lines in PartitionContext can only be tested with a user implemented CheckpointStore class, so not worrying about this --- .../asynctests/test_consumer_client_async.py | 2 +- .../livetest/asynctests/test_receive_async.py | 15 +++++++++++++-- .../livetest/synctests/test_consumer_client.py | 2 +- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/sdk/eventhub/azure-eventhub/tests/livetest/asynctests/test_consumer_client_async.py b/sdk/eventhub/azure-eventhub/tests/livetest/asynctests/test_consumer_client_async.py index 41c2a950b629..0ff6ae711cbf 100644 --- a/sdk/eventhub/azure-eventhub/tests/livetest/asynctests/test_consumer_client_async.py +++ b/sdk/eventhub/azure-eventhub/tests/livetest/asynctests/test_consumer_client_async.py @@ -16,7 +16,7 @@ async def test_receive_no_partition_async(connstr_senders): async def on_event(partition_context, event): on_event.received += 1 - await partition_context.update_checkpoint(event, fake_kwarg="arg") # ignores fake_kwarg + await partition_context.update_checkpoint(event) on_event.namespace = partition_context.fully_qualified_namespace on_event.eventhub_name = partition_context.eventhub_name on_event.consumer_group = partition_context.consumer_group diff --git a/sdk/eventhub/azure-eventhub/tests/livetest/asynctests/test_receive_async.py b/sdk/eventhub/azure-eventhub/tests/livetest/asynctests/test_receive_async.py index cd7de4f46037..6fb153052023 100644 --- a/sdk/eventhub/azure-eventhub/tests/livetest/asynctests/test_receive_async.py +++ b/sdk/eventhub/azure-eventhub/tests/livetest/asynctests/test_receive_async.py @@ -10,7 +10,7 @@ from azure.eventhub import EventData, TransportType from azure.eventhub.exceptions import EventHubError -from azure.eventhub.aio import EventHubConsumerClient +from azure.eventhub.aio import EventHubProducerClient, EventHubConsumerClient @pytest.mark.liveTest @@ -30,16 +30,27 @@ async def on_event(partition_context, event): on_event.called = False connection_str, senders = connstr_senders + # test async producer client + producer_client = EventHubProducerClient.from_connection_string(connection_str) + partitions = await producer_client.get_partition_ids() + senders = [] + for p in partitions: + sender = producer_client._create_producer(partition_id=p) + senders.append(sender) + client = EventHubConsumerClient.from_connection_string(connection_str, consumer_group='$default') async with client: task = asyncio.ensure_future(client.receive(on_event, partition_id="0", starting_position="@latest")) await asyncio.sleep(10) assert on_event.called is False - senders[0].send(EventData(b"Receiving only a single event"), partition_key='0') + await senders[0].send(EventData(b"Receiving only a single event"), partition_key='0') await asyncio.sleep(10) assert on_event.called is True await task + for s in senders: + await s.close() + await producer_client.close() @pytest.mark.parametrize("position, inclusive, expected_result", diff --git a/sdk/eventhub/azure-eventhub/tests/livetest/synctests/test_consumer_client.py b/sdk/eventhub/azure-eventhub/tests/livetest/synctests/test_consumer_client.py index 5a2dca789f37..8da5ddeb6ead 100644 --- a/sdk/eventhub/azure-eventhub/tests/livetest/synctests/test_consumer_client.py +++ b/sdk/eventhub/azure-eventhub/tests/livetest/synctests/test_consumer_client.py @@ -17,7 +17,7 @@ def test_receive_no_partition(connstr_senders): def on_event(partition_context, event): on_event.received += 1 - partition_context.update_checkpoint(event, fake_kwarg="arg") # ignores fake_kwarg + partition_context.update_checkpoint(event) on_event.namespace = partition_context.fully_qualified_namespace on_event.eventhub_name = partition_context.eventhub_name on_event.consumer_group = partition_context.consumer_group From dd670398a71edceacb47934b681b823f84fb448d Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Mon, 13 Sep 2021 13:04:52 -0700 Subject: [PATCH 45/85] Sync eng/common directory with azure-sdk-tools for PR 1946 (#20656) * Add ability to exit gracefully when all files in the diff are excluded * Address case where cspell exits with an error when all files from the 'files' config list are excluded by the expressions in 'ignorePaths' * Add tests * Review feedback: impl goes at the bottom and should be treated as a script, logic for testing should happen above that and exit appropriately if running tests * Import common instead of logging * Enable strict mode Co-authored-by: Daniel Jurek --- .../check-spelling-in-changed-files.ps1 | 324 ++++++++++++++---- 1 file changed, 259 insertions(+), 65 deletions(-) diff --git a/eng/common/scripts/check-spelling-in-changed-files.ps1 b/eng/common/scripts/check-spelling-in-changed-files.ps1 index b0a9611620d5..ebeddc605032 100644 --- a/eng/common/scripts/check-spelling-in-changed-files.ps1 +++ b/eng/common/scripts/check-spelling-in-changed-files.ps1 @@ -1,3 +1,54 @@ +<# +.SYNOPSIS +Uses cspell (from NPM) to check spelling of recently changed files + +.DESCRIPTION +This script checks files that have changed relative to a base branch (default +branch) for spelling errors. Dictionaries and spelling configurations reside +in a configurable `cspell.json` location. + +This script uses `npx` and assumes that NodeJS (and by extension `npm` and +`npx`) are installed on the machine. If it does not detect `npx` it will warn +the user and exit with an error. + +The entire file is scanned, not just changed sections. Spelling errors in parts +of the file not touched will still be shown. + +This script copies the config file supplied in CspellConfigPath to a temporary +location, mutates the config file to include only the files that have changed, +and then uses the mutated config file to call cspell. In the case of success +the temporary file is deleted. In the case of failure the temporary file, whose +location was logged to the console, remains on disk. + +.PARAMETER TargetBranch +Git ref to compare changes. This is usually the "base" (GitHub) or "target" +(DevOps) branch for which a pull request would be opened. + +.PARAMETER SourceBranch +Git ref to use instead of changes in current repo state. Use `HEAD` here to +check spelling of files that have been committed and exclude any new files or +modified files that are not committed. This is most useful in CI scenarios where +builds may have modified the state of the repo. Leaving this parameter blank +includes files for whom changes have not been committed. + +.PARAMETER CspellConfigPath +Optional location to use for cspell.json path. Default value is +`./.vscode/cspell.json` + +.PARAMETER ExitWithError +Exit with error code 1 if spelling errors are detected. + +.PARAMETER Test +Run test functions against the script logic + +.EXAMPLE +./eng/common/scripts/check-spelling-in-changed-files.ps1 -TargetBranch 'target_branch_name' + +This will run spell check with changes in the current branch with respect to +`target_branch_name` + +#> + [CmdletBinding()] Param ( [Parameter()] @@ -10,18 +61,205 @@ Param ( [string] $CspellConfigPath = "./.vscode/cspell.json", [Parameter()] - [switch] $ExitWithError + [switch] $ExitWithError, + + [Parameter()] + [switch] $Test ) +Set-StrictMode -Version 3.0 + +function TestSpellChecker() { + Test-Exit0WhenAllFilesExcluded + ResetTest + Test-Exit1WhenIncludedFileHasSpellingError + ResetTest + Test-Exit0WhenIncludedFileHasNoSpellingError + ResetTest + Test-Exit1WhenChangedFileAlreadyHasSpellingError + ResetTest + Test-Exit0WhenUnalteredFileHasSpellingError + ResetTest + Test-Exit0WhenSpellingErrorsAndNoExitWithError +} + +function Test-Exit0WhenAllFilesExcluded() { + # Arrange + "sepleing errrrrorrrrr" > ./excluded/excluded-file.txt + git add -A + git commit -m "One change" + + # Act + &"$PSScriptRoot/check-spelling-in-changed-files.ps1" ` + -TargetBranch HEAD~1 ` + -ExitWithError + + # Assert + if ($LASTEXITCODE -ne 0) { + throw "`$LASTEXITCODE != 0" + } +} + +function Test-Exit1WhenIncludedFileHasSpellingError() { + # Arrange + "sepleing errrrrorrrrr" > ./included/included-file.txt + git add -A + git commit -m "One change" + + # Act + &"$PSScriptRoot/check-spelling-in-changed-files.ps1" ` + -TargetBranch HEAD~1 ` + -ExitWithError + + # Assert + if ($LASTEXITCODE -ne 1) { + throw "`$LASTEXITCODE != 1" + } +} + +function Test-Exit0WhenIncludedFileHasNoSpellingError() { + # Arrange + "correct spelling" > ./included/included-file.txt + git add -A + git commit -m "One change" + + # Act + &"$PSScriptRoot/check-spelling-in-changed-files.ps1" ` + -TargetBranch HEAD~1 ` + -ExitWithError + + # Assert + if ($LASTEXITCODE -ne 0) { + throw "`$LASTEXITCODE != 0" + } +} + +function Test-Exit1WhenChangedFileAlreadyHasSpellingError() { + # Arrange + "sepleing errrrrorrrrr" > ./included/included-file.txt + git add -A + git commit -m "First change" + + "A statement without spelling errors" >> ./included/included-file.txt + git add -A + git commit -m "Second change" + + # Act + &"$PSScriptRoot/check-spelling-in-changed-files.ps1" ` + -TargetBranch HEAD~1 ` + -ExitWithError + + # Assert + if ($LASTEXITCODE -ne 1) { + throw "`$LASTEXITCODE != 1" + } +} + +function Test-Exit0WhenUnalteredFileHasSpellingError() { + # Arrange + "sepleing errrrrorrrrr" > ./included/included-file-1.txt + git add -A + git commit -m "One change" + + "A statement without spelling errors" > ./included/included-file-2.txt + git add -A + git commit -m "Second change" + + # Act + &"$PSScriptRoot/check-spelling-in-changed-files.ps1" ` + -TargetBranch HEAD~1 ` + -ExitWithError + + # Assert + if ($LASTEXITCODE -ne 0) { + throw "`$LASTEXITCODE != 0" + } +} + +function Test-Exit0WhenSpellingErrorsAndNoExitWithError() { + # Arrange + "sepleing errrrrorrrrr" > ./included/included-file-1.txt + git add -A + git commit -m "One change" + + # Act + &"$PSScriptRoot/check-spelling-in-changed-files.ps1" ` + -TargetBranch HEAD~1 + + # Assert + if ($LASTEXITCODE -ne 0) { + throw "`$LASTEXITCODE != 0" + } +} + +function SetupTest($workingDirectory) { + Write-Host "Create test temp dir: $workingDirectory" + New-Item -ItemType Directory -Force -Path $workingDirectory | Out-Null + + Push-Location $workingDirectory | Out-Null + git init + + New-Item -ItemType Directory -Force -Path "./excluded" + New-Item -ItemType Directory -Force -Path "./included" + New-Item -ItemType Directory -Force -Path "./.vscode" + + "Placeholder" > "./excluded/placeholder.txt" + "Placeholder" > "./included/placeholder.txt" + + $configJsonContent = @" +{ + "version": "0.1", + "language": "en", + "ignorePaths": [ + ".vscode/cspell.json", + "excluded/**" + ] +} +"@ + $configJsonContent > "./.vscode/cspell.json" + + git add -A + git commit -m "Init" +} + +function ResetTest() { + # Empty out the working tree + git checkout . + git clean -xdf + + $revCount = git rev-list --count HEAD + if ($revCount -gt 1) { + # Reset N-1 changes so there is only the initial commit + $revisionsToReset = $revCount - 1 + git reset --hard HEAD~$revisionsToReset + } +} + +function TeardownTest($workingDirectory) { + Pop-Location | Out-Null + Write-Host "Remove test temp dir: $workingDirectory" + Remove-Item -Path $workingDirectory -Recurse -Force | Out-Null +} + +if ($Test) { + $workingDirectory = Join-Path ([System.IO.Path]::GetTempPath()) ([System.IO.Path]::GetRandomFileName()) + + SetupTest $workingDirectory + TestSpellChecker + TeardownTest $workingDirectory + Write-Host "Test complete" + exit 0 +} + $ErrorActionPreference = "Continue" -. $PSScriptRoot/logging.ps1 +. $PSScriptRoot/common.ps1 -if ((Get-Command git | Measure-Object).Count -eq 0) { +if ((Get-Command git | Measure-Object).Count -eq 0) { LogError "Could not locate git. Install git https://git-scm.com/downloads" exit 1 } -if ((Get-Command npx | Measure-Object).Count -eq 0) { +if ((Get-Command npx | Measure-Object).Count -eq 0) { LogError "Could not locate npx. Install NodeJS (includes npx and npx) https://nodejs.org/en/download/" exit 1 } @@ -31,7 +269,7 @@ if (!(Test-Path $CspellConfigPath)) { exit 1 } -# Lists names of files that were in some way changed between the +# Lists names of files that were in some way changed between the # current $SourceBranch and $TargetBranch. Excludes files that were deleted to # prevent errors in Resolve-Path Write-Host "git diff --diff-filter=d --name-only $TargetBranch $SourceBranch" @@ -51,11 +289,12 @@ foreach ($file in $changedFiles) { $changedFilePaths += $file.Path } -# Using GetTempPath because it works on linux and windows. Setting .json -# extension because cspell requires the file have a .json or .jsonc extension -$cspellConfigTemporaryPath = Join-Path ` - ([System.IO.Path]::GetTempPath()) ` - "$([System.IO.Path]::GetRandomFileName()).json" +# The "files" list must always contain a file which exists, is not empty, and is +# not excluded in ignorePaths. In this case it will be a file with the contents +# "1" (no spelling errors will be detected) +$notExcludedFile = (New-TemporaryFile).ToString() +"1" >> $notExcludedFile +$changedFilePaths += $notExcludedFile $cspellConfigContent = Get-Content $CspellConfigPath -Raw $cspellConfig = ConvertFrom-Json $cspellConfigContent @@ -74,14 +313,17 @@ Add-Member ` # Set the temporary config file with the mutated configuration. The temporary # location is used to configure the command and the original file remains # unchanged. -Write-Host "Setting config in: $cspellConfigTemporaryPath" +Write-Host "Setting config in: $CspellConfigPath" Set-Content ` - -Path $cspellConfigTemporaryPath ` + -Path $CspellConfigPath ` -Value (ConvertTo-Json $cspellConfig -Depth 100) # Use the mutated configuration file when calling cspell -Write-Host "npx cspell lint --config $cspellConfigTemporaryPath" -$spellingErrors = npx cspell lint --config $cspellConfigTemporaryPath +Write-Host "npx cspell lint --config $CspellConfigPath --no-must-find-files " +$spellingErrors = npx cspell lint --config $CspellConfigPath --no-must-find-files + +Write-Host "cspell run complete, restoring original configuration." +Set-Content -Path $CspellConfigPath -Value $cspellConfigContent -NoNewLine if ($spellingErrors) { $errorLoggingFunction = Get-Item 'Function:LogWarning' @@ -89,7 +331,7 @@ if ($spellingErrors) { $errorLoggingFunction = Get-Item 'Function:LogError' } - foreach ($spellingError in $spellingErrors) { + foreach ($spellingError in $spellingErrors) { &$errorLoggingFunction $spellingError } &$errorLoggingFunction "Spelling errors detected. To correct false positives or learn about spell checking see: https://aka.ms/azsdk/engsys/spellcheck" @@ -98,56 +340,8 @@ if ($spellingErrors) { exit 1 } } else { - Write-Host "No spelling errors detected. Removing temporary config file." - Remove-Item -Path $cspellConfigTemporaryPath -Force + Write-Host "No spelling errors detected. Removing temporary file." + Remove-Item -Path $notExcludedFile -Force | Out-Null } exit 0 - -<# -.SYNOPSIS -Uses cspell (from NPM) to check spelling of recently changed files - -.DESCRIPTION -This script checks files that have changed relative to a base branch (default -branch) for spelling errors. Dictionaries and spelling configurations reside -in a configurable `cspell.json` location. - -This script uses `npx` and assumes that NodeJS (and by extension `npm` and -`npx`) are installed on the machine. If it does not detect `npx` it will warn -the user and exit with an error. - -The entire file is scanned, not just changed sections. Spelling errors in parts -of the file not touched will still be shown. - -This script copies the config file supplied in CspellConfigPath to a temporary -location, mutates the config file to include only the files that have changed, -and then uses the mutated config file to call cspell. In the case of success -the temporary file is deleted. In the case of failure the temporary file, whose -location was logged to the console, remains on disk. - -.PARAMETER TargetBranch -Git ref to compare changes. This is usually the "base" (GitHub) or "target" -(DevOps) branch for which a pull request would be opened. - -.PARAMETER SourceBranch -Git ref to use instead of changes in current repo state. Use `HEAD` here to -check spelling of files that have been committed and exclude any new files or -modified files that are not committed. This is most useful in CI scenarios where -builds may have modified the state of the repo. Leaving this parameter blank -includes files for whom changes have not been committed. - -.PARAMETER CspellConfigPath -Optional location to use for cspell.json path. Default value is -`./.vscode/cspell.json` - -.PARAMETER ExitWithError -Exit with error code 1 if spelling errors are detected. - -.EXAMPLE -./eng/common/scripts/check-spelling-in-changed-files.ps1 -TargetBranch 'target_branch_name' - -This will run spell check with changes in the current branch with respect to -`target_branch_name` - -#> From 90ce5164a256f911e9ee1bf7a0cf88d828807fb9 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Mon, 13 Sep 2021 13:06:02 -0700 Subject: [PATCH 46/85] Fix SemVer.ToString to handle v0 case (#20665) Since we are treating v0 versions as prerelease we need to make sure we don't accidently start to add the bogus prerelease label in cases where we call ToString() on the version. Co-authored-by: Wes Haggard --- eng/common/scripts/SemVer.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/common/scripts/SemVer.ps1 b/eng/common/scripts/SemVer.ps1 index b3ca5353274d..6459f252a67c 100644 --- a/eng/common/scripts/SemVer.ps1 +++ b/eng/common/scripts/SemVer.ps1 @@ -136,7 +136,7 @@ class AzureEngSemanticVersion : IComparable { { $versionString = "{0}.{1}.{2}" -F $this.Major, $this.Minor, $this.Patch - if ($this.IsPrerelease) + if ($this.IsPrerelease -and $this.PrereleaseLabel -ne "zzz") { $versionString += $this.PrereleaseLabelSeparator + $this.PrereleaseLabel + ` $this.PrereleaseNumberSeparator + $this.PrereleaseNumber From 3a537c9231152dee3ef0e21e024fd598c73da140 Mon Sep 17 00:00:00 2001 From: Travis Prescott Date: Mon, 13 Sep 2021 13:45:21 -0700 Subject: [PATCH 47/85] Update docstrings for custom models. (#20592) --- .../search/documents/indexes/models/_index.py | 202 +++++++------- .../documents/indexes/models/_models.py | 264 +++++++++--------- 2 files changed, 233 insertions(+), 233 deletions(-) diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/models/_index.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/models/_index.py index c4bc1bbe1318..778ea41176a5 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/models/_index.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/models/_index.py @@ -31,26 +31,26 @@ class SearchField(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the field, which must be unique within the fields collection + :keyword name: Required. The name of the field, which must be unique within the fields collection of the index or parent field. - :type name: str - :param type: Required. The data type of the field. Possible values include: "Edm.String", + :paramtype name: str + :keyword type: Required. The data type of the field. Possible values include: "Edm.String", "Edm.Int32", "Edm.Int64", "Edm.Double", "Edm.Boolean", "Edm.DateTimeOffset", "Edm.GeographyPoint", "Edm.ComplexType". - :type type: str or ~azure.search.documents.indexes.models.SearchFieldDataType - :param key: A value indicating whether the field uniquely identifies documents in the index. + :paramtype type: str or ~azure.search.documents.indexes.models.SearchFieldDataType + :keyword key: A value indicating whether the field uniquely identifies documents in the index. Exactly one top-level field in each index must be chosen as the key field and it must be of type Edm.String. Key fields can be used to look up documents directly and update or delete specific documents. Default is false for simple fields and null for complex fields. - :type key: bool - :param hidden: A value indicating whether the field can be returned in a search result. + :paramtype key: bool + :keyword hidden: A value indicating whether the field can be returned in a search result. You can enable this option if you want to use a field (for example, margin) as a filter, sorting, or scoring mechanism but do not want the field to be visible to the end user. This property must be False for key fields, and it must be null for complex fields. This property can be changed on existing fields. Enabling this property does not cause any increase in index storage requirements. Default is False for simple fields and null for complex fields. - :type hidden: bool - :param searchable: A value indicating whether the field is full-text searchable. This means it + :paramtype hidden: bool + :keyword searchable: A value indicating whether the field is full-text searchable. This means it will undergo analysis such as word-breaking during indexing. If you set a searchable field to a value like "sunny day", internally it will be split into the individual tokens "sunny" and "day". This enables full-text searches for these terms. Fields of type Edm.String or @@ -59,15 +59,15 @@ class SearchField(msrest.serialization.Model): consume extra space in your index since Azure Cognitive Search will store an additional tokenized version of the field value for full-text searches. If you want to save space in your index and you don't need a field to be included in searches, set searchable to false. - :type searchable: bool - :param filterable: A value indicating whether to enable the field to be referenced in $filter + :paramtype searchable: bool + :keyword filterable: A value indicating whether to enable the field to be referenced in $filter queries. filterable differs from searchable in how strings are handled. Fields of type Edm.String or Collection(Edm.String) that are filterable do not undergo word-breaking, so comparisons are for exact matches only. For example, if you set such a field f to "sunny day", $filter=f eq 'sunny' will find no matches, but $filter=f eq 'sunny day' will. This property must be null for complex fields. Default is true for simple fields and null for complex fields. - :type filterable: bool - :param sortable: A value indicating whether to enable the field to be referenced in $orderby + :paramtype filterable: bool + :keyword sortable: A value indicating whether to enable the field to be referenced in $orderby expressions. By default Azure Cognitive Search sorts results by score, but in many experiences users will want to sort by fields in the documents. A simple field can be sortable only if it is single-valued (it has a single value in the scope of the parent document). Simple collection @@ -77,15 +77,15 @@ class SearchField(msrest.serialization.Model): cannot be sortable and the sortable property must be null for such fields. The default for sortable is true for single-valued simple fields, false for multi-valued simple fields, and null for complex fields. - :type sortable: bool - :param facetable: A value indicating whether to enable the field to be referenced in facet + :paramtype sortable: bool + :keyword facetable: A value indicating whether to enable the field to be referenced in facet queries. Typically used in a presentation of search results that includes hit count by category (for example, search for digital cameras and see hits by brand, by megapixels, by price, and so on). This property must be null for complex fields. Fields of type Edm.GeographyPoint or Collection(Edm.GeographyPoint) cannot be facetable. Default is true for all other simple fields. - :type facetable: bool - :param analyzer_name: The name of the analyzer to use for the field. This option can be used only + :paramtype facetable: bool + :keyword analyzer_name: The name of the analyzer to use for the field. This option can be used only with searchable fields and it can't be set together with either searchAnalyzer or indexAnalyzer. Once the analyzer is chosen, it cannot be changed for the field. Must be null for complex fields. Possible values include: "ar.microsoft", "ar.lucene", "hy.lucene", @@ -105,8 +105,8 @@ class SearchField(msrest.serialization.Model): "th.microsoft", "th.lucene", "tr.microsoft", "tr.lucene", "uk.microsoft", "ur.microsoft", "vi.microsoft", "standard.lucene", "standardasciifolding.lucene", "keyword", "pattern", "simple", "stop", "whitespace". - :type analyzer_name: str or ~azure.search.documents.indexes.models.LexicalAnalyzerName - :param search_analyzer_name: The name of the analyzer used at search time for the field. This option + :paramtype analyzer_name: str or ~azure.search.documents.indexes.models.LexicalAnalyzerName + :keyword search_analyzer_name: The name of the analyzer used at search time for the field. This option can be used only with searchable fields. It must be set together with indexAnalyzer and it cannot be set together with the analyzer option. This property cannot be set to the name of a language analyzer; use the analyzer property instead if you need a language analyzer. This @@ -128,8 +128,8 @@ class SearchField(msrest.serialization.Model): "th.lucene", "tr.microsoft", "tr.lucene", "uk.microsoft", "ur.microsoft", "vi.microsoft", "standard.lucene", "standardasciifolding.lucene", "keyword", "pattern", "simple", "stop", "whitespace". - :type search_analyzer_name: str or ~azure.search.documents.indexes.models.LexicalAnalyzerName - :param index_analyzer_name: The name of the analyzer used at indexing time for the field. This + :paramtype search_analyzer_name: str or ~azure.search.documents.indexes.models.LexicalAnalyzerName + :keyword index_analyzer_name: The name of the analyzer used at indexing time for the field. This option can be used only with searchable fields. It must be set together with searchAnalyzer and it cannot be set together with the analyzer option. This property cannot be set to the name of a language analyzer; use the analyzer property instead if you need a language analyzer. Once @@ -151,21 +151,21 @@ class SearchField(msrest.serialization.Model): "th.lucene", "tr.microsoft", "tr.lucene", "uk.microsoft", "ur.microsoft", "vi.microsoft", "standard.lucene", "standardasciifolding.lucene", "keyword", "pattern", "simple", "stop", "whitespace". - :type index_analyzer_name: str or ~azure.search.documents.indexes.models.LexicalAnalyzerName - :param normalizer_name: The name of the normalizer to use for the field. This option can be used + :paramtype index_analyzer_name: str or ~azure.search.documents.indexes.models.LexicalAnalyzerName + :keyword normalizer_name: The name of the normalizer to use for the field. This option can be used only with fields with filterable, sortable, or facetable enabled. Once the normalizer is chosen, it cannot be changed for the field. Must be null for complex fields. Possible values include: "asciifolding", "elision", "lowercase", "standard", "uppercase". - :type normalizer_name: str or ~azure.search.documents.indexes.models.LexicalNormalizerName - :param synonym_map_names: A list of the names of synonym maps to associate with this field. This + :paramtype normalizer_name: str or ~azure.search.documents.indexes.models.LexicalNormalizerName + :keyword synonym_map_names: A list of the names of synonym maps to associate with this field. This option can be used only with searchable fields. Currently only one synonym map per field is supported. Assigning a synonym map to a field ensures that query terms targeting that field are expanded at query-time using the rules in the synonym map. This attribute can be changed on existing fields. Must be null or an empty collection for complex fields. - :type synonym_map_names: list[str] - :param fields: A list of sub-fields if this is a field of type Edm.ComplexType or + :paramtype synonym_map_names: list[str] + :keyword fields: A list of sub-fields if this is a field of type Edm.ComplexType or Collection(Edm.ComplexType). Must be null or empty for simple fields. - :type fields: list[~azure.search.documents.models.SearchField] + :paramtype fields: list[~azure.search.documents.models.SearchField] """ _validation = { @@ -268,34 +268,34 @@ def SimpleField(**kw): # type: (**Any) -> SearchField """Configure a simple field for an Azure Search Index - :param name: Required. The name of the field, which must be unique within the fields collection + :keyword name: Required. The name of the field, which must be unique within the fields collection of the index or parent field. - :type name: str - :param type: Required. The data type of the field. Possible values include: SearchFieldDataType.String, + :paramtype name: str + :keyword type: Required. The data type of the field. Possible values include: SearchFieldDataType.String, SearchFieldDataType.Int32, SearchFieldDataType.Int64, SearchFieldDataType.Double, SearchFieldDataType.Boolean, SearchFieldDataType.DateTimeOffset, SearchFieldDataType.GeographyPoint, SearchFieldDataType.ComplexType, from `azure.search.documents.SearchFieldDataType`. - :type type: str - :param key: A value indicating whether the field uniquely identifies documents in the index. + :paramtype type: str + :keyword key: A value indicating whether the field uniquely identifies documents in the index. Exactly one top-level field in each index must be chosen as the key field and it must be of type SearchFieldDataType.String. Key fields can be used to look up documents directly and update or delete specific documents. Default is False - :type key: bool - :param hidden: A value indicating whether the field can be returned in a search result. + :paramtype key: bool + :keyword hidden: A value indicating whether the field can be returned in a search result. You can enable this option if you want to use a field (for example, margin) as a filter, sorting, or scoring mechanism but do not want the field to be visible to the end user. This property must be False for key fields. This property can be changed on existing fields. Enabling this property does not cause any increase in index storage requirements. Default is False. - :type hidden: bool - :param filterable: A value indicating whether to enable the field to be referenced in $filter + :paramtype hidden: bool + :keyword filterable: A value indicating whether to enable the field to be referenced in $filter queries. filterable differs from searchable in how strings are handled. Fields of type SearchFieldDataType.String or Collection(SearchFieldDataType.String) that are filterable do not undergo word-breaking, so comparisons are for exact matches only. For example, if you set such a field f to "sunny day", $filter=f eq 'sunny' will find no matches, but $filter=f eq 'sunny day' will. This property must be null for complex fields. Default is False - :type filterable: bool - :param sortable: A value indicating whether to enable the field to be referenced in $orderby + :paramtype filterable: bool + :keyword sortable: A value indicating whether to enable the field to be referenced in $orderby expressions. By default Azure Cognitive Search sorts results by score, but in many experiences users will want to sort by fields in the documents. A simple field can be sortable only if it is single-valued (it has a single value in the scope of the parent document). Simple collection @@ -303,13 +303,13 @@ def SimpleField(**kw): collections are also multi-valued, and therefore cannot be sortable. This is true whether it's an immediate parent field, or an ancestor field, that's the complex collection. The default is False. - :type sortable: bool - :param facetable: A value indicating whether to enable the field to be referenced in facet + :paramtype sortable: bool + :keyword facetable: A value indicating whether to enable the field to be referenced in facet queries. Typically used in a presentation of search results that includes hit count by category (for example, search for digital cameras and see hits by brand, by megapixels, by price, and so on). Fields of type SearchFieldDataType.GeographyPoint or Collection(SearchFieldDataType.GeographyPoint) cannot be facetable. Default is False. - :type facetable: bool + :paramtype facetable: bool """ result = {"name": kw.get("name"), "type": kw.get("type")} # type: Dict[str, Any] result["key"] = kw.get("key", False) @@ -325,24 +325,24 @@ def SearchableField(**kw): # type: (**Any) -> SearchField """Configure a searchable text field for an Azure Search Index - :param name: Required. The name of the field, which must be unique within the fields collection + :keyword name: Required. The name of the field, which must be unique within the fields collection of the index or parent field. - :type name: str - :param collection: Whether this search field is a collection (default False) - :type collection: bool - :param key: A value indicating whether the field uniquely identifies documents in the index. + :paramtype name: str + :keyword collection: Whether this search field is a collection (default False) + :paramtype collection: bool + :keyword key: A value indicating whether the field uniquely identifies documents in the index. Exactly one top-level field in each index must be chosen as the key field and it must be of type SearchFieldDataType.String. Key fields can be used to look up documents directly and update or delete specific documents. Default is False - :type key: bool - :param hidden: A value indicating whether the field can be returned in a search result. + :paramtype key: bool + :keyword hidden: A value indicating whether the field can be returned in a search result. You can enable this option if you want to use a field (for example, margin) as a filter, sorting, or scoring mechanism but do not want the field to be visible to the end user. This property must be False for key fields. This property can be changed on existing fields. Enabling this property does not cause any increase in index storage requirements. Default is False. - :type hidden: bool - :param searchable: A value indicating whether the field is full-text searchable. This means it + :paramtype hidden: bool + :keyword searchable: A value indicating whether the field is full-text searchable. This means it will undergo analysis such as word-breaking during indexing. If you set a searchable field to a value like "sunny day", internally it will be split into the individual tokens "sunny" and "day". This enables full-text searches for these terms. Note: searchable fields @@ -350,23 +350,23 @@ def SearchableField(**kw): tokenized version of the field value for full-text searches. If you want to save space in your index and you don't need a field to be included in searches, set searchable to false. Default is True. - :type searchable: bool - :param filterable: A value indicating whether to enable the field to be referenced in $filter + :paramtype searchable: bool + :keyword filterable: A value indicating whether to enable the field to be referenced in $filter queries. filterable differs from searchable in how strings are handled. Fields that are filterable do not undergo word-breaking, so comparisons are for exact matches only. For example, if you set such a field f to "sunny day", $filter=f eq 'sunny' will find no matches, but $filter=f eq 'sunny day' will. Default is False. - :type filterable: bool - :param sortable: A value indicating whether to enable the field to be referenced in $orderby + :paramtype filterable: bool + :keyword sortable: A value indicating whether to enable the field to be referenced in $orderby expressions. By default Azure Cognitive Search sorts results by score, but in many experiences users will want to sort by fields in the documents. The default is true False. - :type sortable: bool - :param facetable: A value indicating whether to enable the field to be referenced in facet + :paramtype sortable: bool + :keyword facetable: A value indicating whether to enable the field to be referenced in facet queries. Typically used in a presentation of search results that includes hit count by category (for example, search for digital cameras and see hits by brand, by megapixels, by price, and so on). Default is False. - :type facetable: bool - :param analyzer_name: The name of the analyzer to use for the field. This option can't be set together + :paramtype facetable: bool + :keyword analyzer_name: The name of the analyzer to use for the field. This option can't be set together with either searchAnalyzer or indexAnalyzer. Once the analyzer is chosen, it cannot be changed for the field. Possible values include: 'ar.microsoft', 'ar.lucene', 'hy.lucene', 'bn.microsoft', 'eu.lucene', 'bg.microsoft', 'bg.lucene', 'ca.microsoft', 'ca.lucene', 'zh- @@ -385,8 +385,8 @@ def SearchableField(**kw): 'th.microsoft', 'th.lucene', 'tr.microsoft', 'tr.lucene', 'uk.microsoft', 'ur.microsoft', 'vi.microsoft', 'standard.lucene', 'standardasciifolding.lucene', 'keyword', 'pattern', 'simple', 'stop', 'whitespace'. - :type analyzer_name: str or ~azure.search.documents.indexes.models.AnalyzerName - :param search_analyzer_name: The name of the analyzer used at search time for the field. It must be + :paramtype analyzer_name: str or ~azure.search.documents.indexes.models.AnalyzerName + :keyword search_analyzer_name: The name of the analyzer used at search time for the field. It must be set together with indexAnalyzer and it cannot be set together with the analyzer option. This property cannot be set to the name of a language analyzer; use the analyzer property instead if you need a language analyzer. This analyzer can be updated on an existing field. Possible @@ -408,8 +408,8 @@ def SearchableField(**kw): 'th.lucene', 'tr.microsoft', 'tr.lucene', 'uk.microsoft', 'ur.microsoft', 'vi.microsoft', 'standard.lucene', 'standardasciifolding.lucene', 'keyword', 'pattern', 'simple', 'stop', 'whitespace'. - :type search_analyzer_name: str or ~azure.search.documents.indexes.models.AnalyzerName - :param index_analyzer_name: The name of the analyzer used at indexing time for the field. + :paramtype search_analyzer_name: str or ~azure.search.documents.indexes.models.AnalyzerName + :keyword index_analyzer_name: The name of the analyzer used at indexing time for the field. It must be set together with searchAnalyzer and it cannot be set together with the analyzer option. This property cannot be set to the name of a language analyzer; use the analyzer property instead if you need a language analyzer. Once the analyzer is chosen, it cannot be @@ -431,12 +431,12 @@ def SearchableField(**kw): 'th.lucene', 'tr.microsoft', 'tr.lucene', 'uk.microsoft', 'ur.microsoft', 'vi.microsoft', 'standard.lucene', 'standardasciifolding.lucene', 'keyword', 'pattern', 'simple', 'stop', 'whitespace'. - :type index_analyzer_name: str or ~azure.search.documents.indexes.models.AnalyzerName - :param synonym_map_names: A list of the names of synonym maps to associate with this field. Currently + :paramtype index_analyzer_name: str or ~azure.search.documents.indexes.models.AnalyzerName + :keyword synonym_map_names: A list of the names of synonym maps to associate with this field. Currently only one synonym map per field is supported. Assigning a synonym map to a field ensures that query terms targeting that field are expanded at query-time using the rules in the synonym map. This attribute can be changed on existing fields. - :type synonym_map_names: list[str] + :paramtype synonym_map_names: list[str] """ typ = Collection(String) if kw.get("collection", False) else String @@ -463,14 +463,14 @@ def ComplexField(**kw): """Configure a Complex or Complex collection field for an Azure Search Index - :param name: Required. The name of the field, which must be unique within the fields collection + :keyword name: Required. The name of the field, which must be unique within the fields collection of the index or parent field. - :type name: str - :param collection: Whether this complex field is a collection (default False) - :type collection: bool - :type type: str or ~search_service_client.models.DataType - :param fields: A list of sub-fields - :type fields: list[~search_service_client.models.Field] + :paramtype name: str + :keyword collection: Whether this complex field is a collection (default False) + :paramtype collection: bool + :paramtype type: str or ~search_service_client.models.DataType + :keyword fields: A list of sub-fields + :paramtype fields: list[~search_service_client.models.Field] """ typ = Collection(ComplexType) if kw.get("collection", False) else ComplexType @@ -485,32 +485,32 @@ class SearchIndex(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the index. - :type name: str - :param fields: Required. The fields of the index. - :type fields: list[~azure.search.documents.indexes.models.SearchField] - :param scoring_profiles: The scoring profiles for the index. - :type scoring_profiles: list[~azure.search.documents.indexes.models.ScoringProfile] - :param default_scoring_profile: The name of the scoring profile to use if none is specified in + :keyword name: Required. The name of the index. + :paramtype name: str + :keyword fields: Required. The fields of the index. + :paramtype fields: list[~azure.search.documents.indexes.models.SearchField] + :keyword scoring_profiles: The scoring profiles for the index. + :paramtype scoring_profiles: list[~azure.search.documents.indexes.models.ScoringProfile] + :keyword default_scoring_profile: The name of the scoring profile to use if none is specified in the query. If this property is not set and no scoring profile is specified in the query, then default scoring (tf-idf) will be used. - :type default_scoring_profile: str - :param cors_options: Options to control Cross-Origin Resource Sharing (CORS) for the index. - :type cors_options: ~azure.search.documents.indexes.models.CorsOptions - :param suggesters: The suggesters for the index. - :type suggesters: list[~azure.search.documents.indexes.models.SearchSuggester] - :param analyzers: The analyzers for the index. - :type analyzers: list[~azure.search.documents.indexes.models.LexicalAnalyzer] - :param tokenizers: The tokenizers for the index. - :type tokenizers: list[~azure.search.documents.indexes.models.LexicalTokenizer] - :param token_filters: The token filters for the index. - :type token_filters: list[~azure.search.documents.indexes.models.TokenFilter] - :param char_filters: The character filters for the index. - :type char_filters: list[~azure.search.documents.indexes.models.CharFilter] - :param normalizers: The normalizers for the index. - :type normalizers: + :paramtype default_scoring_profile: str + :keyword cors_options: Options to control Cross-Origin Resource Sharing (CORS) for the index. + :paramtype cors_options: ~azure.search.documents.indexes.models.CorsOptions + :keyword suggesters: The suggesters for the index. + :paramtype suggesters: list[~azure.search.documents.indexes.models.SearchSuggester] + :keyword analyzers: The analyzers for the index. + :paramtype analyzers: list[~azure.search.documents.indexes.models.LexicalAnalyzer] + :keyword tokenizers: The tokenizers for the index. + :paramtype tokenizers: list[~azure.search.documents.indexes.models.LexicalTokenizer] + :keyword token_filters: The token filters for the index. + :paramtype token_filters: list[~azure.search.documents.indexes.models.TokenFilter] + :keyword char_filters: The character filters for the index. + :paramtype char_filters: list[~azure.search.documents.indexes.models.CharFilter] + :keyword normalizers: The normalizers for the index. + :paramtype normalizers: list[~azure.search.documents.indexes.models.LexicalNormalizer] - :param encryption_key: A description of an encryption key that you create in Azure Key Vault. + :keyword encryption_key: A description of an encryption key that you create in Azure Key Vault. This key is used to provide an additional level of encryption-at-rest for your data when you want full assurance that no one, not even Microsoft, can decrypt your data in Azure Cognitive Search. Once you have encrypted your data, it will always remain encrypted. Azure Cognitive @@ -518,14 +518,14 @@ class SearchIndex(msrest.serialization.Model): needed if you want to rotate your encryption key; Your data will be unaffected. Encryption with customer-managed keys is not available for free search services, and is only available for paid services created on or after January 1, 2019. - :type encryption_key: ~azure.search.documents.indexes.models.SearchResourceEncryptionKey - :param similarity: The type of similarity algorithm to be used when scoring and ranking the + :paramtype encryption_key: ~azure.search.documents.indexes.models.SearchResourceEncryptionKey + :keyword similarity: The type of similarity algorithm to be used when scoring and ranking the documents matching a search query. The similarity algorithm can only be defined at index creation time and cannot be modified on existing indexes. If null, the ClassicSimilarity algorithm is used. - :type similarity: ~azure.search.documents.indexes.models.SimilarityAlgorithm - :param e_tag: The ETag of the index. - :type e_tag: str + :paramtype similarity: ~azure.search.documents.indexes.models.SimilarityAlgorithm + :keyword e_tag: The ETag of the index. + :paramtype e_tag: str """ _validation = { diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/models/_models.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/models/_models.py index 36d75590f017..baa2aea92ebf 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/models/_models.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/models/_models.py @@ -34,22 +34,22 @@ class SearchIndexerSkillset(_SearchIndexerSkillset): All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the skillset. - :type name: str - :param description: The description of the skillset. - :type description: str - :param skills: Required. A list of skills in the skillset. - :type skills: list[~azure.search.documents.indexes.models.SearchIndexerSkill] - :param cognitive_services_account: Details about cognitive services to be used when running + :keyword name: Required. The name of the skillset. + :paramtype name: str + :keyword description: The description of the skillset. + :paramtype description: str + :keyword skills: Required. A list of skills in the skillset. + :paramtype skills: list[~azure.search.documents.indexes.models.SearchIndexerSkill] + :keyword cognitive_services_account: Details about cognitive services to be used when running skills. - :type cognitive_services_account: + :paramtype cognitive_services_account: ~azure.search.documents.indexes.models.CognitiveServicesAccount - :param knowledge_store: Definition of additional projections to azure blob, table, or files, of + :keyword knowledge_store: Definition of additional projections to azure blob, table, or files, of enriched data. - :type knowledge_store: ~azure.search.documents.indexes.models.SearchIndexerKnowledgeStore - :param e_tag: The ETag of the skillset. - :type e_tag: str - :param encryption_key: A description of an encryption key that you create in Azure Key Vault. + :paramtype knowledge_store: ~azure.search.documents.indexes.models.SearchIndexerKnowledgeStore + :keyword e_tag: The ETag of the skillset. + :paramtype e_tag: str + :keyword encryption_key: A description of an encryption key that you create in Azure Key Vault. This key is used to provide an additional level of encryption-at-rest for your skillset definition when you want full assurance that no one, not even Microsoft, can decrypt your skillset definition in Azure Cognitive Search. Once you have encrypted your skillset @@ -58,7 +58,7 @@ class SearchIndexerSkillset(_SearchIndexerSkillset): encryption key; Your skillset definition will be unaffected. Encryption with customer-managed keys is not available for free search services, and is only available for paid services created on or after January 1, 2019. - :type encryption_key: ~azure.search.documents.indexes.models.SearchResourceEncryptionKey + :paramtype encryption_key: ~azure.search.documents.indexes.models.SearchResourceEncryptionKey """ def __init__( @@ -118,48 +118,48 @@ class EntityRecognitionSkill(SearchIndexerSkill): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the skill.Constant filled by server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill + :paramtype odata_type: str + :keyword name: The name of the skill which uniquely identifies it within the skillset. A skill with no name defined will be given a default name of its 1-based index in the skills array, prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage + :paramtype name: str + :keyword description: The description of the skill which describes the inputs, outputs, and usage of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root + :paramtype description: str + :keyword context: Represents the level at which operations take place, such as the document root or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the + :paramtype context: str + :keyword inputs: Required. Inputs of the skills could be a column in the source data set, or the output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value + :paramtype inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] + :keyword outputs: Required. The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] - :param categories: A list of entity categories that should be extracted. - :type categories: list[str or ~azure.search.documents.indexes.models.EntityCategory] - :param default_language_code: A value indicating which language code to use. Default is en. + :paramtype outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] + :keyword categories: A list of entity categories that should be extracted. + :paramtype categories: list[str or ~azure.search.documents.indexes.models.EntityCategory] + :keyword default_language_code: A value indicating which language code to use. Default is en. Possible values include: "ar", "cs", "zh-Hans", "zh-Hant", "da", "nl", "en", "fi", "fr", "de", "el", "hu", "it", "ja", "ko", "no", "pl", "pt-PT", "pt-BR", "ru", "es", "sv", "tr". - :type default_language_code: str or + :paramtype default_language_code: str or ~azure.search.documents.indexes.models.EntityRecognitionSkillLanguage - :param include_typeless_entities: Determines whether or not to include entities which are well + :keyword include_typeless_entities: Determines whether or not to include entities which are well known but don't conform to a pre-defined type. If this configuration is not set (default), set to null or set to false, entities which don't conform to one of the pre-defined types will not be surfaced. Only valid for skill version 1. - :type include_typeless_entities: bool - :param minimum_precision: A value between 0 and 1 that be used to only include entities whose + :paramtype include_typeless_entities: bool + :keyword minimum_precision: A value between 0 and 1 that be used to only include entities whose confidence score is greater than the value specified. If not set (default), or if explicitly set to null, all entities will be included. - :type minimum_precision: float - :param model_version: The version of the model to use when calling the Text Analytics service. + :paramtype minimum_precision: float + :keyword model_version: The version of the model to use when calling the Text Analytics service. It will default to the latest available when not specified. We recommend you do not specify this value unless absolutely necessary. Only valid from skill version 3. - :type model_version: str - :param skill_version: The version of the skill to use when calling the Text Analytics service. + :paramtype model_version: str + :keyword skill_version: The version of the skill to use when calling the Text Analytics service. It will default to V1 when not specified. - :type skill_version: ~azure.search.documents.indexes.models.EntityRecognitionSkillVersion + :paramtype skill_version: ~azure.search.documents.indexes.models.EntityRecognitionSkillVersion """ _validation = { @@ -265,41 +265,41 @@ class SentimentSkill(SearchIndexerSkill): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the skill.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the skill.Constant filled by server. - :type odata_type: str - :param name: The name of the skill which uniquely identifies it within the skillset. A skill + :paramtype odata_type: str + :keyword name: The name of the skill which uniquely identifies it within the skillset. A skill with no name defined will be given a default name of its 1-based index in the skills array, prefixed with the character '#'. - :type name: str - :param description: The description of the skill which describes the inputs, outputs, and usage + :paramtype name: str + :keyword description: The description of the skill which describes the inputs, outputs, and usage of the skill. - :type description: str - :param context: Represents the level at which operations take place, such as the document root + :paramtype description: str + :keyword context: Represents the level at which operations take place, such as the document root or document content (for example, /document or /document/content). The default is /document. - :type context: str - :param inputs: Required. Inputs of the skills could be a column in the source data set, or the + :paramtype context: str + :keyword inputs: Required. Inputs of the skills could be a column in the source data set, or the output of an upstream skill. - :type inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] - :param outputs: Required. The output of a skill is either a field in a search index, or a value + :paramtype inputs: list[~azure.search.documents.indexes.models.InputFieldMappingEntry] + :keyword outputs: Required. The output of a skill is either a field in a search index, or a value that can be consumed as an input by another skill. - :type outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] - :param default_language_code: A value indicating which language code to use. Default is en. + :paramtype outputs: list[~azure.search.documents.indexes.models.OutputFieldMappingEntry] + :keyword default_language_code: A value indicating which language code to use. Default is en. Possible values include: "da", "nl", "en", "fi", "fr", "de", "el", "it", "no", "pl", "pt-PT", "ru", "es", "sv", "tr". - :type default_language_code: str or + :paramtype default_language_code: str or ~azure.search.documents.indexes.models.SentimentSkillLanguage - :param include_opinion_mining: If set to true, the skill output will include information from + :keyword include_opinion_mining: If set to true, the skill output will include information from Text Analytics for opinion mining, namely targets (nouns or verbs) and their associated assessment (adjective) in the text. Default is false. - :type include_opinion_mining: bool - :param model_version: The version of the model to use when calling the Text Analytics service. + :paramtype include_opinion_mining: bool + :keyword model_version: The version of the model to use when calling the Text Analytics service. It will default to the latest available when not specified. We recommend you do not specify this value unless absolutely necessary. - :type model_version: str - :param skill_version: The version of the skill to use when calling the Text Analytics service. + :paramtype model_version: str + :keyword skill_version: The version of the skill to use when calling the Text Analytics service. It will default to V1 when not specified. - :type skill_version: ~azure.search.documents.indexes.models.SentimentSkillVersion + :paramtype skill_version: ~azure.search.documents.indexes.models.SentimentSkillVersion """ _validation = { @@ -380,9 +380,9 @@ class AnalyzeTextOptions(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param text: Required. The text to break into tokens. - :type text: str - :param analyzer_name: The name of the analyzer to use to break the given text. If this parameter is + :keyword text: Required. The text to break into tokens. + :paramtype text: str + :keyword analyzer_name: The name of the analyzer to use to break the given text. If this parameter is not specified, you must specify a tokenizer instead. The tokenizer and analyzer parameters are mutually exclusive. Possible values include: "ar.microsoft", "ar.lucene", "hy.lucene", "bn.microsoft", "eu.lucene", "bg.microsoft", "bg.lucene", "ca.microsoft", "ca.lucene", "zh- @@ -401,22 +401,22 @@ class AnalyzeTextOptions(msrest.serialization.Model): "th.microsoft", "th.lucene", "tr.microsoft", "tr.lucene", "uk.microsoft", "ur.microsoft", "vi.microsoft", "standard.lucene", "standardasciifolding.lucene", "keyword", "pattern", "simple", "stop", "whitespace". - :type analyzer_name: str or ~azure.search.documents.indexes.models.LexicalAnalyzerName - :param tokenizer_name: The name of the tokenizer to use to break the given text. If this parameter + :paramtype analyzer_name: str or ~azure.search.documents.indexes.models.LexicalAnalyzerName + :keyword tokenizer_name: The name of the tokenizer to use to break the given text. If this parameter is not specified, you must specify an analyzer instead. The tokenizer and analyzer parameters are mutually exclusive. Possible values include: "classic", "edgeNGram", "keyword_v2", "letter", "lowercase", "microsoft_language_tokenizer", "microsoft_language_stemming_tokenizer", "nGram", "path_hierarchy_v2", "pattern", "standard_v2", "uax_url_email", "whitespace". - :type tokenizer_name: str or ~azure.search.documents.indexes.models.LexicalTokenizerName - :param normalizer_name: The name of the normalizer to use to normalize the given text. Possible + :paramtype tokenizer_name: str or ~azure.search.documents.indexes.models.LexicalTokenizerName + :keyword normalizer_name: The name of the normalizer to use to normalize the given text. Possible values include: "asciifolding", "elision", "lowercase", "standard", "uppercase". - :type normalizer_name: str or ~azure.search.documents.indexes.models.LexicalNormalizerName - :param token_filters: An optional list of token filters to use when breaking the given text. + :paramtype normalizer_name: str or ~azure.search.documents.indexes.models.LexicalNormalizerName + :keyword token_filters: An optional list of token filters to use when breaking the given text. This parameter can only be set when using the tokenizer parameter. - :type token_filters: list[str or ~azure.search.documents.indexes.models.TokenFilterName] - :param char_filters: An optional list of character filters to use when breaking the given text. + :paramtype token_filters: list[str or ~azure.search.documents.indexes.models.TokenFilterName] + :keyword char_filters: An optional list of character filters to use when breaking the given text. This parameter can only be set when using the tokenizer parameter. - :type char_filters: list[str] + :paramtype char_filters: list[str] """ _validation = { @@ -460,27 +460,27 @@ class CustomAnalyzer(LexicalAnalyzer): All required parameters must be populated in order to send to Azure. - :param odata_type: Required. Identifies the concrete type of the analyzer.Constant filled by + :keyword odata_type: Required. Identifies the concrete type of the analyzer.Constant filled by server. - :type odata_type: str - :param name: Required. The name of the analyzer. It must only contain letters, digits, spaces, + :paramtype odata_type: str + :keyword name: Required. The name of the analyzer. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str - :param tokenizer_name: Required. The name of the tokenizer to use to divide continuous text into a + :paramtype name: str + :keyword tokenizer_name: Required. The name of the tokenizer to use to divide continuous text into a sequence of tokens, such as breaking a sentence into words. Possible values include: "classic", "edgeNGram", "keyword_v2", "letter", "lowercase", "microsoft_language_tokenizer", "microsoft_language_stemming_tokenizer", "nGram", "path_hierarchy_v2", "pattern", "standard_v2", "uax_url_email", "whitespace". - :type tokenizer_name: str or ~azure.search.documents.indexes.models.LexicalTokenizerName - :param token_filters: A list of token filters used to filter out or modify the tokens generated + :paramtype tokenizer_name: str or ~azure.search.documents.indexes.models.LexicalTokenizerName + :keyword token_filters: A list of token filters used to filter out or modify the tokens generated by a tokenizer. For example, you can specify a lowercase filter that converts all characters to lowercase. The filters are run in the order in which they are listed. - :type token_filters: list[str or ~azure.search.documents.indexes.models.TokenFilterName] - :param char_filters: A list of character filters used to prepare input text before it is + :paramtype token_filters: list[str or ~azure.search.documents.indexes.models.TokenFilterName] + :keyword char_filters: A list of character filters used to prepare input text before it is processed by the tokenizer. For instance, they can replace certain characters or symbols. The filters are run in the order in which they are listed. - :type char_filters: list[str] + :paramtype char_filters: list[str] """ _validation = { @@ -532,21 +532,21 @@ class PatternAnalyzer(LexicalAnalyzer): All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the analyzer. It must only contain letters, digits, spaces, + :keyword name: Required. The name of the analyzer. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str - :param lower_case_terms: A value indicating whether terms should be lower-cased. Default is + :paramtype name: str + :keyword lower_case_terms: A value indicating whether terms should be lower-cased. Default is true. - :type lower_case_terms: bool - :param pattern: A regular expression to match token separators. Default is an + :paramtype lower_case_terms: bool + :keyword pattern: A regular expression to match token separators. Default is an expression that matches one or more white space characters. - :type pattern: str - :param flags: List of regular expression flags. Possible values of each flag include: 'CANON_EQ', + :paramtype pattern: str + :keyword flags: List of regular expression flags. Possible values of each flag include: 'CANON_EQ', 'CASE_INSENSITIVE', 'COMMENTS', 'DOTALL', 'LITERAL', 'MULTILINE', 'UNICODE_CASE', 'UNIX_LINES'. - :type flags: list[str] or list[~search_service_client.models.RegexFlags] - :param stopwords: A list of stopwords. - :type stopwords: list[str] + :paramtype flags: list[str] or list[~search_service_client.models.RegexFlags] + :keyword stopwords: A list of stopwords. + :paramtype stopwords: list[str] """ _validation = {"odata_type": {"required": True}, "name": {"required": True}} @@ -604,20 +604,20 @@ class PatternTokenizer(LexicalTokenizer): All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the tokenizer. It must only contain letters, digits, spaces, + :keyword name: Required. The name of the tokenizer. It must only contain letters, digits, spaces, dashes or underscores, can only start and end with alphanumeric characters, and is limited to 128 characters. - :type name: str - :param pattern: A regular expression to match token separators. Default is an + :paramtype name: str + :keyword pattern: A regular expression to match token separators. Default is an expression that matches one or more white space characters. - :type pattern: str - :param flags: List of regular expression flags. Possible values of each flag include: 'CANON_EQ', + :paramtype pattern: str + :keyword flags: List of regular expression flags. Possible values of each flag include: 'CANON_EQ', 'CASE_INSENSITIVE', 'COMMENTS', 'DOTALL', 'LITERAL', 'MULTILINE', 'UNICODE_CASE', 'UNIX_LINES'. - :type flags: list[str] or list[~search_service_client.models.RegexFlags] - :param group: The zero-based ordinal of the matching group in the regular expression to + :paramtype flags: list[str] or list[~search_service_client.models.RegexFlags] + :keyword group: The zero-based ordinal of the matching group in the regular expression to extract into tokens. Use -1 if you want to use the entire pattern to split the input into tokens, irrespective of matching groups. Default is -1. - :type group: int + :paramtype group: int """ _validation = {"odata_type": {"required": True}, "name": {"required": True}} @@ -671,22 +671,22 @@ class SearchResourceEncryptionKey(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param key_name: Required. The name of your Azure Key Vault key to be used to encrypt your data + :keyword key_name: Required. The name of your Azure Key Vault key to be used to encrypt your data at rest. - :type key_name: str - :param key_version: Required. The version of your Azure Key Vault key to be used to encrypt + :paramtype key_name: str + :keyword key_version: Required. The version of your Azure Key Vault key to be used to encrypt your data at rest. - :type key_version: str - :param vault_uri: Required. The URI of your Azure Key Vault, also referred to as DNS name, that + :paramtype key_version: str + :keyword vault_uri: Required. The URI of your Azure Key Vault, also referred to as DNS name, that contains the key to be used to encrypt your data at rest. An example URI might be https://my- keyvault-name.vault.azure.net. - :type vault_uri: str - :param application_id: Required. An AAD Application ID that was granted the required access + :paramtype vault_uri: str + :keyword application_id: Required. An AAD Application ID that was granted the required access permissions to the Azure Key Vault that is to be used when encrypting your data at rest. The Application ID should not be confused with the Object ID for your AAD Application. - :type application_id: str - :param application_secret: The authentication key of the specified AAD application. - :type application_secret: str + :paramtype application_id: str + :keyword application_secret: The authentication key of the specified AAD application. + :paramtype application_secret: str """ _validation = { @@ -756,15 +756,15 @@ class SynonymMap(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the synonym map. - :type name: str + :keyword name: Required. The name of the synonym map. + :paramtype name: str :ivar format: Required. The format of the synonym map. Only the 'solr' format is currently supported. Default value: "solr". :vartype format: str - :param synonyms: Required. A series of synonym rules in the specified synonym map format. The + :keyword synonyms: Required. A series of synonym rules in the specified synonym map format. The rules must be separated by newlines. - :type synonyms: list[str] - :param encryption_key: A description of an encryption key that you create in Azure Key Vault. + :paramtype synonyms: list[str] + :keyword encryption_key: A description of an encryption key that you create in Azure Key Vault. This key is used to provide an additional level of encryption-at-rest for your data when you want full assurance that no one, not even Microsoft, can decrypt your data in Azure Cognitive Search. Once you have encrypted your data, it will always remain encrypted. Azure Cognitive @@ -772,9 +772,9 @@ class SynonymMap(msrest.serialization.Model): needed if you want to rotate your encryption key; Your data will be unaffected. Encryption with customer-managed keys is not available for free search services, and is only available for paid services created on or after January 1, 2019. - :type encryption_key: ~azure.search.documents.indexes.models.SearchResourceEncryptionKey - :param e_tag: The ETag of the synonym map. - :type e_tag: str + :paramtype encryption_key: ~azure.search.documents.indexes.models.SearchResourceEncryptionKey + :keyword e_tag: The ETag of the synonym map. + :paramtype e_tag: str """ _validation = { @@ -833,24 +833,24 @@ class SearchIndexerDataSourceConnection(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the datasource connection. - :type name: str - :param description: The description of the datasource connection. - :type description: str - :param type: Required. The type of the datasource connection. Possible values include: "azuresql", + :keyword name: Required. The name of the datasource connection. + :paramtype name: str + :keyword description: The description of the datasource connection. + :paramtype description: str + :keyword type: Required. The type of the datasource connection. Possible values include: "azuresql", "cosmosdb", "azureblob", "azuretable", "mysql", "adlsgen2". - :type type: str or ~azure.search.documents.indexes.models.SearchIndexerDataSourceType - :param connection_string: The connection string for the datasource connection. - :type connection_string: str - :param container: Required. The data container for the datasource connection. - :type container: ~azure.search.documents.indexes.models.SearchIndexerDataContainer - :param data_change_detection_policy: The data change detection policy for the datasource connection. - :type data_change_detection_policy: ~azure.search.documents.models.DataChangeDetectionPolicy - :param data_deletion_detection_policy: The data deletion detection policy for the datasource connection. - :type data_deletion_detection_policy: + :paramtype type: str or ~azure.search.documents.indexes.models.SearchIndexerDataSourceType + :keyword connection_string: The connection string for the datasource connection. + :paramtype connection_string: str + :keyword container: Required. The data container for the datasource connection. + :paramtype container: ~azure.search.documents.indexes.models.SearchIndexerDataContainer + :keyword data_change_detection_policy: The data change detection policy for the datasource connection. + :paramtype data_change_detection_policy: ~azure.search.documents.models.DataChangeDetectionPolicy + :keyword data_deletion_detection_policy: The data deletion detection policy for the datasource connection. + :paramtype data_deletion_detection_policy: ~azure.search.documents.models.DataDeletionDetectionPolicy - :param e_tag: The ETag of the data source. - :type e_tag: str + :keyword e_tag: The ETag of the data source. + :paramtype e_tag: str """ _validation = { From c4d64b2b520d173d6ff55272862b7f4660b1a290 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Mon, 13 Sep 2021 13:50:44 -0700 Subject: [PATCH 48/85] Sync eng/common directory with azure-sdk-tools for PR 1979 (#20666) * Move logic for removing empty sections to ChangeLog-Operations.ps1 * Refactor sections regex * Add SanitizeEntry parameter Co-authored-by: Chidozie Ononiwu --- eng/common/scripts/ChangeLog-Operations.ps1 | 42 ++++++++++++++++- eng/common/scripts/Update-ChangeLog.ps1 | 51 +++++---------------- 2 files changed, 52 insertions(+), 41 deletions(-) diff --git a/eng/common/scripts/ChangeLog-Operations.ps1 b/eng/common/scripts/ChangeLog-Operations.ps1 index 25423b0ea8ad..2de780150145 100644 --- a/eng/common/scripts/ChangeLog-Operations.ps1 +++ b/eng/common/scripts/ChangeLog-Operations.ps1 @@ -3,6 +3,7 @@ . "${PSScriptRoot}\SemVer.ps1" $RELEASE_TITLE_REGEX = "(?^\#+\s+(?$([AzureEngSemanticVersion]::SEMVER_REGEX))(\s+(?\(.+\))))" +$SECTIONS_HEADER_REGEX = "^###\s(?.*)" $CHANGELOG_UNRELEASED_STATUS = "(Unreleased)" $CHANGELOG_DATE_FORMAT = "yyyy-MM-dd" $RecommendedSectionHeaders = @("Features Added", "Breaking Changes", "Bugs Fixed", "Other Changes") @@ -56,7 +57,7 @@ function Get-ChangeLogEntriesFromContent { } else { if ($changeLogEntry) { - if ($line.Trim() -match "^###\s(?.*)") + if ($line.Trim() -match $SECTIONS_HEADER_REGEX) { $sectionName = $matches["sectionName"].Trim() $changeLogEntry.Sections[$sectionName] = @() @@ -289,3 +290,42 @@ function Set-ChangeLogContent { Set-Content -Path $ChangeLogLocation -Value $changeLogContent } + +function Remove-EmptySections { + param ( + [Parameter(Mandatory = $true)] + $ChangeLogEntry + ) + + $releaseContent = $ChangeLogEntry.ReleaseContent + $sectionsToRemove = @() + + if ($releaseContent.Count -gt 0) + { + $parsedSections = $ChangeLogEntry.Sections + $sanitizedReleaseContent = New-Object System.Collections.ArrayList(,$releaseContent) + + foreach ($key in @($parsedSections.Key)) + { + if ([System.String]::IsNullOrWhiteSpace($parsedSections[$key])) + { + for ($i = 0; $i -lt $sanitizedReleaseContent.Count; $i++) + { + $line = $sanitizedReleaseContent[$i] + if ($line -match $SECTIONS_HEADER_REGEX -and $matches["sectionName"].Trim() -eq $key) + { + $sanitizedReleaseContent.RemoveAt($i) + while($i -lt $sanitizedReleaseContent.Count -and [System.String]::IsNullOrWhiteSpace($sanitizedReleaseContent[$i])) + { + $sanitizedReleaseContent.RemoveAt($i) + } + $ChangeLogEntry.Sections.Remove($key) + break + } + } + } + } + $ChangeLogEntry.ReleaseContent = $sanitizedReleaseContent.ToArray() + } + return $changeLogEntry +} diff --git a/eng/common/scripts/Update-ChangeLog.ps1 b/eng/common/scripts/Update-ChangeLog.ps1 index 1524bd7318c1..43e97918bea1 100644 --- a/eng/common/scripts/Update-ChangeLog.ps1 +++ b/eng/common/scripts/Update-ChangeLog.ps1 @@ -4,6 +4,7 @@ # Version : Version to add or replace in change log # Unreleased: Default is true. If it is set to false, then today's date will be set in verion title. If it is True then title will show "Unreleased" # ReplaceLatestEntryTitle: Replaces the latest changelog entry title. +# SanitizeEntry: Removes all empty section in the entry that is updated param ( [Parameter(Mandatory = $true)] @@ -13,7 +14,8 @@ param ( [Boolean]$Unreleased = $true, [Boolean]$ReplaceLatestEntryTitle = $false, [String]$ChangelogPath, - [String]$ReleaseDate + [String]$ReleaseDate, + [Boolean]$SanitizeEntry = $false ) Set-StrictMode -Version 3 @@ -106,47 +108,12 @@ if ($LatestsSorted[0] -ne $Version) { if ($ReplaceLatestEntryTitle) { - # Remove empty sections from content - $sanitizedContent = @() - $sectionContent = @() - $sectionContentCount = 0 - $latesVersionContent = $ChangeLogEntries[$LatestVersion].ReleaseContent - - foreach ($line in $latesVersionContent) - { - if ($line.StartsWith("### ") -or $sectionContentCount -gt 0) - { - if ($line.StartsWith("#") -and $sectionContentCount -gt 1) - { - $sanitizedContent += $sectionContent - $sectionContent = @() - $sectionContentCount = 0 - } - - if ($line.StartsWith("#") -and $sectionContentCount -eq 1) - { - $sectionContent = @() - $sectionContentCount = 0 - } - - $sectionContent += $line - if (-not [System.String]::IsNullOrWhiteSpace($line)) - { - $sectionContentCount++ - } - } - elseif ($sectionContent.Count -eq 0) - { - $sanitizedContent += $line - } - } - - if ($sectionContentCount -gt 1) + $entryToBeUpdated = $ChangeLogEntries[$LatestVersion] + if ($SanitizeEntry) { - $sanitizedContent += $sectionContent + $entryToBeUpdated = Remove-EmptySections -ChangeLogEntry $entryToBeUpdated } - - $newChangeLogEntry = New-ChangeLogEntry -Version $Version -Status $ReleaseStatus -Content $sanitizedContent + $newChangeLogEntry = New-ChangeLogEntry -Version $Version -Status $ReleaseStatus -Content $entryToBeUpdated LogDebug "Resetting latest entry title to [$($newChangeLogEntry.ReleaseTitle)]" $ChangeLogEntries.Remove($LatestVersion) if ($newChangeLogEntry) { @@ -162,6 +129,10 @@ elseif ($ChangeLogEntries.Contains($Version)) LogDebug "Updating ReleaseStatus for Version [$Version] to [$($ReleaseStatus)]" $ChangeLogEntries[$Version].ReleaseStatus = $ReleaseStatus $ChangeLogEntries[$Version].ReleaseTitle = "## $Version $ReleaseStatus" + if ($SanitizeEntry) + { + $ChangeLogEntries[$Version] = Remove-EmptySections -ChangeLogEntry $ChangeLogEntries[$Version] + } } else { From ce307fe49ffb7c3eabaa5f336f3597fd782c566c Mon Sep 17 00:00:00 2001 From: Scott Addie <10702007+scottaddie@users.noreply.github.com> Date: Mon, 13 Sep 2021 17:23:16 -0500 Subject: [PATCH 49/85] Final consistency review of Monitor Query README (#20667) * Final consistency review of Monitor Query README * Add rate limits section --- sdk/monitor/azure-monitor-query/README.md | 236 +++++++++++----------- 1 file changed, 113 insertions(+), 123 deletions(-) diff --git a/sdk/monitor/azure-monitor-query/README.md b/sdk/monitor/azure-monitor-query/README.md index 16ed4a04e214..82ea4e8cfa0d 100644 --- a/sdk/monitor/azure-monitor-query/README.md +++ b/sdk/monitor/azure-monitor-query/README.md @@ -1,38 +1,43 @@ # Azure Monitor Query client library for Python -Azure Monitor helps you maximize the availability and performance of your apps. It delivers a comprehensive solution for collecting, analyzing, and acting on telemetry from your cloud and on-premises environments. +The Azure Monitor Query client library is used to execute read-only queries against [Azure Monitor][azure_monitor_overview]'s two data platforms: -All data collected by Azure Monitor fits into one of two fundamental types: +- [Logs](https://docs.microsoft.com/azure/azure-monitor/logs/data-platform-logs) - Collects and organizes log and performance data from monitored resources. Data from different sources such as platform logs from Azure services, log and performance data from virtual machines agents, and usage and performance data from apps can be consolidated into a single [Azure Log Analytics workspace](https://docs.microsoft.com/azure/azure-monitor/logs/data-platform-logs#log-analytics-workspaces). The various data types can be analyzed together using the [Kusto Query Language][kusto_query_language]. +- [Metrics](https://docs.microsoft.com/azure/azure-monitor/essentials/data-platform-metrics) - Collects numeric data from monitored resources into a time series database. Metrics are numerical values that are collected at regular intervals and describe some aspect of a system at a particular time. Metrics are lightweight and capable of supporting near real-time scenarios, making them particularly useful for alerting and fast detection of issues. -- **Metrics** - Numerical values that describe some aspect of a system at a particular time. They're lightweight and can support near real-time scenarios. -- **Logs** - Disparate types of data organized into records with different sets of properties for each type. Performance data and telemetry such as events, exceptions, and traces are stored as logs. +**Resources:** -To programmatically analyze these data sources, the Azure Monitor Query client library can be used. - -[Source code][python-query-src] | [Package (PyPI)][python-query-pypi] | [API reference documentation][python-query-ref-docs] | [Product documentation][python-query-product-docs] | [Samples][python-query-samples] | [Changelog][python-query-changelog] +- [Source code][source] +- [Package (PyPI)][package] +- [API reference documentation][python-query-ref-docs] +- [Service documentation][azure_monitor_overview] +- [Samples][samples] +- [Change log][changelog] ## Getting started ### Prerequisites -- Python 2.7, or 3.6 or later. -- An [Azure subscription][azure_subscription]. +- Python 2.7, or 3.6 or later +- An [Azure subscription][azure_subscription] +- To query Logs, you need an [Azure Log Analytics workspace][azure_monitor_create_using_portal]. +- To query Metrics, you need an Azure resource of any kind (Storage Account, Key Vault, Cosmos DB, etc.). ### Install the package Install the Azure Monitor Query client library for Python with [pip][pip]: ```bash -pip install azure-monitor-query --pre +pip install azure-monitor-query ``` ### Create the client -To interact with the Azure Monitor service, create an instance of a token credential. Use that instance when creating a `LogsQueryClient` or `MetricsQueryClient`. +An authenticated client is required to query Logs or Metrics. The library includes both synchronous and asynchronous forms of the clients. To authenticate, create an instance of a token credential. Use that instance when creating a `LogsQueryClient` or `MetricsQueryClient`. The following examples use `DefaultAzureCredential` from the [azure-identity](https://pypi.org/project/azure-identity/) package. #### Synchronous clients -Consider the following example, which creates synchronous clients for both logs and metrics querying: +Consider the following example, which creates synchronous clients for both Logs and Metrics querying: ```python from azure.identity import DefaultAzureCredential @@ -56,37 +61,23 @@ async_logs_client = LogsQueryClient(credential) async_metrics_client = MetricsQueryClient(credential) ``` -## Key concepts - -### Logs - -Azure Monitor Logs collects and organizes log and performance data from monitored resources. Data from different sources can be consolidated into a single workspace. Examples of data sources include: - -- Platform logs from Azure services. -- Log and performance data from virtual machine agents. -- Usage and performance data from apps. +### Execute the query -#### Azure Log Analytics workspaces +For examples of Logs and Metrics queries, see the [Examples](#examples) section. -Data collected by Azure Monitor Logs is stored in one or more [Log Analytics workspaces](https://docs.microsoft.com/azure/azure-monitor/logs/data-platform-logs#log-analytics-workspaces). The workspace defines the: - -- Geographic location of the data. -- Access rights defining which users can access data. -- Configuration settings, such as the pricing tier and data retention. - -#### Log queries +## Key concepts -Data from the disparate sources can be analyzed together using [Kusto Query Language (KQL)](https://docs.microsoft.com/azure/data-explorer/kusto/query/)—the same query language used by [Azure Data Explorer](https://docs.microsoft.com/azure/data-explorer/data-explorer-overview). Data is retrieved from a Log Analytics workspace using a KQL query—a read-only request to process data and return results. For more information, see [Log queries in Azure Monitor](https://docs.microsoft.com/azure/azure-monitor/logs/log-query-overview). +### Logs query rate limits and throttling -### Metrics +Each Azure Active Directory user is able to make up to 200 requests per 30 seconds, with no cap on the total calls per day. If requests are made at a rate higher than this, these requests will receive HTTP status code 429 (Too Many Requests) along with the `Retry-After: ` header. The header indicates the number of seconds until requests to this app are likely to be accepted. -Azure Monitor Metrics collects numeric data from monitored resources into a time series database. Metrics are collected at regular intervals and describe some aspect of a system at a particular time. Metrics in Azure Monitor are lightweight and can support near real-time scenarios. They're useful for alerting and fast detection of issues. Metrics can be: +In addition to call rate limits and daily quota caps, there are limits on queries themselves. Queries cannot: -- Analyzed interactively with [Metrics Explorer](https://docs.microsoft.com/azure/azure-monitor/essentials/metrics-getting-started). -- Used to receive notifications with an alert when a value crosses a threshold. -- Visualized in a workbook or dashboard. +- Return more than 500,000 rows. +- Return more than 64,000,000 bytes (~61 MiB total data). +- Run longer than 10 minutes by default. See this for details. -#### Metrics data structure +### Metrics data structure Each set of metric values is a time series with the following characteristics: @@ -99,19 +90,20 @@ Each set of metric values is a time series with the following characteristics: ## Examples -- [Single logs query](#single-logs-query) +- [Logs query](#logs-query) - [Specify timespan](#specify-timespan) - - [Set logs query timeout](#set-logs-query-timeout) + - [Handle logs query response](#handle-logs-query-response) - [Batch logs query](#batch-logs-query) -- [Query metrics](#query-metrics) -- [Handle metrics response](#handle-metrics-response) - - [Example of handling response](#example-of-handling-response) -- [Advanced scenarios](#advanced-scenarios) +- [Advanced logs query scenarios](#advanced-logs-query-scenarios) + - [Set logs query timeout](#set-logs-query-timeout) - [Query multiple workspaces](#query-multiple-workspaces) +- [Metrics query](#metrics-query) + - [Handle metrics query response](#handle-metrics-query-response) + - [Example of handling response](#example-of-handling-response) -### Single logs query +### Logs query -This example shows getting a log query. To handle the response and view it in a tabular form, the [pandas](https://pypi.org/project/pandas/) library is used. See the [samples][python-query-samples] if you choose not to use pandas. +This example shows getting a logs query. To handle the response and view it in a tabular form, the [pandas](https://pypi.org/project/pandas/) library is used. See the [samples][samples] if you choose not to use pandas. #### Specify timespan @@ -150,29 +142,45 @@ for table in response.tables: print(df) ``` -#### Set logs query timeout +#### Handle logs query response -The following example shows setting a server timeout in seconds. A gateway timeout is raised if the query takes more time than the mentioned timeout. The default is 180 seconds and can be set up to 10 minutes (600 seconds). +The `query` API returns the `LogsQueryResult` while the `batch_query` API returns list of `LogsQueryResult`. Here's a hierarchy of the response: + +``` +LogsQueryResult +|---statistics +|---visualization +|---error +|---tables (list of `LogsTable` objects) + |---name + |---rows + |---columns (list of `LogsTableColumn` objects) + |---name + |---type +``` + +For example, to handle a logs query response with tables and display it using pandas: ```python -import os -import pandas as pd -from azure.monitor.query import LogsQueryClient -from azure.identity import DefaultAzureCredential +table = response.tables[0] +df = pd.DataFrame(table.rows, columns=[col.name for col in table.columns]) +``` -credential = DefaultAzureCredential() -client = LogsQueryClient(credential) +A full sample can be found [here](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/monitor/azure-monitor-query/samples/sample_log_query_client.py). -response = client.query( - os.environ['LOG_WORKSPACE_ID'], - "range x from 1 to 10000000000 step 1 | count", - server_timeout=1, - ) +In a similar fashion, to handle a batch logs query response: + +```python +for result in response: + table = result.tables[0] + df = pd.DataFrame(table.rows, columns=[col.name for col in table.columns]) ``` +A full sample can be found [here](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/monitor/azure-monitor-query/samples/sample_batch_query.py). + ### Batch logs query -The following example demonstrates sending multiple queries at the same time using batch query API. The queries can either be represented as a list of `LogQueryRequest` objects or a dictionary. This example uses the former approach. +The following example demonstrates sending multiple queries at the same time using batch query API. The queries can either be represented as a list of `LogsBatchQuery` objects or a dictionary. This example uses the former approach. ```python import os @@ -196,7 +204,7 @@ requests = [ timespan=(datetime(2021, 6, 2), timedelta(hours=1)), workspace_id=os.environ['LOG_WORKSPACE_ID'] ), - LogsBatchQueryRequest( + LogsBatchQuery( query= "AppRequests | take 2", workspace_id=os.environ['LOG_WORKSPACE_ID'] ), @@ -213,43 +221,51 @@ for rsp in response: print(df) ``` -#### Handling the response for Logs Query +### Advanced logs query scenarios -The `query` API returns the `LogsQueryResult` while the `batch_query` API returns list of `LogsQueryResult`. +#### Set logs query timeout -Here is a heirarchy of the response: +The following example shows setting a server timeout in seconds. A gateway timeout is raised if the query takes more time than the mentioned timeout. The default is 180 seconds and can be set up to 10 minutes (600 seconds). -``` -LogsQueryResult -|---statistics -|---visualization -|---error -|---tables (list of `LogsTable` objects) - |---name - |---rows - |---columns (list of `LogsTableColumn` objects) - |---name - |---type -``` +```python +import os +import pandas as pd +from azure.monitor.query import LogsQueryClient +from azure.identity import DefaultAzureCredential -So, to handle a response with tables and display it using pandas, +credential = DefaultAzureCredential() +client = LogsQueryClient(credential) -```python -table = response.tables[0] -df = pd.DataFrame(table.rows, columns=[col.name for col in table.columns]) +response = client.query( + os.environ['LOG_WORKSPACE_ID'], + "range x from 1 to 10000000000 step 1 | count", + server_timeout=1, + ) ``` -A full sample can be found [here](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/monitor/azure-monitor-query/samples/sample_log_query_client.py). -In a very similar fashion, to handle a batch response, +#### Query multiple workspaces + +The same logs query can be executed across multiple Log Analytics workspaces. In addition to the Kusto query, the following parameters are required: + +- `workspace_id` - The first (primary) workspace ID. +- `additional_workspaces` - A list of workspaces, excluding the workspace provided in the `workspace_id` parameter. The parameter's list items may consist of the following identifier formats: + - Qualified workspace names + - Workspace IDs + - Azure resource IDs + +For example, the following query executes in three workspaces: ```python -for result in response: - table = result.tables[0] - df = pd.DataFrame(table.rows, columns=[col.name for col in table.columns]) +client.query( + , + query, + additional_workspaces=['', ''] + ) ``` -A full sample can be found [here](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/monitor/azure-monitor-query/samples/sample_batch_query.py). -### Query metrics +A full sample can be found [here](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/monitor/azure-monitor-query/samples/sample_log_query_multiple_workspaces.py). + +### Metrics query The following example gets metrics for an Event Grid subscription. The resource URI is that of an event grid topic. @@ -285,7 +301,7 @@ for metric in response.metrics: print(metric_value.time_stamp) ``` -### Handle metrics response +#### Handle metrics query response The metrics query API returns a `MetricsResult` object. The `MetricsResult` object contains properties such as a list of `Metric`-typed objects, `granularity`, `namespace`, and `timespan`. The `Metric` objects list can be accessed using the `metrics` param. Each `Metric` object in this list contains a list of `TimeSeriesElement` objects. Each `TimeSeriesElement` contains `data` and `metadata_values` properties. In visual form, the object hierarchy of the response resembles the following structure: @@ -337,30 +353,6 @@ for metric in response.metrics: ) ``` -### Advanced scenarios - -#### Query multiple workspaces - -The same log query can be executed across multiple Log Analytics workspaces. In addition to the KQL query, the following parameters are required: - -- `workspace_id` - The first (primary) workspace ID. -- `additional_workspaces` - A list of workspaces, excluding the workspace provided in the `workspace_id` parameter. The parameter's list items may consist of the following identifier formats: - - Qualified workspace names - - Workspace IDs - - Azure resource IDs - -For example, the following query executes in three workspaces: - -```python -client.query( - , - query, - additional_workspaces=['', ''] - ) -``` - -A full sample can be found [here](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/monitor/azure-monitor-query/samples/sample_log_query_multiple_workspaces.py). - ## Troubleshooting Enable the `azure.monitor.query` logger to collect traces from the library. @@ -379,9 +371,7 @@ Optional keyword arguments can be passed in at the client and per-operation leve ## Next steps -### Additional documentation - -For more extensive documentation, see the [Azure Monitor Query documentation][python-query-product-docs]. +To learn more about Azure Monitor, see the [Azure Monitor service documentation][azure_monitor_overview]. ## Contributing @@ -393,19 +383,19 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con -[azure_cli_link]: https://pypi.org/project/azure-cli/ -[python-query-src]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/monitor/azure-monitor-query/ -[python-query-pypi]: https://aka.ms/azsdk-python-monitor-query-pypi -[python-query-product-docs]: https://docs.microsoft.com/azure/azure-monitor/ -[python-query-ref-docs]: https://docs.microsoft.com/python/api/overview/azure/monitor-query-readme?view=azure-python-preview -[python-query-samples]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/monitor/azure-monitor-query/samples -[python-query-changelog]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/monitor/azure-monitor-query/CHANGELOG.md -[pip]: https://pypi.org/project/pip/ - [azure_core_exceptions]: https://aka.ms/azsdk/python/core/docs#module-azure.core.exceptions -[python_logging]: https://docs.python.org/3/library/logging.html [azure_core_ref_docs]: https://aka.ms/azsdk/python/core/docs +[azure_monitor_create_using_portal]: https://docs.microsoft.com/azure/azure-monitor/logs/quick-create-workspace +[azure_monitor_overview]: https://docs.microsoft.com/azure/azure-monitor/ [azure_subscription]: https://azure.microsoft.com/free/python/ +[changelog]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/monitor/azure-monitor-query/CHANGELOG.md +[kusto_query_language]: https://docs.microsoft.com/azure/data-explorer/kusto/query/ +[package]: https://aka.ms/azsdk-python-monitor-query-pypi +[pip]: https://pypi.org/project/pip/ +[python_logging]: https://docs.python.org/3/library/logging.html +[python-query-ref-docs]: https://docs.microsoft.com/python/api/overview/azure/monitor-query-readme?view=azure-python-preview +[samples]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/monitor/azure-monitor-query/samples +[source]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/monitor/azure-monitor-query/ [cla]: https://cla.microsoft.com [code_of_conduct]: https://opensource.microsoft.com/codeofconduct/ From 69be40d75fcf29c69393c342982e426dfd499335 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?McCoy=20Pati=C3=B1o?= <39780829+mccoyp@users.noreply.github.com> Date: Mon, 13 Sep 2021 15:35:26 -0700 Subject: [PATCH 50/85] [Key Vault] Update new test resource script (#20663) --- sdk/keyvault/test-resources.json | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sdk/keyvault/test-resources.json b/sdk/keyvault/test-resources.json index d22bd550fd57..cadd04d8b6d5 100644 --- a/sdk/keyvault/test-resources.json +++ b/sdk/keyvault/test-resources.json @@ -23,6 +23,12 @@ "description": "The client OID to grant access to test resources." } }, + "provisionerApplicationOid": { + "type": "string", + "metadata": { + "description": "The provisioner OID to grant access to test resources." + } + }, "location": { "type": "string", "defaultValue": "[resourceGroup().location]", @@ -188,9 +194,7 @@ }, "properties": { "tenantId": "[parameters('tenantId')]", - "initialAdminObjectIds": [ - "[parameters('testApplicationOid')]" - ], + "initialAdminObjectIds": "[union(array(parameters('testApplicationOid')), array(parameters('provisionerApplicationOid')))]", "enablePurgeProtection": false, "enableSoftDelete": true, "publicNetworkAccess": "Enabled", From 3eb0af9356a93ea9f17be8c240b94768849ed5b2 Mon Sep 17 00:00:00 2001 From: William Harding Date: Mon, 13 Sep 2021 16:06:06 -0700 Subject: [PATCH 51/85] Updated notebooks to make them more "general" (#15660) * Updated notebooks to make them more "general" * updated gitignore, added models, updated path * reverted gitignore * reverting gitignore * Renamed some files, changed model id to be more generic --- .../samples/notebooks/01_Patrons.ipynb | 605 ++++++ .../notebooks/02_Purchasing_Tickets.ipynb | 1695 +++++++++++++++++ ...3_Adding_a_bunch of_other_components.ipynb | 649 +++++++ .../notebooks/04_Lots_on_Queries.ipynb | 1197 ++++++++++++ .../samples/notebooks/models/Patron.json | 43 + .../samples/notebooks/models/area.json | 28 + .../samples/notebooks/models/line.json | 35 + .../samples/notebooks/models/ticket.json | 63 + .../samples/notebooks/readme.md | 20 + 9 files changed, 4335 insertions(+) create mode 100644 sdk/digitaltwins/azure-digitaltwins-core/samples/notebooks/01_Patrons.ipynb create mode 100644 sdk/digitaltwins/azure-digitaltwins-core/samples/notebooks/02_Purchasing_Tickets.ipynb create mode 100644 sdk/digitaltwins/azure-digitaltwins-core/samples/notebooks/03_Adding_a_bunch of_other_components.ipynb create mode 100644 sdk/digitaltwins/azure-digitaltwins-core/samples/notebooks/04_Lots_on_Queries.ipynb create mode 100644 sdk/digitaltwins/azure-digitaltwins-core/samples/notebooks/models/Patron.json create mode 100644 sdk/digitaltwins/azure-digitaltwins-core/samples/notebooks/models/area.json create mode 100644 sdk/digitaltwins/azure-digitaltwins-core/samples/notebooks/models/line.json create mode 100644 sdk/digitaltwins/azure-digitaltwins-core/samples/notebooks/models/ticket.json create mode 100644 sdk/digitaltwins/azure-digitaltwins-core/samples/notebooks/readme.md diff --git a/sdk/digitaltwins/azure-digitaltwins-core/samples/notebooks/01_Patrons.ipynb b/sdk/digitaltwins/azure-digitaltwins-core/samples/notebooks/01_Patrons.ipynb new file mode 100644 index 000000000000..5fa433175299 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/samples/notebooks/01_Patrons.ipynb @@ -0,0 +1,605 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# The Patron\n", + "## An example of the Digital Twin\n", + "\n", + "This example just includes:\n", + "* Connecting\n", + "* Uploading models\n", + "* Creating twins\n", + "* Querying twins\n", + "\n", + "It's not a lot, but it will all tie together when we start running scenarios. \n", + "\n", + "[This is the SDK repo on Github](https://github.com/Azure/azure-sdk-for-python/tree/4559e19e2f3146a49f1eba1706bb798071f4a1f5/sdk/digitaltwins/azure-digitaltwins-core)\n", + "\n", + "[Here is the doc on the query language](https://docs.microsoft.com/en-us/azure/digital-twins/concepts-query-language)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Connecting\n", + "\n", + "**note**: you will need to replace {`home-test-twin.api.wcus.digitaltwins.azure.net`} with the address of your ADT. " + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "from azure.identity import AzureCliCredential\n", + "from azure.digitaltwins.core import DigitalTwinsClient\n", + "\n", + "# using yaml instead of \n", + "import yaml\n", + "import uuid\n", + "\n", + "# using altair instead of matplotlib for vizuals\n", + "import numpy as np\n", + "import pandas as pd\n", + "\n", + "# you will get this from the ADT resource at portal.azure.com\n", + "your_digital_twin_url = \"home-test-twin.api.wcus.digitaltwins.azure.net\"\n", + "\n", + "azure_cli = AzureCliCredential()\n", + "service_client = DigitalTwinsClient(\n", + " your_digital_twin_url, azure_cli)\n", + "service_client" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "service_client" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Loading the model from a local Json file, I'm defining a model for a `Patron`. That's like a `class` that will be used to make several instances of a customer." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Uploading models" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [], + "source": [ + "patron_model_id = \"dtmi:mymodels:patron;1\"" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [], + "source": [ + "# # Delete the model that you don't want. \n", + "# service_client.delete_model(patron_model_id)\n", + "\n", + "# # Create it if you just deleted it.\n", + "# patron_model_json = yaml.safe_load(open(\"models/patron.json\"))\n", + "# service_client.create_models([patron_model_json])" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Note that the json must be in a list. This is so that you can deploy several models in a single go." + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'display_name': {'en': 'Patron'},\n", + " 'description': {'en': 'As an example, contains all of the properties possible in the DTDL.'},\n", + " 'id': 'dtmi:billmanh:patron;1',\n", + " 'upload_time': '2020-11-19T02:14:27.21094Z',\n", + " 'decommissioned': False}" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Get the Patron model\n", + "get_model = service_client.get_model(patron_model_id)\n", + "get_model.as_dict()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In my case I use `customer` as an _instance_ of a model (a _twin_). The only thing to add is the information specific to the twin I want to upload. " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Creating twins" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [], + "source": [ + "digital_twin_id = 'customer-' + str(uuid.uuid4())\n", + "\n", + "customer_json = {\n", + " \"$metadata\": {\n", + " \"$model\": patron_model_id\n", + " },\n", + " \"satisfaction\": 10,\n", + " \"totalWaitTime\": 10\n", + "}\n", + "\n", + "created_twin = service_client.upsert_digital_twin(digital_twin_id, customer_json)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "You can see that the process with the API is simple:\n", + "* Define a model\n", + "* Build a twin from that model\n", + "* Give that model some attributes.\n" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "dict" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "type(created_twin)" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'$dtId': 'customer-3cbd5e60-957d-44ff-944f-9adb42a20a52',\n", + " '$etag': 'W/\"ea33ae65-f47c-4116-8e3d-1c6fa61777d6\"',\n", + " 'satisfaction': 10,\n", + " 'totalWaitTime': 10,\n", + " '$metadata': {'$model': 'dtmi:billmanh:patron;1',\n", + " 'satisfaction': {'lastUpdateTime': '2020-11-19T15:48:13.1057699Z'},\n", + " 'totalWaitTime': {'lastUpdateTime': '2020-11-19T15:48:13.1057699Z'}}}" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "created_twin" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "So let's create a bunch of people. Let's pretend we have a single room full of a bunch of people that all have similar attributes:\n", + "* `satisfaction` varies from person to person.\n", + "* `totalWaitTime` is the same at the beginning. \n", + "\n", + "the item for the `$metadata` is the model that it will be an instance of. The rest of the items in the dict are the `contents` of the model as you defined it.\n" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[('customer-5c454e2f-f70b-4352-b75a-958f1a49beba',\n", + " {'$metadata': {'$model': 'dtmi:billmanh:patron;1'},\n", + " 'satisfaction': 7,\n", + " 'totalWaitTime': 0}),\n", + " ('customer-26196fee-5ffd-457a-86b7-192a998f3cf2',\n", + " {'$metadata': {'$model': 'dtmi:billmanh:patron;1'},\n", + " 'satisfaction': 9,\n", + " 'totalWaitTime': 0}),\n", + " ('customer-e6f49d8a-711b-41c3-9db8-c7ece3dbc32c',\n", + " {'$metadata': {'$model': 'dtmi:billmanh:patron;1'},\n", + " 'satisfaction': 7,\n", + " 'totalWaitTime': 0}),\n", + " ('customer-c87adbfa-1c6e-4ea9-9f03-83e3877ef5fc',\n", + " {'$metadata': {'$model': 'dtmi:billmanh:patron;1'},\n", + " 'satisfaction': 8,\n", + " 'totalWaitTime': 0}),\n", + " ('customer-21e17d28-76c3-4c04-8df9-396703692a68',\n", + " {'$metadata': {'$model': 'dtmi:billmanh:patron;1'},\n", + " 'satisfaction': 8,\n", + " 'totalWaitTime': 0})]" + ] + }, + "execution_count": 13, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "def create_new_customer():\n", + " digital_twin_id = 'customer-' + str(uuid.uuid4())\n", + " customer_json = {\n", + " \"$metadata\": {\n", + " \"$model\": patron_model_id\n", + " },\n", + " \"satisfaction\": np.random.randint(5,10),\n", + " \"totalWaitTime\": 0\n", + " }\n", + " return digital_twin_id,customer_json\n", + " \n", + "customer_twin_examples = [create_new_customer() for i in range(40)]\n", + "customer_twin_examples[:5]" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "\n", + "
\n", + "" + ], + "text/plain": [ + "alt.Chart(...)" + ] + }, + "execution_count": 22, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "customer_df = pd.DataFrame([i[1] for i in customer_twin_examples])\n", + "\n", + "customer_df" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Of course, those are just local customer data points. You could imagine that this is information collected at the edge. \n", + "\n", + "Now let's upload those people to see them in the cloud. Try to imagine that each customer in the store had an app on their phone that sent this information to the graph. Each `customer` represents a data feed from IoT telemetry. Generally, each device would upload a separate feed of IoT, but we are simulating using a single device (your computer) to upload this data.\n" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": {}, + "outputs": [], + "source": [ + "for i in customer_twin_examples:\n", + " service_client.upsert_digital_twin(i[0], i[1])" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Now let's query our customers to see how they are feeling. " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Querying twins\n", + "This is pretty easy. If you've ever done SQL you'll get this right away.\n" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": {}, + "outputs": [], + "source": [ + "query_expression = 'SELECT * FROM digitaltwins'\n", + "query_result = service_client.query_twins(query_expression)" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": {}, + "outputs": [], + "source": [ + "for i in query_result:\n", + " pass" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'$dtId': 'customer-2e551c55-265a-46e0-a84b-4965bc734e21',\n", + " '$etag': 'W/\"8f1be988-70af-4488-a7c9-5403a4b6ea1d\"',\n", + " 'satisfaction': 9,\n", + " 'totalWaitTime': 0,\n", + " '$metadata': {'$model': 'dtmi:billmanh:patron;1',\n", + " 'satisfaction': {'lastUpdateTime': '2020-11-19T16:13:44.9882083Z'},\n", + " 'totalWaitTime': {'lastUpdateTime': '2020-11-19T16:13:44.9882083Z'}}}" + ] + }, + "execution_count": 29, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "i" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Let's say I want to get all of the customers that have > 7 satisfaction _Happy customers_" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [], + "source": [ + "query_result = service_client.query_twins(\n", + "\"\"\"\n", + "SELECT *\n", + "FROM DigitalTwins T \n", + "WHERE T.satisfaction > 7\n", + "\"\"\"\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "customer-cc04f3b6-39b0-4cef-bfff-a7d668cce446 10\n", + "customer-3cbd5e60-957d-44ff-944f-9adb42a20a52 10\n", + "customer-26196fee-5ffd-457a-86b7-192a998f3cf2 9\n", + "customer-c87adbfa-1c6e-4ea9-9f03-83e3877ef5fc 8\n", + "customer-21e17d28-76c3-4c04-8df9-396703692a68 8\n", + "customer-8375cece-abf8-400f-be66-459f7f40fe6a 8\n", + "customer-d0483de8-0f9f-41d4-ac0c-84d608f7467a 8\n", + "customer-8ae03d4b-ee2c-4ffd-9aa8-8edbfbf39728 9\n", + "customer-fc568319-d5a9-492a-83ce-fed774257003 8\n", + "customer-d9ca8715-1a6d-43ea-83d2-671fc972ebd7 9\n", + "customer-acd7a91f-1d28-46b3-894d-6f3953fbd85e 8\n", + "customer-a867aacb-68a7-4872-a3bb-330b0b34ef7c 9\n", + "customer-373017d3-d7e2-4407-8c5b-5fc44e20286f 9\n", + "customer-418cbc74-b101-4f50-8cf0-6075a2a8053c 8\n", + "customer-04cc7f9d-5503-4d64-8dbc-373a47a8710a 9\n", + "customer-e5d090d6-ae68-4c31-890e-16ce96c1e462 9\n", + "customer-12a558cf-b15d-41ee-a98b-d07c4b7411ee 8\n", + "customer-1c51c2a0-45bc-442c-b4df-1d193e11f628 8\n", + "customer-ca674938-4d13-463f-8858-e0b9ac5deebc 9\n", + "customer-2139a9c9-ff79-4a63-9576-c34744f0521d 9\n", + "customer-2e551c55-265a-46e0-a84b-4965bc734e21 9\n", + "customer-107c1168-d86b-40e1-a57d-4c500148e172 10\n", + "customer-73299891-e2f2-4d29-98f1-9d2ee0e9f12b 9\n", + "customer-d1de64aa-cfc2-4385-9644-667506f0f474 9\n", + "customer-d4e84d9f-ee9d-45e8-ba9f-d9d90885f578 9\n", + "customer-b7a9fbba-8e06-4b23-ac39-35acfbacfe7c 8\n", + "customer-83f65979-cd94-41da-b248-c6a1a76e2f13 9\n", + "customer-84e9f81b-db4c-40c7-8284-230a357937a7 8\n", + "customer-06c5c57e-aec0-47c4-ac78-b986e589da15 8\n", + "customer-26a50817-189d-48cf-8ecc-efa9828f092a 9\n", + "customer-45e9aa03-733d-4a99-b9d5-94f1c6b04214 9\n", + "customer-0234cb48-1fa2-43e0-b69d-36a6ff269666 9\n", + "customer-048f85a8-173e-4305-92b8-ead2a748b07f 8\n", + "customer-25e19268-3433-4f09-afe3-94f466313368 10\n" + ] + } + ], + "source": [ + "for i in query_result:\n", + " print (i['$dtId'],i['satisfaction'])" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Of course, you can just pull everything, but this might be problematic as you build a larger model. " + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "metadata": {}, + "outputs": [], + "source": [ + "query_result = service_client.query_twins(\n", + "\"\"\"\n", + "SELECT COUNT() \n", + "FROM DigitalTwins \n", + "\"\"\"\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'COUNT': 88}\n" + ] + } + ], + "source": [ + "for i in query_result:\n", + " print(i)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python (azure_test)", + "language": "python", + "name": "azure_test" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.9" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} \ No newline at end of file diff --git a/sdk/digitaltwins/azure-digitaltwins-core/samples/notebooks/02_Purchasing_Tickets.ipynb b/sdk/digitaltwins/azure-digitaltwins-core/samples/notebooks/02_Purchasing_Tickets.ipynb new file mode 100644 index 000000000000..f5f2199c7661 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/samples/notebooks/02_Purchasing_Tickets.ipynb @@ -0,0 +1,1695 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Purchasing tickets\n", + "## An example use case of the Digital Twin\n", + "\n", + "This example just includes:\n", + "* Connecting\n", + "* Building relationships between models\n", + "* Updating values\n", + "* Modifying the relationships and updating twins\n", + "* Querying twins by relationship\n", + "\n", + "In the previous scenario we made a bunch of customers. In this scenario we built a bunch of individual users \n", + "[This is the SDK repo on Github](https://github.com/Azure/azure-sdk-for-python/tree/4559e19e2f3146a49f1eba1706bb798071f4a1f5/sdk/digitaltwins/azure-digitaltwins-core)\n", + "\n", + "[Here is the doc on the query language](https://docs.microsoft.com/en-us/azure/digital-twins/concepts-query-language)\n" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 1, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "from azure.identity import AzureCliCredential\n", + "from azure.digitaltwins.core import DigitalTwinsClient\n", + "\n", + "# using yaml instead of \n", + "import yaml\n", + "import uuid\n", + "\n", + "# using altair instead of matplotlib for vizuals\n", + "import numpy as np\n", + "import pandas as pd\n", + "\n", + "# you will get this from the ADT resource at portal.azure.com\n", + "your_digital_twin_url = \"home-test-twin.api.wcus.digitaltwins.azure.net\"\n", + "\n", + "azure_cli = AzureCliCredential()\n", + "service_client = DigitalTwinsClient(\n", + " your_digital_twin_url, azure_cli)\n", + "service_client" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "So from the previous notebook we uploaded some models. " + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'display_name': {'en': 'Patron'},\n", + " 'description': {'en': 'As an example, contains all of the properties possible in the DTDL.'},\n", + " 'id': 'dtmi:billmanh:patron;1',\n", + " 'upload_time': '2020-11-30T00:26:34.514069Z',\n", + " 'decommissioned': False}" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "patron = service_client.get_model(\"dtmi:mymodels:patron;1\")\n", + "patron.as_dict()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "And we have several `customers` in our ecosystem that are made from the `patron` model." + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [], + "source": [ + "query_expression = \"SELECT * FROM digitaltwins t where IS_OF_MODEL('dtmi:billmanh:patron;1')\"\n", + "query_result = service_client.query_twins(query_expression)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**Note** the query object loves to drop values. To keep from making multiple queries, save the data somewhere. " + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [], + "source": [ + "values = []\n", + "for i in query_result:\n", + " values.append(i)" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [], + "source": [ + "df_customers = pd.DataFrame([[i['$dtId'],i['satisfaction']] for i in values],\n", + " columns=['id','satisfaction'])" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
idsatisfaction
0customer-cc04f3b6-39b0-4cef-bfff-a7d668cce44610
1customer-3cbd5e60-957d-44ff-944f-9adb42a20a5210
2customer-5c454e2f-f70b-4352-b75a-958f1a49beba7
3customer-26196fee-5ffd-457a-86b7-192a998f3cf29
4customer-e6f49d8a-711b-41c3-9db8-c7ece3dbc32c7
.........
79customer-45e9aa03-733d-4a99-b9d5-94f1c6b042149
80customer-0234cb48-1fa2-43e0-b69d-36a6ff2696669
81customer-75b2f757-faee-4a85-bc93-e6e9ff7cd8916
82customer-048f85a8-173e-4305-92b8-ead2a748b07f8
83customer-25e19268-3433-4f09-afe3-94f46631336810
\n", + "

84 rows × 2 columns

\n", + "
" + ], + "text/plain": [ + " id satisfaction\n", + "0 customer-cc04f3b6-39b0-4cef-bfff-a7d668cce446 10\n", + "1 customer-3cbd5e60-957d-44ff-944f-9adb42a20a52 10\n", + "2 customer-5c454e2f-f70b-4352-b75a-958f1a49beba 7\n", + "3 customer-26196fee-5ffd-457a-86b7-192a998f3cf2 9\n", + "4 customer-e6f49d8a-711b-41c3-9db8-c7ece3dbc32c 7\n", + ".. ... ...\n", + "79 customer-45e9aa03-733d-4a99-b9d5-94f1c6b04214 9\n", + "80 customer-0234cb48-1fa2-43e0-b69d-36a6ff269666 9\n", + "81 customer-75b2f757-faee-4a85-bc93-e6e9ff7cd891 6\n", + "82 customer-048f85a8-173e-4305-92b8-ead2a748b07f 8\n", + "83 customer-25e19268-3433-4f09-afe3-94f466313368 10\n", + "\n", + "[84 rows x 2 columns]" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "df_customers" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Let's add another model for `tickets`. In our very simple model, we will assume that `customers` will buy `tickets` to our events." + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [], + "source": [ + "# service_client.delete_model(ticket_model_id)" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [], + "source": [ + "# ticket_model_json = yaml.safe_load(open(\"models/ticket.json\"))\n", + "# service_client.create_models([ticket_model_json])" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'display_name': {'en': 'ticket'},\n", + " 'description': {'en': 'an abstract ticket'},\n", + " 'id': 'dtmi:billmanh:ticket;1',\n", + " 'upload_time': '2020-11-26T20:12:34.578813Z',\n", + " 'decommissioned': False}" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "ticket_model_id = \"dtmi:mymodels:ticket;1\"\n", + "get_model = service_client.get_model(ticket_model_id)\n", + "get_model.as_dict()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Note that the dict returned from the service doesn't contain all of the values that you created, but that's ok. " + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [], + "source": [ + "def generate_twin(name,model_id):\n", + " digital_twin_id = f'{name}-{str(uuid.uuid4())}'\n", + " dt_json = {\n", + " \"$metadata\": {\n", + " \"$model\": model_id\n", + " }\n", + " }\n", + " return digital_twin_id,dt_json\n", + "\n", + "def updsert_twin():\n", + " created_twin = service_client.upsert_digital_twin(digital_twin_id, dt_json)\n", + " return created_twin" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [], + "source": [ + "ticket_id, ticket_json = generate_twin(\"ticket\",ticket_model_id)" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'$metadata': {'$model': 'dtmi:billmanh:ticket;1'}}" + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "ticket_json" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "So when I create the `tickets` I’m going to create them as unsold (`available`) and for a range of events. I'm just going to introduce some tickets into the system for some shows coming up. These tickets just exist locally at this point, but we will 'go live' when we push them into the ecosystem." + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
$metadataevent_titlestateticket_locationuid
0{'$model': 'dtmi:billmanh:ticket;1'}Nirvanaopen0ticket-b10211a2-1a7a-4f6f-9fc3-d23daefe8cbe
1{'$model': 'dtmi:billmanh:ticket;1'}Nirvanaopen1ticket-d1d2ad08-add8-4f5f-97cf-0b6516914cc9
2{'$model': 'dtmi:billmanh:ticket;1'}Nirvanaopen2ticket-260e3349-adc5-41af-9ae5-4f3690d813c7
3{'$model': 'dtmi:billmanh:ticket;1'}Nirvanaopen3ticket-9f2bc5f4-b7d6-4f86-a1f8-c570cb263717
4{'$model': 'dtmi:billmanh:ticket;1'}Nirvanaopen4ticket-cf70a216-0183-4458-8e13-94f432f7b8c0
5{'$model': 'dtmi:billmanh:ticket;1'}Smashing Pumpkinsopen0ticket-57a45e6f-f42a-41b0-a0f5-68e5e0fd67ba
6{'$model': 'dtmi:billmanh:ticket;1'}Smashing Pumpkinsopen1ticket-7f414b3f-fde6-4cbc-ad58-86c7ccfb1109
7{'$model': 'dtmi:billmanh:ticket;1'}Smashing Pumpkinsopen2ticket-2d69b397-3ec3-4588-9eaf-5eb931f1f8c4
8{'$model': 'dtmi:billmanh:ticket;1'}Smashing Pumpkinsopen3ticket-e9fc6ad3-d7ad-4ef1-8a58-0759a0f27a00
9{'$model': 'dtmi:billmanh:ticket;1'}Smashing Pumpkinsopen4ticket-dc48bc69-b1f5-4850-b5af-037c4ea72961
10{'$model': 'dtmi:billmanh:ticket;1'}Foo Fightersopen0ticket-b7a550e8-0fa8-46ff-8b4c-1a290a5d706c
11{'$model': 'dtmi:billmanh:ticket;1'}Foo Fightersopen1ticket-92826a40-b024-4b91-a4d2-7e20dcfddce3
12{'$model': 'dtmi:billmanh:ticket;1'}Foo Fightersopen2ticket-8c483b5c-37d4-4027-8d67-d920bf8ca063
13{'$model': 'dtmi:billmanh:ticket;1'}Foo Fightersopen3ticket-09028447-8e23-4e4f-a100-098a4dc8e919
14{'$model': 'dtmi:billmanh:ticket;1'}Foo Fightersopen4ticket-ccc89397-0d52-42a3-8fe1-39c97158c87c
\n", + "
" + ], + "text/plain": [ + " $metadata event_title state \\\n", + "0 {'$model': 'dtmi:billmanh:ticket;1'} Nirvana open \n", + "1 {'$model': 'dtmi:billmanh:ticket;1'} Nirvana open \n", + "2 {'$model': 'dtmi:billmanh:ticket;1'} Nirvana open \n", + "3 {'$model': 'dtmi:billmanh:ticket;1'} Nirvana open \n", + "4 {'$model': 'dtmi:billmanh:ticket;1'} Nirvana open \n", + "5 {'$model': 'dtmi:billmanh:ticket;1'} Smashing Pumpkins open \n", + "6 {'$model': 'dtmi:billmanh:ticket;1'} Smashing Pumpkins open \n", + "7 {'$model': 'dtmi:billmanh:ticket;1'} Smashing Pumpkins open \n", + "8 {'$model': 'dtmi:billmanh:ticket;1'} Smashing Pumpkins open \n", + "9 {'$model': 'dtmi:billmanh:ticket;1'} Smashing Pumpkins open \n", + "10 {'$model': 'dtmi:billmanh:ticket;1'} Foo Fighters open \n", + "11 {'$model': 'dtmi:billmanh:ticket;1'} Foo Fighters open \n", + "12 {'$model': 'dtmi:billmanh:ticket;1'} Foo Fighters open \n", + "13 {'$model': 'dtmi:billmanh:ticket;1'} Foo Fighters open \n", + "14 {'$model': 'dtmi:billmanh:ticket;1'} Foo Fighters open \n", + "\n", + " ticket_location uid \n", + "0 0 ticket-b10211a2-1a7a-4f6f-9fc3-d23daefe8cbe \n", + "1 1 ticket-d1d2ad08-add8-4f5f-97cf-0b6516914cc9 \n", + "2 2 ticket-260e3349-adc5-41af-9ae5-4f3690d813c7 \n", + "3 3 ticket-9f2bc5f4-b7d6-4f86-a1f8-c570cb263717 \n", + "4 4 ticket-cf70a216-0183-4458-8e13-94f432f7b8c0 \n", + "5 0 ticket-57a45e6f-f42a-41b0-a0f5-68e5e0fd67ba \n", + "6 1 ticket-7f414b3f-fde6-4cbc-ad58-86c7ccfb1109 \n", + "7 2 ticket-2d69b397-3ec3-4588-9eaf-5eb931f1f8c4 \n", + "8 3 ticket-e9fc6ad3-d7ad-4ef1-8a58-0759a0f27a00 \n", + "9 4 ticket-dc48bc69-b1f5-4850-b5af-037c4ea72961 \n", + "10 0 ticket-b7a550e8-0fa8-46ff-8b4c-1a290a5d706c \n", + "11 1 ticket-92826a40-b024-4b91-a4d2-7e20dcfddce3 \n", + "12 2 ticket-8c483b5c-37d4-4027-8d67-d920bf8ca063 \n", + "13 3 ticket-09028447-8e23-4e4f-a100-098a4dc8e919 \n", + "14 4 ticket-ccc89397-0d52-42a3-8fe1-39c97158c87c " + ] + }, + "execution_count": 13, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "def generate_tickets(title,n_tickets):\n", + " tickets = []\n", + " for i in range(n_tickets):\n", + " ticket_id, ticket_json = generate_twin(\"ticket\",ticket_model_id)\n", + " ticket_json['event_title'] = title\n", + " ticket_json['state'] = 'open'\n", + " ticket_json['ticket_location'] = i\n", + " ticket_json['uid'] = f'ticket-{str(uuid.uuid4())}'\n", + " tickets.append(ticket_json)\n", + " return tickets\n", + "\n", + "tickets_df = pd.concat([pd.DataFrame(generate_tickets('Nirvana',5)),\n", + " pd.DataFrame(generate_tickets('Smashing Pumpkins',5)),\n", + " pd.DataFrame(generate_tickets('Foo Fighters',5))]).reset_index(drop=True)\n", + "\n", + "tickets_df" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Ok now that we know what tickets we want to sell, let's push them to the digital twin ecosystem. This is exactly the same as what we did with `Customers` in step one. " + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "outputs": [], + "source": [ + "ticket_twins = []\n", + "for i in tickets_df.index:\n", + " ticket_data = tickets_df.loc[i]\n", + " ticket_twin_id = ticket_data['uid']\n", + " ticket_json = ticket_data.drop('uid').to_dict()\n", + " created_twin = service_client.upsert_digital_twin(ticket_twin_id, ticket_json)\n", + " ticket_twins.append(created_twin)" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[{'$dtId': 'ticket-b10211a2-1a7a-4f6f-9fc3-d23daefe8cbe',\n", + " '$etag': 'W/\"172ddd8b-a58c-41da-9081-19b0ff611ffa\"',\n", + " 'event_title': 'Nirvana',\n", + " 'state': 'open',\n", + " 'ticket_location': '0',\n", + " '$metadata': {'$model': 'dtmi:billmanh:ticket;1',\n", + " 'event_title': {'lastUpdateTime': '2020-12-07T01:30:50.2153563Z'},\n", + " 'state': {'lastUpdateTime': '2020-12-07T01:30:50.2153563Z'},\n", + " 'ticket_location': {'lastUpdateTime': '2020-12-07T01:30:50.2153563Z'}}},\n", + " {'$dtId': 'ticket-d1d2ad08-add8-4f5f-97cf-0b6516914cc9',\n", + " '$etag': 'W/\"f775c7be-176a-401a-b427-bd7797752283\"',\n", + " 'event_title': 'Nirvana',\n", + " 'state': 'open',\n", + " 'ticket_location': '1',\n", + " '$metadata': {'$model': 'dtmi:billmanh:ticket;1',\n", + " 'event_title': {'lastUpdateTime': '2020-12-07T01:30:50.8441094Z'},\n", + " 'state': {'lastUpdateTime': '2020-12-07T01:30:50.8441094Z'},\n", + " 'ticket_location': {'lastUpdateTime': '2020-12-07T01:30:50.8441094Z'}}},\n", + " {'$dtId': 'ticket-260e3349-adc5-41af-9ae5-4f3690d813c7',\n", + " '$etag': 'W/\"8670c70a-b849-4d0c-abbc-5bcf6b77ec21\"',\n", + " 'event_title': 'Nirvana',\n", + " 'state': 'open',\n", + " 'ticket_location': '2',\n", + " '$metadata': {'$model': 'dtmi:billmanh:ticket;1',\n", + " 'event_title': {'lastUpdateTime': '2020-12-07T01:30:51.0152850Z'},\n", + " 'state': {'lastUpdateTime': '2020-12-07T01:30:51.0152850Z'},\n", + " 'ticket_location': {'lastUpdateTime': '2020-12-07T01:30:51.0152850Z'}}}]" + ] + }, + "execution_count": 15, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "ticket_twins[:3]" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": {}, + "outputs": [], + "source": [ + "# # Delete twins if you want\n", + "# for i in tickets_df.index:\n", + "# ticket_data = tickets_df.loc[i]\n", + "# ticket_twin_id = ticket_data['uid']\n", + "# service_client.delete_digital_twin(ticket_twin_id)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "So now I have `customers` and I have `tickets`, but there is no relationship between them. Let's pretend that I have a website that sells tickets. When a `customer` buys a `ticket` on the website, a relationship between the two is established AND the status of the ticket changes to sold. \n", + "\n", + "* website (or mobile app) will tell the user which tickets are still available, and have features that allow them to search by row, or by concert.\n", + "* the website (or mobile app) gets the latitude and longitude of the user when they buy the tickets. \n", + "* once purchased, the status of that ticket changes to `sold`.\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# The user experience (mobile app)\n", + "\n", + "Here is where the user will buy tickets. \n", + "\n", + "This cell is a customer experience. The `customer` enters the website and looks up the available tickets for the show they want. This data comes from the website. " + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": {}, + "outputs": [], + "source": [ + "# selection from a dropdown menu or something\n", + "selection_show = 'Nirvana'\n", + "# just grabbing the first customer. \n", + "user = df_customers.loc[0]['id']\n", + "user_lat = np.random.randint(0,100)\n", + "user_long = np.random.randint(0,100)\n", + "\n", + "query_expression = f\"\"\"\n", + "SELECT * FROM digitaltwins where IS_OF_MODEL('{ticket_model_id}') \n", + "and state = 'open'\n", + "and event_title = '{selection_show}'\n", + "\"\"\"\n", + "query_result = service_client.query_twins(query_expression)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Note that the client dumps records after the query. Try running the cell below a few times. If you need to use the values again and again you need to put them into memory somewhere. " + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
$dtIdevent_titlestate
0ticket-b10211a2-1a7a-4f6f-9fc3-d23daefe8cbeNirvanaopen
1ticket-d1d2ad08-add8-4f5f-97cf-0b6516914cc9Nirvanaopen
2ticket-cf70a216-0183-4458-8e13-94f432f7b8c0Nirvanaopen
3ticket-260e3349-adc5-41af-9ae5-4f3690d813c7Nirvanaopen
4ticket-9f2bc5f4-b7d6-4f86-a1f8-c570cb263717Nirvanaopen
\n", + "
" + ], + "text/plain": [ + " $dtId event_title state\n", + "0 ticket-b10211a2-1a7a-4f6f-9fc3-d23daefe8cbe Nirvana open\n", + "1 ticket-d1d2ad08-add8-4f5f-97cf-0b6516914cc9 Nirvana open\n", + "2 ticket-cf70a216-0183-4458-8e13-94f432f7b8c0 Nirvana open\n", + "3 ticket-260e3349-adc5-41af-9ae5-4f3690d813c7 Nirvana open\n", + "4 ticket-9f2bc5f4-b7d6-4f86-a1f8-c570cb263717 Nirvana open" + ] + }, + "execution_count": 18, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "available_tickets_df = pd.DataFrame([[i['$dtId'],i['event_title'],i['state']] for i in query_result],\n", + " columns = ['$dtId','event_title','state'])\n", + "available_tickets_df" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Now the user chooses to buy a ticket. The ticket state changes to closed." + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'$dtId': 'ticket-b10211a2-1a7a-4f6f-9fc3-d23daefe8cbe',\n", + " '$etag': 'W/\"172ddd8b-a58c-41da-9081-19b0ff611ffa\"',\n", + " 'event_title': 'Nirvana',\n", + " 'state': 'open',\n", + " 'ticket_location': '0',\n", + " '$metadata': {'$model': 'dtmi:billmanh:ticket;1',\n", + " 'event_title': {'lastUpdateTime': '2020-12-07T01:30:50.2153563Z'},\n", + " 'state': {'lastUpdateTime': '2020-12-07T01:30:50.2153563Z'},\n", + " 'ticket_location': {'lastUpdateTime': '2020-12-07T01:30:50.2153563Z'}}}" + ] + }, + "execution_count": 19, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "customer_selection = available_tickets_df.loc[0]['$dtId']\n", + "\n", + "service_client.get_digital_twin(customer_selection)" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": {}, + "outputs": [], + "source": [ + "customer_selection = available_tickets_df.loc[0]['$dtId']\n", + "\n", + "patch = [\n", + " {\n", + " \"op\": \"replace\",\n", + " \"path\": \"\",\n", + " \"value\": \"sold\"\n", + " }\n", + "]\n", + "service_client.update_component(customer_selection,\"state\", patch)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**NOTE** that the path is `\"\"` when the item is at the root of the state." + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
$dtIdevent_titlestate
0ticket-600f2149-1ed8-4cb4-b0b8-bb6d03f575cdNirvanasold
1ticket-b8860b9b-cc54-4591-abb3-2abc3adc0800Nirvanasold
2ticket-2256b8c9-1dd8-4ef8-a00a-b191dc122532Nirvanasold
3ticket-99023c6e-5d97-4e43-ab08-3d893233c8b0Nirvanasold
4ticket-132839a8-a4a3-4c75-ae96-9ff4085a07d4Nirvanasold
5ticket-b10211a2-1a7a-4f6f-9fc3-d23daefe8cbeNirvanaopen
6ticket-d1d2ad08-add8-4f5f-97cf-0b6516914cc9Nirvanaopen
7ticket-cf70a216-0183-4458-8e13-94f432f7b8c0Nirvanaopen
8ticket-260e3349-adc5-41af-9ae5-4f3690d813c7Nirvanaopen
9ticket-9f2bc5f4-b7d6-4f86-a1f8-c570cb263717Nirvanaopen
\n", + "
" + ], + "text/plain": [ + " $dtId event_title state\n", + "0 ticket-600f2149-1ed8-4cb4-b0b8-bb6d03f575cd Nirvana sold\n", + "1 ticket-b8860b9b-cc54-4591-abb3-2abc3adc0800 Nirvana sold\n", + "2 ticket-2256b8c9-1dd8-4ef8-a00a-b191dc122532 Nirvana sold\n", + "3 ticket-99023c6e-5d97-4e43-ab08-3d893233c8b0 Nirvana sold\n", + "4 ticket-132839a8-a4a3-4c75-ae96-9ff4085a07d4 Nirvana sold\n", + "5 ticket-b10211a2-1a7a-4f6f-9fc3-d23daefe8cbe Nirvana open\n", + "6 ticket-d1d2ad08-add8-4f5f-97cf-0b6516914cc9 Nirvana open\n", + "7 ticket-cf70a216-0183-4458-8e13-94f432f7b8c0 Nirvana open\n", + "8 ticket-260e3349-adc5-41af-9ae5-4f3690d813c7 Nirvana open\n", + "9 ticket-9f2bc5f4-b7d6-4f86-a1f8-c570cb263717 Nirvana open" + ] + }, + "execution_count": 21, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "query_expression = f\"\"\"\n", + "SELECT * FROM digitaltwins where IS_OF_MODEL('{ticket_model_id}') \n", + "and event_title = '{selection_show}'\n", + "\"\"\"\n", + "query_result = service_client.query_twins(query_expression)\n", + "available_tickets_df = pd.DataFrame([[i['$dtId'],i['event_title'],i['state']] for i in query_result],\n", + " columns = ['$dtId','event_title','state'])\n", + "available_tickets_df" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Relationships: \n", + "* the target is the leaf (or the customer)\n", + "* the source is the branch (or the ticket)\n", + "\n", + "you can add extra stuff to the relationship. " + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ticket-b10211a2-1a7a-4f6f-9fc3-d23daefe8cbe\n", + "customer-cc04f3b6-39b0-4cef-bfff-a7d668cce446\n" + ] + } + ], + "source": [ + "print(customer_selection)\n", + "print(user)" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'$relationshipId': 'ticket-b10211a2-1a7a-4f6f-9fc3-d23daefe8cbeownedBycustomer-cc04f3b6-39b0-4cef-bfff-a7d668cce446',\n", + " '$etag': 'W/\"63140a7e-b8e9-4638-909e-9adf67a05d0d\"',\n", + " '$sourceId': 'ticket-b10211a2-1a7a-4f6f-9fc3-d23daefe8cbe',\n", + " '$relationshipName': 'ownedBy',\n", + " '$targetId': 'customer-cc04f3b6-39b0-4cef-bfff-a7d668cce446',\n", + " 'bought_online': True}" + ] + }, + "execution_count": 23, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "tickethoder_relationship = {\n", + " \"$relationshipId\": f\"{customer_selection}ownedBy{user}\",\n", + " \"$sourceId\": customer_selection,\n", + " \"$relationshipName\": \"ownedBy\",\n", + " \"$targetId\": user,\n", + " \"bought_online\": True\n", + " }\n", + "\n", + "service_client.upsert_relationship(\n", + " tickethoder_relationship[\"$sourceId\"],\n", + " tickethoder_relationship[\"$relationshipId\"],\n", + " tickethoder_relationship\n", + " )" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "14" + ] + }, + "execution_count": 24, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "[i for i in service_client.list_relationships(customer_selection)]\n", + "i" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Another customer will buy several tickets. " + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
$dtIdevent_titlestate
0ticket-52e25a0a-06b1-428f-b6a2-479cafc45c16Smashing Pumpkinsopen
1ticket-58bf00bf-d5b8-4d06-9002-f8bf1693cc56Foo Fightersopen
2ticket-67f3cbfb-4b35-4e10-bf6d-3fd216093c3cFoo Fightersopen
3ticket-3f82286d-7e0b-4df5-a491-d9e28f7c94f9Foo Fightersopen
4ticket-d1d2ad08-add8-4f5f-97cf-0b6516914cc9Nirvanaopen
5ticket-cf70a216-0183-4458-8e13-94f432f7b8c0Nirvanaopen
6ticket-260e3349-adc5-41af-9ae5-4f3690d813c7Nirvanaopen
7ticket-9f2bc5f4-b7d6-4f86-a1f8-c570cb263717Nirvanaopen
8ticket-b7a550e8-0fa8-46ff-8b4c-1a290a5d706cFoo Fightersopen
9ticket-57a45e6f-f42a-41b0-a0f5-68e5e0fd67baSmashing Pumpkinsopen
10ticket-7f414b3f-fde6-4cbc-ad58-86c7ccfb1109Smashing Pumpkinsopen
11ticket-2d69b397-3ec3-4588-9eaf-5eb931f1f8c4Smashing Pumpkinsopen
12ticket-e9fc6ad3-d7ad-4ef1-8a58-0759a0f27a00Smashing Pumpkinsopen
13ticket-dc48bc69-b1f5-4850-b5af-037c4ea72961Smashing Pumpkinsopen
14ticket-92826a40-b024-4b91-a4d2-7e20dcfddce3Foo Fightersopen
15ticket-8c483b5c-37d4-4027-8d67-d920bf8ca063Foo Fightersopen
16ticket-09028447-8e23-4e4f-a100-098a4dc8e919Foo Fightersopen
17ticket-ccc89397-0d52-42a3-8fe1-39c97158c87cFoo Fightersopen
\n", + "
" + ], + "text/plain": [ + " $dtId event_title state\n", + "0 ticket-52e25a0a-06b1-428f-b6a2-479cafc45c16 Smashing Pumpkins open\n", + "1 ticket-58bf00bf-d5b8-4d06-9002-f8bf1693cc56 Foo Fighters open\n", + "2 ticket-67f3cbfb-4b35-4e10-bf6d-3fd216093c3c Foo Fighters open\n", + "3 ticket-3f82286d-7e0b-4df5-a491-d9e28f7c94f9 Foo Fighters open\n", + "4 ticket-d1d2ad08-add8-4f5f-97cf-0b6516914cc9 Nirvana open\n", + "5 ticket-cf70a216-0183-4458-8e13-94f432f7b8c0 Nirvana open\n", + "6 ticket-260e3349-adc5-41af-9ae5-4f3690d813c7 Nirvana open\n", + "7 ticket-9f2bc5f4-b7d6-4f86-a1f8-c570cb263717 Nirvana open\n", + "8 ticket-b7a550e8-0fa8-46ff-8b4c-1a290a5d706c Foo Fighters open\n", + "9 ticket-57a45e6f-f42a-41b0-a0f5-68e5e0fd67ba Smashing Pumpkins open\n", + "10 ticket-7f414b3f-fde6-4cbc-ad58-86c7ccfb1109 Smashing Pumpkins open\n", + "11 ticket-2d69b397-3ec3-4588-9eaf-5eb931f1f8c4 Smashing Pumpkins open\n", + "12 ticket-e9fc6ad3-d7ad-4ef1-8a58-0759a0f27a00 Smashing Pumpkins open\n", + "13 ticket-dc48bc69-b1f5-4850-b5af-037c4ea72961 Smashing Pumpkins open\n", + "14 ticket-92826a40-b024-4b91-a4d2-7e20dcfddce3 Foo Fighters open\n", + "15 ticket-8c483b5c-37d4-4027-8d67-d920bf8ca063 Foo Fighters open\n", + "16 ticket-09028447-8e23-4e4f-a100-098a4dc8e919 Foo Fighters open\n", + "17 ticket-ccc89397-0d52-42a3-8fe1-39c97158c87c Foo Fighters open" + ] + }, + "execution_count": 25, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "query_expression = f\"\"\"\n", + "SELECT * FROM digitaltwins t where IS_OF_MODEL('{ticket_model_id}') \n", + "and t.state = 'open'\n", + "\"\"\"\n", + "query_result = service_client.query_twins(query_expression)\n", + "available_tickets_df = pd.DataFrame([[i['$dtId'],i['event_title'],i['state']] for i in query_result],\n", + " columns = ['$dtId','event_title','state'])\n", + "available_tickets_df" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'customer-25e19268-3433-4f09-afe3-94f466313368'" + ] + }, + "execution_count": 26, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "other_user = df_customers.loc[len(df_customers)-1]['id']\n", + "other_user" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "['ticket-52e25a0a-06b1-428f-b6a2-479cafc45c16',\n", + " 'ticket-58bf00bf-d5b8-4d06-9002-f8bf1693cc56',\n", + " 'ticket-67f3cbfb-4b35-4e10-bf6d-3fd216093c3c',\n", + " 'ticket-3f82286d-7e0b-4df5-a491-d9e28f7c94f9',\n", + " 'ticket-d1d2ad08-add8-4f5f-97cf-0b6516914cc9',\n", + " 'ticket-cf70a216-0183-4458-8e13-94f432f7b8c0']" + ] + }, + "execution_count": 27, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "tickets_bought = available_tickets_df.loc[:5,'$dtId'].tolist()\n", + "tickets_bought" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "['ticket-52e25a0a-06b1-428f-b6a2-479cafc45c16',\n", + " 'ticket-58bf00bf-d5b8-4d06-9002-f8bf1693cc56',\n", + " 'ticket-67f3cbfb-4b35-4e10-bf6d-3fd216093c3c',\n", + " 'ticket-3f82286d-7e0b-4df5-a491-d9e28f7c94f9',\n", + " 'ticket-d1d2ad08-add8-4f5f-97cf-0b6516914cc9',\n", + " 'ticket-cf70a216-0183-4458-8e13-94f432f7b8c0']" + ] + }, + "execution_count": 28, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "tickets_bought" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ticket-52e25a0a-06b1-428f-b6a2-479cafc45c16\n", + "ticket-58bf00bf-d5b8-4d06-9002-f8bf1693cc56\n", + "ticket-67f3cbfb-4b35-4e10-bf6d-3fd216093c3c\n", + "ticket-3f82286d-7e0b-4df5-a491-d9e28f7c94f9\n", + "ticket-d1d2ad08-add8-4f5f-97cf-0b6516914cc9\n", + "ticket-cf70a216-0183-4458-8e13-94f432f7b8c0\n" + ] + } + ], + "source": [ + "for t in tickets_bought:\n", + " print(t)\n", + " tickethoder_relationship = {\n", + " \"$relationshipId\": f\"{customer_selection}ownedBy{other_user}\",\n", + " \"$sourceId\": t,\n", + " \"$relationshipName\": \"ownedBy\",\n", + " \"$targetId\": other_user,\n", + " \"bought_online\": False\n", + " }\n", + "\n", + " service_client.upsert_relationship(\n", + " tickethoder_relationship[\"$sourceId\"],\n", + " tickethoder_relationship[\"$relationshipId\"],\n", + " tickethoder_relationship\n", + " )\n", + " customer_selection = available_tickets_df.loc[0]['$dtId']\n", + "\n", + " patch = [\n", + " {\n", + " \"op\": \"replace\",\n", + " \"path\": \"\",\n", + " \"value\": \"sold\"\n", + " }\n", + " ]\n", + " service_client.update_component(t,\"state\", patch)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Now let's lets look at the tickets. " + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
$dtIdevent_titlestate
0ticket-600f2149-1ed8-4cb4-b0b8-bb6d03f575cdNirvanasold
1ticket-b8860b9b-cc54-4591-abb3-2abc3adc0800Nirvanasold
2ticket-2256b8c9-1dd8-4ef8-a00a-b191dc122532Nirvanasold
3ticket-18663c82-67a2-4791-b1c4-05db261af867Smashing Pumpkinssold
4ticket-99023c6e-5d97-4e43-ab08-3d893233c8b0Nirvanasold
5ticket-132839a8-a4a3-4c75-ae96-9ff4085a07d4Nirvanasold
6ticket-79f3f382-bd65-4788-8ad1-0db507b8a3abSmashing Pumpkinssold
7ticket-9f7c0906-9729-4568-a559-89d63b634d09Smashing Pumpkinssold
8ticket-633f4537-50a1-4735-9e70-99bf19be51e4Smashing Pumpkinssold
9ticket-52e25a0a-06b1-428f-b6a2-479cafc45c16Smashing Pumpkinssold
10ticket-ca767da7-0152-4861-9be6-fbe39b5dd9d8Foo Fighterssold
11ticket-0cd531c6-d81c-4c4c-84c9-9592a8f43e70Foo Fighterssold
12ticket-58bf00bf-d5b8-4d06-9002-f8bf1693cc56Foo Fighterssold
13ticket-67f3cbfb-4b35-4e10-bf6d-3fd216093c3cFoo Fighterssold
14ticket-3f82286d-7e0b-4df5-a491-d9e28f7c94f9Foo Fighterssold
15ticket-b10211a2-1a7a-4f6f-9fc3-d23daefe8cbeNirvanasold
16ticket-d1d2ad08-add8-4f5f-97cf-0b6516914cc9Nirvanasold
17ticket-cf70a216-0183-4458-8e13-94f432f7b8c0Nirvanasold
18ticket-260e3349-adc5-41af-9ae5-4f3690d813c7Nirvanaopen
19ticket-9f2bc5f4-b7d6-4f86-a1f8-c570cb263717Nirvanaopen
20ticket-b7a550e8-0fa8-46ff-8b4c-1a290a5d706cFoo Fightersopen
21ticket-57a45e6f-f42a-41b0-a0f5-68e5e0fd67baSmashing Pumpkinsopen
22ticket-7f414b3f-fde6-4cbc-ad58-86c7ccfb1109Smashing Pumpkinsopen
23ticket-2d69b397-3ec3-4588-9eaf-5eb931f1f8c4Smashing Pumpkinsopen
24ticket-e9fc6ad3-d7ad-4ef1-8a58-0759a0f27a00Smashing Pumpkinsopen
25ticket-dc48bc69-b1f5-4850-b5af-037c4ea72961Smashing Pumpkinsopen
26ticket-92826a40-b024-4b91-a4d2-7e20dcfddce3Foo Fightersopen
27ticket-8c483b5c-37d4-4027-8d67-d920bf8ca063Foo Fightersopen
28ticket-09028447-8e23-4e4f-a100-098a4dc8e919Foo Fightersopen
29ticket-ccc89397-0d52-42a3-8fe1-39c97158c87cFoo Fightersopen
\n", + "
" + ], + "text/plain": [ + " $dtId event_title state\n", + "0 ticket-600f2149-1ed8-4cb4-b0b8-bb6d03f575cd Nirvana sold\n", + "1 ticket-b8860b9b-cc54-4591-abb3-2abc3adc0800 Nirvana sold\n", + "2 ticket-2256b8c9-1dd8-4ef8-a00a-b191dc122532 Nirvana sold\n", + "3 ticket-18663c82-67a2-4791-b1c4-05db261af867 Smashing Pumpkins sold\n", + "4 ticket-99023c6e-5d97-4e43-ab08-3d893233c8b0 Nirvana sold\n", + "5 ticket-132839a8-a4a3-4c75-ae96-9ff4085a07d4 Nirvana sold\n", + "6 ticket-79f3f382-bd65-4788-8ad1-0db507b8a3ab Smashing Pumpkins sold\n", + "7 ticket-9f7c0906-9729-4568-a559-89d63b634d09 Smashing Pumpkins sold\n", + "8 ticket-633f4537-50a1-4735-9e70-99bf19be51e4 Smashing Pumpkins sold\n", + "9 ticket-52e25a0a-06b1-428f-b6a2-479cafc45c16 Smashing Pumpkins sold\n", + "10 ticket-ca767da7-0152-4861-9be6-fbe39b5dd9d8 Foo Fighters sold\n", + "11 ticket-0cd531c6-d81c-4c4c-84c9-9592a8f43e70 Foo Fighters sold\n", + "12 ticket-58bf00bf-d5b8-4d06-9002-f8bf1693cc56 Foo Fighters sold\n", + "13 ticket-67f3cbfb-4b35-4e10-bf6d-3fd216093c3c Foo Fighters sold\n", + "14 ticket-3f82286d-7e0b-4df5-a491-d9e28f7c94f9 Foo Fighters sold\n", + "15 ticket-b10211a2-1a7a-4f6f-9fc3-d23daefe8cbe Nirvana sold\n", + "16 ticket-d1d2ad08-add8-4f5f-97cf-0b6516914cc9 Nirvana sold\n", + "17 ticket-cf70a216-0183-4458-8e13-94f432f7b8c0 Nirvana sold\n", + "18 ticket-260e3349-adc5-41af-9ae5-4f3690d813c7 Nirvana open\n", + "19 ticket-9f2bc5f4-b7d6-4f86-a1f8-c570cb263717 Nirvana open\n", + "20 ticket-b7a550e8-0fa8-46ff-8b4c-1a290a5d706c Foo Fighters open\n", + "21 ticket-57a45e6f-f42a-41b0-a0f5-68e5e0fd67ba Smashing Pumpkins open\n", + "22 ticket-7f414b3f-fde6-4cbc-ad58-86c7ccfb1109 Smashing Pumpkins open\n", + "23 ticket-2d69b397-3ec3-4588-9eaf-5eb931f1f8c4 Smashing Pumpkins open\n", + "24 ticket-e9fc6ad3-d7ad-4ef1-8a58-0759a0f27a00 Smashing Pumpkins open\n", + "25 ticket-dc48bc69-b1f5-4850-b5af-037c4ea72961 Smashing Pumpkins open\n", + "26 ticket-92826a40-b024-4b91-a4d2-7e20dcfddce3 Foo Fighters open\n", + "27 ticket-8c483b5c-37d4-4027-8d67-d920bf8ca063 Foo Fighters open\n", + "28 ticket-09028447-8e23-4e4f-a100-098a4dc8e919 Foo Fighters open\n", + "29 ticket-ccc89397-0d52-42a3-8fe1-39c97158c87c Foo Fighters open" + ] + }, + "execution_count": 30, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "query_expression = f\"\"\"\n", + "SELECT * FROM digitaltwins t where IS_OF_MODEL('{ticket_model_id}') \n", + "\"\"\"\n", + "query_result = service_client.query_twins(query_expression)\n", + "available_tickets_df = pd.DataFrame([[i['$dtId'],i['event_title'],i['state']] for i in query_result],\n", + " columns = ['$dtId','event_title','state'])\n", + "available_tickets_df" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "You can see that our web app can easily filter on tickets that are open and give a person specific rows. We will get into more complicated analysis in the next steps." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python (azure_test)", + "language": "python", + "name": "azure_test" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.9" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} \ No newline at end of file diff --git a/sdk/digitaltwins/azure-digitaltwins-core/samples/notebooks/03_Adding_a_bunch of_other_components.ipynb b/sdk/digitaltwins/azure-digitaltwins-core/samples/notebooks/03_Adding_a_bunch of_other_components.ipynb new file mode 100644 index 000000000000..578e852889ed --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/samples/notebooks/03_Adding_a_bunch of_other_components.ipynb @@ -0,0 +1,649 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Moving through a physical experience\n", + "## Some examples of IoT application that ping a digital twin\n", + "\n", + "This doc does not really teach anything new, but it will give us some exercise with the previous examples. We will need a more complicated model in future steps. \n", + "* Adding more connections.\n", + "* Making connections using ids. \n", + "\n", + "\n", + "[This is the SDK repo on Github](https://github.com/Azure/azure-sdk-for-python/tree/4559e19e2f3146a49f1eba1706bb798071f4a1f5/sdk/digitaltwins/azure-digitaltwins-core)\n", + "\n", + "[Here is the doc on the query language](https://docs.microsoft.com/en-us/azure/digital-twins/concepts-query-language)\n" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 30, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "from azure.identity import AzureCliCredential\n", + "from azure.digitaltwins.core import DigitalTwinsClient\n", + "\n", + "# using yaml instead of \n", + "import yaml\n", + "import uuid\n", + "\n", + "# using altair instead of matplotlib for vizuals\n", + "import numpy as np\n", + "import pandas as pd\n", + "\n", + "# you will get this from the ADT resource at portal.azure.com\n", + "your_digital_twin_url = \"home-test-twin.api.wcus.digitaltwins.azure.net\"\n", + "\n", + "azure_cli = AzureCliCredential()\n", + "service_client = DigitalTwinsClient(\n", + " your_digital_twin_url, azure_cli)\n", + "service_client" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [], + "source": [ + "query_expression = \"SELECT * FROM digitaltwins t where IS_OF_MODEL('dtmi:billmanh:patron;1')\"\n", + "query_result = service_client.query_twins(query_expression)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**Note** the query object loves to drop values. To keep from making multiple queries, save the data somewhere. " + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [], + "source": [ + "values = []\n", + "for i in query_result:\n", + " values.append(i)" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [], + "source": [ + "df_customers = pd.DataFrame([[i['$dtId'],i['satisfaction']] for i in values],\n", + " columns=['id','satisfaction'])" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
idsatisfaction
0customer-cc04f3b6-39b0-4cef-bfff-a7d668cce44610
1customer-3cbd5e60-957d-44ff-944f-9adb42a20a5210
2customer-5c454e2f-f70b-4352-b75a-958f1a49beba7
3customer-26196fee-5ffd-457a-86b7-192a998f3cf29
4customer-e6f49d8a-711b-41c3-9db8-c7ece3dbc32c7
.........
79customer-45e9aa03-733d-4a99-b9d5-94f1c6b042149
80customer-0234cb48-1fa2-43e0-b69d-36a6ff2696669
81customer-75b2f757-faee-4a85-bc93-e6e9ff7cd8916
82customer-048f85a8-173e-4305-92b8-ead2a748b07f8
83customer-25e19268-3433-4f09-afe3-94f46631336810
\n", + "

84 rows × 2 columns

\n", + "
" + ], + "text/plain": [ + " id satisfaction\n", + "0 customer-cc04f3b6-39b0-4cef-bfff-a7d668cce446 10\n", + "1 customer-3cbd5e60-957d-44ff-944f-9adb42a20a52 10\n", + "2 customer-5c454e2f-f70b-4352-b75a-958f1a49beba 7\n", + "3 customer-26196fee-5ffd-457a-86b7-192a998f3cf2 9\n", + "4 customer-e6f49d8a-711b-41c3-9db8-c7ece3dbc32c 7\n", + ".. ... ...\n", + "79 customer-45e9aa03-733d-4a99-b9d5-94f1c6b04214 9\n", + "80 customer-0234cb48-1fa2-43e0-b69d-36a6ff269666 9\n", + "81 customer-75b2f757-faee-4a85-bc93-e6e9ff7cd891 6\n", + "82 customer-048f85a8-173e-4305-92b8-ead2a748b07f 8\n", + "83 customer-25e19268-3433-4f09-afe3-94f466313368 10\n", + "\n", + "[84 rows x 2 columns]" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "df_customers" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "and a `df` of the tickets" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
$dtIdevent_titlestate
0ticket-633f4537-50a1-4735-9e70-99bf19be51e4Smashing Pumpkinsopen
1ticket-52e25a0a-06b1-428f-b6a2-479cafc45c16Smashing Pumpkinsopen
2ticket-0cd531c6-d81c-4c4c-84c9-9592a8f43e70Foo Fightersopen
3ticket-58bf00bf-d5b8-4d06-9002-f8bf1693cc56Foo Fightersopen
4ticket-67f3cbfb-4b35-4e10-bf6d-3fd216093c3cFoo Fightersopen
5ticket-3f82286d-7e0b-4df5-a491-d9e28f7c94f9Foo Fightersopen
\n", + "
" + ], + "text/plain": [ + " $dtId event_title state\n", + "0 ticket-633f4537-50a1-4735-9e70-99bf19be51e4 Smashing Pumpkins open\n", + "1 ticket-52e25a0a-06b1-428f-b6a2-479cafc45c16 Smashing Pumpkins open\n", + "2 ticket-0cd531c6-d81c-4c4c-84c9-9592a8f43e70 Foo Fighters open\n", + "3 ticket-58bf00bf-d5b8-4d06-9002-f8bf1693cc56 Foo Fighters open\n", + "4 ticket-67f3cbfb-4b35-4e10-bf6d-3fd216093c3c Foo Fighters open\n", + "5 ticket-3f82286d-7e0b-4df5-a491-d9e28f7c94f9 Foo Fighters open" + ] + }, + "execution_count": 31, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "query_expression = f\"\"\"\n", + "SELECT * FROM digitaltwins t where IS_OF_MODEL('dtmi:mymodels:ticket;1') and t.state='open'\n", + "\"\"\"\n", + "query_result = service_client.query_twins(query_expression)\n", + "available_tickets_df = pd.DataFrame([[i['$dtId'],i['event_title'],i['state']] for i in query_result],\n", + " columns = ['$dtId','event_title','state'])\n", + "available_tickets_df" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Let's sell a couple more of those tickets. " + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "['ticket-633f4537-50a1-4735-9e70-99bf19be51e4',\n", + " 'ticket-0cd531c6-d81c-4c4c-84c9-9592a8f43e70']" + ] + }, + "execution_count": 33, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "tickets_sold = available_tickets_df.drop_duplicates(subset='event_title')['$dtId'].tolist()\n", + "\n", + "tickets_sold" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "['customer-c87adbfa-1c6e-4ea9-9f03-83e3877ef5fc',\n", + " 'customer-21e17d28-76c3-4c04-8df9-396703692a68']" + ] + }, + "execution_count": 34, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "customers_sold = df_customers['id'].tolist()[5:7]\n", + "\n", + "customers_sold" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The purpose is to create a simulation. So I'm just hacking something out real quick to make our model look a little fuller." + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ticket-633f4537-50a1-4735-9e70-99bf19be51e4\n", + "ticket-0cd531c6-d81c-4c4c-84c9-9592a8f43e70\n" + ] + } + ], + "source": [ + "for c,t in enumerate(tickets_sold):\n", + " print(t)\n", + " tickethoder_relationship = {\n", + " \"$relationshipId\": f\"{t}ownedBy{customers_sold[c]}\",\n", + " \"$sourceId\": t,\n", + " \"$relationshipName\": \"ownedBy\",\n", + " \"$targetId\": customers_sold[c],\n", + " \"bought_online\": False\n", + " }\n", + "\n", + " service_client.upsert_relationship(\n", + " tickethoder_relationship[\"$sourceId\"],\n", + " tickethoder_relationship[\"$relationshipId\"],\n", + " tickethoder_relationship\n", + " )\n", + "\n", + " patch = [\n", + " {\n", + " \"op\": \"replace\",\n", + " \"path\": \"\",\n", + " \"value\": \"sold\"\n", + " }\n", + " ]\n", + " service_client.update_component(t,\"state\", patch)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "You should be able to load the storage explorer at this point and look at the relationships. " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "I'm going to add some areas. \n", + "* People go into areas when the concert begins.\n", + "* areas have capacity\n", + "\n", + "Also adding lines:\n", + "* Lines lead to other places, but one line can lead to many places (like the entrance).\n", + "* Lines have a capacity\n", + "\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": 87, + "metadata": {}, + "outputs": [], + "source": [ + "# # # Delete the model that you don't want. \n", + "# # service_client.delete_model(patron_model_id)\n", + "\n", + "# # Create it if you just deleted it.\n", + "# # area_model_json = yaml.safe_load(open(\"models/area.json\"))\n", + "# line_model_json = yaml.safe_load(open(\"models/Patron.json\"))\n", + "# service_client.create_models([line_model_json])" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Ok now that we know what tickets we want to sell, let's push them to the digital twin ecosystem. This is exactly the same as what we did with `Customers` in step one. " + ] + }, + { + "cell_type": "code", + "execution_count": 58, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "area-0\n", + "{'$dtId': 'area-0', '$etag': 'W/\"7789a5c1-8ab0-473d-9c0e-6c12abe8f20f\"', 'capacity': 3, 'status': 'open', '$metadata': {'$model': 'dtmi:billmanh:area;1', 'capacity': {'lastUpdateTime': '2020-11-29T23:47:16.3097488Z'}, 'status': {'lastUpdateTime': '2020-11-29T23:47:16.3097488Z'}}}\n", + "area-1\n", + "{'$dtId': 'area-1', '$etag': 'W/\"78d4f941-5c4f-4e55-9a24-e1061f35a0f9\"', 'capacity': 3, 'status': 'open', '$metadata': {'$model': 'dtmi:billmanh:area;1', 'capacity': {'lastUpdateTime': '2020-11-29T23:47:16.3994079Z'}, 'status': {'lastUpdateTime': '2020-11-29T23:47:16.3994079Z'}}}\n", + "area-2\n", + "{'$dtId': 'area-2', '$etag': 'W/\"8d9d633f-51e1-4814-bf7f-71ffa5b647e6\"', 'capacity': 3, 'status': 'open', '$metadata': {'$model': 'dtmi:billmanh:area;1', 'capacity': {'lastUpdateTime': '2020-11-29T23:47:16.4841446Z'}, 'status': {'lastUpdateTime': '2020-11-29T23:47:16.4841446Z'}}}\n", + "area-3\n", + "{'$dtId': 'area-3', '$etag': 'W/\"990a5327-b8e5-4051-9ce2-9a078ec3c0aa\"', 'capacity': 3, 'status': 'open', '$metadata': {'$model': 'dtmi:billmanh:area;1', 'capacity': {'lastUpdateTime': '2020-11-29T23:47:16.5562464Z'}, 'status': {'lastUpdateTime': '2020-11-29T23:47:16.5562464Z'}}}\n" + ] + } + ], + "source": [ + "for r in range(4):\n", + " digital_twin_id = f'area-{r}'\n", + " print(digital_twin_id)\n", + " dt_json = {\n", + " \"$metadata\": {\n", + " \"$model\": \"dtmi:mymodels:area;1\"\n", + " },\n", + " \"capacity\": 3,\n", + " \"status\": \"open\"\n", + " }\n", + " created_twin = service_client.upsert_digital_twin(digital_twin_id, dt_json)\n", + " print(created_twin)" + ] + }, + { + "cell_type": "code", + "execution_count": 71, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "line-0\n", + "{'$dtId': 'line-0', '$etag': 'W/\"efd0563b-244c-41b1-8a02-7d2f5bcb11cb\"', '$metadata': {'$model': 'dtmi:billmanh:line;1'}}\n", + "line-1\n", + "{'$dtId': 'line-1', '$etag': 'W/\"e96e3bcb-3829-4fd0-a042-6d5f866fbd0a\"', '$metadata': {'$model': 'dtmi:billmanh:line;1'}}\n", + "line-2\n", + "{'$dtId': 'line-2', '$etag': 'W/\"c2f75074-3491-47b4-a703-6ade5e9993ad\"', '$metadata': {'$model': 'dtmi:billmanh:line;1'}}\n", + "line-3\n", + "{'$dtId': 'line-3', '$etag': 'W/\"8d749fc0-c15f-448d-b246-8f2d9212a29d\"', '$metadata': {'$model': 'dtmi:billmanh:line;1'}}\n" + ] + } + ], + "source": [ + "for r in range(4):\n", + " digital_twin_id = f'line-{r}'\n", + " print(digital_twin_id)\n", + " dt_json = {\n", + " \"$metadata\": {\n", + " \"$model\": \"dtmi:mymodels:line;1\"\n", + " }\n", + " }\n", + " created_twin = service_client.upsert_digital_twin(digital_twin_id, dt_json)\n", + " print(created_twin)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Now establishing a realtionship between the lines and the areas. If a person leaves one area they have to get into the line of the next area in order to get there. " + ] + }, + { + "cell_type": "code", + "execution_count": 77, + "metadata": {}, + "outputs": [], + "source": [ + "def line_to_room(line,area,walking):\n", + " tickethoder_relationship = {\n", + " \"$relationshipId\": f\"{line}leadsTo{area}\",\n", + " \"$sourceId\": line,\n", + " \"$relationshipName\": \"leadsTo\",\n", + " \"$targetId\": area,\n", + " \"walk_distance\": walking\n", + " }\n", + "\n", + " service_client.upsert_relationship(\n", + " tickethoder_relationship[\"$sourceId\"],\n", + " tickethoder_relationship[\"$relationshipId\"],\n", + " tickethoder_relationship\n", + " )\n", + " \n", + "line_to_room(\"line-0\",\"area-0\",5)\n", + "line_to_room(\"line-1\",\"area-1\",5)\n", + "line_to_room(\"line-2\",\"area-2\",5)\n", + "line_to_room(\"line-3\",\"area-3\",5)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Now I'm going to add some people into different parts of the experience. This will change from user to user, but you can use this as an example of how this would work on your twin. Use the queries above to get the specific ids of your twins." + ] + }, + { + "cell_type": "code", + "execution_count": 85, + "metadata": {}, + "outputs": [], + "source": [ + "def cust_to_area(cust,area):\n", + " tickethoder_relationship = {\n", + " \"$relationshipId\": f\"{cust}locatedIn{area}\",\n", + " \"$sourceId\": cust,\n", + " \"$relationshipName\": \"locatedIn\",\n", + " \"$targetId\": area,\n", + " }\n", + "\n", + " service_client.upsert_relationship(\n", + " tickethoder_relationship[\"$sourceId\"],\n", + " tickethoder_relationship[\"$relationshipId\"],\n", + " tickethoder_relationship\n", + " )\n", + " \n", + "cust_to_area(\"customer-e6f49d8a-711b-41c3-9db8-c7ece3dbc32c\",\"line-1\")\n", + "cust_to_area(\"customer-21e17d28-76c3-4c04-8df9-396703692a68\",\"line-1\")\n", + "# cust_to_area(\"customer-25e19268-3433-4f09-afe3-94f466313368\",\"line-0\")\n", + "# cust_to_area(\"customer-c87adbfa-1c6e-4ea9-9f03-83e3877ef5fc\",\"line-2\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Sell a couple more tickets" + ] + }, + { + "cell_type": "code", + "execution_count": 83, + "metadata": {}, + "outputs": [], + "source": [ + "def ticket_to_cust(ticket,cust):\n", + " tickethoder_relationship = {\n", + " \"$relationshipId\": f\"{ticket}ownedBy{cust}\",\n", + " \"$sourceId\": ticket,\n", + " \"$relationshipName\": \"ownedBy\",\n", + " \"$targetId\": cust,\n", + " }\n", + "\n", + " service_client.upsert_relationship(\n", + " tickethoder_relationship[\"$sourceId\"],\n", + " tickethoder_relationship[\"$relationshipId\"],\n", + " tickethoder_relationship\n", + " )\n", + " \n", + "ticket_to_cust(\"ticket-58bf00bf-d5b8-4d06-9002-f8bf1693cc56\",\"customer-418cbc74-b101-4f50-8cf0-6075a2a8053c\")\n", + "ticket_to_cust(\"ticket-67f3cbfb-4b35-4e10-bf6d-3fd216093c3c\",\"customer-9c9b5c36-69f6-4f48-9362-4aaac4cb1be4\")\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python (azure_test)", + "language": "python", + "name": "azure_test" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.9" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} \ No newline at end of file diff --git a/sdk/digitaltwins/azure-digitaltwins-core/samples/notebooks/04_Lots_on_Queries.ipynb b/sdk/digitaltwins/azure-digitaltwins-core/samples/notebooks/04_Lots_on_Queries.ipynb new file mode 100644 index 000000000000..0a6969916e4b --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/samples/notebooks/04_Lots_on_Queries.ipynb @@ -0,0 +1,1197 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Complex queries\n", + "## An example use of the Digital Twin\n", + "\n", + "In this notebook we are going to dive deep into queries:\n", + "* Examining the customer experience through the lens of different aspects of the experience. \n", + "\n", + "In our previous steps we made:\n", + "* Patrons, that have a `customer satisfaction`, a relationship with tickets, and locations.\n", + "* Tickets that are `owned by customers`\n", + "* Lines that lead to areas\n", + "* Areas where people are located. \n", + "\n", + "We will be doing a bunch of different queries on this theme. \n", + "\n", + "\n", + "[This is the SDK repo on Github](https://github.com/Azure/azure-sdk-for-python/tree/4559e19e2f3146a49f1eba1706bb798071f4a1f5/sdk/digitaltwins/azure-digitaltwins-core)\n", + "\n", + "[Here is the doc on the query language](https://docs.microsoft.com/en-us/azure/digital-twins/concepts-query-language)\n" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 1, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "from azure.identity import AzureCliCredential\n", + "from azure.digitaltwins.core import DigitalTwinsClient\n", + "\n", + "# using yaml instead of \n", + "import yaml\n", + "import uuid\n", + "\n", + "# using altair instead of matplotlib for vizuals\n", + "import numpy as np\n", + "import pandas as pd\n", + "\n", + "# you will get this from the ADT resource at portal.azure.com\n", + "your_digital_twin_url = \"home-test-twin.api.wcus.digitaltwins.azure.net\"\n", + "\n", + "azure_cli = AzureCliCredential()\n", + "service_client = DigitalTwinsClient(\n", + " your_digital_twin_url, azure_cli)\n", + "service_client" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "I'm going to set up a generic function that runs queries and gets the data. This will keep me from doing it over and over. \n", + "\n", + "**Note that with really large models this might perform poorly** I'm only doing this here as this example is very small. " + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
$dtId$etagsatisfactiontotalWaitTime$metadataevent_titlestateticket_locationcapacitystatus
0customer-cc04f3b6-39b0-4cef-bfff-a7d668cce446W/\"158b01df-d555-4c1b-bf44-9c1e8c63eb02\"10.010.0{'$model': 'dtmi:billmanh:patron;1', 'satisfac...NaNNaNNaNNaNNaN
1customer-3cbd5e60-957d-44ff-944f-9adb42a20a52W/\"5d7359d5-e0f6-44e7-80f8-2a3f191295f2\"10.010.0{'$model': 'dtmi:billmanh:patron;1', 'satisfac...NaNNaNNaNNaNNaN
2customer-5c454e2f-f70b-4352-b75a-958f1a49bebaW/\"d7a8af67-7b40-4ed8-94c4-553fb639e197\"7.00.0{'$model': 'dtmi:billmanh:patron;1', 'satisfac...NaNNaNNaNNaNNaN
3customer-26196fee-5ffd-457a-86b7-192a998f3cf2W/\"ee1d4d68-aa14-4d35-a029-7635675f24d7\"9.00.0{'$model': 'dtmi:billmanh:patron;1', 'satisfac...NaNNaNNaNNaNNaN
4customer-e6f49d8a-711b-41c3-9db8-c7ece3dbc32cW/\"d1242800-1c21-4bab-909f-8dc49ef0ce92\"7.00.0{'$model': 'dtmi:billmanh:patron;1', 'satisfac...NaNNaNNaNNaNNaN
.................................
117ticket-dc48bc69-b1f5-4850-b5af-037c4ea72961W/\"5ea29c9e-a6be-4c02-979a-df1b2aa8cb5c\"NaNNaN{'$model': 'dtmi:billmanh:ticket;1', 'event_ti...Smashing Pumpkinsopen4NaNNaN
118ticket-92826a40-b024-4b91-a4d2-7e20dcfddce3W/\"002990f3-4ed8-464c-a90e-4b83ae5362fb\"NaNNaN{'$model': 'dtmi:billmanh:ticket;1', 'event_ti...Foo Fightersopen1NaNNaN
119ticket-8c483b5c-37d4-4027-8d67-d920bf8ca063W/\"22d419c0-a6da-4935-82e3-5b1f7236908e\"NaNNaN{'$model': 'dtmi:billmanh:ticket;1', 'event_ti...Foo Fightersopen2NaNNaN
120ticket-09028447-8e23-4e4f-a100-098a4dc8e919W/\"39cc602c-a41e-47bf-8da9-1a401419832a\"NaNNaN{'$model': 'dtmi:billmanh:ticket;1', 'event_ti...Foo Fightersopen3NaNNaN
121ticket-ccc89397-0d52-42a3-8fe1-39c97158c87cW/\"094b5fa9-4443-4923-b8f9-24201fb2f26f\"NaNNaN{'$model': 'dtmi:billmanh:ticket;1', 'event_ti...Foo Fightersopen4NaNNaN
\n", + "

122 rows × 10 columns

\n", + "
" + ], + "text/plain": [ + " $dtId \\\n", + "0 customer-cc04f3b6-39b0-4cef-bfff-a7d668cce446 \n", + "1 customer-3cbd5e60-957d-44ff-944f-9adb42a20a52 \n", + "2 customer-5c454e2f-f70b-4352-b75a-958f1a49beba \n", + "3 customer-26196fee-5ffd-457a-86b7-192a998f3cf2 \n", + "4 customer-e6f49d8a-711b-41c3-9db8-c7ece3dbc32c \n", + ".. ... \n", + "117 ticket-dc48bc69-b1f5-4850-b5af-037c4ea72961 \n", + "118 ticket-92826a40-b024-4b91-a4d2-7e20dcfddce3 \n", + "119 ticket-8c483b5c-37d4-4027-8d67-d920bf8ca063 \n", + "120 ticket-09028447-8e23-4e4f-a100-098a4dc8e919 \n", + "121 ticket-ccc89397-0d52-42a3-8fe1-39c97158c87c \n", + "\n", + " $etag satisfaction totalWaitTime \\\n", + "0 W/\"158b01df-d555-4c1b-bf44-9c1e8c63eb02\" 10.0 10.0 \n", + "1 W/\"5d7359d5-e0f6-44e7-80f8-2a3f191295f2\" 10.0 10.0 \n", + "2 W/\"d7a8af67-7b40-4ed8-94c4-553fb639e197\" 7.0 0.0 \n", + "3 W/\"ee1d4d68-aa14-4d35-a029-7635675f24d7\" 9.0 0.0 \n", + "4 W/\"d1242800-1c21-4bab-909f-8dc49ef0ce92\" 7.0 0.0 \n", + ".. ... ... ... \n", + "117 W/\"5ea29c9e-a6be-4c02-979a-df1b2aa8cb5c\" NaN NaN \n", + "118 W/\"002990f3-4ed8-464c-a90e-4b83ae5362fb\" NaN NaN \n", + "119 W/\"22d419c0-a6da-4935-82e3-5b1f7236908e\" NaN NaN \n", + "120 W/\"39cc602c-a41e-47bf-8da9-1a401419832a\" NaN NaN \n", + "121 W/\"094b5fa9-4443-4923-b8f9-24201fb2f26f\" NaN NaN \n", + "\n", + " $metadata event_title \\\n", + "0 {'$model': 'dtmi:billmanh:patron;1', 'satisfac... NaN \n", + "1 {'$model': 'dtmi:billmanh:patron;1', 'satisfac... NaN \n", + "2 {'$model': 'dtmi:billmanh:patron;1', 'satisfac... NaN \n", + "3 {'$model': 'dtmi:billmanh:patron;1', 'satisfac... NaN \n", + "4 {'$model': 'dtmi:billmanh:patron;1', 'satisfac... NaN \n", + ".. ... ... \n", + "117 {'$model': 'dtmi:billmanh:ticket;1', 'event_ti... Smashing Pumpkins \n", + "118 {'$model': 'dtmi:billmanh:ticket;1', 'event_ti... Foo Fighters \n", + "119 {'$model': 'dtmi:billmanh:ticket;1', 'event_ti... Foo Fighters \n", + "120 {'$model': 'dtmi:billmanh:ticket;1', 'event_ti... Foo Fighters \n", + "121 {'$model': 'dtmi:billmanh:ticket;1', 'event_ti... Foo Fighters \n", + "\n", + " state ticket_location capacity status \n", + "0 NaN NaN NaN NaN \n", + "1 NaN NaN NaN NaN \n", + "2 NaN NaN NaN NaN \n", + "3 NaN NaN NaN NaN \n", + "4 NaN NaN NaN NaN \n", + ".. ... ... ... ... \n", + "117 open 4 NaN NaN \n", + "118 open 1 NaN NaN \n", + "119 open 2 NaN NaN \n", + "120 open 3 NaN NaN \n", + "121 open 4 NaN NaN \n", + "\n", + "[122 rows x 10 columns]" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "def query_ADT(query):\n", + " query_result = service_client.query_twins(query)\n", + " values = [i for i in query_result]\n", + " return values\n", + "\n", + "def query_to_df(query):\n", + " query_result = query_ADT(query)\n", + " values = pd.DataFrame(query_result)\n", + " return values\n", + "\n", + "query_expression = \"SELECT * FROM digitaltwins\"\n", + "query_to_df(query_expression)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Note that the larger query will give you back all of the values, so you can pop it into a dataframe and filter on the `$metadata` to get the values you want" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## IS_OF_MODEL\n", + "The process for most analysis is to query the items that are relevant into a dataframe and do your analysis on them. " + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "count 84.000000\n", + "mean 7.142857\n", + "std 1.529965\n", + "min 5.000000\n", + "25% 6.000000\n", + "50% 7.000000\n", + "75% 8.250000\n", + "max 10.000000\n", + "Name: satisfaction, dtype: float64" + ] + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "query_expression = \"SELECT * FROM digitaltwins where IS_OF_MODEL('dtmi:mymodels:patron;1')\"\n", + "customers = query_to_df(query_expression)\n", + "customers.satisfaction.describe()" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
TCT
0{'$dtId': 'customer-cc04f3b6-39b0-4cef-bfff-a7...{'$dtId': 'line-2', '$etag': 'W/\"dd64cd24-6ec2...
1{'$dtId': 'customer-25e19268-3433-4f09-afe3-94...{'$dtId': 'line-2', '$etag': 'W/\"dd64cd24-6ec2...
2{'$dtId': 'customer-c87adbfa-1c6e-4ea9-9f03-83...{'$dtId': 'line-2', '$etag': 'W/\"dd64cd24-6ec2...
\n", + "
" + ], + "text/plain": [ + " T \\\n", + "0 {'$dtId': 'customer-cc04f3b6-39b0-4cef-bfff-a7... \n", + "1 {'$dtId': 'customer-25e19268-3433-4f09-afe3-94... \n", + "2 {'$dtId': 'customer-c87adbfa-1c6e-4ea9-9f03-83... \n", + "\n", + " CT \n", + "0 {'$dtId': 'line-2', '$etag': 'W/\"dd64cd24-6ec2... \n", + "1 {'$dtId': 'line-2', '$etag': 'W/\"dd64cd24-6ec2... \n", + "2 {'$dtId': 'line-2', '$etag': 'W/\"dd64cd24-6ec2... " + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "query_expression =\"\"\"\n", + "SELECT T, CT\n", + "FROM DIGITALTWINS T\n", + "JOIN CT RELATED T.locatedIn\n", + "WHERE CT.$dtId = 'line-2'\n", + "\"\"\"\n", + "\n", + "customers_in_area_2 = query_to_df(query_expression)\n", + "customers_in_area_2" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Ok let's unpack that:\n", + "\n", + "`SELECT T, CT` - means to give short names to all the different classes, so in this case `T` refers to all twins, and CT refers to a related item. The related item comes out in the second column\n", + "\n", + "`RELATED T.locatedIn` - gits all of elements that have a `locatedIn` relationship and stores it in `CT`. \n", + "\n", + "`WHERE CT.$dtId = 'line-2'` - limits the query to items that have that relationship with `line-2`. This is the filter part. \n", + "\n", + "**Note** it seems that all _joined queries_ require a specific twin by name. \n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "T {'$dtId': 'customer-cc04f3b6-39b0-4cef-bfff-a7...\n", + "CT {'$dtId': 'line-2', '$etag': 'W/\"dd64cd24-6ec2...\n", + "Name: 0, dtype: object" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "customers_in_area_2.loc[0]" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'$dtId': 'line-2',\n", + " '$etag': 'W/\"dd64cd24-6ec2-452d-b17a-83ebe4bcd73a\"',\n", + " 'capacity': 3,\n", + " '$metadata': {'$model': 'dtmi:billmanh:line;1',\n", + " 'capacity': {'lastUpdateTime': '2020-11-30T00:10:31.5945931Z'}}}" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "customers_in_area_2.loc[0,'CT']" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "So let's look at the customers in `line-2`" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'$dtId': 'customer-cc04f3b6-39b0-4cef-bfff-a7d668cce446',\n", + " '$etag': 'W/\"158b01df-d555-4c1b-bf44-9c1e8c63eb02\"',\n", + " 'satisfaction': 10,\n", + " 'totalWaitTime': 10,\n", + " '$metadata': {'$model': 'dtmi:billmanh:patron;1',\n", + " 'satisfaction': {'lastUpdateTime': '2020-11-19T02:17:30.1401999Z'},\n", + " 'totalWaitTime': {'lastUpdateTime': '2020-11-19T02:17:30.1401999Z'}}}" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "customers_in_area_2.loc[0,'T']" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
$dtId$etagsatisfactiontotalWaitTime$metadata
0customer-cc04f3b6-39b0-4cef-bfff-a7d668cce446W/\"158b01df-d555-4c1b-bf44-9c1e8c63eb02\"1010{'$model': 'dtmi:billmanh:patron;1', 'satisfac...
1customer-25e19268-3433-4f09-afe3-94f466313368W/\"91509c0d-7dc9-465b-a735-2fde2f67fe02\"1010{'$model': 'dtmi:billmanh:patron;1', 'satisfac...
2customer-c87adbfa-1c6e-4ea9-9f03-83e3877ef5fcW/\"44f9fd9b-141f-4603-8a0b-ad8a3730ed0d\"80{'$model': 'dtmi:billmanh:patron;1', 'satisfac...
\n", + "
" + ], + "text/plain": [ + " $dtId \\\n", + "0 customer-cc04f3b6-39b0-4cef-bfff-a7d668cce446 \n", + "1 customer-25e19268-3433-4f09-afe3-94f466313368 \n", + "2 customer-c87adbfa-1c6e-4ea9-9f03-83e3877ef5fc \n", + "\n", + " $etag satisfaction totalWaitTime \\\n", + "0 W/\"158b01df-d555-4c1b-bf44-9c1e8c63eb02\" 10 10 \n", + "1 W/\"91509c0d-7dc9-465b-a735-2fde2f67fe02\" 10 10 \n", + "2 W/\"44f9fd9b-141f-4603-8a0b-ad8a3730ed0d\" 8 0 \n", + "\n", + " $metadata \n", + "0 {'$model': 'dtmi:billmanh:patron;1', 'satisfac... \n", + "1 {'$model': 'dtmi:billmanh:patron;1', 'satisfac... \n", + "2 {'$model': 'dtmi:billmanh:patron;1', 'satisfac... " + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "l2_cust = pd.DataFrame(customers_in_area_2['T'].tolist())\n", + "l2_cust" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "count 3.000000\n", + "mean 9.333333\n", + "std 1.154701\n", + "min 8.000000\n", + "25% 9.000000\n", + "50% 10.000000\n", + "75% 10.000000\n", + "max 10.000000\n", + "Name: satisfaction, dtype: float64" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "l2_cust.satisfaction.describe()" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "count 84.000000\n", + "mean 7.142857\n", + "std 1.529965\n", + "min 5.000000\n", + "25% 6.000000\n", + "50% 7.000000\n", + "75% 8.250000\n", + "max 10.000000\n", + "Name: satisfaction, dtype: float64" + ] + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "customers.satisfaction.describe()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Customers in line 2 have higher satisfaction than customers in general. " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## How many people in each line" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
COUNT
05
\n", + "
" + ], + "text/plain": [ + " COUNT\n", + "0 5" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "query = \"\"\"\n", + "SELECT COUNT() \n", + "FROM DIGITALTWINS T \n", + "JOIN CT RELATED T.locatedIn \n", + "WHERE CT.$dtId IN ['line-0','line-1','line-2', 'line-3']\n", + "\"\"\"\n", + "\n", + "customers_in_lines = query_to_df(query)\n", + "customers_in_lines" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
COUNT
03
\n", + "
" + ], + "text/plain": [ + " COUNT\n", + "0 3" + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "query = \"\"\"\n", + "SELECT COUNT() \n", + "FROM DIGITALTWINS T \n", + "JOIN CT RELATED T.locatedIn \n", + "WHERE CT.$dtId IN ['line-2']\n", + "\"\"\"\n", + "\n", + "customers_in_lines = query_to_df(query)\n", + "customers_in_lines" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The rough part is that you can only get one count back, not a count per line, like you could with propper SQL. You also have to hard code all of your `$dtID` as they require literal values. Lame.\n", + "\n", + "Here is the way around that. \n", + "\n", + "`SELECT line, customer` <- select the columns that you want the query to return\n", + "\n", + "`AND IS_OF_MODEL(customer, 'dtmi:billmanh:patron;1')` <- specify that `customer` are twins of the `patron` model. \n", + "\n", + "You still have to hard type the names of the lines, or rooms or whatever, but it returns all of the customers in all of the lines. " + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
linecustomer
0{'$dtId': 'line-1', '$etag': 'W/\"aa93fee2-cba0...{'$dtId': 'customer-e6f49d8a-711b-41c3-9db8-c7...
1{'$dtId': 'line-1', '$etag': 'W/\"aa93fee2-cba0...{'$dtId': 'customer-21e17d28-76c3-4c04-8df9-39...
2{'$dtId': 'line-2', '$etag': 'W/\"dd64cd24-6ec2...{'$dtId': 'customer-cc04f3b6-39b0-4cef-bfff-a7...
3{'$dtId': 'line-2', '$etag': 'W/\"dd64cd24-6ec2...{'$dtId': 'customer-25e19268-3433-4f09-afe3-94...
4{'$dtId': 'line-2', '$etag': 'W/\"dd64cd24-6ec2...{'$dtId': 'customer-c87adbfa-1c6e-4ea9-9f03-83...
\n", + "
" + ], + "text/plain": [ + " line \\\n", + "0 {'$dtId': 'line-1', '$etag': 'W/\"aa93fee2-cba0... \n", + "1 {'$dtId': 'line-1', '$etag': 'W/\"aa93fee2-cba0... \n", + "2 {'$dtId': 'line-2', '$etag': 'W/\"dd64cd24-6ec2... \n", + "3 {'$dtId': 'line-2', '$etag': 'W/\"dd64cd24-6ec2... \n", + "4 {'$dtId': 'line-2', '$etag': 'W/\"dd64cd24-6ec2... \n", + "\n", + " customer \n", + "0 {'$dtId': 'customer-e6f49d8a-711b-41c3-9db8-c7... \n", + "1 {'$dtId': 'customer-21e17d28-76c3-4c04-8df9-39... \n", + "2 {'$dtId': 'customer-cc04f3b6-39b0-4cef-bfff-a7... \n", + "3 {'$dtId': 'customer-25e19268-3433-4f09-afe3-94... \n", + "4 {'$dtId': 'customer-c87adbfa-1c6e-4ea9-9f03-83... " + ] + }, + "execution_count": 13, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "query = \"\"\"\n", + "SELECT line, customer\n", + "FROM DIGITALTWINS customer\n", + "JOIN line RELATED customer.locatedIn\n", + "WHERE line.$dtId IN ['line-0','line-1','line-2', 'line-3']\n", + "AND IS_OF_MODEL(customer, 'dtmi:mymodels:patron;1')\n", + "\"\"\"\n", + "\n", + "customers_in_lines = query_to_df(query)\n", + "customers_in_lines" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Easy enough to munge it into a dataframe:" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
line$etagcapacity$metadatacustomer$etagsatisfactiontotalWaitTime$metadata
0line-1W/\"aa93fee2-cba0-4bd4-a020-114f058b0f01\"3{'$model': 'dtmi:billmanh:line;1', 'capacity':...customer-e6f49d8a-711b-41c3-9db8-c7ece3dbc32cW/\"d1242800-1c21-4bab-909f-8dc49ef0ce92\"70{'$model': 'dtmi:billmanh:patron;1', 'satisfac...
1line-1W/\"aa93fee2-cba0-4bd4-a020-114f058b0f01\"3{'$model': 'dtmi:billmanh:line;1', 'capacity':...customer-21e17d28-76c3-4c04-8df9-396703692a68W/\"c62357a9-f4e5-4ec6-9d60-08b0da1125a7\"80{'$model': 'dtmi:billmanh:patron;1', 'satisfac...
2line-2W/\"dd64cd24-6ec2-452d-b17a-83ebe4bcd73a\"3{'$model': 'dtmi:billmanh:line;1', 'capacity':...customer-cc04f3b6-39b0-4cef-bfff-a7d668cce446W/\"158b01df-d555-4c1b-bf44-9c1e8c63eb02\"1010{'$model': 'dtmi:billmanh:patron;1', 'satisfac...
3line-2W/\"dd64cd24-6ec2-452d-b17a-83ebe4bcd73a\"3{'$model': 'dtmi:billmanh:line;1', 'capacity':...customer-25e19268-3433-4f09-afe3-94f466313368W/\"91509c0d-7dc9-465b-a735-2fde2f67fe02\"1010{'$model': 'dtmi:billmanh:patron;1', 'satisfac...
4line-2W/\"dd64cd24-6ec2-452d-b17a-83ebe4bcd73a\"3{'$model': 'dtmi:billmanh:line;1', 'capacity':...customer-c87adbfa-1c6e-4ea9-9f03-83e3877ef5fcW/\"44f9fd9b-141f-4603-8a0b-ad8a3730ed0d\"80{'$model': 'dtmi:billmanh:patron;1', 'satisfac...
\n", + "
" + ], + "text/plain": [ + " line $etag capacity \\\n", + "0 line-1 W/\"aa93fee2-cba0-4bd4-a020-114f058b0f01\" 3 \n", + "1 line-1 W/\"aa93fee2-cba0-4bd4-a020-114f058b0f01\" 3 \n", + "2 line-2 W/\"dd64cd24-6ec2-452d-b17a-83ebe4bcd73a\" 3 \n", + "3 line-2 W/\"dd64cd24-6ec2-452d-b17a-83ebe4bcd73a\" 3 \n", + "4 line-2 W/\"dd64cd24-6ec2-452d-b17a-83ebe4bcd73a\" 3 \n", + "\n", + " $metadata \\\n", + "0 {'$model': 'dtmi:billmanh:line;1', 'capacity':... \n", + "1 {'$model': 'dtmi:billmanh:line;1', 'capacity':... \n", + "2 {'$model': 'dtmi:billmanh:line;1', 'capacity':... \n", + "3 {'$model': 'dtmi:billmanh:line;1', 'capacity':... \n", + "4 {'$model': 'dtmi:billmanh:line;1', 'capacity':... \n", + "\n", + " customer \\\n", + "0 customer-e6f49d8a-711b-41c3-9db8-c7ece3dbc32c \n", + "1 customer-21e17d28-76c3-4c04-8df9-396703692a68 \n", + "2 customer-cc04f3b6-39b0-4cef-bfff-a7d668cce446 \n", + "3 customer-25e19268-3433-4f09-afe3-94f466313368 \n", + "4 customer-c87adbfa-1c6e-4ea9-9f03-83e3877ef5fc \n", + "\n", + " $etag satisfaction totalWaitTime \\\n", + "0 W/\"d1242800-1c21-4bab-909f-8dc49ef0ce92\" 7 0 \n", + "1 W/\"c62357a9-f4e5-4ec6-9d60-08b0da1125a7\" 8 0 \n", + "2 W/\"158b01df-d555-4c1b-bf44-9c1e8c63eb02\" 10 10 \n", + "3 W/\"91509c0d-7dc9-465b-a735-2fde2f67fe02\" 10 10 \n", + "4 W/\"44f9fd9b-141f-4603-8a0b-ad8a3730ed0d\" 8 0 \n", + "\n", + " $metadata \n", + "0 {'$model': 'dtmi:billmanh:patron;1', 'satisfac... \n", + "1 {'$model': 'dtmi:billmanh:patron;1', 'satisfac... \n", + "2 {'$model': 'dtmi:billmanh:patron;1', 'satisfac... \n", + "3 {'$model': 'dtmi:billmanh:patron;1', 'satisfac... \n", + "4 {'$model': 'dtmi:billmanh:patron;1', 'satisfac... " + ] + }, + "execution_count": 14, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "c_in_line = pd.concat(\n", + " [pd.DataFrame(customers_in_lines['line'].tolist()),\n", + " pd.DataFrame(customers_in_lines['customer'].tolist())],\n", + " axis=1\n", + ")\n", + "\n", + "cols = c_in_line.columns.tolist()\n", + "cols[0] = 'line'\n", + "cols[4] = 'customer'\n", + "c_in_line.columns = cols\n", + "c_in_line" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "How many people are in each line: " + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "line\n", + "line-1 2\n", + "line-2 3\n", + "Name: customer, dtype: int64" + ] + }, + "execution_count": 15, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "c_in_line.groupby('line').count()['customer']" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Which group of people has the highest satisfaction?" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "line\n", + "line-1 7.500000\n", + "line-2 9.333333\n", + "Name: satisfaction, dtype: float64" + ] + }, + "execution_count": 16, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "c_in_line.groupby('line').mean()['satisfaction']" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python (azure_test)", + "language": "python", + "name": "azure_test" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.9" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} \ No newline at end of file diff --git a/sdk/digitaltwins/azure-digitaltwins-core/samples/notebooks/models/Patron.json b/sdk/digitaltwins/azure-digitaltwins-core/samples/notebooks/models/Patron.json new file mode 100644 index 000000000000..7a34a5945d00 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/samples/notebooks/models/Patron.json @@ -0,0 +1,43 @@ +{ + "@id": "dtmi:mymodels:patron;1", + "@type": "Interface", + "displayName": "Patron", + "contents": [ + { + "@type": "Command", + "name": "order", + "request": { + "name": "wallet", + "displayName": "available money", + "description": "how much the patron is willing to spend", + "schema": "double" + }, + "response": { + "name": "decision", + "displayName": "consumer decision", + "schema": "string" + } + }, + { + "@type": "Property", + "name": "totalWaitTime", + "displayName": "Total Wait Time", + "schema": "double", + "comment": "time in seconds that the customer is required to wait" + }, + { + "@type": "Property", + "name": "satisfaction", + "displayName": "Customer Satisfaction", + "schema": "integer", + "comment": "1-10 scale of how likely to recommend to a friend (NPS)" + }, + { + "@type": "Relationship", + "name": "locatedIn" + } + ], + "@context": "dtmi:dtdl:context;2", + "comment": "This should represent one restaurant visitor.", + "description": "As an example, contains all of the properties possible in the DTDL." +} \ No newline at end of file diff --git a/sdk/digitaltwins/azure-digitaltwins-core/samples/notebooks/models/area.json b/sdk/digitaltwins/azure-digitaltwins-core/samples/notebooks/models/area.json new file mode 100644 index 000000000000..90f84d04aa35 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/samples/notebooks/models/area.json @@ -0,0 +1,28 @@ +{ + "@id": "dtmi:mymodels:area;1", + "@type": "Interface", + "displayName": "area", + "contents": [ + { + "@type": "Property", + "name": "capacity", + "displayName": "capacity", + "schema": "double", + "comment": "How many people can safely be in this area." + }, + { + "@type": "Property", + "name": "status", + "displayName": "status", + "schema": "string", + "comment": "open, closed, etc." + }, + { + "@type": "Relationship", + "name": "occupiedBy" + } + ], + "@context": "dtmi:dtdl:context;2", + "comment": "A number of people in a room", + "description": "a room" +} \ No newline at end of file diff --git a/sdk/digitaltwins/azure-digitaltwins-core/samples/notebooks/models/line.json b/sdk/digitaltwins/azure-digitaltwins-core/samples/notebooks/models/line.json new file mode 100644 index 000000000000..20004091a117 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/samples/notebooks/models/line.json @@ -0,0 +1,35 @@ +{ + "@id": "dtmi:mymodels:line;1", + "@type": "Interface", + "displayName": "line", + "contents": [ + { + "@type": "Property", + "name": "capacity", + "displayName": "capacity", + "schema": "double", + "comment": "How many people can safely wait in this line." + }, + { + "@type": "Property", + "name": "status", + "displayName": "status", + "schema": "string", + "comment": "current status of the line" + }, + { + "@type": "Relationship", + "name": "leadsTo", + "properties": [ + { + "@type": "Property", + "name": "walk_distance", + "schema": "double" + } + ] + } + ], + "@context": "dtmi:dtdl:context;2", + "comment": "lines can hold a number of people.", + "description": "a group of people waiting to get into a place." +} \ No newline at end of file diff --git a/sdk/digitaltwins/azure-digitaltwins-core/samples/notebooks/models/ticket.json b/sdk/digitaltwins/azure-digitaltwins-core/samples/notebooks/models/ticket.json new file mode 100644 index 000000000000..94f4ef3d8a01 --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/samples/notebooks/models/ticket.json @@ -0,0 +1,63 @@ +{ + "@id": "dtmi:mymodels:ticket;1", + "@type": "Interface", + "displayName": "ticket", + "contents": [ + { + "@type": "Property", + "name": "purchaselocation_lat", + "displayName": "puchased location (latitude)", + "schema": "double", + "comment": "latitude of the place where the ticket was purchased" + }, + { + "@type": "Property", + "name": "purchaselocation_long", + "displayName": "puchased location", + "schema": "double", + "comment": "longitude of the place where the ticket was purchased" + }, + { + "@type": "Property", + "name": "sold_to", + "displayName": "sold to", + "schema": "string", + "comment": "UID of the purchaser from customer data" + }, + { + "@type": "Property", + "name": "event_title", + "displayName": "event name", + "schema": "string", + "comment": "name or id of the event" + }, + { + "@type": "Property", + "name": "ticket_location", + "displayName": "ticket location", + "schema": "string", + "comment": "location of the seat, for demonstration this is just a number" + }, + { + "@type": "Property", + "name": "state", + "displayName": "state", + "schema": "string", + "comment": "current state of the ticket" + }, + { + "@type": "Relationship", + "name": "ownedBy", + "properties": [ + { + "@type": "Property", + "name": "bought_online", + "schema": "boolean" + } + ] + } + ], + "@context": "dtmi:dtdl:context;2", + "comment": "A number of tickets are placed into ADT before purchase with the initial state: open", + "description": "an abstract ticket" +} \ No newline at end of file diff --git a/sdk/digitaltwins/azure-digitaltwins-core/samples/notebooks/readme.md b/sdk/digitaltwins/azure-digitaltwins-core/samples/notebooks/readme.md new file mode 100644 index 000000000000..160a69239fdd --- /dev/null +++ b/sdk/digitaltwins/azure-digitaltwins-core/samples/notebooks/readme.md @@ -0,0 +1,20 @@ +## Digital Twin Tutorial + +These notebooks will show you how to create a graph and interact with it through the Python API. It will build a venue and allow you to measure the customer satisfaction of people as the pass through the system. + + +You will need: +* A conda environment with the latest `Azure-Digital-Twin SDK` +* The Azure CLI tools for authentication +* The digital twin explorer +* A digital twin account, where you have sufficient permission. + + +The perspective of these notebooks is from the role of the **Analyst** not an application. The purpose is to use the graph to get insights on customers. This would allow you to query the API in real time, as events are happening. + +| notebook | purpose | +|----------|:-------------:| +| 01 | The basics of connecting, uploading models and creating twins | +| 02 | More details about creating relationships, updating values and basic queries | +| 03 | Some examples of arbitrary model changes that I made to shape the model | +| 04 | More detail about running queries with some examples of how to get insights | From fd80cb7a31a15275b2a5008d68f91dbe35493543 Mon Sep 17 00:00:00 2001 From: Azure CLI Bot Date: Tue, 14 Sep 2021 13:52:13 +0800 Subject: [PATCH 52/85] [AutoRelease] t2-storage-2021-09-14-45016(Do not merge) (#20678) * CodeGen from PR 15627 in Azure/azure-rest-api-specs [SRP] 2021-06-01 Swagger Api (#15627) * Add June21 Swagger Api version, Updated Readme files * adding abort and hnson migration swagger API * swagger: marking requesttype as required parameter for hns onmigration * Added new PublicNetworkAccess property to swagger spec * Add enableNfsV3RootSquash and enableNfsV3AllSquash to June21 swagger * Add Account Level VLW Swagger changes and example * Update Blob Inventory Api comment to include AccessTierInferred and Tags * Rename HnsOn to hierarchical namespace * [Swagger] [June21] Added defaultToOAuthAuthentication to swagger spec * Update Spell check custom words list. Correct incorrect spellings * Add missing refrences to PublicNetworkAccess Examples * Add required type:object, Add default return type for hns migration apis * Prettier tool update to storage.json * Add update account with immutability policy example * Removed StorageFileDataSmbShareOwner as Server side does not support it * Add AllowProtectedAppendWritesAll feature changes with example * Updated enum values and description for PublicNetworkAccess * Add type:object to ProtectedAppendWritesHistory ; Spellcheck * version,CHANGELOG Co-authored-by: SDKAuto Co-authored-by: PythonSdkPipelines --- sdk/storage/azure-mgmt-storage/CHANGELOG.md | 30 + sdk/storage/azure-mgmt-storage/MANIFEST.in | 1 + sdk/storage/azure-mgmt-storage/_meta.json | 11 +- .../storage/_storage_management_client.py | 63 +- .../azure/mgmt/storage/_version.py | 2 +- .../storage/aio/_storage_management_client.py | 63 +- .../azure/mgmt/storage/models.py | 2 +- .../mgmt/storage/v2015_06_15/_version.py | 2 +- .../_storage_accounts_operations.py | 24 +- .../aio/operations/_usage_operations.py | 2 +- .../_storage_accounts_operations.py | 4 +- .../mgmt/storage/v2016_01_01/_version.py | 2 +- .../_storage_accounts_operations.py | 24 +- .../aio/operations/_usage_operations.py | 2 +- .../storage/v2016_01_01/models/_models.py | 6 +- .../storage/v2016_01_01/models/_models_py3.py | 6 +- .../_storage_accounts_operations.py | 4 +- .../mgmt/storage/v2016_12_01/_version.py | 2 +- .../_storage_accounts_operations.py | 28 +- .../aio/operations/_usage_operations.py | 2 +- .../storage/v2016_12_01/models/_models.py | 6 +- .../storage/v2016_12_01/models/_models_py3.py | 6 +- .../_storage_accounts_operations.py | 4 +- .../mgmt/storage/v2017_06_01/_version.py | 2 +- .../v2017_06_01/aio/operations/_operations.py | 2 +- .../aio/operations/_skus_operations.py | 2 +- .../_storage_accounts_operations.py | 28 +- .../aio/operations/_usage_operations.py | 2 +- .../storage/v2017_06_01/models/_models.py | 26 +- .../storage/v2017_06_01/models/_models_py3.py | 28 +- .../_storage_accounts_operations.py | 4 +- .../mgmt/storage/v2017_10_01/_version.py | 2 +- .../v2017_10_01/aio/operations/_operations.py | 2 +- .../aio/operations/_skus_operations.py | 2 +- .../_storage_accounts_operations.py | 28 +- .../aio/operations/_usage_operations.py | 2 +- .../storage/v2017_10_01/models/_models.py | 26 +- .../storage/v2017_10_01/models/_models_py3.py | 28 +- .../_storage_accounts_operations.py | 4 +- .../mgmt/storage/v2018_02_01/_version.py | 2 +- .../operations/_blob_containers_operations.py | 26 +- .../v2018_02_01/aio/operations/_operations.py | 2 +- .../aio/operations/_skus_operations.py | 2 +- .../_storage_accounts_operations.py | 28 +- .../aio/operations/_usage_operations.py | 4 +- .../storage/v2018_02_01/models/_models.py | 26 +- .../storage/v2018_02_01/models/_models_py3.py | 28 +- .../_storage_accounts_operations.py | 4 +- .../storage/v2018_03_01_preview/_version.py | 2 +- .../operations/_blob_containers_operations.py | 26 +- .../aio/operations/_operations.py | 2 +- .../aio/operations/_skus_operations.py | 2 +- .../_storage_accounts_operations.py | 34 +- .../aio/operations/_usages_operations.py | 4 +- .../v2018_03_01_preview/models/_models.py | 42 +- .../v2018_03_01_preview/models/_models_py3.py | 54 +- .../_storage_accounts_operations.py | 4 +- .../mgmt/storage/v2018_07_01/_version.py | 2 +- .../operations/_blob_containers_operations.py | 26 +- .../operations/_blob_services_operations.py | 4 +- .../_management_policies_operations.py | 6 +- .../v2018_07_01/aio/operations/_operations.py | 2 +- .../aio/operations/_skus_operations.py | 2 +- .../_storage_accounts_operations.py | 36 +- .../aio/operations/_usages_operations.py | 2 +- .../storage/v2018_07_01/models/_models.py | 42 +- .../storage/v2018_07_01/models/_models_py3.py | 54 +- .../_storage_accounts_operations.py | 8 +- .../mgmt/storage/v2018_11_01/_version.py | 2 +- .../operations/_blob_containers_operations.py | 26 +- .../operations/_blob_services_operations.py | 4 +- .../_management_policies_operations.py | 6 +- .../v2018_11_01/aio/operations/_operations.py | 2 +- .../aio/operations/_skus_operations.py | 2 +- .../_storage_accounts_operations.py | 38 +- .../aio/operations/_usages_operations.py | 2 +- .../storage/v2018_11_01/models/_models.py | 26 +- .../storage/v2018_11_01/models/_models_py3.py | 28 +- .../_storage_accounts_operations.py | 8 +- .../mgmt/storage/v2019_04_01/_version.py | 2 +- .../operations/_blob_containers_operations.py | 26 +- .../operations/_blob_services_operations.py | 6 +- .../operations/_file_services_operations.py | 6 +- .../aio/operations/_file_shares_operations.py | 10 +- .../_management_policies_operations.py | 6 +- .../v2019_04_01/aio/operations/_operations.py | 2 +- .../aio/operations/_skus_operations.py | 2 +- .../_storage_accounts_operations.py | 38 +- .../aio/operations/_usages_operations.py | 2 +- .../storage/v2019_04_01/models/_models.py | 26 +- .../storage/v2019_04_01/models/_models_py3.py | 28 +- .../_storage_accounts_operations.py | 8 +- .../mgmt/storage/v2019_06_01/_version.py | 2 +- .../operations/_blob_containers_operations.py | 26 +- .../_blob_inventory_policies_operations.py | 8 +- .../operations/_blob_services_operations.py | 6 +- .../_encryption_scopes_operations.py | 8 +- .../operations/_file_services_operations.py | 6 +- .../aio/operations/_file_shares_operations.py | 12 +- .../_management_policies_operations.py | 6 +- ..._object_replication_policies_operations.py | 8 +- .../v2019_06_01/aio/operations/_operations.py | 2 +- ...private_endpoint_connections_operations.py | 8 +- .../_private_link_resources_operations.py | 2 +- .../aio/operations/_queue_operations.py | 10 +- .../operations/_queue_services_operations.py | 6 +- .../aio/operations/_skus_operations.py | 2 +- .../_storage_accounts_operations.py | 46 +- .../aio/operations/_table_operations.py | 10 +- .../operations/_table_services_operations.py | 6 +- .../aio/operations/_usages_operations.py | 2 +- .../storage/v2019_06_01/models/_models.py | 26 +- .../storage/v2019_06_01/models/_models_py3.py | 28 +- .../_storage_accounts_operations.py | 12 +- .../storage/v2020_08_01_preview/_version.py | 2 +- .../operations/_blob_containers_operations.py | 26 +- .../_blob_inventory_policies_operations.py | 8 +- .../operations/_blob_services_operations.py | 6 +- .../_deleted_accounts_operations.py | 4 +- .../_encryption_scopes_operations.py | 8 +- .../operations/_file_services_operations.py | 6 +- .../aio/operations/_file_shares_operations.py | 12 +- .../_management_policies_operations.py | 6 +- ..._object_replication_policies_operations.py | 8 +- .../aio/operations/_operations.py | 2 +- ...private_endpoint_connections_operations.py | 8 +- .../_private_link_resources_operations.py | 2 +- .../aio/operations/_queue_operations.py | 10 +- .../operations/_queue_services_operations.py | 6 +- .../aio/operations/_skus_operations.py | 2 +- .../_storage_accounts_operations.py | 46 +- .../aio/operations/_table_operations.py | 10 +- .../operations/_table_services_operations.py | 6 +- .../aio/operations/_usages_operations.py | 2 +- .../v2020_08_01_preview/models/_models.py | 26 +- .../v2020_08_01_preview/models/_models_py3.py | 28 +- .../_storage_accounts_operations.py | 12 +- .../mgmt/storage/v2021_01_01/_version.py | 2 +- .../operations/_blob_containers_operations.py | 26 +- .../_blob_inventory_policies_operations.py | 8 +- .../operations/_blob_services_operations.py | 6 +- .../_deleted_accounts_operations.py | 4 +- .../_encryption_scopes_operations.py | 8 +- .../operations/_file_services_operations.py | 6 +- .../aio/operations/_file_shares_operations.py | 12 +- .../_management_policies_operations.py | 6 +- ..._object_replication_policies_operations.py | 8 +- .../v2021_01_01/aio/operations/_operations.py | 2 +- ...private_endpoint_connections_operations.py | 8 +- .../_private_link_resources_operations.py | 2 +- .../aio/operations/_queue_operations.py | 10 +- .../operations/_queue_services_operations.py | 6 +- .../aio/operations/_skus_operations.py | 2 +- .../_storage_accounts_operations.py | 46 +- .../aio/operations/_table_operations.py | 10 +- .../operations/_table_services_operations.py | 6 +- .../aio/operations/_usages_operations.py | 2 +- .../storage/v2021_01_01/models/_models.py | 24 +- .../storage/v2021_01_01/models/_models_py3.py | 26 +- .../_storage_accounts_operations.py | 12 +- .../mgmt/storage/v2021_02_01/_version.py | 2 +- .../operations/_blob_containers_operations.py | 26 +- .../_blob_inventory_policies_operations.py | 8 +- .../operations/_blob_services_operations.py | 6 +- .../_deleted_accounts_operations.py | 4 +- .../_encryption_scopes_operations.py | 8 +- .../operations/_file_services_operations.py | 6 +- .../aio/operations/_file_shares_operations.py | 12 +- .../_management_policies_operations.py | 6 +- ..._object_replication_policies_operations.py | 8 +- .../v2021_02_01/aio/operations/_operations.py | 2 +- ...private_endpoint_connections_operations.py | 8 +- .../_private_link_resources_operations.py | 2 +- .../aio/operations/_queue_operations.py | 10 +- .../operations/_queue_services_operations.py | 6 +- .../aio/operations/_skus_operations.py | 2 +- .../_storage_accounts_operations.py | 46 +- .../aio/operations/_table_operations.py | 10 +- .../operations/_table_services_operations.py | 6 +- .../aio/operations/_usages_operations.py | 2 +- .../storage/v2021_02_01/models/_models.py | 24 +- .../storage/v2021_02_01/models/_models_py3.py | 26 +- .../_storage_accounts_operations.py | 12 +- .../mgmt/storage/v2021_04_01/_version.py | 2 +- .../operations/_blob_containers_operations.py | 34 +- .../_blob_inventory_policies_operations.py | 8 +- .../operations/_blob_services_operations.py | 6 +- .../_deleted_accounts_operations.py | 4 +- .../_encryption_scopes_operations.py | 8 +- .../operations/_file_services_operations.py | 6 +- .../aio/operations/_file_shares_operations.py | 14 +- .../_management_policies_operations.py | 6 +- ..._object_replication_policies_operations.py | 26 +- .../v2021_04_01/aio/operations/_operations.py | 2 +- ...private_endpoint_connections_operations.py | 8 +- .../_private_link_resources_operations.py | 2 +- .../aio/operations/_queue_operations.py | 10 +- .../operations/_queue_services_operations.py | 6 +- .../aio/operations/_skus_operations.py | 2 +- .../_storage_accounts_operations.py | 46 +- .../aio/operations/_table_operations.py | 10 +- .../operations/_table_services_operations.py | 6 +- .../aio/operations/_usages_operations.py | 2 +- .../storage/v2021_04_01/models/_models.py | 40 +- .../storage/v2021_04_01/models/_models_py3.py | 46 +- .../operations/_blob_containers_operations.py | 4 +- ..._object_replication_policies_operations.py | 18 +- .../_storage_accounts_operations.py | 12 +- .../mgmt/storage/v2021_06_01/__init__.py | 19 + .../storage/v2021_06_01/_configuration.py | 71 + .../mgmt/storage/v2021_06_01/_metadata.json | 121 + .../v2021_06_01/_storage_management_client.py | 179 + .../mgmt/storage/v2021_06_01/_version.py | 9 + .../mgmt/storage/v2021_06_01/aio/__init__.py | 10 + .../storage/v2021_06_01/aio/_configuration.py | 67 + .../aio/_storage_management_client.py | 172 + .../v2021_06_01/aio/operations/__init__.py | 49 + .../operations/_blob_containers_operations.py | 1208 ++++ .../_blob_inventory_policies_operations.py | 326 + .../operations/_blob_services_operations.py | 256 + .../_deleted_accounts_operations.py | 168 + .../_encryption_scopes_operations.py | 349 + .../operations/_file_services_operations.py | 242 + .../aio/operations/_file_shares_operations.py | 628 ++ .../_management_policies_operations.py | 242 + ..._object_replication_policies_operations.py | 333 + .../v2021_06_01/aio/operations/_operations.py | 104 + ...private_endpoint_connections_operations.py | 325 + .../_private_link_resources_operations.py | 102 + .../aio/operations/_queue_operations.py | 421 ++ .../operations/_queue_services_operations.py | 242 + .../aio/operations/_skus_operations.py | 108 + .../_storage_accounts_operations.py | 1383 ++++ .../aio/operations/_table_operations.py | 389 + .../operations/_table_services_operations.py | 242 + .../aio/operations/_usages_operations.py | 113 + .../storage/v2021_06_01/models/__init__.py | 559 ++ .../storage/v2021_06_01/models/_models.py | 5943 +++++++++++++++ .../storage/v2021_06_01/models/_models_py3.py | 6424 +++++++++++++++++ .../_storage_management_client_enums.py | 528 ++ .../v2021_06_01/operations/__init__.py | 49 + .../operations/_blob_containers_operations.py | 1227 ++++ .../_blob_inventory_policies_operations.py | 334 + .../operations/_blob_services_operations.py | 263 + .../_deleted_accounts_operations.py | 174 + .../_encryption_scopes_operations.py | 357 + .../operations/_file_services_operations.py | 249 + .../operations/_file_shares_operations.py | 639 ++ .../_management_policies_operations.py | 249 + ..._object_replication_policies_operations.py | 341 + .../v2021_06_01/operations/_operations.py | 109 + ...private_endpoint_connections_operations.py | 333 + .../_private_link_resources_operations.py | 107 + .../operations/_queue_operations.py | 430 ++ .../operations/_queue_services_operations.py | 249 + .../operations/_skus_operations.py | 113 + .../_storage_accounts_operations.py | 1408 ++++ .../operations/_table_operations.py | 398 + .../operations/_table_services_operations.py | 249 + .../operations/_usages_operations.py | 118 + .../azure/mgmt/storage/v2021_06_01/py.typed | 1 + 261 files changed, 30036 insertions(+), 1259 deletions(-) create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/__init__.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/_configuration.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/_metadata.json create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/_storage_management_client.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/_version.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/__init__.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/_configuration.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/_storage_management_client.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/__init__.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_blob_containers_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_blob_inventory_policies_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_blob_services_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_deleted_accounts_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_encryption_scopes_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_file_services_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_file_shares_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_management_policies_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_object_replication_policies_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_private_endpoint_connections_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_private_link_resources_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_queue_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_queue_services_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_skus_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_storage_accounts_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_table_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_table_services_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_usages_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/models/__init__.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/models/_models.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/models/_models_py3.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/models/_storage_management_client_enums.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/__init__.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_blob_containers_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_blob_inventory_policies_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_blob_services_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_deleted_accounts_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_encryption_scopes_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_file_services_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_file_shares_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_management_policies_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_object_replication_policies_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_private_endpoint_connections_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_private_link_resources_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_queue_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_queue_services_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_skus_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_storage_accounts_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_table_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_table_services_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_usages_operations.py create mode 100644 sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/py.typed diff --git a/sdk/storage/azure-mgmt-storage/CHANGELOG.md b/sdk/storage/azure-mgmt-storage/CHANGELOG.md index 5cd1252d5689..5505dab1d2f3 100644 --- a/sdk/storage/azure-mgmt-storage/CHANGELOG.md +++ b/sdk/storage/azure-mgmt-storage/CHANGELOG.md @@ -1,5 +1,35 @@ # Release History +## 19.0.0 (2021-09-14) + +**Features** + + - Model BlobContainer has a new parameter enable_nfs_v3_root_squash + - Model BlobContainer has a new parameter enable_nfs_v3_all_squash + - Model UpdateHistoryProperty has a new parameter allow_protected_append_writes + - Model UpdateHistoryProperty has a new parameter allow_protected_append_writes_all + - Model StorageAccountUpdateParameters has a new parameter default_to_o_auth_authentication + - Model StorageAccountUpdateParameters has a new parameter public_network_access + - Model StorageAccountUpdateParameters has a new parameter immutable_storage_with_versioning + - Model ImmutabilityPolicy has a new parameter allow_protected_append_writes_all + - Model StorageAccountCreateParameters has a new parameter default_to_o_auth_authentication + - Model StorageAccountCreateParameters has a new parameter public_network_access + - Model StorageAccountCreateParameters has a new parameter immutable_storage_with_versioning + - Model ListContainerItem has a new parameter enable_nfs_v3_root_squash + - Model ListContainerItem has a new parameter enable_nfs_v3_all_squash + - Model LegalHoldProperties has a new parameter protected_append_writes_history + - Model ImmutabilityPolicyProperties has a new parameter allow_protected_append_writes_all + - Model StorageAccount has a new parameter default_to_o_auth_authentication + - Model StorageAccount has a new parameter public_network_access + - Model StorageAccount has a new parameter immutable_storage_with_versioning + - Model LegalHold has a new parameter allow_protected_append_writes_all + - Added operation StorageAccountsOperations.begin_abort_hierarchical_namespace_migration + - Added operation StorageAccountsOperations.begin_hierarchical_namespace_migration + +**Breaking changes** + + - Model AccessPolicy has a new signature + ## 18.0.0 (2021-05-13) **Features** diff --git a/sdk/storage/azure-mgmt-storage/MANIFEST.in b/sdk/storage/azure-mgmt-storage/MANIFEST.in index a3cb07df8765..3a9b6517412b 100644 --- a/sdk/storage/azure-mgmt-storage/MANIFEST.in +++ b/sdk/storage/azure-mgmt-storage/MANIFEST.in @@ -1,3 +1,4 @@ +include _meta.json recursive-include tests *.py *.yaml include *.md include azure/__init__.py diff --git a/sdk/storage/azure-mgmt-storage/_meta.json b/sdk/storage/azure-mgmt-storage/_meta.json index 7af3043bc60f..c3a7720c0900 100644 --- a/sdk/storage/azure-mgmt-storage/_meta.json +++ b/sdk/storage/azure-mgmt-storage/_meta.json @@ -1,8 +1,11 @@ { - "autorest": "3.3.0", - "use": "@autorest/python@5.6.6", - "commit": "719b74f77b92eb1ec3814be6c4488bcf6b651733", + "autorest": "3.4.5", + "use": [ + "@autorest/python@5.8.4", + "@autorest/modelerfour@4.19.2" + ], + "commit": "cfa9e0f3df4553767d7915ec8f471ff7d4931ed1", "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest_command": "autorest specification/storage/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.6.6 --version=3.3.0", + "autorest_command": "autorest specification/storage/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.4 --use=@autorest/modelerfour@4.19.2 --version=3.4.5", "readme": "specification/storage/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/_storage_management_client.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/_storage_management_client.py index db2c5f8ea626..8a5a61e9f4ff 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/_storage_management_client.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/_storage_management_client.py @@ -56,7 +56,7 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient): :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ - DEFAULT_API_VERSION = '2021-04-01' + DEFAULT_API_VERSION = '2021-06-01' _PROFILE_TAG = "azure.mgmt.storage.StorageManagementClient" LATEST_PROFILE = ProfileDefinition({ _PROFILE_TAG: { @@ -107,6 +107,7 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2021-01-01: :mod:`v2021_01_01.models` * 2021-02-01: :mod:`v2021_02_01.models` * 2021-04-01: :mod:`v2021_04_01.models` + * 2021-06-01: :mod:`v2021_06_01.models` """ if api_version == '2015-06-15': from .v2015_06_15 import models @@ -153,6 +154,9 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2021-04-01': from .v2021_04_01 import models return models + elif api_version == '2021-06-01': + from .v2021_06_01 import models + return models raise ValueError("API version {} is not available".format(api_version)) @property @@ -169,6 +173,7 @@ def blob_containers(self): * 2021-01-01: :class:`BlobContainersOperations` * 2021-02-01: :class:`BlobContainersOperations` * 2021-04-01: :class:`BlobContainersOperations` + * 2021-06-01: :class:`BlobContainersOperations` """ api_version = self._get_api_version('blob_containers') if api_version == '2018-02-01': @@ -191,6 +196,8 @@ def blob_containers(self): from .v2021_02_01.operations import BlobContainersOperations as OperationClass elif api_version == '2021-04-01': from .v2021_04_01.operations import BlobContainersOperations as OperationClass + elif api_version == '2021-06-01': + from .v2021_06_01.operations import BlobContainersOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'blob_containers'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -204,6 +211,7 @@ def blob_inventory_policies(self): * 2021-01-01: :class:`BlobInventoryPoliciesOperations` * 2021-02-01: :class:`BlobInventoryPoliciesOperations` * 2021-04-01: :class:`BlobInventoryPoliciesOperations` + * 2021-06-01: :class:`BlobInventoryPoliciesOperations` """ api_version = self._get_api_version('blob_inventory_policies') if api_version == '2019-06-01': @@ -216,6 +224,8 @@ def blob_inventory_policies(self): from .v2021_02_01.operations import BlobInventoryPoliciesOperations as OperationClass elif api_version == '2021-04-01': from .v2021_04_01.operations import BlobInventoryPoliciesOperations as OperationClass + elif api_version == '2021-06-01': + from .v2021_06_01.operations import BlobInventoryPoliciesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'blob_inventory_policies'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -232,6 +242,7 @@ def blob_services(self): * 2021-01-01: :class:`BlobServicesOperations` * 2021-02-01: :class:`BlobServicesOperations` * 2021-04-01: :class:`BlobServicesOperations` + * 2021-06-01: :class:`BlobServicesOperations` """ api_version = self._get_api_version('blob_services') if api_version == '2018-07-01': @@ -250,6 +261,8 @@ def blob_services(self): from .v2021_02_01.operations import BlobServicesOperations as OperationClass elif api_version == '2021-04-01': from .v2021_04_01.operations import BlobServicesOperations as OperationClass + elif api_version == '2021-06-01': + from .v2021_06_01.operations import BlobServicesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'blob_services'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -262,6 +275,7 @@ def deleted_accounts(self): * 2021-01-01: :class:`DeletedAccountsOperations` * 2021-02-01: :class:`DeletedAccountsOperations` * 2021-04-01: :class:`DeletedAccountsOperations` + * 2021-06-01: :class:`DeletedAccountsOperations` """ api_version = self._get_api_version('deleted_accounts') if api_version == '2020-08-01-preview': @@ -272,6 +286,8 @@ def deleted_accounts(self): from .v2021_02_01.operations import DeletedAccountsOperations as OperationClass elif api_version == '2021-04-01': from .v2021_04_01.operations import DeletedAccountsOperations as OperationClass + elif api_version == '2021-06-01': + from .v2021_06_01.operations import DeletedAccountsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'deleted_accounts'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -285,6 +301,7 @@ def encryption_scopes(self): * 2021-01-01: :class:`EncryptionScopesOperations` * 2021-02-01: :class:`EncryptionScopesOperations` * 2021-04-01: :class:`EncryptionScopesOperations` + * 2021-06-01: :class:`EncryptionScopesOperations` """ api_version = self._get_api_version('encryption_scopes') if api_version == '2019-06-01': @@ -297,6 +314,8 @@ def encryption_scopes(self): from .v2021_02_01.operations import EncryptionScopesOperations as OperationClass elif api_version == '2021-04-01': from .v2021_04_01.operations import EncryptionScopesOperations as OperationClass + elif api_version == '2021-06-01': + from .v2021_06_01.operations import EncryptionScopesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'encryption_scopes'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -311,6 +330,7 @@ def file_services(self): * 2021-01-01: :class:`FileServicesOperations` * 2021-02-01: :class:`FileServicesOperations` * 2021-04-01: :class:`FileServicesOperations` + * 2021-06-01: :class:`FileServicesOperations` """ api_version = self._get_api_version('file_services') if api_version == '2019-04-01': @@ -325,6 +345,8 @@ def file_services(self): from .v2021_02_01.operations import FileServicesOperations as OperationClass elif api_version == '2021-04-01': from .v2021_04_01.operations import FileServicesOperations as OperationClass + elif api_version == '2021-06-01': + from .v2021_06_01.operations import FileServicesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'file_services'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -339,6 +361,7 @@ def file_shares(self): * 2021-01-01: :class:`FileSharesOperations` * 2021-02-01: :class:`FileSharesOperations` * 2021-04-01: :class:`FileSharesOperations` + * 2021-06-01: :class:`FileSharesOperations` """ api_version = self._get_api_version('file_shares') if api_version == '2019-04-01': @@ -353,6 +376,8 @@ def file_shares(self): from .v2021_02_01.operations import FileSharesOperations as OperationClass elif api_version == '2021-04-01': from .v2021_04_01.operations import FileSharesOperations as OperationClass + elif api_version == '2021-06-01': + from .v2021_06_01.operations import FileSharesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'file_shares'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -369,6 +394,7 @@ def management_policies(self): * 2021-01-01: :class:`ManagementPoliciesOperations` * 2021-02-01: :class:`ManagementPoliciesOperations` * 2021-04-01: :class:`ManagementPoliciesOperations` + * 2021-06-01: :class:`ManagementPoliciesOperations` """ api_version = self._get_api_version('management_policies') if api_version == '2018-07-01': @@ -387,6 +413,8 @@ def management_policies(self): from .v2021_02_01.operations import ManagementPoliciesOperations as OperationClass elif api_version == '2021-04-01': from .v2021_04_01.operations import ManagementPoliciesOperations as OperationClass + elif api_version == '2021-06-01': + from .v2021_06_01.operations import ManagementPoliciesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'management_policies'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -400,6 +428,7 @@ def object_replication_policies(self): * 2021-01-01: :class:`ObjectReplicationPoliciesOperations` * 2021-02-01: :class:`ObjectReplicationPoliciesOperations` * 2021-04-01: :class:`ObjectReplicationPoliciesOperations` + * 2021-06-01: :class:`ObjectReplicationPoliciesOperations` """ api_version = self._get_api_version('object_replication_policies') if api_version == '2019-06-01': @@ -412,6 +441,8 @@ def object_replication_policies(self): from .v2021_02_01.operations import ObjectReplicationPoliciesOperations as OperationClass elif api_version == '2021-04-01': from .v2021_04_01.operations import ObjectReplicationPoliciesOperations as OperationClass + elif api_version == '2021-06-01': + from .v2021_06_01.operations import ObjectReplicationPoliciesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'object_replication_policies'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -432,6 +463,7 @@ def operations(self): * 2021-01-01: :class:`Operations` * 2021-02-01: :class:`Operations` * 2021-04-01: :class:`Operations` + * 2021-06-01: :class:`Operations` """ api_version = self._get_api_version('operations') if api_version == '2017-06-01': @@ -458,6 +490,8 @@ def operations(self): from .v2021_02_01.operations import Operations as OperationClass elif api_version == '2021-04-01': from .v2021_04_01.operations import Operations as OperationClass + elif api_version == '2021-06-01': + from .v2021_06_01.operations import Operations as OperationClass else: raise ValueError("API version {} does not have operation group 'operations'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -471,6 +505,7 @@ def private_endpoint_connections(self): * 2021-01-01: :class:`PrivateEndpointConnectionsOperations` * 2021-02-01: :class:`PrivateEndpointConnectionsOperations` * 2021-04-01: :class:`PrivateEndpointConnectionsOperations` + * 2021-06-01: :class:`PrivateEndpointConnectionsOperations` """ api_version = self._get_api_version('private_endpoint_connections') if api_version == '2019-06-01': @@ -483,6 +518,8 @@ def private_endpoint_connections(self): from .v2021_02_01.operations import PrivateEndpointConnectionsOperations as OperationClass elif api_version == '2021-04-01': from .v2021_04_01.operations import PrivateEndpointConnectionsOperations as OperationClass + elif api_version == '2021-06-01': + from .v2021_06_01.operations import PrivateEndpointConnectionsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'private_endpoint_connections'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -496,6 +533,7 @@ def private_link_resources(self): * 2021-01-01: :class:`PrivateLinkResourcesOperations` * 2021-02-01: :class:`PrivateLinkResourcesOperations` * 2021-04-01: :class:`PrivateLinkResourcesOperations` + * 2021-06-01: :class:`PrivateLinkResourcesOperations` """ api_version = self._get_api_version('private_link_resources') if api_version == '2019-06-01': @@ -508,6 +546,8 @@ def private_link_resources(self): from .v2021_02_01.operations import PrivateLinkResourcesOperations as OperationClass elif api_version == '2021-04-01': from .v2021_04_01.operations import PrivateLinkResourcesOperations as OperationClass + elif api_version == '2021-06-01': + from .v2021_06_01.operations import PrivateLinkResourcesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'private_link_resources'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -521,6 +561,7 @@ def queue(self): * 2021-01-01: :class:`QueueOperations` * 2021-02-01: :class:`QueueOperations` * 2021-04-01: :class:`QueueOperations` + * 2021-06-01: :class:`QueueOperations` """ api_version = self._get_api_version('queue') if api_version == '2019-06-01': @@ -533,6 +574,8 @@ def queue(self): from .v2021_02_01.operations import QueueOperations as OperationClass elif api_version == '2021-04-01': from .v2021_04_01.operations import QueueOperations as OperationClass + elif api_version == '2021-06-01': + from .v2021_06_01.operations import QueueOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'queue'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -546,6 +589,7 @@ def queue_services(self): * 2021-01-01: :class:`QueueServicesOperations` * 2021-02-01: :class:`QueueServicesOperations` * 2021-04-01: :class:`QueueServicesOperations` + * 2021-06-01: :class:`QueueServicesOperations` """ api_version = self._get_api_version('queue_services') if api_version == '2019-06-01': @@ -558,6 +602,8 @@ def queue_services(self): from .v2021_02_01.operations import QueueServicesOperations as OperationClass elif api_version == '2021-04-01': from .v2021_04_01.operations import QueueServicesOperations as OperationClass + elif api_version == '2021-06-01': + from .v2021_06_01.operations import QueueServicesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'queue_services'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -578,6 +624,7 @@ def skus(self): * 2021-01-01: :class:`SkusOperations` * 2021-02-01: :class:`SkusOperations` * 2021-04-01: :class:`SkusOperations` + * 2021-06-01: :class:`SkusOperations` """ api_version = self._get_api_version('skus') if api_version == '2017-06-01': @@ -604,6 +651,8 @@ def skus(self): from .v2021_02_01.operations import SkusOperations as OperationClass elif api_version == '2021-04-01': from .v2021_04_01.operations import SkusOperations as OperationClass + elif api_version == '2021-06-01': + from .v2021_06_01.operations import SkusOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'skus'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -627,6 +676,7 @@ def storage_accounts(self): * 2021-01-01: :class:`StorageAccountsOperations` * 2021-02-01: :class:`StorageAccountsOperations` * 2021-04-01: :class:`StorageAccountsOperations` + * 2021-06-01: :class:`StorageAccountsOperations` """ api_version = self._get_api_version('storage_accounts') if api_version == '2015-06-15': @@ -659,6 +709,8 @@ def storage_accounts(self): from .v2021_02_01.operations import StorageAccountsOperations as OperationClass elif api_version == '2021-04-01': from .v2021_04_01.operations import StorageAccountsOperations as OperationClass + elif api_version == '2021-06-01': + from .v2021_06_01.operations import StorageAccountsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'storage_accounts'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -672,6 +724,7 @@ def table(self): * 2021-01-01: :class:`TableOperations` * 2021-02-01: :class:`TableOperations` * 2021-04-01: :class:`TableOperations` + * 2021-06-01: :class:`TableOperations` """ api_version = self._get_api_version('table') if api_version == '2019-06-01': @@ -684,6 +737,8 @@ def table(self): from .v2021_02_01.operations import TableOperations as OperationClass elif api_version == '2021-04-01': from .v2021_04_01.operations import TableOperations as OperationClass + elif api_version == '2021-06-01': + from .v2021_06_01.operations import TableOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'table'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -697,6 +752,7 @@ def table_services(self): * 2021-01-01: :class:`TableServicesOperations` * 2021-02-01: :class:`TableServicesOperations` * 2021-04-01: :class:`TableServicesOperations` + * 2021-06-01: :class:`TableServicesOperations` """ api_version = self._get_api_version('table_services') if api_version == '2019-06-01': @@ -709,6 +765,8 @@ def table_services(self): from .v2021_02_01.operations import TableServicesOperations as OperationClass elif api_version == '2021-04-01': from .v2021_04_01.operations import TableServicesOperations as OperationClass + elif api_version == '2021-06-01': + from .v2021_06_01.operations import TableServicesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'table_services'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -754,6 +812,7 @@ def usages(self): * 2021-01-01: :class:`UsagesOperations` * 2021-02-01: :class:`UsagesOperations` * 2021-04-01: :class:`UsagesOperations` + * 2021-06-01: :class:`UsagesOperations` """ api_version = self._get_api_version('usages') if api_version == '2018-03-01-preview': @@ -774,6 +833,8 @@ def usages(self): from .v2021_02_01.operations import UsagesOperations as OperationClass elif api_version == '2021-04-01': from .v2021_04_01.operations import UsagesOperations as OperationClass + elif api_version == '2021-06-01': + from .v2021_06_01.operations import UsagesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'usages'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/_version.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/_version.py index fd82a0d1274f..fb7288a742cb 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/_version.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/_version.py @@ -5,4 +5,4 @@ # license information. # -------------------------------------------------------------------------- -VERSION = "18.0.0" +VERSION = "19.0.0" diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/aio/_storage_management_client.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/aio/_storage_management_client.py index 2528573c561f..f4381b05dccf 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/aio/_storage_management_client.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/aio/_storage_management_client.py @@ -54,7 +54,7 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient): :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ - DEFAULT_API_VERSION = '2021-04-01' + DEFAULT_API_VERSION = '2021-06-01' _PROFILE_TAG = "azure.mgmt.storage.StorageManagementClient" LATEST_PROFILE = ProfileDefinition({ _PROFILE_TAG: { @@ -105,6 +105,7 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2021-01-01: :mod:`v2021_01_01.models` * 2021-02-01: :mod:`v2021_02_01.models` * 2021-04-01: :mod:`v2021_04_01.models` + * 2021-06-01: :mod:`v2021_06_01.models` """ if api_version == '2015-06-15': from ..v2015_06_15 import models @@ -151,6 +152,9 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2021-04-01': from ..v2021_04_01 import models return models + elif api_version == '2021-06-01': + from ..v2021_06_01 import models + return models raise ValueError("API version {} is not available".format(api_version)) @property @@ -167,6 +171,7 @@ def blob_containers(self): * 2021-01-01: :class:`BlobContainersOperations` * 2021-02-01: :class:`BlobContainersOperations` * 2021-04-01: :class:`BlobContainersOperations` + * 2021-06-01: :class:`BlobContainersOperations` """ api_version = self._get_api_version('blob_containers') if api_version == '2018-02-01': @@ -189,6 +194,8 @@ def blob_containers(self): from ..v2021_02_01.aio.operations import BlobContainersOperations as OperationClass elif api_version == '2021-04-01': from ..v2021_04_01.aio.operations import BlobContainersOperations as OperationClass + elif api_version == '2021-06-01': + from ..v2021_06_01.aio.operations import BlobContainersOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'blob_containers'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -202,6 +209,7 @@ def blob_inventory_policies(self): * 2021-01-01: :class:`BlobInventoryPoliciesOperations` * 2021-02-01: :class:`BlobInventoryPoliciesOperations` * 2021-04-01: :class:`BlobInventoryPoliciesOperations` + * 2021-06-01: :class:`BlobInventoryPoliciesOperations` """ api_version = self._get_api_version('blob_inventory_policies') if api_version == '2019-06-01': @@ -214,6 +222,8 @@ def blob_inventory_policies(self): from ..v2021_02_01.aio.operations import BlobInventoryPoliciesOperations as OperationClass elif api_version == '2021-04-01': from ..v2021_04_01.aio.operations import BlobInventoryPoliciesOperations as OperationClass + elif api_version == '2021-06-01': + from ..v2021_06_01.aio.operations import BlobInventoryPoliciesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'blob_inventory_policies'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -230,6 +240,7 @@ def blob_services(self): * 2021-01-01: :class:`BlobServicesOperations` * 2021-02-01: :class:`BlobServicesOperations` * 2021-04-01: :class:`BlobServicesOperations` + * 2021-06-01: :class:`BlobServicesOperations` """ api_version = self._get_api_version('blob_services') if api_version == '2018-07-01': @@ -248,6 +259,8 @@ def blob_services(self): from ..v2021_02_01.aio.operations import BlobServicesOperations as OperationClass elif api_version == '2021-04-01': from ..v2021_04_01.aio.operations import BlobServicesOperations as OperationClass + elif api_version == '2021-06-01': + from ..v2021_06_01.aio.operations import BlobServicesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'blob_services'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -260,6 +273,7 @@ def deleted_accounts(self): * 2021-01-01: :class:`DeletedAccountsOperations` * 2021-02-01: :class:`DeletedAccountsOperations` * 2021-04-01: :class:`DeletedAccountsOperations` + * 2021-06-01: :class:`DeletedAccountsOperations` """ api_version = self._get_api_version('deleted_accounts') if api_version == '2020-08-01-preview': @@ -270,6 +284,8 @@ def deleted_accounts(self): from ..v2021_02_01.aio.operations import DeletedAccountsOperations as OperationClass elif api_version == '2021-04-01': from ..v2021_04_01.aio.operations import DeletedAccountsOperations as OperationClass + elif api_version == '2021-06-01': + from ..v2021_06_01.aio.operations import DeletedAccountsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'deleted_accounts'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -283,6 +299,7 @@ def encryption_scopes(self): * 2021-01-01: :class:`EncryptionScopesOperations` * 2021-02-01: :class:`EncryptionScopesOperations` * 2021-04-01: :class:`EncryptionScopesOperations` + * 2021-06-01: :class:`EncryptionScopesOperations` """ api_version = self._get_api_version('encryption_scopes') if api_version == '2019-06-01': @@ -295,6 +312,8 @@ def encryption_scopes(self): from ..v2021_02_01.aio.operations import EncryptionScopesOperations as OperationClass elif api_version == '2021-04-01': from ..v2021_04_01.aio.operations import EncryptionScopesOperations as OperationClass + elif api_version == '2021-06-01': + from ..v2021_06_01.aio.operations import EncryptionScopesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'encryption_scopes'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -309,6 +328,7 @@ def file_services(self): * 2021-01-01: :class:`FileServicesOperations` * 2021-02-01: :class:`FileServicesOperations` * 2021-04-01: :class:`FileServicesOperations` + * 2021-06-01: :class:`FileServicesOperations` """ api_version = self._get_api_version('file_services') if api_version == '2019-04-01': @@ -323,6 +343,8 @@ def file_services(self): from ..v2021_02_01.aio.operations import FileServicesOperations as OperationClass elif api_version == '2021-04-01': from ..v2021_04_01.aio.operations import FileServicesOperations as OperationClass + elif api_version == '2021-06-01': + from ..v2021_06_01.aio.operations import FileServicesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'file_services'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -337,6 +359,7 @@ def file_shares(self): * 2021-01-01: :class:`FileSharesOperations` * 2021-02-01: :class:`FileSharesOperations` * 2021-04-01: :class:`FileSharesOperations` + * 2021-06-01: :class:`FileSharesOperations` """ api_version = self._get_api_version('file_shares') if api_version == '2019-04-01': @@ -351,6 +374,8 @@ def file_shares(self): from ..v2021_02_01.aio.operations import FileSharesOperations as OperationClass elif api_version == '2021-04-01': from ..v2021_04_01.aio.operations import FileSharesOperations as OperationClass + elif api_version == '2021-06-01': + from ..v2021_06_01.aio.operations import FileSharesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'file_shares'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -367,6 +392,7 @@ def management_policies(self): * 2021-01-01: :class:`ManagementPoliciesOperations` * 2021-02-01: :class:`ManagementPoliciesOperations` * 2021-04-01: :class:`ManagementPoliciesOperations` + * 2021-06-01: :class:`ManagementPoliciesOperations` """ api_version = self._get_api_version('management_policies') if api_version == '2018-07-01': @@ -385,6 +411,8 @@ def management_policies(self): from ..v2021_02_01.aio.operations import ManagementPoliciesOperations as OperationClass elif api_version == '2021-04-01': from ..v2021_04_01.aio.operations import ManagementPoliciesOperations as OperationClass + elif api_version == '2021-06-01': + from ..v2021_06_01.aio.operations import ManagementPoliciesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'management_policies'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -398,6 +426,7 @@ def object_replication_policies(self): * 2021-01-01: :class:`ObjectReplicationPoliciesOperations` * 2021-02-01: :class:`ObjectReplicationPoliciesOperations` * 2021-04-01: :class:`ObjectReplicationPoliciesOperations` + * 2021-06-01: :class:`ObjectReplicationPoliciesOperations` """ api_version = self._get_api_version('object_replication_policies') if api_version == '2019-06-01': @@ -410,6 +439,8 @@ def object_replication_policies(self): from ..v2021_02_01.aio.operations import ObjectReplicationPoliciesOperations as OperationClass elif api_version == '2021-04-01': from ..v2021_04_01.aio.operations import ObjectReplicationPoliciesOperations as OperationClass + elif api_version == '2021-06-01': + from ..v2021_06_01.aio.operations import ObjectReplicationPoliciesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'object_replication_policies'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -430,6 +461,7 @@ def operations(self): * 2021-01-01: :class:`Operations` * 2021-02-01: :class:`Operations` * 2021-04-01: :class:`Operations` + * 2021-06-01: :class:`Operations` """ api_version = self._get_api_version('operations') if api_version == '2017-06-01': @@ -456,6 +488,8 @@ def operations(self): from ..v2021_02_01.aio.operations import Operations as OperationClass elif api_version == '2021-04-01': from ..v2021_04_01.aio.operations import Operations as OperationClass + elif api_version == '2021-06-01': + from ..v2021_06_01.aio.operations import Operations as OperationClass else: raise ValueError("API version {} does not have operation group 'operations'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -469,6 +503,7 @@ def private_endpoint_connections(self): * 2021-01-01: :class:`PrivateEndpointConnectionsOperations` * 2021-02-01: :class:`PrivateEndpointConnectionsOperations` * 2021-04-01: :class:`PrivateEndpointConnectionsOperations` + * 2021-06-01: :class:`PrivateEndpointConnectionsOperations` """ api_version = self._get_api_version('private_endpoint_connections') if api_version == '2019-06-01': @@ -481,6 +516,8 @@ def private_endpoint_connections(self): from ..v2021_02_01.aio.operations import PrivateEndpointConnectionsOperations as OperationClass elif api_version == '2021-04-01': from ..v2021_04_01.aio.operations import PrivateEndpointConnectionsOperations as OperationClass + elif api_version == '2021-06-01': + from ..v2021_06_01.aio.operations import PrivateEndpointConnectionsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'private_endpoint_connections'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -494,6 +531,7 @@ def private_link_resources(self): * 2021-01-01: :class:`PrivateLinkResourcesOperations` * 2021-02-01: :class:`PrivateLinkResourcesOperations` * 2021-04-01: :class:`PrivateLinkResourcesOperations` + * 2021-06-01: :class:`PrivateLinkResourcesOperations` """ api_version = self._get_api_version('private_link_resources') if api_version == '2019-06-01': @@ -506,6 +544,8 @@ def private_link_resources(self): from ..v2021_02_01.aio.operations import PrivateLinkResourcesOperations as OperationClass elif api_version == '2021-04-01': from ..v2021_04_01.aio.operations import PrivateLinkResourcesOperations as OperationClass + elif api_version == '2021-06-01': + from ..v2021_06_01.aio.operations import PrivateLinkResourcesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'private_link_resources'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -519,6 +559,7 @@ def queue(self): * 2021-01-01: :class:`QueueOperations` * 2021-02-01: :class:`QueueOperations` * 2021-04-01: :class:`QueueOperations` + * 2021-06-01: :class:`QueueOperations` """ api_version = self._get_api_version('queue') if api_version == '2019-06-01': @@ -531,6 +572,8 @@ def queue(self): from ..v2021_02_01.aio.operations import QueueOperations as OperationClass elif api_version == '2021-04-01': from ..v2021_04_01.aio.operations import QueueOperations as OperationClass + elif api_version == '2021-06-01': + from ..v2021_06_01.aio.operations import QueueOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'queue'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -544,6 +587,7 @@ def queue_services(self): * 2021-01-01: :class:`QueueServicesOperations` * 2021-02-01: :class:`QueueServicesOperations` * 2021-04-01: :class:`QueueServicesOperations` + * 2021-06-01: :class:`QueueServicesOperations` """ api_version = self._get_api_version('queue_services') if api_version == '2019-06-01': @@ -556,6 +600,8 @@ def queue_services(self): from ..v2021_02_01.aio.operations import QueueServicesOperations as OperationClass elif api_version == '2021-04-01': from ..v2021_04_01.aio.operations import QueueServicesOperations as OperationClass + elif api_version == '2021-06-01': + from ..v2021_06_01.aio.operations import QueueServicesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'queue_services'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -576,6 +622,7 @@ def skus(self): * 2021-01-01: :class:`SkusOperations` * 2021-02-01: :class:`SkusOperations` * 2021-04-01: :class:`SkusOperations` + * 2021-06-01: :class:`SkusOperations` """ api_version = self._get_api_version('skus') if api_version == '2017-06-01': @@ -602,6 +649,8 @@ def skus(self): from ..v2021_02_01.aio.operations import SkusOperations as OperationClass elif api_version == '2021-04-01': from ..v2021_04_01.aio.operations import SkusOperations as OperationClass + elif api_version == '2021-06-01': + from ..v2021_06_01.aio.operations import SkusOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'skus'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -625,6 +674,7 @@ def storage_accounts(self): * 2021-01-01: :class:`StorageAccountsOperations` * 2021-02-01: :class:`StorageAccountsOperations` * 2021-04-01: :class:`StorageAccountsOperations` + * 2021-06-01: :class:`StorageAccountsOperations` """ api_version = self._get_api_version('storage_accounts') if api_version == '2015-06-15': @@ -657,6 +707,8 @@ def storage_accounts(self): from ..v2021_02_01.aio.operations import StorageAccountsOperations as OperationClass elif api_version == '2021-04-01': from ..v2021_04_01.aio.operations import StorageAccountsOperations as OperationClass + elif api_version == '2021-06-01': + from ..v2021_06_01.aio.operations import StorageAccountsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'storage_accounts'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -670,6 +722,7 @@ def table(self): * 2021-01-01: :class:`TableOperations` * 2021-02-01: :class:`TableOperations` * 2021-04-01: :class:`TableOperations` + * 2021-06-01: :class:`TableOperations` """ api_version = self._get_api_version('table') if api_version == '2019-06-01': @@ -682,6 +735,8 @@ def table(self): from ..v2021_02_01.aio.operations import TableOperations as OperationClass elif api_version == '2021-04-01': from ..v2021_04_01.aio.operations import TableOperations as OperationClass + elif api_version == '2021-06-01': + from ..v2021_06_01.aio.operations import TableOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'table'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -695,6 +750,7 @@ def table_services(self): * 2021-01-01: :class:`TableServicesOperations` * 2021-02-01: :class:`TableServicesOperations` * 2021-04-01: :class:`TableServicesOperations` + * 2021-06-01: :class:`TableServicesOperations` """ api_version = self._get_api_version('table_services') if api_version == '2019-06-01': @@ -707,6 +763,8 @@ def table_services(self): from ..v2021_02_01.aio.operations import TableServicesOperations as OperationClass elif api_version == '2021-04-01': from ..v2021_04_01.aio.operations import TableServicesOperations as OperationClass + elif api_version == '2021-06-01': + from ..v2021_06_01.aio.operations import TableServicesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'table_services'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -752,6 +810,7 @@ def usages(self): * 2021-01-01: :class:`UsagesOperations` * 2021-02-01: :class:`UsagesOperations` * 2021-04-01: :class:`UsagesOperations` + * 2021-06-01: :class:`UsagesOperations` """ api_version = self._get_api_version('usages') if api_version == '2018-03-01-preview': @@ -772,6 +831,8 @@ def usages(self): from ..v2021_02_01.aio.operations import UsagesOperations as OperationClass elif api_version == '2021-04-01': from ..v2021_04_01.aio.operations import UsagesOperations as OperationClass + elif api_version == '2021-06-01': + from ..v2021_06_01.aio.operations import UsagesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'usages'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/models.py index 4b99fd086598..60a2d2a8e47e 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/models.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/models.py @@ -5,4 +5,4 @@ # license information. # -------------------------------------------------------------------------- from .v2018_02_01.models import * -from .v2021_04_01.models import * +from .v2021_06_01.models import * diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/_version.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/_version.py index 8dae91701610..232662316d4d 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/_version.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "18.0.0" +VERSION = "19.0.0" diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/aio/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/aio/operations/_storage_accounts_operations.py index b7e1145336f8..1f268c402268 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/aio/operations/_storage_accounts_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/aio/operations/_storage_accounts_operations.py @@ -46,7 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def check_name_availability( self, account_name: "_models.StorageAccountCheckNameAvailabilityParameters", - **kwargs + **kwargs: Any ) -> "_models.CheckNameAvailabilityResult": """Checks that the storage account name is valid and is not already in use. @@ -108,7 +108,7 @@ async def _create_initial( resource_group_name: str, account_name: str, parameters: "_models.StorageAccountCreateParameters", - **kwargs + **kwargs: Any ) -> Optional["_models.StorageAccount"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StorageAccount"]] error_map = { @@ -163,7 +163,7 @@ async def begin_create( resource_group_name: str, account_name: str, parameters: "_models.StorageAccountCreateParameters", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.StorageAccount"]: """Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the @@ -181,8 +181,8 @@ async def begin_create( :type parameters: ~azure.mgmt.storage.v2015_06_15.models.StorageAccountCreateParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either StorageAccount or the result of cls(response) @@ -239,7 +239,7 @@ async def delete( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> None: """Deletes a storage account in Microsoft Azure. @@ -295,7 +295,7 @@ async def get_properties( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.StorageAccount": """Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage @@ -359,7 +359,7 @@ async def update( resource_group_name: str, account_name: str, parameters: "_models.StorageAccountUpdateParameters", - **kwargs + **kwargs: Any ) -> "_models.StorageAccount": """The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also be used to map the account to a custom domain. Only one custom @@ -432,7 +432,7 @@ async def update( def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.StorageAccountListResult"]: """Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. @@ -500,7 +500,7 @@ async def get_next(next_link=None): def list_by_resource_group( self, resource_group_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.StorageAccountListResult"]: """Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this. @@ -573,7 +573,7 @@ async def list_keys( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.StorageAccountKeys": """Lists the access keys for the specified storage account. @@ -635,7 +635,7 @@ async def regenerate_key( resource_group_name: str, account_name: str, regenerate_key: "_models.StorageAccountRegenerateKeyParameters", - **kwargs + **kwargs: Any ) -> "_models.StorageAccountKeys": """Regenerates one of the access keys for the specified storage account. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/aio/operations/_usage_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/aio/operations/_usage_operations.py index 29594b6d85dc..d9f8fdb6dbcc 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/aio/operations/_usage_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/aio/operations/_usage_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.UsageListResult"]: """Lists the current usage count and the limit for the resources under the subscription. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/operations/_storage_accounts_operations.py index c187f5445f0d..a3cfe7a86128 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/operations/_storage_accounts_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/operations/_storage_accounts_operations.py @@ -188,8 +188,8 @@ def begin_create( :type parameters: ~azure.mgmt.storage.v2015_06_15.models.StorageAccountCreateParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either StorageAccount or the result of cls(response) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/_version.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/_version.py index 8dae91701610..232662316d4d 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/_version.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "18.0.0" +VERSION = "19.0.0" diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/aio/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/aio/operations/_storage_accounts_operations.py index 60778dfc2ffa..7faa9b1117b9 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/aio/operations/_storage_accounts_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/aio/operations/_storage_accounts_operations.py @@ -46,7 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def check_name_availability( self, account_name: "_models.StorageAccountCheckNameAvailabilityParameters", - **kwargs + **kwargs: Any ) -> "_models.CheckNameAvailabilityResult": """Checks that the storage account name is valid and is not already in use. @@ -108,7 +108,7 @@ async def _create_initial( resource_group_name: str, account_name: str, parameters: "_models.StorageAccountCreateParameters", - **kwargs + **kwargs: Any ) -> Optional["_models.StorageAccount"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StorageAccount"]] error_map = { @@ -163,7 +163,7 @@ async def begin_create( resource_group_name: str, account_name: str, parameters: "_models.StorageAccountCreateParameters", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.StorageAccount"]: """Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the @@ -180,8 +180,8 @@ async def begin_create( :type parameters: ~azure.mgmt.storage.v2016_01_01.models.StorageAccountCreateParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either StorageAccount or the result of cls(response) @@ -238,7 +238,7 @@ async def delete( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> None: """Deletes a storage account in Microsoft Azure. @@ -293,7 +293,7 @@ async def get_properties( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.StorageAccount": """Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage @@ -356,7 +356,7 @@ async def update( resource_group_name: str, account_name: str, parameters: "_models.StorageAccountUpdateParameters", - **kwargs + **kwargs: Any ) -> "_models.StorageAccount": """The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also be used to map the account to a custom domain. Only one custom @@ -428,7 +428,7 @@ async def update( def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.StorageAccountListResult"]: """Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. @@ -496,7 +496,7 @@ async def get_next(next_link=None): def list_by_resource_group( self, resource_group_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.StorageAccountListResult"]: """Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this. @@ -568,7 +568,7 @@ async def list_keys( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.StorageAccountListKeysResult": """Lists the access keys for the specified storage account. @@ -629,7 +629,7 @@ async def regenerate_key( resource_group_name: str, account_name: str, regenerate_key: "_models.StorageAccountRegenerateKeyParameters", - **kwargs + **kwargs: Any ) -> "_models.StorageAccountListKeysResult": """Regenerates one of the access keys for the specified storage account. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/aio/operations/_usage_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/aio/operations/_usage_operations.py index 52dc9615d6e4..a7cb247a208a 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/aio/operations/_usage_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/aio/operations/_usage_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.UsageListResult"]: """Gets the current usage count and the limit for the resources under the subscription. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/_models.py index 78d74c7d009d..26863c8864f1 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/_models.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/_models.py @@ -88,8 +88,8 @@ class Encryption(msrest.serialization.Model): :param services: List of services which support encryption. :type services: ~azure.mgmt.storage.v2016_01_01.models.EncryptionServices - :ivar key_source: Required. The encryption keySource (provider). Possible values - (case-insensitive): Microsoft.Storage. Default value: "Microsoft.Storage". + :ivar key_source: The encryption keySource (provider). Possible values (case-insensitive): + Microsoft.Storage. Has constant value: "Microsoft.Storage". :vartype key_source: str """ @@ -414,7 +414,7 @@ class StorageAccountCheckNameAvailabilityParameters(msrest.serialization.Model): :param name: Required. :type name: str - :ivar type: Required. Default value: "Microsoft.Storage/storageAccounts". + :ivar type: Has constant value: "Microsoft.Storage/storageAccounts". :vartype type: str """ diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/_models_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/_models_py3.py index 045c2e649c84..955e9e189d80 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/_models_py3.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/models/_models_py3.py @@ -95,8 +95,8 @@ class Encryption(msrest.serialization.Model): :param services: List of services which support encryption. :type services: ~azure.mgmt.storage.v2016_01_01.models.EncryptionServices - :ivar key_source: Required. The encryption keySource (provider). Possible values - (case-insensitive): Microsoft.Storage. Default value: "Microsoft.Storage". + :ivar key_source: The encryption keySource (provider). Possible values (case-insensitive): + Microsoft.Storage. Has constant value: "Microsoft.Storage". :vartype key_source: str """ @@ -435,7 +435,7 @@ class StorageAccountCheckNameAvailabilityParameters(msrest.serialization.Model): :param name: Required. :type name: str - :ivar type: Required. Default value: "Microsoft.Storage/storageAccounts". + :ivar type: Has constant value: "Microsoft.Storage/storageAccounts". :vartype type: str """ diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/operations/_storage_accounts_operations.py index 2d4399ca813e..32e8240c5961 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/operations/_storage_accounts_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_01_01/operations/_storage_accounts_operations.py @@ -187,8 +187,8 @@ def begin_create( :type parameters: ~azure.mgmt.storage.v2016_01_01.models.StorageAccountCreateParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either StorageAccount or the result of cls(response) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/_version.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/_version.py index 8dae91701610..232662316d4d 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/_version.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "18.0.0" +VERSION = "19.0.0" diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/aio/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/aio/operations/_storage_accounts_operations.py index 2fb22b4bbd20..c8d9d3971a37 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/aio/operations/_storage_accounts_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/aio/operations/_storage_accounts_operations.py @@ -46,7 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def check_name_availability( self, account_name: "_models.StorageAccountCheckNameAvailabilityParameters", - **kwargs + **kwargs: Any ) -> "_models.CheckNameAvailabilityResult": """Checks that the storage account name is valid and is not already in use. @@ -108,7 +108,7 @@ async def _create_initial( resource_group_name: str, account_name: str, parameters: "_models.StorageAccountCreateParameters", - **kwargs + **kwargs: Any ) -> Optional["_models.StorageAccount"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StorageAccount"]] error_map = { @@ -163,7 +163,7 @@ async def begin_create( resource_group_name: str, account_name: str, parameters: "_models.StorageAccountCreateParameters", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.StorageAccount"]: """Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the @@ -181,8 +181,8 @@ async def begin_create( :type parameters: ~azure.mgmt.storage.v2016_12_01.models.StorageAccountCreateParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either StorageAccount or the result of cls(response) @@ -239,7 +239,7 @@ async def delete( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> None: """Deletes a storage account in Microsoft Azure. @@ -295,7 +295,7 @@ async def get_properties( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.StorageAccount": """Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage @@ -359,7 +359,7 @@ async def update( resource_group_name: str, account_name: str, parameters: "_models.StorageAccountUpdateParameters", - **kwargs + **kwargs: Any ) -> "_models.StorageAccount": """The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also be used to map the account to a custom domain. Only one custom @@ -432,7 +432,7 @@ async def update( def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.StorageAccountListResult"]: """Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. @@ -500,7 +500,7 @@ async def get_next(next_link=None): def list_by_resource_group( self, resource_group_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.StorageAccountListResult"]: """Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this. @@ -573,7 +573,7 @@ async def list_keys( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.StorageAccountListKeysResult": """Lists the access keys for the specified storage account. @@ -635,7 +635,7 @@ async def regenerate_key( resource_group_name: str, account_name: str, regenerate_key: "_models.StorageAccountRegenerateKeyParameters", - **kwargs + **kwargs: Any ) -> "_models.StorageAccountListKeysResult": """Regenerates one of the access keys for the specified storage account. @@ -704,7 +704,7 @@ async def list_account_sas( resource_group_name: str, account_name: str, parameters: "_models.AccountSasParameters", - **kwargs + **kwargs: Any ) -> "_models.ListAccountSasResponse": """List SAS credentials of a storage account. @@ -773,7 +773,7 @@ async def list_service_sas( resource_group_name: str, account_name: str, parameters: "_models.ServiceSasParameters", - **kwargs + **kwargs: Any ) -> "_models.ListServiceSasResponse": """List service SAS credentials of a specific resource. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/aio/operations/_usage_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/aio/operations/_usage_operations.py index 0095b14fb85e..f86af2a94548 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/aio/operations/_usage_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/aio/operations/_usage_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.UsageListResult"]: """Gets the current usage count and the limit for the resources under the subscription. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/_models.py index 9ee059aae9f9..ccb022c84cda 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/_models.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/_models.py @@ -156,8 +156,8 @@ class Encryption(msrest.serialization.Model): :param services: List of services which support encryption. :type services: ~azure.mgmt.storage.v2016_12_01.models.EncryptionServices - :ivar key_source: Required. The encryption keySource (provider). Possible values - (case-insensitive): Microsoft.Storage. Default value: "Microsoft.Storage". + :ivar key_source: The encryption keySource (provider). Possible values (case-insensitive): + Microsoft.Storage. Has constant value: "Microsoft.Storage". :vartype key_source: str """ @@ -658,7 +658,7 @@ class StorageAccountCheckNameAvailabilityParameters(msrest.serialization.Model): :param name: Required. :type name: str - :ivar type: Required. Default value: "Microsoft.Storage/storageAccounts". + :ivar type: Has constant value: "Microsoft.Storage/storageAccounts". :vartype type: str """ diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/_models_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/_models_py3.py index 1b2617d1bfe7..978707220a8d 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/_models_py3.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/models/_models_py3.py @@ -173,8 +173,8 @@ class Encryption(msrest.serialization.Model): :param services: List of services which support encryption. :type services: ~azure.mgmt.storage.v2016_12_01.models.EncryptionServices - :ivar key_source: Required. The encryption keySource (provider). Possible values - (case-insensitive): Microsoft.Storage. Default value: "Microsoft.Storage". + :ivar key_source: The encryption keySource (provider). Possible values (case-insensitive): + Microsoft.Storage. Has constant value: "Microsoft.Storage". :vartype key_source: str """ @@ -710,7 +710,7 @@ class StorageAccountCheckNameAvailabilityParameters(msrest.serialization.Model): :param name: Required. :type name: str - :ivar type: Required. Default value: "Microsoft.Storage/storageAccounts". + :ivar type: Has constant value: "Microsoft.Storage/storageAccounts". :vartype type: str """ diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/operations/_storage_accounts_operations.py index 710f809c21a5..5d6595502c7e 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/operations/_storage_accounts_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2016_12_01/operations/_storage_accounts_operations.py @@ -188,8 +188,8 @@ def begin_create( :type parameters: ~azure.mgmt.storage.v2016_12_01.models.StorageAccountCreateParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either StorageAccount or the result of cls(response) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/_version.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/_version.py index 8dae91701610..232662316d4d 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/_version.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "18.0.0" +VERSION = "19.0.0" diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/aio/operations/_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/aio/operations/_operations.py index 1fe7969577bd..efe606dcfaed 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/aio/operations/_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/aio/operations/_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available Storage Rest API operations. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/aio/operations/_skus_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/aio/operations/_skus_operations.py index 5fd123a5b611..cc0aa50c9fe0 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/aio/operations/_skus_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/aio/operations/_skus_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.StorageSkuListResult"]: """Lists the available SKUs supported by Microsoft.Storage for given subscription. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/aio/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/aio/operations/_storage_accounts_operations.py index b71bf71ea7e5..64d32bee43d8 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/aio/operations/_storage_accounts_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/aio/operations/_storage_accounts_operations.py @@ -46,7 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def check_name_availability( self, account_name: "_models.StorageAccountCheckNameAvailabilityParameters", - **kwargs + **kwargs: Any ) -> "_models.CheckNameAvailabilityResult": """Checks that the storage account name is valid and is not already in use. @@ -108,7 +108,7 @@ async def _create_initial( resource_group_name: str, account_name: str, parameters: "_models.StorageAccountCreateParameters", - **kwargs + **kwargs: Any ) -> Optional["_models.StorageAccount"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StorageAccount"]] error_map = { @@ -163,7 +163,7 @@ async def begin_create( resource_group_name: str, account_name: str, parameters: "_models.StorageAccountCreateParameters", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.StorageAccount"]: """Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the @@ -181,8 +181,8 @@ async def begin_create( :type parameters: ~azure.mgmt.storage.v2017_06_01.models.StorageAccountCreateParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either StorageAccount or the result of cls(response) @@ -239,7 +239,7 @@ async def delete( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> None: """Deletes a storage account in Microsoft Azure. @@ -295,7 +295,7 @@ async def get_properties( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.StorageAccount": """Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage @@ -359,7 +359,7 @@ async def update( resource_group_name: str, account_name: str, parameters: "_models.StorageAccountUpdateParameters", - **kwargs + **kwargs: Any ) -> "_models.StorageAccount": """The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also be used to map the account to a custom domain. Only one custom @@ -432,7 +432,7 @@ async def update( def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.StorageAccountListResult"]: """Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. @@ -500,7 +500,7 @@ async def get_next(next_link=None): def list_by_resource_group( self, resource_group_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.StorageAccountListResult"]: """Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this. @@ -573,7 +573,7 @@ async def list_keys( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.StorageAccountListKeysResult": """Lists the access keys for the specified storage account. @@ -635,7 +635,7 @@ async def regenerate_key( resource_group_name: str, account_name: str, regenerate_key: "_models.StorageAccountRegenerateKeyParameters", - **kwargs + **kwargs: Any ) -> "_models.StorageAccountListKeysResult": """Regenerates one of the access keys for the specified storage account. @@ -704,7 +704,7 @@ async def list_account_sas( resource_group_name: str, account_name: str, parameters: "_models.AccountSasParameters", - **kwargs + **kwargs: Any ) -> "_models.ListAccountSasResponse": """List SAS credentials of a storage account. @@ -773,7 +773,7 @@ async def list_service_sas( resource_group_name: str, account_name: str, parameters: "_models.ServiceSasParameters", - **kwargs + **kwargs: Any ) -> "_models.ListServiceSasResponse": """List service SAS credentials of a specific resource. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/aio/operations/_usage_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/aio/operations/_usage_operations.py index 61882126fc10..f4a58fed7514 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/aio/operations/_usage_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/aio/operations/_usage_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.UsageListResult"]: """Gets the current usage count and the limit for the resources under the subscription. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/_models.py index 58c4e203ed66..d48a55e487cd 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/_models.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/_models.py @@ -323,7 +323,7 @@ class Identity(msrest.serialization.Model): :vartype principal_id: str :ivar tenant_id: The tenant ID of resource. :vartype tenant_id: str - :ivar type: Required. The identity type. Default value: "SystemAssigned". + :ivar type: The identity type. Has constant value: "SystemAssigned". :vartype type: str """ @@ -353,20 +353,18 @@ def __init__( class IPRule(msrest.serialization.Model): """IP rule with specific IP or IP range in CIDR format. - Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. :type ip_address_or_range: str - :ivar action: The action of IP ACL rule. Default value: "Allow". - :vartype action: str + :param action: The action of IP ACL rule. The only acceptable values to pass in are None and + "Allow". The default value is None. + :type action: str """ _validation = { 'ip_address_or_range': {'required': True}, - 'action': {'constant': True}, } _attribute_map = { @@ -374,14 +372,13 @@ class IPRule(msrest.serialization.Model): 'action': {'key': 'action', 'type': 'str'}, } - action = "Allow" - def __init__( self, **kwargs ): super(IPRule, self).__init__(**kwargs) self.ip_address_or_range = kwargs['ip_address_or_range'] + self.action = kwargs.get('action', None) class KeyVaultProperties(msrest.serialization.Model): @@ -1073,7 +1070,7 @@ class StorageAccountCheckNameAvailabilityParameters(msrest.serialization.Model): :param name: Required. The storage account name. :type name: str - :ivar type: Required. The type of resource, Microsoft.Storage/storageAccounts. Default value: + :ivar type: The type of resource, Microsoft.Storage/storageAccounts. Has constant value: "Microsoft.Storage/storageAccounts". :vartype type: str """ @@ -1458,15 +1455,14 @@ def __init__( class VirtualNetworkRule(msrest.serialization.Model): """Virtual Network rule. - Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. :param virtual_network_resource_id: Required. Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. :type virtual_network_resource_id: str - :ivar action: The action of virtual network rule. Default value: "Allow". - :vartype action: str + :param action: The action of virtual network rule. The only acceptable values to pass in are + None and "Allow". The default value is None. + :type action: str :param state: Gets the state of virtual network rule. Possible values include: "provisioning", "deprovisioning", "succeeded", "failed", "networkSourceDeleted". :type state: str or ~azure.mgmt.storage.v2017_06_01.models.State @@ -1474,7 +1470,6 @@ class VirtualNetworkRule(msrest.serialization.Model): _validation = { 'virtual_network_resource_id': {'required': True}, - 'action': {'constant': True}, } _attribute_map = { @@ -1483,12 +1478,11 @@ class VirtualNetworkRule(msrest.serialization.Model): 'state': {'key': 'state', 'type': 'str'}, } - action = "Allow" - def __init__( self, **kwargs ): super(VirtualNetworkRule, self).__init__(**kwargs) self.virtual_network_resource_id = kwargs['virtual_network_resource_id'] + self.action = kwargs.get('action', None) self.state = kwargs.get('state', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/_models_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/_models_py3.py index 3071a40a24f0..1fbc5e0de664 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/_models_py3.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/models/_models_py3.py @@ -352,7 +352,7 @@ class Identity(msrest.serialization.Model): :vartype principal_id: str :ivar tenant_id: The tenant ID of resource. :vartype tenant_id: str - :ivar type: Required. The identity type. Default value: "SystemAssigned". + :ivar type: The identity type. Has constant value: "SystemAssigned". :vartype type: str """ @@ -382,20 +382,18 @@ def __init__( class IPRule(msrest.serialization.Model): """IP rule with specific IP or IP range in CIDR format. - Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. :type ip_address_or_range: str - :ivar action: The action of IP ACL rule. Default value: "Allow". - :vartype action: str + :param action: The action of IP ACL rule. The only acceptable values to pass in are None and + "Allow". The default value is None. + :type action: str """ _validation = { 'ip_address_or_range': {'required': True}, - 'action': {'constant': True}, } _attribute_map = { @@ -403,16 +401,16 @@ class IPRule(msrest.serialization.Model): 'action': {'key': 'action', 'type': 'str'}, } - action = "Allow" - def __init__( self, *, ip_address_or_range: str, + action: Optional[str] = None, **kwargs ): super(IPRule, self).__init__(**kwargs) self.ip_address_or_range = ip_address_or_range + self.action = action class KeyVaultProperties(msrest.serialization.Model): @@ -1168,7 +1166,7 @@ class StorageAccountCheckNameAvailabilityParameters(msrest.serialization.Model): :param name: Required. The storage account name. :type name: str - :ivar type: Required. The type of resource, Microsoft.Storage/storageAccounts. Default value: + :ivar type: The type of resource, Microsoft.Storage/storageAccounts. Has constant value: "Microsoft.Storage/storageAccounts". :vartype type: str """ @@ -1579,15 +1577,14 @@ def __init__( class VirtualNetworkRule(msrest.serialization.Model): """Virtual Network rule. - Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. :param virtual_network_resource_id: Required. Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. :type virtual_network_resource_id: str - :ivar action: The action of virtual network rule. Default value: "Allow". - :vartype action: str + :param action: The action of virtual network rule. The only acceptable values to pass in are + None and "Allow". The default value is None. + :type action: str :param state: Gets the state of virtual network rule. Possible values include: "provisioning", "deprovisioning", "succeeded", "failed", "networkSourceDeleted". :type state: str or ~azure.mgmt.storage.v2017_06_01.models.State @@ -1595,7 +1592,6 @@ class VirtualNetworkRule(msrest.serialization.Model): _validation = { 'virtual_network_resource_id': {'required': True}, - 'action': {'constant': True}, } _attribute_map = { @@ -1604,15 +1600,15 @@ class VirtualNetworkRule(msrest.serialization.Model): 'state': {'key': 'state', 'type': 'str'}, } - action = "Allow" - def __init__( self, *, virtual_network_resource_id: str, + action: Optional[str] = None, state: Optional[Union[str, "State"]] = None, **kwargs ): super(VirtualNetworkRule, self).__init__(**kwargs) self.virtual_network_resource_id = virtual_network_resource_id + self.action = action self.state = state diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/_storage_accounts_operations.py index eded46aeae90..ac8b8d149fcc 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/_storage_accounts_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_06_01/operations/_storage_accounts_operations.py @@ -188,8 +188,8 @@ def begin_create( :type parameters: ~azure.mgmt.storage.v2017_06_01.models.StorageAccountCreateParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either StorageAccount or the result of cls(response) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/_version.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/_version.py index 8dae91701610..232662316d4d 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/_version.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "18.0.0" +VERSION = "19.0.0" diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/aio/operations/_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/aio/operations/_operations.py index 9fc993a2392a..b4c1535f7db2 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/aio/operations/_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/aio/operations/_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available Storage Rest API operations. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/aio/operations/_skus_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/aio/operations/_skus_operations.py index daab3859df0f..da4d4780c46d 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/aio/operations/_skus_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/aio/operations/_skus_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.StorageSkuListResult"]: """Lists the available SKUs supported by Microsoft.Storage for given subscription. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/aio/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/aio/operations/_storage_accounts_operations.py index 32ab52758329..f7436de7de95 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/aio/operations/_storage_accounts_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/aio/operations/_storage_accounts_operations.py @@ -46,7 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def check_name_availability( self, account_name: "_models.StorageAccountCheckNameAvailabilityParameters", - **kwargs + **kwargs: Any ) -> "_models.CheckNameAvailabilityResult": """Checks that the storage account name is valid and is not already in use. @@ -108,7 +108,7 @@ async def _create_initial( resource_group_name: str, account_name: str, parameters: "_models.StorageAccountCreateParameters", - **kwargs + **kwargs: Any ) -> Optional["_models.StorageAccount"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StorageAccount"]] error_map = { @@ -163,7 +163,7 @@ async def begin_create( resource_group_name: str, account_name: str, parameters: "_models.StorageAccountCreateParameters", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.StorageAccount"]: """Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the @@ -181,8 +181,8 @@ async def begin_create( :type parameters: ~azure.mgmt.storage.v2017_10_01.models.StorageAccountCreateParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either StorageAccount or the result of cls(response) @@ -239,7 +239,7 @@ async def delete( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> None: """Deletes a storage account in Microsoft Azure. @@ -295,7 +295,7 @@ async def get_properties( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.StorageAccount": """Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage @@ -359,7 +359,7 @@ async def update( resource_group_name: str, account_name: str, parameters: "_models.StorageAccountUpdateParameters", - **kwargs + **kwargs: Any ) -> "_models.StorageAccount": """The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also be used to map the account to a custom domain. Only one custom @@ -432,7 +432,7 @@ async def update( def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.StorageAccountListResult"]: """Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. @@ -500,7 +500,7 @@ async def get_next(next_link=None): def list_by_resource_group( self, resource_group_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.StorageAccountListResult"]: """Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this. @@ -573,7 +573,7 @@ async def list_keys( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.StorageAccountListKeysResult": """Lists the access keys for the specified storage account. @@ -635,7 +635,7 @@ async def regenerate_key( resource_group_name: str, account_name: str, regenerate_key: "_models.StorageAccountRegenerateKeyParameters", - **kwargs + **kwargs: Any ) -> "_models.StorageAccountListKeysResult": """Regenerates one of the access keys for the specified storage account. @@ -704,7 +704,7 @@ async def list_account_sas( resource_group_name: str, account_name: str, parameters: "_models.AccountSasParameters", - **kwargs + **kwargs: Any ) -> "_models.ListAccountSasResponse": """List SAS credentials of a storage account. @@ -773,7 +773,7 @@ async def list_service_sas( resource_group_name: str, account_name: str, parameters: "_models.ServiceSasParameters", - **kwargs + **kwargs: Any ) -> "_models.ListServiceSasResponse": """List service SAS credentials of a specific resource. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/aio/operations/_usage_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/aio/operations/_usage_operations.py index bdc9f7d621b4..7675582d3696 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/aio/operations/_usage_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/aio/operations/_usage_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.UsageListResult"]: """Gets the current usage count and the limit for the resources under the subscription. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/_models.py index ea4836c69ae8..247337f032db 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/_models.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/_models.py @@ -323,7 +323,7 @@ class Identity(msrest.serialization.Model): :vartype principal_id: str :ivar tenant_id: The tenant ID of resource. :vartype tenant_id: str - :ivar type: Required. The identity type. Default value: "SystemAssigned". + :ivar type: The identity type. Has constant value: "SystemAssigned". :vartype type: str """ @@ -353,20 +353,18 @@ def __init__( class IPRule(msrest.serialization.Model): """IP rule with specific IP or IP range in CIDR format. - Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. :type ip_address_or_range: str - :ivar action: The action of IP ACL rule. Default value: "Allow". - :vartype action: str + :param action: The action of IP ACL rule. The only acceptable values to pass in are None and + "Allow". The default value is None. + :type action: str """ _validation = { 'ip_address_or_range': {'required': True}, - 'action': {'constant': True}, } _attribute_map = { @@ -374,14 +372,13 @@ class IPRule(msrest.serialization.Model): 'action': {'key': 'action', 'type': 'str'}, } - action = "Allow" - def __init__( self, **kwargs ): super(IPRule, self).__init__(**kwargs) self.ip_address_or_range = kwargs['ip_address_or_range'] + self.action = kwargs.get('action', None) class KeyVaultProperties(msrest.serialization.Model): @@ -1073,7 +1070,7 @@ class StorageAccountCheckNameAvailabilityParameters(msrest.serialization.Model): :param name: Required. The storage account name. :type name: str - :ivar type: Required. The type of resource, Microsoft.Storage/storageAccounts. Default value: + :ivar type: The type of resource, Microsoft.Storage/storageAccounts. Has constant value: "Microsoft.Storage/storageAccounts". :vartype type: str """ @@ -1463,15 +1460,14 @@ def __init__( class VirtualNetworkRule(msrest.serialization.Model): """Virtual Network rule. - Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. :param virtual_network_resource_id: Required. Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. :type virtual_network_resource_id: str - :ivar action: The action of virtual network rule. Default value: "Allow". - :vartype action: str + :param action: The action of virtual network rule. The only acceptable values to pass in are + None and "Allow". The default value is None. + :type action: str :param state: Gets the state of virtual network rule. Possible values include: "provisioning", "deprovisioning", "succeeded", "failed", "networkSourceDeleted". :type state: str or ~azure.mgmt.storage.v2017_10_01.models.State @@ -1479,7 +1475,6 @@ class VirtualNetworkRule(msrest.serialization.Model): _validation = { 'virtual_network_resource_id': {'required': True}, - 'action': {'constant': True}, } _attribute_map = { @@ -1488,12 +1483,11 @@ class VirtualNetworkRule(msrest.serialization.Model): 'state': {'key': 'state', 'type': 'str'}, } - action = "Allow" - def __init__( self, **kwargs ): super(VirtualNetworkRule, self).__init__(**kwargs) self.virtual_network_resource_id = kwargs['virtual_network_resource_id'] + self.action = kwargs.get('action', None) self.state = kwargs.get('state', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/_models_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/_models_py3.py index cfe831cc6baf..a7523b679d83 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/_models_py3.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/models/_models_py3.py @@ -352,7 +352,7 @@ class Identity(msrest.serialization.Model): :vartype principal_id: str :ivar tenant_id: The tenant ID of resource. :vartype tenant_id: str - :ivar type: Required. The identity type. Default value: "SystemAssigned". + :ivar type: The identity type. Has constant value: "SystemAssigned". :vartype type: str """ @@ -382,20 +382,18 @@ def __init__( class IPRule(msrest.serialization.Model): """IP rule with specific IP or IP range in CIDR format. - Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. :type ip_address_or_range: str - :ivar action: The action of IP ACL rule. Default value: "Allow". - :vartype action: str + :param action: The action of IP ACL rule. The only acceptable values to pass in are None and + "Allow". The default value is None. + :type action: str """ _validation = { 'ip_address_or_range': {'required': True}, - 'action': {'constant': True}, } _attribute_map = { @@ -403,16 +401,16 @@ class IPRule(msrest.serialization.Model): 'action': {'key': 'action', 'type': 'str'}, } - action = "Allow" - def __init__( self, *, ip_address_or_range: str, + action: Optional[str] = None, **kwargs ): super(IPRule, self).__init__(**kwargs) self.ip_address_or_range = ip_address_or_range + self.action = action class KeyVaultProperties(msrest.serialization.Model): @@ -1168,7 +1166,7 @@ class StorageAccountCheckNameAvailabilityParameters(msrest.serialization.Model): :param name: Required. The storage account name. :type name: str - :ivar type: Required. The type of resource, Microsoft.Storage/storageAccounts. Default value: + :ivar type: The type of resource, Microsoft.Storage/storageAccounts. Has constant value: "Microsoft.Storage/storageAccounts". :vartype type: str """ @@ -1585,15 +1583,14 @@ def __init__( class VirtualNetworkRule(msrest.serialization.Model): """Virtual Network rule. - Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. :param virtual_network_resource_id: Required. Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. :type virtual_network_resource_id: str - :ivar action: The action of virtual network rule. Default value: "Allow". - :vartype action: str + :param action: The action of virtual network rule. The only acceptable values to pass in are + None and "Allow". The default value is None. + :type action: str :param state: Gets the state of virtual network rule. Possible values include: "provisioning", "deprovisioning", "succeeded", "failed", "networkSourceDeleted". :type state: str or ~azure.mgmt.storage.v2017_10_01.models.State @@ -1601,7 +1598,6 @@ class VirtualNetworkRule(msrest.serialization.Model): _validation = { 'virtual_network_resource_id': {'required': True}, - 'action': {'constant': True}, } _attribute_map = { @@ -1610,15 +1606,15 @@ class VirtualNetworkRule(msrest.serialization.Model): 'state': {'key': 'state', 'type': 'str'}, } - action = "Allow" - def __init__( self, *, virtual_network_resource_id: str, + action: Optional[str] = None, state: Optional[Union[str, "State"]] = None, **kwargs ): super(VirtualNetworkRule, self).__init__(**kwargs) self.virtual_network_resource_id = virtual_network_resource_id + self.action = action self.state = state diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/_storage_accounts_operations.py index 9cc1ae5756f3..62a52a1945c5 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/_storage_accounts_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/operations/_storage_accounts_operations.py @@ -188,8 +188,8 @@ def begin_create( :type parameters: ~azure.mgmt.storage.v2017_10_01.models.StorageAccountCreateParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either StorageAccount or the result of cls(response) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/_version.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/_version.py index 8dae91701610..232662316d4d 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/_version.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "18.0.0" +VERSION = "19.0.0" diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/aio/operations/_blob_containers_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/aio/operations/_blob_containers_operations.py index 1eb3e01971df..0745b0e44630 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/aio/operations/_blob_containers_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/aio/operations/_blob_containers_operations.py @@ -44,7 +44,7 @@ async def list( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.ListContainerItems": """Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. @@ -108,7 +108,7 @@ async def create( account_name: str, container_name: str, blob_container: "_models.BlobContainer", - **kwargs + **kwargs: Any ) -> "_models.BlobContainer": """Creates a new container under the specified account as described by request body. The container resource includes metadata and properties for that container. It does not include a list of the @@ -186,7 +186,7 @@ async def update( account_name: str, container_name: str, blob_container: "_models.BlobContainer", - **kwargs + **kwargs: Any ) -> "_models.BlobContainer": """Updates container properties as specified in request body. Properties not mentioned in the request will be unchanged. Update fails if the specified container doesn't already exist. @@ -262,7 +262,7 @@ async def get( resource_group_name: str, account_name: str, container_name: str, - **kwargs + **kwargs: Any ) -> "_models.BlobContainer": """Gets properties of a specified container. @@ -330,7 +330,7 @@ async def delete( resource_group_name: str, account_name: str, container_name: str, - **kwargs + **kwargs: Any ) -> None: """Deletes specified container under its account. @@ -394,7 +394,7 @@ async def set_legal_hold( account_name: str, container_name: str, legal_hold: "_models.LegalHold", - **kwargs + **kwargs: Any ) -> "_models.LegalHold": """Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append pattern and does not clear out the existing tags that are not specified in @@ -472,7 +472,7 @@ async def clear_legal_hold( account_name: str, container_name: str, legal_hold: "_models.LegalHold", - **kwargs + **kwargs: Any ) -> "_models.LegalHold": """Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold clears out only the specified tags in the request. @@ -550,7 +550,7 @@ async def create_or_update_immutability_policy( container_name: str, if_match: Optional[str] = None, parameters: Optional["_models.ImmutabilityPolicy"] = None, - **kwargs + **kwargs: Any ) -> "_models.ImmutabilityPolicy": """Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for this operation. @@ -641,7 +641,7 @@ async def get_immutability_policy( account_name: str, container_name: str, if_match: Optional[str] = None, - **kwargs + **kwargs: Any ) -> "_models.ImmutabilityPolicy": """Gets the existing immutability policy along with the corresponding ETag in response headers and body. @@ -721,7 +721,7 @@ async def delete_immutability_policy( account_name: str, container_name: str, if_match: str, - **kwargs + **kwargs: Any ) -> "_models.ImmutabilityPolicy": """Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is required for this @@ -802,7 +802,7 @@ async def lock_immutability_policy( account_name: str, container_name: str, if_match: str, - **kwargs + **kwargs: Any ) -> "_models.ImmutabilityPolicy": """Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. @@ -880,7 +880,7 @@ async def extend_immutability_policy( container_name: str, if_match: str, parameters: Optional["_models.ImmutabilityPolicy"] = None, - **kwargs + **kwargs: Any ) -> "_models.ImmutabilityPolicy": """Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a Locked policy will be this action. ETag in If-Match is required for this @@ -969,7 +969,7 @@ async def lease( account_name: str, container_name: str, parameters: Optional["_models.LeaseContainerRequest"] = None, - **kwargs + **kwargs: Any ) -> "_models.LeaseContainerResponse": """The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/aio/operations/_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/aio/operations/_operations.py index 8f032f550b45..afacadb61fae 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/aio/operations/_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/aio/operations/_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available Storage Rest API operations. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/aio/operations/_skus_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/aio/operations/_skus_operations.py index c962a2c29279..a8133bca91dd 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/aio/operations/_skus_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/aio/operations/_skus_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.StorageSkuListResult"]: """Lists the available SKUs supported by Microsoft.Storage for given subscription. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/aio/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/aio/operations/_storage_accounts_operations.py index 32565fe7ff87..0842a3a0d05c 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/aio/operations/_storage_accounts_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/aio/operations/_storage_accounts_operations.py @@ -46,7 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def check_name_availability( self, account_name: "_models.StorageAccountCheckNameAvailabilityParameters", - **kwargs + **kwargs: Any ) -> "_models.CheckNameAvailabilityResult": """Checks that the storage account name is valid and is not already in use. @@ -108,7 +108,7 @@ async def _create_initial( resource_group_name: str, account_name: str, parameters: "_models.StorageAccountCreateParameters", - **kwargs + **kwargs: Any ) -> Optional["_models.StorageAccount"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StorageAccount"]] error_map = { @@ -163,7 +163,7 @@ async def begin_create( resource_group_name: str, account_name: str, parameters: "_models.StorageAccountCreateParameters", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.StorageAccount"]: """Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the @@ -181,8 +181,8 @@ async def begin_create( :type parameters: ~azure.mgmt.storage.v2018_02_01.models.StorageAccountCreateParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either StorageAccount or the result of cls(response) @@ -239,7 +239,7 @@ async def delete( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> None: """Deletes a storage account in Microsoft Azure. @@ -295,7 +295,7 @@ async def get_properties( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.StorageAccount": """Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage @@ -359,7 +359,7 @@ async def update( resource_group_name: str, account_name: str, parameters: "_models.StorageAccountUpdateParameters", - **kwargs + **kwargs: Any ) -> "_models.StorageAccount": """The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also be used to map the account to a custom domain. Only one custom @@ -432,7 +432,7 @@ async def update( def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.StorageAccountListResult"]: """Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. @@ -500,7 +500,7 @@ async def get_next(next_link=None): def list_by_resource_group( self, resource_group_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.StorageAccountListResult"]: """Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this. @@ -573,7 +573,7 @@ async def list_keys( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.StorageAccountListKeysResult": """Lists the access keys for the specified storage account. @@ -635,7 +635,7 @@ async def regenerate_key( resource_group_name: str, account_name: str, regenerate_key: "_models.StorageAccountRegenerateKeyParameters", - **kwargs + **kwargs: Any ) -> "_models.StorageAccountListKeysResult": """Regenerates one of the access keys for the specified storage account. @@ -704,7 +704,7 @@ async def list_account_sas( resource_group_name: str, account_name: str, parameters: "_models.AccountSasParameters", - **kwargs + **kwargs: Any ) -> "_models.ListAccountSasResponse": """List SAS credentials of a storage account. @@ -773,7 +773,7 @@ async def list_service_sas( resource_group_name: str, account_name: str, parameters: "_models.ServiceSasParameters", - **kwargs + **kwargs: Any ) -> "_models.ListServiceSasResponse": """List service SAS credentials of a specific resource. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/aio/operations/_usage_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/aio/operations/_usage_operations.py index 8c77fa0feeff..d04e257ee6de 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/aio/operations/_usage_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/aio/operations/_usage_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.UsageListResult"]: """Gets the current usage count and the limit for the resources under the subscription. @@ -110,7 +110,7 @@ async def get_next(next_link=None): def list_by_location( self, location: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.UsageListResult"]: """Gets the current usage count and the limit for the resources of the location under the subscription. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/_models.py index d9c903663426..8876aeaf9988 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/_models.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/_models.py @@ -505,7 +505,7 @@ class Identity(msrest.serialization.Model): :vartype principal_id: str :ivar tenant_id: The tenant ID of resource. :vartype tenant_id: str - :ivar type: Required. The identity type. Default value: "SystemAssigned". + :ivar type: The identity type. Has constant value: "SystemAssigned". :vartype type: str """ @@ -628,20 +628,18 @@ def __init__( class IPRule(msrest.serialization.Model): """IP rule with specific IP or IP range in CIDR format. - Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. :type ip_address_or_range: str - :ivar action: The action of IP ACL rule. Default value: "Allow". - :vartype action: str + :param action: The action of IP ACL rule. The only acceptable values to pass in are None and + "Allow". The default value is None. + :type action: str """ _validation = { 'ip_address_or_range': {'required': True}, - 'action': {'constant': True}, } _attribute_map = { @@ -649,14 +647,13 @@ class IPRule(msrest.serialization.Model): 'action': {'key': 'action', 'type': 'str'}, } - action = "Allow" - def __init__( self, **kwargs ): super(IPRule, self).__init__(**kwargs) self.ip_address_or_range = kwargs['ip_address_or_range'] + self.action = kwargs.get('action', None) class KeyVaultProperties(msrest.serialization.Model): @@ -1611,7 +1608,7 @@ class StorageAccountCheckNameAvailabilityParameters(msrest.serialization.Model): :param name: Required. The storage account name. :type name: str - :ivar type: Required. The type of resource, Microsoft.Storage/storageAccounts. Default value: + :ivar type: The type of resource, Microsoft.Storage/storageAccounts. Has constant value: "Microsoft.Storage/storageAccounts". :vartype type: str """ @@ -2103,15 +2100,14 @@ def __init__( class VirtualNetworkRule(msrest.serialization.Model): """Virtual Network rule. - Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. :param virtual_network_resource_id: Required. Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. :type virtual_network_resource_id: str - :ivar action: The action of virtual network rule. Default value: "Allow". - :vartype action: str + :param action: The action of virtual network rule. The only acceptable values to pass in are + None and "Allow". The default value is None. + :type action: str :param state: Gets the state of virtual network rule. Possible values include: "provisioning", "deprovisioning", "succeeded", "failed", "networkSourceDeleted". :type state: str or ~azure.mgmt.storage.v2018_02_01.models.State @@ -2119,7 +2115,6 @@ class VirtualNetworkRule(msrest.serialization.Model): _validation = { 'virtual_network_resource_id': {'required': True}, - 'action': {'constant': True}, } _attribute_map = { @@ -2128,12 +2123,11 @@ class VirtualNetworkRule(msrest.serialization.Model): 'state': {'key': 'state', 'type': 'str'}, } - action = "Allow" - def __init__( self, **kwargs ): super(VirtualNetworkRule, self).__init__(**kwargs) self.virtual_network_resource_id = kwargs['virtual_network_resource_id'] + self.action = kwargs.get('action', None) self.state = kwargs.get('state', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/_models_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/_models_py3.py index bfd646d618d2..479bf8bb2d31 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/_models_py3.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/models/_models_py3.py @@ -537,7 +537,7 @@ class Identity(msrest.serialization.Model): :vartype principal_id: str :ivar tenant_id: The tenant ID of resource. :vartype tenant_id: str - :ivar type: Required. The identity type. Default value: "SystemAssigned". + :ivar type: The identity type. Has constant value: "SystemAssigned". :vartype type: str """ @@ -664,20 +664,18 @@ def __init__( class IPRule(msrest.serialization.Model): """IP rule with specific IP or IP range in CIDR format. - Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. :type ip_address_or_range: str - :ivar action: The action of IP ACL rule. Default value: "Allow". - :vartype action: str + :param action: The action of IP ACL rule. The only acceptable values to pass in are None and + "Allow". The default value is None. + :type action: str """ _validation = { 'ip_address_or_range': {'required': True}, - 'action': {'constant': True}, } _attribute_map = { @@ -685,16 +683,16 @@ class IPRule(msrest.serialization.Model): 'action': {'key': 'action', 'type': 'str'}, } - action = "Allow" - def __init__( self, *, ip_address_or_range: str, + action: Optional[str] = None, **kwargs ): super(IPRule, self).__init__(**kwargs) self.ip_address_or_range = ip_address_or_range + self.action = action class KeyVaultProperties(msrest.serialization.Model): @@ -1733,7 +1731,7 @@ class StorageAccountCheckNameAvailabilityParameters(msrest.serialization.Model): :param name: Required. The storage account name. :type name: str - :ivar type: Required. The type of resource, Microsoft.Storage/storageAccounts. Default value: + :ivar type: The type of resource, Microsoft.Storage/storageAccounts. Has constant value: "Microsoft.Storage/storageAccounts". :vartype type: str """ @@ -2253,15 +2251,14 @@ def __init__( class VirtualNetworkRule(msrest.serialization.Model): """Virtual Network rule. - Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. :param virtual_network_resource_id: Required. Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. :type virtual_network_resource_id: str - :ivar action: The action of virtual network rule. Default value: "Allow". - :vartype action: str + :param action: The action of virtual network rule. The only acceptable values to pass in are + None and "Allow". The default value is None. + :type action: str :param state: Gets the state of virtual network rule. Possible values include: "provisioning", "deprovisioning", "succeeded", "failed", "networkSourceDeleted". :type state: str or ~azure.mgmt.storage.v2018_02_01.models.State @@ -2269,7 +2266,6 @@ class VirtualNetworkRule(msrest.serialization.Model): _validation = { 'virtual_network_resource_id': {'required': True}, - 'action': {'constant': True}, } _attribute_map = { @@ -2278,15 +2274,15 @@ class VirtualNetworkRule(msrest.serialization.Model): 'state': {'key': 'state', 'type': 'str'}, } - action = "Allow" - def __init__( self, *, virtual_network_resource_id: str, + action: Optional[str] = None, state: Optional[Union[str, "State"]] = None, **kwargs ): super(VirtualNetworkRule, self).__init__(**kwargs) self.virtual_network_resource_id = virtual_network_resource_id + self.action = action self.state = state diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/_storage_accounts_operations.py index 51b718236878..8607e3345db0 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/_storage_accounts_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_02_01/operations/_storage_accounts_operations.py @@ -188,8 +188,8 @@ def begin_create( :type parameters: ~azure.mgmt.storage.v2018_02_01.models.StorageAccountCreateParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either StorageAccount or the result of cls(response) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/_version.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/_version.py index 8dae91701610..232662316d4d 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/_version.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "18.0.0" +VERSION = "19.0.0" diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/aio/operations/_blob_containers_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/aio/operations/_blob_containers_operations.py index 111241aa098e..cbbc78a23b4d 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/aio/operations/_blob_containers_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/aio/operations/_blob_containers_operations.py @@ -44,7 +44,7 @@ async def list( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.ListContainerItems": """Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. @@ -108,7 +108,7 @@ async def create( account_name: str, container_name: str, blob_container: "_models.BlobContainer", - **kwargs + **kwargs: Any ) -> "_models.BlobContainer": """Creates a new container under the specified account as described by request body. The container resource includes metadata and properties for that container. It does not include a list of the @@ -186,7 +186,7 @@ async def update( account_name: str, container_name: str, blob_container: "_models.BlobContainer", - **kwargs + **kwargs: Any ) -> "_models.BlobContainer": """Updates container properties as specified in request body. Properties not mentioned in the request will be unchanged. Update fails if the specified container doesn't already exist. @@ -262,7 +262,7 @@ async def get( resource_group_name: str, account_name: str, container_name: str, - **kwargs + **kwargs: Any ) -> "_models.BlobContainer": """Gets properties of a specified container. @@ -330,7 +330,7 @@ async def delete( resource_group_name: str, account_name: str, container_name: str, - **kwargs + **kwargs: Any ) -> None: """Deletes specified container under its account. @@ -394,7 +394,7 @@ async def set_legal_hold( account_name: str, container_name: str, legal_hold: "_models.LegalHold", - **kwargs + **kwargs: Any ) -> "_models.LegalHold": """Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append pattern and does not clear out the existing tags that are not specified in @@ -472,7 +472,7 @@ async def clear_legal_hold( account_name: str, container_name: str, legal_hold: "_models.LegalHold", - **kwargs + **kwargs: Any ) -> "_models.LegalHold": """Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold clears out only the specified tags in the request. @@ -550,7 +550,7 @@ async def create_or_update_immutability_policy( container_name: str, if_match: Optional[str] = None, parameters: Optional["_models.ImmutabilityPolicy"] = None, - **kwargs + **kwargs: Any ) -> "_models.ImmutabilityPolicy": """Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for this operation. @@ -641,7 +641,7 @@ async def get_immutability_policy( account_name: str, container_name: str, if_match: Optional[str] = None, - **kwargs + **kwargs: Any ) -> "_models.ImmutabilityPolicy": """Gets the existing immutability policy along with the corresponding ETag in response headers and body. @@ -721,7 +721,7 @@ async def delete_immutability_policy( account_name: str, container_name: str, if_match: str, - **kwargs + **kwargs: Any ) -> "_models.ImmutabilityPolicy": """Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is required for this @@ -802,7 +802,7 @@ async def lock_immutability_policy( account_name: str, container_name: str, if_match: str, - **kwargs + **kwargs: Any ) -> "_models.ImmutabilityPolicy": """Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. @@ -880,7 +880,7 @@ async def extend_immutability_policy( container_name: str, if_match: str, parameters: Optional["_models.ImmutabilityPolicy"] = None, - **kwargs + **kwargs: Any ) -> "_models.ImmutabilityPolicy": """Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a Locked policy will be this action. ETag in If-Match is required for this @@ -969,7 +969,7 @@ async def lease( account_name: str, container_name: str, parameters: Optional["_models.LeaseContainerRequest"] = None, - **kwargs + **kwargs: Any ) -> "_models.LeaseContainerResponse": """The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/aio/operations/_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/aio/operations/_operations.py index 8acaf370503e..f16fcc74108e 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/aio/operations/_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/aio/operations/_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available Storage Rest API operations. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/aio/operations/_skus_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/aio/operations/_skus_operations.py index a253f1b1bae8..78e9436d07d3 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/aio/operations/_skus_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/aio/operations/_skus_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.StorageSkuListResult"]: """Lists the available SKUs supported by Microsoft.Storage for given subscription. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/aio/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/aio/operations/_storage_accounts_operations.py index 96edd77d655b..798a72a41dd5 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/aio/operations/_storage_accounts_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/aio/operations/_storage_accounts_operations.py @@ -46,7 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def check_name_availability( self, account_name: "_models.StorageAccountCheckNameAvailabilityParameters", - **kwargs + **kwargs: Any ) -> "_models.CheckNameAvailabilityResult": """Checks that the storage account name is valid and is not already in use. @@ -108,7 +108,7 @@ async def _create_initial( resource_group_name: str, account_name: str, parameters: "_models.StorageAccountCreateParameters", - **kwargs + **kwargs: Any ) -> Optional["_models.StorageAccount"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StorageAccount"]] error_map = { @@ -163,7 +163,7 @@ async def begin_create( resource_group_name: str, account_name: str, parameters: "_models.StorageAccountCreateParameters", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.StorageAccount"]: """Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the @@ -181,8 +181,8 @@ async def begin_create( :type parameters: ~azure.mgmt.storage.v2018_03_01_preview.models.StorageAccountCreateParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either StorageAccount or the result of cls(response) @@ -239,7 +239,7 @@ async def delete( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> None: """Deletes a storage account in Microsoft Azure. @@ -295,7 +295,7 @@ async def get_properties( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.StorageAccount": """Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage @@ -359,7 +359,7 @@ async def update( resource_group_name: str, account_name: str, parameters: "_models.StorageAccountUpdateParameters", - **kwargs + **kwargs: Any ) -> "_models.StorageAccount": """The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also be used to map the account to a custom domain. Only one custom @@ -432,7 +432,7 @@ async def update( def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.StorageAccountListResult"]: """Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. @@ -500,7 +500,7 @@ async def get_next(next_link=None): def list_by_resource_group( self, resource_group_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.StorageAccountListResult"]: """Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this. @@ -573,7 +573,7 @@ async def list_keys( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.StorageAccountListKeysResult": """Lists the access keys for the specified storage account. @@ -635,7 +635,7 @@ async def regenerate_key( resource_group_name: str, account_name: str, regenerate_key: "_models.StorageAccountRegenerateKeyParameters", - **kwargs + **kwargs: Any ) -> "_models.StorageAccountListKeysResult": """Regenerates one of the access keys for the specified storage account. @@ -704,7 +704,7 @@ async def list_account_sas( resource_group_name: str, account_name: str, parameters: "_models.AccountSasParameters", - **kwargs + **kwargs: Any ) -> "_models.ListAccountSasResponse": """List SAS credentials of a storage account. @@ -773,7 +773,7 @@ async def list_service_sas( resource_group_name: str, account_name: str, parameters: "_models.ServiceSasParameters", - **kwargs + **kwargs: Any ) -> "_models.ListServiceSasResponse": """List service SAS credentials of a specific resource. @@ -842,7 +842,7 @@ async def get_management_policies( resource_group_name: str, account_name: str, management_policy_name: Union[str, "_models.ManagementPolicyName"], - **kwargs + **kwargs: Any ) -> "_models.StorageAccountManagementPolicies": """Gets the data policy rules associated with the specified storage account. @@ -909,7 +909,7 @@ async def create_or_update_management_policies( account_name: str, management_policy_name: Union[str, "_models.ManagementPolicyName"], properties: "_models.ManagementPoliciesRulesSetParameter", - **kwargs + **kwargs: Any ) -> "_models.StorageAccountManagementPolicies": """Sets the data policy rules associated with the specified storage account. @@ -982,7 +982,7 @@ async def delete_management_policies( resource_group_name: str, account_name: str, management_policy_name: Union[str, "_models.ManagementPolicyName"], - **kwargs + **kwargs: Any ) -> None: """Deletes the data policy rules associated with the specified storage account. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/aio/operations/_usages_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/aio/operations/_usages_operations.py index 6b1f688f21cc..af7951014e4d 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/aio/operations/_usages_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/aio/operations/_usages_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.UsageListResult"]: """Gets the current usage count and the limit for the resources under the subscription. @@ -110,7 +110,7 @@ async def get_next(next_link=None): def list_by_location( self, location: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.UsageListResult"]: """Gets the current usage count and the limit for the resources of the location under the subscription. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/_models.py index 21ae67fbf49b..3317718d039c 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/_models.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/_models.py @@ -505,7 +505,7 @@ class Identity(msrest.serialization.Model): :vartype principal_id: str :ivar tenant_id: The tenant ID of resource. :vartype tenant_id: str - :ivar type: Required. The identity type. Default value: "SystemAssigned". + :ivar type: The identity type. Has constant value: "SystemAssigned". :vartype type: str """ @@ -629,20 +629,18 @@ def __init__( class IPRule(msrest.serialization.Model): """IP rule with specific IP or IP range in CIDR format. - Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. :type ip_address_or_range: str - :ivar action: The action of IP ACL rule. Default value: "Allow". - :vartype action: str + :param action: The action of IP ACL rule. The only acceptable values to pass in are None and + "Allow". The default value is None. + :type action: str """ _validation = { 'ip_address_or_range': {'required': True}, - 'action': {'constant': True}, } _attribute_map = { @@ -650,14 +648,13 @@ class IPRule(msrest.serialization.Model): 'action': {'key': 'action', 'type': 'str'}, } - action = "Allow" - def __init__( self, **kwargs ): super(IPRule, self).__init__(**kwargs) self.ip_address_or_range = kwargs['ip_address_or_range'] + self.action = kwargs.get('action', None) class KeyVaultProperties(msrest.serialization.Model): @@ -994,11 +991,11 @@ class ManagementPoliciesRules(msrest.serialization.Model): :param policy: The Storage Account ManagementPolicies Rules, in JSON format. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - :type policy: str + :type policy: any """ _attribute_map = { - 'policy': {'key': 'policy', 'type': 'str'}, + 'policy': {'key': 'policy', 'type': 'object'}, } def __init__( @@ -1014,11 +1011,11 @@ class ManagementPoliciesRulesSetParameter(msrest.serialization.Model): :param policy: The Storage Account ManagementPolicies Rules, in JSON format. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - :type policy: str + :type policy: any """ _attribute_map = { - 'policy': {'key': 'properties.policy', 'type': 'str'}, + 'policy': {'key': 'properties.policy', 'type': 'object'}, } def __init__( @@ -1657,7 +1654,7 @@ class StorageAccountCheckNameAvailabilityParameters(msrest.serialization.Model): :param name: Required. The storage account name. :type name: str - :ivar type: Required. The type of resource, Microsoft.Storage/storageAccounts. Default value: + :ivar type: The type of resource, Microsoft.Storage/storageAccounts. Has constant value: "Microsoft.Storage/storageAccounts". :vartype type: str """ @@ -1862,7 +1859,7 @@ class StorageAccountManagementPolicies(Resource): :vartype type: str :param policy: The Storage Account ManagementPolicies Rules, in JSON format. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - :type policy: str + :type policy: any :ivar last_modified_time: Returns the date and time the ManagementPolicies was last modified. :vartype last_modified_time: ~datetime.datetime """ @@ -1878,7 +1875,7 @@ class StorageAccountManagementPolicies(Resource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'policy': {'key': 'properties.policy', 'type': 'str'}, + 'policy': {'key': 'properties.policy', 'type': 'object'}, 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, } @@ -1898,7 +1895,7 @@ class StorageAccountManagementPoliciesRulesProperty(ManagementPoliciesRules): :param policy: The Storage Account ManagementPolicies Rules, in JSON format. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - :type policy: str + :type policy: any :ivar last_modified_time: Returns the date and time the ManagementPolicies was last modified. :vartype last_modified_time: ~datetime.datetime """ @@ -1908,7 +1905,7 @@ class StorageAccountManagementPoliciesRulesProperty(ManagementPoliciesRules): } _attribute_map = { - 'policy': {'key': 'policy', 'type': 'str'}, + 'policy': {'key': 'policy', 'type': 'object'}, 'last_modified_time': {'key': 'lastModifiedTime', 'type': 'iso-8601'}, } @@ -2223,15 +2220,14 @@ def __init__( class VirtualNetworkRule(msrest.serialization.Model): """Virtual Network rule. - Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. :param virtual_network_resource_id: Required. Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. :type virtual_network_resource_id: str - :ivar action: The action of virtual network rule. Default value: "Allow". - :vartype action: str + :param action: The action of virtual network rule. The only acceptable values to pass in are + None and "Allow". The default value is None. + :type action: str :param state: Gets the state of virtual network rule. Possible values include: "provisioning", "deprovisioning", "succeeded", "failed", "networkSourceDeleted". :type state: str or ~azure.mgmt.storage.v2018_03_01_preview.models.State @@ -2239,7 +2235,6 @@ class VirtualNetworkRule(msrest.serialization.Model): _validation = { 'virtual_network_resource_id': {'required': True}, - 'action': {'constant': True}, } _attribute_map = { @@ -2248,12 +2243,11 @@ class VirtualNetworkRule(msrest.serialization.Model): 'state': {'key': 'state', 'type': 'str'}, } - action = "Allow" - def __init__( self, **kwargs ): super(VirtualNetworkRule, self).__init__(**kwargs) self.virtual_network_resource_id = kwargs['virtual_network_resource_id'] + self.action = kwargs.get('action', None) self.state = kwargs.get('state', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/_models_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/_models_py3.py index 57268137f721..d0bed1a06631 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/_models_py3.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/models/_models_py3.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- import datetime -from typing import Dict, List, Optional, Union +from typing import Any, Dict, List, Optional, Union import msrest.serialization @@ -537,7 +537,7 @@ class Identity(msrest.serialization.Model): :vartype principal_id: str :ivar tenant_id: The tenant ID of resource. :vartype tenant_id: str - :ivar type: Required. The identity type. Default value: "SystemAssigned". + :ivar type: The identity type. Has constant value: "SystemAssigned". :vartype type: str """ @@ -665,20 +665,18 @@ def __init__( class IPRule(msrest.serialization.Model): """IP rule with specific IP or IP range in CIDR format. - Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. :type ip_address_or_range: str - :ivar action: The action of IP ACL rule. Default value: "Allow". - :vartype action: str + :param action: The action of IP ACL rule. The only acceptable values to pass in are None and + "Allow". The default value is None. + :type action: str """ _validation = { 'ip_address_or_range': {'required': True}, - 'action': {'constant': True}, } _attribute_map = { @@ -686,16 +684,16 @@ class IPRule(msrest.serialization.Model): 'action': {'key': 'action', 'type': 'str'}, } - action = "Allow" - def __init__( self, *, ip_address_or_range: str, + action: Optional[str] = None, **kwargs ): super(IPRule, self).__init__(**kwargs) self.ip_address_or_range = ip_address_or_range + self.action = action class KeyVaultProperties(msrest.serialization.Model): @@ -1054,17 +1052,17 @@ class ManagementPoliciesRules(msrest.serialization.Model): :param policy: The Storage Account ManagementPolicies Rules, in JSON format. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - :type policy: str + :type policy: any """ _attribute_map = { - 'policy': {'key': 'policy', 'type': 'str'}, + 'policy': {'key': 'policy', 'type': 'object'}, } def __init__( self, *, - policy: Optional[str] = None, + policy: Optional[Any] = None, **kwargs ): super(ManagementPoliciesRules, self).__init__(**kwargs) @@ -1076,17 +1074,17 @@ class ManagementPoliciesRulesSetParameter(msrest.serialization.Model): :param policy: The Storage Account ManagementPolicies Rules, in JSON format. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - :type policy: str + :type policy: any """ _attribute_map = { - 'policy': {'key': 'properties.policy', 'type': 'str'}, + 'policy': {'key': 'properties.policy', 'type': 'object'}, } def __init__( self, *, - policy: Optional[str] = None, + policy: Optional[Any] = None, **kwargs ): super(ManagementPoliciesRulesSetParameter, self).__init__(**kwargs) @@ -1783,7 +1781,7 @@ class StorageAccountCheckNameAvailabilityParameters(msrest.serialization.Model): :param name: Required. The storage account name. :type name: str - :ivar type: Required. The type of resource, Microsoft.Storage/storageAccounts. Default value: + :ivar type: The type of resource, Microsoft.Storage/storageAccounts. Has constant value: "Microsoft.Storage/storageAccounts". :vartype type: str """ @@ -2002,7 +2000,7 @@ class StorageAccountManagementPolicies(Resource): :vartype type: str :param policy: The Storage Account ManagementPolicies Rules, in JSON format. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - :type policy: str + :type policy: any :ivar last_modified_time: Returns the date and time the ManagementPolicies was last modified. :vartype last_modified_time: ~datetime.datetime """ @@ -2018,14 +2016,14 @@ class StorageAccountManagementPolicies(Resource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'policy': {'key': 'properties.policy', 'type': 'str'}, + 'policy': {'key': 'properties.policy', 'type': 'object'}, 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, } def __init__( self, *, - policy: Optional[str] = None, + policy: Optional[Any] = None, **kwargs ): super(StorageAccountManagementPolicies, self).__init__(**kwargs) @@ -2040,7 +2038,7 @@ class StorageAccountManagementPoliciesRulesProperty(ManagementPoliciesRules): :param policy: The Storage Account ManagementPolicies Rules, in JSON format. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - :type policy: str + :type policy: any :ivar last_modified_time: Returns the date and time the ManagementPolicies was last modified. :vartype last_modified_time: ~datetime.datetime """ @@ -2050,14 +2048,14 @@ class StorageAccountManagementPoliciesRulesProperty(ManagementPoliciesRules): } _attribute_map = { - 'policy': {'key': 'policy', 'type': 'str'}, + 'policy': {'key': 'policy', 'type': 'object'}, 'last_modified_time': {'key': 'lastModifiedTime', 'type': 'iso-8601'}, } def __init__( self, *, - policy: Optional[str] = None, + policy: Optional[Any] = None, **kwargs ): super(StorageAccountManagementPoliciesRulesProperty, self).__init__(policy=policy, **kwargs) @@ -2381,15 +2379,14 @@ def __init__( class VirtualNetworkRule(msrest.serialization.Model): """Virtual Network rule. - Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. :param virtual_network_resource_id: Required. Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. :type virtual_network_resource_id: str - :ivar action: The action of virtual network rule. Default value: "Allow". - :vartype action: str + :param action: The action of virtual network rule. The only acceptable values to pass in are + None and "Allow". The default value is None. + :type action: str :param state: Gets the state of virtual network rule. Possible values include: "provisioning", "deprovisioning", "succeeded", "failed", "networkSourceDeleted". :type state: str or ~azure.mgmt.storage.v2018_03_01_preview.models.State @@ -2397,7 +2394,6 @@ class VirtualNetworkRule(msrest.serialization.Model): _validation = { 'virtual_network_resource_id': {'required': True}, - 'action': {'constant': True}, } _attribute_map = { @@ -2406,15 +2402,15 @@ class VirtualNetworkRule(msrest.serialization.Model): 'state': {'key': 'state', 'type': 'str'}, } - action = "Allow" - def __init__( self, *, virtual_network_resource_id: str, + action: Optional[str] = None, state: Optional[Union[str, "State"]] = None, **kwargs ): super(VirtualNetworkRule, self).__init__(**kwargs) self.virtual_network_resource_id = virtual_network_resource_id + self.action = action self.state = state diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/_storage_accounts_operations.py index 9bcd6256d306..37821a6431a6 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/_storage_accounts_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_03_01_preview/operations/_storage_accounts_operations.py @@ -188,8 +188,8 @@ def begin_create( :type parameters: ~azure.mgmt.storage.v2018_03_01_preview.models.StorageAccountCreateParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either StorageAccount or the result of cls(response) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/_version.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/_version.py index 8dae91701610..232662316d4d 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/_version.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "18.0.0" +VERSION = "19.0.0" diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/operations/_blob_containers_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/operations/_blob_containers_operations.py index f724311b8aa2..fa446262595e 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/operations/_blob_containers_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/operations/_blob_containers_operations.py @@ -44,7 +44,7 @@ async def list( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.ListContainerItems": """Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. @@ -108,7 +108,7 @@ async def create( account_name: str, container_name: str, blob_container: "_models.BlobContainer", - **kwargs + **kwargs: Any ) -> "_models.BlobContainer": """Creates a new container under the specified account as described by request body. The container resource includes metadata and properties for that container. It does not include a list of the @@ -186,7 +186,7 @@ async def update( account_name: str, container_name: str, blob_container: "_models.BlobContainer", - **kwargs + **kwargs: Any ) -> "_models.BlobContainer": """Updates container properties as specified in request body. Properties not mentioned in the request will be unchanged. Update fails if the specified container doesn't already exist. @@ -262,7 +262,7 @@ async def get( resource_group_name: str, account_name: str, container_name: str, - **kwargs + **kwargs: Any ) -> "_models.BlobContainer": """Gets properties of a specified container. @@ -330,7 +330,7 @@ async def delete( resource_group_name: str, account_name: str, container_name: str, - **kwargs + **kwargs: Any ) -> None: """Deletes specified container under its account. @@ -394,7 +394,7 @@ async def set_legal_hold( account_name: str, container_name: str, legal_hold: "_models.LegalHold", - **kwargs + **kwargs: Any ) -> "_models.LegalHold": """Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append pattern and does not clear out the existing tags that are not specified in @@ -472,7 +472,7 @@ async def clear_legal_hold( account_name: str, container_name: str, legal_hold: "_models.LegalHold", - **kwargs + **kwargs: Any ) -> "_models.LegalHold": """Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold clears out only the specified tags in the request. @@ -550,7 +550,7 @@ async def create_or_update_immutability_policy( container_name: str, if_match: Optional[str] = None, parameters: Optional["_models.ImmutabilityPolicy"] = None, - **kwargs + **kwargs: Any ) -> "_models.ImmutabilityPolicy": """Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for this operation. @@ -641,7 +641,7 @@ async def get_immutability_policy( account_name: str, container_name: str, if_match: Optional[str] = None, - **kwargs + **kwargs: Any ) -> "_models.ImmutabilityPolicy": """Gets the existing immutability policy along with the corresponding ETag in response headers and body. @@ -721,7 +721,7 @@ async def delete_immutability_policy( account_name: str, container_name: str, if_match: str, - **kwargs + **kwargs: Any ) -> "_models.ImmutabilityPolicy": """Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is required for this @@ -802,7 +802,7 @@ async def lock_immutability_policy( account_name: str, container_name: str, if_match: str, - **kwargs + **kwargs: Any ) -> "_models.ImmutabilityPolicy": """Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. @@ -880,7 +880,7 @@ async def extend_immutability_policy( container_name: str, if_match: str, parameters: Optional["_models.ImmutabilityPolicy"] = None, - **kwargs + **kwargs: Any ) -> "_models.ImmutabilityPolicy": """Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a Locked policy will be this action. ETag in If-Match is required for this @@ -969,7 +969,7 @@ async def lease( account_name: str, container_name: str, parameters: Optional["_models.LeaseContainerRequest"] = None, - **kwargs + **kwargs: Any ) -> "_models.LeaseContainerResponse": """The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/operations/_blob_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/operations/_blob_services_operations.py index 6fa8f697c590..fc13dc5fd68d 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/operations/_blob_services_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/operations/_blob_services_operations.py @@ -45,7 +45,7 @@ async def set_service_properties( resource_group_name: str, account_name: str, parameters: "_models.BlobServiceProperties", - **kwargs + **kwargs: Any ) -> "_models.BlobServiceProperties": """Sets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. @@ -117,7 +117,7 @@ async def get_service_properties( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.BlobServiceProperties": """Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/operations/_management_policies_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/operations/_management_policies_operations.py index 2ad069b7d639..57e4c676eebc 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/operations/_management_policies_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/operations/_management_policies_operations.py @@ -45,7 +45,7 @@ async def get( resource_group_name: str, account_name: str, management_policy_name: Union[str, "_models.ManagementPolicyName"], - **kwargs + **kwargs: Any ) -> "_models.StorageAccountManagementPolicies": """Gets the data policy rules associated with the specified storage account. @@ -112,7 +112,7 @@ async def create_or_update( account_name: str, management_policy_name: Union[str, "_models.ManagementPolicyName"], properties: "_models.ManagementPoliciesRulesSetParameter", - **kwargs + **kwargs: Any ) -> "_models.StorageAccountManagementPolicies": """Sets the data policy rules associated with the specified storage account. @@ -185,7 +185,7 @@ async def delete( resource_group_name: str, account_name: str, management_policy_name: Union[str, "_models.ManagementPolicyName"], - **kwargs + **kwargs: Any ) -> None: """Deletes the data policy rules associated with the specified storage account. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/operations/_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/operations/_operations.py index a899d4a9d237..8f374fe94387 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/operations/_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/operations/_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available Storage Rest API operations. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/operations/_skus_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/operations/_skus_operations.py index fcfd30590798..a79667a98862 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/operations/_skus_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/operations/_skus_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.StorageSkuListResult"]: """Lists the available SKUs supported by Microsoft.Storage for given subscription. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/operations/_storage_accounts_operations.py index a7034a976d25..4ec8dc6ea00f 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/operations/_storage_accounts_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/operations/_storage_accounts_operations.py @@ -46,7 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def check_name_availability( self, account_name: "_models.StorageAccountCheckNameAvailabilityParameters", - **kwargs + **kwargs: Any ) -> "_models.CheckNameAvailabilityResult": """Checks that the storage account name is valid and is not already in use. @@ -108,7 +108,7 @@ async def _create_initial( resource_group_name: str, account_name: str, parameters: "_models.StorageAccountCreateParameters", - **kwargs + **kwargs: Any ) -> Optional["_models.StorageAccount"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StorageAccount"]] error_map = { @@ -163,7 +163,7 @@ async def begin_create( resource_group_name: str, account_name: str, parameters: "_models.StorageAccountCreateParameters", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.StorageAccount"]: """Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the @@ -181,8 +181,8 @@ async def begin_create( :type parameters: ~azure.mgmt.storage.v2018_07_01.models.StorageAccountCreateParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either StorageAccount or the result of cls(response) @@ -239,7 +239,7 @@ async def delete( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> None: """Deletes a storage account in Microsoft Azure. @@ -296,7 +296,7 @@ async def get_properties( resource_group_name: str, account_name: str, expand: Optional[str] = "geoReplicationStats", - **kwargs + **kwargs: Any ) -> "_models.StorageAccount": """Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage @@ -365,7 +365,7 @@ async def update( resource_group_name: str, account_name: str, parameters: "_models.StorageAccountUpdateParameters", - **kwargs + **kwargs: Any ) -> "_models.StorageAccount": """The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also be used to map the account to a custom domain. Only one custom @@ -438,7 +438,7 @@ async def update( def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.StorageAccountListResult"]: """Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. @@ -506,7 +506,7 @@ async def get_next(next_link=None): def list_by_resource_group( self, resource_group_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.StorageAccountListResult"]: """Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this. @@ -579,7 +579,7 @@ async def list_keys( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.StorageAccountListKeysResult": """Lists the access keys for the specified storage account. @@ -641,7 +641,7 @@ async def regenerate_key( resource_group_name: str, account_name: str, regenerate_key: "_models.StorageAccountRegenerateKeyParameters", - **kwargs + **kwargs: Any ) -> "_models.StorageAccountListKeysResult": """Regenerates one of the access keys for the specified storage account. @@ -710,7 +710,7 @@ async def list_account_sas( resource_group_name: str, account_name: str, parameters: "_models.AccountSasParameters", - **kwargs + **kwargs: Any ) -> "_models.ListAccountSasResponse": """List SAS credentials of a storage account. @@ -779,7 +779,7 @@ async def list_service_sas( resource_group_name: str, account_name: str, parameters: "_models.ServiceSasParameters", - **kwargs + **kwargs: Any ) -> "_models.ListServiceSasResponse": """List service SAS credentials of a specific resource. @@ -847,7 +847,7 @@ async def _failover_initial( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { @@ -889,7 +889,7 @@ async def begin_failover( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Failover request can be triggered for a storage account in case of availability issues. The failover occurs from the storage account's primary cluster to secondary cluster for RA-GRS @@ -904,8 +904,8 @@ async def begin_failover( :type account_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/operations/_usages_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/operations/_usages_operations.py index 1f067a6c2b6b..b6dc43fd9328 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/operations/_usages_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/aio/operations/_usages_operations.py @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list_by_location( self, location: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.UsageListResult"]: """Gets the current usage count and the limit for the resources of the location under the subscription. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/_models.py index b473b061bc91..ea1e6fc66306 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/_models.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/_models.py @@ -698,7 +698,7 @@ class Identity(msrest.serialization.Model): :vartype principal_id: str :ivar tenant_id: The tenant ID of resource. :vartype tenant_id: str - :ivar type: Required. The identity type. Default value: "SystemAssigned". + :ivar type: The identity type. Has constant value: "SystemAssigned". :vartype type: str """ @@ -821,20 +821,18 @@ def __init__( class IPRule(msrest.serialization.Model): """IP rule with specific IP or IP range in CIDR format. - Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. :type ip_address_or_range: str - :ivar action: The action of IP ACL rule. Default value: "Allow". - :vartype action: str + :param action: The action of IP ACL rule. The only acceptable values to pass in are None and + "Allow". The default value is None. + :type action: str """ _validation = { 'ip_address_or_range': {'required': True}, - 'action': {'constant': True}, } _attribute_map = { @@ -842,14 +840,13 @@ class IPRule(msrest.serialization.Model): 'action': {'key': 'action', 'type': 'str'}, } - action = "Allow" - def __init__( self, **kwargs ): super(IPRule, self).__init__(**kwargs) self.ip_address_or_range = kwargs['ip_address_or_range'] + self.action = kwargs.get('action', None) class KeyVaultProperties(msrest.serialization.Model): @@ -1186,11 +1183,11 @@ class ManagementPoliciesRules(msrest.serialization.Model): :param policy: The Storage Account ManagementPolicies Rules, in JSON format. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - :type policy: str + :type policy: any """ _attribute_map = { - 'policy': {'key': 'policy', 'type': 'str'}, + 'policy': {'key': 'policy', 'type': 'object'}, } def __init__( @@ -1206,11 +1203,11 @@ class ManagementPoliciesRulesSetParameter(msrest.serialization.Model): :param policy: The Storage Account ManagementPolicies Rules, in JSON format. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - :type policy: str + :type policy: any """ _attribute_map = { - 'policy': {'key': 'properties.policy', 'type': 'str'}, + 'policy': {'key': 'properties.policy', 'type': 'object'}, } def __init__( @@ -1861,7 +1858,7 @@ class StorageAccountCheckNameAvailabilityParameters(msrest.serialization.Model): :param name: Required. The storage account name. :type name: str - :ivar type: Required. The type of resource, Microsoft.Storage/storageAccounts. Default value: + :ivar type: The type of resource, Microsoft.Storage/storageAccounts. Has constant value: "Microsoft.Storage/storageAccounts". :vartype type: str """ @@ -2071,7 +2068,7 @@ class StorageAccountManagementPolicies(Resource): :vartype type: str :param policy: The Storage Account ManagementPolicies Rules, in JSON format. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - :type policy: str + :type policy: any :ivar last_modified_time: Returns the date and time the ManagementPolicies was last modified. :vartype last_modified_time: ~datetime.datetime """ @@ -2087,7 +2084,7 @@ class StorageAccountManagementPolicies(Resource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'policy': {'key': 'properties.policy', 'type': 'str'}, + 'policy': {'key': 'properties.policy', 'type': 'object'}, 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, } @@ -2107,7 +2104,7 @@ class StorageAccountManagementPoliciesRulesProperty(ManagementPoliciesRules): :param policy: The Storage Account ManagementPolicies Rules, in JSON format. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - :type policy: str + :type policy: any :ivar last_modified_time: Returns the date and time the ManagementPolicies was last modified. :vartype last_modified_time: ~datetime.datetime """ @@ -2117,7 +2114,7 @@ class StorageAccountManagementPoliciesRulesProperty(ManagementPoliciesRules): } _attribute_map = { - 'policy': {'key': 'policy', 'type': 'str'}, + 'policy': {'key': 'policy', 'type': 'object'}, 'last_modified_time': {'key': 'lastModifiedTime', 'type': 'iso-8601'}, } @@ -2438,15 +2435,14 @@ def __init__( class VirtualNetworkRule(msrest.serialization.Model): """Virtual Network rule. - Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. :param virtual_network_resource_id: Required. Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. :type virtual_network_resource_id: str - :ivar action: The action of virtual network rule. Default value: "Allow". - :vartype action: str + :param action: The action of virtual network rule. The only acceptable values to pass in are + None and "Allow". The default value is None. + :type action: str :param state: Gets the state of virtual network rule. Possible values include: "provisioning", "deprovisioning", "succeeded", "failed", "networkSourceDeleted". :type state: str or ~azure.mgmt.storage.v2018_07_01.models.State @@ -2454,7 +2450,6 @@ class VirtualNetworkRule(msrest.serialization.Model): _validation = { 'virtual_network_resource_id': {'required': True}, - 'action': {'constant': True}, } _attribute_map = { @@ -2463,12 +2458,11 @@ class VirtualNetworkRule(msrest.serialization.Model): 'state': {'key': 'state', 'type': 'str'}, } - action = "Allow" - def __init__( self, **kwargs ): super(VirtualNetworkRule, self).__init__(**kwargs) self.virtual_network_resource_id = kwargs['virtual_network_resource_id'] + self.action = kwargs.get('action', None) self.state = kwargs.get('state', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/_models_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/_models_py3.py index 23c38e1f31f8..6131ef6b9580 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/_models_py3.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/_models_py3.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- import datetime -from typing import Dict, List, Optional, Union +from typing import Any, Dict, List, Optional, Union import msrest.serialization @@ -745,7 +745,7 @@ class Identity(msrest.serialization.Model): :vartype principal_id: str :ivar tenant_id: The tenant ID of resource. :vartype tenant_id: str - :ivar type: Required. The identity type. Default value: "SystemAssigned". + :ivar type: The identity type. Has constant value: "SystemAssigned". :vartype type: str """ @@ -872,20 +872,18 @@ def __init__( class IPRule(msrest.serialization.Model): """IP rule with specific IP or IP range in CIDR format. - Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. :type ip_address_or_range: str - :ivar action: The action of IP ACL rule. Default value: "Allow". - :vartype action: str + :param action: The action of IP ACL rule. The only acceptable values to pass in are None and + "Allow". The default value is None. + :type action: str """ _validation = { 'ip_address_or_range': {'required': True}, - 'action': {'constant': True}, } _attribute_map = { @@ -893,16 +891,16 @@ class IPRule(msrest.serialization.Model): 'action': {'key': 'action', 'type': 'str'}, } - action = "Allow" - def __init__( self, *, ip_address_or_range: str, + action: Optional[str] = None, **kwargs ): super(IPRule, self).__init__(**kwargs) self.ip_address_or_range = ip_address_or_range + self.action = action class KeyVaultProperties(msrest.serialization.Model): @@ -1261,17 +1259,17 @@ class ManagementPoliciesRules(msrest.serialization.Model): :param policy: The Storage Account ManagementPolicies Rules, in JSON format. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - :type policy: str + :type policy: any """ _attribute_map = { - 'policy': {'key': 'policy', 'type': 'str'}, + 'policy': {'key': 'policy', 'type': 'object'}, } def __init__( self, *, - policy: Optional[str] = None, + policy: Optional[Any] = None, **kwargs ): super(ManagementPoliciesRules, self).__init__(**kwargs) @@ -1283,17 +1281,17 @@ class ManagementPoliciesRulesSetParameter(msrest.serialization.Model): :param policy: The Storage Account ManagementPolicies Rules, in JSON format. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - :type policy: str + :type policy: any """ _attribute_map = { - 'policy': {'key': 'properties.policy', 'type': 'str'}, + 'policy': {'key': 'properties.policy', 'type': 'object'}, } def __init__( self, *, - policy: Optional[str] = None, + policy: Optional[Any] = None, **kwargs ): super(ManagementPoliciesRulesSetParameter, self).__init__(**kwargs) @@ -2003,7 +2001,7 @@ class StorageAccountCheckNameAvailabilityParameters(msrest.serialization.Model): :param name: Required. The storage account name. :type name: str - :ivar type: Required. The type of resource, Microsoft.Storage/storageAccounts. Default value: + :ivar type: The type of resource, Microsoft.Storage/storageAccounts. Has constant value: "Microsoft.Storage/storageAccounts". :vartype type: str """ @@ -2228,7 +2226,7 @@ class StorageAccountManagementPolicies(Resource): :vartype type: str :param policy: The Storage Account ManagementPolicies Rules, in JSON format. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - :type policy: str + :type policy: any :ivar last_modified_time: Returns the date and time the ManagementPolicies was last modified. :vartype last_modified_time: ~datetime.datetime """ @@ -2244,14 +2242,14 @@ class StorageAccountManagementPolicies(Resource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'policy': {'key': 'properties.policy', 'type': 'str'}, + 'policy': {'key': 'properties.policy', 'type': 'object'}, 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, } def __init__( self, *, - policy: Optional[str] = None, + policy: Optional[Any] = None, **kwargs ): super(StorageAccountManagementPolicies, self).__init__(**kwargs) @@ -2266,7 +2264,7 @@ class StorageAccountManagementPoliciesRulesProperty(ManagementPoliciesRules): :param policy: The Storage Account ManagementPolicies Rules, in JSON format. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - :type policy: str + :type policy: any :ivar last_modified_time: Returns the date and time the ManagementPolicies was last modified. :vartype last_modified_time: ~datetime.datetime """ @@ -2276,14 +2274,14 @@ class StorageAccountManagementPoliciesRulesProperty(ManagementPoliciesRules): } _attribute_map = { - 'policy': {'key': 'policy', 'type': 'str'}, + 'policy': {'key': 'policy', 'type': 'object'}, 'last_modified_time': {'key': 'lastModifiedTime', 'type': 'iso-8601'}, } def __init__( self, *, - policy: Optional[str] = None, + policy: Optional[Any] = None, **kwargs ): super(StorageAccountManagementPoliciesRulesProperty, self).__init__(policy=policy, **kwargs) @@ -2614,15 +2612,14 @@ def __init__( class VirtualNetworkRule(msrest.serialization.Model): """Virtual Network rule. - Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. :param virtual_network_resource_id: Required. Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. :type virtual_network_resource_id: str - :ivar action: The action of virtual network rule. Default value: "Allow". - :vartype action: str + :param action: The action of virtual network rule. The only acceptable values to pass in are + None and "Allow". The default value is None. + :type action: str :param state: Gets the state of virtual network rule. Possible values include: "provisioning", "deprovisioning", "succeeded", "failed", "networkSourceDeleted". :type state: str or ~azure.mgmt.storage.v2018_07_01.models.State @@ -2630,7 +2627,6 @@ class VirtualNetworkRule(msrest.serialization.Model): _validation = { 'virtual_network_resource_id': {'required': True}, - 'action': {'constant': True}, } _attribute_map = { @@ -2639,15 +2635,15 @@ class VirtualNetworkRule(msrest.serialization.Model): 'state': {'key': 'state', 'type': 'str'}, } - action = "Allow" - def __init__( self, *, virtual_network_resource_id: str, + action: Optional[str] = None, state: Optional[Union[str, "State"]] = None, **kwargs ): super(VirtualNetworkRule, self).__init__(**kwargs) self.virtual_network_resource_id = virtual_network_resource_id + self.action = action self.state = state diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/_storage_accounts_operations.py index 077665035d98..d0027934c406 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/_storage_accounts_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/operations/_storage_accounts_operations.py @@ -188,8 +188,8 @@ def begin_create( :type parameters: ~azure.mgmt.storage.v2018_07_01.models.StorageAccountCreateParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either StorageAccount or the result of cls(response) @@ -922,8 +922,8 @@ def begin_failover( :type account_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/_version.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/_version.py index 8dae91701610..232662316d4d 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/_version.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "18.0.0" +VERSION = "19.0.0" diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/operations/_blob_containers_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/operations/_blob_containers_operations.py index 9cff9d8acdb4..1940f65d2bea 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/operations/_blob_containers_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/operations/_blob_containers_operations.py @@ -44,7 +44,7 @@ async def list( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.ListContainerItems": """Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. @@ -108,7 +108,7 @@ async def create( account_name: str, container_name: str, blob_container: "_models.BlobContainer", - **kwargs + **kwargs: Any ) -> "_models.BlobContainer": """Creates a new container under the specified account as described by request body. The container resource includes metadata and properties for that container. It does not include a list of the @@ -190,7 +190,7 @@ async def update( account_name: str, container_name: str, blob_container: "_models.BlobContainer", - **kwargs + **kwargs: Any ) -> "_models.BlobContainer": """Updates container properties as specified in request body. Properties not mentioned in the request will be unchanged. Update fails if the specified container doesn't already exist. @@ -266,7 +266,7 @@ async def get( resource_group_name: str, account_name: str, container_name: str, - **kwargs + **kwargs: Any ) -> "_models.BlobContainer": """Gets properties of a specified container. @@ -334,7 +334,7 @@ async def delete( resource_group_name: str, account_name: str, container_name: str, - **kwargs + **kwargs: Any ) -> None: """Deletes specified container under its account. @@ -398,7 +398,7 @@ async def set_legal_hold( account_name: str, container_name: str, legal_hold: "_models.LegalHold", - **kwargs + **kwargs: Any ) -> "_models.LegalHold": """Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append pattern and does not clear out the existing tags that are not specified in @@ -476,7 +476,7 @@ async def clear_legal_hold( account_name: str, container_name: str, legal_hold: "_models.LegalHold", - **kwargs + **kwargs: Any ) -> "_models.LegalHold": """Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold clears out only the specified tags in the request. @@ -554,7 +554,7 @@ async def create_or_update_immutability_policy( container_name: str, if_match: Optional[str] = None, parameters: Optional["_models.ImmutabilityPolicy"] = None, - **kwargs + **kwargs: Any ) -> "_models.ImmutabilityPolicy": """Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for this operation. @@ -645,7 +645,7 @@ async def get_immutability_policy( account_name: str, container_name: str, if_match: Optional[str] = None, - **kwargs + **kwargs: Any ) -> "_models.ImmutabilityPolicy": """Gets the existing immutability policy along with the corresponding ETag in response headers and body. @@ -725,7 +725,7 @@ async def delete_immutability_policy( account_name: str, container_name: str, if_match: str, - **kwargs + **kwargs: Any ) -> "_models.ImmutabilityPolicy": """Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is required for this @@ -806,7 +806,7 @@ async def lock_immutability_policy( account_name: str, container_name: str, if_match: str, - **kwargs + **kwargs: Any ) -> "_models.ImmutabilityPolicy": """Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. @@ -884,7 +884,7 @@ async def extend_immutability_policy( container_name: str, if_match: str, parameters: Optional["_models.ImmutabilityPolicy"] = None, - **kwargs + **kwargs: Any ) -> "_models.ImmutabilityPolicy": """Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a Locked policy will be this action. ETag in If-Match is required for this @@ -973,7 +973,7 @@ async def lease( account_name: str, container_name: str, parameters: Optional["_models.LeaseContainerRequest"] = None, - **kwargs + **kwargs: Any ) -> "_models.LeaseContainerResponse": """The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/operations/_blob_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/operations/_blob_services_operations.py index 42c05e27fbd6..7562fad33ec9 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/operations/_blob_services_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/operations/_blob_services_operations.py @@ -45,7 +45,7 @@ async def set_service_properties( resource_group_name: str, account_name: str, parameters: "_models.BlobServiceProperties", - **kwargs + **kwargs: Any ) -> "_models.BlobServiceProperties": """Sets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. @@ -117,7 +117,7 @@ async def get_service_properties( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.BlobServiceProperties": """Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/operations/_management_policies_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/operations/_management_policies_operations.py index 4cbf3f9ed304..b06335bcadfc 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/operations/_management_policies_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/operations/_management_policies_operations.py @@ -45,7 +45,7 @@ async def get( resource_group_name: str, account_name: str, management_policy_name: Union[str, "_models.ManagementPolicyName"], - **kwargs + **kwargs: Any ) -> "_models.ManagementPolicy": """Gets the managementpolicy associated with the specified storage account. @@ -112,7 +112,7 @@ async def create_or_update( account_name: str, management_policy_name: Union[str, "_models.ManagementPolicyName"], properties: "_models.ManagementPolicy", - **kwargs + **kwargs: Any ) -> "_models.ManagementPolicy": """Sets the managementpolicy to the specified storage account. @@ -185,7 +185,7 @@ async def delete( resource_group_name: str, account_name: str, management_policy_name: Union[str, "_models.ManagementPolicyName"], - **kwargs + **kwargs: Any ) -> None: """Deletes the managementpolicy associated with the specified storage account. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/operations/_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/operations/_operations.py index 6c5ccf3719f3..7ddde1f8e9e9 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/operations/_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/operations/_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available Storage Rest API operations. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/operations/_skus_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/operations/_skus_operations.py index 56e3ff52482f..157f14924a9d 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/operations/_skus_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/operations/_skus_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.StorageSkuListResult"]: """Lists the available SKUs supported by Microsoft.Storage for given subscription. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/operations/_storage_accounts_operations.py index d55200170f3c..6db372da1d6d 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/operations/_storage_accounts_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/operations/_storage_accounts_operations.py @@ -46,7 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def check_name_availability( self, account_name: "_models.StorageAccountCheckNameAvailabilityParameters", - **kwargs + **kwargs: Any ) -> "_models.CheckNameAvailabilityResult": """Checks that the storage account name is valid and is not already in use. @@ -108,7 +108,7 @@ async def _create_initial( resource_group_name: str, account_name: str, parameters: "_models.StorageAccountCreateParameters", - **kwargs + **kwargs: Any ) -> Optional["_models.StorageAccount"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StorageAccount"]] error_map = { @@ -163,7 +163,7 @@ async def begin_create( resource_group_name: str, account_name: str, parameters: "_models.StorageAccountCreateParameters", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.StorageAccount"]: """Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the @@ -181,8 +181,8 @@ async def begin_create( :type parameters: ~azure.mgmt.storage.v2018_11_01.models.StorageAccountCreateParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either StorageAccount or the result of cls(response) @@ -239,7 +239,7 @@ async def delete( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> None: """Deletes a storage account in Microsoft Azure. @@ -296,7 +296,7 @@ async def get_properties( resource_group_name: str, account_name: str, expand: Optional[str] = "geoReplicationStats", - **kwargs + **kwargs: Any ) -> "_models.StorageAccount": """Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage @@ -365,7 +365,7 @@ async def update( resource_group_name: str, account_name: str, parameters: "_models.StorageAccountUpdateParameters", - **kwargs + **kwargs: Any ) -> "_models.StorageAccount": """The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also be used to map the account to a custom domain. Only one custom @@ -438,7 +438,7 @@ async def update( def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.StorageAccountListResult"]: """Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. @@ -506,7 +506,7 @@ async def get_next(next_link=None): def list_by_resource_group( self, resource_group_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.StorageAccountListResult"]: """Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this. @@ -579,7 +579,7 @@ async def list_keys( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.StorageAccountListKeysResult": """Lists the access keys for the specified storage account. @@ -641,7 +641,7 @@ async def regenerate_key( resource_group_name: str, account_name: str, regenerate_key: "_models.StorageAccountRegenerateKeyParameters", - **kwargs + **kwargs: Any ) -> "_models.StorageAccountListKeysResult": """Regenerates one of the access keys for the specified storage account. @@ -710,7 +710,7 @@ async def list_account_sas( resource_group_name: str, account_name: str, parameters: "_models.AccountSasParameters", - **kwargs + **kwargs: Any ) -> "_models.ListAccountSasResponse": """List SAS credentials of a storage account. @@ -779,7 +779,7 @@ async def list_service_sas( resource_group_name: str, account_name: str, parameters: "_models.ServiceSasParameters", - **kwargs + **kwargs: Any ) -> "_models.ListServiceSasResponse": """List service SAS credentials of a specific resource. @@ -847,7 +847,7 @@ async def _failover_initial( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { @@ -889,7 +889,7 @@ async def begin_failover( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Failover request can be triggered for a storage account in case of availability issues. The failover occurs from the storage account's primary cluster to secondary cluster for RA-GRS @@ -904,8 +904,8 @@ async def begin_failover( :type account_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) @@ -958,7 +958,7 @@ async def revoke_user_delegation_keys( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> None: """Revoke user delegation keys. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/operations/_usages_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/operations/_usages_operations.py index 615ca2cde4c4..f5f99b4e06cf 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/operations/_usages_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/aio/operations/_usages_operations.py @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list_by_location( self, location: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.UsageListResult"]: """Gets the current usage count and the limit for the resources of the location under the subscription. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/_models.py index 27f9ab99baa6..f85be8e03a01 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/_models.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/_models.py @@ -750,7 +750,7 @@ class Identity(msrest.serialization.Model): :vartype principal_id: str :ivar tenant_id: The tenant ID of resource. :vartype tenant_id: str - :ivar type: Required. The identity type. Default value: "SystemAssigned". + :ivar type: The identity type. Has constant value: "SystemAssigned". :vartype type: str """ @@ -873,20 +873,18 @@ def __init__( class IPRule(msrest.serialization.Model): """IP rule with specific IP or IP range in CIDR format. - Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. :type ip_address_or_range: str - :ivar action: The action of IP ACL rule. Default value: "Allow". - :vartype action: str + :param action: The action of IP ACL rule. The only acceptable values to pass in are None and + "Allow". The default value is None. + :type action: str """ _validation = { 'ip_address_or_range': {'required': True}, - 'action': {'constant': True}, } _attribute_map = { @@ -894,14 +892,13 @@ class IPRule(msrest.serialization.Model): 'action': {'key': 'action', 'type': 'str'}, } - action = "Allow" - def __init__( self, **kwargs ): super(IPRule, self).__init__(**kwargs) self.ip_address_or_range = kwargs['ip_address_or_range'] + self.action = kwargs.get('action', None) class KeyVaultProperties(msrest.serialization.Model): @@ -2112,7 +2109,7 @@ class StorageAccountCheckNameAvailabilityParameters(msrest.serialization.Model): :param name: Required. The storage account name. :type name: str - :ivar type: Required. The type of resource, Microsoft.Storage/storageAccounts. Default value: + :ivar type: The type of resource, Microsoft.Storage/storageAccounts. Has constant value: "Microsoft.Storage/storageAccounts". :vartype type: str """ @@ -2616,15 +2613,14 @@ def __init__( class VirtualNetworkRule(msrest.serialization.Model): """Virtual Network rule. - Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. :param virtual_network_resource_id: Required. Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. :type virtual_network_resource_id: str - :ivar action: The action of virtual network rule. Default value: "Allow". - :vartype action: str + :param action: The action of virtual network rule. The only acceptable values to pass in are + None and "Allow". The default value is None. + :type action: str :param state: Gets the state of virtual network rule. Possible values include: "provisioning", "deprovisioning", "succeeded", "failed", "networkSourceDeleted". :type state: str or ~azure.mgmt.storage.v2018_11_01.models.State @@ -2632,7 +2628,6 @@ class VirtualNetworkRule(msrest.serialization.Model): _validation = { 'virtual_network_resource_id': {'required': True}, - 'action': {'constant': True}, } _attribute_map = { @@ -2641,12 +2636,11 @@ class VirtualNetworkRule(msrest.serialization.Model): 'state': {'key': 'state', 'type': 'str'}, } - action = "Allow" - def __init__( self, **kwargs ): super(VirtualNetworkRule, self).__init__(**kwargs) self.virtual_network_resource_id = kwargs['virtual_network_resource_id'] + self.action = kwargs.get('action', None) self.state = kwargs.get('state', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/_models_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/_models_py3.py index feb844b3dad7..bf89657db351 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/_models_py3.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/models/_models_py3.py @@ -801,7 +801,7 @@ class Identity(msrest.serialization.Model): :vartype principal_id: str :ivar tenant_id: The tenant ID of resource. :vartype tenant_id: str - :ivar type: Required. The identity type. Default value: "SystemAssigned". + :ivar type: The identity type. Has constant value: "SystemAssigned". :vartype type: str """ @@ -928,20 +928,18 @@ def __init__( class IPRule(msrest.serialization.Model): """IP rule with specific IP or IP range in CIDR format. - Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. :type ip_address_or_range: str - :ivar action: The action of IP ACL rule. Default value: "Allow". - :vartype action: str + :param action: The action of IP ACL rule. The only acceptable values to pass in are None and + "Allow". The default value is None. + :type action: str """ _validation = { 'ip_address_or_range': {'required': True}, - 'action': {'constant': True}, } _attribute_map = { @@ -949,16 +947,16 @@ class IPRule(msrest.serialization.Model): 'action': {'key': 'action', 'type': 'str'}, } - action = "Allow" - def __init__( self, *, ip_address_or_range: str, + action: Optional[str] = None, **kwargs ): super(IPRule, self).__init__(**kwargs) self.ip_address_or_range = ip_address_or_range + self.action = action class KeyVaultProperties(msrest.serialization.Model): @@ -2278,7 +2276,7 @@ class StorageAccountCheckNameAvailabilityParameters(msrest.serialization.Model): :param name: Required. The storage account name. :type name: str - :ivar type: Required. The type of resource, Microsoft.Storage/storageAccounts. Default value: + :ivar type: The type of resource, Microsoft.Storage/storageAccounts. Has constant value: "Microsoft.Storage/storageAccounts". :vartype type: str """ @@ -2812,15 +2810,14 @@ def __init__( class VirtualNetworkRule(msrest.serialization.Model): """Virtual Network rule. - Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. :param virtual_network_resource_id: Required. Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. :type virtual_network_resource_id: str - :ivar action: The action of virtual network rule. Default value: "Allow". - :vartype action: str + :param action: The action of virtual network rule. The only acceptable values to pass in are + None and "Allow". The default value is None. + :type action: str :param state: Gets the state of virtual network rule. Possible values include: "provisioning", "deprovisioning", "succeeded", "failed", "networkSourceDeleted". :type state: str or ~azure.mgmt.storage.v2018_11_01.models.State @@ -2828,7 +2825,6 @@ class VirtualNetworkRule(msrest.serialization.Model): _validation = { 'virtual_network_resource_id': {'required': True}, - 'action': {'constant': True}, } _attribute_map = { @@ -2837,15 +2833,15 @@ class VirtualNetworkRule(msrest.serialization.Model): 'state': {'key': 'state', 'type': 'str'}, } - action = "Allow" - def __init__( self, *, virtual_network_resource_id: str, + action: Optional[str] = None, state: Optional[Union[str, "State"]] = None, **kwargs ): super(VirtualNetworkRule, self).__init__(**kwargs) self.virtual_network_resource_id = virtual_network_resource_id + self.action = action self.state = state diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/_storage_accounts_operations.py index c57e491ea44a..a4ec5619f98f 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/_storage_accounts_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2018_11_01/operations/_storage_accounts_operations.py @@ -188,8 +188,8 @@ def begin_create( :type parameters: ~azure.mgmt.storage.v2018_11_01.models.StorageAccountCreateParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either StorageAccount or the result of cls(response) @@ -922,8 +922,8 @@ def begin_failover( :type account_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/_version.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/_version.py index 8dae91701610..232662316d4d 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/_version.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "18.0.0" +VERSION = "19.0.0" diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_blob_containers_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_blob_containers_operations.py index f18a9bf8db40..8e2b43d5b6a9 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_blob_containers_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_blob_containers_operations.py @@ -48,7 +48,7 @@ def list( skip_token: Optional[str] = None, maxpagesize: Optional[str] = None, filter: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ListContainerItems"]: """Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. @@ -142,7 +142,7 @@ async def create( account_name: str, container_name: str, blob_container: "_models.BlobContainer", - **kwargs + **kwargs: Any ) -> "_models.BlobContainer": """Creates a new container under the specified account as described by request body. The container resource includes metadata and properties for that container. It does not include a list of the @@ -224,7 +224,7 @@ async def update( account_name: str, container_name: str, blob_container: "_models.BlobContainer", - **kwargs + **kwargs: Any ) -> "_models.BlobContainer": """Updates container properties as specified in request body. Properties not mentioned in the request will be unchanged. Update fails if the specified container doesn't already exist. @@ -300,7 +300,7 @@ async def get( resource_group_name: str, account_name: str, container_name: str, - **kwargs + **kwargs: Any ) -> "_models.BlobContainer": """Gets properties of a specified container. @@ -368,7 +368,7 @@ async def delete( resource_group_name: str, account_name: str, container_name: str, - **kwargs + **kwargs: Any ) -> None: """Deletes specified container under its account. @@ -432,7 +432,7 @@ async def set_legal_hold( account_name: str, container_name: str, legal_hold: "_models.LegalHold", - **kwargs + **kwargs: Any ) -> "_models.LegalHold": """Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append pattern and does not clear out the existing tags that are not specified in @@ -510,7 +510,7 @@ async def clear_legal_hold( account_name: str, container_name: str, legal_hold: "_models.LegalHold", - **kwargs + **kwargs: Any ) -> "_models.LegalHold": """Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold clears out only the specified tags in the request. @@ -588,7 +588,7 @@ async def create_or_update_immutability_policy( container_name: str, if_match: Optional[str] = None, parameters: Optional["_models.ImmutabilityPolicy"] = None, - **kwargs + **kwargs: Any ) -> "_models.ImmutabilityPolicy": """Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for this operation. @@ -679,7 +679,7 @@ async def get_immutability_policy( account_name: str, container_name: str, if_match: Optional[str] = None, - **kwargs + **kwargs: Any ) -> "_models.ImmutabilityPolicy": """Gets the existing immutability policy along with the corresponding ETag in response headers and body. @@ -759,7 +759,7 @@ async def delete_immutability_policy( account_name: str, container_name: str, if_match: str, - **kwargs + **kwargs: Any ) -> "_models.ImmutabilityPolicy": """Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is required for this @@ -840,7 +840,7 @@ async def lock_immutability_policy( account_name: str, container_name: str, if_match: str, - **kwargs + **kwargs: Any ) -> "_models.ImmutabilityPolicy": """Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. @@ -918,7 +918,7 @@ async def extend_immutability_policy( container_name: str, if_match: str, parameters: Optional["_models.ImmutabilityPolicy"] = None, - **kwargs + **kwargs: Any ) -> "_models.ImmutabilityPolicy": """Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a Locked policy will be this action. ETag in If-Match is required for this @@ -1007,7 +1007,7 @@ async def lease( account_name: str, container_name: str, parameters: Optional["_models.LeaseContainerRequest"] = None, - **kwargs + **kwargs: Any ) -> "_models.LeaseContainerResponse": """The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_blob_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_blob_services_operations.py index 0b83f49e20a7..96d7966352d6 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_blob_services_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_blob_services_operations.py @@ -45,7 +45,7 @@ def list( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.BlobServiceItems"]: """List blob services of storage account. It returns a collection of one object named default. @@ -123,7 +123,7 @@ async def set_service_properties( resource_group_name: str, account_name: str, parameters: "_models.BlobServiceProperties", - **kwargs + **kwargs: Any ) -> "_models.BlobServiceProperties": """Sets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. @@ -195,7 +195,7 @@ async def get_service_properties( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.BlobServiceProperties": """Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_file_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_file_services_operations.py index 273ed725bbf0..b7aaf2ea2584 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_file_services_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_file_services_operations.py @@ -44,7 +44,7 @@ async def list( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.FileServiceItems": """List all file services in storage accounts. @@ -106,7 +106,7 @@ async def set_service_properties( resource_group_name: str, account_name: str, parameters: "_models.FileServiceProperties", - **kwargs + **kwargs: Any ) -> "_models.FileServiceProperties": """Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. @@ -178,7 +178,7 @@ async def get_service_properties( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.FileServiceProperties": """Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_file_shares_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_file_shares_operations.py index 0bb360c3a307..0e341fb080e8 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_file_shares_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_file_shares_operations.py @@ -48,7 +48,7 @@ def list( skip_token: Optional[str] = None, maxpagesize: Optional[str] = None, filter: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.FileShareItems"]: """Lists all shares. @@ -141,7 +141,7 @@ async def create( account_name: str, share_name: str, file_share: "_models.FileShare", - **kwargs + **kwargs: Any ) -> "_models.FileShare": """Creates a new share under the specified account as described by request body. The share resource includes metadata and properties for that share. It does not include a list of the @@ -223,7 +223,7 @@ async def update( account_name: str, share_name: str, file_share: "_models.FileShare", - **kwargs + **kwargs: Any ) -> "_models.FileShare": """Updates share properties as specified in request body. Properties not mentioned in the request will not be changed. Update fails if the specified share does not already exist. @@ -299,7 +299,7 @@ async def get( resource_group_name: str, account_name: str, share_name: str, - **kwargs + **kwargs: Any ) -> "_models.FileShare": """Gets properties of a specified share. @@ -367,7 +367,7 @@ async def delete( resource_group_name: str, account_name: str, share_name: str, - **kwargs + **kwargs: Any ) -> None: """Deletes specified share under its account. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_management_policies_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_management_policies_operations.py index 5f4d0b075d8f..9589da58dbde 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_management_policies_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_management_policies_operations.py @@ -45,7 +45,7 @@ async def get( resource_group_name: str, account_name: str, management_policy_name: Union[str, "_models.ManagementPolicyName"], - **kwargs + **kwargs: Any ) -> "_models.ManagementPolicy": """Gets the managementpolicy associated with the specified storage account. @@ -112,7 +112,7 @@ async def create_or_update( account_name: str, management_policy_name: Union[str, "_models.ManagementPolicyName"], properties: "_models.ManagementPolicy", - **kwargs + **kwargs: Any ) -> "_models.ManagementPolicy": """Sets the managementpolicy to the specified storage account. @@ -185,7 +185,7 @@ async def delete( resource_group_name: str, account_name: str, management_policy_name: Union[str, "_models.ManagementPolicyName"], - **kwargs + **kwargs: Any ) -> None: """Deletes the managementpolicy associated with the specified storage account. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_operations.py index f5f819cd8278..03dfdc2e6bd9 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available Storage Rest API operations. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_skus_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_skus_operations.py index c43bad98990c..f9f5d92a97dc 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_skus_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_skus_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.StorageSkuListResult"]: """Lists the available SKUs supported by Microsoft.Storage for given subscription. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_storage_accounts_operations.py index 5d5785c037f1..b401f6df462d 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_storage_accounts_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_storage_accounts_operations.py @@ -46,7 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def check_name_availability( self, account_name: "_models.StorageAccountCheckNameAvailabilityParameters", - **kwargs + **kwargs: Any ) -> "_models.CheckNameAvailabilityResult": """Checks that the storage account name is valid and is not already in use. @@ -108,7 +108,7 @@ async def _create_initial( resource_group_name: str, account_name: str, parameters: "_models.StorageAccountCreateParameters", - **kwargs + **kwargs: Any ) -> Optional["_models.StorageAccount"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StorageAccount"]] error_map = { @@ -163,7 +163,7 @@ async def begin_create( resource_group_name: str, account_name: str, parameters: "_models.StorageAccountCreateParameters", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.StorageAccount"]: """Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the @@ -181,8 +181,8 @@ async def begin_create( :type parameters: ~azure.mgmt.storage.v2019_04_01.models.StorageAccountCreateParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either StorageAccount or the result of cls(response) @@ -239,7 +239,7 @@ async def delete( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> None: """Deletes a storage account in Microsoft Azure. @@ -296,7 +296,7 @@ async def get_properties( resource_group_name: str, account_name: str, expand: Optional[str] = "geoReplicationStats", - **kwargs + **kwargs: Any ) -> "_models.StorageAccount": """Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage @@ -365,7 +365,7 @@ async def update( resource_group_name: str, account_name: str, parameters: "_models.StorageAccountUpdateParameters", - **kwargs + **kwargs: Any ) -> "_models.StorageAccount": """The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also be used to map the account to a custom domain. Only one custom @@ -438,7 +438,7 @@ async def update( def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.StorageAccountListResult"]: """Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. @@ -506,7 +506,7 @@ async def get_next(next_link=None): def list_by_resource_group( self, resource_group_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.StorageAccountListResult"]: """Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this. @@ -580,7 +580,7 @@ async def list_keys( resource_group_name: str, account_name: str, expand: Optional[str] = "kerb", - **kwargs + **kwargs: Any ) -> "_models.StorageAccountListKeysResult": """Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. @@ -647,7 +647,7 @@ async def regenerate_key( resource_group_name: str, account_name: str, regenerate_key: "_models.StorageAccountRegenerateKeyParameters", - **kwargs + **kwargs: Any ) -> "_models.StorageAccountListKeysResult": """Regenerates one of the access keys or Kerberos keys for the specified storage account. @@ -717,7 +717,7 @@ async def list_account_sas( resource_group_name: str, account_name: str, parameters: "_models.AccountSasParameters", - **kwargs + **kwargs: Any ) -> "_models.ListAccountSasResponse": """List SAS credentials of a storage account. @@ -786,7 +786,7 @@ async def list_service_sas( resource_group_name: str, account_name: str, parameters: "_models.ServiceSasParameters", - **kwargs + **kwargs: Any ) -> "_models.ListServiceSasResponse": """List service SAS credentials of a specific resource. @@ -854,7 +854,7 @@ async def _failover_initial( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { @@ -896,7 +896,7 @@ async def begin_failover( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Failover request can be triggered for a storage account in case of availability issues. The failover occurs from the storage account's primary cluster to secondary cluster for RA-GRS @@ -911,8 +911,8 @@ async def begin_failover( :type account_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) @@ -965,7 +965,7 @@ async def revoke_user_delegation_keys( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> None: """Revoke user delegation keys. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_usages_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_usages_operations.py index 58d6fe413f70..f962a6c9f6f1 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_usages_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/aio/operations/_usages_operations.py @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list_by_location( self, location: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.UsageListResult"]: """Gets the current usage count and the limit for the resources of the location under the subscription. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models.py index f6c657b18dc4..e743f1ef8fcb 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models.py @@ -1121,7 +1121,7 @@ class Identity(msrest.serialization.Model): :vartype principal_id: str :ivar tenant_id: The tenant ID of resource. :vartype tenant_id: str - :ivar type: Required. The identity type. Default value: "SystemAssigned". + :ivar type: The identity type. Has constant value: "SystemAssigned". :vartype type: str """ @@ -1244,20 +1244,18 @@ def __init__( class IPRule(msrest.serialization.Model): """IP rule with specific IP or IP range in CIDR format. - Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. :type ip_address_or_range: str - :ivar action: The action of IP ACL rule. Default value: "Allow". - :vartype action: str + :param action: The action of IP ACL rule. The only acceptable values to pass in are None and + "Allow". The default value is None. + :type action: str """ _validation = { 'ip_address_or_range': {'required': True}, - 'action': {'constant': True}, } _attribute_map = { @@ -1265,14 +1263,13 @@ class IPRule(msrest.serialization.Model): 'action': {'key': 'action', 'type': 'str'}, } - action = "Allow" - def __init__( self, **kwargs ): super(IPRule, self).__init__(**kwargs) self.ip_address_or_range = kwargs['ip_address_or_range'] + self.action = kwargs.get('action', None) class KeyVaultProperties(msrest.serialization.Model): @@ -2521,7 +2518,7 @@ class StorageAccountCheckNameAvailabilityParameters(msrest.serialization.Model): :param name: Required. The storage account name. :type name: str - :ivar type: Required. The type of resource, Microsoft.Storage/storageAccounts. Default value: + :ivar type: The type of resource, Microsoft.Storage/storageAccounts. Has constant value: "Microsoft.Storage/storageAccounts". :vartype type: str """ @@ -3082,15 +3079,14 @@ def __init__( class VirtualNetworkRule(msrest.serialization.Model): """Virtual Network rule. - Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. :param virtual_network_resource_id: Required. Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. :type virtual_network_resource_id: str - :ivar action: The action of virtual network rule. Default value: "Allow". - :vartype action: str + :param action: The action of virtual network rule. The only acceptable values to pass in are + None and "Allow". The default value is None. + :type action: str :param state: Gets the state of virtual network rule. Possible values include: "provisioning", "deprovisioning", "succeeded", "failed", "networkSourceDeleted". :type state: str or ~azure.mgmt.storage.v2019_04_01.models.State @@ -3098,7 +3094,6 @@ class VirtualNetworkRule(msrest.serialization.Model): _validation = { 'virtual_network_resource_id': {'required': True}, - 'action': {'constant': True}, } _attribute_map = { @@ -3107,12 +3102,11 @@ class VirtualNetworkRule(msrest.serialization.Model): 'state': {'key': 'state', 'type': 'str'}, } - action = "Allow" - def __init__( self, **kwargs ): super(VirtualNetworkRule, self).__init__(**kwargs) self.virtual_network_resource_id = kwargs['virtual_network_resource_id'] + self.action = kwargs.get('action', None) self.state = kwargs.get('state', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models_py3.py index 331d44784ac8..e0f440f9de9a 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models_py3.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models_py3.py @@ -1199,7 +1199,7 @@ class Identity(msrest.serialization.Model): :vartype principal_id: str :ivar tenant_id: The tenant ID of resource. :vartype tenant_id: str - :ivar type: Required. The identity type. Default value: "SystemAssigned". + :ivar type: The identity type. Has constant value: "SystemAssigned". :vartype type: str """ @@ -1326,20 +1326,18 @@ def __init__( class IPRule(msrest.serialization.Model): """IP rule with specific IP or IP range in CIDR format. - Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. :type ip_address_or_range: str - :ivar action: The action of IP ACL rule. Default value: "Allow". - :vartype action: str + :param action: The action of IP ACL rule. The only acceptable values to pass in are None and + "Allow". The default value is None. + :type action: str """ _validation = { 'ip_address_or_range': {'required': True}, - 'action': {'constant': True}, } _attribute_map = { @@ -1347,16 +1345,16 @@ class IPRule(msrest.serialization.Model): 'action': {'key': 'action', 'type': 'str'}, } - action = "Allow" - def __init__( self, *, ip_address_or_range: str, + action: Optional[str] = None, **kwargs ): super(IPRule, self).__init__(**kwargs) self.ip_address_or_range = ip_address_or_range + self.action = action class KeyVaultProperties(msrest.serialization.Model): @@ -2716,7 +2714,7 @@ class StorageAccountCheckNameAvailabilityParameters(msrest.serialization.Model): :param name: Required. The storage account name. :type name: str - :ivar type: Required. The type of resource, Microsoft.Storage/storageAccounts. Default value: + :ivar type: The type of resource, Microsoft.Storage/storageAccounts. Has constant value: "Microsoft.Storage/storageAccounts". :vartype type: str """ @@ -3315,15 +3313,14 @@ def __init__( class VirtualNetworkRule(msrest.serialization.Model): """Virtual Network rule. - Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. :param virtual_network_resource_id: Required. Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. :type virtual_network_resource_id: str - :ivar action: The action of virtual network rule. Default value: "Allow". - :vartype action: str + :param action: The action of virtual network rule. The only acceptable values to pass in are + None and "Allow". The default value is None. + :type action: str :param state: Gets the state of virtual network rule. Possible values include: "provisioning", "deprovisioning", "succeeded", "failed", "networkSourceDeleted". :type state: str or ~azure.mgmt.storage.v2019_04_01.models.State @@ -3331,7 +3328,6 @@ class VirtualNetworkRule(msrest.serialization.Model): _validation = { 'virtual_network_resource_id': {'required': True}, - 'action': {'constant': True}, } _attribute_map = { @@ -3340,15 +3336,15 @@ class VirtualNetworkRule(msrest.serialization.Model): 'state': {'key': 'state', 'type': 'str'}, } - action = "Allow" - def __init__( self, *, virtual_network_resource_id: str, + action: Optional[str] = None, state: Optional[Union[str, "State"]] = None, **kwargs ): super(VirtualNetworkRule, self).__init__(**kwargs) self.virtual_network_resource_id = virtual_network_resource_id + self.action = action self.state = state diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_storage_accounts_operations.py index 74757f174982..952d60742c41 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_storage_accounts_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_storage_accounts_operations.py @@ -188,8 +188,8 @@ def begin_create( :type parameters: ~azure.mgmt.storage.v2019_04_01.models.StorageAccountCreateParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either StorageAccount or the result of cls(response) @@ -929,8 +929,8 @@ def begin_failover( :type account_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/_version.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/_version.py index 8dae91701610..232662316d4d 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/_version.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "18.0.0" +VERSION = "19.0.0" diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_blob_containers_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_blob_containers_operations.py index ae2224ec8fb2..9e80dd5aa03c 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_blob_containers_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_blob_containers_operations.py @@ -48,7 +48,7 @@ def list( maxpagesize: Optional[str] = None, filter: Optional[str] = None, include: Optional[Union[str, "_models.ListContainersInclude"]] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ListContainerItems"]: """Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. @@ -142,7 +142,7 @@ async def create( account_name: str, container_name: str, blob_container: "_models.BlobContainer", - **kwargs + **kwargs: Any ) -> "_models.BlobContainer": """Creates a new container under the specified account as described by request body. The container resource includes metadata and properties for that container. It does not include a list of the @@ -224,7 +224,7 @@ async def update( account_name: str, container_name: str, blob_container: "_models.BlobContainer", - **kwargs + **kwargs: Any ) -> "_models.BlobContainer": """Updates container properties as specified in request body. Properties not mentioned in the request will be unchanged. Update fails if the specified container doesn't already exist. @@ -300,7 +300,7 @@ async def get( resource_group_name: str, account_name: str, container_name: str, - **kwargs + **kwargs: Any ) -> "_models.BlobContainer": """Gets properties of a specified container. @@ -368,7 +368,7 @@ async def delete( resource_group_name: str, account_name: str, container_name: str, - **kwargs + **kwargs: Any ) -> None: """Deletes specified container under its account. @@ -432,7 +432,7 @@ async def set_legal_hold( account_name: str, container_name: str, legal_hold: "_models.LegalHold", - **kwargs + **kwargs: Any ) -> "_models.LegalHold": """Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append pattern and does not clear out the existing tags that are not specified in @@ -510,7 +510,7 @@ async def clear_legal_hold( account_name: str, container_name: str, legal_hold: "_models.LegalHold", - **kwargs + **kwargs: Any ) -> "_models.LegalHold": """Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold clears out only the specified tags in the request. @@ -588,7 +588,7 @@ async def create_or_update_immutability_policy( container_name: str, if_match: Optional[str] = None, parameters: Optional["_models.ImmutabilityPolicy"] = None, - **kwargs + **kwargs: Any ) -> "_models.ImmutabilityPolicy": """Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for this operation. @@ -679,7 +679,7 @@ async def get_immutability_policy( account_name: str, container_name: str, if_match: Optional[str] = None, - **kwargs + **kwargs: Any ) -> "_models.ImmutabilityPolicy": """Gets the existing immutability policy along with the corresponding ETag in response headers and body. @@ -759,7 +759,7 @@ async def delete_immutability_policy( account_name: str, container_name: str, if_match: str, - **kwargs + **kwargs: Any ) -> "_models.ImmutabilityPolicy": """Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is required for this @@ -840,7 +840,7 @@ async def lock_immutability_policy( account_name: str, container_name: str, if_match: str, - **kwargs + **kwargs: Any ) -> "_models.ImmutabilityPolicy": """Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. @@ -918,7 +918,7 @@ async def extend_immutability_policy( container_name: str, if_match: str, parameters: Optional["_models.ImmutabilityPolicy"] = None, - **kwargs + **kwargs: Any ) -> "_models.ImmutabilityPolicy": """Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a Locked policy will be this action. ETag in If-Match is required for this @@ -1007,7 +1007,7 @@ async def lease( account_name: str, container_name: str, parameters: Optional["_models.LeaseContainerRequest"] = None, - **kwargs + **kwargs: Any ) -> "_models.LeaseContainerResponse": """The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_blob_inventory_policies_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_blob_inventory_policies_operations.py index 2c722c1abda2..7fb117f12140 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_blob_inventory_policies_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_blob_inventory_policies_operations.py @@ -46,7 +46,7 @@ async def get( resource_group_name: str, account_name: str, blob_inventory_policy_name: Union[str, "_models.BlobInventoryPolicyName"], - **kwargs + **kwargs: Any ) -> "_models.BlobInventoryPolicy": """Gets the blob inventory policy associated with the specified storage account. @@ -114,7 +114,7 @@ async def create_or_update( account_name: str, blob_inventory_policy_name: Union[str, "_models.BlobInventoryPolicyName"], properties: "_models.BlobInventoryPolicy", - **kwargs + **kwargs: Any ) -> "_models.BlobInventoryPolicy": """Sets the blob inventory policy to the specified storage account. @@ -188,7 +188,7 @@ async def delete( resource_group_name: str, account_name: str, blob_inventory_policy_name: Union[str, "_models.BlobInventoryPolicyName"], - **kwargs + **kwargs: Any ) -> None: """Deletes the blob inventory policy associated with the specified storage account. @@ -251,7 +251,7 @@ def list( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ListBlobInventoryPolicy"]: """Gets the blob inventory policy associated with the specified storage account. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_blob_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_blob_services_operations.py index b58d04a492ba..39e0cc4125b0 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_blob_services_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_blob_services_operations.py @@ -45,7 +45,7 @@ def list( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.BlobServiceItems"]: """List blob services of storage account. It returns a collection of one object named default. @@ -123,7 +123,7 @@ async def set_service_properties( resource_group_name: str, account_name: str, parameters: "_models.BlobServiceProperties", - **kwargs + **kwargs: Any ) -> "_models.BlobServiceProperties": """Sets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. @@ -195,7 +195,7 @@ async def get_service_properties( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.BlobServiceProperties": """Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_encryption_scopes_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_encryption_scopes_operations.py index 4e93adce98bc..419100afefae 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_encryption_scopes_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_encryption_scopes_operations.py @@ -47,7 +47,7 @@ async def put( account_name: str, encryption_scope_name: str, encryption_scope: "_models.EncryptionScope", - **kwargs + **kwargs: Any ) -> "_models.EncryptionScope": """Synchronously creates or updates an encryption scope under the specified storage account. If an encryption scope is already created and a subsequent request is issued with different @@ -130,7 +130,7 @@ async def patch( account_name: str, encryption_scope_name: str, encryption_scope: "_models.EncryptionScope", - **kwargs + **kwargs: Any ) -> "_models.EncryptionScope": """Update encryption scope properties as specified in the request body. Update fails if the specified encryption scope does not already exist. @@ -207,7 +207,7 @@ async def get( resource_group_name: str, account_name: str, encryption_scope_name: str, - **kwargs + **kwargs: Any ) -> "_models.EncryptionScope": """Returns the properties for the specified encryption scope. @@ -275,7 +275,7 @@ def list( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.EncryptionScopeListResult"]: """Lists all the encryption scopes available under the specified storage account. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_file_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_file_services_operations.py index fcccd2fb523c..4c99ace8e42b 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_file_services_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_file_services_operations.py @@ -44,7 +44,7 @@ async def list( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.FileServiceItems": """List all file services in storage accounts. @@ -106,7 +106,7 @@ async def set_service_properties( resource_group_name: str, account_name: str, parameters: "_models.FileServiceProperties", - **kwargs + **kwargs: Any ) -> "_models.FileServiceProperties": """Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. @@ -178,7 +178,7 @@ async def get_service_properties( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.FileServiceProperties": """Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_file_shares_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_file_shares_operations.py index da14d994bd31..09a2512ba8db 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_file_shares_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_file_shares_operations.py @@ -48,7 +48,7 @@ def list( maxpagesize: Optional[str] = None, filter: Optional[str] = None, expand: Optional[str] = "deleted", - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.FileShareItems"]: """Lists all shares. @@ -141,7 +141,7 @@ async def create( account_name: str, share_name: str, file_share: "_models.FileShare", - **kwargs + **kwargs: Any ) -> "_models.FileShare": """Creates a new share under the specified account as described by request body. The share resource includes metadata and properties for that share. It does not include a list of the @@ -223,7 +223,7 @@ async def update( account_name: str, share_name: str, file_share: "_models.FileShare", - **kwargs + **kwargs: Any ) -> "_models.FileShare": """Updates share properties as specified in request body. Properties not mentioned in the request will not be changed. Update fails if the specified share does not already exist. @@ -300,7 +300,7 @@ async def get( account_name: str, share_name: str, expand: Optional[str] = "stats", - **kwargs + **kwargs: Any ) -> "_models.FileShare": """Gets properties of a specified share. @@ -372,7 +372,7 @@ async def delete( resource_group_name: str, account_name: str, share_name: str, - **kwargs + **kwargs: Any ) -> None: """Deletes specified share under its account. @@ -438,7 +438,7 @@ async def restore( account_name: str, share_name: str, deleted_share: "_models.DeletedShare", - **kwargs + **kwargs: Any ) -> None: """Restore a file share within a valid retention days if share soft delete is enabled. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_management_policies_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_management_policies_operations.py index 76b93db0d9ca..29066d82165c 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_management_policies_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_management_policies_operations.py @@ -45,7 +45,7 @@ async def get( resource_group_name: str, account_name: str, management_policy_name: Union[str, "_models.ManagementPolicyName"], - **kwargs + **kwargs: Any ) -> "_models.ManagementPolicy": """Gets the managementpolicy associated with the specified storage account. @@ -112,7 +112,7 @@ async def create_or_update( account_name: str, management_policy_name: Union[str, "_models.ManagementPolicyName"], properties: "_models.ManagementPolicy", - **kwargs + **kwargs: Any ) -> "_models.ManagementPolicy": """Sets the managementpolicy to the specified storage account. @@ -185,7 +185,7 @@ async def delete( resource_group_name: str, account_name: str, management_policy_name: Union[str, "_models.ManagementPolicyName"], - **kwargs + **kwargs: Any ) -> None: """Deletes the managementpolicy associated with the specified storage account. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_object_replication_policies_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_object_replication_policies_operations.py index 904076f962a9..f0293809a7f1 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_object_replication_policies_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_object_replication_policies_operations.py @@ -45,7 +45,7 @@ def list( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ObjectReplicationPolicies"]: """List the object replication policies associated with the storage account. @@ -124,7 +124,7 @@ async def get( resource_group_name: str, account_name: str, object_replication_policy_id: str, - **kwargs + **kwargs: Any ) -> "_models.ObjectReplicationPolicy": """Get the object replication policy of the storage account by policy ID. @@ -192,7 +192,7 @@ async def create_or_update( account_name: str, object_replication_policy_id: str, properties: "_models.ObjectReplicationPolicy", - **kwargs + **kwargs: Any ) -> "_models.ObjectReplicationPolicy": """Create or update the object replication policy of the storage account. @@ -267,7 +267,7 @@ async def delete( resource_group_name: str, account_name: str, object_replication_policy_id: str, - **kwargs + **kwargs: Any ) -> None: """Deletes the object replication policy associated with the specified storage account. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_operations.py index 415785e7ec76..299e369b90b8 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available Storage Rest API operations. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_private_endpoint_connections_operations.py index f28b04b22eba..7d02829dc493 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_private_endpoint_connections_operations.py @@ -45,7 +45,7 @@ def list( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.PrivateEndpointConnectionListResult"]: """List all the private endpoint connections associated with the storage account. @@ -123,7 +123,7 @@ async def get( resource_group_name: str, account_name: str, private_endpoint_connection_name: str, - **kwargs + **kwargs: Any ) -> "_models.PrivateEndpointConnection": """Gets the specified private endpoint connection associated with the storage account. @@ -191,7 +191,7 @@ async def put( account_name: str, private_endpoint_connection_name: str, properties: "_models.PrivateEndpointConnection", - **kwargs + **kwargs: Any ) -> "_models.PrivateEndpointConnection": """Update the state of specified private endpoint connection associated with the storage account. @@ -265,7 +265,7 @@ async def delete( resource_group_name: str, account_name: str, private_endpoint_connection_name: str, - **kwargs + **kwargs: Any ) -> None: """Deletes the specified private endpoint connection associated with the storage account. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_private_link_resources_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_private_link_resources_operations.py index 849c64c0421c..456ab602b2fe 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_private_link_resources_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_private_link_resources_operations.py @@ -44,7 +44,7 @@ async def list_by_storage_account( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.PrivateLinkResourceListResult": """Gets the private link resources that need to be created for a storage account. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_queue_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_queue_operations.py index c79d3c4eb5fc..f69485f03047 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_queue_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_queue_operations.py @@ -47,7 +47,7 @@ async def create( account_name: str, queue_name: str, queue: "_models.StorageQueue", - **kwargs + **kwargs: Any ) -> "_models.StorageQueue": """Creates a new queue with the specified queue name, under the specified account. @@ -123,7 +123,7 @@ async def update( account_name: str, queue_name: str, queue: "_models.StorageQueue", - **kwargs + **kwargs: Any ) -> "_models.StorageQueue": """Creates a new queue with the specified queue name, under the specified account. @@ -198,7 +198,7 @@ async def get( resource_group_name: str, account_name: str, queue_name: str, - **kwargs + **kwargs: Any ) -> "_models.StorageQueue": """Gets the queue with the specified queue name, under the specified account if it exists. @@ -266,7 +266,7 @@ async def delete( resource_group_name: str, account_name: str, queue_name: str, - **kwargs + **kwargs: Any ) -> None: """Deletes the queue with the specified queue name, under the specified account if it exists. @@ -332,7 +332,7 @@ def list( account_name: str, maxpagesize: Optional[str] = None, filter: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ListQueueResource"]: """Gets a list of all the queues under the specified storage account. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_queue_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_queue_services_operations.py index dc0b41e212f9..614648ded66c 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_queue_services_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_queue_services_operations.py @@ -44,7 +44,7 @@ async def list( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.ListQueueServices": """List all queue services for the storage account. @@ -106,7 +106,7 @@ async def set_service_properties( resource_group_name: str, account_name: str, parameters: "_models.QueueServiceProperties", - **kwargs + **kwargs: Any ) -> "_models.QueueServiceProperties": """Sets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. @@ -178,7 +178,7 @@ async def get_service_properties( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.QueueServiceProperties": """Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_skus_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_skus_operations.py index bc035d05d4e0..b83745e95012 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_skus_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_skus_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.StorageSkuListResult"]: """Lists the available SKUs supported by Microsoft.Storage for given subscription. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_storage_accounts_operations.py index 80ca6860d3d4..a4f8a87c0c7b 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_storage_accounts_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_storage_accounts_operations.py @@ -46,7 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def check_name_availability( self, account_name: "_models.StorageAccountCheckNameAvailabilityParameters", - **kwargs + **kwargs: Any ) -> "_models.CheckNameAvailabilityResult": """Checks that the storage account name is valid and is not already in use. @@ -108,7 +108,7 @@ async def _create_initial( resource_group_name: str, account_name: str, parameters: "_models.StorageAccountCreateParameters", - **kwargs + **kwargs: Any ) -> Optional["_models.StorageAccount"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StorageAccount"]] error_map = { @@ -163,7 +163,7 @@ async def begin_create( resource_group_name: str, account_name: str, parameters: "_models.StorageAccountCreateParameters", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.StorageAccount"]: """Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the @@ -181,8 +181,8 @@ async def begin_create( :type parameters: ~azure.mgmt.storage.v2019_06_01.models.StorageAccountCreateParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either StorageAccount or the result of cls(response) @@ -239,7 +239,7 @@ async def delete( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> None: """Deletes a storage account in Microsoft Azure. @@ -296,7 +296,7 @@ async def get_properties( resource_group_name: str, account_name: str, expand: Optional[Union[str, "_models.StorageAccountExpand"]] = None, - **kwargs + **kwargs: Any ) -> "_models.StorageAccount": """Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage @@ -366,7 +366,7 @@ async def update( resource_group_name: str, account_name: str, parameters: "_models.StorageAccountUpdateParameters", - **kwargs + **kwargs: Any ) -> "_models.StorageAccount": """The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also be used to map the account to a custom domain. Only one custom @@ -439,7 +439,7 @@ async def update( def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.StorageAccountListResult"]: """Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. @@ -507,7 +507,7 @@ async def get_next(next_link=None): def list_by_resource_group( self, resource_group_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.StorageAccountListResult"]: """Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this. @@ -581,7 +581,7 @@ async def list_keys( resource_group_name: str, account_name: str, expand: Optional[str] = "kerb", - **kwargs + **kwargs: Any ) -> "_models.StorageAccountListKeysResult": """Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. @@ -648,7 +648,7 @@ async def regenerate_key( resource_group_name: str, account_name: str, regenerate_key: "_models.StorageAccountRegenerateKeyParameters", - **kwargs + **kwargs: Any ) -> "_models.StorageAccountListKeysResult": """Regenerates one of the access keys or Kerberos keys for the specified storage account. @@ -718,7 +718,7 @@ async def list_account_sas( resource_group_name: str, account_name: str, parameters: "_models.AccountSasParameters", - **kwargs + **kwargs: Any ) -> "_models.ListAccountSasResponse": """List SAS credentials of a storage account. @@ -787,7 +787,7 @@ async def list_service_sas( resource_group_name: str, account_name: str, parameters: "_models.ServiceSasParameters", - **kwargs + **kwargs: Any ) -> "_models.ListServiceSasResponse": """List service SAS credentials of a specific resource. @@ -855,7 +855,7 @@ async def _failover_initial( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { @@ -897,7 +897,7 @@ async def begin_failover( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Failover request can be triggered for a storage account in case of availability issues. The failover occurs from the storage account's primary cluster to secondary cluster for RA-GRS @@ -912,8 +912,8 @@ async def begin_failover( :type account_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) @@ -967,7 +967,7 @@ async def _restore_blob_ranges_initial( resource_group_name: str, account_name: str, parameters: "_models.BlobRestoreParameters", - **kwargs + **kwargs: Any ) -> "_models.BlobRestoreStatus": cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobRestoreStatus"] error_map = { @@ -1024,7 +1024,7 @@ async def begin_restore_blob_ranges( resource_group_name: str, account_name: str, parameters: "_models.BlobRestoreParameters", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.BlobRestoreStatus"]: """Restore blobs in the specified blob ranges. @@ -1039,8 +1039,8 @@ async def begin_restore_blob_ranges( :type parameters: ~azure.mgmt.storage.v2019_06_01.models.BlobRestoreParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either BlobRestoreStatus or the result of cls(response) @@ -1097,7 +1097,7 @@ async def revoke_user_delegation_keys( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> None: """Revoke user delegation keys. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_table_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_table_operations.py index f6cbfc8a6bd3..ca6d307d82d8 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_table_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_table_operations.py @@ -46,7 +46,7 @@ async def create( resource_group_name: str, account_name: str, table_name: str, - **kwargs + **kwargs: Any ) -> "_models.Table": """Creates a new table with the specified table name, under the specified account. @@ -113,7 +113,7 @@ async def update( resource_group_name: str, account_name: str, table_name: str, - **kwargs + **kwargs: Any ) -> "_models.Table": """Creates a new table with the specified table name, under the specified account. @@ -180,7 +180,7 @@ async def get( resource_group_name: str, account_name: str, table_name: str, - **kwargs + **kwargs: Any ) -> "_models.Table": """Gets the table with the specified table name, under the specified account if it exists. @@ -247,7 +247,7 @@ async def delete( resource_group_name: str, account_name: str, table_name: str, - **kwargs + **kwargs: Any ) -> None: """Deletes the table with the specified table name, under the specified account if it exists. @@ -310,7 +310,7 @@ def list( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ListTableResource"]: """Gets a list of all the tables under the specified storage account. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_table_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_table_services_operations.py index f5128f278a7d..e73a0904d485 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_table_services_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_table_services_operations.py @@ -44,7 +44,7 @@ async def list( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.ListTableServices": """List all table services for the storage account. @@ -106,7 +106,7 @@ async def set_service_properties( resource_group_name: str, account_name: str, parameters: "_models.TableServiceProperties", - **kwargs + **kwargs: Any ) -> "_models.TableServiceProperties": """Sets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. @@ -178,7 +178,7 @@ async def get_service_properties( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.TableServiceProperties": """Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_usages_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_usages_operations.py index 160c428f7228..5241dd42f118 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_usages_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/aio/operations/_usages_operations.py @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list_by_location( self, location: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.UsageListResult"]: """Gets the current usage count and the limit for the resources of the location under the subscription. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/models/_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/models/_models.py index 1bccaf33474c..ac6432e96daf 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/models/_models.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/models/_models.py @@ -1803,7 +1803,7 @@ class Identity(msrest.serialization.Model): :vartype principal_id: str :ivar tenant_id: The tenant ID of resource. :vartype tenant_id: str - :ivar type: Required. The identity type. Default value: "SystemAssigned". + :ivar type: The identity type. Has constant value: "SystemAssigned". :vartype type: str """ @@ -1939,20 +1939,18 @@ def __init__( class IPRule(msrest.serialization.Model): """IP rule with specific IP or IP range in CIDR format. - Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. :type ip_address_or_range: str - :ivar action: The action of IP ACL rule. Default value: "Allow". - :vartype action: str + :param action: The action of IP ACL rule. The only acceptable values to pass in are None and + "Allow". The default value is None. + :type action: str """ _validation = { 'ip_address_or_range': {'required': True}, - 'action': {'constant': True}, } _attribute_map = { @@ -1960,14 +1958,13 @@ class IPRule(msrest.serialization.Model): 'action': {'key': 'action', 'type': 'str'}, } - action = "Allow" - def __init__( self, **kwargs ): super(IPRule, self).__init__(**kwargs) self.ip_address_or_range = kwargs['ip_address_or_range'] + self.action = kwargs.get('action', None) class KeyVaultProperties(msrest.serialization.Model): @@ -4028,7 +4025,7 @@ class StorageAccountCheckNameAvailabilityParameters(msrest.serialization.Model): :param name: Required. The storage account name. :type name: str - :ivar type: Required. The type of resource, Microsoft.Storage/storageAccounts. Default value: + :ivar type: The type of resource, Microsoft.Storage/storageAccounts. Has constant value: "Microsoft.Storage/storageAccounts". :vartype type: str """ @@ -4891,15 +4888,14 @@ def __init__( class VirtualNetworkRule(msrest.serialization.Model): """Virtual Network rule. - Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. :param virtual_network_resource_id: Required. Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. :type virtual_network_resource_id: str - :ivar action: The action of virtual network rule. Default value: "Allow". - :vartype action: str + :param action: The action of virtual network rule. The only acceptable values to pass in are + None and "Allow". The default value is None. + :type action: str :param state: Gets the state of virtual network rule. Possible values include: "provisioning", "deprovisioning", "succeeded", "failed", "networkSourceDeleted". :type state: str or ~azure.mgmt.storage.v2019_06_01.models.State @@ -4907,7 +4903,6 @@ class VirtualNetworkRule(msrest.serialization.Model): _validation = { 'virtual_network_resource_id': {'required': True}, - 'action': {'constant': True}, } _attribute_map = { @@ -4916,12 +4911,11 @@ class VirtualNetworkRule(msrest.serialization.Model): 'state': {'key': 'state', 'type': 'str'}, } - action = "Allow" - def __init__( self, **kwargs ): super(VirtualNetworkRule, self).__init__(**kwargs) self.virtual_network_resource_id = kwargs['virtual_network_resource_id'] + self.action = kwargs.get('action', None) self.state = kwargs.get('state', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/models/_models_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/models/_models_py3.py index 64f10653798a..8511407eeb5f 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/models/_models_py3.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/models/_models_py3.py @@ -1941,7 +1941,7 @@ class Identity(msrest.serialization.Model): :vartype principal_id: str :ivar tenant_id: The tenant ID of resource. :vartype tenant_id: str - :ivar type: Required. The identity type. Default value: "SystemAssigned". + :ivar type: The identity type. Has constant value: "SystemAssigned". :vartype type: str """ @@ -2083,20 +2083,18 @@ def __init__( class IPRule(msrest.serialization.Model): """IP rule with specific IP or IP range in CIDR format. - Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. :type ip_address_or_range: str - :ivar action: The action of IP ACL rule. Default value: "Allow". - :vartype action: str + :param action: The action of IP ACL rule. The only acceptable values to pass in are None and + "Allow". The default value is None. + :type action: str """ _validation = { 'ip_address_or_range': {'required': True}, - 'action': {'constant': True}, } _attribute_map = { @@ -2104,16 +2102,16 @@ class IPRule(msrest.serialization.Model): 'action': {'key': 'action', 'type': 'str'}, } - action = "Allow" - def __init__( self, *, ip_address_or_range: str, + action: Optional[str] = None, **kwargs ): super(IPRule, self).__init__(**kwargs) self.ip_address_or_range = ip_address_or_range + self.action = action class KeyVaultProperties(msrest.serialization.Model): @@ -4342,7 +4340,7 @@ class StorageAccountCheckNameAvailabilityParameters(msrest.serialization.Model): :param name: Required. The storage account name. :type name: str - :ivar type: Required. The type of resource, Microsoft.Storage/storageAccounts. Default value: + :ivar type: The type of resource, Microsoft.Storage/storageAccounts. Has constant value: "Microsoft.Storage/storageAccounts". :vartype type: str """ @@ -5260,15 +5258,14 @@ def __init__( class VirtualNetworkRule(msrest.serialization.Model): """Virtual Network rule. - Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. :param virtual_network_resource_id: Required. Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. :type virtual_network_resource_id: str - :ivar action: The action of virtual network rule. Default value: "Allow". - :vartype action: str + :param action: The action of virtual network rule. The only acceptable values to pass in are + None and "Allow". The default value is None. + :type action: str :param state: Gets the state of virtual network rule. Possible values include: "provisioning", "deprovisioning", "succeeded", "failed", "networkSourceDeleted". :type state: str or ~azure.mgmt.storage.v2019_06_01.models.State @@ -5276,7 +5273,6 @@ class VirtualNetworkRule(msrest.serialization.Model): _validation = { 'virtual_network_resource_id': {'required': True}, - 'action': {'constant': True}, } _attribute_map = { @@ -5285,15 +5281,15 @@ class VirtualNetworkRule(msrest.serialization.Model): 'state': {'key': 'state', 'type': 'str'}, } - action = "Allow" - def __init__( self, *, virtual_network_resource_id: str, + action: Optional[str] = None, state: Optional[Union[str, "State"]] = None, **kwargs ): super(VirtualNetworkRule, self).__init__(**kwargs) self.virtual_network_resource_id = virtual_network_resource_id + self.action = action self.state = state diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_storage_accounts_operations.py index ad86d4f2fec2..543c0d4ae407 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_storage_accounts_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_storage_accounts_operations.py @@ -188,8 +188,8 @@ def begin_create( :type parameters: ~azure.mgmt.storage.v2019_06_01.models.StorageAccountCreateParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either StorageAccount or the result of cls(response) @@ -930,8 +930,8 @@ def begin_failover( :type account_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) @@ -1059,8 +1059,8 @@ def begin_restore_blob_ranges( :type parameters: ~azure.mgmt.storage.v2019_06_01.models.BlobRestoreParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either BlobRestoreStatus or the result of cls(response) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/_version.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/_version.py index 8dae91701610..232662316d4d 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/_version.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "18.0.0" +VERSION = "19.0.0" diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_blob_containers_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_blob_containers_operations.py index 1f0713a5497d..3fbfd652f9f8 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_blob_containers_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_blob_containers_operations.py @@ -48,7 +48,7 @@ def list( maxpagesize: Optional[str] = None, filter: Optional[str] = None, include: Optional[Union[str, "_models.ListContainersInclude"]] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ListContainerItems"]: """Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. @@ -142,7 +142,7 @@ async def create( account_name: str, container_name: str, blob_container: "_models.BlobContainer", - **kwargs + **kwargs: Any ) -> "_models.BlobContainer": """Creates a new container under the specified account as described by request body. The container resource includes metadata and properties for that container. It does not include a list of the @@ -224,7 +224,7 @@ async def update( account_name: str, container_name: str, blob_container: "_models.BlobContainer", - **kwargs + **kwargs: Any ) -> "_models.BlobContainer": """Updates container properties as specified in request body. Properties not mentioned in the request will be unchanged. Update fails if the specified container doesn't already exist. @@ -300,7 +300,7 @@ async def get( resource_group_name: str, account_name: str, container_name: str, - **kwargs + **kwargs: Any ) -> "_models.BlobContainer": """Gets properties of a specified container. @@ -368,7 +368,7 @@ async def delete( resource_group_name: str, account_name: str, container_name: str, - **kwargs + **kwargs: Any ) -> None: """Deletes specified container under its account. @@ -432,7 +432,7 @@ async def set_legal_hold( account_name: str, container_name: str, legal_hold: "_models.LegalHold", - **kwargs + **kwargs: Any ) -> "_models.LegalHold": """Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append pattern and does not clear out the existing tags that are not specified in @@ -510,7 +510,7 @@ async def clear_legal_hold( account_name: str, container_name: str, legal_hold: "_models.LegalHold", - **kwargs + **kwargs: Any ) -> "_models.LegalHold": """Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold clears out only the specified tags in the request. @@ -588,7 +588,7 @@ async def create_or_update_immutability_policy( container_name: str, if_match: Optional[str] = None, parameters: Optional["_models.ImmutabilityPolicy"] = None, - **kwargs + **kwargs: Any ) -> "_models.ImmutabilityPolicy": """Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for this operation. @@ -679,7 +679,7 @@ async def get_immutability_policy( account_name: str, container_name: str, if_match: Optional[str] = None, - **kwargs + **kwargs: Any ) -> "_models.ImmutabilityPolicy": """Gets the existing immutability policy along with the corresponding ETag in response headers and body. @@ -759,7 +759,7 @@ async def delete_immutability_policy( account_name: str, container_name: str, if_match: str, - **kwargs + **kwargs: Any ) -> "_models.ImmutabilityPolicy": """Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is required for this @@ -840,7 +840,7 @@ async def lock_immutability_policy( account_name: str, container_name: str, if_match: str, - **kwargs + **kwargs: Any ) -> "_models.ImmutabilityPolicy": """Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. @@ -918,7 +918,7 @@ async def extend_immutability_policy( container_name: str, if_match: str, parameters: Optional["_models.ImmutabilityPolicy"] = None, - **kwargs + **kwargs: Any ) -> "_models.ImmutabilityPolicy": """Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a Locked policy will be this action. ETag in If-Match is required for this @@ -1007,7 +1007,7 @@ async def lease( account_name: str, container_name: str, parameters: Optional["_models.LeaseContainerRequest"] = None, - **kwargs + **kwargs: Any ) -> "_models.LeaseContainerResponse": """The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_blob_inventory_policies_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_blob_inventory_policies_operations.py index 266304790c4b..cb52b18812dc 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_blob_inventory_policies_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_blob_inventory_policies_operations.py @@ -46,7 +46,7 @@ async def get( resource_group_name: str, account_name: str, blob_inventory_policy_name: Union[str, "_models.BlobInventoryPolicyName"], - **kwargs + **kwargs: Any ) -> "_models.BlobInventoryPolicy": """Gets the blob inventory policy associated with the specified storage account. @@ -114,7 +114,7 @@ async def create_or_update( account_name: str, blob_inventory_policy_name: Union[str, "_models.BlobInventoryPolicyName"], properties: "_models.BlobInventoryPolicy", - **kwargs + **kwargs: Any ) -> "_models.BlobInventoryPolicy": """Sets the blob inventory policy to the specified storage account. @@ -188,7 +188,7 @@ async def delete( resource_group_name: str, account_name: str, blob_inventory_policy_name: Union[str, "_models.BlobInventoryPolicyName"], - **kwargs + **kwargs: Any ) -> None: """Deletes the blob inventory policy associated with the specified storage account. @@ -251,7 +251,7 @@ def list( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ListBlobInventoryPolicy"]: """Gets the blob inventory policy associated with the specified storage account. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_blob_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_blob_services_operations.py index 907a41085167..a8b50842fc17 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_blob_services_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_blob_services_operations.py @@ -45,7 +45,7 @@ def list( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.BlobServiceItems"]: """List blob services of storage account. It returns a collection of one object named default. @@ -123,7 +123,7 @@ async def set_service_properties( resource_group_name: str, account_name: str, parameters: "_models.BlobServiceProperties", - **kwargs + **kwargs: Any ) -> "_models.BlobServiceProperties": """Sets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. @@ -195,7 +195,7 @@ async def get_service_properties( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.BlobServiceProperties": """Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_deleted_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_deleted_accounts_operations.py index 10783789f4e7..9ee4432d1747 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_deleted_accounts_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_deleted_accounts_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.DeletedAccountListResult"]: """Lists deleted accounts under the subscription. @@ -112,7 +112,7 @@ async def get( self, deleted_account_name: str, location: str, - **kwargs + **kwargs: Any ) -> "_models.DeletedAccount": """Get properties of specified deleted account resource. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_encryption_scopes_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_encryption_scopes_operations.py index 13f7d4f1ad84..4e3ec3c11bec 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_encryption_scopes_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_encryption_scopes_operations.py @@ -47,7 +47,7 @@ async def put( account_name: str, encryption_scope_name: str, encryption_scope: "_models.EncryptionScope", - **kwargs + **kwargs: Any ) -> "_models.EncryptionScope": """Synchronously creates or updates an encryption scope under the specified storage account. If an encryption scope is already created and a subsequent request is issued with different @@ -130,7 +130,7 @@ async def patch( account_name: str, encryption_scope_name: str, encryption_scope: "_models.EncryptionScope", - **kwargs + **kwargs: Any ) -> "_models.EncryptionScope": """Update encryption scope properties as specified in the request body. Update fails if the specified encryption scope does not already exist. @@ -207,7 +207,7 @@ async def get( resource_group_name: str, account_name: str, encryption_scope_name: str, - **kwargs + **kwargs: Any ) -> "_models.EncryptionScope": """Returns the properties for the specified encryption scope. @@ -275,7 +275,7 @@ def list( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.EncryptionScopeListResult"]: """Lists all the encryption scopes available under the specified storage account. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_file_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_file_services_operations.py index fb02b98da900..58e8391bae1d 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_file_services_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_file_services_operations.py @@ -44,7 +44,7 @@ async def list( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.FileServiceItems": """List all file services in storage accounts. @@ -106,7 +106,7 @@ async def set_service_properties( resource_group_name: str, account_name: str, parameters: "_models.FileServiceProperties", - **kwargs + **kwargs: Any ) -> "_models.FileServiceProperties": """Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. @@ -178,7 +178,7 @@ async def get_service_properties( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.FileServiceProperties": """Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_file_shares_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_file_shares_operations.py index 04b379085566..e1184cdb8c12 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_file_shares_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_file_shares_operations.py @@ -48,7 +48,7 @@ def list( maxpagesize: Optional[str] = None, filter: Optional[str] = None, expand: Optional[Union[str, "_models.ListSharesExpand"]] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.FileShareItems"]: """Lists all shares. @@ -142,7 +142,7 @@ async def create( share_name: str, file_share: "_models.FileShare", expand: Optional[str] = "snapshots", - **kwargs + **kwargs: Any ) -> "_models.FileShare": """Creates a new share under the specified account as described by request body. The share resource includes metadata and properties for that share. It does not include a list of the @@ -228,7 +228,7 @@ async def update( account_name: str, share_name: str, file_share: "_models.FileShare", - **kwargs + **kwargs: Any ) -> "_models.FileShare": """Updates share properties as specified in request body. Properties not mentioned in the request will not be changed. Update fails if the specified share does not already exist. @@ -306,7 +306,7 @@ async def get( share_name: str, expand: Optional[str] = "stats", x_ms_snapshot: Optional[str] = None, - **kwargs + **kwargs: Any ) -> "_models.FileShare": """Gets properties of a specified share. @@ -383,7 +383,7 @@ async def delete( account_name: str, share_name: str, x_ms_snapshot: Optional[str] = None, - **kwargs + **kwargs: Any ) -> None: """Deletes specified share under its account. @@ -453,7 +453,7 @@ async def restore( account_name: str, share_name: str, deleted_share: "_models.DeletedShare", - **kwargs + **kwargs: Any ) -> None: """Restore a file share within a valid retention days if share soft delete is enabled. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_management_policies_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_management_policies_operations.py index ee89243e8d1e..7af33facc22d 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_management_policies_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_management_policies_operations.py @@ -45,7 +45,7 @@ async def get( resource_group_name: str, account_name: str, management_policy_name: Union[str, "_models.ManagementPolicyName"], - **kwargs + **kwargs: Any ) -> "_models.ManagementPolicy": """Gets the managementpolicy associated with the specified storage account. @@ -112,7 +112,7 @@ async def create_or_update( account_name: str, management_policy_name: Union[str, "_models.ManagementPolicyName"], properties: "_models.ManagementPolicy", - **kwargs + **kwargs: Any ) -> "_models.ManagementPolicy": """Sets the managementpolicy to the specified storage account. @@ -185,7 +185,7 @@ async def delete( resource_group_name: str, account_name: str, management_policy_name: Union[str, "_models.ManagementPolicyName"], - **kwargs + **kwargs: Any ) -> None: """Deletes the managementpolicy associated with the specified storage account. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_object_replication_policies_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_object_replication_policies_operations.py index 75ce07b70611..a906c358f4fe 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_object_replication_policies_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_object_replication_policies_operations.py @@ -45,7 +45,7 @@ def list( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ObjectReplicationPolicies"]: """List the object replication policies associated with the storage account. @@ -124,7 +124,7 @@ async def get( resource_group_name: str, account_name: str, object_replication_policy_id: str, - **kwargs + **kwargs: Any ) -> "_models.ObjectReplicationPolicy": """Get the object replication policy of the storage account by policy ID. @@ -192,7 +192,7 @@ async def create_or_update( account_name: str, object_replication_policy_id: str, properties: "_models.ObjectReplicationPolicy", - **kwargs + **kwargs: Any ) -> "_models.ObjectReplicationPolicy": """Create or update the object replication policy of the storage account. @@ -267,7 +267,7 @@ async def delete( resource_group_name: str, account_name: str, object_replication_policy_id: str, - **kwargs + **kwargs: Any ) -> None: """Deletes the object replication policy associated with the specified storage account. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_operations.py index 2dc76eec21b8..f113b28ee1ef 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available Storage Rest API operations. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_private_endpoint_connections_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_private_endpoint_connections_operations.py index 876b640fd299..b965d4e311b2 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_private_endpoint_connections_operations.py @@ -45,7 +45,7 @@ def list( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.PrivateEndpointConnectionListResult"]: """List all the private endpoint connections associated with the storage account. @@ -123,7 +123,7 @@ async def get( resource_group_name: str, account_name: str, private_endpoint_connection_name: str, - **kwargs + **kwargs: Any ) -> "_models.PrivateEndpointConnection": """Gets the specified private endpoint connection associated with the storage account. @@ -191,7 +191,7 @@ async def put( account_name: str, private_endpoint_connection_name: str, properties: "_models.PrivateEndpointConnection", - **kwargs + **kwargs: Any ) -> "_models.PrivateEndpointConnection": """Update the state of specified private endpoint connection associated with the storage account. @@ -265,7 +265,7 @@ async def delete( resource_group_name: str, account_name: str, private_endpoint_connection_name: str, - **kwargs + **kwargs: Any ) -> None: """Deletes the specified private endpoint connection associated with the storage account. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_private_link_resources_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_private_link_resources_operations.py index ea51308267f2..5a6ade98542b 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_private_link_resources_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_private_link_resources_operations.py @@ -44,7 +44,7 @@ async def list_by_storage_account( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.PrivateLinkResourceListResult": """Gets the private link resources that need to be created for a storage account. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_queue_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_queue_operations.py index d7de946fcdae..d8541e40852e 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_queue_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_queue_operations.py @@ -47,7 +47,7 @@ async def create( account_name: str, queue_name: str, queue: "_models.StorageQueue", - **kwargs + **kwargs: Any ) -> "_models.StorageQueue": """Creates a new queue with the specified queue name, under the specified account. @@ -123,7 +123,7 @@ async def update( account_name: str, queue_name: str, queue: "_models.StorageQueue", - **kwargs + **kwargs: Any ) -> "_models.StorageQueue": """Creates a new queue with the specified queue name, under the specified account. @@ -198,7 +198,7 @@ async def get( resource_group_name: str, account_name: str, queue_name: str, - **kwargs + **kwargs: Any ) -> "_models.StorageQueue": """Gets the queue with the specified queue name, under the specified account if it exists. @@ -266,7 +266,7 @@ async def delete( resource_group_name: str, account_name: str, queue_name: str, - **kwargs + **kwargs: Any ) -> None: """Deletes the queue with the specified queue name, under the specified account if it exists. @@ -332,7 +332,7 @@ def list( account_name: str, maxpagesize: Optional[str] = None, filter: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ListQueueResource"]: """Gets a list of all the queues under the specified storage account. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_queue_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_queue_services_operations.py index b8aaaad75149..0eb1beeee8e6 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_queue_services_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_queue_services_operations.py @@ -44,7 +44,7 @@ async def list( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.ListQueueServices": """List all queue services for the storage account. @@ -106,7 +106,7 @@ async def set_service_properties( resource_group_name: str, account_name: str, parameters: "_models.QueueServiceProperties", - **kwargs + **kwargs: Any ) -> "_models.QueueServiceProperties": """Sets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. @@ -178,7 +178,7 @@ async def get_service_properties( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.QueueServiceProperties": """Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_skus_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_skus_operations.py index 682e54407335..814c41264640 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_skus_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_skus_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.StorageSkuListResult"]: """Lists the available SKUs supported by Microsoft.Storage for given subscription. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_storage_accounts_operations.py index c3481d0f4f91..38d4184b62d4 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_storage_accounts_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_storage_accounts_operations.py @@ -46,7 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def check_name_availability( self, account_name: "_models.StorageAccountCheckNameAvailabilityParameters", - **kwargs + **kwargs: Any ) -> "_models.CheckNameAvailabilityResult": """Checks that the storage account name is valid and is not already in use. @@ -108,7 +108,7 @@ async def _create_initial( resource_group_name: str, account_name: str, parameters: "_models.StorageAccountCreateParameters", - **kwargs + **kwargs: Any ) -> Optional["_models.StorageAccount"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StorageAccount"]] error_map = { @@ -163,7 +163,7 @@ async def begin_create( resource_group_name: str, account_name: str, parameters: "_models.StorageAccountCreateParameters", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.StorageAccount"]: """Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the @@ -181,8 +181,8 @@ async def begin_create( :type parameters: ~azure.mgmt.storage.v2020_08_01_preview.models.StorageAccountCreateParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either StorageAccount or the result of cls(response) @@ -239,7 +239,7 @@ async def delete( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> None: """Deletes a storage account in Microsoft Azure. @@ -296,7 +296,7 @@ async def get_properties( resource_group_name: str, account_name: str, expand: Optional[Union[str, "_models.StorageAccountExpand"]] = None, - **kwargs + **kwargs: Any ) -> "_models.StorageAccount": """Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage @@ -366,7 +366,7 @@ async def update( resource_group_name: str, account_name: str, parameters: "_models.StorageAccountUpdateParameters", - **kwargs + **kwargs: Any ) -> "_models.StorageAccount": """The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also be used to map the account to a custom domain. Only one custom @@ -439,7 +439,7 @@ async def update( def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.StorageAccountListResult"]: """Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. @@ -507,7 +507,7 @@ async def get_next(next_link=None): def list_by_resource_group( self, resource_group_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.StorageAccountListResult"]: """Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this. @@ -581,7 +581,7 @@ async def list_keys( resource_group_name: str, account_name: str, expand: Optional[str] = "kerb", - **kwargs + **kwargs: Any ) -> "_models.StorageAccountListKeysResult": """Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. @@ -648,7 +648,7 @@ async def regenerate_key( resource_group_name: str, account_name: str, regenerate_key: "_models.StorageAccountRegenerateKeyParameters", - **kwargs + **kwargs: Any ) -> "_models.StorageAccountListKeysResult": """Regenerates one of the access keys or Kerberos keys for the specified storage account. @@ -718,7 +718,7 @@ async def list_account_sas( resource_group_name: str, account_name: str, parameters: "_models.AccountSasParameters", - **kwargs + **kwargs: Any ) -> "_models.ListAccountSasResponse": """List SAS credentials of a storage account. @@ -787,7 +787,7 @@ async def list_service_sas( resource_group_name: str, account_name: str, parameters: "_models.ServiceSasParameters", - **kwargs + **kwargs: Any ) -> "_models.ListServiceSasResponse": """List service SAS credentials of a specific resource. @@ -855,7 +855,7 @@ async def _failover_initial( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { @@ -897,7 +897,7 @@ async def begin_failover( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Failover request can be triggered for a storage account in case of availability issues. The failover occurs from the storage account's primary cluster to secondary cluster for RA-GRS @@ -912,8 +912,8 @@ async def begin_failover( :type account_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) @@ -967,7 +967,7 @@ async def _restore_blob_ranges_initial( resource_group_name: str, account_name: str, parameters: "_models.BlobRestoreParameters", - **kwargs + **kwargs: Any ) -> "_models.BlobRestoreStatus": cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobRestoreStatus"] error_map = { @@ -1024,7 +1024,7 @@ async def begin_restore_blob_ranges( resource_group_name: str, account_name: str, parameters: "_models.BlobRestoreParameters", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.BlobRestoreStatus"]: """Restore blobs in the specified blob ranges. @@ -1039,8 +1039,8 @@ async def begin_restore_blob_ranges( :type parameters: ~azure.mgmt.storage.v2020_08_01_preview.models.BlobRestoreParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either BlobRestoreStatus or the result of cls(response) @@ -1097,7 +1097,7 @@ async def revoke_user_delegation_keys( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> None: """Revoke user delegation keys. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_table_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_table_operations.py index 98c16bd52ecc..cbdcab3a72ba 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_table_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_table_operations.py @@ -46,7 +46,7 @@ async def create( resource_group_name: str, account_name: str, table_name: str, - **kwargs + **kwargs: Any ) -> "_models.Table": """Creates a new table with the specified table name, under the specified account. @@ -113,7 +113,7 @@ async def update( resource_group_name: str, account_name: str, table_name: str, - **kwargs + **kwargs: Any ) -> "_models.Table": """Creates a new table with the specified table name, under the specified account. @@ -180,7 +180,7 @@ async def get( resource_group_name: str, account_name: str, table_name: str, - **kwargs + **kwargs: Any ) -> "_models.Table": """Gets the table with the specified table name, under the specified account if it exists. @@ -247,7 +247,7 @@ async def delete( resource_group_name: str, account_name: str, table_name: str, - **kwargs + **kwargs: Any ) -> None: """Deletes the table with the specified table name, under the specified account if it exists. @@ -310,7 +310,7 @@ def list( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ListTableResource"]: """Gets a list of all the tables under the specified storage account. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_table_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_table_services_operations.py index a8f6ea36f694..f239cb8720cb 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_table_services_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_table_services_operations.py @@ -44,7 +44,7 @@ async def list( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.ListTableServices": """List all table services for the storage account. @@ -106,7 +106,7 @@ async def set_service_properties( resource_group_name: str, account_name: str, parameters: "_models.TableServiceProperties", - **kwargs + **kwargs: Any ) -> "_models.TableServiceProperties": """Sets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. @@ -178,7 +178,7 @@ async def get_service_properties( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.TableServiceProperties": """Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_usages_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_usages_operations.py index 21474cd2c4ca..c612906d7006 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_usages_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/aio/operations/_usages_operations.py @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list_by_location( self, location: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.UsageListResult"]: """Gets the current usage count and the limit for the resources of the location under the subscription. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/models/_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/models/_models.py index 0aa65c5d984a..194dcd985483 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/models/_models.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/models/_models.py @@ -1969,7 +1969,7 @@ class Identity(msrest.serialization.Model): :vartype principal_id: str :ivar tenant_id: The tenant ID of resource. :vartype tenant_id: str - :ivar type: Required. The identity type. Default value: "SystemAssigned". + :ivar type: The identity type. Has constant value: "SystemAssigned". :vartype type: str """ @@ -2106,20 +2106,18 @@ def __init__( class IPRule(msrest.serialization.Model): """IP rule with specific IP or IP range in CIDR format. - Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. :type ip_address_or_range: str - :ivar action: The action of IP ACL rule. Default value: "Allow". - :vartype action: str + :param action: The action of IP ACL rule. The only acceptable values to pass in are None and + "Allow". The default value is None. + :type action: str """ _validation = { 'ip_address_or_range': {'required': True}, - 'action': {'constant': True}, } _attribute_map = { @@ -2127,14 +2125,13 @@ class IPRule(msrest.serialization.Model): 'action': {'key': 'action', 'type': 'str'}, } - action = "Allow" - def __init__( self, **kwargs ): super(IPRule, self).__init__(**kwargs) self.ip_address_or_range = kwargs['ip_address_or_range'] + self.action = kwargs.get('action', None) class KeyVaultProperties(msrest.serialization.Model): @@ -4291,7 +4288,7 @@ class StorageAccountCheckNameAvailabilityParameters(msrest.serialization.Model): :param name: Required. The storage account name. :type name: str - :ivar type: Required. The type of resource, Microsoft.Storage/storageAccounts. Default value: + :ivar type: The type of resource, Microsoft.Storage/storageAccounts. Has constant value: "Microsoft.Storage/storageAccounts". :vartype type: str """ @@ -5164,15 +5161,14 @@ def __init__( class VirtualNetworkRule(msrest.serialization.Model): """Virtual Network rule. - Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. :param virtual_network_resource_id: Required. Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. :type virtual_network_resource_id: str - :ivar action: The action of virtual network rule. Default value: "Allow". - :vartype action: str + :param action: The action of virtual network rule. The only acceptable values to pass in are + None and "Allow". The default value is None. + :type action: str :param state: Gets the state of virtual network rule. Possible values include: "provisioning", "deprovisioning", "succeeded", "failed", "networkSourceDeleted". :type state: str or ~azure.mgmt.storage.v2020_08_01_preview.models.State @@ -5180,7 +5176,6 @@ class VirtualNetworkRule(msrest.serialization.Model): _validation = { 'virtual_network_resource_id': {'required': True}, - 'action': {'constant': True}, } _attribute_map = { @@ -5189,12 +5184,11 @@ class VirtualNetworkRule(msrest.serialization.Model): 'state': {'key': 'state', 'type': 'str'}, } - action = "Allow" - def __init__( self, **kwargs ): super(VirtualNetworkRule, self).__init__(**kwargs) self.virtual_network_resource_id = kwargs['virtual_network_resource_id'] + self.action = kwargs.get('action', None) self.state = kwargs.get('state', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/models/_models_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/models/_models_py3.py index 9b24eaff7a60..d7cabcdaa929 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/models/_models_py3.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/models/_models_py3.py @@ -2111,7 +2111,7 @@ class Identity(msrest.serialization.Model): :vartype principal_id: str :ivar tenant_id: The tenant ID of resource. :vartype tenant_id: str - :ivar type: Required. The identity type. Default value: "SystemAssigned". + :ivar type: The identity type. Has constant value: "SystemAssigned". :vartype type: str """ @@ -2254,20 +2254,18 @@ def __init__( class IPRule(msrest.serialization.Model): """IP rule with specific IP or IP range in CIDR format. - Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. :type ip_address_or_range: str - :ivar action: The action of IP ACL rule. Default value: "Allow". - :vartype action: str + :param action: The action of IP ACL rule. The only acceptable values to pass in are None and + "Allow". The default value is None. + :type action: str """ _validation = { 'ip_address_or_range': {'required': True}, - 'action': {'constant': True}, } _attribute_map = { @@ -2275,16 +2273,16 @@ class IPRule(msrest.serialization.Model): 'action': {'key': 'action', 'type': 'str'}, } - action = "Allow" - def __init__( self, *, ip_address_or_range: str, + action: Optional[str] = None, **kwargs ): super(IPRule, self).__init__(**kwargs) self.ip_address_or_range = ip_address_or_range + self.action = action class KeyVaultProperties(msrest.serialization.Model): @@ -4620,7 +4618,7 @@ class StorageAccountCheckNameAvailabilityParameters(msrest.serialization.Model): :param name: Required. The storage account name. :type name: str - :ivar type: Required. The type of resource, Microsoft.Storage/storageAccounts. Default value: + :ivar type: The type of resource, Microsoft.Storage/storageAccounts. Has constant value: "Microsoft.Storage/storageAccounts". :vartype type: str """ @@ -5549,15 +5547,14 @@ def __init__( class VirtualNetworkRule(msrest.serialization.Model): """Virtual Network rule. - Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. :param virtual_network_resource_id: Required. Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. :type virtual_network_resource_id: str - :ivar action: The action of virtual network rule. Default value: "Allow". - :vartype action: str + :param action: The action of virtual network rule. The only acceptable values to pass in are + None and "Allow". The default value is None. + :type action: str :param state: Gets the state of virtual network rule. Possible values include: "provisioning", "deprovisioning", "succeeded", "failed", "networkSourceDeleted". :type state: str or ~azure.mgmt.storage.v2020_08_01_preview.models.State @@ -5565,7 +5562,6 @@ class VirtualNetworkRule(msrest.serialization.Model): _validation = { 'virtual_network_resource_id': {'required': True}, - 'action': {'constant': True}, } _attribute_map = { @@ -5574,15 +5570,15 @@ class VirtualNetworkRule(msrest.serialization.Model): 'state': {'key': 'state', 'type': 'str'}, } - action = "Allow" - def __init__( self, *, virtual_network_resource_id: str, + action: Optional[str] = None, state: Optional[Union[str, "State"]] = None, **kwargs ): super(VirtualNetworkRule, self).__init__(**kwargs) self.virtual_network_resource_id = virtual_network_resource_id + self.action = action self.state = state diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_storage_accounts_operations.py index 8f376d64494e..7db5cf712d13 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_storage_accounts_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2020_08_01_preview/operations/_storage_accounts_operations.py @@ -188,8 +188,8 @@ def begin_create( :type parameters: ~azure.mgmt.storage.v2020_08_01_preview.models.StorageAccountCreateParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either StorageAccount or the result of cls(response) @@ -930,8 +930,8 @@ def begin_failover( :type account_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) @@ -1059,8 +1059,8 @@ def begin_restore_blob_ranges( :type parameters: ~azure.mgmt.storage.v2020_08_01_preview.models.BlobRestoreParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either BlobRestoreStatus or the result of cls(response) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/_version.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/_version.py index 8dae91701610..232662316d4d 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/_version.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "18.0.0" +VERSION = "19.0.0" diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_blob_containers_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_blob_containers_operations.py index 7b744f7f57a6..5ec25418be87 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_blob_containers_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_blob_containers_operations.py @@ -48,7 +48,7 @@ def list( maxpagesize: Optional[str] = None, filter: Optional[str] = None, include: Optional[Union[str, "_models.ListContainersInclude"]] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ListContainerItems"]: """Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. @@ -142,7 +142,7 @@ async def create( account_name: str, container_name: str, blob_container: "_models.BlobContainer", - **kwargs + **kwargs: Any ) -> "_models.BlobContainer": """Creates a new container under the specified account as described by request body. The container resource includes metadata and properties for that container. It does not include a list of the @@ -224,7 +224,7 @@ async def update( account_name: str, container_name: str, blob_container: "_models.BlobContainer", - **kwargs + **kwargs: Any ) -> "_models.BlobContainer": """Updates container properties as specified in request body. Properties not mentioned in the request will be unchanged. Update fails if the specified container doesn't already exist. @@ -300,7 +300,7 @@ async def get( resource_group_name: str, account_name: str, container_name: str, - **kwargs + **kwargs: Any ) -> "_models.BlobContainer": """Gets properties of a specified container. @@ -368,7 +368,7 @@ async def delete( resource_group_name: str, account_name: str, container_name: str, - **kwargs + **kwargs: Any ) -> None: """Deletes specified container under its account. @@ -432,7 +432,7 @@ async def set_legal_hold( account_name: str, container_name: str, legal_hold: "_models.LegalHold", - **kwargs + **kwargs: Any ) -> "_models.LegalHold": """Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append pattern and does not clear out the existing tags that are not specified in @@ -510,7 +510,7 @@ async def clear_legal_hold( account_name: str, container_name: str, legal_hold: "_models.LegalHold", - **kwargs + **kwargs: Any ) -> "_models.LegalHold": """Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold clears out only the specified tags in the request. @@ -588,7 +588,7 @@ async def create_or_update_immutability_policy( container_name: str, if_match: Optional[str] = None, parameters: Optional["_models.ImmutabilityPolicy"] = None, - **kwargs + **kwargs: Any ) -> "_models.ImmutabilityPolicy": """Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for this operation. @@ -679,7 +679,7 @@ async def get_immutability_policy( account_name: str, container_name: str, if_match: Optional[str] = None, - **kwargs + **kwargs: Any ) -> "_models.ImmutabilityPolicy": """Gets the existing immutability policy along with the corresponding ETag in response headers and body. @@ -759,7 +759,7 @@ async def delete_immutability_policy( account_name: str, container_name: str, if_match: str, - **kwargs + **kwargs: Any ) -> "_models.ImmutabilityPolicy": """Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is required for this @@ -840,7 +840,7 @@ async def lock_immutability_policy( account_name: str, container_name: str, if_match: str, - **kwargs + **kwargs: Any ) -> "_models.ImmutabilityPolicy": """Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. @@ -918,7 +918,7 @@ async def extend_immutability_policy( container_name: str, if_match: str, parameters: Optional["_models.ImmutabilityPolicy"] = None, - **kwargs + **kwargs: Any ) -> "_models.ImmutabilityPolicy": """Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a Locked policy will be this action. ETag in If-Match is required for this @@ -1007,7 +1007,7 @@ async def lease( account_name: str, container_name: str, parameters: Optional["_models.LeaseContainerRequest"] = None, - **kwargs + **kwargs: Any ) -> "_models.LeaseContainerResponse": """The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_blob_inventory_policies_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_blob_inventory_policies_operations.py index 3c3e77c1c44d..0db3d9b56f5d 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_blob_inventory_policies_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_blob_inventory_policies_operations.py @@ -46,7 +46,7 @@ async def get( resource_group_name: str, account_name: str, blob_inventory_policy_name: Union[str, "_models.BlobInventoryPolicyName"], - **kwargs + **kwargs: Any ) -> "_models.BlobInventoryPolicy": """Gets the blob inventory policy associated with the specified storage account. @@ -114,7 +114,7 @@ async def create_or_update( account_name: str, blob_inventory_policy_name: Union[str, "_models.BlobInventoryPolicyName"], properties: "_models.BlobInventoryPolicy", - **kwargs + **kwargs: Any ) -> "_models.BlobInventoryPolicy": """Sets the blob inventory policy to the specified storage account. @@ -188,7 +188,7 @@ async def delete( resource_group_name: str, account_name: str, blob_inventory_policy_name: Union[str, "_models.BlobInventoryPolicyName"], - **kwargs + **kwargs: Any ) -> None: """Deletes the blob inventory policy associated with the specified storage account. @@ -251,7 +251,7 @@ def list( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ListBlobInventoryPolicy"]: """Gets the blob inventory policy associated with the specified storage account. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_blob_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_blob_services_operations.py index 118fa5102a16..a574ef16887d 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_blob_services_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_blob_services_operations.py @@ -45,7 +45,7 @@ def list( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.BlobServiceItems"]: """List blob services of storage account. It returns a collection of one object named default. @@ -123,7 +123,7 @@ async def set_service_properties( resource_group_name: str, account_name: str, parameters: "_models.BlobServiceProperties", - **kwargs + **kwargs: Any ) -> "_models.BlobServiceProperties": """Sets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. @@ -195,7 +195,7 @@ async def get_service_properties( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.BlobServiceProperties": """Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_deleted_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_deleted_accounts_operations.py index 53b6c0f0dfa4..caedd8cb02e0 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_deleted_accounts_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_deleted_accounts_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.DeletedAccountListResult"]: """Lists deleted accounts under the subscription. @@ -112,7 +112,7 @@ async def get( self, deleted_account_name: str, location: str, - **kwargs + **kwargs: Any ) -> "_models.DeletedAccount": """Get properties of specified deleted account resource. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_encryption_scopes_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_encryption_scopes_operations.py index 13af980ee616..23a478dcc082 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_encryption_scopes_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_encryption_scopes_operations.py @@ -47,7 +47,7 @@ async def put( account_name: str, encryption_scope_name: str, encryption_scope: "_models.EncryptionScope", - **kwargs + **kwargs: Any ) -> "_models.EncryptionScope": """Synchronously creates or updates an encryption scope under the specified storage account. If an encryption scope is already created and a subsequent request is issued with different @@ -130,7 +130,7 @@ async def patch( account_name: str, encryption_scope_name: str, encryption_scope: "_models.EncryptionScope", - **kwargs + **kwargs: Any ) -> "_models.EncryptionScope": """Update encryption scope properties as specified in the request body. Update fails if the specified encryption scope does not already exist. @@ -207,7 +207,7 @@ async def get( resource_group_name: str, account_name: str, encryption_scope_name: str, - **kwargs + **kwargs: Any ) -> "_models.EncryptionScope": """Returns the properties for the specified encryption scope. @@ -275,7 +275,7 @@ def list( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.EncryptionScopeListResult"]: """Lists all the encryption scopes available under the specified storage account. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_file_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_file_services_operations.py index 6119b29eafb9..766c575c1a8a 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_file_services_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_file_services_operations.py @@ -44,7 +44,7 @@ async def list( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.FileServiceItems": """List all file services in storage accounts. @@ -106,7 +106,7 @@ async def set_service_properties( resource_group_name: str, account_name: str, parameters: "_models.FileServiceProperties", - **kwargs + **kwargs: Any ) -> "_models.FileServiceProperties": """Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. @@ -178,7 +178,7 @@ async def get_service_properties( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.FileServiceProperties": """Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_file_shares_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_file_shares_operations.py index 75a5afcc8fc6..24a24b197fdb 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_file_shares_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_file_shares_operations.py @@ -48,7 +48,7 @@ def list( maxpagesize: Optional[str] = None, filter: Optional[str] = None, expand: Optional[Union[str, "_models.ListSharesExpand"]] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.FileShareItems"]: """Lists all shares. @@ -142,7 +142,7 @@ async def create( share_name: str, file_share: "_models.FileShare", expand: Optional[Union[str, "_models.PutSharesExpand"]] = None, - **kwargs + **kwargs: Any ) -> "_models.FileShare": """Creates a new share under the specified account as described by request body. The share resource includes metadata and properties for that share. It does not include a list of the @@ -228,7 +228,7 @@ async def update( account_name: str, share_name: str, file_share: "_models.FileShare", - **kwargs + **kwargs: Any ) -> "_models.FileShare": """Updates share properties as specified in request body. Properties not mentioned in the request will not be changed. Update fails if the specified share does not already exist. @@ -306,7 +306,7 @@ async def get( share_name: str, expand: Optional[str] = "stats", x_ms_snapshot: Optional[str] = None, - **kwargs + **kwargs: Any ) -> "_models.FileShare": """Gets properties of a specified share. @@ -383,7 +383,7 @@ async def delete( account_name: str, share_name: str, x_ms_snapshot: Optional[str] = None, - **kwargs + **kwargs: Any ) -> None: """Deletes specified share under its account. @@ -453,7 +453,7 @@ async def restore( account_name: str, share_name: str, deleted_share: "_models.DeletedShare", - **kwargs + **kwargs: Any ) -> None: """Restore a file share within a valid retention days if share soft delete is enabled. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_management_policies_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_management_policies_operations.py index 7a0921c93ce4..1ea23a614d2b 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_management_policies_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_management_policies_operations.py @@ -45,7 +45,7 @@ async def get( resource_group_name: str, account_name: str, management_policy_name: Union[str, "_models.ManagementPolicyName"], - **kwargs + **kwargs: Any ) -> "_models.ManagementPolicy": """Gets the managementpolicy associated with the specified storage account. @@ -112,7 +112,7 @@ async def create_or_update( account_name: str, management_policy_name: Union[str, "_models.ManagementPolicyName"], properties: "_models.ManagementPolicy", - **kwargs + **kwargs: Any ) -> "_models.ManagementPolicy": """Sets the managementpolicy to the specified storage account. @@ -185,7 +185,7 @@ async def delete( resource_group_name: str, account_name: str, management_policy_name: Union[str, "_models.ManagementPolicyName"], - **kwargs + **kwargs: Any ) -> None: """Deletes the managementpolicy associated with the specified storage account. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_object_replication_policies_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_object_replication_policies_operations.py index 245ba2166fd8..21ab00380dff 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_object_replication_policies_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_object_replication_policies_operations.py @@ -45,7 +45,7 @@ def list( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ObjectReplicationPolicies"]: """List the object replication policies associated with the storage account. @@ -124,7 +124,7 @@ async def get( resource_group_name: str, account_name: str, object_replication_policy_id: str, - **kwargs + **kwargs: Any ) -> "_models.ObjectReplicationPolicy": """Get the object replication policy of the storage account by policy ID. @@ -192,7 +192,7 @@ async def create_or_update( account_name: str, object_replication_policy_id: str, properties: "_models.ObjectReplicationPolicy", - **kwargs + **kwargs: Any ) -> "_models.ObjectReplicationPolicy": """Create or update the object replication policy of the storage account. @@ -267,7 +267,7 @@ async def delete( resource_group_name: str, account_name: str, object_replication_policy_id: str, - **kwargs + **kwargs: Any ) -> None: """Deletes the object replication policy associated with the specified storage account. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_operations.py index a530a43e9ab8..8c61f7a1cef6 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available Storage Rest API operations. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_private_endpoint_connections_operations.py index e5e87b908f6a..8672b403dac4 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_private_endpoint_connections_operations.py @@ -45,7 +45,7 @@ def list( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.PrivateEndpointConnectionListResult"]: """List all the private endpoint connections associated with the storage account. @@ -123,7 +123,7 @@ async def get( resource_group_name: str, account_name: str, private_endpoint_connection_name: str, - **kwargs + **kwargs: Any ) -> "_models.PrivateEndpointConnection": """Gets the specified private endpoint connection associated with the storage account. @@ -191,7 +191,7 @@ async def put( account_name: str, private_endpoint_connection_name: str, properties: "_models.PrivateEndpointConnection", - **kwargs + **kwargs: Any ) -> "_models.PrivateEndpointConnection": """Update the state of specified private endpoint connection associated with the storage account. @@ -265,7 +265,7 @@ async def delete( resource_group_name: str, account_name: str, private_endpoint_connection_name: str, - **kwargs + **kwargs: Any ) -> None: """Deletes the specified private endpoint connection associated with the storage account. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_private_link_resources_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_private_link_resources_operations.py index 1aa45ba299c7..7ec8b65a6d38 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_private_link_resources_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_private_link_resources_operations.py @@ -44,7 +44,7 @@ async def list_by_storage_account( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.PrivateLinkResourceListResult": """Gets the private link resources that need to be created for a storage account. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_queue_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_queue_operations.py index 6a458c786a06..c65263b21845 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_queue_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_queue_operations.py @@ -47,7 +47,7 @@ async def create( account_name: str, queue_name: str, queue: "_models.StorageQueue", - **kwargs + **kwargs: Any ) -> "_models.StorageQueue": """Creates a new queue with the specified queue name, under the specified account. @@ -123,7 +123,7 @@ async def update( account_name: str, queue_name: str, queue: "_models.StorageQueue", - **kwargs + **kwargs: Any ) -> "_models.StorageQueue": """Creates a new queue with the specified queue name, under the specified account. @@ -198,7 +198,7 @@ async def get( resource_group_name: str, account_name: str, queue_name: str, - **kwargs + **kwargs: Any ) -> "_models.StorageQueue": """Gets the queue with the specified queue name, under the specified account if it exists. @@ -266,7 +266,7 @@ async def delete( resource_group_name: str, account_name: str, queue_name: str, - **kwargs + **kwargs: Any ) -> None: """Deletes the queue with the specified queue name, under the specified account if it exists. @@ -332,7 +332,7 @@ def list( account_name: str, maxpagesize: Optional[str] = None, filter: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ListQueueResource"]: """Gets a list of all the queues under the specified storage account. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_queue_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_queue_services_operations.py index e227d53079de..50d8d539200a 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_queue_services_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_queue_services_operations.py @@ -44,7 +44,7 @@ async def list( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.ListQueueServices": """List all queue services for the storage account. @@ -106,7 +106,7 @@ async def set_service_properties( resource_group_name: str, account_name: str, parameters: "_models.QueueServiceProperties", - **kwargs + **kwargs: Any ) -> "_models.QueueServiceProperties": """Sets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. @@ -178,7 +178,7 @@ async def get_service_properties( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.QueueServiceProperties": """Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_skus_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_skus_operations.py index 9b02b3478751..c1d7a093c045 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_skus_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_skus_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.StorageSkuListResult"]: """Lists the available SKUs supported by Microsoft.Storage for given subscription. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_storage_accounts_operations.py index cc717da406df..25959d4c323d 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_storage_accounts_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_storage_accounts_operations.py @@ -46,7 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def check_name_availability( self, account_name: "_models.StorageAccountCheckNameAvailabilityParameters", - **kwargs + **kwargs: Any ) -> "_models.CheckNameAvailabilityResult": """Checks that the storage account name is valid and is not already in use. @@ -108,7 +108,7 @@ async def _create_initial( resource_group_name: str, account_name: str, parameters: "_models.StorageAccountCreateParameters", - **kwargs + **kwargs: Any ) -> Optional["_models.StorageAccount"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StorageAccount"]] error_map = { @@ -163,7 +163,7 @@ async def begin_create( resource_group_name: str, account_name: str, parameters: "_models.StorageAccountCreateParameters", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.StorageAccount"]: """Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the @@ -181,8 +181,8 @@ async def begin_create( :type parameters: ~azure.mgmt.storage.v2021_01_01.models.StorageAccountCreateParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either StorageAccount or the result of cls(response) @@ -239,7 +239,7 @@ async def delete( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> None: """Deletes a storage account in Microsoft Azure. @@ -296,7 +296,7 @@ async def get_properties( resource_group_name: str, account_name: str, expand: Optional[Union[str, "_models.StorageAccountExpand"]] = None, - **kwargs + **kwargs: Any ) -> "_models.StorageAccount": """Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage @@ -366,7 +366,7 @@ async def update( resource_group_name: str, account_name: str, parameters: "_models.StorageAccountUpdateParameters", - **kwargs + **kwargs: Any ) -> "_models.StorageAccount": """The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also be used to map the account to a custom domain. Only one custom @@ -439,7 +439,7 @@ async def update( def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.StorageAccountListResult"]: """Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. @@ -507,7 +507,7 @@ async def get_next(next_link=None): def list_by_resource_group( self, resource_group_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.StorageAccountListResult"]: """Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this. @@ -581,7 +581,7 @@ async def list_keys( resource_group_name: str, account_name: str, expand: Optional[str] = "kerb", - **kwargs + **kwargs: Any ) -> "_models.StorageAccountListKeysResult": """Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. @@ -648,7 +648,7 @@ async def regenerate_key( resource_group_name: str, account_name: str, regenerate_key: "_models.StorageAccountRegenerateKeyParameters", - **kwargs + **kwargs: Any ) -> "_models.StorageAccountListKeysResult": """Regenerates one of the access keys or Kerberos keys for the specified storage account. @@ -718,7 +718,7 @@ async def list_account_sas( resource_group_name: str, account_name: str, parameters: "_models.AccountSasParameters", - **kwargs + **kwargs: Any ) -> "_models.ListAccountSasResponse": """List SAS credentials of a storage account. @@ -787,7 +787,7 @@ async def list_service_sas( resource_group_name: str, account_name: str, parameters: "_models.ServiceSasParameters", - **kwargs + **kwargs: Any ) -> "_models.ListServiceSasResponse": """List service SAS credentials of a specific resource. @@ -855,7 +855,7 @@ async def _failover_initial( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { @@ -897,7 +897,7 @@ async def begin_failover( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Failover request can be triggered for a storage account in case of availability issues. The failover occurs from the storage account's primary cluster to secondary cluster for RA-GRS @@ -912,8 +912,8 @@ async def begin_failover( :type account_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) @@ -967,7 +967,7 @@ async def _restore_blob_ranges_initial( resource_group_name: str, account_name: str, parameters: "_models.BlobRestoreParameters", - **kwargs + **kwargs: Any ) -> "_models.BlobRestoreStatus": cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobRestoreStatus"] error_map = { @@ -1024,7 +1024,7 @@ async def begin_restore_blob_ranges( resource_group_name: str, account_name: str, parameters: "_models.BlobRestoreParameters", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.BlobRestoreStatus"]: """Restore blobs in the specified blob ranges. @@ -1039,8 +1039,8 @@ async def begin_restore_blob_ranges( :type parameters: ~azure.mgmt.storage.v2021_01_01.models.BlobRestoreParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either BlobRestoreStatus or the result of cls(response) @@ -1097,7 +1097,7 @@ async def revoke_user_delegation_keys( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> None: """Revoke user delegation keys. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_table_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_table_operations.py index 2e6bf256ac37..a3a14fac8cac 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_table_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_table_operations.py @@ -46,7 +46,7 @@ async def create( resource_group_name: str, account_name: str, table_name: str, - **kwargs + **kwargs: Any ) -> "_models.Table": """Creates a new table with the specified table name, under the specified account. @@ -113,7 +113,7 @@ async def update( resource_group_name: str, account_name: str, table_name: str, - **kwargs + **kwargs: Any ) -> "_models.Table": """Creates a new table with the specified table name, under the specified account. @@ -180,7 +180,7 @@ async def get( resource_group_name: str, account_name: str, table_name: str, - **kwargs + **kwargs: Any ) -> "_models.Table": """Gets the table with the specified table name, under the specified account if it exists. @@ -247,7 +247,7 @@ async def delete( resource_group_name: str, account_name: str, table_name: str, - **kwargs + **kwargs: Any ) -> None: """Deletes the table with the specified table name, under the specified account if it exists. @@ -310,7 +310,7 @@ def list( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ListTableResource"]: """Gets a list of all the tables under the specified storage account. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_table_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_table_services_operations.py index 44d0e79680df..7eae020c5aa5 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_table_services_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_table_services_operations.py @@ -44,7 +44,7 @@ async def list( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.ListTableServices": """List all table services for the storage account. @@ -106,7 +106,7 @@ async def set_service_properties( resource_group_name: str, account_name: str, parameters: "_models.TableServiceProperties", - **kwargs + **kwargs: Any ) -> "_models.TableServiceProperties": """Sets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. @@ -178,7 +178,7 @@ async def get_service_properties( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.TableServiceProperties": """Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_usages_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_usages_operations.py index 4fb31d3652c0..8533cd128a13 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_usages_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/aio/operations/_usages_operations.py @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list_by_location( self, location: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.UsageListResult"]: """Gets the current usage count and the limit for the resources of the location under the subscription. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/models/_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/models/_models.py index 82dfb0a2f5e6..21a22e103718 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/models/_models.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/models/_models.py @@ -2155,20 +2155,18 @@ def __init__( class IPRule(msrest.serialization.Model): """IP rule with specific IP or IP range in CIDR format. - Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. :type ip_address_or_range: str - :ivar action: The action of IP ACL rule. Default value: "Allow". - :vartype action: str + :param action: The action of IP ACL rule. The only acceptable values to pass in are None and + "Allow". The default value is None. + :type action: str """ _validation = { 'ip_address_or_range': {'required': True}, - 'action': {'constant': True}, } _attribute_map = { @@ -2176,14 +2174,13 @@ class IPRule(msrest.serialization.Model): 'action': {'key': 'action', 'type': 'str'}, } - action = "Allow" - def __init__( self, **kwargs ): super(IPRule, self).__init__(**kwargs) self.ip_address_or_range = kwargs['ip_address_or_range'] + self.action = kwargs.get('action', None) class KeyVaultProperties(msrest.serialization.Model): @@ -4356,7 +4353,7 @@ class StorageAccountCheckNameAvailabilityParameters(msrest.serialization.Model): :param name: Required. The storage account name. :type name: str - :ivar type: Required. The type of resource, Microsoft.Storage/storageAccounts. Default value: + :ivar type: The type of resource, Microsoft.Storage/storageAccounts. Has constant value: "Microsoft.Storage/storageAccounts". :vartype type: str """ @@ -5259,15 +5256,14 @@ def __init__( class VirtualNetworkRule(msrest.serialization.Model): """Virtual Network rule. - Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. :param virtual_network_resource_id: Required. Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. :type virtual_network_resource_id: str - :ivar action: The action of virtual network rule. Default value: "Allow". - :vartype action: str + :param action: The action of virtual network rule. The only acceptable values to pass in are + None and "Allow". The default value is None. + :type action: str :param state: Gets the state of virtual network rule. Possible values include: "provisioning", "deprovisioning", "succeeded", "failed", "networkSourceDeleted". :type state: str or ~azure.mgmt.storage.v2021_01_01.models.State @@ -5275,7 +5271,6 @@ class VirtualNetworkRule(msrest.serialization.Model): _validation = { 'virtual_network_resource_id': {'required': True}, - 'action': {'constant': True}, } _attribute_map = { @@ -5284,12 +5279,11 @@ class VirtualNetworkRule(msrest.serialization.Model): 'state': {'key': 'state', 'type': 'str'}, } - action = "Allow" - def __init__( self, **kwargs ): super(VirtualNetworkRule, self).__init__(**kwargs) self.virtual_network_resource_id = kwargs['virtual_network_resource_id'] + self.action = kwargs.get('action', None) self.state = kwargs.get('state', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/models/_models_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/models/_models_py3.py index 03af40e76c6a..ce32c8537084 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/models/_models_py3.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/models/_models_py3.py @@ -2310,20 +2310,18 @@ def __init__( class IPRule(msrest.serialization.Model): """IP rule with specific IP or IP range in CIDR format. - Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. :type ip_address_or_range: str - :ivar action: The action of IP ACL rule. Default value: "Allow". - :vartype action: str + :param action: The action of IP ACL rule. The only acceptable values to pass in are None and + "Allow". The default value is None. + :type action: str """ _validation = { 'ip_address_or_range': {'required': True}, - 'action': {'constant': True}, } _attribute_map = { @@ -2331,16 +2329,16 @@ class IPRule(msrest.serialization.Model): 'action': {'key': 'action', 'type': 'str'}, } - action = "Allow" - def __init__( self, *, ip_address_or_range: str, + action: Optional[str] = None, **kwargs ): super(IPRule, self).__init__(**kwargs) self.ip_address_or_range = ip_address_or_range + self.action = action class KeyVaultProperties(msrest.serialization.Model): @@ -4697,7 +4695,7 @@ class StorageAccountCheckNameAvailabilityParameters(msrest.serialization.Model): :param name: Required. The storage account name. :type name: str - :ivar type: Required. The type of resource, Microsoft.Storage/storageAccounts. Default value: + :ivar type: The type of resource, Microsoft.Storage/storageAccounts. Has constant value: "Microsoft.Storage/storageAccounts". :vartype type: str """ @@ -5657,15 +5655,14 @@ def __init__( class VirtualNetworkRule(msrest.serialization.Model): """Virtual Network rule. - Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. :param virtual_network_resource_id: Required. Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. :type virtual_network_resource_id: str - :ivar action: The action of virtual network rule. Default value: "Allow". - :vartype action: str + :param action: The action of virtual network rule. The only acceptable values to pass in are + None and "Allow". The default value is None. + :type action: str :param state: Gets the state of virtual network rule. Possible values include: "provisioning", "deprovisioning", "succeeded", "failed", "networkSourceDeleted". :type state: str or ~azure.mgmt.storage.v2021_01_01.models.State @@ -5673,7 +5670,6 @@ class VirtualNetworkRule(msrest.serialization.Model): _validation = { 'virtual_network_resource_id': {'required': True}, - 'action': {'constant': True}, } _attribute_map = { @@ -5682,15 +5678,15 @@ class VirtualNetworkRule(msrest.serialization.Model): 'state': {'key': 'state', 'type': 'str'}, } - action = "Allow" - def __init__( self, *, virtual_network_resource_id: str, + action: Optional[str] = None, state: Optional[Union[str, "State"]] = None, **kwargs ): super(VirtualNetworkRule, self).__init__(**kwargs) self.virtual_network_resource_id = virtual_network_resource_id + self.action = action self.state = state diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/operations/_storage_accounts_operations.py index 69abcfc2cf5e..97ccc9fd067e 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/operations/_storage_accounts_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_01_01/operations/_storage_accounts_operations.py @@ -188,8 +188,8 @@ def begin_create( :type parameters: ~azure.mgmt.storage.v2021_01_01.models.StorageAccountCreateParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either StorageAccount or the result of cls(response) @@ -930,8 +930,8 @@ def begin_failover( :type account_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) @@ -1059,8 +1059,8 @@ def begin_restore_blob_ranges( :type parameters: ~azure.mgmt.storage.v2021_01_01.models.BlobRestoreParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either BlobRestoreStatus or the result of cls(response) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/_version.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/_version.py index 8dae91701610..232662316d4d 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/_version.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "18.0.0" +VERSION = "19.0.0" diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_blob_containers_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_blob_containers_operations.py index 93a6259bbb18..7773c9cb187e 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_blob_containers_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_blob_containers_operations.py @@ -48,7 +48,7 @@ def list( maxpagesize: Optional[str] = None, filter: Optional[str] = None, include: Optional[Union[str, "_models.ListContainersInclude"]] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ListContainerItems"]: """Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. @@ -142,7 +142,7 @@ async def create( account_name: str, container_name: str, blob_container: "_models.BlobContainer", - **kwargs + **kwargs: Any ) -> "_models.BlobContainer": """Creates a new container under the specified account as described by request body. The container resource includes metadata and properties for that container. It does not include a list of the @@ -224,7 +224,7 @@ async def update( account_name: str, container_name: str, blob_container: "_models.BlobContainer", - **kwargs + **kwargs: Any ) -> "_models.BlobContainer": """Updates container properties as specified in request body. Properties not mentioned in the request will be unchanged. Update fails if the specified container doesn't already exist. @@ -300,7 +300,7 @@ async def get( resource_group_name: str, account_name: str, container_name: str, - **kwargs + **kwargs: Any ) -> "_models.BlobContainer": """Gets properties of a specified container. @@ -368,7 +368,7 @@ async def delete( resource_group_name: str, account_name: str, container_name: str, - **kwargs + **kwargs: Any ) -> None: """Deletes specified container under its account. @@ -432,7 +432,7 @@ async def set_legal_hold( account_name: str, container_name: str, legal_hold: "_models.LegalHold", - **kwargs + **kwargs: Any ) -> "_models.LegalHold": """Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append pattern and does not clear out the existing tags that are not specified in @@ -510,7 +510,7 @@ async def clear_legal_hold( account_name: str, container_name: str, legal_hold: "_models.LegalHold", - **kwargs + **kwargs: Any ) -> "_models.LegalHold": """Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold clears out only the specified tags in the request. @@ -588,7 +588,7 @@ async def create_or_update_immutability_policy( container_name: str, if_match: Optional[str] = None, parameters: Optional["_models.ImmutabilityPolicy"] = None, - **kwargs + **kwargs: Any ) -> "_models.ImmutabilityPolicy": """Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for this operation. @@ -679,7 +679,7 @@ async def get_immutability_policy( account_name: str, container_name: str, if_match: Optional[str] = None, - **kwargs + **kwargs: Any ) -> "_models.ImmutabilityPolicy": """Gets the existing immutability policy along with the corresponding ETag in response headers and body. @@ -759,7 +759,7 @@ async def delete_immutability_policy( account_name: str, container_name: str, if_match: str, - **kwargs + **kwargs: Any ) -> "_models.ImmutabilityPolicy": """Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is required for this @@ -840,7 +840,7 @@ async def lock_immutability_policy( account_name: str, container_name: str, if_match: str, - **kwargs + **kwargs: Any ) -> "_models.ImmutabilityPolicy": """Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. @@ -918,7 +918,7 @@ async def extend_immutability_policy( container_name: str, if_match: str, parameters: Optional["_models.ImmutabilityPolicy"] = None, - **kwargs + **kwargs: Any ) -> "_models.ImmutabilityPolicy": """Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a Locked policy will be this action. ETag in If-Match is required for this @@ -1007,7 +1007,7 @@ async def lease( account_name: str, container_name: str, parameters: Optional["_models.LeaseContainerRequest"] = None, - **kwargs + **kwargs: Any ) -> "_models.LeaseContainerResponse": """The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_blob_inventory_policies_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_blob_inventory_policies_operations.py index 3632455f240c..26347aabee8d 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_blob_inventory_policies_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_blob_inventory_policies_operations.py @@ -46,7 +46,7 @@ async def get( resource_group_name: str, account_name: str, blob_inventory_policy_name: Union[str, "_models.BlobInventoryPolicyName"], - **kwargs + **kwargs: Any ) -> "_models.BlobInventoryPolicy": """Gets the blob inventory policy associated with the specified storage account. @@ -114,7 +114,7 @@ async def create_or_update( account_name: str, blob_inventory_policy_name: Union[str, "_models.BlobInventoryPolicyName"], properties: "_models.BlobInventoryPolicy", - **kwargs + **kwargs: Any ) -> "_models.BlobInventoryPolicy": """Sets the blob inventory policy to the specified storage account. @@ -188,7 +188,7 @@ async def delete( resource_group_name: str, account_name: str, blob_inventory_policy_name: Union[str, "_models.BlobInventoryPolicyName"], - **kwargs + **kwargs: Any ) -> None: """Deletes the blob inventory policy associated with the specified storage account. @@ -251,7 +251,7 @@ def list( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ListBlobInventoryPolicy"]: """Gets the blob inventory policy associated with the specified storage account. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_blob_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_blob_services_operations.py index 107ccf855fda..eac22724fa55 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_blob_services_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_blob_services_operations.py @@ -45,7 +45,7 @@ def list( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.BlobServiceItems"]: """List blob services of storage account. It returns a collection of one object named default. @@ -123,7 +123,7 @@ async def set_service_properties( resource_group_name: str, account_name: str, parameters: "_models.BlobServiceProperties", - **kwargs + **kwargs: Any ) -> "_models.BlobServiceProperties": """Sets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. @@ -195,7 +195,7 @@ async def get_service_properties( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.BlobServiceProperties": """Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_deleted_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_deleted_accounts_operations.py index 196e515bbc06..493edc60ee1c 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_deleted_accounts_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_deleted_accounts_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.DeletedAccountListResult"]: """Lists deleted accounts under the subscription. @@ -112,7 +112,7 @@ async def get( self, deleted_account_name: str, location: str, - **kwargs + **kwargs: Any ) -> "_models.DeletedAccount": """Get properties of specified deleted account resource. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_encryption_scopes_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_encryption_scopes_operations.py index 1cb92ae29889..8e4cfa289175 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_encryption_scopes_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_encryption_scopes_operations.py @@ -47,7 +47,7 @@ async def put( account_name: str, encryption_scope_name: str, encryption_scope: "_models.EncryptionScope", - **kwargs + **kwargs: Any ) -> "_models.EncryptionScope": """Synchronously creates or updates an encryption scope under the specified storage account. If an encryption scope is already created and a subsequent request is issued with different @@ -130,7 +130,7 @@ async def patch( account_name: str, encryption_scope_name: str, encryption_scope: "_models.EncryptionScope", - **kwargs + **kwargs: Any ) -> "_models.EncryptionScope": """Update encryption scope properties as specified in the request body. Update fails if the specified encryption scope does not already exist. @@ -207,7 +207,7 @@ async def get( resource_group_name: str, account_name: str, encryption_scope_name: str, - **kwargs + **kwargs: Any ) -> "_models.EncryptionScope": """Returns the properties for the specified encryption scope. @@ -275,7 +275,7 @@ def list( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.EncryptionScopeListResult"]: """Lists all the encryption scopes available under the specified storage account. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_file_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_file_services_operations.py index bd5806166571..b1a8c6fdfdca 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_file_services_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_file_services_operations.py @@ -44,7 +44,7 @@ async def list( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.FileServiceItems": """List all file services in storage accounts. @@ -106,7 +106,7 @@ async def set_service_properties( resource_group_name: str, account_name: str, parameters: "_models.FileServiceProperties", - **kwargs + **kwargs: Any ) -> "_models.FileServiceProperties": """Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. @@ -178,7 +178,7 @@ async def get_service_properties( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.FileServiceProperties": """Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_file_shares_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_file_shares_operations.py index 6c33de0ea4cb..28fdb0080068 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_file_shares_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_file_shares_operations.py @@ -48,7 +48,7 @@ def list( maxpagesize: Optional[str] = None, filter: Optional[str] = None, expand: Optional[Union[str, "_models.ListSharesExpand"]] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.FileShareItems"]: """Lists all shares. @@ -142,7 +142,7 @@ async def create( share_name: str, file_share: "_models.FileShare", expand: Optional[Union[str, "_models.PutSharesExpand"]] = None, - **kwargs + **kwargs: Any ) -> "_models.FileShare": """Creates a new share under the specified account as described by request body. The share resource includes metadata and properties for that share. It does not include a list of the @@ -228,7 +228,7 @@ async def update( account_name: str, share_name: str, file_share: "_models.FileShare", - **kwargs + **kwargs: Any ) -> "_models.FileShare": """Updates share properties as specified in request body. Properties not mentioned in the request will not be changed. Update fails if the specified share does not already exist. @@ -306,7 +306,7 @@ async def get( share_name: str, expand: Optional[str] = "stats", x_ms_snapshot: Optional[str] = None, - **kwargs + **kwargs: Any ) -> "_models.FileShare": """Gets properties of a specified share. @@ -383,7 +383,7 @@ async def delete( account_name: str, share_name: str, x_ms_snapshot: Optional[str] = None, - **kwargs + **kwargs: Any ) -> None: """Deletes specified share under its account. @@ -453,7 +453,7 @@ async def restore( account_name: str, share_name: str, deleted_share: "_models.DeletedShare", - **kwargs + **kwargs: Any ) -> None: """Restore a file share within a valid retention days if share soft delete is enabled. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_management_policies_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_management_policies_operations.py index bce6df27a310..6ff754af14a1 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_management_policies_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_management_policies_operations.py @@ -45,7 +45,7 @@ async def get( resource_group_name: str, account_name: str, management_policy_name: Union[str, "_models.ManagementPolicyName"], - **kwargs + **kwargs: Any ) -> "_models.ManagementPolicy": """Gets the managementpolicy associated with the specified storage account. @@ -112,7 +112,7 @@ async def create_or_update( account_name: str, management_policy_name: Union[str, "_models.ManagementPolicyName"], properties: "_models.ManagementPolicy", - **kwargs + **kwargs: Any ) -> "_models.ManagementPolicy": """Sets the managementpolicy to the specified storage account. @@ -185,7 +185,7 @@ async def delete( resource_group_name: str, account_name: str, management_policy_name: Union[str, "_models.ManagementPolicyName"], - **kwargs + **kwargs: Any ) -> None: """Deletes the managementpolicy associated with the specified storage account. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_object_replication_policies_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_object_replication_policies_operations.py index c3cc925b7205..1cc042f1c30b 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_object_replication_policies_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_object_replication_policies_operations.py @@ -45,7 +45,7 @@ def list( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ObjectReplicationPolicies"]: """List the object replication policies associated with the storage account. @@ -124,7 +124,7 @@ async def get( resource_group_name: str, account_name: str, object_replication_policy_id: str, - **kwargs + **kwargs: Any ) -> "_models.ObjectReplicationPolicy": """Get the object replication policy of the storage account by policy ID. @@ -192,7 +192,7 @@ async def create_or_update( account_name: str, object_replication_policy_id: str, properties: "_models.ObjectReplicationPolicy", - **kwargs + **kwargs: Any ) -> "_models.ObjectReplicationPolicy": """Create or update the object replication policy of the storage account. @@ -267,7 +267,7 @@ async def delete( resource_group_name: str, account_name: str, object_replication_policy_id: str, - **kwargs + **kwargs: Any ) -> None: """Deletes the object replication policy associated with the specified storage account. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_operations.py index 4036d17d9d95..4defdab67ac3 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available Storage Rest API operations. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_private_endpoint_connections_operations.py index 83e966eb8b9d..d35508c36cca 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_private_endpoint_connections_operations.py @@ -45,7 +45,7 @@ def list( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.PrivateEndpointConnectionListResult"]: """List all the private endpoint connections associated with the storage account. @@ -123,7 +123,7 @@ async def get( resource_group_name: str, account_name: str, private_endpoint_connection_name: str, - **kwargs + **kwargs: Any ) -> "_models.PrivateEndpointConnection": """Gets the specified private endpoint connection associated with the storage account. @@ -191,7 +191,7 @@ async def put( account_name: str, private_endpoint_connection_name: str, properties: "_models.PrivateEndpointConnection", - **kwargs + **kwargs: Any ) -> "_models.PrivateEndpointConnection": """Update the state of specified private endpoint connection associated with the storage account. @@ -265,7 +265,7 @@ async def delete( resource_group_name: str, account_name: str, private_endpoint_connection_name: str, - **kwargs + **kwargs: Any ) -> None: """Deletes the specified private endpoint connection associated with the storage account. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_private_link_resources_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_private_link_resources_operations.py index 0313d0ec6e5c..b510330027ad 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_private_link_resources_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_private_link_resources_operations.py @@ -44,7 +44,7 @@ async def list_by_storage_account( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.PrivateLinkResourceListResult": """Gets the private link resources that need to be created for a storage account. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_queue_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_queue_operations.py index b21d186ba979..cfb603403b6e 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_queue_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_queue_operations.py @@ -47,7 +47,7 @@ async def create( account_name: str, queue_name: str, queue: "_models.StorageQueue", - **kwargs + **kwargs: Any ) -> "_models.StorageQueue": """Creates a new queue with the specified queue name, under the specified account. @@ -123,7 +123,7 @@ async def update( account_name: str, queue_name: str, queue: "_models.StorageQueue", - **kwargs + **kwargs: Any ) -> "_models.StorageQueue": """Creates a new queue with the specified queue name, under the specified account. @@ -198,7 +198,7 @@ async def get( resource_group_name: str, account_name: str, queue_name: str, - **kwargs + **kwargs: Any ) -> "_models.StorageQueue": """Gets the queue with the specified queue name, under the specified account if it exists. @@ -266,7 +266,7 @@ async def delete( resource_group_name: str, account_name: str, queue_name: str, - **kwargs + **kwargs: Any ) -> None: """Deletes the queue with the specified queue name, under the specified account if it exists. @@ -332,7 +332,7 @@ def list( account_name: str, maxpagesize: Optional[str] = None, filter: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ListQueueResource"]: """Gets a list of all the queues under the specified storage account. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_queue_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_queue_services_operations.py index fa3a764c26ca..916c0cb85c1d 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_queue_services_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_queue_services_operations.py @@ -44,7 +44,7 @@ async def list( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.ListQueueServices": """List all queue services for the storage account. @@ -106,7 +106,7 @@ async def set_service_properties( resource_group_name: str, account_name: str, parameters: "_models.QueueServiceProperties", - **kwargs + **kwargs: Any ) -> "_models.QueueServiceProperties": """Sets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. @@ -178,7 +178,7 @@ async def get_service_properties( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.QueueServiceProperties": """Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_skus_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_skus_operations.py index 5300036c1d52..53e098893fa7 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_skus_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_skus_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.StorageSkuListResult"]: """Lists the available SKUs supported by Microsoft.Storage for given subscription. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_storage_accounts_operations.py index 731e6ef4ee70..e60dfe68b399 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_storage_accounts_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_storage_accounts_operations.py @@ -46,7 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def check_name_availability( self, account_name: "_models.StorageAccountCheckNameAvailabilityParameters", - **kwargs + **kwargs: Any ) -> "_models.CheckNameAvailabilityResult": """Checks that the storage account name is valid and is not already in use. @@ -108,7 +108,7 @@ async def _create_initial( resource_group_name: str, account_name: str, parameters: "_models.StorageAccountCreateParameters", - **kwargs + **kwargs: Any ) -> Optional["_models.StorageAccount"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StorageAccount"]] error_map = { @@ -163,7 +163,7 @@ async def begin_create( resource_group_name: str, account_name: str, parameters: "_models.StorageAccountCreateParameters", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.StorageAccount"]: """Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the @@ -181,8 +181,8 @@ async def begin_create( :type parameters: ~azure.mgmt.storage.v2021_02_01.models.StorageAccountCreateParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either StorageAccount or the result of cls(response) @@ -239,7 +239,7 @@ async def delete( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> None: """Deletes a storage account in Microsoft Azure. @@ -296,7 +296,7 @@ async def get_properties( resource_group_name: str, account_name: str, expand: Optional[Union[str, "_models.StorageAccountExpand"]] = None, - **kwargs + **kwargs: Any ) -> "_models.StorageAccount": """Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage @@ -366,7 +366,7 @@ async def update( resource_group_name: str, account_name: str, parameters: "_models.StorageAccountUpdateParameters", - **kwargs + **kwargs: Any ) -> "_models.StorageAccount": """The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also be used to map the account to a custom domain. Only one custom @@ -439,7 +439,7 @@ async def update( def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.StorageAccountListResult"]: """Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. @@ -507,7 +507,7 @@ async def get_next(next_link=None): def list_by_resource_group( self, resource_group_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.StorageAccountListResult"]: """Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this. @@ -581,7 +581,7 @@ async def list_keys( resource_group_name: str, account_name: str, expand: Optional[str] = "kerb", - **kwargs + **kwargs: Any ) -> "_models.StorageAccountListKeysResult": """Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. @@ -648,7 +648,7 @@ async def regenerate_key( resource_group_name: str, account_name: str, regenerate_key: "_models.StorageAccountRegenerateKeyParameters", - **kwargs + **kwargs: Any ) -> "_models.StorageAccountListKeysResult": """Regenerates one of the access keys or Kerberos keys for the specified storage account. @@ -718,7 +718,7 @@ async def list_account_sas( resource_group_name: str, account_name: str, parameters: "_models.AccountSasParameters", - **kwargs + **kwargs: Any ) -> "_models.ListAccountSasResponse": """List SAS credentials of a storage account. @@ -787,7 +787,7 @@ async def list_service_sas( resource_group_name: str, account_name: str, parameters: "_models.ServiceSasParameters", - **kwargs + **kwargs: Any ) -> "_models.ListServiceSasResponse": """List service SAS credentials of a specific resource. @@ -855,7 +855,7 @@ async def _failover_initial( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { @@ -897,7 +897,7 @@ async def begin_failover( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Failover request can be triggered for a storage account in case of availability issues. The failover occurs from the storage account's primary cluster to secondary cluster for RA-GRS @@ -912,8 +912,8 @@ async def begin_failover( :type account_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) @@ -967,7 +967,7 @@ async def _restore_blob_ranges_initial( resource_group_name: str, account_name: str, parameters: "_models.BlobRestoreParameters", - **kwargs + **kwargs: Any ) -> "_models.BlobRestoreStatus": cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobRestoreStatus"] error_map = { @@ -1024,7 +1024,7 @@ async def begin_restore_blob_ranges( resource_group_name: str, account_name: str, parameters: "_models.BlobRestoreParameters", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.BlobRestoreStatus"]: """Restore blobs in the specified blob ranges. @@ -1039,8 +1039,8 @@ async def begin_restore_blob_ranges( :type parameters: ~azure.mgmt.storage.v2021_02_01.models.BlobRestoreParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either BlobRestoreStatus or the result of cls(response) @@ -1097,7 +1097,7 @@ async def revoke_user_delegation_keys( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> None: """Revoke user delegation keys. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_table_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_table_operations.py index ca8574cc7a2c..6d851ce472df 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_table_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_table_operations.py @@ -46,7 +46,7 @@ async def create( resource_group_name: str, account_name: str, table_name: str, - **kwargs + **kwargs: Any ) -> "_models.Table": """Creates a new table with the specified table name, under the specified account. @@ -113,7 +113,7 @@ async def update( resource_group_name: str, account_name: str, table_name: str, - **kwargs + **kwargs: Any ) -> "_models.Table": """Creates a new table with the specified table name, under the specified account. @@ -180,7 +180,7 @@ async def get( resource_group_name: str, account_name: str, table_name: str, - **kwargs + **kwargs: Any ) -> "_models.Table": """Gets the table with the specified table name, under the specified account if it exists. @@ -247,7 +247,7 @@ async def delete( resource_group_name: str, account_name: str, table_name: str, - **kwargs + **kwargs: Any ) -> None: """Deletes the table with the specified table name, under the specified account if it exists. @@ -310,7 +310,7 @@ def list( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ListTableResource"]: """Gets a list of all the tables under the specified storage account. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_table_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_table_services_operations.py index 97ee89d6311d..fc661d2fd5d0 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_table_services_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_table_services_operations.py @@ -44,7 +44,7 @@ async def list( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.ListTableServices": """List all table services for the storage account. @@ -106,7 +106,7 @@ async def set_service_properties( resource_group_name: str, account_name: str, parameters: "_models.TableServiceProperties", - **kwargs + **kwargs: Any ) -> "_models.TableServiceProperties": """Sets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. @@ -178,7 +178,7 @@ async def get_service_properties( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.TableServiceProperties": """Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_usages_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_usages_operations.py index 87533c9f9d5f..2f546eb90431 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_usages_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/aio/operations/_usages_operations.py @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list_by_location( self, location: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.UsageListResult"]: """Gets the current usage count and the limit for the resources of the location under the subscription. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/models/_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/models/_models.py index 269879ababdb..4dc29f6b362c 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/models/_models.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/models/_models.py @@ -2155,20 +2155,18 @@ def __init__( class IPRule(msrest.serialization.Model): """IP rule with specific IP or IP range in CIDR format. - Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. :type ip_address_or_range: str - :ivar action: The action of IP ACL rule. Default value: "Allow". - :vartype action: str + :param action: The action of IP ACL rule. The only acceptable values to pass in are None and + "Allow". The default value is None. + :type action: str """ _validation = { 'ip_address_or_range': {'required': True}, - 'action': {'constant': True}, } _attribute_map = { @@ -2176,14 +2174,13 @@ class IPRule(msrest.serialization.Model): 'action': {'key': 'action', 'type': 'str'}, } - action = "Allow" - def __init__( self, **kwargs ): super(IPRule, self).__init__(**kwargs) self.ip_address_or_range = kwargs['ip_address_or_range'] + self.action = kwargs.get('action', None) class KeyCreationTime(msrest.serialization.Model): @@ -4450,7 +4447,7 @@ class StorageAccountCheckNameAvailabilityParameters(msrest.serialization.Model): :param name: Required. The storage account name. :type name: str - :ivar type: Required. The type of resource, Microsoft.Storage/storageAccounts. Default value: + :ivar type: The type of resource, Microsoft.Storage/storageAccounts. Has constant value: "Microsoft.Storage/storageAccounts". :vartype type: str """ @@ -5374,15 +5371,14 @@ def __init__( class VirtualNetworkRule(msrest.serialization.Model): """Virtual Network rule. - Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. :param virtual_network_resource_id: Required. Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. :type virtual_network_resource_id: str - :ivar action: The action of virtual network rule. Default value: "Allow". - :vartype action: str + :param action: The action of virtual network rule. The only acceptable values to pass in are + None and "Allow". The default value is None. + :type action: str :param state: Gets the state of virtual network rule. Possible values include: "provisioning", "deprovisioning", "succeeded", "failed", "networkSourceDeleted". :type state: str or ~azure.mgmt.storage.v2021_02_01.models.State @@ -5390,7 +5386,6 @@ class VirtualNetworkRule(msrest.serialization.Model): _validation = { 'virtual_network_resource_id': {'required': True}, - 'action': {'constant': True}, } _attribute_map = { @@ -5399,12 +5394,11 @@ class VirtualNetworkRule(msrest.serialization.Model): 'state': {'key': 'state', 'type': 'str'}, } - action = "Allow" - def __init__( self, **kwargs ): super(VirtualNetworkRule, self).__init__(**kwargs) self.virtual_network_resource_id = kwargs['virtual_network_resource_id'] + self.action = kwargs.get('action', None) self.state = kwargs.get('state', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/models/_models_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/models/_models_py3.py index b4465626acd3..080542258ce2 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/models/_models_py3.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/models/_models_py3.py @@ -2310,20 +2310,18 @@ def __init__( class IPRule(msrest.serialization.Model): """IP rule with specific IP or IP range in CIDR format. - Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. :type ip_address_or_range: str - :ivar action: The action of IP ACL rule. Default value: "Allow". - :vartype action: str + :param action: The action of IP ACL rule. The only acceptable values to pass in are None and + "Allow". The default value is None. + :type action: str """ _validation = { 'ip_address_or_range': {'required': True}, - 'action': {'constant': True}, } _attribute_map = { @@ -2331,16 +2329,16 @@ class IPRule(msrest.serialization.Model): 'action': {'key': 'action', 'type': 'str'}, } - action = "Allow" - def __init__( self, *, ip_address_or_range: str, + action: Optional[str] = None, **kwargs ): super(IPRule, self).__init__(**kwargs) self.ip_address_or_range = ip_address_or_range + self.action = action class KeyCreationTime(msrest.serialization.Model): @@ -4799,7 +4797,7 @@ class StorageAccountCheckNameAvailabilityParameters(msrest.serialization.Model): :param name: Required. The storage account name. :type name: str - :ivar type: Required. The type of resource, Microsoft.Storage/storageAccounts. Default value: + :ivar type: The type of resource, Microsoft.Storage/storageAccounts. Has constant value: "Microsoft.Storage/storageAccounts". :vartype type: str """ @@ -5784,15 +5782,14 @@ def __init__( class VirtualNetworkRule(msrest.serialization.Model): """Virtual Network rule. - Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. :param virtual_network_resource_id: Required. Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. :type virtual_network_resource_id: str - :ivar action: The action of virtual network rule. Default value: "Allow". - :vartype action: str + :param action: The action of virtual network rule. The only acceptable values to pass in are + None and "Allow". The default value is None. + :type action: str :param state: Gets the state of virtual network rule. Possible values include: "provisioning", "deprovisioning", "succeeded", "failed", "networkSourceDeleted". :type state: str or ~azure.mgmt.storage.v2021_02_01.models.State @@ -5800,7 +5797,6 @@ class VirtualNetworkRule(msrest.serialization.Model): _validation = { 'virtual_network_resource_id': {'required': True}, - 'action': {'constant': True}, } _attribute_map = { @@ -5809,15 +5805,15 @@ class VirtualNetworkRule(msrest.serialization.Model): 'state': {'key': 'state', 'type': 'str'}, } - action = "Allow" - def __init__( self, *, virtual_network_resource_id: str, + action: Optional[str] = None, state: Optional[Union[str, "State"]] = None, **kwargs ): super(VirtualNetworkRule, self).__init__(**kwargs) self.virtual_network_resource_id = virtual_network_resource_id + self.action = action self.state = state diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/operations/_storage_accounts_operations.py index c48de05eb38d..47c07ebfcb52 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/operations/_storage_accounts_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/operations/_storage_accounts_operations.py @@ -188,8 +188,8 @@ def begin_create( :type parameters: ~azure.mgmt.storage.v2021_02_01.models.StorageAccountCreateParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either StorageAccount or the result of cls(response) @@ -930,8 +930,8 @@ def begin_failover( :type account_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) @@ -1059,8 +1059,8 @@ def begin_restore_blob_ranges( :type parameters: ~azure.mgmt.storage.v2021_02_01.models.BlobRestoreParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either BlobRestoreStatus or the result of cls(response) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/_version.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/_version.py index 8dae91701610..232662316d4d 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/_version.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "18.0.0" +VERSION = "19.0.0" diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_blob_containers_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_blob_containers_operations.py index 079288f3887c..a33a46f660c8 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_blob_containers_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_blob_containers_operations.py @@ -50,7 +50,7 @@ def list( maxpagesize: Optional[str] = None, filter: Optional[str] = None, include: Optional[Union[str, "_models.ListContainersInclude"]] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ListContainerItems"]: """Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. @@ -144,7 +144,7 @@ async def create( account_name: str, container_name: str, blob_container: "_models.BlobContainer", - **kwargs + **kwargs: Any ) -> "_models.BlobContainer": """Creates a new container under the specified account as described by request body. The container resource includes metadata and properties for that container. It does not include a list of the @@ -226,7 +226,7 @@ async def update( account_name: str, container_name: str, blob_container: "_models.BlobContainer", - **kwargs + **kwargs: Any ) -> "_models.BlobContainer": """Updates container properties as specified in request body. Properties not mentioned in the request will be unchanged. Update fails if the specified container doesn't already exist. @@ -302,7 +302,7 @@ async def get( resource_group_name: str, account_name: str, container_name: str, - **kwargs + **kwargs: Any ) -> "_models.BlobContainer": """Gets properties of a specified container. @@ -370,7 +370,7 @@ async def delete( resource_group_name: str, account_name: str, container_name: str, - **kwargs + **kwargs: Any ) -> None: """Deletes specified container under its account. @@ -434,7 +434,7 @@ async def set_legal_hold( account_name: str, container_name: str, legal_hold: "_models.LegalHold", - **kwargs + **kwargs: Any ) -> "_models.LegalHold": """Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append pattern and does not clear out the existing tags that are not specified in @@ -512,7 +512,7 @@ async def clear_legal_hold( account_name: str, container_name: str, legal_hold: "_models.LegalHold", - **kwargs + **kwargs: Any ) -> "_models.LegalHold": """Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold clears out only the specified tags in the request. @@ -590,7 +590,7 @@ async def create_or_update_immutability_policy( container_name: str, if_match: Optional[str] = None, parameters: Optional["_models.ImmutabilityPolicy"] = None, - **kwargs + **kwargs: Any ) -> "_models.ImmutabilityPolicy": """Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for this operation. @@ -681,7 +681,7 @@ async def get_immutability_policy( account_name: str, container_name: str, if_match: Optional[str] = None, - **kwargs + **kwargs: Any ) -> "_models.ImmutabilityPolicy": """Gets the existing immutability policy along with the corresponding ETag in response headers and body. @@ -761,7 +761,7 @@ async def delete_immutability_policy( account_name: str, container_name: str, if_match: str, - **kwargs + **kwargs: Any ) -> "_models.ImmutabilityPolicy": """Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is required for this @@ -842,7 +842,7 @@ async def lock_immutability_policy( account_name: str, container_name: str, if_match: str, - **kwargs + **kwargs: Any ) -> "_models.ImmutabilityPolicy": """Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. @@ -920,7 +920,7 @@ async def extend_immutability_policy( container_name: str, if_match: str, parameters: Optional["_models.ImmutabilityPolicy"] = None, - **kwargs + **kwargs: Any ) -> "_models.ImmutabilityPolicy": """Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a Locked policy will be this action. ETag in If-Match is required for this @@ -1009,7 +1009,7 @@ async def lease( account_name: str, container_name: str, parameters: Optional["_models.LeaseContainerRequest"] = None, - **kwargs + **kwargs: Any ) -> "_models.LeaseContainerResponse": """The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. @@ -1088,7 +1088,7 @@ async def _object_level_worm_initial( resource_group_name: str, account_name: str, container_name: str, - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { @@ -1134,7 +1134,7 @@ async def begin_object_level_worm( resource_group_name: str, account_name: str, container_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """This operation migrates a blob container from container level WORM to object level immutability enabled container. Prerequisites require a container level immutability policy either in locked @@ -1155,8 +1155,8 @@ async def begin_object_level_worm( :type container_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_blob_inventory_policies_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_blob_inventory_policies_operations.py index a8ce9711451e..5db228f296d8 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_blob_inventory_policies_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_blob_inventory_policies_operations.py @@ -46,7 +46,7 @@ async def get( resource_group_name: str, account_name: str, blob_inventory_policy_name: Union[str, "_models.BlobInventoryPolicyName"], - **kwargs + **kwargs: Any ) -> "_models.BlobInventoryPolicy": """Gets the blob inventory policy associated with the specified storage account. @@ -114,7 +114,7 @@ async def create_or_update( account_name: str, blob_inventory_policy_name: Union[str, "_models.BlobInventoryPolicyName"], properties: "_models.BlobInventoryPolicy", - **kwargs + **kwargs: Any ) -> "_models.BlobInventoryPolicy": """Sets the blob inventory policy to the specified storage account. @@ -188,7 +188,7 @@ async def delete( resource_group_name: str, account_name: str, blob_inventory_policy_name: Union[str, "_models.BlobInventoryPolicyName"], - **kwargs + **kwargs: Any ) -> None: """Deletes the blob inventory policy associated with the specified storage account. @@ -251,7 +251,7 @@ def list( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ListBlobInventoryPolicy"]: """Gets the blob inventory policy associated with the specified storage account. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_blob_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_blob_services_operations.py index 7f9c497b0e1e..afdd15842a39 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_blob_services_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_blob_services_operations.py @@ -45,7 +45,7 @@ def list( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.BlobServiceItems"]: """List blob services of storage account. It returns a collection of one object named default. @@ -123,7 +123,7 @@ async def set_service_properties( resource_group_name: str, account_name: str, parameters: "_models.BlobServiceProperties", - **kwargs + **kwargs: Any ) -> "_models.BlobServiceProperties": """Sets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. @@ -195,7 +195,7 @@ async def get_service_properties( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.BlobServiceProperties": """Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_deleted_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_deleted_accounts_operations.py index 66efeb4efa8e..6ef845000d4b 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_deleted_accounts_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_deleted_accounts_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.DeletedAccountListResult"]: """Lists deleted accounts under the subscription. @@ -112,7 +112,7 @@ async def get( self, deleted_account_name: str, location: str, - **kwargs + **kwargs: Any ) -> "_models.DeletedAccount": """Get properties of specified deleted account resource. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_encryption_scopes_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_encryption_scopes_operations.py index 045d6e87fcd8..c3e1d35abff2 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_encryption_scopes_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_encryption_scopes_operations.py @@ -47,7 +47,7 @@ async def put( account_name: str, encryption_scope_name: str, encryption_scope: "_models.EncryptionScope", - **kwargs + **kwargs: Any ) -> "_models.EncryptionScope": """Synchronously creates or updates an encryption scope under the specified storage account. If an encryption scope is already created and a subsequent request is issued with different @@ -130,7 +130,7 @@ async def patch( account_name: str, encryption_scope_name: str, encryption_scope: "_models.EncryptionScope", - **kwargs + **kwargs: Any ) -> "_models.EncryptionScope": """Update encryption scope properties as specified in the request body. Update fails if the specified encryption scope does not already exist. @@ -207,7 +207,7 @@ async def get( resource_group_name: str, account_name: str, encryption_scope_name: str, - **kwargs + **kwargs: Any ) -> "_models.EncryptionScope": """Returns the properties for the specified encryption scope. @@ -275,7 +275,7 @@ def list( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.EncryptionScopeListResult"]: """Lists all the encryption scopes available under the specified storage account. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_file_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_file_services_operations.py index 90530b898ac7..42a5083fc2e5 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_file_services_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_file_services_operations.py @@ -44,7 +44,7 @@ async def list( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.FileServiceItems": """List all file services in storage accounts. @@ -107,7 +107,7 @@ async def set_service_properties( resource_group_name: str, account_name: str, parameters: "_models.FileServiceProperties", - **kwargs + **kwargs: Any ) -> "_models.FileServiceProperties": """Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. @@ -180,7 +180,7 @@ async def get_service_properties( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.FileServiceProperties": """Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_file_shares_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_file_shares_operations.py index 75e8259dddf8..e61cb48fafb6 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_file_shares_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_file_shares_operations.py @@ -48,7 +48,7 @@ def list( maxpagesize: Optional[str] = None, filter: Optional[str] = None, expand: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.FileShareItems"]: """Lists all shares. @@ -144,7 +144,7 @@ async def create( share_name: str, file_share: "_models.FileShare", expand: Optional[str] = None, - **kwargs + **kwargs: Any ) -> "_models.FileShare": """Creates a new share under the specified account as described by request body. The share resource includes metadata and properties for that share. It does not include a list of the @@ -232,7 +232,7 @@ async def update( account_name: str, share_name: str, file_share: "_models.FileShare", - **kwargs + **kwargs: Any ) -> "_models.FileShare": """Updates share properties as specified in request body. Properties not mentioned in the request will not be changed. Update fails if the specified share does not already exist. @@ -311,7 +311,7 @@ async def get( share_name: str, expand: Optional[str] = None, x_ms_snapshot: Optional[str] = None, - **kwargs + **kwargs: Any ) -> "_models.FileShare": """Gets properties of a specified share. @@ -391,7 +391,7 @@ async def delete( share_name: str, x_ms_snapshot: Optional[str] = None, include: Optional[str] = None, - **kwargs + **kwargs: Any ) -> None: """Deletes specified share under its account. @@ -471,7 +471,7 @@ async def restore( account_name: str, share_name: str, deleted_share: "_models.DeletedShare", - **kwargs + **kwargs: Any ) -> None: """Restore a file share within a valid retention days if share soft delete is enabled. @@ -546,7 +546,7 @@ async def lease( share_name: str, x_ms_snapshot: Optional[str] = None, parameters: Optional["_models.LeaseShareRequest"] = None, - **kwargs + **kwargs: Any ) -> "_models.LeaseShareResponse": """The Lease Share operation establishes and manages a lock on a share for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_management_policies_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_management_policies_operations.py index 42305fc68478..d351d125a0f6 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_management_policies_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_management_policies_operations.py @@ -45,7 +45,7 @@ async def get( resource_group_name: str, account_name: str, management_policy_name: Union[str, "_models.ManagementPolicyName"], - **kwargs + **kwargs: Any ) -> "_models.ManagementPolicy": """Gets the managementpolicy associated with the specified storage account. @@ -112,7 +112,7 @@ async def create_or_update( account_name: str, management_policy_name: Union[str, "_models.ManagementPolicyName"], properties: "_models.ManagementPolicy", - **kwargs + **kwargs: Any ) -> "_models.ManagementPolicy": """Sets the managementpolicy to the specified storage account. @@ -185,7 +185,7 @@ async def delete( resource_group_name: str, account_name: str, management_policy_name: Union[str, "_models.ManagementPolicyName"], - **kwargs + **kwargs: Any ) -> None: """Deletes the managementpolicy associated with the specified storage account. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_object_replication_policies_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_object_replication_policies_operations.py index 2ff0064e0806..0d318fb806b7 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_object_replication_policies_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_object_replication_policies_operations.py @@ -45,7 +45,7 @@ def list( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ObjectReplicationPolicies"]: """List the object replication policies associated with the storage account. @@ -124,7 +124,7 @@ async def get( resource_group_name: str, account_name: str, object_replication_policy_id: str, - **kwargs + **kwargs: Any ) -> "_models.ObjectReplicationPolicy": """Get the object replication policy of the storage account by policy ID. @@ -135,8 +135,10 @@ async def get( Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. :type account_name: str - :param object_replication_policy_id: The ID of object replication policy or 'default' if the - policy ID is unknown. + :param object_replication_policy_id: For the destination account, provide the value 'default'. + Configure the policy on the destination account first. For the source account, provide the + value of the policy ID that is returned when you download the policy that was defined on the + destination account. The policy is downloaded as a JSON file. :type object_replication_policy_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ObjectReplicationPolicy, or the result of cls(response) @@ -192,7 +194,7 @@ async def create_or_update( account_name: str, object_replication_policy_id: str, properties: "_models.ObjectReplicationPolicy", - **kwargs + **kwargs: Any ) -> "_models.ObjectReplicationPolicy": """Create or update the object replication policy of the storage account. @@ -203,8 +205,10 @@ async def create_or_update( Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. :type account_name: str - :param object_replication_policy_id: The ID of object replication policy or 'default' if the - policy ID is unknown. + :param object_replication_policy_id: For the destination account, provide the value 'default'. + Configure the policy on the destination account first. For the source account, provide the + value of the policy ID that is returned when you download the policy that was defined on the + destination account. The policy is downloaded as a JSON file. :type object_replication_policy_id: str :param properties: The object replication policy set to a storage account. A unique policy ID will be created if absent. @@ -267,7 +271,7 @@ async def delete( resource_group_name: str, account_name: str, object_replication_policy_id: str, - **kwargs + **kwargs: Any ) -> None: """Deletes the object replication policy associated with the specified storage account. @@ -278,8 +282,10 @@ async def delete( Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. :type account_name: str - :param object_replication_policy_id: The ID of object replication policy or 'default' if the - policy ID is unknown. + :param object_replication_policy_id: For the destination account, provide the value 'default'. + Configure the policy on the destination account first. For the source account, provide the + value of the policy ID that is returned when you download the policy that was defined on the + destination account. The policy is downloaded as a JSON file. :type object_replication_policy_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_operations.py index 1af12ef521f6..ec690abe837d 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available Storage Rest API operations. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_private_endpoint_connections_operations.py index 3862f564a9d9..f9802d859688 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_private_endpoint_connections_operations.py @@ -45,7 +45,7 @@ def list( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.PrivateEndpointConnectionListResult"]: """List all the private endpoint connections associated with the storage account. @@ -123,7 +123,7 @@ async def get( resource_group_name: str, account_name: str, private_endpoint_connection_name: str, - **kwargs + **kwargs: Any ) -> "_models.PrivateEndpointConnection": """Gets the specified private endpoint connection associated with the storage account. @@ -191,7 +191,7 @@ async def put( account_name: str, private_endpoint_connection_name: str, properties: "_models.PrivateEndpointConnection", - **kwargs + **kwargs: Any ) -> "_models.PrivateEndpointConnection": """Update the state of specified private endpoint connection associated with the storage account. @@ -265,7 +265,7 @@ async def delete( resource_group_name: str, account_name: str, private_endpoint_connection_name: str, - **kwargs + **kwargs: Any ) -> None: """Deletes the specified private endpoint connection associated with the storage account. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_private_link_resources_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_private_link_resources_operations.py index 54748625ee56..a340af4dd0c8 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_private_link_resources_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_private_link_resources_operations.py @@ -44,7 +44,7 @@ async def list_by_storage_account( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.PrivateLinkResourceListResult": """Gets the private link resources that need to be created for a storage account. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_queue_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_queue_operations.py index 3cda7519420a..d6b2efbd39d6 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_queue_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_queue_operations.py @@ -47,7 +47,7 @@ async def create( account_name: str, queue_name: str, queue: "_models.StorageQueue", - **kwargs + **kwargs: Any ) -> "_models.StorageQueue": """Creates a new queue with the specified queue name, under the specified account. @@ -124,7 +124,7 @@ async def update( account_name: str, queue_name: str, queue: "_models.StorageQueue", - **kwargs + **kwargs: Any ) -> "_models.StorageQueue": """Creates a new queue with the specified queue name, under the specified account. @@ -200,7 +200,7 @@ async def get( resource_group_name: str, account_name: str, queue_name: str, - **kwargs + **kwargs: Any ) -> "_models.StorageQueue": """Gets the queue with the specified queue name, under the specified account if it exists. @@ -269,7 +269,7 @@ async def delete( resource_group_name: str, account_name: str, queue_name: str, - **kwargs + **kwargs: Any ) -> None: """Deletes the queue with the specified queue name, under the specified account if it exists. @@ -336,7 +336,7 @@ def list( account_name: str, maxpagesize: Optional[str] = None, filter: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ListQueueResource"]: """Gets a list of all the queues under the specified storage account. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_queue_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_queue_services_operations.py index cacf051c38df..015027550a17 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_queue_services_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_queue_services_operations.py @@ -44,7 +44,7 @@ async def list( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.ListQueueServices": """List all queue services for the storage account. @@ -107,7 +107,7 @@ async def set_service_properties( resource_group_name: str, account_name: str, parameters: "_models.QueueServiceProperties", - **kwargs + **kwargs: Any ) -> "_models.QueueServiceProperties": """Sets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. @@ -180,7 +180,7 @@ async def get_service_properties( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.QueueServiceProperties": """Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_skus_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_skus_operations.py index 3898207133a9..9250537c5fdb 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_skus_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_skus_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.StorageSkuListResult"]: """Lists the available SKUs supported by Microsoft.Storage for given subscription. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_storage_accounts_operations.py index 272f2767d750..f4380271a954 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_storage_accounts_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_storage_accounts_operations.py @@ -46,7 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def check_name_availability( self, account_name: "_models.StorageAccountCheckNameAvailabilityParameters", - **kwargs + **kwargs: Any ) -> "_models.CheckNameAvailabilityResult": """Checks that the storage account name is valid and is not already in use. @@ -108,7 +108,7 @@ async def _create_initial( resource_group_name: str, account_name: str, parameters: "_models.StorageAccountCreateParameters", - **kwargs + **kwargs: Any ) -> Optional["_models.StorageAccount"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StorageAccount"]] error_map = { @@ -163,7 +163,7 @@ async def begin_create( resource_group_name: str, account_name: str, parameters: "_models.StorageAccountCreateParameters", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.StorageAccount"]: """Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the @@ -181,8 +181,8 @@ async def begin_create( :type parameters: ~azure.mgmt.storage.v2021_04_01.models.StorageAccountCreateParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either StorageAccount or the result of cls(response) @@ -239,7 +239,7 @@ async def delete( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> None: """Deletes a storage account in Microsoft Azure. @@ -296,7 +296,7 @@ async def get_properties( resource_group_name: str, account_name: str, expand: Optional[Union[str, "_models.StorageAccountExpand"]] = None, - **kwargs + **kwargs: Any ) -> "_models.StorageAccount": """Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage @@ -366,7 +366,7 @@ async def update( resource_group_name: str, account_name: str, parameters: "_models.StorageAccountUpdateParameters", - **kwargs + **kwargs: Any ) -> "_models.StorageAccount": """The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also be used to map the account to a custom domain. Only one custom @@ -439,7 +439,7 @@ async def update( def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.StorageAccountListResult"]: """Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. @@ -507,7 +507,7 @@ async def get_next(next_link=None): def list_by_resource_group( self, resource_group_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.StorageAccountListResult"]: """Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this. @@ -581,7 +581,7 @@ async def list_keys( resource_group_name: str, account_name: str, expand: Optional[str] = "kerb", - **kwargs + **kwargs: Any ) -> "_models.StorageAccountListKeysResult": """Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. @@ -648,7 +648,7 @@ async def regenerate_key( resource_group_name: str, account_name: str, regenerate_key: "_models.StorageAccountRegenerateKeyParameters", - **kwargs + **kwargs: Any ) -> "_models.StorageAccountListKeysResult": """Regenerates one of the access keys or Kerberos keys for the specified storage account. @@ -718,7 +718,7 @@ async def list_account_sas( resource_group_name: str, account_name: str, parameters: "_models.AccountSasParameters", - **kwargs + **kwargs: Any ) -> "_models.ListAccountSasResponse": """List SAS credentials of a storage account. @@ -787,7 +787,7 @@ async def list_service_sas( resource_group_name: str, account_name: str, parameters: "_models.ServiceSasParameters", - **kwargs + **kwargs: Any ) -> "_models.ListServiceSasResponse": """List service SAS credentials of a specific resource. @@ -855,7 +855,7 @@ async def _failover_initial( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { @@ -897,7 +897,7 @@ async def begin_failover( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Failover request can be triggered for a storage account in case of availability issues. The failover occurs from the storage account's primary cluster to secondary cluster for RA-GRS @@ -912,8 +912,8 @@ async def begin_failover( :type account_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) @@ -967,7 +967,7 @@ async def _restore_blob_ranges_initial( resource_group_name: str, account_name: str, parameters: "_models.BlobRestoreParameters", - **kwargs + **kwargs: Any ) -> "_models.BlobRestoreStatus": cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobRestoreStatus"] error_map = { @@ -1024,7 +1024,7 @@ async def begin_restore_blob_ranges( resource_group_name: str, account_name: str, parameters: "_models.BlobRestoreParameters", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.BlobRestoreStatus"]: """Restore blobs in the specified blob ranges. @@ -1039,8 +1039,8 @@ async def begin_restore_blob_ranges( :type parameters: ~azure.mgmt.storage.v2021_04_01.models.BlobRestoreParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either BlobRestoreStatus or the result of cls(response) @@ -1097,7 +1097,7 @@ async def revoke_user_delegation_keys( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> None: """Revoke user delegation keys. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_table_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_table_operations.py index d1984fc59295..ab2f3fc20397 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_table_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_table_operations.py @@ -46,7 +46,7 @@ async def create( resource_group_name: str, account_name: str, table_name: str, - **kwargs + **kwargs: Any ) -> "_models.Table": """Creates a new table with the specified table name, under the specified account. @@ -114,7 +114,7 @@ async def update( resource_group_name: str, account_name: str, table_name: str, - **kwargs + **kwargs: Any ) -> "_models.Table": """Creates a new table with the specified table name, under the specified account. @@ -182,7 +182,7 @@ async def get( resource_group_name: str, account_name: str, table_name: str, - **kwargs + **kwargs: Any ) -> "_models.Table": """Gets the table with the specified table name, under the specified account if it exists. @@ -250,7 +250,7 @@ async def delete( resource_group_name: str, account_name: str, table_name: str, - **kwargs + **kwargs: Any ) -> None: """Deletes the table with the specified table name, under the specified account if it exists. @@ -314,7 +314,7 @@ def list( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ListTableResource"]: """Gets a list of all the tables under the specified storage account. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_table_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_table_services_operations.py index 5f37c7629f54..dae40c4d10f8 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_table_services_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_table_services_operations.py @@ -44,7 +44,7 @@ async def list( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.ListTableServices": """List all table services for the storage account. @@ -107,7 +107,7 @@ async def set_service_properties( resource_group_name: str, account_name: str, parameters: "_models.TableServiceProperties", - **kwargs + **kwargs: Any ) -> "_models.TableServiceProperties": """Sets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. @@ -180,7 +180,7 @@ async def get_service_properties( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.TableServiceProperties": """Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_usages_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_usages_operations.py index 042ac6700289..fab2699d7255 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_usages_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_usages_operations.py @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list_by_location( self, location: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.UsageListResult"]: """Gets the current usage count and the limit for the resources of the location under the subscription. diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/models/_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/models/_models.py index 1f01f9dc9f94..91eabb7bbf9a 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/models/_models.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/models/_models.py @@ -13,17 +13,17 @@ class AccessPolicy(msrest.serialization.Model): """AccessPolicy. - :param start: Start time of the access policy. - :type start: ~datetime.datetime - :param expiry: Expiry time of the access policy. - :type expiry: ~datetime.datetime + :param start_time: Start time of the access policy. + :type start_time: ~datetime.datetime + :param expiry_time: Expiry time of the access policy. + :type expiry_time: ~datetime.datetime :param permission: List of abbreviated permissions. :type permission: str """ _attribute_map = { - 'start': {'key': 'start', 'type': 'iso-8601'}, - 'expiry': {'key': 'expiry', 'type': 'iso-8601'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, 'permission': {'key': 'permission', 'type': 'str'}, } @@ -32,8 +32,8 @@ def __init__( **kwargs ): super(AccessPolicy, self).__init__(**kwargs) - self.start = kwargs.get('start', None) - self.expiry = kwargs.get('expiry', None) + self.start_time = kwargs.get('start_time', None) + self.expiry_time = kwargs.get('expiry_time', None) self.permission = kwargs.get('permission', None) @@ -2361,20 +2361,18 @@ def __init__( class IPRule(msrest.serialization.Model): """IP rule with specific IP or IP range in CIDR format. - Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. :type ip_address_or_range: str - :ivar action: The action of IP ACL rule. Default value: "Allow". - :vartype action: str + :param action: The action of IP ACL rule. The only acceptable values to pass in are None and + "Allow". The default value is None. + :type action: str """ _validation = { 'ip_address_or_range': {'required': True}, - 'action': {'constant': True}, } _attribute_map = { @@ -2382,14 +2380,13 @@ class IPRule(msrest.serialization.Model): 'action': {'key': 'action', 'type': 'str'}, } - action = "Allow" - def __init__( self, **kwargs ): super(IPRule, self).__init__(**kwargs) self.ip_address_or_range = kwargs['ip_address_or_range'] + self.action = kwargs.get('action', None) class KeyCreationTime(msrest.serialization.Model): @@ -4762,7 +4759,7 @@ class StorageAccountCheckNameAvailabilityParameters(msrest.serialization.Model): :param name: Required. The storage account name. :type name: str - :ivar type: Required. The type of resource, Microsoft.Storage/storageAccounts. Default value: + :ivar type: The type of resource, Microsoft.Storage/storageAccounts. Has constant value: "Microsoft.Storage/storageAccounts". :vartype type: str """ @@ -5696,15 +5693,14 @@ def __init__( class VirtualNetworkRule(msrest.serialization.Model): """Virtual Network rule. - Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. :param virtual_network_resource_id: Required. Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. :type virtual_network_resource_id: str - :ivar action: The action of virtual network rule. Default value: "Allow". - :vartype action: str + :param action: The action of virtual network rule. The only acceptable values to pass in are + None and "Allow". The default value is None. + :type action: str :param state: Gets the state of virtual network rule. Possible values include: "Provisioning", "Deprovisioning", "Succeeded", "Failed", "NetworkSourceDeleted". :type state: str or ~azure.mgmt.storage.v2021_04_01.models.State @@ -5712,7 +5708,6 @@ class VirtualNetworkRule(msrest.serialization.Model): _validation = { 'virtual_network_resource_id': {'required': True}, - 'action': {'constant': True}, } _attribute_map = { @@ -5721,12 +5716,11 @@ class VirtualNetworkRule(msrest.serialization.Model): 'state': {'key': 'state', 'type': 'str'}, } - action = "Allow" - def __init__( self, **kwargs ): super(VirtualNetworkRule, self).__init__(**kwargs) self.virtual_network_resource_id = kwargs['virtual_network_resource_id'] + self.action = kwargs.get('action', None) self.state = kwargs.get('state', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/models/_models_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/models/_models_py3.py index 19352c5a60df..606d5e5a1d72 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/models/_models_py3.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/models/_models_py3.py @@ -18,31 +18,31 @@ class AccessPolicy(msrest.serialization.Model): """AccessPolicy. - :param start: Start time of the access policy. - :type start: ~datetime.datetime - :param expiry: Expiry time of the access policy. - :type expiry: ~datetime.datetime + :param start_time: Start time of the access policy. + :type start_time: ~datetime.datetime + :param expiry_time: Expiry time of the access policy. + :type expiry_time: ~datetime.datetime :param permission: List of abbreviated permissions. :type permission: str """ _attribute_map = { - 'start': {'key': 'start', 'type': 'iso-8601'}, - 'expiry': {'key': 'expiry', 'type': 'iso-8601'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, 'permission': {'key': 'permission', 'type': 'str'}, } def __init__( self, *, - start: Optional[datetime.datetime] = None, - expiry: Optional[datetime.datetime] = None, + start_time: Optional[datetime.datetime] = None, + expiry_time: Optional[datetime.datetime] = None, permission: Optional[str] = None, **kwargs ): super(AccessPolicy, self).__init__(**kwargs) - self.start = start - self.expiry = expiry + self.start_time = start_time + self.expiry_time = expiry_time self.permission = permission @@ -2537,20 +2537,18 @@ def __init__( class IPRule(msrest.serialization.Model): """IP rule with specific IP or IP range in CIDR format. - Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. :type ip_address_or_range: str - :ivar action: The action of IP ACL rule. Default value: "Allow". - :vartype action: str + :param action: The action of IP ACL rule. The only acceptable values to pass in are None and + "Allow". The default value is None. + :type action: str """ _validation = { 'ip_address_or_range': {'required': True}, - 'action': {'constant': True}, } _attribute_map = { @@ -2558,16 +2556,16 @@ class IPRule(msrest.serialization.Model): 'action': {'key': 'action', 'type': 'str'}, } - action = "Allow" - def __init__( self, *, ip_address_or_range: str, + action: Optional[str] = None, **kwargs ): super(IPRule, self).__init__(**kwargs) self.ip_address_or_range = ip_address_or_range + self.action = action class KeyCreationTime(msrest.serialization.Model): @@ -5146,7 +5144,7 @@ class StorageAccountCheckNameAvailabilityParameters(msrest.serialization.Model): :param name: Required. The storage account name. :type name: str - :ivar type: Required. The type of resource, Microsoft.Storage/storageAccounts. Default value: + :ivar type: The type of resource, Microsoft.Storage/storageAccounts. Has constant value: "Microsoft.Storage/storageAccounts". :vartype type: str """ @@ -6143,15 +6141,14 @@ def __init__( class VirtualNetworkRule(msrest.serialization.Model): """Virtual Network rule. - Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. :param virtual_network_resource_id: Required. Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. :type virtual_network_resource_id: str - :ivar action: The action of virtual network rule. Default value: "Allow". - :vartype action: str + :param action: The action of virtual network rule. The only acceptable values to pass in are + None and "Allow". The default value is None. + :type action: str :param state: Gets the state of virtual network rule. Possible values include: "Provisioning", "Deprovisioning", "Succeeded", "Failed", "NetworkSourceDeleted". :type state: str or ~azure.mgmt.storage.v2021_04_01.models.State @@ -6159,7 +6156,6 @@ class VirtualNetworkRule(msrest.serialization.Model): _validation = { 'virtual_network_resource_id': {'required': True}, - 'action': {'constant': True}, } _attribute_map = { @@ -6168,15 +6164,15 @@ class VirtualNetworkRule(msrest.serialization.Model): 'state': {'key': 'state', 'type': 'str'}, } - action = "Allow" - def __init__( self, *, virtual_network_resource_id: str, + action: Optional[str] = None, state: Optional[Union[str, "State"]] = None, **kwargs ): super(VirtualNetworkRule, self).__init__(**kwargs) self.virtual_network_resource_id = virtual_network_resource_id + self.action = action self.state = state diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/operations/_blob_containers_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/operations/_blob_containers_operations.py index 784eb597d0b9..462b148f34db 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/operations/_blob_containers_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/operations/_blob_containers_operations.py @@ -1174,8 +1174,8 @@ def begin_object_level_worm( :type container_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/operations/_object_replication_policies_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/operations/_object_replication_policies_operations.py index a76b2e476381..e153de6c391b 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/operations/_object_replication_policies_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/operations/_object_replication_policies_operations.py @@ -141,8 +141,10 @@ def get( Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. :type account_name: str - :param object_replication_policy_id: The ID of object replication policy or 'default' if the - policy ID is unknown. + :param object_replication_policy_id: For the destination account, provide the value 'default'. + Configure the policy on the destination account first. For the source account, provide the + value of the policy ID that is returned when you download the policy that was defined on the + destination account. The policy is downloaded as a JSON file. :type object_replication_policy_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ObjectReplicationPolicy, or the result of cls(response) @@ -210,8 +212,10 @@ def create_or_update( Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. :type account_name: str - :param object_replication_policy_id: The ID of object replication policy or 'default' if the - policy ID is unknown. + :param object_replication_policy_id: For the destination account, provide the value 'default'. + Configure the policy on the destination account first. For the source account, provide the + value of the policy ID that is returned when you download the policy that was defined on the + destination account. The policy is downloaded as a JSON file. :type object_replication_policy_id: str :param properties: The object replication policy set to a storage account. A unique policy ID will be created if absent. @@ -286,8 +290,10 @@ def delete( Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. :type account_name: str - :param object_replication_policy_id: The ID of object replication policy or 'default' if the - policy ID is unknown. + :param object_replication_policy_id: For the destination account, provide the value 'default'. + Configure the policy on the destination account first. For the source account, provide the + value of the policy ID that is returned when you download the policy that was defined on the + destination account. The policy is downloaded as a JSON file. :type object_replication_policy_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/operations/_storage_accounts_operations.py index 19bbf14057b8..78e7c7f39bb0 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/operations/_storage_accounts_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/operations/_storage_accounts_operations.py @@ -188,8 +188,8 @@ def begin_create( :type parameters: ~azure.mgmt.storage.v2021_04_01.models.StorageAccountCreateParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either StorageAccount or the result of cls(response) @@ -930,8 +930,8 @@ def begin_failover( :type account_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) @@ -1059,8 +1059,8 @@ def begin_restore_blob_ranges( :type parameters: ~azure.mgmt.storage.v2021_04_01.models.BlobRestoreParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either BlobRestoreStatus or the result of cls(response) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/__init__.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/__init__.py new file mode 100644 index 000000000000..a50d1e1c39a7 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/__init__.py @@ -0,0 +1,19 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._storage_management_client import StorageManagementClient +from ._version import VERSION + +__version__ = VERSION +__all__ = ['StorageManagementClient'] + +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/_configuration.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/_configuration.py new file mode 100644 index 000000000000..8c02e8f6f624 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/_configuration.py @@ -0,0 +1,71 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +from ._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + + +class StorageManagementClientConfiguration(Configuration): + """Configuration for StorageManagementClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(StorageManagementClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2021-06-01" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-storage/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/_metadata.json b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/_metadata.json new file mode 100644 index 000000000000..5c2931eb4a70 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/_metadata.json @@ -0,0 +1,121 @@ +{ + "chosen_version": "2021-06-01", + "total_api_version_list": ["2021-06-01"], + "client": { + "name": "StorageManagementClient", + "filename": "_storage_management_client", + "description": "The Azure Storage Management API.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true, + "client_side_validation": false, + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"StorageManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"StorageManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + }, + "global_parameters": { + "sync": { + "credential": { + "signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "The ID of the target subscription.", + "docstring_type": "str", + "required": true + } + }, + "async": { + "credential": { + "signature": "credential: \"AsyncTokenCredential\",", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id: str,", + "description": "The ID of the target subscription.", + "docstring_type": "str", + "required": true + } + }, + "constant": { + }, + "call": "credential, subscription_id", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url=None, # type: Optional[str]", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "async": { + "api_version": { + "signature": "api_version: Optional[str] = None,", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url: Optional[str] = None,", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } + }, + "config": { + "credential": true, + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null, + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" + }, + "operation_groups": { + "operations": "Operations", + "skus": "SkusOperations", + "storage_accounts": "StorageAccountsOperations", + "deleted_accounts": "DeletedAccountsOperations", + "usages": "UsagesOperations", + "management_policies": "ManagementPoliciesOperations", + "blob_inventory_policies": "BlobInventoryPoliciesOperations", + "private_endpoint_connections": "PrivateEndpointConnectionsOperations", + "private_link_resources": "PrivateLinkResourcesOperations", + "object_replication_policies": "ObjectReplicationPoliciesOperations", + "encryption_scopes": "EncryptionScopesOperations", + "blob_services": "BlobServicesOperations", + "blob_containers": "BlobContainersOperations", + "file_services": "FileServicesOperations", + "file_shares": "FileSharesOperations", + "queue_services": "QueueServicesOperations", + "queue": "QueueOperations", + "table_services": "TableServicesOperations", + "table": "TableOperations" + } +} \ No newline at end of file diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/_storage_management_client.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/_storage_management_client.py new file mode 100644 index 000000000000..94287daed865 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/_storage_management_client.py @@ -0,0 +1,179 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + from azure.core.credentials import TokenCredential + from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from ._configuration import StorageManagementClientConfiguration +from .operations import Operations +from .operations import SkusOperations +from .operations import StorageAccountsOperations +from .operations import DeletedAccountsOperations +from .operations import UsagesOperations +from .operations import ManagementPoliciesOperations +from .operations import BlobInventoryPoliciesOperations +from .operations import PrivateEndpointConnectionsOperations +from .operations import PrivateLinkResourcesOperations +from .operations import ObjectReplicationPoliciesOperations +from .operations import EncryptionScopesOperations +from .operations import BlobServicesOperations +from .operations import BlobContainersOperations +from .operations import FileServicesOperations +from .operations import FileSharesOperations +from .operations import QueueServicesOperations +from .operations import QueueOperations +from .operations import TableServicesOperations +from .operations import TableOperations +from . import models + + +class StorageManagementClient(object): + """The Azure Storage Management API. + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.storage.v2021_06_01.operations.Operations + :ivar skus: SkusOperations operations + :vartype skus: azure.mgmt.storage.v2021_06_01.operations.SkusOperations + :ivar storage_accounts: StorageAccountsOperations operations + :vartype storage_accounts: azure.mgmt.storage.v2021_06_01.operations.StorageAccountsOperations + :ivar deleted_accounts: DeletedAccountsOperations operations + :vartype deleted_accounts: azure.mgmt.storage.v2021_06_01.operations.DeletedAccountsOperations + :ivar usages: UsagesOperations operations + :vartype usages: azure.mgmt.storage.v2021_06_01.operations.UsagesOperations + :ivar management_policies: ManagementPoliciesOperations operations + :vartype management_policies: azure.mgmt.storage.v2021_06_01.operations.ManagementPoliciesOperations + :ivar blob_inventory_policies: BlobInventoryPoliciesOperations operations + :vartype blob_inventory_policies: azure.mgmt.storage.v2021_06_01.operations.BlobInventoryPoliciesOperations + :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations + :vartype private_endpoint_connections: azure.mgmt.storage.v2021_06_01.operations.PrivateEndpointConnectionsOperations + :ivar private_link_resources: PrivateLinkResourcesOperations operations + :vartype private_link_resources: azure.mgmt.storage.v2021_06_01.operations.PrivateLinkResourcesOperations + :ivar object_replication_policies: ObjectReplicationPoliciesOperations operations + :vartype object_replication_policies: azure.mgmt.storage.v2021_06_01.operations.ObjectReplicationPoliciesOperations + :ivar encryption_scopes: EncryptionScopesOperations operations + :vartype encryption_scopes: azure.mgmt.storage.v2021_06_01.operations.EncryptionScopesOperations + :ivar blob_services: BlobServicesOperations operations + :vartype blob_services: azure.mgmt.storage.v2021_06_01.operations.BlobServicesOperations + :ivar blob_containers: BlobContainersOperations operations + :vartype blob_containers: azure.mgmt.storage.v2021_06_01.operations.BlobContainersOperations + :ivar file_services: FileServicesOperations operations + :vartype file_services: azure.mgmt.storage.v2021_06_01.operations.FileServicesOperations + :ivar file_shares: FileSharesOperations operations + :vartype file_shares: azure.mgmt.storage.v2021_06_01.operations.FileSharesOperations + :ivar queue_services: QueueServicesOperations operations + :vartype queue_services: azure.mgmt.storage.v2021_06_01.operations.QueueServicesOperations + :ivar queue: QueueOperations operations + :vartype queue: azure.mgmt.storage.v2021_06_01.operations.QueueOperations + :ivar table_services: TableServicesOperations operations + :vartype table_services: azure.mgmt.storage.v2021_06_01.operations.TableServicesOperations + :ivar table: TableOperations operations + :vartype table: azure.mgmt.storage.v2021_06_01.operations.TableOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = StorageManagementClientConfiguration(credential, subscription_id, **kwargs) + self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.skus = SkusOperations( + self._client, self._config, self._serialize, self._deserialize) + self.storage_accounts = StorageAccountsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.deleted_accounts = DeletedAccountsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.usages = UsagesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.management_policies = ManagementPoliciesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.blob_inventory_policies = BlobInventoryPoliciesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.object_replication_policies = ObjectReplicationPoliciesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.encryption_scopes = EncryptionScopesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.blob_services = BlobServicesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.blob_containers = BlobContainersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.file_services = FileServicesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.file_shares = FileSharesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.queue_services = QueueServicesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.queue = QueueOperations( + self._client, self._config, self._serialize, self._deserialize) + self.table_services = TableServicesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.table = TableOperations( + self._client, self._config, self._serialize, self._deserialize) + + def _send_request(self, http_request, **kwargs): + # type: (HttpRequest, Any) -> HttpResponse + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.HttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> StorageManagementClient + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/_version.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/_version.py new file mode 100644 index 000000000000..232662316d4d --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/_version.py @@ -0,0 +1,9 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +VERSION = "19.0.0" diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/__init__.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/__init__.py new file mode 100644 index 000000000000..9cfe0ace1ba9 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/__init__.py @@ -0,0 +1,10 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._storage_management_client import StorageManagementClient +__all__ = ['StorageManagementClient'] diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/_configuration.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/_configuration.py new file mode 100644 index 000000000000..480fd3067ddf --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/_configuration.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +from .._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + + +class StorageManagementClientConfiguration(Configuration): + """Configuration for StorageManagementClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(StorageManagementClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2021-06-01" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-storage/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs: Any + ) -> None: + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/_storage_management_client.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/_storage_management_client.py new file mode 100644 index 000000000000..367b5f44657b --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/_storage_management_client.py @@ -0,0 +1,172 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional, TYPE_CHECKING + +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +from ._configuration import StorageManagementClientConfiguration +from .operations import Operations +from .operations import SkusOperations +from .operations import StorageAccountsOperations +from .operations import DeletedAccountsOperations +from .operations import UsagesOperations +from .operations import ManagementPoliciesOperations +from .operations import BlobInventoryPoliciesOperations +from .operations import PrivateEndpointConnectionsOperations +from .operations import PrivateLinkResourcesOperations +from .operations import ObjectReplicationPoliciesOperations +from .operations import EncryptionScopesOperations +from .operations import BlobServicesOperations +from .operations import BlobContainersOperations +from .operations import FileServicesOperations +from .operations import FileSharesOperations +from .operations import QueueServicesOperations +from .operations import QueueOperations +from .operations import TableServicesOperations +from .operations import TableOperations +from .. import models + + +class StorageManagementClient(object): + """The Azure Storage Management API. + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.storage.v2021_06_01.aio.operations.Operations + :ivar skus: SkusOperations operations + :vartype skus: azure.mgmt.storage.v2021_06_01.aio.operations.SkusOperations + :ivar storage_accounts: StorageAccountsOperations operations + :vartype storage_accounts: azure.mgmt.storage.v2021_06_01.aio.operations.StorageAccountsOperations + :ivar deleted_accounts: DeletedAccountsOperations operations + :vartype deleted_accounts: azure.mgmt.storage.v2021_06_01.aio.operations.DeletedAccountsOperations + :ivar usages: UsagesOperations operations + :vartype usages: azure.mgmt.storage.v2021_06_01.aio.operations.UsagesOperations + :ivar management_policies: ManagementPoliciesOperations operations + :vartype management_policies: azure.mgmt.storage.v2021_06_01.aio.operations.ManagementPoliciesOperations + :ivar blob_inventory_policies: BlobInventoryPoliciesOperations operations + :vartype blob_inventory_policies: azure.mgmt.storage.v2021_06_01.aio.operations.BlobInventoryPoliciesOperations + :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations + :vartype private_endpoint_connections: azure.mgmt.storage.v2021_06_01.aio.operations.PrivateEndpointConnectionsOperations + :ivar private_link_resources: PrivateLinkResourcesOperations operations + :vartype private_link_resources: azure.mgmt.storage.v2021_06_01.aio.operations.PrivateLinkResourcesOperations + :ivar object_replication_policies: ObjectReplicationPoliciesOperations operations + :vartype object_replication_policies: azure.mgmt.storage.v2021_06_01.aio.operations.ObjectReplicationPoliciesOperations + :ivar encryption_scopes: EncryptionScopesOperations operations + :vartype encryption_scopes: azure.mgmt.storage.v2021_06_01.aio.operations.EncryptionScopesOperations + :ivar blob_services: BlobServicesOperations operations + :vartype blob_services: azure.mgmt.storage.v2021_06_01.aio.operations.BlobServicesOperations + :ivar blob_containers: BlobContainersOperations operations + :vartype blob_containers: azure.mgmt.storage.v2021_06_01.aio.operations.BlobContainersOperations + :ivar file_services: FileServicesOperations operations + :vartype file_services: azure.mgmt.storage.v2021_06_01.aio.operations.FileServicesOperations + :ivar file_shares: FileSharesOperations operations + :vartype file_shares: azure.mgmt.storage.v2021_06_01.aio.operations.FileSharesOperations + :ivar queue_services: QueueServicesOperations operations + :vartype queue_services: azure.mgmt.storage.v2021_06_01.aio.operations.QueueServicesOperations + :ivar queue: QueueOperations operations + :vartype queue: azure.mgmt.storage.v2021_06_01.aio.operations.QueueOperations + :ivar table_services: TableServicesOperations operations + :vartype table_services: azure.mgmt.storage.v2021_06_01.aio.operations.TableServicesOperations + :ivar table: TableOperations operations + :vartype table: azure.mgmt.storage.v2021_06_01.aio.operations.TableOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = StorageManagementClientConfiguration(credential, subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.skus = SkusOperations( + self._client, self._config, self._serialize, self._deserialize) + self.storage_accounts = StorageAccountsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.deleted_accounts = DeletedAccountsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.usages = UsagesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.management_policies = ManagementPoliciesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.blob_inventory_policies = BlobInventoryPoliciesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.object_replication_policies = ObjectReplicationPoliciesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.encryption_scopes = EncryptionScopesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.blob_services = BlobServicesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.blob_containers = BlobContainersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.file_services = FileServicesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.file_shares = FileSharesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.queue_services = QueueServicesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.queue = QueueOperations( + self._client, self._config, self._serialize, self._deserialize) + self.table_services = TableServicesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.table = TableOperations( + self._client, self._config, self._serialize, self._deserialize) + + async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "StorageManagementClient": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/__init__.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/__init__.py new file mode 100644 index 000000000000..bddcf8c8cb34 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/__init__.py @@ -0,0 +1,49 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operations import Operations +from ._skus_operations import SkusOperations +from ._storage_accounts_operations import StorageAccountsOperations +from ._deleted_accounts_operations import DeletedAccountsOperations +from ._usages_operations import UsagesOperations +from ._management_policies_operations import ManagementPoliciesOperations +from ._blob_inventory_policies_operations import BlobInventoryPoliciesOperations +from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._private_link_resources_operations import PrivateLinkResourcesOperations +from ._object_replication_policies_operations import ObjectReplicationPoliciesOperations +from ._encryption_scopes_operations import EncryptionScopesOperations +from ._blob_services_operations import BlobServicesOperations +from ._blob_containers_operations import BlobContainersOperations +from ._file_services_operations import FileServicesOperations +from ._file_shares_operations import FileSharesOperations +from ._queue_services_operations import QueueServicesOperations +from ._queue_operations import QueueOperations +from ._table_services_operations import TableServicesOperations +from ._table_operations import TableOperations + +__all__ = [ + 'Operations', + 'SkusOperations', + 'StorageAccountsOperations', + 'DeletedAccountsOperations', + 'UsagesOperations', + 'ManagementPoliciesOperations', + 'BlobInventoryPoliciesOperations', + 'PrivateEndpointConnectionsOperations', + 'PrivateLinkResourcesOperations', + 'ObjectReplicationPoliciesOperations', + 'EncryptionScopesOperations', + 'BlobServicesOperations', + 'BlobContainersOperations', + 'FileServicesOperations', + 'FileSharesOperations', + 'QueueServicesOperations', + 'QueueOperations', + 'TableServicesOperations', + 'TableOperations', +] diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_blob_containers_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_blob_containers_operations.py new file mode 100644 index 000000000000..172f9af84cdb --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_blob_containers_operations.py @@ -0,0 +1,1208 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class BlobContainersOperations: + """BlobContainersOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2021_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + account_name: str, + maxpagesize: Optional[str] = None, + filter: Optional[str] = None, + include: Optional[Union[str, "_models.ListContainersInclude"]] = None, + **kwargs: Any + ) -> AsyncIterable["_models.ListContainerItems"]: + """Lists all containers and does not support a prefix like data plane. Also SRP today does not + return continuation token. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param maxpagesize: Optional. Specified maximum number of containers that can be included in + the list. + :type maxpagesize: str + :param filter: Optional. When specified, only container names starting with the filter will be + listed. + :type filter: str + :param include: Optional, used to include the properties for soft deleted blob containers. + :type include: str or ~azure.mgmt.storage.v2021_06_01.models.ListContainersInclude + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListContainerItems or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2021_06_01.models.ListContainerItems] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListContainerItems"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if maxpagesize is not None: + query_parameters['$maxpagesize'] = self._serialize.query("maxpagesize", maxpagesize, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if include is not None: + query_parameters['$include'] = self._serialize.query("include", include, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ListContainerItems', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers'} # type: ignore + + async def create( + self, + resource_group_name: str, + account_name: str, + container_name: str, + blob_container: "_models.BlobContainer", + **kwargs: Any + ) -> "_models.BlobContainer": + """Creates a new container under the specified account as described by request body. The container + resource includes metadata and properties for that container. It does not include a list of the + blobs contained by the container. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the specified storage account. + Blob container names must be between 3 and 63 characters in length and use numbers, lower-case + letters and dash (-) only. Every dash (-) character must be immediately preceded and followed + by a letter or number. + :type container_name: str + :param blob_container: Properties of the blob container to create. + :type blob_container: ~azure.mgmt.storage.v2021_06_01.models.BlobContainer + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BlobContainer, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.BlobContainer + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobContainer"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(blob_container, 'BlobContainer') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('BlobContainer', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('BlobContainer', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} # type: ignore + + async def update( + self, + resource_group_name: str, + account_name: str, + container_name: str, + blob_container: "_models.BlobContainer", + **kwargs: Any + ) -> "_models.BlobContainer": + """Updates container properties as specified in request body. Properties not mentioned in the + request will be unchanged. Update fails if the specified container doesn't already exist. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the specified storage account. + Blob container names must be between 3 and 63 characters in length and use numbers, lower-case + letters and dash (-) only. Every dash (-) character must be immediately preceded and followed + by a letter or number. + :type container_name: str + :param blob_container: Properties to update for the blob container. + :type blob_container: ~azure.mgmt.storage.v2021_06_01.models.BlobContainer + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BlobContainer, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.BlobContainer + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobContainer"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(blob_container, 'BlobContainer') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BlobContainer', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + account_name: str, + container_name: str, + **kwargs: Any + ) -> "_models.BlobContainer": + """Gets properties of a specified container. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the specified storage account. + Blob container names must be between 3 and 63 characters in length and use numbers, lower-case + letters and dash (-) only. Every dash (-) character must be immediately preceded and followed + by a letter or number. + :type container_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BlobContainer, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.BlobContainer + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobContainer"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BlobContainer', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + account_name: str, + container_name: str, + **kwargs: Any + ) -> None: + """Deletes specified container under its account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the specified storage account. + Blob container names must be between 3 and 63 characters in length and use numbers, lower-case + letters and dash (-) only. Every dash (-) character must be immediately preceded and followed + by a letter or number. + :type container_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} # type: ignore + + async def set_legal_hold( + self, + resource_group_name: str, + account_name: str, + container_name: str, + legal_hold: "_models.LegalHold", + **kwargs: Any + ) -> "_models.LegalHold": + """Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold + follows an append pattern and does not clear out the existing tags that are not specified in + the request. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the specified storage account. + Blob container names must be between 3 and 63 characters in length and use numbers, lower-case + letters and dash (-) only. Every dash (-) character must be immediately preceded and followed + by a letter or number. + :type container_name: str + :param legal_hold: The LegalHold property that will be set to a blob container. + :type legal_hold: ~azure.mgmt.storage.v2021_06_01.models.LegalHold + :keyword callable cls: A custom type or function that will be passed the direct response + :return: LegalHold, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.LegalHold + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.LegalHold"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.set_legal_hold.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(legal_hold, 'LegalHold') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('LegalHold', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + set_legal_hold.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/setLegalHold'} # type: ignore + + async def clear_legal_hold( + self, + resource_group_name: str, + account_name: str, + container_name: str, + legal_hold: "_models.LegalHold", + **kwargs: Any + ) -> "_models.LegalHold": + """Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent + operation. ClearLegalHold clears out only the specified tags in the request. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the specified storage account. + Blob container names must be between 3 and 63 characters in length and use numbers, lower-case + letters and dash (-) only. Every dash (-) character must be immediately preceded and followed + by a letter or number. + :type container_name: str + :param legal_hold: The LegalHold property that will be clear from a blob container. + :type legal_hold: ~azure.mgmt.storage.v2021_06_01.models.LegalHold + :keyword callable cls: A custom type or function that will be passed the direct response + :return: LegalHold, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.LegalHold + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.LegalHold"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.clear_legal_hold.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(legal_hold, 'LegalHold') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('LegalHold', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + clear_legal_hold.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/clearLegalHold'} # type: ignore + + async def create_or_update_immutability_policy( + self, + resource_group_name: str, + account_name: str, + container_name: str, + if_match: Optional[str] = None, + parameters: Optional["_models.ImmutabilityPolicy"] = None, + **kwargs: Any + ) -> "_models.ImmutabilityPolicy": + """Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but + not required for this operation. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the specified storage account. + Blob container names must be between 3 and 63 characters in length and use numbers, lower-case + letters and dash (-) only. Every dash (-) character must be immediately preceded and followed + by a letter or number. + :type container_name: str + :param if_match: The entity state (ETag) version of the immutability policy to update. A value + of "*" can be used to apply the operation only if the immutability policy already exists. If + omitted, this operation will always be applied. + :type if_match: str + :param parameters: The ImmutabilityPolicy Properties that will be created or updated to a blob + container. + :type parameters: ~azure.mgmt.storage.v2021_06_01.models.ImmutabilityPolicy + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ImmutabilityPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.ImmutabilityPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + immutability_policy_name = "default" + api_version = "2021-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_immutability_policy.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'immutabilityPolicyName': self._serialize.url("immutability_policy_name", immutability_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if parameters is not None: + body_content = self._serialize.body(parameters, 'ImmutabilityPolicy') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) + deserialized = self._deserialize('ImmutabilityPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + create_or_update_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}'} # type: ignore + + async def get_immutability_policy( + self, + resource_group_name: str, + account_name: str, + container_name: str, + if_match: Optional[str] = None, + **kwargs: Any + ) -> "_models.ImmutabilityPolicy": + """Gets the existing immutability policy along with the corresponding ETag in response headers and + body. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the specified storage account. + Blob container names must be between 3 and 63 characters in length and use numbers, lower-case + letters and dash (-) only. Every dash (-) character must be immediately preceded and followed + by a letter or number. + :type container_name: str + :param if_match: The entity state (ETag) version of the immutability policy to update. A value + of "*" can be used to apply the operation only if the immutability policy already exists. If + omitted, this operation will always be applied. + :type if_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ImmutabilityPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.ImmutabilityPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + immutability_policy_name = "default" + api_version = "2021-06-01" + accept = "application/json" + + # Construct URL + url = self.get_immutability_policy.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'immutabilityPolicyName': self._serialize.url("immutability_policy_name", immutability_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) + deserialized = self._deserialize('ImmutabilityPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + get_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}'} # type: ignore + + async def delete_immutability_policy( + self, + resource_group_name: str, + account_name: str, + container_name: str, + if_match: str, + **kwargs: Any + ) -> "_models.ImmutabilityPolicy": + """Aborts an unlocked immutability policy. The response of delete has + immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is required for this + operation. Deleting a locked immutability policy is not allowed, the only way is to delete the + container after deleting all expired blobs inside the policy locked container. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the specified storage account. + Blob container names must be between 3 and 63 characters in length and use numbers, lower-case + letters and dash (-) only. Every dash (-) character must be immediately preceded and followed + by a letter or number. + :type container_name: str + :param if_match: The entity state (ETag) version of the immutability policy to update. A value + of "*" can be used to apply the operation only if the immutability policy already exists. If + omitted, this operation will always be applied. + :type if_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ImmutabilityPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.ImmutabilityPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + immutability_policy_name = "default" + api_version = "2021-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_immutability_policy.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'immutabilityPolicyName': self._serialize.url("immutability_policy_name", immutability_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) + deserialized = self._deserialize('ImmutabilityPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + delete_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}'} # type: ignore + + async def lock_immutability_policy( + self, + resource_group_name: str, + account_name: str, + container_name: str, + if_match: str, + **kwargs: Any + ) -> "_models.ImmutabilityPolicy": + """Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is + ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the specified storage account. + Blob container names must be between 3 and 63 characters in length and use numbers, lower-case + letters and dash (-) only. Every dash (-) character must be immediately preceded and followed + by a letter or number. + :type container_name: str + :param if_match: The entity state (ETag) version of the immutability policy to update. A value + of "*" can be used to apply the operation only if the immutability policy already exists. If + omitted, this operation will always be applied. + :type if_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ImmutabilityPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.ImmutabilityPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + # Construct URL + url = self.lock_immutability_policy.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) + deserialized = self._deserialize('ImmutabilityPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + lock_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/lock'} # type: ignore + + async def extend_immutability_policy( + self, + resource_group_name: str, + account_name: str, + container_name: str, + if_match: str, + parameters: Optional["_models.ImmutabilityPolicy"] = None, + **kwargs: Any + ) -> "_models.ImmutabilityPolicy": + """Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only + action allowed on a Locked policy will be this action. ETag in If-Match is required for this + operation. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the specified storage account. + Blob container names must be between 3 and 63 characters in length and use numbers, lower-case + letters and dash (-) only. Every dash (-) character must be immediately preceded and followed + by a letter or number. + :type container_name: str + :param if_match: The entity state (ETag) version of the immutability policy to update. A value + of "*" can be used to apply the operation only if the immutability policy already exists. If + omitted, this operation will always be applied. + :type if_match: str + :param parameters: The ImmutabilityPolicy Properties that will be extended for a blob + container. + :type parameters: ~azure.mgmt.storage.v2021_06_01.models.ImmutabilityPolicy + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ImmutabilityPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.ImmutabilityPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.extend_immutability_policy.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if parameters is not None: + body_content = self._serialize.body(parameters, 'ImmutabilityPolicy') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) + deserialized = self._deserialize('ImmutabilityPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + extend_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/extend'} # type: ignore + + async def lease( + self, + resource_group_name: str, + account_name: str, + container_name: str, + parameters: Optional["_models.LeaseContainerRequest"] = None, + **kwargs: Any + ) -> "_models.LeaseContainerResponse": + """The Lease Container operation establishes and manages a lock on a container for delete + operations. The lock duration can be 15 to 60 seconds, or can be infinite. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the specified storage account. + Blob container names must be between 3 and 63 characters in length and use numbers, lower-case + letters and dash (-) only. Every dash (-) character must be immediately preceded and followed + by a letter or number. + :type container_name: str + :param parameters: Lease Container request body. + :type parameters: ~azure.mgmt.storage.v2021_06_01.models.LeaseContainerRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: LeaseContainerResponse, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.LeaseContainerResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.LeaseContainerResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.lease.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if parameters is not None: + body_content = self._serialize.body(parameters, 'LeaseContainerRequest') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('LeaseContainerResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + lease.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/lease'} # type: ignore + + async def _object_level_worm_initial( + self, + resource_group_name: str, + account_name: str, + container_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + # Construct URL + url = self._object_level_worm_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _object_level_worm_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/migrate'} # type: ignore + + async def begin_object_level_worm( + self, + resource_group_name: str, + account_name: str, + container_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """This operation migrates a blob container from container level WORM to object level immutability + enabled container. Prerequisites require a container level immutability policy either in locked + or unlocked state, Account level versioning must be enabled and there should be no Legal hold + on the container. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the specified storage account. + Blob container names must be between 3 and 63 characters in length and use numbers, lower-case + letters and dash (-) only. Every dash (-) character must be immediately preceded and followed + by a letter or number. + :type container_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._object_level_worm_initial( + resource_group_name=resource_group_name, + account_name=account_name, + container_name=container_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_object_level_worm.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/migrate'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_blob_inventory_policies_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_blob_inventory_policies_operations.py new file mode 100644 index 000000000000..b7a5ce46e6fc --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_blob_inventory_policies_operations.py @@ -0,0 +1,326 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class BlobInventoryPoliciesOperations: + """BlobInventoryPoliciesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2021_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + resource_group_name: str, + account_name: str, + blob_inventory_policy_name: Union[str, "_models.BlobInventoryPolicyName"], + **kwargs: Any + ) -> "_models.BlobInventoryPolicy": + """Gets the blob inventory policy associated with the specified storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param blob_inventory_policy_name: The name of the storage account blob inventory policy. It + should always be 'default'. + :type blob_inventory_policy_name: str or ~azure.mgmt.storage.v2021_06_01.models.BlobInventoryPolicyName + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BlobInventoryPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.BlobInventoryPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobInventoryPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'blobInventoryPolicyName': self._serialize.url("blob_inventory_policy_name", blob_inventory_policy_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BlobInventoryPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/inventoryPolicies/{blobInventoryPolicyName}'} # type: ignore + + async def create_or_update( + self, + resource_group_name: str, + account_name: str, + blob_inventory_policy_name: Union[str, "_models.BlobInventoryPolicyName"], + properties: "_models.BlobInventoryPolicy", + **kwargs: Any + ) -> "_models.BlobInventoryPolicy": + """Sets the blob inventory policy to the specified storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param blob_inventory_policy_name: The name of the storage account blob inventory policy. It + should always be 'default'. + :type blob_inventory_policy_name: str or ~azure.mgmt.storage.v2021_06_01.models.BlobInventoryPolicyName + :param properties: The blob inventory policy set to a storage account. + :type properties: ~azure.mgmt.storage.v2021_06_01.models.BlobInventoryPolicy + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BlobInventoryPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.BlobInventoryPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobInventoryPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'blobInventoryPolicyName': self._serialize.url("blob_inventory_policy_name", blob_inventory_policy_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(properties, 'BlobInventoryPolicy') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BlobInventoryPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/inventoryPolicies/{blobInventoryPolicyName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + account_name: str, + blob_inventory_policy_name: Union[str, "_models.BlobInventoryPolicyName"], + **kwargs: Any + ) -> None: + """Deletes the blob inventory policy associated with the specified storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param blob_inventory_policy_name: The name of the storage account blob inventory policy. It + should always be 'default'. + :type blob_inventory_policy_name: str or ~azure.mgmt.storage.v2021_06_01.models.BlobInventoryPolicyName + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'blobInventoryPolicyName': self._serialize.url("blob_inventory_policy_name", blob_inventory_policy_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/inventoryPolicies/{blobInventoryPolicyName}'} # type: ignore + + def list( + self, + resource_group_name: str, + account_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.ListBlobInventoryPolicy"]: + """Gets the blob inventory policy associated with the specified storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListBlobInventoryPolicy or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2021_06_01.models.ListBlobInventoryPolicy] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListBlobInventoryPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ListBlobInventoryPolicy', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/inventoryPolicies'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_blob_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_blob_services_operations.py new file mode 100644 index 000000000000..f0fbc55dbce3 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_blob_services_operations.py @@ -0,0 +1,256 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class BlobServicesOperations: + """BlobServicesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2021_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + account_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.BlobServiceItems"]: + """List blob services of storage account. It returns a collection of one object named default. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either BlobServiceItems or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2021_06_01.models.BlobServiceItems] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobServiceItems"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('BlobServiceItems', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices'} # type: ignore + + async def set_service_properties( + self, + resource_group_name: str, + account_name: str, + parameters: "_models.BlobServiceProperties", + **kwargs: Any + ) -> "_models.BlobServiceProperties": + """Sets the properties of a storage account’s Blob service, including properties for Storage + Analytics and CORS (Cross-Origin Resource Sharing) rules. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param parameters: The properties of a storage account’s Blob service, including properties for + Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + :type parameters: ~azure.mgmt.storage.v2021_06_01.models.BlobServiceProperties + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BlobServiceProperties, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.BlobServiceProperties + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobServiceProperties"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + blob_services_name = "default" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.set_service_properties.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'BlobServicesName': self._serialize.url("blob_services_name", blob_services_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'BlobServiceProperties') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BlobServiceProperties', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + set_service_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/{BlobServicesName}'} # type: ignore + + async def get_service_properties( + self, + resource_group_name: str, + account_name: str, + **kwargs: Any + ) -> "_models.BlobServiceProperties": + """Gets the properties of a storage account’s Blob service, including properties for Storage + Analytics and CORS (Cross-Origin Resource Sharing) rules. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BlobServiceProperties, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.BlobServiceProperties + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobServiceProperties"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + blob_services_name = "default" + accept = "application/json" + + # Construct URL + url = self.get_service_properties.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'BlobServicesName': self._serialize.url("blob_services_name", blob_services_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BlobServiceProperties', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_service_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/{BlobServicesName}'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_deleted_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_deleted_accounts_operations.py new file mode 100644 index 000000000000..49f4da0cb024 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_deleted_accounts_operations.py @@ -0,0 +1,168 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class DeletedAccountsOperations: + """DeletedAccountsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2021_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs: Any + ) -> AsyncIterable["_models.DeletedAccountListResult"]: + """Lists deleted accounts under the subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DeletedAccountListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2021_06_01.models.DeletedAccountListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DeletedAccountListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DeletedAccountListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/deletedAccounts'} # type: ignore + + async def get( + self, + deleted_account_name: str, + location: str, + **kwargs: Any + ) -> "_models.DeletedAccount": + """Get properties of specified deleted account resource. + + :param deleted_account_name: Name of the deleted storage account. + :type deleted_account_name: str + :param location: The location of the deleted storage account. + :type location: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DeletedAccount, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.DeletedAccount + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DeletedAccount"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deletedAccountName': self._serialize.url("deleted_account_name", deleted_account_name, 'str', max_length=24, min_length=3), + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DeletedAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/locations/{location}/deletedAccounts/{deletedAccountName}'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_encryption_scopes_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_encryption_scopes_operations.py new file mode 100644 index 000000000000..52d2223b17f0 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_encryption_scopes_operations.py @@ -0,0 +1,349 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class EncryptionScopesOperations: + """EncryptionScopesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2021_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def put( + self, + resource_group_name: str, + account_name: str, + encryption_scope_name: str, + encryption_scope: "_models.EncryptionScope", + **kwargs: Any + ) -> "_models.EncryptionScope": + """Synchronously creates or updates an encryption scope under the specified storage account. If an + encryption scope is already created and a subsequent request is issued with different + properties, the encryption scope properties will be updated per the specified request. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param encryption_scope_name: The name of the encryption scope within the specified storage + account. Encryption scope names must be between 3 and 63 characters in length and use numbers, + lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type encryption_scope_name: str + :param encryption_scope: Encryption scope properties to be used for the create or update. + :type encryption_scope: ~azure.mgmt.storage.v2021_06_01.models.EncryptionScope + :keyword callable cls: A custom type or function that will be passed the direct response + :return: EncryptionScope, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.EncryptionScope + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.EncryptionScope"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.put.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'encryptionScopeName': self._serialize.url("encryption_scope_name", encryption_scope_name, 'str', max_length=63, min_length=3), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(encryption_scope, 'EncryptionScope') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('EncryptionScope', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('EncryptionScope', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + put.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}'} # type: ignore + + async def patch( + self, + resource_group_name: str, + account_name: str, + encryption_scope_name: str, + encryption_scope: "_models.EncryptionScope", + **kwargs: Any + ) -> "_models.EncryptionScope": + """Update encryption scope properties as specified in the request body. Update fails if the + specified encryption scope does not already exist. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param encryption_scope_name: The name of the encryption scope within the specified storage + account. Encryption scope names must be between 3 and 63 characters in length and use numbers, + lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type encryption_scope_name: str + :param encryption_scope: Encryption scope properties to be used for the update. + :type encryption_scope: ~azure.mgmt.storage.v2021_06_01.models.EncryptionScope + :keyword callable cls: A custom type or function that will be passed the direct response + :return: EncryptionScope, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.EncryptionScope + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.EncryptionScope"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.patch.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'encryptionScopeName': self._serialize.url("encryption_scope_name", encryption_scope_name, 'str', max_length=63, min_length=3), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(encryption_scope, 'EncryptionScope') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('EncryptionScope', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + patch.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + account_name: str, + encryption_scope_name: str, + **kwargs: Any + ) -> "_models.EncryptionScope": + """Returns the properties for the specified encryption scope. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param encryption_scope_name: The name of the encryption scope within the specified storage + account. Encryption scope names must be between 3 and 63 characters in length and use numbers, + lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type encryption_scope_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: EncryptionScope, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.EncryptionScope + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.EncryptionScope"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'encryptionScopeName': self._serialize.url("encryption_scope_name", encryption_scope_name, 'str', max_length=63, min_length=3), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('EncryptionScope', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}'} # type: ignore + + def list( + self, + resource_group_name: str, + account_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.EncryptionScopeListResult"]: + """Lists all the encryption scopes available under the specified storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either EncryptionScopeListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2021_06_01.models.EncryptionScopeListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.EncryptionScopeListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('EncryptionScopeListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_file_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_file_services_operations.py new file mode 100644 index 000000000000..ddd8fb80b703 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_file_services_operations.py @@ -0,0 +1,242 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class FileServicesOperations: + """FileServicesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2021_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def list( + self, + resource_group_name: str, + account_name: str, + **kwargs: Any + ) -> "_models.FileServiceItems": + """List all file services in storage accounts. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FileServiceItems, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.FileServiceItems + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FileServiceItems"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CloudErrorAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FileServiceItems', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices'} # type: ignore + + async def set_service_properties( + self, + resource_group_name: str, + account_name: str, + parameters: "_models.FileServiceProperties", + **kwargs: Any + ) -> "_models.FileServiceProperties": + """Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource + Sharing) rules. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param parameters: The properties of file services in storage accounts, including CORS + (Cross-Origin Resource Sharing) rules. + :type parameters: ~azure.mgmt.storage.v2021_06_01.models.FileServiceProperties + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FileServiceProperties, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.FileServiceProperties + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FileServiceProperties"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + file_services_name = "default" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.set_service_properties.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'FileServicesName': self._serialize.url("file_services_name", file_services_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'FileServiceProperties') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CloudErrorAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FileServiceProperties', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + set_service_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/{FileServicesName}'} # type: ignore + + async def get_service_properties( + self, + resource_group_name: str, + account_name: str, + **kwargs: Any + ) -> "_models.FileServiceProperties": + """Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource + Sharing) rules. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FileServiceProperties, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.FileServiceProperties + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FileServiceProperties"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + file_services_name = "default" + accept = "application/json" + + # Construct URL + url = self.get_service_properties.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'FileServicesName': self._serialize.url("file_services_name", file_services_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CloudErrorAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FileServiceProperties', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_service_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/{FileServicesName}'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_file_shares_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_file_shares_operations.py new file mode 100644 index 000000000000..ac5907431bc4 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_file_shares_operations.py @@ -0,0 +1,628 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class FileSharesOperations: + """FileSharesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2021_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + account_name: str, + maxpagesize: Optional[str] = None, + filter: Optional[str] = None, + expand: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.FileShareItems"]: + """Lists all shares. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param maxpagesize: Optional. Specified maximum number of shares that can be included in the + list. + :type maxpagesize: str + :param filter: Optional. When specified, only share names starting with the filter will be + listed. + :type filter: str + :param expand: Optional, used to expand the properties within share's properties. Valid values + are: deleted, snapshots. Should be passed as a string with delimiter ','. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either FileShareItems or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2021_06_01.models.FileShareItems] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FileShareItems"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if maxpagesize is not None: + query_parameters['$maxpagesize'] = self._serialize.query("maxpagesize", maxpagesize, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('FileShareItems', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.CloudErrorAutoGenerated, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares'} # type: ignore + + async def create( + self, + resource_group_name: str, + account_name: str, + share_name: str, + file_share: "_models.FileShare", + expand: Optional[str] = None, + **kwargs: Any + ) -> "_models.FileShare": + """Creates a new share under the specified account as described by request body. The share + resource includes metadata and properties for that share. It does not include a list of the + files contained by the share. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param share_name: The name of the file share within the specified storage account. File share + names must be between 3 and 63 characters in length and use numbers, lower-case letters and + dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter + or number. + :type share_name: str + :param file_share: Properties of the file share to create. + :type file_share: ~azure.mgmt.storage.v2021_06_01.models.FileShare + :param expand: Optional, used to expand the properties within share's properties. Valid values + are: snapshots. Should be passed as a string with delimiter ','. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FileShare, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.FileShare + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FileShare"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'shareName': self._serialize.url("share_name", share_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(file_share, 'FileShare') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CloudErrorAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('FileShare', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('FileShare', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}'} # type: ignore + + async def update( + self, + resource_group_name: str, + account_name: str, + share_name: str, + file_share: "_models.FileShare", + **kwargs: Any + ) -> "_models.FileShare": + """Updates share properties as specified in request body. Properties not mentioned in the request + will not be changed. Update fails if the specified share does not already exist. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param share_name: The name of the file share within the specified storage account. File share + names must be between 3 and 63 characters in length and use numbers, lower-case letters and + dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter + or number. + :type share_name: str + :param file_share: Properties to update for the file share. + :type file_share: ~azure.mgmt.storage.v2021_06_01.models.FileShare + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FileShare, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.FileShare + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FileShare"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'shareName': self._serialize.url("share_name", share_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(file_share, 'FileShare') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CloudErrorAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FileShare', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + account_name: str, + share_name: str, + expand: Optional[str] = None, + x_ms_snapshot: Optional[str] = None, + **kwargs: Any + ) -> "_models.FileShare": + """Gets properties of a specified share. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param share_name: The name of the file share within the specified storage account. File share + names must be between 3 and 63 characters in length and use numbers, lower-case letters and + dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter + or number. + :type share_name: str + :param expand: Optional, used to expand the properties within share's properties. Valid values + are: stats. Should be passed as a string with delimiter ','. + :type expand: str + :param x_ms_snapshot: Optional, used to retrieve properties of a snapshot. + :type x_ms_snapshot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FileShare, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.FileShare + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FileShare"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'shareName': self._serialize.url("share_name", share_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if x_ms_snapshot is not None: + header_parameters['x-ms-snapshot'] = self._serialize.header("x_ms_snapshot", x_ms_snapshot, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CloudErrorAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FileShare', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + account_name: str, + share_name: str, + x_ms_snapshot: Optional[str] = None, + include: Optional[str] = None, + **kwargs: Any + ) -> None: + """Deletes specified share under its account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param share_name: The name of the file share within the specified storage account. File share + names must be between 3 and 63 characters in length and use numbers, lower-case letters and + dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter + or number. + :type share_name: str + :param x_ms_snapshot: Optional, used to delete a snapshot. + :type x_ms_snapshot: str + :param include: Optional. Valid values are: snapshots, leased-snapshots, none. The default + value is snapshots. For 'snapshots', the file share is deleted including all of its file share + snapshots. If the file share contains leased-snapshots, the deletion fails. For + 'leased-snapshots', the file share is deleted included all of its file share snapshots + (leased/unleased). For 'none', the file share is deleted if it has no share snapshots. If the + file share contains any snapshots (leased or unleased), the deletion fails. + :type include: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'shareName': self._serialize.url("share_name", share_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if include is not None: + query_parameters['$include'] = self._serialize.query("include", include, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if x_ms_snapshot is not None: + header_parameters['x-ms-snapshot'] = self._serialize.header("x_ms_snapshot", x_ms_snapshot, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CloudErrorAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}'} # type: ignore + + async def restore( + self, + resource_group_name: str, + account_name: str, + share_name: str, + deleted_share: "_models.DeletedShare", + **kwargs: Any + ) -> None: + """Restore a file share within a valid retention days if share soft delete is enabled. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param share_name: The name of the file share within the specified storage account. File share + names must be between 3 and 63 characters in length and use numbers, lower-case letters and + dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter + or number. + :type share_name: str + :param deleted_share: + :type deleted_share: ~azure.mgmt.storage.v2021_06_01.models.DeletedShare + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.restore.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'shareName': self._serialize.url("share_name", share_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(deleted_share, 'DeletedShare') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CloudErrorAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + restore.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}/restore'} # type: ignore + + async def lease( + self, + resource_group_name: str, + account_name: str, + share_name: str, + x_ms_snapshot: Optional[str] = None, + parameters: Optional["_models.LeaseShareRequest"] = None, + **kwargs: Any + ) -> "_models.LeaseShareResponse": + """The Lease Share operation establishes and manages a lock on a share for delete operations. The + lock duration can be 15 to 60 seconds, or can be infinite. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param share_name: The name of the file share within the specified storage account. File share + names must be between 3 and 63 characters in length and use numbers, lower-case letters and + dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter + or number. + :type share_name: str + :param x_ms_snapshot: Optional. Specify the snapshot time to lease a snapshot. + :type x_ms_snapshot: str + :param parameters: Lease Share request body. + :type parameters: ~azure.mgmt.storage.v2021_06_01.models.LeaseShareRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: LeaseShareResponse, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.LeaseShareResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.LeaseShareResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.lease.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'shareName': self._serialize.url("share_name", share_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if x_ms_snapshot is not None: + header_parameters['x-ms-snapshot'] = self._serialize.header("x_ms_snapshot", x_ms_snapshot, 'str') + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if parameters is not None: + body_content = self._serialize.body(parameters, 'LeaseShareRequest') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CloudErrorAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) + deserialized = self._deserialize('LeaseShareResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + lease.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}/lease'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_management_policies_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_management_policies_operations.py new file mode 100644 index 000000000000..03fd46c48440 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_management_policies_operations.py @@ -0,0 +1,242 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ManagementPoliciesOperations: + """ManagementPoliciesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2021_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + resource_group_name: str, + account_name: str, + management_policy_name: Union[str, "_models.ManagementPolicyName"], + **kwargs: Any + ) -> "_models.ManagementPolicy": + """Gets the managementpolicy associated with the specified storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param management_policy_name: The name of the Storage Account Management Policy. It should + always be 'default'. + :type management_policy_name: str or ~azure.mgmt.storage.v2021_06_01.models.ManagementPolicyName + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ManagementPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.ManagementPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagementPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'managementPolicyName': self._serialize.url("management_policy_name", management_policy_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ManagementPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}'} # type: ignore + + async def create_or_update( + self, + resource_group_name: str, + account_name: str, + management_policy_name: Union[str, "_models.ManagementPolicyName"], + properties: "_models.ManagementPolicy", + **kwargs: Any + ) -> "_models.ManagementPolicy": + """Sets the managementpolicy to the specified storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param management_policy_name: The name of the Storage Account Management Policy. It should + always be 'default'. + :type management_policy_name: str or ~azure.mgmt.storage.v2021_06_01.models.ManagementPolicyName + :param properties: The ManagementPolicy set to a storage account. + :type properties: ~azure.mgmt.storage.v2021_06_01.models.ManagementPolicy + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ManagementPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.ManagementPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagementPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'managementPolicyName': self._serialize.url("management_policy_name", management_policy_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(properties, 'ManagementPolicy') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ManagementPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + account_name: str, + management_policy_name: Union[str, "_models.ManagementPolicyName"], + **kwargs: Any + ) -> None: + """Deletes the managementpolicy associated with the specified storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param management_policy_name: The name of the Storage Account Management Policy. It should + always be 'default'. + :type management_policy_name: str or ~azure.mgmt.storage.v2021_06_01.models.ManagementPolicyName + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'managementPolicyName': self._serialize.url("management_policy_name", management_policy_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_object_replication_policies_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_object_replication_policies_operations.py new file mode 100644 index 000000000000..506bafc80e94 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_object_replication_policies_operations.py @@ -0,0 +1,333 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ObjectReplicationPoliciesOperations: + """ObjectReplicationPoliciesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2021_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + account_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.ObjectReplicationPolicies"]: + """List the object replication policies associated with the storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ObjectReplicationPolicies or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2021_06_01.models.ObjectReplicationPolicies] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ObjectReplicationPolicies"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ObjectReplicationPolicies', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies'} # type: ignore + + async def get( + self, + resource_group_name: str, + account_name: str, + object_replication_policy_id: str, + **kwargs: Any + ) -> "_models.ObjectReplicationPolicy": + """Get the object replication policy of the storage account by policy ID. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param object_replication_policy_id: For the destination account, provide the value 'default'. + Configure the policy on the destination account first. For the source account, provide the + value of the policy ID that is returned when you download the policy that was defined on the + destination account. The policy is downloaded as a JSON file. + :type object_replication_policy_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ObjectReplicationPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.ObjectReplicationPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ObjectReplicationPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'objectReplicationPolicyId': self._serialize.url("object_replication_policy_id", object_replication_policy_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ObjectReplicationPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}'} # type: ignore + + async def create_or_update( + self, + resource_group_name: str, + account_name: str, + object_replication_policy_id: str, + properties: "_models.ObjectReplicationPolicy", + **kwargs: Any + ) -> "_models.ObjectReplicationPolicy": + """Create or update the object replication policy of the storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param object_replication_policy_id: For the destination account, provide the value 'default'. + Configure the policy on the destination account first. For the source account, provide the + value of the policy ID that is returned when you download the policy that was defined on the + destination account. The policy is downloaded as a JSON file. + :type object_replication_policy_id: str + :param properties: The object replication policy set to a storage account. A unique policy ID + will be created if absent. + :type properties: ~azure.mgmt.storage.v2021_06_01.models.ObjectReplicationPolicy + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ObjectReplicationPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.ObjectReplicationPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ObjectReplicationPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'objectReplicationPolicyId': self._serialize.url("object_replication_policy_id", object_replication_policy_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(properties, 'ObjectReplicationPolicy') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ObjectReplicationPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + account_name: str, + object_replication_policy_id: str, + **kwargs: Any + ) -> None: + """Deletes the object replication policy associated with the specified storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param object_replication_policy_id: For the destination account, provide the value 'default'. + Configure the policy on the destination account first. For the source account, provide the + value of the policy ID that is returned when you download the policy that was defined on the + destination account. The policy is downloaded as a JSON file. + :type object_replication_policy_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'objectReplicationPolicyId': self._serialize.url("object_replication_policy_id", object_replication_policy_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_operations.py new file mode 100644 index 000000000000..133a07c0c985 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_operations.py @@ -0,0 +1,104 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class Operations: + """Operations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2021_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs: Any + ) -> AsyncIterable["_models.OperationListResult"]: + """Lists all of the available Storage Rest API operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2021_06_01.models.OperationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('OperationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.Storage/operations'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_private_endpoint_connections_operations.py new file mode 100644 index 000000000000..ee226514b995 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_private_endpoint_connections_operations.py @@ -0,0 +1,325 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class PrivateEndpointConnectionsOperations: + """PrivateEndpointConnectionsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2021_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + account_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.PrivateEndpointConnectionListResult"]: + """List all the private endpoint connections associated with the storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PrivateEndpointConnectionListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2021_06_01.models.PrivateEndpointConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('PrivateEndpointConnectionListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections'} # type: ignore + + async def get( + self, + resource_group_name: str, + account_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> "_models.PrivateEndpointConnection": + """Gets the specified private endpoint connection associated with the storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def put( + self, + resource_group_name: str, + account_name: str, + private_endpoint_connection_name: str, + properties: "_models.PrivateEndpointConnection", + **kwargs: Any + ) -> "_models.PrivateEndpointConnection": + """Update the state of specified private endpoint connection associated with the storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. + :type private_endpoint_connection_name: str + :param properties: The private endpoint connection properties. + :type properties: ~azure.mgmt.storage.v2021_06_01.models.PrivateEndpointConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.put.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(properties, 'PrivateEndpointConnection') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + put.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + account_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> None: + """Deletes the specified private endpoint connection associated with the storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_private_link_resources_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_private_link_resources_operations.py new file mode 100644 index 000000000000..b6f32442c750 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_private_link_resources_operations.py @@ -0,0 +1,102 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class PrivateLinkResourcesOperations: + """PrivateLinkResourcesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2021_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def list_by_storage_account( + self, + resource_group_name: str, + account_name: str, + **kwargs: Any + ) -> "_models.PrivateLinkResourceListResult": + """Gets the private link resources that need to be created for a storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkResourceListResult, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.PrivateLinkResourceListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + # Construct URL + url = self.list_by_storage_account.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateLinkResourceListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_by_storage_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateLinkResources'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_queue_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_queue_operations.py new file mode 100644 index 000000000000..11c52db9f103 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_queue_operations.py @@ -0,0 +1,421 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class QueueOperations: + """QueueOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2021_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def create( + self, + resource_group_name: str, + account_name: str, + queue_name: str, + queue: "_models.StorageQueue", + **kwargs: Any + ) -> "_models.StorageQueue": + """Creates a new queue with the specified queue name, under the specified account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param queue_name: A queue name must be unique within a storage account and must be between 3 + and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, + it should begin and end with an alphanumeric character and it cannot have two consecutive + dash(-) characters. + :type queue_name: str + :param queue: Queue properties and metadata to be created with. + :type queue: ~azure.mgmt.storage.v2021_06_01.models.StorageQueue + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StorageQueue, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.StorageQueue + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageQueue"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'queueName': self._serialize.url("queue_name", queue_name, 'str', max_length=63, min_length=3, pattern=r'^[a-z0-9]([a-z0-9]|(-(?!-))){1,61}[a-z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(queue, 'StorageQueue') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CloudErrorAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StorageQueue', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}'} # type: ignore + + async def update( + self, + resource_group_name: str, + account_name: str, + queue_name: str, + queue: "_models.StorageQueue", + **kwargs: Any + ) -> "_models.StorageQueue": + """Creates a new queue with the specified queue name, under the specified account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param queue_name: A queue name must be unique within a storage account and must be between 3 + and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, + it should begin and end with an alphanumeric character and it cannot have two consecutive + dash(-) characters. + :type queue_name: str + :param queue: Queue properties and metadata to be created with. + :type queue: ~azure.mgmt.storage.v2021_06_01.models.StorageQueue + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StorageQueue, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.StorageQueue + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageQueue"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'queueName': self._serialize.url("queue_name", queue_name, 'str', max_length=63, min_length=3, pattern=r'^[a-z0-9]([a-z0-9]|(-(?!-))){1,61}[a-z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(queue, 'StorageQueue') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CloudErrorAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StorageQueue', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + account_name: str, + queue_name: str, + **kwargs: Any + ) -> "_models.StorageQueue": + """Gets the queue with the specified queue name, under the specified account if it exists. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param queue_name: A queue name must be unique within a storage account and must be between 3 + and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, + it should begin and end with an alphanumeric character and it cannot have two consecutive + dash(-) characters. + :type queue_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StorageQueue, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.StorageQueue + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageQueue"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'queueName': self._serialize.url("queue_name", queue_name, 'str', max_length=63, min_length=3, pattern=r'^[a-z0-9]([a-z0-9]|(-(?!-))){1,61}[a-z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CloudErrorAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StorageQueue', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + account_name: str, + queue_name: str, + **kwargs: Any + ) -> None: + """Deletes the queue with the specified queue name, under the specified account if it exists. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param queue_name: A queue name must be unique within a storage account and must be between 3 + and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, + it should begin and end with an alphanumeric character and it cannot have two consecutive + dash(-) characters. + :type queue_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'queueName': self._serialize.url("queue_name", queue_name, 'str', max_length=63, min_length=3, pattern=r'^[a-z0-9]([a-z0-9]|(-(?!-))){1,61}[a-z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CloudErrorAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}'} # type: ignore + + def list( + self, + resource_group_name: str, + account_name: str, + maxpagesize: Optional[str] = None, + filter: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.ListQueueResource"]: + """Gets a list of all the queues under the specified storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param maxpagesize: Optional, a maximum number of queues that should be included in a list + queue response. + :type maxpagesize: str + :param filter: Optional, When specified, only the queues with a name starting with the given + filter will be listed. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListQueueResource or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2021_06_01.models.ListQueueResource] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListQueueResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if maxpagesize is not None: + query_parameters['$maxpagesize'] = self._serialize.query("maxpagesize", maxpagesize, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ListQueueResource', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.CloudErrorAutoGenerated, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_queue_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_queue_services_operations.py new file mode 100644 index 000000000000..5a8fd0891c6e --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_queue_services_operations.py @@ -0,0 +1,242 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class QueueServicesOperations: + """QueueServicesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2021_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def list( + self, + resource_group_name: str, + account_name: str, + **kwargs: Any + ) -> "_models.ListQueueServices": + """List all queue services for the storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ListQueueServices, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.ListQueueServices + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListQueueServices"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CloudErrorAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ListQueueServices', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices'} # type: ignore + + async def set_service_properties( + self, + resource_group_name: str, + account_name: str, + parameters: "_models.QueueServiceProperties", + **kwargs: Any + ) -> "_models.QueueServiceProperties": + """Sets the properties of a storage account’s Queue service, including properties for Storage + Analytics and CORS (Cross-Origin Resource Sharing) rules. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param parameters: The properties of a storage account’s Queue service, only properties for + Storage Analytics and CORS (Cross-Origin Resource Sharing) rules can be specified. + :type parameters: ~azure.mgmt.storage.v2021_06_01.models.QueueServiceProperties + :keyword callable cls: A custom type or function that will be passed the direct response + :return: QueueServiceProperties, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.QueueServiceProperties + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.QueueServiceProperties"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + queue_service_name = "default" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.set_service_properties.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'queueServiceName': self._serialize.url("queue_service_name", queue_service_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'QueueServiceProperties') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CloudErrorAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('QueueServiceProperties', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + set_service_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/{queueServiceName}'} # type: ignore + + async def get_service_properties( + self, + resource_group_name: str, + account_name: str, + **kwargs: Any + ) -> "_models.QueueServiceProperties": + """Gets the properties of a storage account’s Queue service, including properties for Storage + Analytics and CORS (Cross-Origin Resource Sharing) rules. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: QueueServiceProperties, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.QueueServiceProperties + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.QueueServiceProperties"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + queue_service_name = "default" + accept = "application/json" + + # Construct URL + url = self.get_service_properties.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'queueServiceName': self._serialize.url("queue_service_name", queue_service_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CloudErrorAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('QueueServiceProperties', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_service_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/{queueServiceName}'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_skus_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_skus_operations.py new file mode 100644 index 000000000000..450186f16430 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_skus_operations.py @@ -0,0 +1,108 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class SkusOperations: + """SkusOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2021_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs: Any + ) -> AsyncIterable["_models.StorageSkuListResult"]: + """Lists the available SKUs supported by Microsoft.Storage for given subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StorageSkuListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2021_06_01.models.StorageSkuListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageSkuListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('StorageSkuListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/skus'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_storage_accounts_operations.py new file mode 100644 index 000000000000..326fdd9c4230 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_storage_accounts_operations.py @@ -0,0 +1,1383 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class StorageAccountsOperations: + """StorageAccountsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2021_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def check_name_availability( + self, + account_name: "_models.StorageAccountCheckNameAvailabilityParameters", + **kwargs: Any + ) -> "_models.CheckNameAvailabilityResult": + """Checks that the storage account name is valid and is not already in use. + + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: ~azure.mgmt.storage.v2021_06_01.models.StorageAccountCheckNameAvailabilityParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CheckNameAvailabilityResult, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.CheckNameAvailabilityResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameAvailabilityResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.check_name_availability.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(account_name, 'StorageAccountCheckNameAvailabilityParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CheckNameAvailabilityResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability'} # type: ignore + + async def _create_initial( + self, + resource_group_name: str, + account_name: str, + parameters: "_models.StorageAccountCreateParameters", + **kwargs: Any + ) -> Optional["_models.StorageAccount"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StorageAccount"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'StorageAccountCreateParameters') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('StorageAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} # type: ignore + + async def begin_create( + self, + resource_group_name: str, + account_name: str, + parameters: "_models.StorageAccountCreateParameters", + **kwargs: Any + ) -> AsyncLROPoller["_models.StorageAccount"]: + """Asynchronously creates a new storage account with the specified parameters. If an account is + already created and a subsequent create request is issued with different properties, the + account properties will be updated. If an account is already created and a subsequent create or + update request is issued with the exact same set of properties, the request will succeed. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param parameters: The parameters to provide for the created account. + :type parameters: ~azure.mgmt.storage.v2021_06_01.models.StorageAccountCreateParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either StorageAccount or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.storage.v2021_06_01.models.StorageAccount] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_initial( + resource_group_name=resource_group_name, + account_name=account_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('StorageAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + account_name: str, + **kwargs: Any + ) -> None: + """Deletes a storage account in Microsoft Azure. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} # type: ignore + + async def get_properties( + self, + resource_group_name: str, + account_name: str, + expand: Optional[Union[str, "_models.StorageAccountExpand"]] = None, + **kwargs: Any + ) -> "_models.StorageAccount": + """Returns the properties for the specified storage account including but not limited to name, SKU + name, location, and account status. The ListKeys operation should be used to retrieve storage + keys. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param expand: May be used to expand the properties within account's properties. By default, + data is not included when fetching properties. Currently we only support geoReplicationStats + and blobRestoreStatus. + :type expand: str or ~azure.mgmt.storage.v2021_06_01.models.StorageAccountExpand + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StorageAccount, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.StorageAccount + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + # Construct URL + url = self.get_properties.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StorageAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} # type: ignore + + async def update( + self, + resource_group_name: str, + account_name: str, + parameters: "_models.StorageAccountUpdateParameters", + **kwargs: Any + ) -> "_models.StorageAccount": + """The update operation can be used to update the SKU, encryption, access tier, or tags for a + storage account. It can also be used to map the account to a custom domain. Only one custom + domain is supported per storage account; the replacement/change of custom domain is not + supported. In order to replace an old custom domain, the old value must be cleared/unregistered + before a new value can be set. The update of multiple properties is supported. This call does + not change the storage keys for the account. If you want to change the storage account keys, + use the regenerate keys operation. The location and name of the storage account cannot be + changed after creation. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param parameters: The parameters to provide for the updated account. + :type parameters: ~azure.mgmt.storage.v2021_06_01.models.StorageAccountUpdateParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StorageAccount, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.StorageAccount + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'StorageAccountUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StorageAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} # type: ignore + + def list( + self, + **kwargs: Any + ) -> AsyncIterable["_models.StorageAccountListResult"]: + """Lists all the storage accounts available under the subscription. Note that storage keys are not + returned; use the ListKeys operation for this. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StorageAccountListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2021_06_01.models.StorageAccountListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('StorageAccountListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.StorageAccountListResult"]: + """Lists all the storage accounts available under the given resource group. Note that storage keys + are not returned; use the ListKeys operation for this. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StorageAccountListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2021_06_01.models.StorageAccountListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('StorageAccountListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts'} # type: ignore + + async def list_keys( + self, + resource_group_name: str, + account_name: str, + expand: Optional[str] = "kerb", + **kwargs: Any + ) -> "_models.StorageAccountListKeysResult": + """Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage + account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param expand: Specifies type of the key to be listed. Possible value is kerb. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StorageAccountListKeysResult, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.StorageAccountListKeysResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListKeysResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + # Construct URL + url = self.list_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StorageAccountListKeysResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys'} # type: ignore + + async def regenerate_key( + self, + resource_group_name: str, + account_name: str, + regenerate_key: "_models.StorageAccountRegenerateKeyParameters", + **kwargs: Any + ) -> "_models.StorageAccountListKeysResult": + """Regenerates one of the access keys or Kerberos keys for the specified storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param regenerate_key: Specifies name of the key which should be regenerated -- key1, key2, + kerb1, kerb2. + :type regenerate_key: ~azure.mgmt.storage.v2021_06_01.models.StorageAccountRegenerateKeyParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StorageAccountListKeysResult, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.StorageAccountListKeysResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListKeysResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.regenerate_key.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(regenerate_key, 'StorageAccountRegenerateKeyParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StorageAccountListKeysResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey'} # type: ignore + + async def list_account_sas( + self, + resource_group_name: str, + account_name: str, + parameters: "_models.AccountSasParameters", + **kwargs: Any + ) -> "_models.ListAccountSasResponse": + """List SAS credentials of a storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param parameters: The parameters to provide to list SAS credentials for the storage account. + :type parameters: ~azure.mgmt.storage.v2021_06_01.models.AccountSasParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ListAccountSasResponse, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.ListAccountSasResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListAccountSasResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.list_account_sas.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'AccountSasParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ListAccountSasResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_account_sas.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListAccountSas'} # type: ignore + + async def list_service_sas( + self, + resource_group_name: str, + account_name: str, + parameters: "_models.ServiceSasParameters", + **kwargs: Any + ) -> "_models.ListServiceSasResponse": + """List service SAS credentials of a specific resource. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param parameters: The parameters to provide to list service SAS credentials. + :type parameters: ~azure.mgmt.storage.v2021_06_01.models.ServiceSasParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ListServiceSasResponse, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.ListServiceSasResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListServiceSasResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.list_service_sas.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ServiceSasParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ListServiceSasResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_service_sas.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListServiceSas'} # type: ignore + + async def _failover_initial( + self, + resource_group_name: str, + account_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + + # Construct URL + url = self._failover_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _failover_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/failover'} # type: ignore + + async def begin_failover( + self, + resource_group_name: str, + account_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Failover request can be triggered for a storage account in case of availability issues. The + failover occurs from the storage account's primary cluster to secondary cluster for RA-GRS + accounts. The secondary cluster will become primary after failover. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._failover_initial( + resource_group_name=resource_group_name, + account_name=account_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_failover.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/failover'} # type: ignore + + async def _hierarchical_namespace_migration_initial( + self, + resource_group_name: str, + account_name: str, + request_type: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + # Construct URL + url = self._hierarchical_namespace_migration_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['requestType'] = self._serialize.query("request_type", request_type, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _hierarchical_namespace_migration_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/hnsonmigration'} # type: ignore + + async def begin_hierarchical_namespace_migration( + self, + resource_group_name: str, + account_name: str, + request_type: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Live Migration of storage account to enable Hns. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param request_type: Required. Hierarchical namespace migration type can either be a + hierarchical namespace validation request 'HnsOnValidationRequest' or a hydration request + 'HnsOnHydrationRequest'. The validation request will validate the migration whereas the + hydration request will migrate the account. + :type request_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._hierarchical_namespace_migration_initial( + resource_group_name=resource_group_name, + account_name=account_name, + request_type=request_type, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_hierarchical_namespace_migration.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/hnsonmigration'} # type: ignore + + async def _abort_hierarchical_namespace_migration_initial( + self, + resource_group_name: str, + account_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + # Construct URL + url = self._abort_hierarchical_namespace_migration_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _abort_hierarchical_namespace_migration_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/aborthnsonmigration'} # type: ignore + + async def begin_abort_hierarchical_namespace_migration( + self, + resource_group_name: str, + account_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Abort live Migration of storage account to enable Hns. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._abort_hierarchical_namespace_migration_initial( + resource_group_name=resource_group_name, + account_name=account_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_abort_hierarchical_namespace_migration.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/aborthnsonmigration'} # type: ignore + + async def _restore_blob_ranges_initial( + self, + resource_group_name: str, + account_name: str, + parameters: "_models.BlobRestoreParameters", + **kwargs: Any + ) -> "_models.BlobRestoreStatus": + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobRestoreStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._restore_blob_ranges_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'BlobRestoreParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('BlobRestoreStatus', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('BlobRestoreStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _restore_blob_ranges_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/restoreBlobRanges'} # type: ignore + + async def begin_restore_blob_ranges( + self, + resource_group_name: str, + account_name: str, + parameters: "_models.BlobRestoreParameters", + **kwargs: Any + ) -> AsyncLROPoller["_models.BlobRestoreStatus"]: + """Restore blobs in the specified blob ranges. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param parameters: The parameters to provide for restore blob ranges. + :type parameters: ~azure.mgmt.storage.v2021_06_01.models.BlobRestoreParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either BlobRestoreStatus or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.storage.v2021_06_01.models.BlobRestoreStatus] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobRestoreStatus"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._restore_blob_ranges_initial( + resource_group_name=resource_group_name, + account_name=account_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('BlobRestoreStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_restore_blob_ranges.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/restoreBlobRanges'} # type: ignore + + async def revoke_user_delegation_keys( + self, + resource_group_name: str, + account_name: str, + **kwargs: Any + ) -> None: + """Revoke user delegation keys. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + + # Construct URL + url = self.revoke_user_delegation_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + revoke_user_delegation_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/revokeUserDelegationKeys'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_table_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_table_operations.py new file mode 100644 index 000000000000..634b8f9b649d --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_table_operations.py @@ -0,0 +1,389 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class TableOperations: + """TableOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2021_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def create( + self, + resource_group_name: str, + account_name: str, + table_name: str, + **kwargs: Any + ) -> "_models.Table": + """Creates a new table with the specified table name, under the specified account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param table_name: A table name must be unique within a storage account and must be between 3 + and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin + with a numeric character. + :type table_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Table, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.Table + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Table"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + # Construct URL + url = self.create.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'tableName': self._serialize.url("table_name", table_name, 'str', max_length=63, min_length=3, pattern=r'^[A-Za-z][A-Za-z0-9]{2,62}$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.put(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CloudErrorAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Table', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}'} # type: ignore + + async def update( + self, + resource_group_name: str, + account_name: str, + table_name: str, + **kwargs: Any + ) -> "_models.Table": + """Creates a new table with the specified table name, under the specified account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param table_name: A table name must be unique within a storage account and must be between 3 + and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin + with a numeric character. + :type table_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Table, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.Table + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Table"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'tableName': self._serialize.url("table_name", table_name, 'str', max_length=63, min_length=3, pattern=r'^[A-Za-z][A-Za-z0-9]{2,62}$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.patch(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CloudErrorAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Table', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + account_name: str, + table_name: str, + **kwargs: Any + ) -> "_models.Table": + """Gets the table with the specified table name, under the specified account if it exists. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param table_name: A table name must be unique within a storage account and must be between 3 + and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin + with a numeric character. + :type table_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Table, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.Table + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Table"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'tableName': self._serialize.url("table_name", table_name, 'str', max_length=63, min_length=3, pattern=r'^[A-Za-z][A-Za-z0-9]{2,62}$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CloudErrorAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Table', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + account_name: str, + table_name: str, + **kwargs: Any + ) -> None: + """Deletes the table with the specified table name, under the specified account if it exists. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param table_name: A table name must be unique within a storage account and must be between 3 + and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin + with a numeric character. + :type table_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'tableName': self._serialize.url("table_name", table_name, 'str', max_length=63, min_length=3, pattern=r'^[A-Za-z][A-Za-z0-9]{2,62}$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CloudErrorAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}'} # type: ignore + + def list( + self, + resource_group_name: str, + account_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.ListTableResource"]: + """Gets a list of all the tables under the specified storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListTableResource or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2021_06_01.models.ListTableResource] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListTableResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ListTableResource', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.CloudErrorAutoGenerated, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_table_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_table_services_operations.py new file mode 100644 index 000000000000..dbd68eb1ef0c --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_table_services_operations.py @@ -0,0 +1,242 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class TableServicesOperations: + """TableServicesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2021_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def list( + self, + resource_group_name: str, + account_name: str, + **kwargs: Any + ) -> "_models.ListTableServices": + """List all table services for the storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ListTableServices, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.ListTableServices + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListTableServices"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CloudErrorAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ListTableServices', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices'} # type: ignore + + async def set_service_properties( + self, + resource_group_name: str, + account_name: str, + parameters: "_models.TableServiceProperties", + **kwargs: Any + ) -> "_models.TableServiceProperties": + """Sets the properties of a storage account’s Table service, including properties for Storage + Analytics and CORS (Cross-Origin Resource Sharing) rules. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param parameters: The properties of a storage account’s Table service, only properties for + Storage Analytics and CORS (Cross-Origin Resource Sharing) rules can be specified. + :type parameters: ~azure.mgmt.storage.v2021_06_01.models.TableServiceProperties + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TableServiceProperties, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.TableServiceProperties + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TableServiceProperties"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + table_service_name = "default" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.set_service_properties.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'tableServiceName': self._serialize.url("table_service_name", table_service_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TableServiceProperties') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CloudErrorAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('TableServiceProperties', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + set_service_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/{tableServiceName}'} # type: ignore + + async def get_service_properties( + self, + resource_group_name: str, + account_name: str, + **kwargs: Any + ) -> "_models.TableServiceProperties": + """Gets the properties of a storage account’s Table service, including properties for Storage + Analytics and CORS (Cross-Origin Resource Sharing) rules. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TableServiceProperties, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.TableServiceProperties + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TableServiceProperties"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + table_service_name = "default" + accept = "application/json" + + # Construct URL + url = self.get_service_properties.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'tableServiceName': self._serialize.url("table_service_name", table_service_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CloudErrorAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('TableServiceProperties', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_service_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/{tableServiceName}'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_usages_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_usages_operations.py new file mode 100644 index 000000000000..6b592ccc4828 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/aio/operations/_usages_operations.py @@ -0,0 +1,113 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class UsagesOperations: + """UsagesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2021_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_location( + self, + location: str, + **kwargs: Any + ) -> AsyncIterable["_models.UsageListResult"]: + """Gets the current usage count and the limit for the resources of the location under the + subscription. + + :param location: The location of the Azure Storage resource. + :type location: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either UsageListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2021_06_01.models.UsageListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsageListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_location.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'location': self._serialize.url("location", location, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('UsageListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_location.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/locations/{location}/usages'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/models/__init__.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/models/__init__.py new file mode 100644 index 000000000000..41c730b3261f --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/models/__init__.py @@ -0,0 +1,559 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import AccessPolicy + from ._models_py3 import AccountImmutabilityPolicyProperties + from ._models_py3 import AccountSasParameters + from ._models_py3 import ActiveDirectoryProperties + from ._models_py3 import AzureEntityResource + from ._models_py3 import AzureFilesIdentityBasedAuthentication + from ._models_py3 import BlobContainer + from ._models_py3 import BlobInventoryPolicy + from ._models_py3 import BlobInventoryPolicyDefinition + from ._models_py3 import BlobInventoryPolicyFilter + from ._models_py3 import BlobInventoryPolicyRule + from ._models_py3 import BlobInventoryPolicySchema + from ._models_py3 import BlobRestoreParameters + from ._models_py3 import BlobRestoreRange + from ._models_py3 import BlobRestoreStatus + from ._models_py3 import BlobServiceItems + from ._models_py3 import BlobServiceProperties + from ._models_py3 import ChangeFeed + from ._models_py3 import CheckNameAvailabilityResult + from ._models_py3 import CloudErrorAutoGenerated + from ._models_py3 import CloudErrorBody + from ._models_py3 import CloudErrorBodyAutoGenerated + from ._models_py3 import CorsRule + from ._models_py3 import CorsRules + from ._models_py3 import CustomDomain + from ._models_py3 import DateAfterCreation + from ._models_py3 import DateAfterModification + from ._models_py3 import DeleteRetentionPolicy + from ._models_py3 import DeletedAccount + from ._models_py3 import DeletedAccountListResult + from ._models_py3 import DeletedShare + from ._models_py3 import Dimension + from ._models_py3 import Encryption + from ._models_py3 import EncryptionIdentity + from ._models_py3 import EncryptionScope + from ._models_py3 import EncryptionScopeKeyVaultProperties + from ._models_py3 import EncryptionScopeListResult + from ._models_py3 import EncryptionService + from ._models_py3 import EncryptionServices + from ._models_py3 import Endpoints + from ._models_py3 import ErrorResponse + from ._models_py3 import ErrorResponseBody + from ._models_py3 import ExtendedLocation + from ._models_py3 import FileServiceItems + from ._models_py3 import FileServiceProperties + from ._models_py3 import FileShare + from ._models_py3 import FileShareItem + from ._models_py3 import FileShareItems + from ._models_py3 import GeoReplicationStats + from ._models_py3 import IPRule + from ._models_py3 import Identity + from ._models_py3 import ImmutabilityPolicy + from ._models_py3 import ImmutabilityPolicyProperties + from ._models_py3 import ImmutableStorageAccount + from ._models_py3 import ImmutableStorageWithVersioning + from ._models_py3 import KeyCreationTime + from ._models_py3 import KeyPolicy + from ._models_py3 import KeyVaultProperties + from ._models_py3 import LastAccessTimeTrackingPolicy + from ._models_py3 import LeaseContainerRequest + from ._models_py3 import LeaseContainerResponse + from ._models_py3 import LeaseShareRequest + from ._models_py3 import LeaseShareResponse + from ._models_py3 import LegalHold + from ._models_py3 import LegalHoldProperties + from ._models_py3 import ListAccountSasResponse + from ._models_py3 import ListBlobInventoryPolicy + from ._models_py3 import ListContainerItem + from ._models_py3 import ListContainerItems + from ._models_py3 import ListQueue + from ._models_py3 import ListQueueResource + from ._models_py3 import ListQueueServices + from ._models_py3 import ListServiceSasResponse + from ._models_py3 import ListTableResource + from ._models_py3 import ListTableServices + from ._models_py3 import ManagementPolicy + from ._models_py3 import ManagementPolicyAction + from ._models_py3 import ManagementPolicyBaseBlob + from ._models_py3 import ManagementPolicyDefinition + from ._models_py3 import ManagementPolicyFilter + from ._models_py3 import ManagementPolicyRule + from ._models_py3 import ManagementPolicySchema + from ._models_py3 import ManagementPolicySnapShot + from ._models_py3 import ManagementPolicyVersion + from ._models_py3 import MetricSpecification + from ._models_py3 import Multichannel + from ._models_py3 import NetworkRuleSet + from ._models_py3 import ObjectReplicationPolicies + from ._models_py3 import ObjectReplicationPolicy + from ._models_py3 import ObjectReplicationPolicyFilter + from ._models_py3 import ObjectReplicationPolicyRule + from ._models_py3 import Operation + from ._models_py3 import OperationDisplay + from ._models_py3 import OperationListResult + from ._models_py3 import PrivateEndpoint + from ._models_py3 import PrivateEndpointConnection + from ._models_py3 import PrivateEndpointConnectionListResult + from ._models_py3 import PrivateLinkResource + from ._models_py3 import PrivateLinkResourceListResult + from ._models_py3 import PrivateLinkServiceConnectionState + from ._models_py3 import ProtectedAppendWritesHistory + from ._models_py3 import ProtocolSettings + from ._models_py3 import ProxyResource + from ._models_py3 import QueueServiceProperties + from ._models_py3 import Resource + from ._models_py3 import ResourceAccessRule + from ._models_py3 import RestorePolicyProperties + from ._models_py3 import Restriction + from ._models_py3 import RoutingPreference + from ._models_py3 import SKUCapability + from ._models_py3 import SasPolicy + from ._models_py3 import ServiceSasParameters + from ._models_py3 import ServiceSpecification + from ._models_py3 import SignedIdentifier + from ._models_py3 import Sku + from ._models_py3 import SkuInformation + from ._models_py3 import SmbSetting + from ._models_py3 import StorageAccount + from ._models_py3 import StorageAccountCheckNameAvailabilityParameters + from ._models_py3 import StorageAccountCreateParameters + from ._models_py3 import StorageAccountInternetEndpoints + from ._models_py3 import StorageAccountKey + from ._models_py3 import StorageAccountListKeysResult + from ._models_py3 import StorageAccountListResult + from ._models_py3 import StorageAccountMicrosoftEndpoints + from ._models_py3 import StorageAccountRegenerateKeyParameters + from ._models_py3 import StorageAccountUpdateParameters + from ._models_py3 import StorageQueue + from ._models_py3 import StorageSkuListResult + from ._models_py3 import SystemData + from ._models_py3 import Table + from ._models_py3 import TableServiceProperties + from ._models_py3 import TagFilter + from ._models_py3 import TagProperty + from ._models_py3 import TrackedResource + from ._models_py3 import UpdateHistoryProperty + from ._models_py3 import Usage + from ._models_py3 import UsageListResult + from ._models_py3 import UsageName + from ._models_py3 import UserAssignedIdentity + from ._models_py3 import VirtualNetworkRule +except (SyntaxError, ImportError): + from ._models import AccessPolicy # type: ignore + from ._models import AccountImmutabilityPolicyProperties # type: ignore + from ._models import AccountSasParameters # type: ignore + from ._models import ActiveDirectoryProperties # type: ignore + from ._models import AzureEntityResource # type: ignore + from ._models import AzureFilesIdentityBasedAuthentication # type: ignore + from ._models import BlobContainer # type: ignore + from ._models import BlobInventoryPolicy # type: ignore + from ._models import BlobInventoryPolicyDefinition # type: ignore + from ._models import BlobInventoryPolicyFilter # type: ignore + from ._models import BlobInventoryPolicyRule # type: ignore + from ._models import BlobInventoryPolicySchema # type: ignore + from ._models import BlobRestoreParameters # type: ignore + from ._models import BlobRestoreRange # type: ignore + from ._models import BlobRestoreStatus # type: ignore + from ._models import BlobServiceItems # type: ignore + from ._models import BlobServiceProperties # type: ignore + from ._models import ChangeFeed # type: ignore + from ._models import CheckNameAvailabilityResult # type: ignore + from ._models import CloudErrorAutoGenerated # type: ignore + from ._models import CloudErrorBody # type: ignore + from ._models import CloudErrorBodyAutoGenerated # type: ignore + from ._models import CorsRule # type: ignore + from ._models import CorsRules # type: ignore + from ._models import CustomDomain # type: ignore + from ._models import DateAfterCreation # type: ignore + from ._models import DateAfterModification # type: ignore + from ._models import DeleteRetentionPolicy # type: ignore + from ._models import DeletedAccount # type: ignore + from ._models import DeletedAccountListResult # type: ignore + from ._models import DeletedShare # type: ignore + from ._models import Dimension # type: ignore + from ._models import Encryption # type: ignore + from ._models import EncryptionIdentity # type: ignore + from ._models import EncryptionScope # type: ignore + from ._models import EncryptionScopeKeyVaultProperties # type: ignore + from ._models import EncryptionScopeListResult # type: ignore + from ._models import EncryptionService # type: ignore + from ._models import EncryptionServices # type: ignore + from ._models import Endpoints # type: ignore + from ._models import ErrorResponse # type: ignore + from ._models import ErrorResponseBody # type: ignore + from ._models import ExtendedLocation # type: ignore + from ._models import FileServiceItems # type: ignore + from ._models import FileServiceProperties # type: ignore + from ._models import FileShare # type: ignore + from ._models import FileShareItem # type: ignore + from ._models import FileShareItems # type: ignore + from ._models import GeoReplicationStats # type: ignore + from ._models import IPRule # type: ignore + from ._models import Identity # type: ignore + from ._models import ImmutabilityPolicy # type: ignore + from ._models import ImmutabilityPolicyProperties # type: ignore + from ._models import ImmutableStorageAccount # type: ignore + from ._models import ImmutableStorageWithVersioning # type: ignore + from ._models import KeyCreationTime # type: ignore + from ._models import KeyPolicy # type: ignore + from ._models import KeyVaultProperties # type: ignore + from ._models import LastAccessTimeTrackingPolicy # type: ignore + from ._models import LeaseContainerRequest # type: ignore + from ._models import LeaseContainerResponse # type: ignore + from ._models import LeaseShareRequest # type: ignore + from ._models import LeaseShareResponse # type: ignore + from ._models import LegalHold # type: ignore + from ._models import LegalHoldProperties # type: ignore + from ._models import ListAccountSasResponse # type: ignore + from ._models import ListBlobInventoryPolicy # type: ignore + from ._models import ListContainerItem # type: ignore + from ._models import ListContainerItems # type: ignore + from ._models import ListQueue # type: ignore + from ._models import ListQueueResource # type: ignore + from ._models import ListQueueServices # type: ignore + from ._models import ListServiceSasResponse # type: ignore + from ._models import ListTableResource # type: ignore + from ._models import ListTableServices # type: ignore + from ._models import ManagementPolicy # type: ignore + from ._models import ManagementPolicyAction # type: ignore + from ._models import ManagementPolicyBaseBlob # type: ignore + from ._models import ManagementPolicyDefinition # type: ignore + from ._models import ManagementPolicyFilter # type: ignore + from ._models import ManagementPolicyRule # type: ignore + from ._models import ManagementPolicySchema # type: ignore + from ._models import ManagementPolicySnapShot # type: ignore + from ._models import ManagementPolicyVersion # type: ignore + from ._models import MetricSpecification # type: ignore + from ._models import Multichannel # type: ignore + from ._models import NetworkRuleSet # type: ignore + from ._models import ObjectReplicationPolicies # type: ignore + from ._models import ObjectReplicationPolicy # type: ignore + from ._models import ObjectReplicationPolicyFilter # type: ignore + from ._models import ObjectReplicationPolicyRule # type: ignore + from ._models import Operation # type: ignore + from ._models import OperationDisplay # type: ignore + from ._models import OperationListResult # type: ignore + from ._models import PrivateEndpoint # type: ignore + from ._models import PrivateEndpointConnection # type: ignore + from ._models import PrivateEndpointConnectionListResult # type: ignore + from ._models import PrivateLinkResource # type: ignore + from ._models import PrivateLinkResourceListResult # type: ignore + from ._models import PrivateLinkServiceConnectionState # type: ignore + from ._models import ProtectedAppendWritesHistory # type: ignore + from ._models import ProtocolSettings # type: ignore + from ._models import ProxyResource # type: ignore + from ._models import QueueServiceProperties # type: ignore + from ._models import Resource # type: ignore + from ._models import ResourceAccessRule # type: ignore + from ._models import RestorePolicyProperties # type: ignore + from ._models import Restriction # type: ignore + from ._models import RoutingPreference # type: ignore + from ._models import SKUCapability # type: ignore + from ._models import SasPolicy # type: ignore + from ._models import ServiceSasParameters # type: ignore + from ._models import ServiceSpecification # type: ignore + from ._models import SignedIdentifier # type: ignore + from ._models import Sku # type: ignore + from ._models import SkuInformation # type: ignore + from ._models import SmbSetting # type: ignore + from ._models import StorageAccount # type: ignore + from ._models import StorageAccountCheckNameAvailabilityParameters # type: ignore + from ._models import StorageAccountCreateParameters # type: ignore + from ._models import StorageAccountInternetEndpoints # type: ignore + from ._models import StorageAccountKey # type: ignore + from ._models import StorageAccountListKeysResult # type: ignore + from ._models import StorageAccountListResult # type: ignore + from ._models import StorageAccountMicrosoftEndpoints # type: ignore + from ._models import StorageAccountRegenerateKeyParameters # type: ignore + from ._models import StorageAccountUpdateParameters # type: ignore + from ._models import StorageQueue # type: ignore + from ._models import StorageSkuListResult # type: ignore + from ._models import SystemData # type: ignore + from ._models import Table # type: ignore + from ._models import TableServiceProperties # type: ignore + from ._models import TagFilter # type: ignore + from ._models import TagProperty # type: ignore + from ._models import TrackedResource # type: ignore + from ._models import UpdateHistoryProperty # type: ignore + from ._models import Usage # type: ignore + from ._models import UsageListResult # type: ignore + from ._models import UsageName # type: ignore + from ._models import UserAssignedIdentity # type: ignore + from ._models import VirtualNetworkRule # type: ignore + +from ._storage_management_client_enums import ( + AccessTier, + AccountImmutabilityPolicyState, + AccountStatus, + BlobInventoryPolicyName, + BlobRestoreProgressStatus, + Bypass, + CorsRuleAllowedMethodsItem, + CreatedByType, + DefaultAction, + DefaultSharePermission, + DirectoryServiceOptions, + EnabledProtocols, + EncryptionScopeSource, + EncryptionScopeState, + ExpirationAction, + ExtendedLocationTypes, + Format, + GeoReplicationStatus, + HttpProtocol, + IdentityType, + ImmutabilityPolicyState, + ImmutabilityPolicyUpdateType, + InventoryRuleType, + KeyPermission, + KeySource, + KeyType, + Kind, + LargeFileSharesState, + LeaseContainerRequestAction, + LeaseDuration, + LeaseShareAction, + LeaseState, + LeaseStatus, + ListContainersInclude, + ManagementPolicyName, + MigrationState, + MinimumTlsVersion, + Name, + ObjectType, + Permissions, + PrivateEndpointConnectionProvisioningState, + PrivateEndpointServiceConnectionStatus, + ProvisioningState, + PublicAccess, + PublicNetworkAccess, + Reason, + ReasonCode, + RootSquashType, + RoutingChoice, + RuleType, + Schedule, + Services, + ShareAccessTier, + SignedResource, + SignedResourceTypes, + SkuName, + SkuTier, + State, + StorageAccountExpand, + UsageUnit, +) + +__all__ = [ + 'AccessPolicy', + 'AccountImmutabilityPolicyProperties', + 'AccountSasParameters', + 'ActiveDirectoryProperties', + 'AzureEntityResource', + 'AzureFilesIdentityBasedAuthentication', + 'BlobContainer', + 'BlobInventoryPolicy', + 'BlobInventoryPolicyDefinition', + 'BlobInventoryPolicyFilter', + 'BlobInventoryPolicyRule', + 'BlobInventoryPolicySchema', + 'BlobRestoreParameters', + 'BlobRestoreRange', + 'BlobRestoreStatus', + 'BlobServiceItems', + 'BlobServiceProperties', + 'ChangeFeed', + 'CheckNameAvailabilityResult', + 'CloudErrorAutoGenerated', + 'CloudErrorBody', + 'CloudErrorBodyAutoGenerated', + 'CorsRule', + 'CorsRules', + 'CustomDomain', + 'DateAfterCreation', + 'DateAfterModification', + 'DeleteRetentionPolicy', + 'DeletedAccount', + 'DeletedAccountListResult', + 'DeletedShare', + 'Dimension', + 'Encryption', + 'EncryptionIdentity', + 'EncryptionScope', + 'EncryptionScopeKeyVaultProperties', + 'EncryptionScopeListResult', + 'EncryptionService', + 'EncryptionServices', + 'Endpoints', + 'ErrorResponse', + 'ErrorResponseBody', + 'ExtendedLocation', + 'FileServiceItems', + 'FileServiceProperties', + 'FileShare', + 'FileShareItem', + 'FileShareItems', + 'GeoReplicationStats', + 'IPRule', + 'Identity', + 'ImmutabilityPolicy', + 'ImmutabilityPolicyProperties', + 'ImmutableStorageAccount', + 'ImmutableStorageWithVersioning', + 'KeyCreationTime', + 'KeyPolicy', + 'KeyVaultProperties', + 'LastAccessTimeTrackingPolicy', + 'LeaseContainerRequest', + 'LeaseContainerResponse', + 'LeaseShareRequest', + 'LeaseShareResponse', + 'LegalHold', + 'LegalHoldProperties', + 'ListAccountSasResponse', + 'ListBlobInventoryPolicy', + 'ListContainerItem', + 'ListContainerItems', + 'ListQueue', + 'ListQueueResource', + 'ListQueueServices', + 'ListServiceSasResponse', + 'ListTableResource', + 'ListTableServices', + 'ManagementPolicy', + 'ManagementPolicyAction', + 'ManagementPolicyBaseBlob', + 'ManagementPolicyDefinition', + 'ManagementPolicyFilter', + 'ManagementPolicyRule', + 'ManagementPolicySchema', + 'ManagementPolicySnapShot', + 'ManagementPolicyVersion', + 'MetricSpecification', + 'Multichannel', + 'NetworkRuleSet', + 'ObjectReplicationPolicies', + 'ObjectReplicationPolicy', + 'ObjectReplicationPolicyFilter', + 'ObjectReplicationPolicyRule', + 'Operation', + 'OperationDisplay', + 'OperationListResult', + 'PrivateEndpoint', + 'PrivateEndpointConnection', + 'PrivateEndpointConnectionListResult', + 'PrivateLinkResource', + 'PrivateLinkResourceListResult', + 'PrivateLinkServiceConnectionState', + 'ProtectedAppendWritesHistory', + 'ProtocolSettings', + 'ProxyResource', + 'QueueServiceProperties', + 'Resource', + 'ResourceAccessRule', + 'RestorePolicyProperties', + 'Restriction', + 'RoutingPreference', + 'SKUCapability', + 'SasPolicy', + 'ServiceSasParameters', + 'ServiceSpecification', + 'SignedIdentifier', + 'Sku', + 'SkuInformation', + 'SmbSetting', + 'StorageAccount', + 'StorageAccountCheckNameAvailabilityParameters', + 'StorageAccountCreateParameters', + 'StorageAccountInternetEndpoints', + 'StorageAccountKey', + 'StorageAccountListKeysResult', + 'StorageAccountListResult', + 'StorageAccountMicrosoftEndpoints', + 'StorageAccountRegenerateKeyParameters', + 'StorageAccountUpdateParameters', + 'StorageQueue', + 'StorageSkuListResult', + 'SystemData', + 'Table', + 'TableServiceProperties', + 'TagFilter', + 'TagProperty', + 'TrackedResource', + 'UpdateHistoryProperty', + 'Usage', + 'UsageListResult', + 'UsageName', + 'UserAssignedIdentity', + 'VirtualNetworkRule', + 'AccessTier', + 'AccountImmutabilityPolicyState', + 'AccountStatus', + 'BlobInventoryPolicyName', + 'BlobRestoreProgressStatus', + 'Bypass', + 'CorsRuleAllowedMethodsItem', + 'CreatedByType', + 'DefaultAction', + 'DefaultSharePermission', + 'DirectoryServiceOptions', + 'EnabledProtocols', + 'EncryptionScopeSource', + 'EncryptionScopeState', + 'ExpirationAction', + 'ExtendedLocationTypes', + 'Format', + 'GeoReplicationStatus', + 'HttpProtocol', + 'IdentityType', + 'ImmutabilityPolicyState', + 'ImmutabilityPolicyUpdateType', + 'InventoryRuleType', + 'KeyPermission', + 'KeySource', + 'KeyType', + 'Kind', + 'LargeFileSharesState', + 'LeaseContainerRequestAction', + 'LeaseDuration', + 'LeaseShareAction', + 'LeaseState', + 'LeaseStatus', + 'ListContainersInclude', + 'ManagementPolicyName', + 'MigrationState', + 'MinimumTlsVersion', + 'Name', + 'ObjectType', + 'Permissions', + 'PrivateEndpointConnectionProvisioningState', + 'PrivateEndpointServiceConnectionStatus', + 'ProvisioningState', + 'PublicAccess', + 'PublicNetworkAccess', + 'Reason', + 'ReasonCode', + 'RootSquashType', + 'RoutingChoice', + 'RuleType', + 'Schedule', + 'Services', + 'ShareAccessTier', + 'SignedResource', + 'SignedResourceTypes', + 'SkuName', + 'SkuTier', + 'State', + 'StorageAccountExpand', + 'UsageUnit', +] diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/models/_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/models/_models.py new file mode 100644 index 000000000000..df1e7ef924c7 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/models/_models.py @@ -0,0 +1,5943 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + + +class AccessPolicy(msrest.serialization.Model): + """AccessPolicy. + + :param start_time: Start time of the access policy. + :type start_time: ~datetime.datetime + :param expiry_time: Expiry time of the access policy. + :type expiry_time: ~datetime.datetime + :param permission: List of abbreviated permissions. + :type permission: str + """ + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, + 'permission': {'key': 'permission', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AccessPolicy, self).__init__(**kwargs) + self.start_time = kwargs.get('start_time', None) + self.expiry_time = kwargs.get('expiry_time', None) + self.permission = kwargs.get('permission', None) + + +class AccountImmutabilityPolicyProperties(msrest.serialization.Model): + """This defines account-level immutability policy properties. + + :param immutability_period_since_creation_in_days: The immutability period for the blobs in the + container since the policy creation, in days. + :type immutability_period_since_creation_in_days: int + :param state: The ImmutabilityPolicy state defines the mode of the policy. Disabled state + disables the policy, Unlocked state allows increase and decrease of immutability retention time + and also allows toggling allowProtectedAppendWrites property, Locked state only allows the + increase of the immutability retention time. A policy can only be created in a Disabled or + Unlocked state and can be toggled between the two states. Only a policy in an Unlocked state + can transition to a Locked state which cannot be reverted. Possible values include: "Unlocked", + "Locked", "Disabled". + :type state: str or ~azure.mgmt.storage.v2021_06_01.models.AccountImmutabilityPolicyState + :param allow_protected_append_writes: This property can only be changed for disabled and + unlocked time-based retention policies. When enabled, new blocks can be written to an append + blob while maintaining immutability protection and compliance. Only new blocks can be added and + any existing blocks cannot be modified or deleted. + :type allow_protected_append_writes: bool + """ + + _validation = { + 'immutability_period_since_creation_in_days': {'maximum': 146000, 'minimum': 1}, + } + + _attribute_map = { + 'immutability_period_since_creation_in_days': {'key': 'immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'state': {'key': 'state', 'type': 'str'}, + 'allow_protected_append_writes': {'key': 'allowProtectedAppendWrites', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(AccountImmutabilityPolicyProperties, self).__init__(**kwargs) + self.immutability_period_since_creation_in_days = kwargs.get('immutability_period_since_creation_in_days', None) + self.state = kwargs.get('state', None) + self.allow_protected_append_writes = kwargs.get('allow_protected_append_writes', None) + + +class AccountSasParameters(msrest.serialization.Model): + """The parameters to list SAS credentials of a storage account. + + All required parameters must be populated in order to send to Azure. + + :param services: Required. The signed services accessible with the account SAS. Possible values + include: Blob (b), Queue (q), Table (t), File (f). Possible values include: "b", "q", "t", "f". + :type services: str or ~azure.mgmt.storage.v2021_06_01.models.Services + :param resource_types: Required. The signed resource types that are accessible with the account + SAS. Service (s): Access to service-level APIs; Container (c): Access to container-level APIs; + Object (o): Access to object-level APIs for blobs, queue messages, table entities, and files. + Possible values include: "s", "c", "o". + :type resource_types: str or ~azure.mgmt.storage.v2021_06_01.models.SignedResourceTypes + :param permissions: Required. The signed permissions for the account SAS. Possible values + include: Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process + (p). Possible values include: "r", "d", "w", "l", "a", "c", "u", "p". + :type permissions: str or ~azure.mgmt.storage.v2021_06_01.models.Permissions + :param ip_address_or_range: An IP address or a range of IP addresses from which to accept + requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the account SAS. Possible + values include: "https,http", "https". + :type protocols: str or ~azure.mgmt.storage.v2021_06_01.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: ~datetime.datetime + :param shared_access_expiry_time: Required. The time at which the shared access signature + becomes invalid. + :type shared_access_expiry_time: ~datetime.datetime + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + """ + + _validation = { + 'services': {'required': True}, + 'resource_types': {'required': True}, + 'permissions': {'required': True}, + 'shared_access_expiry_time': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'signedServices', 'type': 'str'}, + 'resource_types': {'key': 'signedResourceTypes', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'str'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AccountSasParameters, self).__init__(**kwargs) + self.services = kwargs['services'] + self.resource_types = kwargs['resource_types'] + self.permissions = kwargs['permissions'] + self.ip_address_or_range = kwargs.get('ip_address_or_range', None) + self.protocols = kwargs.get('protocols', None) + self.shared_access_start_time = kwargs.get('shared_access_start_time', None) + self.shared_access_expiry_time = kwargs['shared_access_expiry_time'] + self.key_to_sign = kwargs.get('key_to_sign', None) + + +class ActiveDirectoryProperties(msrest.serialization.Model): + """Settings properties for Active Directory (AD). + + All required parameters must be populated in order to send to Azure. + + :param domain_name: Required. Specifies the primary domain that the AD DNS server is + authoritative for. + :type domain_name: str + :param net_bios_domain_name: Required. Specifies the NetBIOS domain name. + :type net_bios_domain_name: str + :param forest_name: Required. Specifies the Active Directory forest to get. + :type forest_name: str + :param domain_guid: Required. Specifies the domain GUID. + :type domain_guid: str + :param domain_sid: Required. Specifies the security identifier (SID). + :type domain_sid: str + :param azure_storage_sid: Required. Specifies the security identifier (SID) for Azure Storage. + :type azure_storage_sid: str + """ + + _validation = { + 'domain_name': {'required': True}, + 'net_bios_domain_name': {'required': True}, + 'forest_name': {'required': True}, + 'domain_guid': {'required': True}, + 'domain_sid': {'required': True}, + 'azure_storage_sid': {'required': True}, + } + + _attribute_map = { + 'domain_name': {'key': 'domainName', 'type': 'str'}, + 'net_bios_domain_name': {'key': 'netBiosDomainName', 'type': 'str'}, + 'forest_name': {'key': 'forestName', 'type': 'str'}, + 'domain_guid': {'key': 'domainGuid', 'type': 'str'}, + 'domain_sid': {'key': 'domainSid', 'type': 'str'}, + 'azure_storage_sid': {'key': 'azureStorageSid', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ActiveDirectoryProperties, self).__init__(**kwargs) + self.domain_name = kwargs['domain_name'] + self.net_bios_domain_name = kwargs['net_bios_domain_name'] + self.forest_name = kwargs['forest_name'] + self.domain_guid = kwargs['domain_guid'] + self.domain_sid = kwargs['domain_sid'] + self.azure_storage_sid = kwargs['azure_storage_sid'] + + +class Resource(msrest.serialization.Model): + """Common fields that are returned in the response for all Azure Resource Manager resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class AzureEntityResource(Resource): + """The resource model definition for an Azure Resource Manager resource with an etag. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureEntityResource, self).__init__(**kwargs) + self.etag = None + + +class AzureFilesIdentityBasedAuthentication(msrest.serialization.Model): + """Settings for Azure Files identity based authentication. + + All required parameters must be populated in order to send to Azure. + + :param directory_service_options: Required. Indicates the directory service used. Possible + values include: "None", "AADDS", "AD". + :type directory_service_options: str or + ~azure.mgmt.storage.v2021_06_01.models.DirectoryServiceOptions + :param active_directory_properties: Required if choose AD. + :type active_directory_properties: + ~azure.mgmt.storage.v2021_06_01.models.ActiveDirectoryProperties + :param default_share_permission: Default share permission for users using Kerberos + authentication if RBAC role is not assigned. Possible values include: "None", + "StorageFileDataSmbShareReader", "StorageFileDataSmbShareContributor", + "StorageFileDataSmbShareElevatedContributor". + :type default_share_permission: str or + ~azure.mgmt.storage.v2021_06_01.models.DefaultSharePermission + """ + + _validation = { + 'directory_service_options': {'required': True}, + } + + _attribute_map = { + 'directory_service_options': {'key': 'directoryServiceOptions', 'type': 'str'}, + 'active_directory_properties': {'key': 'activeDirectoryProperties', 'type': 'ActiveDirectoryProperties'}, + 'default_share_permission': {'key': 'defaultSharePermission', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureFilesIdentityBasedAuthentication, self).__init__(**kwargs) + self.directory_service_options = kwargs['directory_service_options'] + self.active_directory_properties = kwargs.get('active_directory_properties', None) + self.default_share_permission = kwargs.get('default_share_permission', None) + + +class BlobContainer(AzureEntityResource): + """Properties of the blob container, including Id, resource name, resource type, Etag. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :ivar version: The version of the deleted blob container. + :vartype version: str + :ivar deleted: Indicates whether the blob container was deleted. + :vartype deleted: bool + :ivar deleted_time: Blob container deletion time. + :vartype deleted_time: ~datetime.datetime + :ivar remaining_retention_days: Remaining retention days for soft deleted blob container. + :vartype remaining_retention_days: int + :param default_encryption_scope: Default the container to use specified encryption scope for + all writes. + :type default_encryption_scope: str + :param deny_encryption_scope_override: Block override of encryption scope from the container + default. + :type deny_encryption_scope_override: bool + :param public_access: Specifies whether data in the container may be accessed publicly and the + level of access. Possible values include: "Container", "Blob", "None". + :type public_access: str or ~azure.mgmt.storage.v2021_06_01.models.PublicAccess + :ivar last_modified_time: Returns the date and time the container was last modified. + :vartype last_modified_time: ~datetime.datetime + :ivar lease_status: The lease status of the container. Possible values include: "Locked", + "Unlocked". + :vartype lease_status: str or ~azure.mgmt.storage.v2021_06_01.models.LeaseStatus + :ivar lease_state: Lease state of the container. Possible values include: "Available", + "Leased", "Expired", "Breaking", "Broken". + :vartype lease_state: str or ~azure.mgmt.storage.v2021_06_01.models.LeaseState + :ivar lease_duration: Specifies whether the lease on a container is of infinite or fixed + duration, only when the container is leased. Possible values include: "Infinite", "Fixed". + :vartype lease_duration: str or ~azure.mgmt.storage.v2021_06_01.models.LeaseDuration + :param metadata: A name-value pair to associate with the container as metadata. + :type metadata: dict[str, str] + :ivar immutability_policy: The ImmutabilityPolicy property of the container. + :vartype immutability_policy: + ~azure.mgmt.storage.v2021_06_01.models.ImmutabilityPolicyProperties + :ivar legal_hold: The LegalHold property of the container. + :vartype legal_hold: ~azure.mgmt.storage.v2021_06_01.models.LegalHoldProperties + :ivar has_legal_hold: The hasLegalHold public property is set to true by SRP if there are at + least one existing tag. The hasLegalHold public property is set to false by SRP if all existing + legal hold tags are cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :ivar has_immutability_policy: The hasImmutabilityPolicy public property is set to true by SRP + if ImmutabilityPolicy has been created for this container. The hasImmutabilityPolicy public + property is set to false by SRP if ImmutabilityPolicy has not been created for this container. + :vartype has_immutability_policy: bool + :param immutable_storage_with_versioning: The object level immutability property of the + container. The property is immutable and can only be set to true at the container creation + time. Existing containers must undergo a migration process. + :type immutable_storage_with_versioning: + ~azure.mgmt.storage.v2021_06_01.models.ImmutableStorageWithVersioning + :param enable_nfs_v3_root_squash: Enable NFSv3 root squash on blob container. + :type enable_nfs_v3_root_squash: bool + :param enable_nfs_v3_all_squash: Enable NFSv3 all squash on blob container. + :type enable_nfs_v3_all_squash: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'version': {'readonly': True}, + 'deleted': {'readonly': True}, + 'deleted_time': {'readonly': True}, + 'remaining_retention_days': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'lease_status': {'readonly': True}, + 'lease_state': {'readonly': True}, + 'lease_duration': {'readonly': True}, + 'immutability_policy': {'readonly': True}, + 'legal_hold': {'readonly': True}, + 'has_legal_hold': {'readonly': True}, + 'has_immutability_policy': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'deleted': {'key': 'properties.deleted', 'type': 'bool'}, + 'deleted_time': {'key': 'properties.deletedTime', 'type': 'iso-8601'}, + 'remaining_retention_days': {'key': 'properties.remainingRetentionDays', 'type': 'int'}, + 'default_encryption_scope': {'key': 'properties.defaultEncryptionScope', 'type': 'str'}, + 'deny_encryption_scope_override': {'key': 'properties.denyEncryptionScopeOverride', 'type': 'bool'}, + 'public_access': {'key': 'properties.publicAccess', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, + 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, + 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'immutability_policy': {'key': 'properties.immutabilityPolicy', 'type': 'ImmutabilityPolicyProperties'}, + 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, + 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, + 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, + 'immutable_storage_with_versioning': {'key': 'properties.immutableStorageWithVersioning', 'type': 'ImmutableStorageWithVersioning'}, + 'enable_nfs_v3_root_squash': {'key': 'properties.enableNfsV3RootSquash', 'type': 'bool'}, + 'enable_nfs_v3_all_squash': {'key': 'properties.enableNfsV3AllSquash', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(BlobContainer, self).__init__(**kwargs) + self.version = None + self.deleted = None + self.deleted_time = None + self.remaining_retention_days = None + self.default_encryption_scope = kwargs.get('default_encryption_scope', None) + self.deny_encryption_scope_override = kwargs.get('deny_encryption_scope_override', None) + self.public_access = kwargs.get('public_access', None) + self.last_modified_time = None + self.lease_status = None + self.lease_state = None + self.lease_duration = None + self.metadata = kwargs.get('metadata', None) + self.immutability_policy = None + self.legal_hold = None + self.has_legal_hold = None + self.has_immutability_policy = None + self.immutable_storage_with_versioning = kwargs.get('immutable_storage_with_versioning', None) + self.enable_nfs_v3_root_squash = kwargs.get('enable_nfs_v3_root_squash', None) + self.enable_nfs_v3_all_squash = kwargs.get('enable_nfs_v3_all_squash', None) + + +class BlobInventoryPolicy(Resource): + """The storage account blob inventory policy. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.storage.v2021_06_01.models.SystemData + :ivar last_modified_time: Returns the last modified date and time of the blob inventory policy. + :vartype last_modified_time: ~datetime.datetime + :param policy: The storage account blob inventory policy object. It is composed of policy + rules. + :type policy: ~azure.mgmt.storage.v2021_06_01.models.BlobInventoryPolicySchema + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'policy': {'key': 'properties.policy', 'type': 'BlobInventoryPolicySchema'}, + } + + def __init__( + self, + **kwargs + ): + super(BlobInventoryPolicy, self).__init__(**kwargs) + self.system_data = None + self.last_modified_time = None + self.policy = kwargs.get('policy', None) + + +class BlobInventoryPolicyDefinition(msrest.serialization.Model): + """An object that defines the blob inventory rule. + + All required parameters must be populated in order to send to Azure. + + :param filters: An object that defines the filter set. + :type filters: ~azure.mgmt.storage.v2021_06_01.models.BlobInventoryPolicyFilter + :param format: Required. This is a required field, it specifies the format for the inventory + files. Possible values include: "Csv", "Parquet". + :type format: str or ~azure.mgmt.storage.v2021_06_01.models.Format + :param schedule: Required. This is a required field. This field is used to schedule an + inventory formation. Possible values include: "Daily", "Weekly". + :type schedule: str or ~azure.mgmt.storage.v2021_06_01.models.Schedule + :param object_type: Required. This is a required field. This field specifies the scope of the + inventory created either at the blob or container level. Possible values include: "Blob", + "Container". + :type object_type: str or ~azure.mgmt.storage.v2021_06_01.models.ObjectType + :param schema_fields: Required. This is a required field. This field specifies the fields and + properties of the object to be included in the inventory. The Schema field value 'Name' is + always required. The valid values for this field for the 'Blob' definition.objectType include + 'Name, Creation-Time, Last-Modified, Content-Length, Content-MD5, BlobType, AccessTier, + AccessTierChangeTime, AccessTierInferred, Tags, Expiry-Time, hdi_isfolder, Owner, Group, + Permissions, Acl, Snapshot, VersionId, IsCurrentVersion, Metadata, LastAccessTime'. The valid + values for 'Container' definition.objectType include 'Name, Last-Modified, Metadata, + LeaseStatus, LeaseState, LeaseDuration, PublicAccess, HasImmutabilityPolicy, HasLegalHold'. + Schema field values 'Expiry-Time, hdi_isfolder, Owner, Group, Permissions, Acl' are valid only + for Hns enabled accounts.'Tags' field is only valid for non Hns accounts. + :type schema_fields: list[str] + """ + + _validation = { + 'format': {'required': True}, + 'schedule': {'required': True}, + 'object_type': {'required': True}, + 'schema_fields': {'required': True}, + } + + _attribute_map = { + 'filters': {'key': 'filters', 'type': 'BlobInventoryPolicyFilter'}, + 'format': {'key': 'format', 'type': 'str'}, + 'schedule': {'key': 'schedule', 'type': 'str'}, + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'schema_fields': {'key': 'schemaFields', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(BlobInventoryPolicyDefinition, self).__init__(**kwargs) + self.filters = kwargs.get('filters', None) + self.format = kwargs['format'] + self.schedule = kwargs['schedule'] + self.object_type = kwargs['object_type'] + self.schema_fields = kwargs['schema_fields'] + + +class BlobInventoryPolicyFilter(msrest.serialization.Model): + """An object that defines the blob inventory rule filter conditions. For 'Blob' definition.objectType all filter properties are applicable, 'blobTypes' is required and others are optional. For 'Container' definition.objectType only prefixMatch is applicable and is optional. + + :param prefix_match: An array of strings for blob prefixes to be matched. + :type prefix_match: list[str] + :param blob_types: An array of predefined enum values. Valid values include blockBlob, + appendBlob, pageBlob. Hns accounts does not support pageBlobs. This field is required when + definition.objectType property is set to 'Blob'. + :type blob_types: list[str] + :param include_blob_versions: Includes blob versions in blob inventory when value is set to + true. The definition.schemaFields values 'VersionId and IsCurrentVersion' are required if this + property is set to true, else they must be excluded. + :type include_blob_versions: bool + :param include_snapshots: Includes blob snapshots in blob inventory when value is set to true. + The definition.schemaFields value 'Snapshot' is required if this property is set to true, else + it must be excluded. + :type include_snapshots: bool + """ + + _attribute_map = { + 'prefix_match': {'key': 'prefixMatch', 'type': '[str]'}, + 'blob_types': {'key': 'blobTypes', 'type': '[str]'}, + 'include_blob_versions': {'key': 'includeBlobVersions', 'type': 'bool'}, + 'include_snapshots': {'key': 'includeSnapshots', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(BlobInventoryPolicyFilter, self).__init__(**kwargs) + self.prefix_match = kwargs.get('prefix_match', None) + self.blob_types = kwargs.get('blob_types', None) + self.include_blob_versions = kwargs.get('include_blob_versions', None) + self.include_snapshots = kwargs.get('include_snapshots', None) + + +class BlobInventoryPolicyRule(msrest.serialization.Model): + """An object that wraps the blob inventory rule. Each rule is uniquely defined by name. + + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. Rule is enabled when set to true. + :type enabled: bool + :param name: Required. A rule name can contain any combination of alpha numeric characters. + Rule name is case-sensitive. It must be unique within a policy. + :type name: str + :param destination: Required. Container name where blob inventory files are stored. Must be + pre-created. + :type destination: str + :param definition: Required. An object that defines the blob inventory policy rule. + :type definition: ~azure.mgmt.storage.v2021_06_01.models.BlobInventoryPolicyDefinition + """ + + _validation = { + 'enabled': {'required': True}, + 'name': {'required': True}, + 'destination': {'required': True}, + 'definition': {'required': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'destination': {'key': 'destination', 'type': 'str'}, + 'definition': {'key': 'definition', 'type': 'BlobInventoryPolicyDefinition'}, + } + + def __init__( + self, + **kwargs + ): + super(BlobInventoryPolicyRule, self).__init__(**kwargs) + self.enabled = kwargs['enabled'] + self.name = kwargs['name'] + self.destination = kwargs['destination'] + self.definition = kwargs['definition'] + + +class BlobInventoryPolicySchema(msrest.serialization.Model): + """The storage account blob inventory policy rules. + + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. Policy is enabled if set to true. + :type enabled: bool + :param type: Required. The valid value is Inventory. Possible values include: "Inventory". + :type type: str or ~azure.mgmt.storage.v2021_06_01.models.InventoryRuleType + :param rules: Required. The storage account blob inventory policy rules. The rule is applied + when it is enabled. + :type rules: list[~azure.mgmt.storage.v2021_06_01.models.BlobInventoryPolicyRule] + """ + + _validation = { + 'enabled': {'required': True}, + 'type': {'required': True}, + 'rules': {'required': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'type': {'key': 'type', 'type': 'str'}, + 'rules': {'key': 'rules', 'type': '[BlobInventoryPolicyRule]'}, + } + + def __init__( + self, + **kwargs + ): + super(BlobInventoryPolicySchema, self).__init__(**kwargs) + self.enabled = kwargs['enabled'] + self.type = kwargs['type'] + self.rules = kwargs['rules'] + + +class BlobRestoreParameters(msrest.serialization.Model): + """Blob restore parameters. + + All required parameters must be populated in order to send to Azure. + + :param time_to_restore: Required. Restore blob to the specified time. + :type time_to_restore: ~datetime.datetime + :param blob_ranges: Required. Blob ranges to restore. + :type blob_ranges: list[~azure.mgmt.storage.v2021_06_01.models.BlobRestoreRange] + """ + + _validation = { + 'time_to_restore': {'required': True}, + 'blob_ranges': {'required': True}, + } + + _attribute_map = { + 'time_to_restore': {'key': 'timeToRestore', 'type': 'iso-8601'}, + 'blob_ranges': {'key': 'blobRanges', 'type': '[BlobRestoreRange]'}, + } + + def __init__( + self, + **kwargs + ): + super(BlobRestoreParameters, self).__init__(**kwargs) + self.time_to_restore = kwargs['time_to_restore'] + self.blob_ranges = kwargs['blob_ranges'] + + +class BlobRestoreRange(msrest.serialization.Model): + """Blob range. + + All required parameters must be populated in order to send to Azure. + + :param start_range: Required. Blob start range. This is inclusive. Empty means account start. + :type start_range: str + :param end_range: Required. Blob end range. This is exclusive. Empty means account end. + :type end_range: str + """ + + _validation = { + 'start_range': {'required': True}, + 'end_range': {'required': True}, + } + + _attribute_map = { + 'start_range': {'key': 'startRange', 'type': 'str'}, + 'end_range': {'key': 'endRange', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(BlobRestoreRange, self).__init__(**kwargs) + self.start_range = kwargs['start_range'] + self.end_range = kwargs['end_range'] + + +class BlobRestoreStatus(msrest.serialization.Model): + """Blob restore status. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar status: The status of blob restore progress. Possible values are: - InProgress: Indicates + that blob restore is ongoing. - Complete: Indicates that blob restore has been completed + successfully. - Failed: Indicates that blob restore is failed. Possible values include: + "InProgress", "Complete", "Failed". + :vartype status: str or ~azure.mgmt.storage.v2021_06_01.models.BlobRestoreProgressStatus + :ivar failure_reason: Failure reason when blob restore is failed. + :vartype failure_reason: str + :ivar restore_id: Id for tracking blob restore request. + :vartype restore_id: str + :ivar parameters: Blob restore request parameters. + :vartype parameters: ~azure.mgmt.storage.v2021_06_01.models.BlobRestoreParameters + """ + + _validation = { + 'status': {'readonly': True}, + 'failure_reason': {'readonly': True}, + 'restore_id': {'readonly': True}, + 'parameters': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'failure_reason': {'key': 'failureReason', 'type': 'str'}, + 'restore_id': {'key': 'restoreId', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'BlobRestoreParameters'}, + } + + def __init__( + self, + **kwargs + ): + super(BlobRestoreStatus, self).__init__(**kwargs) + self.status = None + self.failure_reason = None + self.restore_id = None + self.parameters = None + + +class BlobServiceItems(msrest.serialization.Model): + """BlobServiceItems. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of blob services returned. + :vartype value: list[~azure.mgmt.storage.v2021_06_01.models.BlobServiceProperties] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BlobServiceProperties]'}, + } + + def __init__( + self, + **kwargs + ): + super(BlobServiceItems, self).__init__(**kwargs) + self.value = None + + +class BlobServiceProperties(Resource): + """The properties of a storage account’s Blob service. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar sku: Sku name and tier. + :vartype sku: ~azure.mgmt.storage.v2021_06_01.models.Sku + :param cors: Specifies CORS rules for the Blob service. You can include up to five CorsRule + elements in the request. If no CorsRule elements are included in the request body, all CORS + rules will be deleted, and CORS will be disabled for the Blob service. + :type cors: ~azure.mgmt.storage.v2021_06_01.models.CorsRules + :param default_service_version: DefaultServiceVersion indicates the default version to use for + requests to the Blob service if an incoming request’s version is not specified. Possible values + include version 2008-10-27 and all more recent versions. + :type default_service_version: str + :param delete_retention_policy: The blob service properties for blob soft delete. + :type delete_retention_policy: ~azure.mgmt.storage.v2021_06_01.models.DeleteRetentionPolicy + :param is_versioning_enabled: Versioning is enabled if set to true. + :type is_versioning_enabled: bool + :param automatic_snapshot_policy_enabled: Deprecated in favor of isVersioningEnabled property. + :type automatic_snapshot_policy_enabled: bool + :param change_feed: The blob service properties for change feed events. + :type change_feed: ~azure.mgmt.storage.v2021_06_01.models.ChangeFeed + :param restore_policy: The blob service properties for blob restore policy. + :type restore_policy: ~azure.mgmt.storage.v2021_06_01.models.RestorePolicyProperties + :param container_delete_retention_policy: The blob service properties for container soft + delete. + :type container_delete_retention_policy: + ~azure.mgmt.storage.v2021_06_01.models.DeleteRetentionPolicy + :param last_access_time_tracking_policy: The blob service property to configure last access + time based tracking policy. + :type last_access_time_tracking_policy: + ~azure.mgmt.storage.v2021_06_01.models.LastAccessTimeTrackingPolicy + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'sku': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'cors': {'key': 'properties.cors', 'type': 'CorsRules'}, + 'default_service_version': {'key': 'properties.defaultServiceVersion', 'type': 'str'}, + 'delete_retention_policy': {'key': 'properties.deleteRetentionPolicy', 'type': 'DeleteRetentionPolicy'}, + 'is_versioning_enabled': {'key': 'properties.isVersioningEnabled', 'type': 'bool'}, + 'automatic_snapshot_policy_enabled': {'key': 'properties.automaticSnapshotPolicyEnabled', 'type': 'bool'}, + 'change_feed': {'key': 'properties.changeFeed', 'type': 'ChangeFeed'}, + 'restore_policy': {'key': 'properties.restorePolicy', 'type': 'RestorePolicyProperties'}, + 'container_delete_retention_policy': {'key': 'properties.containerDeleteRetentionPolicy', 'type': 'DeleteRetentionPolicy'}, + 'last_access_time_tracking_policy': {'key': 'properties.lastAccessTimeTrackingPolicy', 'type': 'LastAccessTimeTrackingPolicy'}, + } + + def __init__( + self, + **kwargs + ): + super(BlobServiceProperties, self).__init__(**kwargs) + self.sku = None + self.cors = kwargs.get('cors', None) + self.default_service_version = kwargs.get('default_service_version', None) + self.delete_retention_policy = kwargs.get('delete_retention_policy', None) + self.is_versioning_enabled = kwargs.get('is_versioning_enabled', None) + self.automatic_snapshot_policy_enabled = kwargs.get('automatic_snapshot_policy_enabled', None) + self.change_feed = kwargs.get('change_feed', None) + self.restore_policy = kwargs.get('restore_policy', None) + self.container_delete_retention_policy = kwargs.get('container_delete_retention_policy', None) + self.last_access_time_tracking_policy = kwargs.get('last_access_time_tracking_policy', None) + + +class ChangeFeed(msrest.serialization.Model): + """The blob service properties for change feed events. + + :param enabled: Indicates whether change feed event logging is enabled for the Blob service. + :type enabled: bool + :param retention_in_days: Indicates the duration of changeFeed retention in days. Minimum value + is 1 day and maximum value is 146000 days (400 years). A null value indicates an infinite + retention of the change feed. + :type retention_in_days: int + """ + + _validation = { + 'retention_in_days': {'maximum': 146000, 'minimum': 1}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'retention_in_days': {'key': 'retentionInDays', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(ChangeFeed, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.retention_in_days = kwargs.get('retention_in_days', None) + + +class CheckNameAvailabilityResult(msrest.serialization.Model): + """The CheckNameAvailability operation response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name_available: Gets a boolean value that indicates whether the name is available for you + to use. If true, the name is available. If false, the name has already been taken or is invalid + and cannot be used. + :vartype name_available: bool + :ivar reason: Gets the reason that a storage account name could not be used. The Reason element + is only returned if NameAvailable is false. Possible values include: "AccountNameInvalid", + "AlreadyExists". + :vartype reason: str or ~azure.mgmt.storage.v2021_06_01.models.Reason + :ivar message: Gets an error message explaining the Reason value in more detail. + :vartype message: str + """ + + _validation = { + 'name_available': {'readonly': True}, + 'reason': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.name_available = None + self.reason = None + self.message = None + + +class CloudErrorAutoGenerated(msrest.serialization.Model): + """An error response from the Storage service. + + :param error: An error response from the Storage service. + :type error: ~azure.mgmt.storage.v2021_06_01.models.CloudErrorBodyAutoGenerated + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'CloudErrorBodyAutoGenerated'}, + } + + def __init__( + self, + **kwargs + ): + super(CloudErrorAutoGenerated, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class CloudErrorBody(msrest.serialization.Model): + """An error response from the Storage service. + + :param code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable for display in a user + interface. + :type message: str + :param target: The target of the particular error. For example, the name of the property in + error. + :type target: str + :param details: A list of additional details about the error. + :type details: list[~azure.mgmt.storage.v2021_06_01.models.CloudErrorBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, + } + + def __init__( + self, + **kwargs + ): + super(CloudErrorBody, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) + self.details = kwargs.get('details', None) + + +class CloudErrorBodyAutoGenerated(msrest.serialization.Model): + """An error response from the Storage service. + + :param code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable for display in a user + interface. + :type message: str + :param target: The target of the particular error. For example, the name of the property in + error. + :type target: str + :param details: A list of additional details about the error. + :type details: list[~azure.mgmt.storage.v2021_06_01.models.CloudErrorBodyAutoGenerated] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudErrorBodyAutoGenerated]'}, + } + + def __init__( + self, + **kwargs + ): + super(CloudErrorBodyAutoGenerated, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) + self.details = kwargs.get('details', None) + + +class CorsRule(msrest.serialization.Model): + """Specifies a CORS rule for the Blob service. + + All required parameters must be populated in order to send to Azure. + + :param allowed_origins: Required. Required if CorsRule element is present. A list of origin + domains that will be allowed via CORS, or "*" to allow all domains. + :type allowed_origins: list[str] + :param allowed_methods: Required. Required if CorsRule element is present. A list of HTTP + methods that are allowed to be executed by the origin. + :type allowed_methods: list[str or + ~azure.mgmt.storage.v2021_06_01.models.CorsRuleAllowedMethodsItem] + :param max_age_in_seconds: Required. Required if CorsRule element is present. The number of + seconds that the client/browser should cache a preflight response. + :type max_age_in_seconds: int + :param exposed_headers: Required. Required if CorsRule element is present. A list of response + headers to expose to CORS clients. + :type exposed_headers: list[str] + :param allowed_headers: Required. Required if CorsRule element is present. A list of headers + allowed to be part of the cross-origin request. + :type allowed_headers: list[str] + """ + + _validation = { + 'allowed_origins': {'required': True}, + 'allowed_methods': {'required': True}, + 'max_age_in_seconds': {'required': True}, + 'exposed_headers': {'required': True}, + 'allowed_headers': {'required': True}, + } + + _attribute_map = { + 'allowed_origins': {'key': 'allowedOrigins', 'type': '[str]'}, + 'allowed_methods': {'key': 'allowedMethods', 'type': '[str]'}, + 'max_age_in_seconds': {'key': 'maxAgeInSeconds', 'type': 'int'}, + 'exposed_headers': {'key': 'exposedHeaders', 'type': '[str]'}, + 'allowed_headers': {'key': 'allowedHeaders', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(CorsRule, self).__init__(**kwargs) + self.allowed_origins = kwargs['allowed_origins'] + self.allowed_methods = kwargs['allowed_methods'] + self.max_age_in_seconds = kwargs['max_age_in_seconds'] + self.exposed_headers = kwargs['exposed_headers'] + self.allowed_headers = kwargs['allowed_headers'] + + +class CorsRules(msrest.serialization.Model): + """Sets the CORS rules. You can include up to five CorsRule elements in the request. + + :param cors_rules: The List of CORS rules. You can include up to five CorsRule elements in the + request. + :type cors_rules: list[~azure.mgmt.storage.v2021_06_01.models.CorsRule] + """ + + _attribute_map = { + 'cors_rules': {'key': 'corsRules', 'type': '[CorsRule]'}, + } + + def __init__( + self, + **kwargs + ): + super(CorsRules, self).__init__(**kwargs) + self.cors_rules = kwargs.get('cors_rules', None) + + +class CustomDomain(msrest.serialization.Model): + """The custom domain assigned to this storage account. This can be set via Update. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the custom domain name assigned to the storage account. + Name is the CNAME source. + :type name: str + :param use_sub_domain_name: Indicates whether indirect CName validation is enabled. Default + value is false. This should only be set on updates. + :type use_sub_domain_name: bool + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'use_sub_domain_name': {'key': 'useSubDomainName', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(CustomDomain, self).__init__(**kwargs) + self.name = kwargs['name'] + self.use_sub_domain_name = kwargs.get('use_sub_domain_name', None) + + +class DateAfterCreation(msrest.serialization.Model): + """Object to define the number of days after creation. + + All required parameters must be populated in order to send to Azure. + + :param days_after_creation_greater_than: Required. Value indicating the age in days after + creation. + :type days_after_creation_greater_than: float + """ + + _validation = { + 'days_after_creation_greater_than': {'required': True, 'minimum': 0, 'multiple': 1}, + } + + _attribute_map = { + 'days_after_creation_greater_than': {'key': 'daysAfterCreationGreaterThan', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(DateAfterCreation, self).__init__(**kwargs) + self.days_after_creation_greater_than = kwargs['days_after_creation_greater_than'] + + +class DateAfterModification(msrest.serialization.Model): + """Object to define the number of days after object last modification Or last access. Properties daysAfterModificationGreaterThan and daysAfterLastAccessTimeGreaterThan are mutually exclusive. + + :param days_after_modification_greater_than: Value indicating the age in days after last + modification. + :type days_after_modification_greater_than: float + :param days_after_last_access_time_greater_than: Value indicating the age in days after last + blob access. This property can only be used in conjunction with last access time tracking + policy. + :type days_after_last_access_time_greater_than: float + """ + + _validation = { + 'days_after_modification_greater_than': {'minimum': 0, 'multiple': 1}, + 'days_after_last_access_time_greater_than': {'minimum': 0, 'multiple': 1}, + } + + _attribute_map = { + 'days_after_modification_greater_than': {'key': 'daysAfterModificationGreaterThan', 'type': 'float'}, + 'days_after_last_access_time_greater_than': {'key': 'daysAfterLastAccessTimeGreaterThan', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(DateAfterModification, self).__init__(**kwargs) + self.days_after_modification_greater_than = kwargs.get('days_after_modification_greater_than', None) + self.days_after_last_access_time_greater_than = kwargs.get('days_after_last_access_time_greater_than', None) + + +class ProxyResource(Resource): + """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProxyResource, self).__init__(**kwargs) + + +class DeletedAccount(ProxyResource): + """Deleted storage account. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar storage_account_resource_id: Full resource id of the original storage account. + :vartype storage_account_resource_id: str + :ivar location: Location of the deleted account. + :vartype location: str + :ivar restore_reference: Can be used to attempt recovering this deleted account via + PutStorageAccount API. + :vartype restore_reference: str + :ivar creation_time: Creation time of the deleted account. + :vartype creation_time: str + :ivar deletion_time: Deletion time of the deleted account. + :vartype deletion_time: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'storage_account_resource_id': {'readonly': True}, + 'location': {'readonly': True}, + 'restore_reference': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'deletion_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'storage_account_resource_id': {'key': 'properties.storageAccountResourceId', 'type': 'str'}, + 'location': {'key': 'properties.location', 'type': 'str'}, + 'restore_reference': {'key': 'properties.restoreReference', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'str'}, + 'deletion_time': {'key': 'properties.deletionTime', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DeletedAccount, self).__init__(**kwargs) + self.storage_account_resource_id = None + self.location = None + self.restore_reference = None + self.creation_time = None + self.deletion_time = None + + +class DeletedAccountListResult(msrest.serialization.Model): + """The response from the List Deleted Accounts operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: Gets the list of deleted accounts and their properties. + :vartype value: list[~azure.mgmt.storage.v2021_06_01.models.DeletedAccount] + :ivar next_link: Request URL that can be used to query next page of deleted accounts. Returned + when total number of requested deleted accounts exceed maximum page size. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DeletedAccount]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DeletedAccountListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class DeletedShare(msrest.serialization.Model): + """The deleted share to be restored. + + All required parameters must be populated in order to send to Azure. + + :param deleted_share_name: Required. Required. Identify the name of the deleted share that will + be restored. + :type deleted_share_name: str + :param deleted_share_version: Required. Required. Identify the version of the deleted share + that will be restored. + :type deleted_share_version: str + """ + + _validation = { + 'deleted_share_name': {'required': True}, + 'deleted_share_version': {'required': True}, + } + + _attribute_map = { + 'deleted_share_name': {'key': 'deletedShareName', 'type': 'str'}, + 'deleted_share_version': {'key': 'deletedShareVersion', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DeletedShare, self).__init__(**kwargs) + self.deleted_share_name = kwargs['deleted_share_name'] + self.deleted_share_version = kwargs['deleted_share_version'] + + +class DeleteRetentionPolicy(msrest.serialization.Model): + """The service properties for soft delete. + + :param enabled: Indicates whether DeleteRetentionPolicy is enabled. + :type enabled: bool + :param days: Indicates the number of days that the deleted item should be retained. The minimum + specified value can be 1 and the maximum value can be 365. + :type days: int + """ + + _validation = { + 'days': {'maximum': 365, 'minimum': 1}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'days': {'key': 'days', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(DeleteRetentionPolicy, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.days = kwargs.get('days', None) + + +class Dimension(msrest.serialization.Model): + """Dimension of blobs, possibly be blob type or access tier. + + :param name: Display name of dimension. + :type name: str + :param display_name: Display name of dimension. + :type display_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Dimension, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + + +class Encryption(msrest.serialization.Model): + """The encryption settings on the storage account. + + All required parameters must be populated in order to send to Azure. + + :param services: List of services which support encryption. + :type services: ~azure.mgmt.storage.v2021_06_01.models.EncryptionServices + :param key_source: Required. The encryption keySource (provider). Possible values + (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. Possible values include: + "Microsoft.Storage", "Microsoft.Keyvault". Default value: "Microsoft.Storage". + :type key_source: str or ~azure.mgmt.storage.v2021_06_01.models.KeySource + :param require_infrastructure_encryption: A boolean indicating whether or not the service + applies a secondary layer of encryption with platform managed keys for data at rest. + :type require_infrastructure_encryption: bool + :param key_vault_properties: Properties provided by key vault. + :type key_vault_properties: ~azure.mgmt.storage.v2021_06_01.models.KeyVaultProperties + :param encryption_identity: The identity to be used with service-side encryption at rest. + :type encryption_identity: ~azure.mgmt.storage.v2021_06_01.models.EncryptionIdentity + """ + + _validation = { + 'key_source': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'services', 'type': 'EncryptionServices'}, + 'key_source': {'key': 'keySource', 'type': 'str'}, + 'require_infrastructure_encryption': {'key': 'requireInfrastructureEncryption', 'type': 'bool'}, + 'key_vault_properties': {'key': 'keyvaultproperties', 'type': 'KeyVaultProperties'}, + 'encryption_identity': {'key': 'identity', 'type': 'EncryptionIdentity'}, + } + + def __init__( + self, + **kwargs + ): + super(Encryption, self).__init__(**kwargs) + self.services = kwargs.get('services', None) + self.key_source = kwargs.get('key_source', "Microsoft.Storage") + self.require_infrastructure_encryption = kwargs.get('require_infrastructure_encryption', None) + self.key_vault_properties = kwargs.get('key_vault_properties', None) + self.encryption_identity = kwargs.get('encryption_identity', None) + + +class EncryptionIdentity(msrest.serialization.Model): + """Encryption identity for the storage account. + + :param encryption_user_assigned_identity: Resource identifier of the UserAssigned identity to + be associated with server-side encryption on the storage account. + :type encryption_user_assigned_identity: str + """ + + _attribute_map = { + 'encryption_user_assigned_identity': {'key': 'userAssignedIdentity', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EncryptionIdentity, self).__init__(**kwargs) + self.encryption_user_assigned_identity = kwargs.get('encryption_user_assigned_identity', None) + + +class EncryptionScope(Resource): + """The Encryption Scope resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param source: The provider for the encryption scope. Possible values (case-insensitive): + Microsoft.Storage, Microsoft.KeyVault. Possible values include: "Microsoft.Storage", + "Microsoft.KeyVault". + :type source: str or ~azure.mgmt.storage.v2021_06_01.models.EncryptionScopeSource + :param state: The state of the encryption scope. Possible values (case-insensitive): Enabled, + Disabled. Possible values include: "Enabled", "Disabled". + :type state: str or ~azure.mgmt.storage.v2021_06_01.models.EncryptionScopeState + :ivar creation_time: Gets the creation date and time of the encryption scope in UTC. + :vartype creation_time: ~datetime.datetime + :ivar last_modified_time: Gets the last modification date and time of the encryption scope in + UTC. + :vartype last_modified_time: ~datetime.datetime + :param key_vault_properties: The key vault properties for the encryption scope. This is a + required field if encryption scope 'source' attribute is set to 'Microsoft.KeyVault'. + :type key_vault_properties: + ~azure.mgmt.storage.v2021_06_01.models.EncryptionScopeKeyVaultProperties + :param require_infrastructure_encryption: A boolean indicating whether or not the service + applies a secondary layer of encryption with platform managed keys for data at rest. + :type require_infrastructure_encryption: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'source': {'key': 'properties.source', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'key_vault_properties': {'key': 'properties.keyVaultProperties', 'type': 'EncryptionScopeKeyVaultProperties'}, + 'require_infrastructure_encryption': {'key': 'properties.requireInfrastructureEncryption', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(EncryptionScope, self).__init__(**kwargs) + self.source = kwargs.get('source', None) + self.state = kwargs.get('state', None) + self.creation_time = None + self.last_modified_time = None + self.key_vault_properties = kwargs.get('key_vault_properties', None) + self.require_infrastructure_encryption = kwargs.get('require_infrastructure_encryption', None) + + +class EncryptionScopeKeyVaultProperties(msrest.serialization.Model): + """The key vault properties for the encryption scope. This is a required field if encryption scope 'source' attribute is set to 'Microsoft.KeyVault'. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param key_uri: The object identifier for a key vault key object. When applied, the encryption + scope will use the key referenced by the identifier to enable customer-managed key support on + this encryption scope. + :type key_uri: str + :ivar current_versioned_key_identifier: The object identifier of the current versioned Key + Vault Key in use. + :vartype current_versioned_key_identifier: str + :ivar last_key_rotation_timestamp: Timestamp of last rotation of the Key Vault Key. + :vartype last_key_rotation_timestamp: ~datetime.datetime + """ + + _validation = { + 'current_versioned_key_identifier': {'readonly': True}, + 'last_key_rotation_timestamp': {'readonly': True}, + } + + _attribute_map = { + 'key_uri': {'key': 'keyUri', 'type': 'str'}, + 'current_versioned_key_identifier': {'key': 'currentVersionedKeyIdentifier', 'type': 'str'}, + 'last_key_rotation_timestamp': {'key': 'lastKeyRotationTimestamp', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(EncryptionScopeKeyVaultProperties, self).__init__(**kwargs) + self.key_uri = kwargs.get('key_uri', None) + self.current_versioned_key_identifier = None + self.last_key_rotation_timestamp = None + + +class EncryptionScopeListResult(msrest.serialization.Model): + """List of encryption scopes requested, and if paging is required, a URL to the next page of encryption scopes. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of encryption scopes requested. + :vartype value: list[~azure.mgmt.storage.v2021_06_01.models.EncryptionScope] + :ivar next_link: Request URL that can be used to query next page of encryption scopes. Returned + when total number of requested encryption scopes exceeds the maximum page size. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[EncryptionScope]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EncryptionScopeListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class EncryptionService(msrest.serialization.Model): + """A service that allows server-side encryption to be used. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param enabled: A boolean indicating whether or not the service encrypts the data as it is + stored. + :type enabled: bool + :ivar last_enabled_time: Gets a rough estimate of the date/time when the encryption was last + enabled by the user. Only returned when encryption is enabled. There might be some unencrypted + blobs which were written after this time, as it is just a rough estimate. + :vartype last_enabled_time: ~datetime.datetime + :param key_type: Encryption key type to be used for the encryption service. 'Account' key type + implies that an account-scoped encryption key will be used. 'Service' key type implies that a + default service key is used. Possible values include: "Service", "Account". + :type key_type: str or ~azure.mgmt.storage.v2021_06_01.models.KeyType + """ + + _validation = { + 'last_enabled_time': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, + 'key_type': {'key': 'keyType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EncryptionService, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.last_enabled_time = None + self.key_type = kwargs.get('key_type', None) + + +class EncryptionServices(msrest.serialization.Model): + """A list of services that support encryption. + + :param blob: The encryption function of the blob storage service. + :type blob: ~azure.mgmt.storage.v2021_06_01.models.EncryptionService + :param file: The encryption function of the file storage service. + :type file: ~azure.mgmt.storage.v2021_06_01.models.EncryptionService + :param table: The encryption function of the table storage service. + :type table: ~azure.mgmt.storage.v2021_06_01.models.EncryptionService + :param queue: The encryption function of the queue storage service. + :type queue: ~azure.mgmt.storage.v2021_06_01.models.EncryptionService + """ + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'EncryptionService'}, + 'file': {'key': 'file', 'type': 'EncryptionService'}, + 'table': {'key': 'table', 'type': 'EncryptionService'}, + 'queue': {'key': 'queue', 'type': 'EncryptionService'}, + } + + def __init__( + self, + **kwargs + ): + super(EncryptionServices, self).__init__(**kwargs) + self.blob = kwargs.get('blob', None) + self.file = kwargs.get('file', None) + self.table = kwargs.get('table', None) + self.queue = kwargs.get('queue', None) + + +class Endpoints(msrest.serialization.Model): + """The URIs that are used to perform a retrieval of a public blob, queue, table, web or dfs object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar blob: Gets the blob endpoint. + :vartype blob: str + :ivar queue: Gets the queue endpoint. + :vartype queue: str + :ivar table: Gets the table endpoint. + :vartype table: str + :ivar file: Gets the file endpoint. + :vartype file: str + :ivar web: Gets the web endpoint. + :vartype web: str + :ivar dfs: Gets the dfs endpoint. + :vartype dfs: str + :param microsoft_endpoints: Gets the microsoft routing storage endpoints. + :type microsoft_endpoints: + ~azure.mgmt.storage.v2021_06_01.models.StorageAccountMicrosoftEndpoints + :param internet_endpoints: Gets the internet routing storage endpoints. + :type internet_endpoints: + ~azure.mgmt.storage.v2021_06_01.models.StorageAccountInternetEndpoints + """ + + _validation = { + 'blob': {'readonly': True}, + 'queue': {'readonly': True}, + 'table': {'readonly': True}, + 'file': {'readonly': True}, + 'web': {'readonly': True}, + 'dfs': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'str'}, + 'queue': {'key': 'queue', 'type': 'str'}, + 'table': {'key': 'table', 'type': 'str'}, + 'file': {'key': 'file', 'type': 'str'}, + 'web': {'key': 'web', 'type': 'str'}, + 'dfs': {'key': 'dfs', 'type': 'str'}, + 'microsoft_endpoints': {'key': 'microsoftEndpoints', 'type': 'StorageAccountMicrosoftEndpoints'}, + 'internet_endpoints': {'key': 'internetEndpoints', 'type': 'StorageAccountInternetEndpoints'}, + } + + def __init__( + self, + **kwargs + ): + super(Endpoints, self).__init__(**kwargs) + self.blob = None + self.queue = None + self.table = None + self.file = None + self.web = None + self.dfs = None + self.microsoft_endpoints = kwargs.get('microsoft_endpoints', None) + self.internet_endpoints = kwargs.get('internet_endpoints', None) + + +class ErrorResponse(msrest.serialization.Model): + """An error response from the storage resource provider. + + :param error: Azure Storage Resource Provider error response body. + :type error: ~azure.mgmt.storage.v2021_06_01.models.ErrorResponseBody + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponseBody'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class ErrorResponseBody(msrest.serialization.Model): + """Error response body contract. + + :param code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable for display in a user + interface. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponseBody, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + + +class ExtendedLocation(msrest.serialization.Model): + """The complex type of the extended location. + + :param name: The name of the extended location. + :type name: str + :param type: The type of the extended location. Possible values include: "EdgeZone". + :type type: str or ~azure.mgmt.storage.v2021_06_01.models.ExtendedLocationTypes + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExtendedLocation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + + +class FileServiceItems(msrest.serialization.Model): + """FileServiceItems. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of file services returned. + :vartype value: list[~azure.mgmt.storage.v2021_06_01.models.FileServiceProperties] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[FileServiceProperties]'}, + } + + def __init__( + self, + **kwargs + ): + super(FileServiceItems, self).__init__(**kwargs) + self.value = None + + +class FileServiceProperties(Resource): + """The properties of File services in storage account. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar sku: Sku name and tier. + :vartype sku: ~azure.mgmt.storage.v2021_06_01.models.Sku + :param cors: Specifies CORS rules for the File service. You can include up to five CorsRule + elements in the request. If no CorsRule elements are included in the request body, all CORS + rules will be deleted, and CORS will be disabled for the File service. + :type cors: ~azure.mgmt.storage.v2021_06_01.models.CorsRules + :param share_delete_retention_policy: The file service properties for share soft delete. + :type share_delete_retention_policy: + ~azure.mgmt.storage.v2021_06_01.models.DeleteRetentionPolicy + :param protocol_settings: Protocol settings for file service. + :type protocol_settings: ~azure.mgmt.storage.v2021_06_01.models.ProtocolSettings + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'sku': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'cors': {'key': 'properties.cors', 'type': 'CorsRules'}, + 'share_delete_retention_policy': {'key': 'properties.shareDeleteRetentionPolicy', 'type': 'DeleteRetentionPolicy'}, + 'protocol_settings': {'key': 'properties.protocolSettings', 'type': 'ProtocolSettings'}, + } + + def __init__( + self, + **kwargs + ): + super(FileServiceProperties, self).__init__(**kwargs) + self.sku = None + self.cors = kwargs.get('cors', None) + self.share_delete_retention_policy = kwargs.get('share_delete_retention_policy', None) + self.protocol_settings = kwargs.get('protocol_settings', None) + + +class FileShare(AzureEntityResource): + """Properties of the file share, including Id, resource name, resource type, Etag. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :ivar last_modified_time: Returns the date and time the share was last modified. + :vartype last_modified_time: ~datetime.datetime + :param metadata: A name-value pair to associate with the share as metadata. + :type metadata: dict[str, str] + :param share_quota: The maximum size of the share, in gigabytes. Must be greater than 0, and + less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400. + :type share_quota: int + :param enabled_protocols: The authentication protocol that is used for the file share. Can only + be specified when creating a share. Possible values include: "SMB", "NFS". + :type enabled_protocols: str or ~azure.mgmt.storage.v2021_06_01.models.EnabledProtocols + :param root_squash: The property is for NFS share only. The default is NoRootSquash. Possible + values include: "NoRootSquash", "RootSquash", "AllSquash". + :type root_squash: str or ~azure.mgmt.storage.v2021_06_01.models.RootSquashType + :ivar version: The version of the share. + :vartype version: str + :ivar deleted: Indicates whether the share was deleted. + :vartype deleted: bool + :ivar deleted_time: The deleted time if the share was deleted. + :vartype deleted_time: ~datetime.datetime + :ivar remaining_retention_days: Remaining retention days for share that was soft deleted. + :vartype remaining_retention_days: int + :param access_tier: Access tier for specific share. GpV2 account can choose between + TransactionOptimized (default), Hot, and Cool. FileStorage account can choose Premium. Possible + values include: "TransactionOptimized", "Hot", "Cool", "Premium". + :type access_tier: str or ~azure.mgmt.storage.v2021_06_01.models.ShareAccessTier + :ivar access_tier_change_time: Indicates the last modification time for share access tier. + :vartype access_tier_change_time: ~datetime.datetime + :ivar access_tier_status: Indicates if there is a pending transition for access tier. + :vartype access_tier_status: str + :ivar share_usage_bytes: The approximate size of the data stored on the share. Note that this + value may not include all recently created or recently resized files. + :vartype share_usage_bytes: long + :ivar lease_status: The lease status of the share. Possible values include: "Locked", + "Unlocked". + :vartype lease_status: str or ~azure.mgmt.storage.v2021_06_01.models.LeaseStatus + :ivar lease_state: Lease state of the share. Possible values include: "Available", "Leased", + "Expired", "Breaking", "Broken". + :vartype lease_state: str or ~azure.mgmt.storage.v2021_06_01.models.LeaseState + :ivar lease_duration: Specifies whether the lease on a share is of infinite or fixed duration, + only when the share is leased. Possible values include: "Infinite", "Fixed". + :vartype lease_duration: str or ~azure.mgmt.storage.v2021_06_01.models.LeaseDuration + :param signed_identifiers: List of stored access policies specified on the share. + :type signed_identifiers: list[~azure.mgmt.storage.v2021_06_01.models.SignedIdentifier] + :ivar snapshot_time: Creation time of share snapshot returned in the response of list shares + with expand param "snapshots". + :vartype snapshot_time: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'share_quota': {'maximum': 102400, 'minimum': 1}, + 'version': {'readonly': True}, + 'deleted': {'readonly': True}, + 'deleted_time': {'readonly': True}, + 'remaining_retention_days': {'readonly': True}, + 'access_tier_change_time': {'readonly': True}, + 'access_tier_status': {'readonly': True}, + 'share_usage_bytes': {'readonly': True}, + 'lease_status': {'readonly': True}, + 'lease_state': {'readonly': True}, + 'lease_duration': {'readonly': True}, + 'snapshot_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'share_quota': {'key': 'properties.shareQuota', 'type': 'int'}, + 'enabled_protocols': {'key': 'properties.enabledProtocols', 'type': 'str'}, + 'root_squash': {'key': 'properties.rootSquash', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'deleted': {'key': 'properties.deleted', 'type': 'bool'}, + 'deleted_time': {'key': 'properties.deletedTime', 'type': 'iso-8601'}, + 'remaining_retention_days': {'key': 'properties.remainingRetentionDays', 'type': 'int'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'str'}, + 'access_tier_change_time': {'key': 'properties.accessTierChangeTime', 'type': 'iso-8601'}, + 'access_tier_status': {'key': 'properties.accessTierStatus', 'type': 'str'}, + 'share_usage_bytes': {'key': 'properties.shareUsageBytes', 'type': 'long'}, + 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, + 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, + 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, + 'signed_identifiers': {'key': 'properties.signedIdentifiers', 'type': '[SignedIdentifier]'}, + 'snapshot_time': {'key': 'properties.snapshotTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(FileShare, self).__init__(**kwargs) + self.last_modified_time = None + self.metadata = kwargs.get('metadata', None) + self.share_quota = kwargs.get('share_quota', None) + self.enabled_protocols = kwargs.get('enabled_protocols', None) + self.root_squash = kwargs.get('root_squash', None) + self.version = None + self.deleted = None + self.deleted_time = None + self.remaining_retention_days = None + self.access_tier = kwargs.get('access_tier', None) + self.access_tier_change_time = None + self.access_tier_status = None + self.share_usage_bytes = None + self.lease_status = None + self.lease_state = None + self.lease_duration = None + self.signed_identifiers = kwargs.get('signed_identifiers', None) + self.snapshot_time = None + + +class FileShareItem(AzureEntityResource): + """The file share properties be listed out. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :ivar last_modified_time: Returns the date and time the share was last modified. + :vartype last_modified_time: ~datetime.datetime + :param metadata: A name-value pair to associate with the share as metadata. + :type metadata: dict[str, str] + :param share_quota: The maximum size of the share, in gigabytes. Must be greater than 0, and + less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400. + :type share_quota: int + :param enabled_protocols: The authentication protocol that is used for the file share. Can only + be specified when creating a share. Possible values include: "SMB", "NFS". + :type enabled_protocols: str or ~azure.mgmt.storage.v2021_06_01.models.EnabledProtocols + :param root_squash: The property is for NFS share only. The default is NoRootSquash. Possible + values include: "NoRootSquash", "RootSquash", "AllSquash". + :type root_squash: str or ~azure.mgmt.storage.v2021_06_01.models.RootSquashType + :ivar version: The version of the share. + :vartype version: str + :ivar deleted: Indicates whether the share was deleted. + :vartype deleted: bool + :ivar deleted_time: The deleted time if the share was deleted. + :vartype deleted_time: ~datetime.datetime + :ivar remaining_retention_days: Remaining retention days for share that was soft deleted. + :vartype remaining_retention_days: int + :param access_tier: Access tier for specific share. GpV2 account can choose between + TransactionOptimized (default), Hot, and Cool. FileStorage account can choose Premium. Possible + values include: "TransactionOptimized", "Hot", "Cool", "Premium". + :type access_tier: str or ~azure.mgmt.storage.v2021_06_01.models.ShareAccessTier + :ivar access_tier_change_time: Indicates the last modification time for share access tier. + :vartype access_tier_change_time: ~datetime.datetime + :ivar access_tier_status: Indicates if there is a pending transition for access tier. + :vartype access_tier_status: str + :ivar share_usage_bytes: The approximate size of the data stored on the share. Note that this + value may not include all recently created or recently resized files. + :vartype share_usage_bytes: long + :ivar lease_status: The lease status of the share. Possible values include: "Locked", + "Unlocked". + :vartype lease_status: str or ~azure.mgmt.storage.v2021_06_01.models.LeaseStatus + :ivar lease_state: Lease state of the share. Possible values include: "Available", "Leased", + "Expired", "Breaking", "Broken". + :vartype lease_state: str or ~azure.mgmt.storage.v2021_06_01.models.LeaseState + :ivar lease_duration: Specifies whether the lease on a share is of infinite or fixed duration, + only when the share is leased. Possible values include: "Infinite", "Fixed". + :vartype lease_duration: str or ~azure.mgmt.storage.v2021_06_01.models.LeaseDuration + :param signed_identifiers: List of stored access policies specified on the share. + :type signed_identifiers: list[~azure.mgmt.storage.v2021_06_01.models.SignedIdentifier] + :ivar snapshot_time: Creation time of share snapshot returned in the response of list shares + with expand param "snapshots". + :vartype snapshot_time: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'share_quota': {'maximum': 102400, 'minimum': 1}, + 'version': {'readonly': True}, + 'deleted': {'readonly': True}, + 'deleted_time': {'readonly': True}, + 'remaining_retention_days': {'readonly': True}, + 'access_tier_change_time': {'readonly': True}, + 'access_tier_status': {'readonly': True}, + 'share_usage_bytes': {'readonly': True}, + 'lease_status': {'readonly': True}, + 'lease_state': {'readonly': True}, + 'lease_duration': {'readonly': True}, + 'snapshot_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'share_quota': {'key': 'properties.shareQuota', 'type': 'int'}, + 'enabled_protocols': {'key': 'properties.enabledProtocols', 'type': 'str'}, + 'root_squash': {'key': 'properties.rootSquash', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'deleted': {'key': 'properties.deleted', 'type': 'bool'}, + 'deleted_time': {'key': 'properties.deletedTime', 'type': 'iso-8601'}, + 'remaining_retention_days': {'key': 'properties.remainingRetentionDays', 'type': 'int'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'str'}, + 'access_tier_change_time': {'key': 'properties.accessTierChangeTime', 'type': 'iso-8601'}, + 'access_tier_status': {'key': 'properties.accessTierStatus', 'type': 'str'}, + 'share_usage_bytes': {'key': 'properties.shareUsageBytes', 'type': 'long'}, + 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, + 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, + 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, + 'signed_identifiers': {'key': 'properties.signedIdentifiers', 'type': '[SignedIdentifier]'}, + 'snapshot_time': {'key': 'properties.snapshotTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(FileShareItem, self).__init__(**kwargs) + self.last_modified_time = None + self.metadata = kwargs.get('metadata', None) + self.share_quota = kwargs.get('share_quota', None) + self.enabled_protocols = kwargs.get('enabled_protocols', None) + self.root_squash = kwargs.get('root_squash', None) + self.version = None + self.deleted = None + self.deleted_time = None + self.remaining_retention_days = None + self.access_tier = kwargs.get('access_tier', None) + self.access_tier_change_time = None + self.access_tier_status = None + self.share_usage_bytes = None + self.lease_status = None + self.lease_state = None + self.lease_duration = None + self.signed_identifiers = kwargs.get('signed_identifiers', None) + self.snapshot_time = None + + +class FileShareItems(msrest.serialization.Model): + """Response schema. Contains list of shares returned, and if paging is requested or required, a URL to next page of shares. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of file shares returned. + :vartype value: list[~azure.mgmt.storage.v2021_06_01.models.FileShareItem] + :ivar next_link: Request URL that can be used to query next page of shares. Returned when total + number of requested shares exceed maximum page size. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[FileShareItem]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(FileShareItems, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class GeoReplicationStats(msrest.serialization.Model): + """Statistics related to replication for storage account's Blob, Table, Queue and File services. It is only available when geo-redundant replication is enabled for the storage account. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar status: The status of the secondary location. Possible values are: - Live: Indicates that + the secondary location is active and operational. - Bootstrap: Indicates initial + synchronization from the primary location to the secondary location is in progress.This + typically occurs when replication is first enabled. - Unavailable: Indicates that the secondary + location is temporarily unavailable. Possible values include: "Live", "Bootstrap", + "Unavailable". + :vartype status: str or ~azure.mgmt.storage.v2021_06_01.models.GeoReplicationStatus + :ivar last_sync_time: All primary writes preceding this UTC date/time value are guaranteed to + be available for read operations. Primary writes following this point in time may or may not be + available for reads. Element may be default value if value of LastSyncTime is not available, + this can happen if secondary is offline or we are in bootstrap. + :vartype last_sync_time: ~datetime.datetime + :ivar can_failover: A boolean flag which indicates whether or not account failover is supported + for the account. + :vartype can_failover: bool + """ + + _validation = { + 'status': {'readonly': True}, + 'last_sync_time': {'readonly': True}, + 'can_failover': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'last_sync_time': {'key': 'lastSyncTime', 'type': 'iso-8601'}, + 'can_failover': {'key': 'canFailover', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(GeoReplicationStats, self).__init__(**kwargs) + self.status = None + self.last_sync_time = None + self.can_failover = None + + +class Identity(msrest.serialization.Model): + """Identity for the resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :param type: Required. The identity type. Possible values include: "None", "SystemAssigned", + "UserAssigned", "SystemAssigned,UserAssigned". + :type type: str or ~azure.mgmt.storage.v2021_06_01.models.IdentityType + :param user_assigned_identities: Gets or sets a list of key value pairs that describe the set + of User Assigned identities that will be used with this storage account. The key is the ARM + resource identifier of the identity. Only 1 User Assigned identity is permitted here. + :type user_assigned_identities: dict[str, + ~azure.mgmt.storage.v2021_06_01.models.UserAssignedIdentity] + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, + } + + def __init__( + self, + **kwargs + ): + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = kwargs['type'] + self.user_assigned_identities = kwargs.get('user_assigned_identities', None) + + +class ImmutabilityPolicy(AzureEntityResource): + """The ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :param immutability_period_since_creation_in_days: The immutability period for the blobs in the + container since the policy creation, in days. + :type immutability_period_since_creation_in_days: int + :ivar state: The ImmutabilityPolicy state of a blob container, possible values include: Locked + and Unlocked. Possible values include: "Locked", "Unlocked". + :vartype state: str or ~azure.mgmt.storage.v2021_06_01.models.ImmutabilityPolicyState + :param allow_protected_append_writes: This property can only be changed for unlocked time-based + retention policies. When enabled, new blocks can be written to an append blob while maintaining + immutability protection and compliance. Only new blocks can be added and any existing blocks + cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy + API. + :type allow_protected_append_writes: bool + :param allow_protected_append_writes_all: This property can only be changed for unlocked + time-based retention policies. When enabled, new blocks can be written to both 'Append and Bock + Blobs' while maintaining immutability protection and compliance. Only new blocks can be added + and any existing blocks cannot be modified or deleted. This property cannot be changed with + ExtendImmutabilityPolicy API. The 'allowProtectedAppendWrites' and + 'allowProtectedAppendWritesAll' properties are mutually exclusive. + :type allow_protected_append_writes_all: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'allow_protected_append_writes': {'key': 'properties.allowProtectedAppendWrites', 'type': 'bool'}, + 'allow_protected_append_writes_all': {'key': 'properties.allowProtectedAppendWritesAll', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(ImmutabilityPolicy, self).__init__(**kwargs) + self.immutability_period_since_creation_in_days = kwargs.get('immutability_period_since_creation_in_days', None) + self.state = None + self.allow_protected_append_writes = kwargs.get('allow_protected_append_writes', None) + self.allow_protected_append_writes_all = kwargs.get('allow_protected_append_writes_all', None) + + +class ImmutabilityPolicyProperties(msrest.serialization.Model): + """The properties of an ImmutabilityPolicy of a blob container. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar etag: ImmutabilityPolicy Etag. + :vartype etag: str + :ivar update_history: The ImmutabilityPolicy update history of the blob container. + :vartype update_history: list[~azure.mgmt.storage.v2021_06_01.models.UpdateHistoryProperty] + :param immutability_period_since_creation_in_days: The immutability period for the blobs in the + container since the policy creation, in days. + :type immutability_period_since_creation_in_days: int + :ivar state: The ImmutabilityPolicy state of a blob container, possible values include: Locked + and Unlocked. Possible values include: "Locked", "Unlocked". + :vartype state: str or ~azure.mgmt.storage.v2021_06_01.models.ImmutabilityPolicyState + :param allow_protected_append_writes: This property can only be changed for unlocked time-based + retention policies. When enabled, new blocks can be written to an append blob while maintaining + immutability protection and compliance. Only new blocks can be added and any existing blocks + cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy + API. + :type allow_protected_append_writes: bool + :param allow_protected_append_writes_all: This property can only be changed for unlocked + time-based retention policies. When enabled, new blocks can be written to both 'Append and Bock + Blobs' while maintaining immutability protection and compliance. Only new blocks can be added + and any existing blocks cannot be modified or deleted. This property cannot be changed with + ExtendImmutabilityPolicy API. The 'allowProtectedAppendWrites' and + 'allowProtectedAppendWritesAll' properties are mutually exclusive. + :type allow_protected_append_writes_all: bool + """ + + _validation = { + 'etag': {'readonly': True}, + 'update_history': {'readonly': True}, + 'state': {'readonly': True}, + } + + _attribute_map = { + 'etag': {'key': 'etag', 'type': 'str'}, + 'update_history': {'key': 'updateHistory', 'type': '[UpdateHistoryProperty]'}, + 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'allow_protected_append_writes': {'key': 'properties.allowProtectedAppendWrites', 'type': 'bool'}, + 'allow_protected_append_writes_all': {'key': 'properties.allowProtectedAppendWritesAll', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(ImmutabilityPolicyProperties, self).__init__(**kwargs) + self.etag = None + self.update_history = None + self.immutability_period_since_creation_in_days = kwargs.get('immutability_period_since_creation_in_days', None) + self.state = None + self.allow_protected_append_writes = kwargs.get('allow_protected_append_writes', None) + self.allow_protected_append_writes_all = kwargs.get('allow_protected_append_writes_all', None) + + +class ImmutableStorageAccount(msrest.serialization.Model): + """This property enables and defines account-level immutability. Enabling the feature auto-enables Blob Versioning. + + :param enabled: A boolean flag which enables account-level immutability. All the containers + under such an account have object-level immutability enabled by default. + :type enabled: bool + :param immutability_policy: Specifies the default account-level immutability policy which is + inherited and applied to objects that do not possess an explicit immutability policy at the + object level. The object-level immutability policy has higher precedence than the + container-level immutability policy, which has a higher precedence than the account-level + immutability policy. + :type immutability_policy: + ~azure.mgmt.storage.v2021_06_01.models.AccountImmutabilityPolicyProperties + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'immutability_policy': {'key': 'immutabilityPolicy', 'type': 'AccountImmutabilityPolicyProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(ImmutableStorageAccount, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.immutability_policy = kwargs.get('immutability_policy', None) + + +class ImmutableStorageWithVersioning(msrest.serialization.Model): + """Object level immutability properties of the container. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param enabled: This is an immutable property, when set to true it enables object level + immutability at the container level. + :type enabled: bool + :ivar time_stamp: Returns the date and time the object level immutability was enabled. + :vartype time_stamp: ~datetime.datetime + :ivar migration_state: This property denotes the container level immutability to object level + immutability migration state. Possible values include: "InProgress", "Completed". + :vartype migration_state: str or ~azure.mgmt.storage.v2021_06_01.models.MigrationState + """ + + _validation = { + 'time_stamp': {'readonly': True}, + 'migration_state': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'time_stamp': {'key': 'timeStamp', 'type': 'iso-8601'}, + 'migration_state': {'key': 'migrationState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ImmutableStorageWithVersioning, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.time_stamp = None + self.migration_state = None + + +class IPRule(msrest.serialization.Model): + """IP rule with specific IP or IP range in CIDR format. + + All required parameters must be populated in order to send to Azure. + + :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR format. Only IPV4 + address is allowed. + :type ip_address_or_range: str + :param action: The action of IP ACL rule. The only acceptable values to pass in are None and + "Allow". The default value is None. + :type action: str + """ + + _validation = { + 'ip_address_or_range': {'required': True}, + } + + _attribute_map = { + 'ip_address_or_range': {'key': 'value', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IPRule, self).__init__(**kwargs) + self.ip_address_or_range = kwargs['ip_address_or_range'] + self.action = kwargs.get('action', None) + + +class KeyCreationTime(msrest.serialization.Model): + """Storage account keys creation time. + + :param key1: + :type key1: ~datetime.datetime + :param key2: + :type key2: ~datetime.datetime + """ + + _attribute_map = { + 'key1': {'key': 'key1', 'type': 'iso-8601'}, + 'key2': {'key': 'key2', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(KeyCreationTime, self).__init__(**kwargs) + self.key1 = kwargs.get('key1', None) + self.key2 = kwargs.get('key2', None) + + +class KeyPolicy(msrest.serialization.Model): + """KeyPolicy assigned to the storage account. + + All required parameters must be populated in order to send to Azure. + + :param key_expiration_period_in_days: Required. The key expiration period in days. + :type key_expiration_period_in_days: int + """ + + _validation = { + 'key_expiration_period_in_days': {'required': True}, + } + + _attribute_map = { + 'key_expiration_period_in_days': {'key': 'keyExpirationPeriodInDays', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(KeyPolicy, self).__init__(**kwargs) + self.key_expiration_period_in_days = kwargs['key_expiration_period_in_days'] + + +class KeyVaultProperties(msrest.serialization.Model): + """Properties of key vault. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param key_name: The name of KeyVault key. + :type key_name: str + :param key_version: The version of KeyVault key. + :type key_version: str + :param key_vault_uri: The Uri of KeyVault. + :type key_vault_uri: str + :ivar current_versioned_key_identifier: The object identifier of the current versioned Key + Vault Key in use. + :vartype current_versioned_key_identifier: str + :ivar last_key_rotation_timestamp: Timestamp of last rotation of the Key Vault Key. + :vartype last_key_rotation_timestamp: ~datetime.datetime + """ + + _validation = { + 'current_versioned_key_identifier': {'readonly': True}, + 'last_key_rotation_timestamp': {'readonly': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyname', 'type': 'str'}, + 'key_version': {'key': 'keyversion', 'type': 'str'}, + 'key_vault_uri': {'key': 'keyvaulturi', 'type': 'str'}, + 'current_versioned_key_identifier': {'key': 'currentVersionedKeyIdentifier', 'type': 'str'}, + 'last_key_rotation_timestamp': {'key': 'lastKeyRotationTimestamp', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(KeyVaultProperties, self).__init__(**kwargs) + self.key_name = kwargs.get('key_name', None) + self.key_version = kwargs.get('key_version', None) + self.key_vault_uri = kwargs.get('key_vault_uri', None) + self.current_versioned_key_identifier = None + self.last_key_rotation_timestamp = None + + +class LastAccessTimeTrackingPolicy(msrest.serialization.Model): + """The blob service properties for Last access time based tracking policy. + + All required parameters must be populated in order to send to Azure. + + :param enable: Required. When set to true last access time based tracking is enabled. + :type enable: bool + :param name: Name of the policy. The valid value is AccessTimeTracking. This field is currently + read only. Possible values include: "AccessTimeTracking". + :type name: str or ~azure.mgmt.storage.v2021_06_01.models.Name + :param tracking_granularity_in_days: The field specifies blob object tracking granularity in + days, typically how often the blob object should be tracked.This field is currently read only + with value as 1. + :type tracking_granularity_in_days: int + :param blob_type: An array of predefined supported blob types. Only blockBlob is the supported + value. This field is currently read only. + :type blob_type: list[str] + """ + + _validation = { + 'enable': {'required': True}, + } + + _attribute_map = { + 'enable': {'key': 'enable', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tracking_granularity_in_days': {'key': 'trackingGranularityInDays', 'type': 'int'}, + 'blob_type': {'key': 'blobType', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(LastAccessTimeTrackingPolicy, self).__init__(**kwargs) + self.enable = kwargs['enable'] + self.name = kwargs.get('name', None) + self.tracking_granularity_in_days = kwargs.get('tracking_granularity_in_days', None) + self.blob_type = kwargs.get('blob_type', None) + + +class LeaseContainerRequest(msrest.serialization.Model): + """Lease Container request schema. + + All required parameters must be populated in order to send to Azure. + + :param action: Required. Specifies the lease action. Can be one of the available actions. + Possible values include: "Acquire", "Renew", "Change", "Release", "Break". + :type action: str or ~azure.mgmt.storage.v2021_06_01.models.LeaseContainerRequestAction + :param lease_id: Identifies the lease. Can be specified in any valid GUID string format. + :type lease_id: str + :param break_period: Optional. For a break action, proposed duration the lease should continue + before it is broken, in seconds, between 0 and 60. + :type break_period: int + :param lease_duration: Required for acquire. Specifies the duration of the lease, in seconds, + or negative one (-1) for a lease that never expires. + :type lease_duration: int + :param proposed_lease_id: Optional for acquire, required for change. Proposed lease ID, in a + GUID string format. + :type proposed_lease_id: str + """ + + _validation = { + 'action': {'required': True}, + } + + _attribute_map = { + 'action': {'key': 'action', 'type': 'str'}, + 'lease_id': {'key': 'leaseId', 'type': 'str'}, + 'break_period': {'key': 'breakPeriod', 'type': 'int'}, + 'lease_duration': {'key': 'leaseDuration', 'type': 'int'}, + 'proposed_lease_id': {'key': 'proposedLeaseId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LeaseContainerRequest, self).__init__(**kwargs) + self.action = kwargs['action'] + self.lease_id = kwargs.get('lease_id', None) + self.break_period = kwargs.get('break_period', None) + self.lease_duration = kwargs.get('lease_duration', None) + self.proposed_lease_id = kwargs.get('proposed_lease_id', None) + + +class LeaseContainerResponse(msrest.serialization.Model): + """Lease Container response schema. + + :param lease_id: Returned unique lease ID that must be included with any request to delete the + container, or to renew, change, or release the lease. + :type lease_id: str + :param lease_time_seconds: Approximate time remaining in the lease period, in seconds. + :type lease_time_seconds: str + """ + + _attribute_map = { + 'lease_id': {'key': 'leaseId', 'type': 'str'}, + 'lease_time_seconds': {'key': 'leaseTimeSeconds', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LeaseContainerResponse, self).__init__(**kwargs) + self.lease_id = kwargs.get('lease_id', None) + self.lease_time_seconds = kwargs.get('lease_time_seconds', None) + + +class LeaseShareRequest(msrest.serialization.Model): + """Lease Share request schema. + + All required parameters must be populated in order to send to Azure. + + :param action: Required. Specifies the lease action. Can be one of the available actions. + Possible values include: "Acquire", "Renew", "Change", "Release", "Break". + :type action: str or ~azure.mgmt.storage.v2021_06_01.models.LeaseShareAction + :param lease_id: Identifies the lease. Can be specified in any valid GUID string format. + :type lease_id: str + :param break_period: Optional. For a break action, proposed duration the lease should continue + before it is broken, in seconds, between 0 and 60. + :type break_period: int + :param lease_duration: Required for acquire. Specifies the duration of the lease, in seconds, + or negative one (-1) for a lease that never expires. + :type lease_duration: int + :param proposed_lease_id: Optional for acquire, required for change. Proposed lease ID, in a + GUID string format. + :type proposed_lease_id: str + """ + + _validation = { + 'action': {'required': True}, + } + + _attribute_map = { + 'action': {'key': 'action', 'type': 'str'}, + 'lease_id': {'key': 'leaseId', 'type': 'str'}, + 'break_period': {'key': 'breakPeriod', 'type': 'int'}, + 'lease_duration': {'key': 'leaseDuration', 'type': 'int'}, + 'proposed_lease_id': {'key': 'proposedLeaseId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LeaseShareRequest, self).__init__(**kwargs) + self.action = kwargs['action'] + self.lease_id = kwargs.get('lease_id', None) + self.break_period = kwargs.get('break_period', None) + self.lease_duration = kwargs.get('lease_duration', None) + self.proposed_lease_id = kwargs.get('proposed_lease_id', None) + + +class LeaseShareResponse(msrest.serialization.Model): + """Lease Share response schema. + + :param lease_id: Returned unique lease ID that must be included with any request to delete the + share, or to renew, change, or release the lease. + :type lease_id: str + :param lease_time_seconds: Approximate time remaining in the lease period, in seconds. + :type lease_time_seconds: str + """ + + _attribute_map = { + 'lease_id': {'key': 'leaseId', 'type': 'str'}, + 'lease_time_seconds': {'key': 'leaseTimeSeconds', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LeaseShareResponse, self).__init__(**kwargs) + self.lease_id = kwargs.get('lease_id', None) + self.lease_time_seconds = kwargs.get('lease_time_seconds', None) + + +class LegalHold(msrest.serialization.Model): + """The LegalHold property of a blob container. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar has_legal_hold: The hasLegalHold public property is set to true by SRP if there are at + least one existing tag. The hasLegalHold public property is set to false by SRP if all existing + legal hold tags are cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :param tags: Required. A set of tags. Each tag should be 3 to 23 alphanumeric characters and is + normalized to lower case at SRP. + :type tags: list[str] + :param allow_protected_append_writes_all: When enabled, new blocks can be written to both + 'Append and Bock Blobs' while maintaining legal hold protection and compliance. Only new blocks + can be added and any existing blocks cannot be modified or deleted. + :type allow_protected_append_writes_all: bool + """ + + _validation = { + 'has_legal_hold': {'readonly': True}, + 'tags': {'required': True}, + } + + _attribute_map = { + 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, + 'tags': {'key': 'tags', 'type': '[str]'}, + 'allow_protected_append_writes_all': {'key': 'allowProtectedAppendWritesAll', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(LegalHold, self).__init__(**kwargs) + self.has_legal_hold = None + self.tags = kwargs['tags'] + self.allow_protected_append_writes_all = kwargs.get('allow_protected_append_writes_all', None) + + +class LegalHoldProperties(msrest.serialization.Model): + """The LegalHold property of a blob container. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar has_legal_hold: The hasLegalHold public property is set to true by SRP if there are at + least one existing tag. The hasLegalHold public property is set to false by SRP if all existing + legal hold tags are cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :param tags: A set of tags. The list of LegalHold tags of a blob container. + :type tags: list[~azure.mgmt.storage.v2021_06_01.models.TagProperty] + :param protected_append_writes_history: Protected append blob writes history. + :type protected_append_writes_history: + ~azure.mgmt.storage.v2021_06_01.models.ProtectedAppendWritesHistory + """ + + _validation = { + 'has_legal_hold': {'readonly': True}, + } + + _attribute_map = { + 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, + 'tags': {'key': 'tags', 'type': '[TagProperty]'}, + 'protected_append_writes_history': {'key': 'protectedAppendWritesHistory', 'type': 'ProtectedAppendWritesHistory'}, + } + + def __init__( + self, + **kwargs + ): + super(LegalHoldProperties, self).__init__(**kwargs) + self.has_legal_hold = None + self.tags = kwargs.get('tags', None) + self.protected_append_writes_history = kwargs.get('protected_append_writes_history', None) + + +class ListAccountSasResponse(msrest.serialization.Model): + """The List SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar account_sas_token: List SAS credentials of storage account. + :vartype account_sas_token: str + """ + + _validation = { + 'account_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'account_sas_token': {'key': 'accountSasToken', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ListAccountSasResponse, self).__init__(**kwargs) + self.account_sas_token = None + + +class ListBlobInventoryPolicy(msrest.serialization.Model): + """List of blob inventory policies returned. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of blob inventory policies. + :vartype value: list[~azure.mgmt.storage.v2021_06_01.models.BlobInventoryPolicy] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BlobInventoryPolicy]'}, + } + + def __init__( + self, + **kwargs + ): + super(ListBlobInventoryPolicy, self).__init__(**kwargs) + self.value = None + + +class ListContainerItem(AzureEntityResource): + """The blob container properties be listed out. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :ivar version: The version of the deleted blob container. + :vartype version: str + :ivar deleted: Indicates whether the blob container was deleted. + :vartype deleted: bool + :ivar deleted_time: Blob container deletion time. + :vartype deleted_time: ~datetime.datetime + :ivar remaining_retention_days: Remaining retention days for soft deleted blob container. + :vartype remaining_retention_days: int + :param default_encryption_scope: Default the container to use specified encryption scope for + all writes. + :type default_encryption_scope: str + :param deny_encryption_scope_override: Block override of encryption scope from the container + default. + :type deny_encryption_scope_override: bool + :param public_access: Specifies whether data in the container may be accessed publicly and the + level of access. Possible values include: "Container", "Blob", "None". + :type public_access: str or ~azure.mgmt.storage.v2021_06_01.models.PublicAccess + :ivar last_modified_time: Returns the date and time the container was last modified. + :vartype last_modified_time: ~datetime.datetime + :ivar lease_status: The lease status of the container. Possible values include: "Locked", + "Unlocked". + :vartype lease_status: str or ~azure.mgmt.storage.v2021_06_01.models.LeaseStatus + :ivar lease_state: Lease state of the container. Possible values include: "Available", + "Leased", "Expired", "Breaking", "Broken". + :vartype lease_state: str or ~azure.mgmt.storage.v2021_06_01.models.LeaseState + :ivar lease_duration: Specifies whether the lease on a container is of infinite or fixed + duration, only when the container is leased. Possible values include: "Infinite", "Fixed". + :vartype lease_duration: str or ~azure.mgmt.storage.v2021_06_01.models.LeaseDuration + :param metadata: A name-value pair to associate with the container as metadata. + :type metadata: dict[str, str] + :ivar immutability_policy: The ImmutabilityPolicy property of the container. + :vartype immutability_policy: + ~azure.mgmt.storage.v2021_06_01.models.ImmutabilityPolicyProperties + :ivar legal_hold: The LegalHold property of the container. + :vartype legal_hold: ~azure.mgmt.storage.v2021_06_01.models.LegalHoldProperties + :ivar has_legal_hold: The hasLegalHold public property is set to true by SRP if there are at + least one existing tag. The hasLegalHold public property is set to false by SRP if all existing + legal hold tags are cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :ivar has_immutability_policy: The hasImmutabilityPolicy public property is set to true by SRP + if ImmutabilityPolicy has been created for this container. The hasImmutabilityPolicy public + property is set to false by SRP if ImmutabilityPolicy has not been created for this container. + :vartype has_immutability_policy: bool + :param immutable_storage_with_versioning: The object level immutability property of the + container. The property is immutable and can only be set to true at the container creation + time. Existing containers must undergo a migration process. + :type immutable_storage_with_versioning: + ~azure.mgmt.storage.v2021_06_01.models.ImmutableStorageWithVersioning + :param enable_nfs_v3_root_squash: Enable NFSv3 root squash on blob container. + :type enable_nfs_v3_root_squash: bool + :param enable_nfs_v3_all_squash: Enable NFSv3 all squash on blob container. + :type enable_nfs_v3_all_squash: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'version': {'readonly': True}, + 'deleted': {'readonly': True}, + 'deleted_time': {'readonly': True}, + 'remaining_retention_days': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'lease_status': {'readonly': True}, + 'lease_state': {'readonly': True}, + 'lease_duration': {'readonly': True}, + 'immutability_policy': {'readonly': True}, + 'legal_hold': {'readonly': True}, + 'has_legal_hold': {'readonly': True}, + 'has_immutability_policy': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'deleted': {'key': 'properties.deleted', 'type': 'bool'}, + 'deleted_time': {'key': 'properties.deletedTime', 'type': 'iso-8601'}, + 'remaining_retention_days': {'key': 'properties.remainingRetentionDays', 'type': 'int'}, + 'default_encryption_scope': {'key': 'properties.defaultEncryptionScope', 'type': 'str'}, + 'deny_encryption_scope_override': {'key': 'properties.denyEncryptionScopeOverride', 'type': 'bool'}, + 'public_access': {'key': 'properties.publicAccess', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, + 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, + 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'immutability_policy': {'key': 'properties.immutabilityPolicy', 'type': 'ImmutabilityPolicyProperties'}, + 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, + 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, + 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, + 'immutable_storage_with_versioning': {'key': 'properties.immutableStorageWithVersioning', 'type': 'ImmutableStorageWithVersioning'}, + 'enable_nfs_v3_root_squash': {'key': 'properties.enableNfsV3RootSquash', 'type': 'bool'}, + 'enable_nfs_v3_all_squash': {'key': 'properties.enableNfsV3AllSquash', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(ListContainerItem, self).__init__(**kwargs) + self.version = None + self.deleted = None + self.deleted_time = None + self.remaining_retention_days = None + self.default_encryption_scope = kwargs.get('default_encryption_scope', None) + self.deny_encryption_scope_override = kwargs.get('deny_encryption_scope_override', None) + self.public_access = kwargs.get('public_access', None) + self.last_modified_time = None + self.lease_status = None + self.lease_state = None + self.lease_duration = None + self.metadata = kwargs.get('metadata', None) + self.immutability_policy = None + self.legal_hold = None + self.has_legal_hold = None + self.has_immutability_policy = None + self.immutable_storage_with_versioning = kwargs.get('immutable_storage_with_versioning', None) + self.enable_nfs_v3_root_squash = kwargs.get('enable_nfs_v3_root_squash', None) + self.enable_nfs_v3_all_squash = kwargs.get('enable_nfs_v3_all_squash', None) + + +class ListContainerItems(msrest.serialization.Model): + """Response schema. Contains list of blobs returned, and if paging is requested or required, a URL to next page of containers. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of blobs containers returned. + :vartype value: list[~azure.mgmt.storage.v2021_06_01.models.ListContainerItem] + :ivar next_link: Request URL that can be used to query next page of containers. Returned when + total number of requested containers exceed maximum page size. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ListContainerItem]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ListContainerItems, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class ListQueue(Resource): + """ListQueue. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param metadata: A name-value pair that represents queue metadata. + :type metadata: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(ListQueue, self).__init__(**kwargs) + self.metadata = kwargs.get('metadata', None) + + +class ListQueueResource(msrest.serialization.Model): + """Response schema. Contains list of queues returned. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of queues returned. + :vartype value: list[~azure.mgmt.storage.v2021_06_01.models.ListQueue] + :ivar next_link: Request URL that can be used to list next page of queues. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ListQueue]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ListQueueResource, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class ListQueueServices(msrest.serialization.Model): + """ListQueueServices. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of queue services returned. + :vartype value: list[~azure.mgmt.storage.v2021_06_01.models.QueueServiceProperties] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[QueueServiceProperties]'}, + } + + def __init__( + self, + **kwargs + ): + super(ListQueueServices, self).__init__(**kwargs) + self.value = None + + +class ListServiceSasResponse(msrest.serialization.Model): + """The List service SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar service_sas_token: List service SAS credentials of specific resource. + :vartype service_sas_token: str + """ + + _validation = { + 'service_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'service_sas_token': {'key': 'serviceSasToken', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ListServiceSasResponse, self).__init__(**kwargs) + self.service_sas_token = None + + +class ListTableResource(msrest.serialization.Model): + """Response schema. Contains list of tables returned. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of tables returned. + :vartype value: list[~azure.mgmt.storage.v2021_06_01.models.Table] + :ivar next_link: Request URL that can be used to query next page of tables. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Table]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ListTableResource, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class ListTableServices(msrest.serialization.Model): + """ListTableServices. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of table services returned. + :vartype value: list[~azure.mgmt.storage.v2021_06_01.models.TableServiceProperties] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[TableServiceProperties]'}, + } + + def __init__( + self, + **kwargs + ): + super(ListTableServices, self).__init__(**kwargs) + self.value = None + + +class ManagementPolicy(Resource): + """The Get Storage Account ManagementPolicies operation response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar last_modified_time: Returns the date and time the ManagementPolicies was last modified. + :vartype last_modified_time: ~datetime.datetime + :param policy: The Storage Account ManagementPolicy, in JSON format. See more details in: + https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + :type policy: ~azure.mgmt.storage.v2021_06_01.models.ManagementPolicySchema + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'policy': {'key': 'properties.policy', 'type': 'ManagementPolicySchema'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagementPolicy, self).__init__(**kwargs) + self.last_modified_time = None + self.policy = kwargs.get('policy', None) + + +class ManagementPolicyAction(msrest.serialization.Model): + """Actions are applied to the filtered blobs when the execution condition is met. + + :param base_blob: The management policy action for base blob. + :type base_blob: ~azure.mgmt.storage.v2021_06_01.models.ManagementPolicyBaseBlob + :param snapshot: The management policy action for snapshot. + :type snapshot: ~azure.mgmt.storage.v2021_06_01.models.ManagementPolicySnapShot + :param version: The management policy action for version. + :type version: ~azure.mgmt.storage.v2021_06_01.models.ManagementPolicyVersion + """ + + _attribute_map = { + 'base_blob': {'key': 'baseBlob', 'type': 'ManagementPolicyBaseBlob'}, + 'snapshot': {'key': 'snapshot', 'type': 'ManagementPolicySnapShot'}, + 'version': {'key': 'version', 'type': 'ManagementPolicyVersion'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagementPolicyAction, self).__init__(**kwargs) + self.base_blob = kwargs.get('base_blob', None) + self.snapshot = kwargs.get('snapshot', None) + self.version = kwargs.get('version', None) + + +class ManagementPolicyBaseBlob(msrest.serialization.Model): + """Management policy action for base blob. + + :param tier_to_cool: The function to tier blobs to cool storage. Support blobs currently at Hot + tier. + :type tier_to_cool: ~azure.mgmt.storage.v2021_06_01.models.DateAfterModification + :param tier_to_archive: The function to tier blobs to archive storage. Support blobs currently + at Hot or Cool tier. + :type tier_to_archive: ~azure.mgmt.storage.v2021_06_01.models.DateAfterModification + :param delete: The function to delete the blob. + :type delete: ~azure.mgmt.storage.v2021_06_01.models.DateAfterModification + :param enable_auto_tier_to_hot_from_cool: This property enables auto tiering of a blob from + cool to hot on a blob access. This property requires + tierToCool.daysAfterLastAccessTimeGreaterThan. + :type enable_auto_tier_to_hot_from_cool: bool + """ + + _attribute_map = { + 'tier_to_cool': {'key': 'tierToCool', 'type': 'DateAfterModification'}, + 'tier_to_archive': {'key': 'tierToArchive', 'type': 'DateAfterModification'}, + 'delete': {'key': 'delete', 'type': 'DateAfterModification'}, + 'enable_auto_tier_to_hot_from_cool': {'key': 'enableAutoTierToHotFromCool', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagementPolicyBaseBlob, self).__init__(**kwargs) + self.tier_to_cool = kwargs.get('tier_to_cool', None) + self.tier_to_archive = kwargs.get('tier_to_archive', None) + self.delete = kwargs.get('delete', None) + self.enable_auto_tier_to_hot_from_cool = kwargs.get('enable_auto_tier_to_hot_from_cool', None) + + +class ManagementPolicyDefinition(msrest.serialization.Model): + """An object that defines the Lifecycle rule. Each definition is made up with a filters set and an actions set. + + All required parameters must be populated in order to send to Azure. + + :param actions: Required. An object that defines the action set. + :type actions: ~azure.mgmt.storage.v2021_06_01.models.ManagementPolicyAction + :param filters: An object that defines the filter set. + :type filters: ~azure.mgmt.storage.v2021_06_01.models.ManagementPolicyFilter + """ + + _validation = { + 'actions': {'required': True}, + } + + _attribute_map = { + 'actions': {'key': 'actions', 'type': 'ManagementPolicyAction'}, + 'filters': {'key': 'filters', 'type': 'ManagementPolicyFilter'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagementPolicyDefinition, self).__init__(**kwargs) + self.actions = kwargs['actions'] + self.filters = kwargs.get('filters', None) + + +class ManagementPolicyFilter(msrest.serialization.Model): + """Filters limit rule actions to a subset of blobs within the storage account. If multiple filters are defined, a logical AND is performed on all filters. + + All required parameters must be populated in order to send to Azure. + + :param prefix_match: An array of strings for prefixes to be match. + :type prefix_match: list[str] + :param blob_types: Required. An array of predefined enum values. Currently blockBlob supports + all tiering and delete actions. Only delete actions are supported for appendBlob. + :type blob_types: list[str] + :param blob_index_match: An array of blob index tag based filters, there can be at most 10 tag + filters. + :type blob_index_match: list[~azure.mgmt.storage.v2021_06_01.models.TagFilter] + """ + + _validation = { + 'blob_types': {'required': True}, + } + + _attribute_map = { + 'prefix_match': {'key': 'prefixMatch', 'type': '[str]'}, + 'blob_types': {'key': 'blobTypes', 'type': '[str]'}, + 'blob_index_match': {'key': 'blobIndexMatch', 'type': '[TagFilter]'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagementPolicyFilter, self).__init__(**kwargs) + self.prefix_match = kwargs.get('prefix_match', None) + self.blob_types = kwargs['blob_types'] + self.blob_index_match = kwargs.get('blob_index_match', None) + + +class ManagementPolicyRule(msrest.serialization.Model): + """An object that wraps the Lifecycle rule. Each rule is uniquely defined by name. + + All required parameters must be populated in order to send to Azure. + + :param enabled: Rule is enabled if set to true. + :type enabled: bool + :param name: Required. A rule name can contain any combination of alpha numeric characters. + Rule name is case-sensitive. It must be unique within a policy. + :type name: str + :param type: Required. The valid value is Lifecycle. Possible values include: "Lifecycle". + :type type: str or ~azure.mgmt.storage.v2021_06_01.models.RuleType + :param definition: Required. An object that defines the Lifecycle rule. + :type definition: ~azure.mgmt.storage.v2021_06_01.models.ManagementPolicyDefinition + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + 'definition': {'required': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'definition': {'key': 'definition', 'type': 'ManagementPolicyDefinition'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagementPolicyRule, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.name = kwargs['name'] + self.type = kwargs['type'] + self.definition = kwargs['definition'] + + +class ManagementPolicySchema(msrest.serialization.Model): + """The Storage Account ManagementPolicies Rules. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + + All required parameters must be populated in order to send to Azure. + + :param rules: Required. The Storage Account ManagementPolicies Rules. See more details in: + https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + :type rules: list[~azure.mgmt.storage.v2021_06_01.models.ManagementPolicyRule] + """ + + _validation = { + 'rules': {'required': True}, + } + + _attribute_map = { + 'rules': {'key': 'rules', 'type': '[ManagementPolicyRule]'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagementPolicySchema, self).__init__(**kwargs) + self.rules = kwargs['rules'] + + +class ManagementPolicySnapShot(msrest.serialization.Model): + """Management policy action for snapshot. + + :param tier_to_cool: The function to tier blob snapshot to cool storage. Support blob snapshot + currently at Hot tier. + :type tier_to_cool: ~azure.mgmt.storage.v2021_06_01.models.DateAfterCreation + :param tier_to_archive: The function to tier blob snapshot to archive storage. Support blob + snapshot currently at Hot or Cool tier. + :type tier_to_archive: ~azure.mgmt.storage.v2021_06_01.models.DateAfterCreation + :param delete: The function to delete the blob snapshot. + :type delete: ~azure.mgmt.storage.v2021_06_01.models.DateAfterCreation + """ + + _attribute_map = { + 'tier_to_cool': {'key': 'tierToCool', 'type': 'DateAfterCreation'}, + 'tier_to_archive': {'key': 'tierToArchive', 'type': 'DateAfterCreation'}, + 'delete': {'key': 'delete', 'type': 'DateAfterCreation'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagementPolicySnapShot, self).__init__(**kwargs) + self.tier_to_cool = kwargs.get('tier_to_cool', None) + self.tier_to_archive = kwargs.get('tier_to_archive', None) + self.delete = kwargs.get('delete', None) + + +class ManagementPolicyVersion(msrest.serialization.Model): + """Management policy action for blob version. + + :param tier_to_cool: The function to tier blob version to cool storage. Support blob version + currently at Hot tier. + :type tier_to_cool: ~azure.mgmt.storage.v2021_06_01.models.DateAfterCreation + :param tier_to_archive: The function to tier blob version to archive storage. Support blob + version currently at Hot or Cool tier. + :type tier_to_archive: ~azure.mgmt.storage.v2021_06_01.models.DateAfterCreation + :param delete: The function to delete the blob version. + :type delete: ~azure.mgmt.storage.v2021_06_01.models.DateAfterCreation + """ + + _attribute_map = { + 'tier_to_cool': {'key': 'tierToCool', 'type': 'DateAfterCreation'}, + 'tier_to_archive': {'key': 'tierToArchive', 'type': 'DateAfterCreation'}, + 'delete': {'key': 'delete', 'type': 'DateAfterCreation'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagementPolicyVersion, self).__init__(**kwargs) + self.tier_to_cool = kwargs.get('tier_to_cool', None) + self.tier_to_archive = kwargs.get('tier_to_archive', None) + self.delete = kwargs.get('delete', None) + + +class MetricSpecification(msrest.serialization.Model): + """Metric specification of operation. + + :param name: Name of metric specification. + :type name: str + :param display_name: Display name of metric specification. + :type display_name: str + :param display_description: Display description of metric specification. + :type display_description: str + :param unit: Unit could be Bytes or Count. + :type unit: str + :param dimensions: Dimensions of blobs, including blob type and access tier. + :type dimensions: list[~azure.mgmt.storage.v2021_06_01.models.Dimension] + :param aggregation_type: Aggregation type could be Average. + :type aggregation_type: str + :param fill_gap_with_zero: The property to decide fill gap with zero or not. + :type fill_gap_with_zero: bool + :param category: The category this metric specification belong to, could be Capacity. + :type category: str + :param resource_id_dimension_name_override: Account Resource Id. + :type resource_id_dimension_name_override: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'category': {'key': 'category', 'type': 'str'}, + 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MetricSpecification, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.display_description = kwargs.get('display_description', None) + self.unit = kwargs.get('unit', None) + self.dimensions = kwargs.get('dimensions', None) + self.aggregation_type = kwargs.get('aggregation_type', None) + self.fill_gap_with_zero = kwargs.get('fill_gap_with_zero', None) + self.category = kwargs.get('category', None) + self.resource_id_dimension_name_override = kwargs.get('resource_id_dimension_name_override', None) + + +class Multichannel(msrest.serialization.Model): + """Multichannel setting. Applies to Premium FileStorage only. + + :param enabled: Indicates whether multichannel is enabled. + :type enabled: bool + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(Multichannel, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + + +class NetworkRuleSet(msrest.serialization.Model): + """Network rule set. + + All required parameters must be populated in order to send to Azure. + + :param bypass: Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. + Possible values are any combination of Logging|Metrics|AzureServices (For example, "Logging, + Metrics"), or None to bypass none of those traffics. Possible values include: "None", + "Logging", "Metrics", "AzureServices". Default value: "AzureServices". + :type bypass: str or ~azure.mgmt.storage.v2021_06_01.models.Bypass + :param resource_access_rules: Sets the resource access rules. + :type resource_access_rules: list[~azure.mgmt.storage.v2021_06_01.models.ResourceAccessRule] + :param virtual_network_rules: Sets the virtual network rules. + :type virtual_network_rules: list[~azure.mgmt.storage.v2021_06_01.models.VirtualNetworkRule] + :param ip_rules: Sets the IP ACL rules. + :type ip_rules: list[~azure.mgmt.storage.v2021_06_01.models.IPRule] + :param default_action: Required. Specifies the default action of allow or deny when no other + rules match. Possible values include: "Allow", "Deny". Default value: "Allow". + :type default_action: str or ~azure.mgmt.storage.v2021_06_01.models.DefaultAction + """ + + _validation = { + 'default_action': {'required': True}, + } + + _attribute_map = { + 'bypass': {'key': 'bypass', 'type': 'str'}, + 'resource_access_rules': {'key': 'resourceAccessRules', 'type': '[ResourceAccessRule]'}, + 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, + 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, + 'default_action': {'key': 'defaultAction', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkRuleSet, self).__init__(**kwargs) + self.bypass = kwargs.get('bypass', "AzureServices") + self.resource_access_rules = kwargs.get('resource_access_rules', None) + self.virtual_network_rules = kwargs.get('virtual_network_rules', None) + self.ip_rules = kwargs.get('ip_rules', None) + self.default_action = kwargs.get('default_action', "Allow") + + +class ObjectReplicationPolicies(msrest.serialization.Model): + """List storage account object replication policies. + + :param value: The replication policy between two storage accounts. + :type value: list[~azure.mgmt.storage.v2021_06_01.models.ObjectReplicationPolicy] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ObjectReplicationPolicy]'}, + } + + def __init__( + self, + **kwargs + ): + super(ObjectReplicationPolicies, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class ObjectReplicationPolicy(Resource): + """The replication policy between two storage accounts. Multiple rules can be defined in one policy. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar policy_id: A unique id for object replication policy. + :vartype policy_id: str + :ivar enabled_time: Indicates when the policy is enabled on the source account. + :vartype enabled_time: ~datetime.datetime + :param source_account: Required. Source account name. It should be full resource id if + allowCrossTenantReplication set to false. + :type source_account: str + :param destination_account: Required. Destination account name. It should be full resource id + if allowCrossTenantReplication set to false. + :type destination_account: str + :param rules: The storage account object replication rules. + :type rules: list[~azure.mgmt.storage.v2021_06_01.models.ObjectReplicationPolicyRule] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'policy_id': {'readonly': True}, + 'enabled_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'policy_id': {'key': 'properties.policyId', 'type': 'str'}, + 'enabled_time': {'key': 'properties.enabledTime', 'type': 'iso-8601'}, + 'source_account': {'key': 'properties.sourceAccount', 'type': 'str'}, + 'destination_account': {'key': 'properties.destinationAccount', 'type': 'str'}, + 'rules': {'key': 'properties.rules', 'type': '[ObjectReplicationPolicyRule]'}, + } + + def __init__( + self, + **kwargs + ): + super(ObjectReplicationPolicy, self).__init__(**kwargs) + self.policy_id = None + self.enabled_time = None + self.source_account = kwargs.get('source_account', None) + self.destination_account = kwargs.get('destination_account', None) + self.rules = kwargs.get('rules', None) + + +class ObjectReplicationPolicyFilter(msrest.serialization.Model): + """Filters limit replication to a subset of blobs within the storage account. A logical OR is performed on values in the filter. If multiple filters are defined, a logical AND is performed on all filters. + + :param prefix_match: Optional. Filters the results to replicate only blobs whose names begin + with the specified prefix. + :type prefix_match: list[str] + :param min_creation_time: Blobs created after the time will be replicated to the destination. + It must be in datetime format 'yyyy-MM-ddTHH:mm:ssZ'. Example: 2020-02-19T16:05:00Z. + :type min_creation_time: str + """ + + _attribute_map = { + 'prefix_match': {'key': 'prefixMatch', 'type': '[str]'}, + 'min_creation_time': {'key': 'minCreationTime', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ObjectReplicationPolicyFilter, self).__init__(**kwargs) + self.prefix_match = kwargs.get('prefix_match', None) + self.min_creation_time = kwargs.get('min_creation_time', None) + + +class ObjectReplicationPolicyRule(msrest.serialization.Model): + """The replication policy rule between two containers. + + All required parameters must be populated in order to send to Azure. + + :param rule_id: Rule Id is auto-generated for each new rule on destination account. It is + required for put policy on source account. + :type rule_id: str + :param source_container: Required. Required. Source container name. + :type source_container: str + :param destination_container: Required. Required. Destination container name. + :type destination_container: str + :param filters: Optional. An object that defines the filter set. + :type filters: ~azure.mgmt.storage.v2021_06_01.models.ObjectReplicationPolicyFilter + """ + + _validation = { + 'source_container': {'required': True}, + 'destination_container': {'required': True}, + } + + _attribute_map = { + 'rule_id': {'key': 'ruleId', 'type': 'str'}, + 'source_container': {'key': 'sourceContainer', 'type': 'str'}, + 'destination_container': {'key': 'destinationContainer', 'type': 'str'}, + 'filters': {'key': 'filters', 'type': 'ObjectReplicationPolicyFilter'}, + } + + def __init__( + self, + **kwargs + ): + super(ObjectReplicationPolicyRule, self).__init__(**kwargs) + self.rule_id = kwargs.get('rule_id', None) + self.source_container = kwargs['source_container'] + self.destination_container = kwargs['destination_container'] + self.filters = kwargs.get('filters', None) + + +class Operation(msrest.serialization.Model): + """Storage REST API operation definition. + + :param name: Operation name: {provider}/{resource}/{operation}. + :type name: str + :param display: Display metadata associated with the operation. + :type display: ~azure.mgmt.storage.v2021_06_01.models.OperationDisplay + :param origin: The origin of operations. + :type origin: str + :param service_specification: One property of operation, include metric specifications. + :type service_specification: ~azure.mgmt.storage.v2021_06_01.models.ServiceSpecification + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, + } + + def __init__( + self, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + self.origin = kwargs.get('origin', None) + self.service_specification = kwargs.get('service_specification', None) + + +class OperationDisplay(msrest.serialization.Model): + """Display metadata associated with the operation. + + :param provider: Service provider: Microsoft Storage. + :type provider: str + :param resource: Resource on which the operation is performed etc. + :type resource: str + :param operation: Type of operation: get, read, delete, etc. + :type operation: str + :param description: Description of the operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) + + +class OperationListResult(msrest.serialization.Model): + """Result of the request to list Storage operations. It contains a list of operations and a URL link to get the next set of results. + + :param value: List of Storage operations supported by the Storage resource provider. + :type value: list[~azure.mgmt.storage.v2021_06_01.models.Operation] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class PrivateEndpoint(msrest.serialization.Model): + """The Private Endpoint resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The ARM identifier for Private Endpoint. + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpoint, self).__init__(**kwargs) + self.id = None + + +class PrivateEndpointConnection(Resource): + """The Private Endpoint Connection resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param private_endpoint: The resource of private end point. + :type private_endpoint: ~azure.mgmt.storage.v2021_06_01.models.PrivateEndpoint + :param private_link_service_connection_state: A collection of information about the state of + the connection between service consumer and provider. + :type private_link_service_connection_state: + ~azure.mgmt.storage.v2021_06_01.models.PrivateLinkServiceConnectionState + :ivar provisioning_state: The provisioning state of the private endpoint connection resource. + Possible values include: "Succeeded", "Creating", "Deleting", "Failed". + :vartype provisioning_state: str or + ~azure.mgmt.storage.v2021_06_01.models.PrivateEndpointConnectionProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.private_endpoint = kwargs.get('private_endpoint', None) + self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) + self.provisioning_state = None + + +class PrivateEndpointConnectionListResult(msrest.serialization.Model): + """List of private endpoint connection associated with the specified storage account. + + :param value: Array of private endpoint connections. + :type value: list[~azure.mgmt.storage.v2021_06_01.models.PrivateEndpointConnection] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class PrivateLinkResource(Resource): + """A private link resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar group_id: The private link resource group id. + :vartype group_id: str + :ivar required_members: The private link resource required member names. + :vartype required_members: list[str] + :param required_zone_names: The private link resource Private link DNS zone name. + :type required_zone_names: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'group_id': {'readonly': True}, + 'required_members': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'group_id': {'key': 'properties.groupId', 'type': 'str'}, + 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, + 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkResource, self).__init__(**kwargs) + self.group_id = None + self.required_members = None + self.required_zone_names = kwargs.get('required_zone_names', None) + + +class PrivateLinkResourceListResult(msrest.serialization.Model): + """A list of private link resources. + + :param value: Array of private link resources. + :type value: list[~azure.mgmt.storage.v2021_06_01.models.PrivateLinkResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkResourceListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class PrivateLinkServiceConnectionState(msrest.serialization.Model): + """A collection of information about the state of the connection between service consumer and provider. + + :param status: Indicates whether the connection has been Approved/Rejected/Removed by the owner + of the service. Possible values include: "Pending", "Approved", "Rejected". + :type status: str or + ~azure.mgmt.storage.v2021_06_01.models.PrivateEndpointServiceConnectionStatus + :param description: The reason for approval/rejection of the connection. + :type description: str + :param action_required: A message indicating if changes on the service provider require any + updates on the consumer. + :type action_required: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'action_required': {'key': 'actionRequired', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.description = kwargs.get('description', None) + self.action_required = kwargs.get('action_required', None) + + +class ProtectedAppendWritesHistory(msrest.serialization.Model): + """Protected append writes history setting for the blob container with Legal holds. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param allow_protected_append_writes_all: When enabled, new blocks can be written to both + 'Append and Bock Blobs' while maintaining legal hold protection and compliance. Only new blocks + can be added and any existing blocks cannot be modified or deleted. + :type allow_protected_append_writes_all: bool + :ivar timestamp: Returns the date and time the tag was added. + :vartype timestamp: ~datetime.datetime + """ + + _validation = { + 'timestamp': {'readonly': True}, + } + + _attribute_map = { + 'allow_protected_append_writes_all': {'key': 'allowProtectedAppendWritesAll', 'type': 'bool'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(ProtectedAppendWritesHistory, self).__init__(**kwargs) + self.allow_protected_append_writes_all = kwargs.get('allow_protected_append_writes_all', None) + self.timestamp = None + + +class ProtocolSettings(msrest.serialization.Model): + """Protocol settings for file service. + + :param smb: Setting for SMB protocol. + :type smb: ~azure.mgmt.storage.v2021_06_01.models.SmbSetting + """ + + _attribute_map = { + 'smb': {'key': 'smb', 'type': 'SmbSetting'}, + } + + def __init__( + self, + **kwargs + ): + super(ProtocolSettings, self).__init__(**kwargs) + self.smb = kwargs.get('smb', None) + + +class QueueServiceProperties(Resource): + """The properties of a storage account’s Queue service. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param cors: Specifies CORS rules for the Queue service. You can include up to five CorsRule + elements in the request. If no CorsRule elements are included in the request body, all CORS + rules will be deleted, and CORS will be disabled for the Queue service. + :type cors: ~azure.mgmt.storage.v2021_06_01.models.CorsRules + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'cors': {'key': 'properties.cors', 'type': 'CorsRules'}, + } + + def __init__( + self, + **kwargs + ): + super(QueueServiceProperties, self).__init__(**kwargs) + self.cors = kwargs.get('cors', None) + + +class ResourceAccessRule(msrest.serialization.Model): + """Resource Access Rule. + + :param tenant_id: Tenant Id. + :type tenant_id: str + :param resource_id: Resource Id. + :type resource_id: str + """ + + _attribute_map = { + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceAccessRule, self).__init__(**kwargs) + self.tenant_id = kwargs.get('tenant_id', None) + self.resource_id = kwargs.get('resource_id', None) + + +class RestorePolicyProperties(msrest.serialization.Model): + """The blob service properties for blob restore policy. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. Blob restore is enabled if set to true. + :type enabled: bool + :param days: how long this blob can be restored. It should be great than zero and less than + DeleteRetentionPolicy.days. + :type days: int + :ivar last_enabled_time: Deprecated in favor of minRestoreTime property. + :vartype last_enabled_time: ~datetime.datetime + :ivar min_restore_time: Returns the minimum date and time that the restore can be started. + :vartype min_restore_time: ~datetime.datetime + """ + + _validation = { + 'enabled': {'required': True}, + 'days': {'maximum': 365, 'minimum': 1}, + 'last_enabled_time': {'readonly': True}, + 'min_restore_time': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'days': {'key': 'days', 'type': 'int'}, + 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, + 'min_restore_time': {'key': 'minRestoreTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(RestorePolicyProperties, self).__init__(**kwargs) + self.enabled = kwargs['enabled'] + self.days = kwargs.get('days', None) + self.last_enabled_time = None + self.min_restore_time = None + + +class Restriction(msrest.serialization.Model): + """The restriction because of which SKU cannot be used. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The type of restrictions. As of now only possible value for this is location. + :vartype type: str + :ivar values: The value of restrictions. If the restriction type is set to location. This would + be different locations where the SKU is restricted. + :vartype values: list[str] + :param reason_code: The reason for the restriction. As of now this can be "QuotaId" or + "NotAvailableForSubscription". Quota Id is set when the SKU has requiredQuotas parameter as the + subscription does not belong to that quota. The "NotAvailableForSubscription" is related to + capacity at DC. Possible values include: "QuotaId", "NotAvailableForSubscription". + :type reason_code: str or ~azure.mgmt.storage.v2021_06_01.models.ReasonCode + """ + + _validation = { + 'type': {'readonly': True}, + 'values': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'reason_code': {'key': 'reasonCode', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Restriction, self).__init__(**kwargs) + self.type = None + self.values = None + self.reason_code = kwargs.get('reason_code', None) + + +class RoutingPreference(msrest.serialization.Model): + """Routing preference defines the type of network, either microsoft or internet routing to be used to deliver the user data, the default option is microsoft routing. + + :param routing_choice: Routing Choice defines the kind of network routing opted by the user. + Possible values include: "MicrosoftRouting", "InternetRouting". + :type routing_choice: str or ~azure.mgmt.storage.v2021_06_01.models.RoutingChoice + :param publish_microsoft_endpoints: A boolean flag which indicates whether microsoft routing + storage endpoints are to be published. + :type publish_microsoft_endpoints: bool + :param publish_internet_endpoints: A boolean flag which indicates whether internet routing + storage endpoints are to be published. + :type publish_internet_endpoints: bool + """ + + _attribute_map = { + 'routing_choice': {'key': 'routingChoice', 'type': 'str'}, + 'publish_microsoft_endpoints': {'key': 'publishMicrosoftEndpoints', 'type': 'bool'}, + 'publish_internet_endpoints': {'key': 'publishInternetEndpoints', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(RoutingPreference, self).__init__(**kwargs) + self.routing_choice = kwargs.get('routing_choice', None) + self.publish_microsoft_endpoints = kwargs.get('publish_microsoft_endpoints', None) + self.publish_internet_endpoints = kwargs.get('publish_internet_endpoints', None) + + +class SasPolicy(msrest.serialization.Model): + """SasPolicy assigned to the storage account. + + All required parameters must be populated in order to send to Azure. + + :param sas_expiration_period: Required. The SAS expiration period, DD.HH:MM:SS. + :type sas_expiration_period: str + :param expiration_action: Required. The SAS expiration action. Can only be Log. Possible values + include: "Log". Default value: "Log". + :type expiration_action: str or ~azure.mgmt.storage.v2021_06_01.models.ExpirationAction + """ + + _validation = { + 'sas_expiration_period': {'required': True}, + 'expiration_action': {'required': True}, + } + + _attribute_map = { + 'sas_expiration_period': {'key': 'sasExpirationPeriod', 'type': 'str'}, + 'expiration_action': {'key': 'expirationAction', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SasPolicy, self).__init__(**kwargs) + self.sas_expiration_period = kwargs['sas_expiration_period'] + self.expiration_action = kwargs.get('expiration_action', "Log") + + +class ServiceSasParameters(msrest.serialization.Model): + """The parameters to list service SAS credentials of a specific resource. + + All required parameters must be populated in order to send to Azure. + + :param canonicalized_resource: Required. The canonical path to the signed resource. + :type canonicalized_resource: str + :param resource: The signed services accessible with the service SAS. Possible values include: + Blob (b), Container (c), File (f), Share (s). Possible values include: "b", "c", "f", "s". + :type resource: str or ~azure.mgmt.storage.v2021_06_01.models.SignedResource + :param permissions: The signed permissions for the service SAS. Possible values include: Read + (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). Possible + values include: "r", "d", "w", "l", "a", "c", "u", "p". + :type permissions: str or ~azure.mgmt.storage.v2021_06_01.models.Permissions + :param ip_address_or_range: An IP address or a range of IP addresses from which to accept + requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the account SAS. Possible + values include: "https,http", "https". + :type protocols: str or ~azure.mgmt.storage.v2021_06_01.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: ~datetime.datetime + :param shared_access_expiry_time: The time at which the shared access signature becomes + invalid. + :type shared_access_expiry_time: ~datetime.datetime + :param identifier: A unique value up to 64 characters in length that correlates to an access + policy specified for the container, queue, or table. + :type identifier: str + :param partition_key_start: The start of partition key. + :type partition_key_start: str + :param partition_key_end: The end of partition key. + :type partition_key_end: str + :param row_key_start: The start of row key. + :type row_key_start: str + :param row_key_end: The end of row key. + :type row_key_end: str + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + :param cache_control: The response header override for cache control. + :type cache_control: str + :param content_disposition: The response header override for content disposition. + :type content_disposition: str + :param content_encoding: The response header override for content encoding. + :type content_encoding: str + :param content_language: The response header override for content language. + :type content_language: str + :param content_type: The response header override for content type. + :type content_type: str + """ + + _validation = { + 'canonicalized_resource': {'required': True}, + 'identifier': {'max_length': 64, 'min_length': 0}, + } + + _attribute_map = { + 'canonicalized_resource': {'key': 'canonicalizedResource', 'type': 'str'}, + 'resource': {'key': 'signedResource', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'str'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'identifier': {'key': 'signedIdentifier', 'type': 'str'}, + 'partition_key_start': {'key': 'startPk', 'type': 'str'}, + 'partition_key_end': {'key': 'endPk', 'type': 'str'}, + 'row_key_start': {'key': 'startRk', 'type': 'str'}, + 'row_key_end': {'key': 'endRk', 'type': 'str'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + 'cache_control': {'key': 'rscc', 'type': 'str'}, + 'content_disposition': {'key': 'rscd', 'type': 'str'}, + 'content_encoding': {'key': 'rsce', 'type': 'str'}, + 'content_language': {'key': 'rscl', 'type': 'str'}, + 'content_type': {'key': 'rsct', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ServiceSasParameters, self).__init__(**kwargs) + self.canonicalized_resource = kwargs['canonicalized_resource'] + self.resource = kwargs.get('resource', None) + self.permissions = kwargs.get('permissions', None) + self.ip_address_or_range = kwargs.get('ip_address_or_range', None) + self.protocols = kwargs.get('protocols', None) + self.shared_access_start_time = kwargs.get('shared_access_start_time', None) + self.shared_access_expiry_time = kwargs.get('shared_access_expiry_time', None) + self.identifier = kwargs.get('identifier', None) + self.partition_key_start = kwargs.get('partition_key_start', None) + self.partition_key_end = kwargs.get('partition_key_end', None) + self.row_key_start = kwargs.get('row_key_start', None) + self.row_key_end = kwargs.get('row_key_end', None) + self.key_to_sign = kwargs.get('key_to_sign', None) + self.cache_control = kwargs.get('cache_control', None) + self.content_disposition = kwargs.get('content_disposition', None) + self.content_encoding = kwargs.get('content_encoding', None) + self.content_language = kwargs.get('content_language', None) + self.content_type = kwargs.get('content_type', None) + + +class ServiceSpecification(msrest.serialization.Model): + """One property of operation, include metric specifications. + + :param metric_specifications: Metric specifications of operation. + :type metric_specifications: list[~azure.mgmt.storage.v2021_06_01.models.MetricSpecification] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + } + + def __init__( + self, + **kwargs + ): + super(ServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = kwargs.get('metric_specifications', None) + + +class SignedIdentifier(msrest.serialization.Model): + """SignedIdentifier. + + :param id: An unique identifier of the stored access policy. + :type id: str + :param access_policy: Access policy. + :type access_policy: ~azure.mgmt.storage.v2021_06_01.models.AccessPolicy + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'access_policy': {'key': 'accessPolicy', 'type': 'AccessPolicy'}, + } + + def __init__( + self, + **kwargs + ): + super(SignedIdentifier, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.access_policy = kwargs.get('access_policy', None) + + +class Sku(msrest.serialization.Model): + """The SKU of the storage account. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The SKU name. Required for account creation; optional for update. Note + that in older versions, SKU name was called accountType. Possible values include: + "Standard_LRS", "Standard_GRS", "Standard_RAGRS", "Standard_ZRS", "Premium_LRS", "Premium_ZRS", + "Standard_GZRS", "Standard_RAGZRS". + :type name: str or ~azure.mgmt.storage.v2021_06_01.models.SkuName + :ivar tier: The SKU tier. This is based on the SKU name. Possible values include: "Standard", + "Premium". + :vartype tier: str or ~azure.mgmt.storage.v2021_06_01.models.SkuTier + """ + + _validation = { + 'name': {'required': True}, + 'tier': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Sku, self).__init__(**kwargs) + self.name = kwargs['name'] + self.tier = None + + +class SKUCapability(msrest.serialization.Model): + """The capability information in the specified SKU, including file encryption, network ACLs, change notification, etc. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The name of capability, The capability information in the specified SKU, including + file encryption, network ACLs, change notification, etc. + :vartype name: str + :ivar value: A string value to indicate states of given capability. Possibly 'true' or 'false'. + :vartype value: str + """ + + _validation = { + 'name': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SKUCapability, self).__init__(**kwargs) + self.name = None + self.value = None + + +class SkuInformation(msrest.serialization.Model): + """Storage SKU and its properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The SKU name. Required for account creation; optional for update. Note + that in older versions, SKU name was called accountType. Possible values include: + "Standard_LRS", "Standard_GRS", "Standard_RAGRS", "Standard_ZRS", "Premium_LRS", "Premium_ZRS", + "Standard_GZRS", "Standard_RAGZRS". + :type name: str or ~azure.mgmt.storage.v2021_06_01.models.SkuName + :ivar tier: The SKU tier. This is based on the SKU name. Possible values include: "Standard", + "Premium". + :vartype tier: str or ~azure.mgmt.storage.v2021_06_01.models.SkuTier + :ivar resource_type: The type of the resource, usually it is 'storageAccounts'. + :vartype resource_type: str + :ivar kind: Indicates the type of storage account. Possible values include: "Storage", + "StorageV2", "BlobStorage", "FileStorage", "BlockBlobStorage". + :vartype kind: str or ~azure.mgmt.storage.v2021_06_01.models.Kind + :ivar locations: The set of locations that the SKU is available. This will be supported and + registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). + :vartype locations: list[str] + :ivar capabilities: The capability information in the specified SKU, including file encryption, + network ACLs, change notification, etc. + :vartype capabilities: list[~azure.mgmt.storage.v2021_06_01.models.SKUCapability] + :param restrictions: The restrictions because of which SKU cannot be used. This is empty if + there are no restrictions. + :type restrictions: list[~azure.mgmt.storage.v2021_06_01.models.Restriction] + """ + + _validation = { + 'name': {'required': True}, + 'tier': {'readonly': True}, + 'resource_type': {'readonly': True}, + 'kind': {'readonly': True}, + 'locations': {'readonly': True}, + 'capabilities': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[SKUCapability]'}, + 'restrictions': {'key': 'restrictions', 'type': '[Restriction]'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuInformation, self).__init__(**kwargs) + self.name = kwargs['name'] + self.tier = None + self.resource_type = None + self.kind = None + self.locations = None + self.capabilities = None + self.restrictions = kwargs.get('restrictions', None) + + +class SmbSetting(msrest.serialization.Model): + """Setting for SMB protocol. + + :param multichannel: Multichannel setting. Applies to Premium FileStorage only. + :type multichannel: ~azure.mgmt.storage.v2021_06_01.models.Multichannel + :param versions: SMB protocol versions supported by server. Valid values are SMB2.1, SMB3.0, + SMB3.1.1. Should be passed as a string with delimiter ';'. + :type versions: str + :param authentication_methods: SMB authentication methods supported by server. Valid values are + NTLMv2, Kerberos. Should be passed as a string with delimiter ';'. + :type authentication_methods: str + :param kerberos_ticket_encryption: Kerberos ticket encryption supported by server. Valid values + are RC4-HMAC, AES-256. Should be passed as a string with delimiter ';'. + :type kerberos_ticket_encryption: str + :param channel_encryption: SMB channel encryption supported by server. Valid values are + AES-128-CCM, AES-128-GCM, AES-256-GCM. Should be passed as a string with delimiter ';'. + :type channel_encryption: str + """ + + _attribute_map = { + 'multichannel': {'key': 'multichannel', 'type': 'Multichannel'}, + 'versions': {'key': 'versions', 'type': 'str'}, + 'authentication_methods': {'key': 'authenticationMethods', 'type': 'str'}, + 'kerberos_ticket_encryption': {'key': 'kerberosTicketEncryption', 'type': 'str'}, + 'channel_encryption': {'key': 'channelEncryption', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SmbSetting, self).__init__(**kwargs) + self.multichannel = kwargs.get('multichannel', None) + self.versions = kwargs.get('versions', None) + self.authentication_methods = kwargs.get('authentication_methods', None) + self.kerberos_ticket_encryption = kwargs.get('kerberos_ticket_encryption', None) + self.channel_encryption = kwargs.get('channel_encryption', None) + + +class TrackedResource(Resource): + """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives. + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TrackedResource, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.location = kwargs['location'] + + +class StorageAccount(TrackedResource): + """The storage account. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives. + :type location: str + :ivar sku: Gets the SKU. + :vartype sku: ~azure.mgmt.storage.v2021_06_01.models.Sku + :ivar kind: Gets the Kind. Possible values include: "Storage", "StorageV2", "BlobStorage", + "FileStorage", "BlockBlobStorage". + :vartype kind: str or ~azure.mgmt.storage.v2021_06_01.models.Kind + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2021_06_01.models.Identity + :param extended_location: The extendedLocation of the resource. + :type extended_location: ~azure.mgmt.storage.v2021_06_01.models.ExtendedLocation + :ivar provisioning_state: Gets the status of the storage account at the time the operation was + called. Possible values include: "Creating", "ResolvingDNS", "Succeeded". + :vartype provisioning_state: str or ~azure.mgmt.storage.v2021_06_01.models.ProvisioningState + :ivar primary_endpoints: Gets the URLs that are used to perform a retrieval of a public blob, + queue, or table object. Note that Standard_ZRS and Premium_LRS accounts only return the blob + endpoint. + :vartype primary_endpoints: ~azure.mgmt.storage.v2021_06_01.models.Endpoints + :ivar primary_location: Gets the location of the primary data center for the storage account. + :vartype primary_location: str + :ivar status_of_primary: Gets the status indicating whether the primary location of the storage + account is available or unavailable. Possible values include: "available", "unavailable". + :vartype status_of_primary: str or ~azure.mgmt.storage.v2021_06_01.models.AccountStatus + :ivar last_geo_failover_time: Gets the timestamp of the most recent instance of a failover to + the secondary location. Only the most recent timestamp is retained. This element is not + returned if there has never been a failover instance. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype last_geo_failover_time: ~datetime.datetime + :ivar secondary_location: Gets the location of the geo-replicated secondary for the storage + account. Only available if the accountType is Standard_GRS or Standard_RAGRS. + :vartype secondary_location: str + :ivar status_of_secondary: Gets the status indicating whether the secondary location of the + storage account is available or unavailable. Only available if the SKU name is Standard_GRS or + Standard_RAGRS. Possible values include: "available", "unavailable". + :vartype status_of_secondary: str or ~azure.mgmt.storage.v2021_06_01.models.AccountStatus + :ivar creation_time: Gets the creation date and time of the storage account in UTC. + :vartype creation_time: ~datetime.datetime + :ivar custom_domain: Gets the custom domain the user assigned to this storage account. + :vartype custom_domain: ~azure.mgmt.storage.v2021_06_01.models.CustomDomain + :ivar sas_policy: SasPolicy assigned to the storage account. + :vartype sas_policy: ~azure.mgmt.storage.v2021_06_01.models.SasPolicy + :ivar key_policy: KeyPolicy assigned to the storage account. + :vartype key_policy: ~azure.mgmt.storage.v2021_06_01.models.KeyPolicy + :ivar key_creation_time: Storage account keys creation time. + :vartype key_creation_time: ~azure.mgmt.storage.v2021_06_01.models.KeyCreationTime + :ivar secondary_endpoints: Gets the URLs that are used to perform a retrieval of a public blob, + queue, or table object from the secondary location of the storage account. Only available if + the SKU name is Standard_RAGRS. + :vartype secondary_endpoints: ~azure.mgmt.storage.v2021_06_01.models.Endpoints + :ivar encryption: Gets the encryption settings on the account. If unspecified, the account is + unencrypted. + :vartype encryption: ~azure.mgmt.storage.v2021_06_01.models.Encryption + :ivar access_tier: Required for storage accounts where kind = BlobStorage. The access tier used + for billing. Possible values include: "Hot", "Cool". + :vartype access_tier: str or ~azure.mgmt.storage.v2021_06_01.models.AccessTier + :param azure_files_identity_based_authentication: Provides the identity based authentication + settings for Azure Files. + :type azure_files_identity_based_authentication: + ~azure.mgmt.storage.v2021_06_01.models.AzureFilesIdentityBasedAuthentication + :param enable_https_traffic_only: Allows https traffic only to storage service if sets to true. + :type enable_https_traffic_only: bool + :ivar network_rule_set: Network rule set. + :vartype network_rule_set: ~azure.mgmt.storage.v2021_06_01.models.NetworkRuleSet + :param is_hns_enabled: Account HierarchicalNamespace enabled if sets to true. + :type is_hns_enabled: bool + :ivar geo_replication_stats: Geo Replication Stats. + :vartype geo_replication_stats: ~azure.mgmt.storage.v2021_06_01.models.GeoReplicationStats + :ivar failover_in_progress: If the failover is in progress, the value will be true, otherwise, + it will be null. + :vartype failover_in_progress: bool + :param large_file_shares_state: Allow large file shares if sets to Enabled. It cannot be + disabled once it is enabled. Possible values include: "Disabled", "Enabled". + :type large_file_shares_state: str or + ~azure.mgmt.storage.v2021_06_01.models.LargeFileSharesState + :ivar private_endpoint_connections: List of private endpoint connection associated with the + specified storage account. + :vartype private_endpoint_connections: + list[~azure.mgmt.storage.v2021_06_01.models.PrivateEndpointConnection] + :param routing_preference: Maintains information about the network routing choice opted by the + user for data transfer. + :type routing_preference: ~azure.mgmt.storage.v2021_06_01.models.RoutingPreference + :ivar blob_restore_status: Blob restore status. + :vartype blob_restore_status: ~azure.mgmt.storage.v2021_06_01.models.BlobRestoreStatus + :param allow_blob_public_access: Allow or disallow public access to all blobs or containers in + the storage account. The default interpretation is true for this property. + :type allow_blob_public_access: bool + :param minimum_tls_version: Set the minimum TLS version to be permitted on requests to storage. + The default interpretation is TLS 1.0 for this property. Possible values include: "TLS1_0", + "TLS1_1", "TLS1_2". + :type minimum_tls_version: str or ~azure.mgmt.storage.v2021_06_01.models.MinimumTlsVersion + :param allow_shared_key_access: Indicates whether the storage account permits requests to be + authorized with the account access key via Shared Key. If false, then all requests, including + shared access signatures, must be authorized with Azure Active Directory (Azure AD). The + default value is null, which is equivalent to true. + :type allow_shared_key_access: bool + :param enable_nfs_v3: NFS 3.0 protocol support enabled if set to true. + :type enable_nfs_v3: bool + :param allow_cross_tenant_replication: Allow or disallow cross AAD tenant object replication. + The default interpretation is true for this property. + :type allow_cross_tenant_replication: bool + :param default_to_o_auth_authentication: A boolean flag which indicates whether the default + authentication is OAuth or not. The default interpretation is false for this property. + :type default_to_o_auth_authentication: bool + :param public_network_access: Allow or disallow public network access to Storage Account. Value + is optional but if passed in, must be 'Enabled' or 'Disabled'. Possible values include: + "Enabled", "Disabled". + :type public_network_access: str or ~azure.mgmt.storage.v2021_06_01.models.PublicNetworkAccess + :param immutable_storage_with_versioning: The property is immutable and can only be set to true + at the account creation time. When set to true, it enables object level immutability for all + the containers in the account by default. + :type immutable_storage_with_versioning: + ~azure.mgmt.storage.v2021_06_01.models.ImmutableStorageAccount + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'sku': {'readonly': True}, + 'kind': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'primary_endpoints': {'readonly': True}, + 'primary_location': {'readonly': True}, + 'status_of_primary': {'readonly': True}, + 'last_geo_failover_time': {'readonly': True}, + 'secondary_location': {'readonly': True}, + 'status_of_secondary': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'custom_domain': {'readonly': True}, + 'sas_policy': {'readonly': True}, + 'key_policy': {'readonly': True}, + 'key_creation_time': {'readonly': True}, + 'secondary_endpoints': {'readonly': True}, + 'encryption': {'readonly': True}, + 'access_tier': {'readonly': True}, + 'network_rule_set': {'readonly': True}, + 'geo_replication_stats': {'readonly': True}, + 'failover_in_progress': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, + 'blob_restore_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'}, + 'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'}, + 'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'str'}, + 'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'}, + 'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'}, + 'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'sas_policy': {'key': 'properties.sasPolicy', 'type': 'SasPolicy'}, + 'key_policy': {'key': 'properties.keyPolicy', 'type': 'KeyPolicy'}, + 'key_creation_time': {'key': 'properties.keyCreationTime', 'type': 'KeyCreationTime'}, + 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'str'}, + 'azure_files_identity_based_authentication': {'key': 'properties.azureFilesIdentityBasedAuthentication', 'type': 'AzureFilesIdentityBasedAuthentication'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'is_hns_enabled': {'key': 'properties.isHnsEnabled', 'type': 'bool'}, + 'geo_replication_stats': {'key': 'properties.geoReplicationStats', 'type': 'GeoReplicationStats'}, + 'failover_in_progress': {'key': 'properties.failoverInProgress', 'type': 'bool'}, + 'large_file_shares_state': {'key': 'properties.largeFileSharesState', 'type': 'str'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, + 'routing_preference': {'key': 'properties.routingPreference', 'type': 'RoutingPreference'}, + 'blob_restore_status': {'key': 'properties.blobRestoreStatus', 'type': 'BlobRestoreStatus'}, + 'allow_blob_public_access': {'key': 'properties.allowBlobPublicAccess', 'type': 'bool'}, + 'minimum_tls_version': {'key': 'properties.minimumTlsVersion', 'type': 'str'}, + 'allow_shared_key_access': {'key': 'properties.allowSharedKeyAccess', 'type': 'bool'}, + 'enable_nfs_v3': {'key': 'properties.isNfsV3Enabled', 'type': 'bool'}, + 'allow_cross_tenant_replication': {'key': 'properties.allowCrossTenantReplication', 'type': 'bool'}, + 'default_to_o_auth_authentication': {'key': 'properties.defaultToOAuthAuthentication', 'type': 'bool'}, + 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, + 'immutable_storage_with_versioning': {'key': 'properties.immutableStorageWithVersioning', 'type': 'ImmutableStorageAccount'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageAccount, self).__init__(**kwargs) + self.sku = None + self.kind = None + self.identity = kwargs.get('identity', None) + self.extended_location = kwargs.get('extended_location', None) + self.provisioning_state = None + self.primary_endpoints = None + self.primary_location = None + self.status_of_primary = None + self.last_geo_failover_time = None + self.secondary_location = None + self.status_of_secondary = None + self.creation_time = None + self.custom_domain = None + self.sas_policy = None + self.key_policy = None + self.key_creation_time = None + self.secondary_endpoints = None + self.encryption = None + self.access_tier = None + self.azure_files_identity_based_authentication = kwargs.get('azure_files_identity_based_authentication', None) + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', None) + self.network_rule_set = None + self.is_hns_enabled = kwargs.get('is_hns_enabled', None) + self.geo_replication_stats = None + self.failover_in_progress = None + self.large_file_shares_state = kwargs.get('large_file_shares_state', None) + self.private_endpoint_connections = None + self.routing_preference = kwargs.get('routing_preference', None) + self.blob_restore_status = None + self.allow_blob_public_access = kwargs.get('allow_blob_public_access', None) + self.minimum_tls_version = kwargs.get('minimum_tls_version', None) + self.allow_shared_key_access = kwargs.get('allow_shared_key_access', None) + self.enable_nfs_v3 = kwargs.get('enable_nfs_v3', None) + self.allow_cross_tenant_replication = kwargs.get('allow_cross_tenant_replication', None) + self.default_to_o_auth_authentication = kwargs.get('default_to_o_auth_authentication', None) + self.public_network_access = kwargs.get('public_network_access', None) + self.immutable_storage_with_versioning = kwargs.get('immutable_storage_with_versioning', None) + + +class StorageAccountCheckNameAvailabilityParameters(msrest.serialization.Model): + """The parameters used to check the availability of the storage account name. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The storage account name. + :type name: str + :ivar type: The type of resource, Microsoft.Storage/storageAccounts. Has constant value: + "Microsoft.Storage/storageAccounts". + :vartype type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.Storage/storageAccounts" + + def __init__( + self, + **kwargs + ): + super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = kwargs['name'] + + +class StorageAccountCreateParameters(msrest.serialization.Model): + """The parameters used when creating a storage account. + + All required parameters must be populated in order to send to Azure. + + :param sku: Required. Required. Gets or sets the SKU name. + :type sku: ~azure.mgmt.storage.v2021_06_01.models.Sku + :param kind: Required. Required. Indicates the type of storage account. Possible values + include: "Storage", "StorageV2", "BlobStorage", "FileStorage", "BlockBlobStorage". + :type kind: str or ~azure.mgmt.storage.v2021_06_01.models.Kind + :param location: Required. Required. Gets or sets the location of the resource. This will be + one of the supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, + etc.). The geo region of a resource cannot be changed once it is created, but if an identical + geo region is specified on update, the request will succeed. + :type location: str + :param extended_location: Optional. Set the extended location of the resource. If not set, the + storage account will be created in Azure main region. Otherwise it will be created in the + specified extended location. + :type extended_location: ~azure.mgmt.storage.v2021_06_01.models.ExtendedLocation + :param tags: A set of tags. Gets or sets a list of key value pairs that describe the resource. + These tags can be used for viewing and grouping this resource (across resource groups). A + maximum of 15 tags can be provided for a resource. Each tag must have a key with a length no + greater than 128 characters and a value with a length no greater than 256 characters. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2021_06_01.models.Identity + :param public_network_access: Allow or disallow public network access to Storage Account. Value + is optional but if passed in, must be 'Enabled' or 'Disabled'. Possible values include: + "Enabled", "Disabled". + :type public_network_access: str or ~azure.mgmt.storage.v2021_06_01.models.PublicNetworkAccess + :param sas_policy: SasPolicy assigned to the storage account. + :type sas_policy: ~azure.mgmt.storage.v2021_06_01.models.SasPolicy + :param key_policy: KeyPolicy assigned to the storage account. + :type key_policy: ~azure.mgmt.storage.v2021_06_01.models.KeyPolicy + :param custom_domain: User domain assigned to the storage account. Name is the CNAME source. + Only one custom domain is supported per storage account at this time. To clear the existing + custom domain, use an empty string for the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2021_06_01.models.CustomDomain + :param encryption: Not applicable. Azure Storage encryption is enabled for all storage accounts + and cannot be disabled. + :type encryption: ~azure.mgmt.storage.v2021_06_01.models.Encryption + :param network_rule_set: Network rule set. + :type network_rule_set: ~azure.mgmt.storage.v2021_06_01.models.NetworkRuleSet + :param access_tier: Required for storage accounts where kind = BlobStorage. The access tier + used for billing. Possible values include: "Hot", "Cool". + :type access_tier: str or ~azure.mgmt.storage.v2021_06_01.models.AccessTier + :param azure_files_identity_based_authentication: Provides the identity based authentication + settings for Azure Files. + :type azure_files_identity_based_authentication: + ~azure.mgmt.storage.v2021_06_01.models.AzureFilesIdentityBasedAuthentication + :param enable_https_traffic_only: Allows https traffic only to storage service if sets to true. + The default value is true since API version 2019-04-01. + :type enable_https_traffic_only: bool + :param is_hns_enabled: Account HierarchicalNamespace enabled if sets to true. + :type is_hns_enabled: bool + :param large_file_shares_state: Allow large file shares if sets to Enabled. It cannot be + disabled once it is enabled. Possible values include: "Disabled", "Enabled". + :type large_file_shares_state: str or + ~azure.mgmt.storage.v2021_06_01.models.LargeFileSharesState + :param routing_preference: Maintains information about the network routing choice opted by the + user for data transfer. + :type routing_preference: ~azure.mgmt.storage.v2021_06_01.models.RoutingPreference + :param allow_blob_public_access: Allow or disallow public access to all blobs or containers in + the storage account. The default interpretation is true for this property. + :type allow_blob_public_access: bool + :param minimum_tls_version: Set the minimum TLS version to be permitted on requests to storage. + The default interpretation is TLS 1.0 for this property. Possible values include: "TLS1_0", + "TLS1_1", "TLS1_2". + :type minimum_tls_version: str or ~azure.mgmt.storage.v2021_06_01.models.MinimumTlsVersion + :param allow_shared_key_access: Indicates whether the storage account permits requests to be + authorized with the account access key via Shared Key. If false, then all requests, including + shared access signatures, must be authorized with Azure Active Directory (Azure AD). The + default value is null, which is equivalent to true. + :type allow_shared_key_access: bool + :param enable_nfs_v3: NFS 3.0 protocol support enabled if set to true. + :type enable_nfs_v3: bool + :param allow_cross_tenant_replication: Allow or disallow cross AAD tenant object replication. + The default interpretation is true for this property. + :type allow_cross_tenant_replication: bool + :param default_to_o_auth_authentication: A boolean flag which indicates whether the default + authentication is OAuth or not. The default interpretation is false for this property. + :type default_to_o_auth_authentication: bool + :param immutable_storage_with_versioning: The property is immutable and can only be set to true + at the account creation time. When set to true, it enables object level immutability for all + the new containers in the account by default. + :type immutable_storage_with_versioning: + ~azure.mgmt.storage.v2021_06_01.models.ImmutableStorageAccount + """ + + _validation = { + 'sku': {'required': True}, + 'kind': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, + 'sas_policy': {'key': 'properties.sasPolicy', 'type': 'SasPolicy'}, + 'key_policy': {'key': 'properties.keyPolicy', 'type': 'KeyPolicy'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'str'}, + 'azure_files_identity_based_authentication': {'key': 'properties.azureFilesIdentityBasedAuthentication', 'type': 'AzureFilesIdentityBasedAuthentication'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'is_hns_enabled': {'key': 'properties.isHnsEnabled', 'type': 'bool'}, + 'large_file_shares_state': {'key': 'properties.largeFileSharesState', 'type': 'str'}, + 'routing_preference': {'key': 'properties.routingPreference', 'type': 'RoutingPreference'}, + 'allow_blob_public_access': {'key': 'properties.allowBlobPublicAccess', 'type': 'bool'}, + 'minimum_tls_version': {'key': 'properties.minimumTlsVersion', 'type': 'str'}, + 'allow_shared_key_access': {'key': 'properties.allowSharedKeyAccess', 'type': 'bool'}, + 'enable_nfs_v3': {'key': 'properties.isNfsV3Enabled', 'type': 'bool'}, + 'allow_cross_tenant_replication': {'key': 'properties.allowCrossTenantReplication', 'type': 'bool'}, + 'default_to_o_auth_authentication': {'key': 'properties.defaultToOAuthAuthentication', 'type': 'bool'}, + 'immutable_storage_with_versioning': {'key': 'properties.immutableStorageWithVersioning', 'type': 'ImmutableStorageAccount'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageAccountCreateParameters, self).__init__(**kwargs) + self.sku = kwargs['sku'] + self.kind = kwargs['kind'] + self.location = kwargs['location'] + self.extended_location = kwargs.get('extended_location', None) + self.tags = kwargs.get('tags', None) + self.identity = kwargs.get('identity', None) + self.public_network_access = kwargs.get('public_network_access', None) + self.sas_policy = kwargs.get('sas_policy', None) + self.key_policy = kwargs.get('key_policy', None) + self.custom_domain = kwargs.get('custom_domain', None) + self.encryption = kwargs.get('encryption', None) + self.network_rule_set = kwargs.get('network_rule_set', None) + self.access_tier = kwargs.get('access_tier', None) + self.azure_files_identity_based_authentication = kwargs.get('azure_files_identity_based_authentication', None) + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', None) + self.is_hns_enabled = kwargs.get('is_hns_enabled', None) + self.large_file_shares_state = kwargs.get('large_file_shares_state', None) + self.routing_preference = kwargs.get('routing_preference', None) + self.allow_blob_public_access = kwargs.get('allow_blob_public_access', None) + self.minimum_tls_version = kwargs.get('minimum_tls_version', None) + self.allow_shared_key_access = kwargs.get('allow_shared_key_access', None) + self.enable_nfs_v3 = kwargs.get('enable_nfs_v3', None) + self.allow_cross_tenant_replication = kwargs.get('allow_cross_tenant_replication', None) + self.default_to_o_auth_authentication = kwargs.get('default_to_o_auth_authentication', None) + self.immutable_storage_with_versioning = kwargs.get('immutable_storage_with_versioning', None) + + +class StorageAccountInternetEndpoints(msrest.serialization.Model): + """The URIs that are used to perform a retrieval of a public blob, file, web or dfs object via a internet routing endpoint. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar blob: Gets the blob endpoint. + :vartype blob: str + :ivar file: Gets the file endpoint. + :vartype file: str + :ivar web: Gets the web endpoint. + :vartype web: str + :ivar dfs: Gets the dfs endpoint. + :vartype dfs: str + """ + + _validation = { + 'blob': {'readonly': True}, + 'file': {'readonly': True}, + 'web': {'readonly': True}, + 'dfs': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'str'}, + 'file': {'key': 'file', 'type': 'str'}, + 'web': {'key': 'web', 'type': 'str'}, + 'dfs': {'key': 'dfs', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageAccountInternetEndpoints, self).__init__(**kwargs) + self.blob = None + self.file = None + self.web = None + self.dfs = None + + +class StorageAccountKey(msrest.serialization.Model): + """An access key for the storage account. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar key_name: Name of the key. + :vartype key_name: str + :ivar value: Base 64-encoded value of the key. + :vartype value: str + :ivar permissions: Permissions for the key -- read-only or full permissions. Possible values + include: "Read", "Full". + :vartype permissions: str or ~azure.mgmt.storage.v2021_06_01.models.KeyPermission + :ivar creation_time: Creation time of the key, in round trip date format. + :vartype creation_time: ~datetime.datetime + """ + + _validation = { + 'key_name': {'readonly': True}, + 'value': {'readonly': True}, + 'permissions': {'readonly': True}, + 'creation_time': {'readonly': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'permissions': {'key': 'permissions', 'type': 'str'}, + 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageAccountKey, self).__init__(**kwargs) + self.key_name = None + self.value = None + self.permissions = None + self.creation_time = None + + +class StorageAccountListKeysResult(msrest.serialization.Model): + """The response from the ListKeys operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar keys: Gets the list of storage account keys and their properties for the specified + storage account. + :vartype keys: list[~azure.mgmt.storage.v2021_06_01.models.StorageAccountKey] + """ + + _validation = { + 'keys': {'readonly': True}, + } + + _attribute_map = { + 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageAccountListKeysResult, self).__init__(**kwargs) + self.keys = None + + +class StorageAccountListResult(msrest.serialization.Model): + """The response from the List Storage Accounts operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: Gets the list of storage accounts and their properties. + :vartype value: list[~azure.mgmt.storage.v2021_06_01.models.StorageAccount] + :ivar next_link: Request URL that can be used to query next page of storage accounts. Returned + when total number of requested storage accounts exceed maximum page size. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[StorageAccount]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageAccountListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class StorageAccountMicrosoftEndpoints(msrest.serialization.Model): + """The URIs that are used to perform a retrieval of a public blob, queue, table, web or dfs object via a microsoft routing endpoint. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar blob: Gets the blob endpoint. + :vartype blob: str + :ivar queue: Gets the queue endpoint. + :vartype queue: str + :ivar table: Gets the table endpoint. + :vartype table: str + :ivar file: Gets the file endpoint. + :vartype file: str + :ivar web: Gets the web endpoint. + :vartype web: str + :ivar dfs: Gets the dfs endpoint. + :vartype dfs: str + """ + + _validation = { + 'blob': {'readonly': True}, + 'queue': {'readonly': True}, + 'table': {'readonly': True}, + 'file': {'readonly': True}, + 'web': {'readonly': True}, + 'dfs': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'str'}, + 'queue': {'key': 'queue', 'type': 'str'}, + 'table': {'key': 'table', 'type': 'str'}, + 'file': {'key': 'file', 'type': 'str'}, + 'web': {'key': 'web', 'type': 'str'}, + 'dfs': {'key': 'dfs', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageAccountMicrosoftEndpoints, self).__init__(**kwargs) + self.blob = None + self.queue = None + self.table = None + self.file = None + self.web = None + self.dfs = None + + +class StorageAccountRegenerateKeyParameters(msrest.serialization.Model): + """The parameters used to regenerate the storage account key. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. The name of storage keys that want to be regenerated, possible + values are key1, key2, kerb1, kerb2. + :type key_name: str + """ + + _validation = { + 'key_name': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) + self.key_name = kwargs['key_name'] + + +class StorageAccountUpdateParameters(msrest.serialization.Model): + """The parameters that can be provided when updating the storage account properties. + + :param sku: Gets or sets the SKU name. Note that the SKU name cannot be updated to + Standard_ZRS, Premium_LRS or Premium_ZRS, nor can accounts of those SKU names be updated to any + other value. + :type sku: ~azure.mgmt.storage.v2021_06_01.models.Sku + :param tags: A set of tags. Gets or sets a list of key value pairs that describe the resource. + These tags can be used in viewing and grouping this resource (across resource groups). A + maximum of 15 tags can be provided for a resource. Each tag must have a key no greater in + length than 128 characters and a value no greater in length than 256 characters. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2021_06_01.models.Identity + :param kind: Optional. Indicates the type of storage account. Currently only StorageV2 value + supported by server. Possible values include: "Storage", "StorageV2", "BlobStorage", + "FileStorage", "BlockBlobStorage". + :type kind: str or ~azure.mgmt.storage.v2021_06_01.models.Kind + :param custom_domain: Custom domain assigned to the storage account by the user. Name is the + CNAME source. Only one custom domain is supported per storage account at this time. To clear + the existing custom domain, use an empty string for the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2021_06_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. The default setting is + unencrypted. + :type encryption: ~azure.mgmt.storage.v2021_06_01.models.Encryption + :param sas_policy: SasPolicy assigned to the storage account. + :type sas_policy: ~azure.mgmt.storage.v2021_06_01.models.SasPolicy + :param key_policy: KeyPolicy assigned to the storage account. + :type key_policy: ~azure.mgmt.storage.v2021_06_01.models.KeyPolicy + :param access_tier: Required for storage accounts where kind = BlobStorage. The access tier + used for billing. Possible values include: "Hot", "Cool". + :type access_tier: str or ~azure.mgmt.storage.v2021_06_01.models.AccessTier + :param azure_files_identity_based_authentication: Provides the identity based authentication + settings for Azure Files. + :type azure_files_identity_based_authentication: + ~azure.mgmt.storage.v2021_06_01.models.AzureFilesIdentityBasedAuthentication + :param enable_https_traffic_only: Allows https traffic only to storage service if sets to true. + :type enable_https_traffic_only: bool + :param network_rule_set: Network rule set. + :type network_rule_set: ~azure.mgmt.storage.v2021_06_01.models.NetworkRuleSet + :param large_file_shares_state: Allow large file shares if sets to Enabled. It cannot be + disabled once it is enabled. Possible values include: "Disabled", "Enabled". + :type large_file_shares_state: str or + ~azure.mgmt.storage.v2021_06_01.models.LargeFileSharesState + :param routing_preference: Maintains information about the network routing choice opted by the + user for data transfer. + :type routing_preference: ~azure.mgmt.storage.v2021_06_01.models.RoutingPreference + :param allow_blob_public_access: Allow or disallow public access to all blobs or containers in + the storage account. The default interpretation is true for this property. + :type allow_blob_public_access: bool + :param minimum_tls_version: Set the minimum TLS version to be permitted on requests to storage. + The default interpretation is TLS 1.0 for this property. Possible values include: "TLS1_0", + "TLS1_1", "TLS1_2". + :type minimum_tls_version: str or ~azure.mgmt.storage.v2021_06_01.models.MinimumTlsVersion + :param allow_shared_key_access: Indicates whether the storage account permits requests to be + authorized with the account access key via Shared Key. If false, then all requests, including + shared access signatures, must be authorized with Azure Active Directory (Azure AD). The + default value is null, which is equivalent to true. + :type allow_shared_key_access: bool + :param allow_cross_tenant_replication: Allow or disallow cross AAD tenant object replication. + The default interpretation is true for this property. + :type allow_cross_tenant_replication: bool + :param default_to_o_auth_authentication: A boolean flag which indicates whether the default + authentication is OAuth or not. The default interpretation is false for this property. + :type default_to_o_auth_authentication: bool + :param public_network_access: Allow or disallow public network access to Storage Account. Value + is optional but if passed in, must be 'Enabled' or 'Disabled'. Possible values include: + "Enabled", "Disabled". + :type public_network_access: str or ~azure.mgmt.storage.v2021_06_01.models.PublicNetworkAccess + :param immutable_storage_with_versioning: The property is immutable and can only be set to true + at the account creation time. When set to true, it enables object level immutability for all + the containers in the account by default. + :type immutable_storage_with_versioning: + ~azure.mgmt.storage.v2021_06_01.models.ImmutableStorageAccount + """ + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'sas_policy': {'key': 'properties.sasPolicy', 'type': 'SasPolicy'}, + 'key_policy': {'key': 'properties.keyPolicy', 'type': 'KeyPolicy'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'str'}, + 'azure_files_identity_based_authentication': {'key': 'properties.azureFilesIdentityBasedAuthentication', 'type': 'AzureFilesIdentityBasedAuthentication'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'large_file_shares_state': {'key': 'properties.largeFileSharesState', 'type': 'str'}, + 'routing_preference': {'key': 'properties.routingPreference', 'type': 'RoutingPreference'}, + 'allow_blob_public_access': {'key': 'properties.allowBlobPublicAccess', 'type': 'bool'}, + 'minimum_tls_version': {'key': 'properties.minimumTlsVersion', 'type': 'str'}, + 'allow_shared_key_access': {'key': 'properties.allowSharedKeyAccess', 'type': 'bool'}, + 'allow_cross_tenant_replication': {'key': 'properties.allowCrossTenantReplication', 'type': 'bool'}, + 'default_to_o_auth_authentication': {'key': 'properties.defaultToOAuthAuthentication', 'type': 'bool'}, + 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, + 'immutable_storage_with_versioning': {'key': 'properties.immutableStorageWithVersioning', 'type': 'ImmutableStorageAccount'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageAccountUpdateParameters, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.tags = kwargs.get('tags', None) + self.identity = kwargs.get('identity', None) + self.kind = kwargs.get('kind', None) + self.custom_domain = kwargs.get('custom_domain', None) + self.encryption = kwargs.get('encryption', None) + self.sas_policy = kwargs.get('sas_policy', None) + self.key_policy = kwargs.get('key_policy', None) + self.access_tier = kwargs.get('access_tier', None) + self.azure_files_identity_based_authentication = kwargs.get('azure_files_identity_based_authentication', None) + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', None) + self.network_rule_set = kwargs.get('network_rule_set', None) + self.large_file_shares_state = kwargs.get('large_file_shares_state', None) + self.routing_preference = kwargs.get('routing_preference', None) + self.allow_blob_public_access = kwargs.get('allow_blob_public_access', None) + self.minimum_tls_version = kwargs.get('minimum_tls_version', None) + self.allow_shared_key_access = kwargs.get('allow_shared_key_access', None) + self.allow_cross_tenant_replication = kwargs.get('allow_cross_tenant_replication', None) + self.default_to_o_auth_authentication = kwargs.get('default_to_o_auth_authentication', None) + self.public_network_access = kwargs.get('public_network_access', None) + self.immutable_storage_with_versioning = kwargs.get('immutable_storage_with_versioning', None) + + +class StorageQueue(Resource): + """StorageQueue. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param metadata: A name-value pair that represents queue metadata. + :type metadata: dict[str, str] + :ivar approximate_message_count: Integer indicating an approximate number of messages in the + queue. This number is not lower than the actual number of messages in the queue, but could be + higher. + :vartype approximate_message_count: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'approximate_message_count': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'approximate_message_count': {'key': 'properties.approximateMessageCount', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageQueue, self).__init__(**kwargs) + self.metadata = kwargs.get('metadata', None) + self.approximate_message_count = None + + +class StorageSkuListResult(msrest.serialization.Model): + """The response from the List Storage SKUs operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: Get the list result of storage SKUs and their properties. + :vartype value: list[~azure.mgmt.storage.v2021_06_01.models.SkuInformation] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SkuInformation]'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageSkuListResult, self).__init__(**kwargs) + self.value = None + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or ~azure.mgmt.storage.v2021_06_01.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or ~azure.mgmt.storage.v2021_06_01.models.CreatedByType + :param last_modified_at: The timestamp of resource last modification (UTC). + :type last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(SystemData, self).__init__(**kwargs) + self.created_by = kwargs.get('created_by', None) + self.created_by_type = kwargs.get('created_by_type', None) + self.created_at = kwargs.get('created_at', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.last_modified_by_type = kwargs.get('last_modified_by_type', None) + self.last_modified_at = kwargs.get('last_modified_at', None) + + +class Table(Resource): + """Properties of the table, including Id, resource name, resource type. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar table_name: Table name under the specified account. + :vartype table_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'table_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'table_name': {'key': 'properties.tableName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Table, self).__init__(**kwargs) + self.table_name = None + + +class TableServiceProperties(Resource): + """The properties of a storage account’s Table service. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param cors: Specifies CORS rules for the Table service. You can include up to five CorsRule + elements in the request. If no CorsRule elements are included in the request body, all CORS + rules will be deleted, and CORS will be disabled for the Table service. + :type cors: ~azure.mgmt.storage.v2021_06_01.models.CorsRules + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'cors': {'key': 'properties.cors', 'type': 'CorsRules'}, + } + + def __init__( + self, + **kwargs + ): + super(TableServiceProperties, self).__init__(**kwargs) + self.cors = kwargs.get('cors', None) + + +class TagFilter(msrest.serialization.Model): + """Blob index tag based filtering for blob objects. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. This is the filter tag name, it can have 1 - 128 characters. + :type name: str + :param op: Required. This is the comparison operator which is used for object comparison and + filtering. Only == (equality operator) is currently supported. + :type op: str + :param value: Required. This is the filter tag value field used for tag based filtering, it can + have 0 - 256 characters. + :type value: str + """ + + _validation = { + 'name': {'required': True, 'max_length': 128, 'min_length': 1}, + 'op': {'required': True}, + 'value': {'required': True, 'max_length': 256, 'min_length': 0}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'op': {'key': 'op', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TagFilter, self).__init__(**kwargs) + self.name = kwargs['name'] + self.op = kwargs['op'] + self.value = kwargs['value'] + + +class TagProperty(msrest.serialization.Model): + """A tag of the LegalHold of a blob container. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar tag: The tag value. + :vartype tag: str + :ivar timestamp: Returns the date and time the tag was added. + :vartype timestamp: ~datetime.datetime + :ivar object_identifier: Returns the Object ID of the user who added the tag. + :vartype object_identifier: str + :ivar tenant_id: Returns the Tenant ID that issued the token for the user who added the tag. + :vartype tenant_id: str + :ivar upn: Returns the User Principal Name of the user who added the tag. + :vartype upn: str + """ + + _validation = { + 'tag': {'readonly': True}, + 'timestamp': {'readonly': True}, + 'object_identifier': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'upn': {'readonly': True}, + } + + _attribute_map = { + 'tag': {'key': 'tag', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'object_identifier': {'key': 'objectIdentifier', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'upn': {'key': 'upn', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TagProperty, self).__init__(**kwargs) + self.tag = None + self.timestamp = None + self.object_identifier = None + self.tenant_id = None + self.upn = None + + +class UpdateHistoryProperty(msrest.serialization.Model): + """An update history of the ImmutabilityPolicy of a blob container. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar update: The ImmutabilityPolicy update type of a blob container, possible values include: + put, lock and extend. Possible values include: "put", "lock", "extend". + :vartype update: str or ~azure.mgmt.storage.v2021_06_01.models.ImmutabilityPolicyUpdateType + :ivar immutability_period_since_creation_in_days: The immutability period for the blobs in the + container since the policy creation, in days. + :vartype immutability_period_since_creation_in_days: int + :ivar timestamp: Returns the date and time the ImmutabilityPolicy was updated. + :vartype timestamp: ~datetime.datetime + :ivar object_identifier: Returns the Object ID of the user who updated the ImmutabilityPolicy. + :vartype object_identifier: str + :ivar tenant_id: Returns the Tenant ID that issued the token for the user who updated the + ImmutabilityPolicy. + :vartype tenant_id: str + :ivar upn: Returns the User Principal Name of the user who updated the ImmutabilityPolicy. + :vartype upn: str + :param allow_protected_append_writes: This property can only be changed for unlocked time-based + retention policies. When enabled, new blocks can be written to an append blob while maintaining + immutability protection and compliance. Only new blocks can be added and any existing blocks + cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy + API. + :type allow_protected_append_writes: bool + :param allow_protected_append_writes_all: This property can only be changed for unlocked + time-based retention policies. When enabled, new blocks can be written to both 'Append and Bock + Blobs' while maintaining immutability protection and compliance. Only new blocks can be added + and any existing blocks cannot be modified or deleted. This property cannot be changed with + ExtendImmutabilityPolicy API. The 'allowProtectedAppendWrites' and + 'allowProtectedAppendWritesAll' properties are mutually exclusive. + :type allow_protected_append_writes_all: bool + """ + + _validation = { + 'update': {'readonly': True}, + 'immutability_period_since_creation_in_days': {'readonly': True}, + 'timestamp': {'readonly': True}, + 'object_identifier': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'upn': {'readonly': True}, + } + + _attribute_map = { + 'update': {'key': 'update', 'type': 'str'}, + 'immutability_period_since_creation_in_days': {'key': 'immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'object_identifier': {'key': 'objectIdentifier', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'upn': {'key': 'upn', 'type': 'str'}, + 'allow_protected_append_writes': {'key': 'allowProtectedAppendWrites', 'type': 'bool'}, + 'allow_protected_append_writes_all': {'key': 'allowProtectedAppendWritesAll', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(UpdateHistoryProperty, self).__init__(**kwargs) + self.update = None + self.immutability_period_since_creation_in_days = None + self.timestamp = None + self.object_identifier = None + self.tenant_id = None + self.upn = None + self.allow_protected_append_writes = kwargs.get('allow_protected_append_writes', None) + self.allow_protected_append_writes_all = kwargs.get('allow_protected_append_writes_all', None) + + +class Usage(msrest.serialization.Model): + """Describes Storage Resource Usage. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar unit: Gets the unit of measurement. Possible values include: "Count", "Bytes", "Seconds", + "Percent", "CountsPerSecond", "BytesPerSecond". + :vartype unit: str or ~azure.mgmt.storage.v2021_06_01.models.UsageUnit + :ivar current_value: Gets the current count of the allocated resources in the subscription. + :vartype current_value: int + :ivar limit: Gets the maximum count of the resources that can be allocated in the subscription. + :vartype limit: int + :ivar name: Gets the name of the type of usage. + :vartype name: ~azure.mgmt.storage.v2021_06_01.models.UsageName + """ + + _validation = { + 'unit': {'readonly': True}, + 'current_value': {'readonly': True}, + 'limit': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'str'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + def __init__( + self, + **kwargs + ): + super(Usage, self).__init__(**kwargs) + self.unit = None + self.current_value = None + self.limit = None + self.name = None + + +class UsageListResult(msrest.serialization.Model): + """The response from the List Usages operation. + + :param value: Gets or sets the list of Storage Resource Usages. + :type value: list[~azure.mgmt.storage.v2021_06_01.models.Usage] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Usage]'}, + } + + def __init__( + self, + **kwargs + ): + super(UsageListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class UsageName(msrest.serialization.Model): + """The usage names that can be used; currently limited to StorageAccount. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: Gets a string describing the resource name. + :vartype value: str + :ivar localized_value: Gets a localized string describing the resource name. + :vartype localized_value: str + """ + + _validation = { + 'value': {'readonly': True}, + 'localized_value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UsageName, self).__init__(**kwargs) + self.value = None + self.localized_value = None + + +class UserAssignedIdentity(msrest.serialization.Model): + """UserAssignedIdentity for the resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal ID of the identity. + :vartype principal_id: str + :ivar client_id: The client ID of the identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UserAssignedIdentity, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + +class VirtualNetworkRule(msrest.serialization.Model): + """Virtual Network rule. + + All required parameters must be populated in order to send to Azure. + + :param virtual_network_resource_id: Required. Resource ID of a subnet, for example: + /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + :type virtual_network_resource_id: str + :param action: The action of virtual network rule. The only acceptable values to pass in are + None and "Allow". The default value is None. + :type action: str + :param state: Gets the state of virtual network rule. Possible values include: "Provisioning", + "Deprovisioning", "Succeeded", "Failed", "NetworkSourceDeleted". + :type state: str or ~azure.mgmt.storage.v2021_06_01.models.State + """ + + _validation = { + 'virtual_network_resource_id': {'required': True}, + } + + _attribute_map = { + 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualNetworkRule, self).__init__(**kwargs) + self.virtual_network_resource_id = kwargs['virtual_network_resource_id'] + self.action = kwargs.get('action', None) + self.state = kwargs.get('state', None) diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/models/_models_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/models/_models_py3.py new file mode 100644 index 000000000000..59c6c288ff9d --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/models/_models_py3.py @@ -0,0 +1,6424 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +import datetime +from typing import Dict, List, Optional, Union + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + +from ._storage_management_client_enums import * + + +class AccessPolicy(msrest.serialization.Model): + """AccessPolicy. + + :param start_time: Start time of the access policy. + :type start_time: ~datetime.datetime + :param expiry_time: Expiry time of the access policy. + :type expiry_time: ~datetime.datetime + :param permission: List of abbreviated permissions. + :type permission: str + """ + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, + 'permission': {'key': 'permission', 'type': 'str'}, + } + + def __init__( + self, + *, + start_time: Optional[datetime.datetime] = None, + expiry_time: Optional[datetime.datetime] = None, + permission: Optional[str] = None, + **kwargs + ): + super(AccessPolicy, self).__init__(**kwargs) + self.start_time = start_time + self.expiry_time = expiry_time + self.permission = permission + + +class AccountImmutabilityPolicyProperties(msrest.serialization.Model): + """This defines account-level immutability policy properties. + + :param immutability_period_since_creation_in_days: The immutability period for the blobs in the + container since the policy creation, in days. + :type immutability_period_since_creation_in_days: int + :param state: The ImmutabilityPolicy state defines the mode of the policy. Disabled state + disables the policy, Unlocked state allows increase and decrease of immutability retention time + and also allows toggling allowProtectedAppendWrites property, Locked state only allows the + increase of the immutability retention time. A policy can only be created in a Disabled or + Unlocked state and can be toggled between the two states. Only a policy in an Unlocked state + can transition to a Locked state which cannot be reverted. Possible values include: "Unlocked", + "Locked", "Disabled". + :type state: str or ~azure.mgmt.storage.v2021_06_01.models.AccountImmutabilityPolicyState + :param allow_protected_append_writes: This property can only be changed for disabled and + unlocked time-based retention policies. When enabled, new blocks can be written to an append + blob while maintaining immutability protection and compliance. Only new blocks can be added and + any existing blocks cannot be modified or deleted. + :type allow_protected_append_writes: bool + """ + + _validation = { + 'immutability_period_since_creation_in_days': {'maximum': 146000, 'minimum': 1}, + } + + _attribute_map = { + 'immutability_period_since_creation_in_days': {'key': 'immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'state': {'key': 'state', 'type': 'str'}, + 'allow_protected_append_writes': {'key': 'allowProtectedAppendWrites', 'type': 'bool'}, + } + + def __init__( + self, + *, + immutability_period_since_creation_in_days: Optional[int] = None, + state: Optional[Union[str, "AccountImmutabilityPolicyState"]] = None, + allow_protected_append_writes: Optional[bool] = None, + **kwargs + ): + super(AccountImmutabilityPolicyProperties, self).__init__(**kwargs) + self.immutability_period_since_creation_in_days = immutability_period_since_creation_in_days + self.state = state + self.allow_protected_append_writes = allow_protected_append_writes + + +class AccountSasParameters(msrest.serialization.Model): + """The parameters to list SAS credentials of a storage account. + + All required parameters must be populated in order to send to Azure. + + :param services: Required. The signed services accessible with the account SAS. Possible values + include: Blob (b), Queue (q), Table (t), File (f). Possible values include: "b", "q", "t", "f". + :type services: str or ~azure.mgmt.storage.v2021_06_01.models.Services + :param resource_types: Required. The signed resource types that are accessible with the account + SAS. Service (s): Access to service-level APIs; Container (c): Access to container-level APIs; + Object (o): Access to object-level APIs for blobs, queue messages, table entities, and files. + Possible values include: "s", "c", "o". + :type resource_types: str or ~azure.mgmt.storage.v2021_06_01.models.SignedResourceTypes + :param permissions: Required. The signed permissions for the account SAS. Possible values + include: Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process + (p). Possible values include: "r", "d", "w", "l", "a", "c", "u", "p". + :type permissions: str or ~azure.mgmt.storage.v2021_06_01.models.Permissions + :param ip_address_or_range: An IP address or a range of IP addresses from which to accept + requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the account SAS. Possible + values include: "https,http", "https". + :type protocols: str or ~azure.mgmt.storage.v2021_06_01.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: ~datetime.datetime + :param shared_access_expiry_time: Required. The time at which the shared access signature + becomes invalid. + :type shared_access_expiry_time: ~datetime.datetime + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + """ + + _validation = { + 'services': {'required': True}, + 'resource_types': {'required': True}, + 'permissions': {'required': True}, + 'shared_access_expiry_time': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'signedServices', 'type': 'str'}, + 'resource_types': {'key': 'signedResourceTypes', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'str'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + } + + def __init__( + self, + *, + services: Union[str, "Services"], + resource_types: Union[str, "SignedResourceTypes"], + permissions: Union[str, "Permissions"], + shared_access_expiry_time: datetime.datetime, + ip_address_or_range: Optional[str] = None, + protocols: Optional[Union[str, "HttpProtocol"]] = None, + shared_access_start_time: Optional[datetime.datetime] = None, + key_to_sign: Optional[str] = None, + **kwargs + ): + super(AccountSasParameters, self).__init__(**kwargs) + self.services = services + self.resource_types = resource_types + self.permissions = permissions + self.ip_address_or_range = ip_address_or_range + self.protocols = protocols + self.shared_access_start_time = shared_access_start_time + self.shared_access_expiry_time = shared_access_expiry_time + self.key_to_sign = key_to_sign + + +class ActiveDirectoryProperties(msrest.serialization.Model): + """Settings properties for Active Directory (AD). + + All required parameters must be populated in order to send to Azure. + + :param domain_name: Required. Specifies the primary domain that the AD DNS server is + authoritative for. + :type domain_name: str + :param net_bios_domain_name: Required. Specifies the NetBIOS domain name. + :type net_bios_domain_name: str + :param forest_name: Required. Specifies the Active Directory forest to get. + :type forest_name: str + :param domain_guid: Required. Specifies the domain GUID. + :type domain_guid: str + :param domain_sid: Required. Specifies the security identifier (SID). + :type domain_sid: str + :param azure_storage_sid: Required. Specifies the security identifier (SID) for Azure Storage. + :type azure_storage_sid: str + """ + + _validation = { + 'domain_name': {'required': True}, + 'net_bios_domain_name': {'required': True}, + 'forest_name': {'required': True}, + 'domain_guid': {'required': True}, + 'domain_sid': {'required': True}, + 'azure_storage_sid': {'required': True}, + } + + _attribute_map = { + 'domain_name': {'key': 'domainName', 'type': 'str'}, + 'net_bios_domain_name': {'key': 'netBiosDomainName', 'type': 'str'}, + 'forest_name': {'key': 'forestName', 'type': 'str'}, + 'domain_guid': {'key': 'domainGuid', 'type': 'str'}, + 'domain_sid': {'key': 'domainSid', 'type': 'str'}, + 'azure_storage_sid': {'key': 'azureStorageSid', 'type': 'str'}, + } + + def __init__( + self, + *, + domain_name: str, + net_bios_domain_name: str, + forest_name: str, + domain_guid: str, + domain_sid: str, + azure_storage_sid: str, + **kwargs + ): + super(ActiveDirectoryProperties, self).__init__(**kwargs) + self.domain_name = domain_name + self.net_bios_domain_name = net_bios_domain_name + self.forest_name = forest_name + self.domain_guid = domain_guid + self.domain_sid = domain_sid + self.azure_storage_sid = azure_storage_sid + + +class Resource(msrest.serialization.Model): + """Common fields that are returned in the response for all Azure Resource Manager resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class AzureEntityResource(Resource): + """The resource model definition for an Azure Resource Manager resource with an etag. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureEntityResource, self).__init__(**kwargs) + self.etag = None + + +class AzureFilesIdentityBasedAuthentication(msrest.serialization.Model): + """Settings for Azure Files identity based authentication. + + All required parameters must be populated in order to send to Azure. + + :param directory_service_options: Required. Indicates the directory service used. Possible + values include: "None", "AADDS", "AD". + :type directory_service_options: str or + ~azure.mgmt.storage.v2021_06_01.models.DirectoryServiceOptions + :param active_directory_properties: Required if choose AD. + :type active_directory_properties: + ~azure.mgmt.storage.v2021_06_01.models.ActiveDirectoryProperties + :param default_share_permission: Default share permission for users using Kerberos + authentication if RBAC role is not assigned. Possible values include: "None", + "StorageFileDataSmbShareReader", "StorageFileDataSmbShareContributor", + "StorageFileDataSmbShareElevatedContributor". + :type default_share_permission: str or + ~azure.mgmt.storage.v2021_06_01.models.DefaultSharePermission + """ + + _validation = { + 'directory_service_options': {'required': True}, + } + + _attribute_map = { + 'directory_service_options': {'key': 'directoryServiceOptions', 'type': 'str'}, + 'active_directory_properties': {'key': 'activeDirectoryProperties', 'type': 'ActiveDirectoryProperties'}, + 'default_share_permission': {'key': 'defaultSharePermission', 'type': 'str'}, + } + + def __init__( + self, + *, + directory_service_options: Union[str, "DirectoryServiceOptions"], + active_directory_properties: Optional["ActiveDirectoryProperties"] = None, + default_share_permission: Optional[Union[str, "DefaultSharePermission"]] = None, + **kwargs + ): + super(AzureFilesIdentityBasedAuthentication, self).__init__(**kwargs) + self.directory_service_options = directory_service_options + self.active_directory_properties = active_directory_properties + self.default_share_permission = default_share_permission + + +class BlobContainer(AzureEntityResource): + """Properties of the blob container, including Id, resource name, resource type, Etag. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :ivar version: The version of the deleted blob container. + :vartype version: str + :ivar deleted: Indicates whether the blob container was deleted. + :vartype deleted: bool + :ivar deleted_time: Blob container deletion time. + :vartype deleted_time: ~datetime.datetime + :ivar remaining_retention_days: Remaining retention days for soft deleted blob container. + :vartype remaining_retention_days: int + :param default_encryption_scope: Default the container to use specified encryption scope for + all writes. + :type default_encryption_scope: str + :param deny_encryption_scope_override: Block override of encryption scope from the container + default. + :type deny_encryption_scope_override: bool + :param public_access: Specifies whether data in the container may be accessed publicly and the + level of access. Possible values include: "Container", "Blob", "None". + :type public_access: str or ~azure.mgmt.storage.v2021_06_01.models.PublicAccess + :ivar last_modified_time: Returns the date and time the container was last modified. + :vartype last_modified_time: ~datetime.datetime + :ivar lease_status: The lease status of the container. Possible values include: "Locked", + "Unlocked". + :vartype lease_status: str or ~azure.mgmt.storage.v2021_06_01.models.LeaseStatus + :ivar lease_state: Lease state of the container. Possible values include: "Available", + "Leased", "Expired", "Breaking", "Broken". + :vartype lease_state: str or ~azure.mgmt.storage.v2021_06_01.models.LeaseState + :ivar lease_duration: Specifies whether the lease on a container is of infinite or fixed + duration, only when the container is leased. Possible values include: "Infinite", "Fixed". + :vartype lease_duration: str or ~azure.mgmt.storage.v2021_06_01.models.LeaseDuration + :param metadata: A name-value pair to associate with the container as metadata. + :type metadata: dict[str, str] + :ivar immutability_policy: The ImmutabilityPolicy property of the container. + :vartype immutability_policy: + ~azure.mgmt.storage.v2021_06_01.models.ImmutabilityPolicyProperties + :ivar legal_hold: The LegalHold property of the container. + :vartype legal_hold: ~azure.mgmt.storage.v2021_06_01.models.LegalHoldProperties + :ivar has_legal_hold: The hasLegalHold public property is set to true by SRP if there are at + least one existing tag. The hasLegalHold public property is set to false by SRP if all existing + legal hold tags are cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :ivar has_immutability_policy: The hasImmutabilityPolicy public property is set to true by SRP + if ImmutabilityPolicy has been created for this container. The hasImmutabilityPolicy public + property is set to false by SRP if ImmutabilityPolicy has not been created for this container. + :vartype has_immutability_policy: bool + :param immutable_storage_with_versioning: The object level immutability property of the + container. The property is immutable and can only be set to true at the container creation + time. Existing containers must undergo a migration process. + :type immutable_storage_with_versioning: + ~azure.mgmt.storage.v2021_06_01.models.ImmutableStorageWithVersioning + :param enable_nfs_v3_root_squash: Enable NFSv3 root squash on blob container. + :type enable_nfs_v3_root_squash: bool + :param enable_nfs_v3_all_squash: Enable NFSv3 all squash on blob container. + :type enable_nfs_v3_all_squash: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'version': {'readonly': True}, + 'deleted': {'readonly': True}, + 'deleted_time': {'readonly': True}, + 'remaining_retention_days': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'lease_status': {'readonly': True}, + 'lease_state': {'readonly': True}, + 'lease_duration': {'readonly': True}, + 'immutability_policy': {'readonly': True}, + 'legal_hold': {'readonly': True}, + 'has_legal_hold': {'readonly': True}, + 'has_immutability_policy': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'deleted': {'key': 'properties.deleted', 'type': 'bool'}, + 'deleted_time': {'key': 'properties.deletedTime', 'type': 'iso-8601'}, + 'remaining_retention_days': {'key': 'properties.remainingRetentionDays', 'type': 'int'}, + 'default_encryption_scope': {'key': 'properties.defaultEncryptionScope', 'type': 'str'}, + 'deny_encryption_scope_override': {'key': 'properties.denyEncryptionScopeOverride', 'type': 'bool'}, + 'public_access': {'key': 'properties.publicAccess', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, + 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, + 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'immutability_policy': {'key': 'properties.immutabilityPolicy', 'type': 'ImmutabilityPolicyProperties'}, + 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, + 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, + 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, + 'immutable_storage_with_versioning': {'key': 'properties.immutableStorageWithVersioning', 'type': 'ImmutableStorageWithVersioning'}, + 'enable_nfs_v3_root_squash': {'key': 'properties.enableNfsV3RootSquash', 'type': 'bool'}, + 'enable_nfs_v3_all_squash': {'key': 'properties.enableNfsV3AllSquash', 'type': 'bool'}, + } + + def __init__( + self, + *, + default_encryption_scope: Optional[str] = None, + deny_encryption_scope_override: Optional[bool] = None, + public_access: Optional[Union[str, "PublicAccess"]] = None, + metadata: Optional[Dict[str, str]] = None, + immutable_storage_with_versioning: Optional["ImmutableStorageWithVersioning"] = None, + enable_nfs_v3_root_squash: Optional[bool] = None, + enable_nfs_v3_all_squash: Optional[bool] = None, + **kwargs + ): + super(BlobContainer, self).__init__(**kwargs) + self.version = None + self.deleted = None + self.deleted_time = None + self.remaining_retention_days = None + self.default_encryption_scope = default_encryption_scope + self.deny_encryption_scope_override = deny_encryption_scope_override + self.public_access = public_access + self.last_modified_time = None + self.lease_status = None + self.lease_state = None + self.lease_duration = None + self.metadata = metadata + self.immutability_policy = None + self.legal_hold = None + self.has_legal_hold = None + self.has_immutability_policy = None + self.immutable_storage_with_versioning = immutable_storage_with_versioning + self.enable_nfs_v3_root_squash = enable_nfs_v3_root_squash + self.enable_nfs_v3_all_squash = enable_nfs_v3_all_squash + + +class BlobInventoryPolicy(Resource): + """The storage account blob inventory policy. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.storage.v2021_06_01.models.SystemData + :ivar last_modified_time: Returns the last modified date and time of the blob inventory policy. + :vartype last_modified_time: ~datetime.datetime + :param policy: The storage account blob inventory policy object. It is composed of policy + rules. + :type policy: ~azure.mgmt.storage.v2021_06_01.models.BlobInventoryPolicySchema + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'policy': {'key': 'properties.policy', 'type': 'BlobInventoryPolicySchema'}, + } + + def __init__( + self, + *, + policy: Optional["BlobInventoryPolicySchema"] = None, + **kwargs + ): + super(BlobInventoryPolicy, self).__init__(**kwargs) + self.system_data = None + self.last_modified_time = None + self.policy = policy + + +class BlobInventoryPolicyDefinition(msrest.serialization.Model): + """An object that defines the blob inventory rule. + + All required parameters must be populated in order to send to Azure. + + :param filters: An object that defines the filter set. + :type filters: ~azure.mgmt.storage.v2021_06_01.models.BlobInventoryPolicyFilter + :param format: Required. This is a required field, it specifies the format for the inventory + files. Possible values include: "Csv", "Parquet". + :type format: str or ~azure.mgmt.storage.v2021_06_01.models.Format + :param schedule: Required. This is a required field. This field is used to schedule an + inventory formation. Possible values include: "Daily", "Weekly". + :type schedule: str or ~azure.mgmt.storage.v2021_06_01.models.Schedule + :param object_type: Required. This is a required field. This field specifies the scope of the + inventory created either at the blob or container level. Possible values include: "Blob", + "Container". + :type object_type: str or ~azure.mgmt.storage.v2021_06_01.models.ObjectType + :param schema_fields: Required. This is a required field. This field specifies the fields and + properties of the object to be included in the inventory. The Schema field value 'Name' is + always required. The valid values for this field for the 'Blob' definition.objectType include + 'Name, Creation-Time, Last-Modified, Content-Length, Content-MD5, BlobType, AccessTier, + AccessTierChangeTime, AccessTierInferred, Tags, Expiry-Time, hdi_isfolder, Owner, Group, + Permissions, Acl, Snapshot, VersionId, IsCurrentVersion, Metadata, LastAccessTime'. The valid + values for 'Container' definition.objectType include 'Name, Last-Modified, Metadata, + LeaseStatus, LeaseState, LeaseDuration, PublicAccess, HasImmutabilityPolicy, HasLegalHold'. + Schema field values 'Expiry-Time, hdi_isfolder, Owner, Group, Permissions, Acl' are valid only + for Hns enabled accounts.'Tags' field is only valid for non Hns accounts. + :type schema_fields: list[str] + """ + + _validation = { + 'format': {'required': True}, + 'schedule': {'required': True}, + 'object_type': {'required': True}, + 'schema_fields': {'required': True}, + } + + _attribute_map = { + 'filters': {'key': 'filters', 'type': 'BlobInventoryPolicyFilter'}, + 'format': {'key': 'format', 'type': 'str'}, + 'schedule': {'key': 'schedule', 'type': 'str'}, + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'schema_fields': {'key': 'schemaFields', 'type': '[str]'}, + } + + def __init__( + self, + *, + format: Union[str, "Format"], + schedule: Union[str, "Schedule"], + object_type: Union[str, "ObjectType"], + schema_fields: List[str], + filters: Optional["BlobInventoryPolicyFilter"] = None, + **kwargs + ): + super(BlobInventoryPolicyDefinition, self).__init__(**kwargs) + self.filters = filters + self.format = format + self.schedule = schedule + self.object_type = object_type + self.schema_fields = schema_fields + + +class BlobInventoryPolicyFilter(msrest.serialization.Model): + """An object that defines the blob inventory rule filter conditions. For 'Blob' definition.objectType all filter properties are applicable, 'blobTypes' is required and others are optional. For 'Container' definition.objectType only prefixMatch is applicable and is optional. + + :param prefix_match: An array of strings for blob prefixes to be matched. + :type prefix_match: list[str] + :param blob_types: An array of predefined enum values. Valid values include blockBlob, + appendBlob, pageBlob. Hns accounts does not support pageBlobs. This field is required when + definition.objectType property is set to 'Blob'. + :type blob_types: list[str] + :param include_blob_versions: Includes blob versions in blob inventory when value is set to + true. The definition.schemaFields values 'VersionId and IsCurrentVersion' are required if this + property is set to true, else they must be excluded. + :type include_blob_versions: bool + :param include_snapshots: Includes blob snapshots in blob inventory when value is set to true. + The definition.schemaFields value 'Snapshot' is required if this property is set to true, else + it must be excluded. + :type include_snapshots: bool + """ + + _attribute_map = { + 'prefix_match': {'key': 'prefixMatch', 'type': '[str]'}, + 'blob_types': {'key': 'blobTypes', 'type': '[str]'}, + 'include_blob_versions': {'key': 'includeBlobVersions', 'type': 'bool'}, + 'include_snapshots': {'key': 'includeSnapshots', 'type': 'bool'}, + } + + def __init__( + self, + *, + prefix_match: Optional[List[str]] = None, + blob_types: Optional[List[str]] = None, + include_blob_versions: Optional[bool] = None, + include_snapshots: Optional[bool] = None, + **kwargs + ): + super(BlobInventoryPolicyFilter, self).__init__(**kwargs) + self.prefix_match = prefix_match + self.blob_types = blob_types + self.include_blob_versions = include_blob_versions + self.include_snapshots = include_snapshots + + +class BlobInventoryPolicyRule(msrest.serialization.Model): + """An object that wraps the blob inventory rule. Each rule is uniquely defined by name. + + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. Rule is enabled when set to true. + :type enabled: bool + :param name: Required. A rule name can contain any combination of alpha numeric characters. + Rule name is case-sensitive. It must be unique within a policy. + :type name: str + :param destination: Required. Container name where blob inventory files are stored. Must be + pre-created. + :type destination: str + :param definition: Required. An object that defines the blob inventory policy rule. + :type definition: ~azure.mgmt.storage.v2021_06_01.models.BlobInventoryPolicyDefinition + """ + + _validation = { + 'enabled': {'required': True}, + 'name': {'required': True}, + 'destination': {'required': True}, + 'definition': {'required': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'destination': {'key': 'destination', 'type': 'str'}, + 'definition': {'key': 'definition', 'type': 'BlobInventoryPolicyDefinition'}, + } + + def __init__( + self, + *, + enabled: bool, + name: str, + destination: str, + definition: "BlobInventoryPolicyDefinition", + **kwargs + ): + super(BlobInventoryPolicyRule, self).__init__(**kwargs) + self.enabled = enabled + self.name = name + self.destination = destination + self.definition = definition + + +class BlobInventoryPolicySchema(msrest.serialization.Model): + """The storage account blob inventory policy rules. + + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. Policy is enabled if set to true. + :type enabled: bool + :param type: Required. The valid value is Inventory. Possible values include: "Inventory". + :type type: str or ~azure.mgmt.storage.v2021_06_01.models.InventoryRuleType + :param rules: Required. The storage account blob inventory policy rules. The rule is applied + when it is enabled. + :type rules: list[~azure.mgmt.storage.v2021_06_01.models.BlobInventoryPolicyRule] + """ + + _validation = { + 'enabled': {'required': True}, + 'type': {'required': True}, + 'rules': {'required': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'type': {'key': 'type', 'type': 'str'}, + 'rules': {'key': 'rules', 'type': '[BlobInventoryPolicyRule]'}, + } + + def __init__( + self, + *, + enabled: bool, + type: Union[str, "InventoryRuleType"], + rules: List["BlobInventoryPolicyRule"], + **kwargs + ): + super(BlobInventoryPolicySchema, self).__init__(**kwargs) + self.enabled = enabled + self.type = type + self.rules = rules + + +class BlobRestoreParameters(msrest.serialization.Model): + """Blob restore parameters. + + All required parameters must be populated in order to send to Azure. + + :param time_to_restore: Required. Restore blob to the specified time. + :type time_to_restore: ~datetime.datetime + :param blob_ranges: Required. Blob ranges to restore. + :type blob_ranges: list[~azure.mgmt.storage.v2021_06_01.models.BlobRestoreRange] + """ + + _validation = { + 'time_to_restore': {'required': True}, + 'blob_ranges': {'required': True}, + } + + _attribute_map = { + 'time_to_restore': {'key': 'timeToRestore', 'type': 'iso-8601'}, + 'blob_ranges': {'key': 'blobRanges', 'type': '[BlobRestoreRange]'}, + } + + def __init__( + self, + *, + time_to_restore: datetime.datetime, + blob_ranges: List["BlobRestoreRange"], + **kwargs + ): + super(BlobRestoreParameters, self).__init__(**kwargs) + self.time_to_restore = time_to_restore + self.blob_ranges = blob_ranges + + +class BlobRestoreRange(msrest.serialization.Model): + """Blob range. + + All required parameters must be populated in order to send to Azure. + + :param start_range: Required. Blob start range. This is inclusive. Empty means account start. + :type start_range: str + :param end_range: Required. Blob end range. This is exclusive. Empty means account end. + :type end_range: str + """ + + _validation = { + 'start_range': {'required': True}, + 'end_range': {'required': True}, + } + + _attribute_map = { + 'start_range': {'key': 'startRange', 'type': 'str'}, + 'end_range': {'key': 'endRange', 'type': 'str'}, + } + + def __init__( + self, + *, + start_range: str, + end_range: str, + **kwargs + ): + super(BlobRestoreRange, self).__init__(**kwargs) + self.start_range = start_range + self.end_range = end_range + + +class BlobRestoreStatus(msrest.serialization.Model): + """Blob restore status. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar status: The status of blob restore progress. Possible values are: - InProgress: Indicates + that blob restore is ongoing. - Complete: Indicates that blob restore has been completed + successfully. - Failed: Indicates that blob restore is failed. Possible values include: + "InProgress", "Complete", "Failed". + :vartype status: str or ~azure.mgmt.storage.v2021_06_01.models.BlobRestoreProgressStatus + :ivar failure_reason: Failure reason when blob restore is failed. + :vartype failure_reason: str + :ivar restore_id: Id for tracking blob restore request. + :vartype restore_id: str + :ivar parameters: Blob restore request parameters. + :vartype parameters: ~azure.mgmt.storage.v2021_06_01.models.BlobRestoreParameters + """ + + _validation = { + 'status': {'readonly': True}, + 'failure_reason': {'readonly': True}, + 'restore_id': {'readonly': True}, + 'parameters': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'failure_reason': {'key': 'failureReason', 'type': 'str'}, + 'restore_id': {'key': 'restoreId', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'BlobRestoreParameters'}, + } + + def __init__( + self, + **kwargs + ): + super(BlobRestoreStatus, self).__init__(**kwargs) + self.status = None + self.failure_reason = None + self.restore_id = None + self.parameters = None + + +class BlobServiceItems(msrest.serialization.Model): + """BlobServiceItems. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of blob services returned. + :vartype value: list[~azure.mgmt.storage.v2021_06_01.models.BlobServiceProperties] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BlobServiceProperties]'}, + } + + def __init__( + self, + **kwargs + ): + super(BlobServiceItems, self).__init__(**kwargs) + self.value = None + + +class BlobServiceProperties(Resource): + """The properties of a storage account’s Blob service. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar sku: Sku name and tier. + :vartype sku: ~azure.mgmt.storage.v2021_06_01.models.Sku + :param cors: Specifies CORS rules for the Blob service. You can include up to five CorsRule + elements in the request. If no CorsRule elements are included in the request body, all CORS + rules will be deleted, and CORS will be disabled for the Blob service. + :type cors: ~azure.mgmt.storage.v2021_06_01.models.CorsRules + :param default_service_version: DefaultServiceVersion indicates the default version to use for + requests to the Blob service if an incoming request’s version is not specified. Possible values + include version 2008-10-27 and all more recent versions. + :type default_service_version: str + :param delete_retention_policy: The blob service properties for blob soft delete. + :type delete_retention_policy: ~azure.mgmt.storage.v2021_06_01.models.DeleteRetentionPolicy + :param is_versioning_enabled: Versioning is enabled if set to true. + :type is_versioning_enabled: bool + :param automatic_snapshot_policy_enabled: Deprecated in favor of isVersioningEnabled property. + :type automatic_snapshot_policy_enabled: bool + :param change_feed: The blob service properties for change feed events. + :type change_feed: ~azure.mgmt.storage.v2021_06_01.models.ChangeFeed + :param restore_policy: The blob service properties for blob restore policy. + :type restore_policy: ~azure.mgmt.storage.v2021_06_01.models.RestorePolicyProperties + :param container_delete_retention_policy: The blob service properties for container soft + delete. + :type container_delete_retention_policy: + ~azure.mgmt.storage.v2021_06_01.models.DeleteRetentionPolicy + :param last_access_time_tracking_policy: The blob service property to configure last access + time based tracking policy. + :type last_access_time_tracking_policy: + ~azure.mgmt.storage.v2021_06_01.models.LastAccessTimeTrackingPolicy + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'sku': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'cors': {'key': 'properties.cors', 'type': 'CorsRules'}, + 'default_service_version': {'key': 'properties.defaultServiceVersion', 'type': 'str'}, + 'delete_retention_policy': {'key': 'properties.deleteRetentionPolicy', 'type': 'DeleteRetentionPolicy'}, + 'is_versioning_enabled': {'key': 'properties.isVersioningEnabled', 'type': 'bool'}, + 'automatic_snapshot_policy_enabled': {'key': 'properties.automaticSnapshotPolicyEnabled', 'type': 'bool'}, + 'change_feed': {'key': 'properties.changeFeed', 'type': 'ChangeFeed'}, + 'restore_policy': {'key': 'properties.restorePolicy', 'type': 'RestorePolicyProperties'}, + 'container_delete_retention_policy': {'key': 'properties.containerDeleteRetentionPolicy', 'type': 'DeleteRetentionPolicy'}, + 'last_access_time_tracking_policy': {'key': 'properties.lastAccessTimeTrackingPolicy', 'type': 'LastAccessTimeTrackingPolicy'}, + } + + def __init__( + self, + *, + cors: Optional["CorsRules"] = None, + default_service_version: Optional[str] = None, + delete_retention_policy: Optional["DeleteRetentionPolicy"] = None, + is_versioning_enabled: Optional[bool] = None, + automatic_snapshot_policy_enabled: Optional[bool] = None, + change_feed: Optional["ChangeFeed"] = None, + restore_policy: Optional["RestorePolicyProperties"] = None, + container_delete_retention_policy: Optional["DeleteRetentionPolicy"] = None, + last_access_time_tracking_policy: Optional["LastAccessTimeTrackingPolicy"] = None, + **kwargs + ): + super(BlobServiceProperties, self).__init__(**kwargs) + self.sku = None + self.cors = cors + self.default_service_version = default_service_version + self.delete_retention_policy = delete_retention_policy + self.is_versioning_enabled = is_versioning_enabled + self.automatic_snapshot_policy_enabled = automatic_snapshot_policy_enabled + self.change_feed = change_feed + self.restore_policy = restore_policy + self.container_delete_retention_policy = container_delete_retention_policy + self.last_access_time_tracking_policy = last_access_time_tracking_policy + + +class ChangeFeed(msrest.serialization.Model): + """The blob service properties for change feed events. + + :param enabled: Indicates whether change feed event logging is enabled for the Blob service. + :type enabled: bool + :param retention_in_days: Indicates the duration of changeFeed retention in days. Minimum value + is 1 day and maximum value is 146000 days (400 years). A null value indicates an infinite + retention of the change feed. + :type retention_in_days: int + """ + + _validation = { + 'retention_in_days': {'maximum': 146000, 'minimum': 1}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'retention_in_days': {'key': 'retentionInDays', 'type': 'int'}, + } + + def __init__( + self, + *, + enabled: Optional[bool] = None, + retention_in_days: Optional[int] = None, + **kwargs + ): + super(ChangeFeed, self).__init__(**kwargs) + self.enabled = enabled + self.retention_in_days = retention_in_days + + +class CheckNameAvailabilityResult(msrest.serialization.Model): + """The CheckNameAvailability operation response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name_available: Gets a boolean value that indicates whether the name is available for you + to use. If true, the name is available. If false, the name has already been taken or is invalid + and cannot be used. + :vartype name_available: bool + :ivar reason: Gets the reason that a storage account name could not be used. The Reason element + is only returned if NameAvailable is false. Possible values include: "AccountNameInvalid", + "AlreadyExists". + :vartype reason: str or ~azure.mgmt.storage.v2021_06_01.models.Reason + :ivar message: Gets an error message explaining the Reason value in more detail. + :vartype message: str + """ + + _validation = { + 'name_available': {'readonly': True}, + 'reason': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.name_available = None + self.reason = None + self.message = None + + +class CloudErrorAutoGenerated(msrest.serialization.Model): + """An error response from the Storage service. + + :param error: An error response from the Storage service. + :type error: ~azure.mgmt.storage.v2021_06_01.models.CloudErrorBodyAutoGenerated + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'CloudErrorBodyAutoGenerated'}, + } + + def __init__( + self, + *, + error: Optional["CloudErrorBodyAutoGenerated"] = None, + **kwargs + ): + super(CloudErrorAutoGenerated, self).__init__(**kwargs) + self.error = error + + +class CloudErrorBody(msrest.serialization.Model): + """An error response from the Storage service. + + :param code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable for display in a user + interface. + :type message: str + :param target: The target of the particular error. For example, the name of the property in + error. + :type target: str + :param details: A list of additional details about the error. + :type details: list[~azure.mgmt.storage.v2021_06_01.models.CloudErrorBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + target: Optional[str] = None, + details: Optional[List["CloudErrorBody"]] = None, + **kwargs + ): + super(CloudErrorBody, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + + +class CloudErrorBodyAutoGenerated(msrest.serialization.Model): + """An error response from the Storage service. + + :param code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable for display in a user + interface. + :type message: str + :param target: The target of the particular error. For example, the name of the property in + error. + :type target: str + :param details: A list of additional details about the error. + :type details: list[~azure.mgmt.storage.v2021_06_01.models.CloudErrorBodyAutoGenerated] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudErrorBodyAutoGenerated]'}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + target: Optional[str] = None, + details: Optional[List["CloudErrorBodyAutoGenerated"]] = None, + **kwargs + ): + super(CloudErrorBodyAutoGenerated, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + + +class CorsRule(msrest.serialization.Model): + """Specifies a CORS rule for the Blob service. + + All required parameters must be populated in order to send to Azure. + + :param allowed_origins: Required. Required if CorsRule element is present. A list of origin + domains that will be allowed via CORS, or "*" to allow all domains. + :type allowed_origins: list[str] + :param allowed_methods: Required. Required if CorsRule element is present. A list of HTTP + methods that are allowed to be executed by the origin. + :type allowed_methods: list[str or + ~azure.mgmt.storage.v2021_06_01.models.CorsRuleAllowedMethodsItem] + :param max_age_in_seconds: Required. Required if CorsRule element is present. The number of + seconds that the client/browser should cache a preflight response. + :type max_age_in_seconds: int + :param exposed_headers: Required. Required if CorsRule element is present. A list of response + headers to expose to CORS clients. + :type exposed_headers: list[str] + :param allowed_headers: Required. Required if CorsRule element is present. A list of headers + allowed to be part of the cross-origin request. + :type allowed_headers: list[str] + """ + + _validation = { + 'allowed_origins': {'required': True}, + 'allowed_methods': {'required': True}, + 'max_age_in_seconds': {'required': True}, + 'exposed_headers': {'required': True}, + 'allowed_headers': {'required': True}, + } + + _attribute_map = { + 'allowed_origins': {'key': 'allowedOrigins', 'type': '[str]'}, + 'allowed_methods': {'key': 'allowedMethods', 'type': '[str]'}, + 'max_age_in_seconds': {'key': 'maxAgeInSeconds', 'type': 'int'}, + 'exposed_headers': {'key': 'exposedHeaders', 'type': '[str]'}, + 'allowed_headers': {'key': 'allowedHeaders', 'type': '[str]'}, + } + + def __init__( + self, + *, + allowed_origins: List[str], + allowed_methods: List[Union[str, "CorsRuleAllowedMethodsItem"]], + max_age_in_seconds: int, + exposed_headers: List[str], + allowed_headers: List[str], + **kwargs + ): + super(CorsRule, self).__init__(**kwargs) + self.allowed_origins = allowed_origins + self.allowed_methods = allowed_methods + self.max_age_in_seconds = max_age_in_seconds + self.exposed_headers = exposed_headers + self.allowed_headers = allowed_headers + + +class CorsRules(msrest.serialization.Model): + """Sets the CORS rules. You can include up to five CorsRule elements in the request. + + :param cors_rules: The List of CORS rules. You can include up to five CorsRule elements in the + request. + :type cors_rules: list[~azure.mgmt.storage.v2021_06_01.models.CorsRule] + """ + + _attribute_map = { + 'cors_rules': {'key': 'corsRules', 'type': '[CorsRule]'}, + } + + def __init__( + self, + *, + cors_rules: Optional[List["CorsRule"]] = None, + **kwargs + ): + super(CorsRules, self).__init__(**kwargs) + self.cors_rules = cors_rules + + +class CustomDomain(msrest.serialization.Model): + """The custom domain assigned to this storage account. This can be set via Update. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the custom domain name assigned to the storage account. + Name is the CNAME source. + :type name: str + :param use_sub_domain_name: Indicates whether indirect CName validation is enabled. Default + value is false. This should only be set on updates. + :type use_sub_domain_name: bool + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'use_sub_domain_name': {'key': 'useSubDomainName', 'type': 'bool'}, + } + + def __init__( + self, + *, + name: str, + use_sub_domain_name: Optional[bool] = None, + **kwargs + ): + super(CustomDomain, self).__init__(**kwargs) + self.name = name + self.use_sub_domain_name = use_sub_domain_name + + +class DateAfterCreation(msrest.serialization.Model): + """Object to define the number of days after creation. + + All required parameters must be populated in order to send to Azure. + + :param days_after_creation_greater_than: Required. Value indicating the age in days after + creation. + :type days_after_creation_greater_than: float + """ + + _validation = { + 'days_after_creation_greater_than': {'required': True, 'minimum': 0, 'multiple': 1}, + } + + _attribute_map = { + 'days_after_creation_greater_than': {'key': 'daysAfterCreationGreaterThan', 'type': 'float'}, + } + + def __init__( + self, + *, + days_after_creation_greater_than: float, + **kwargs + ): + super(DateAfterCreation, self).__init__(**kwargs) + self.days_after_creation_greater_than = days_after_creation_greater_than + + +class DateAfterModification(msrest.serialization.Model): + """Object to define the number of days after object last modification Or last access. Properties daysAfterModificationGreaterThan and daysAfterLastAccessTimeGreaterThan are mutually exclusive. + + :param days_after_modification_greater_than: Value indicating the age in days after last + modification. + :type days_after_modification_greater_than: float + :param days_after_last_access_time_greater_than: Value indicating the age in days after last + blob access. This property can only be used in conjunction with last access time tracking + policy. + :type days_after_last_access_time_greater_than: float + """ + + _validation = { + 'days_after_modification_greater_than': {'minimum': 0, 'multiple': 1}, + 'days_after_last_access_time_greater_than': {'minimum': 0, 'multiple': 1}, + } + + _attribute_map = { + 'days_after_modification_greater_than': {'key': 'daysAfterModificationGreaterThan', 'type': 'float'}, + 'days_after_last_access_time_greater_than': {'key': 'daysAfterLastAccessTimeGreaterThan', 'type': 'float'}, + } + + def __init__( + self, + *, + days_after_modification_greater_than: Optional[float] = None, + days_after_last_access_time_greater_than: Optional[float] = None, + **kwargs + ): + super(DateAfterModification, self).__init__(**kwargs) + self.days_after_modification_greater_than = days_after_modification_greater_than + self.days_after_last_access_time_greater_than = days_after_last_access_time_greater_than + + +class ProxyResource(Resource): + """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProxyResource, self).__init__(**kwargs) + + +class DeletedAccount(ProxyResource): + """Deleted storage account. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar storage_account_resource_id: Full resource id of the original storage account. + :vartype storage_account_resource_id: str + :ivar location: Location of the deleted account. + :vartype location: str + :ivar restore_reference: Can be used to attempt recovering this deleted account via + PutStorageAccount API. + :vartype restore_reference: str + :ivar creation_time: Creation time of the deleted account. + :vartype creation_time: str + :ivar deletion_time: Deletion time of the deleted account. + :vartype deletion_time: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'storage_account_resource_id': {'readonly': True}, + 'location': {'readonly': True}, + 'restore_reference': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'deletion_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'storage_account_resource_id': {'key': 'properties.storageAccountResourceId', 'type': 'str'}, + 'location': {'key': 'properties.location', 'type': 'str'}, + 'restore_reference': {'key': 'properties.restoreReference', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'str'}, + 'deletion_time': {'key': 'properties.deletionTime', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DeletedAccount, self).__init__(**kwargs) + self.storage_account_resource_id = None + self.location = None + self.restore_reference = None + self.creation_time = None + self.deletion_time = None + + +class DeletedAccountListResult(msrest.serialization.Model): + """The response from the List Deleted Accounts operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: Gets the list of deleted accounts and their properties. + :vartype value: list[~azure.mgmt.storage.v2021_06_01.models.DeletedAccount] + :ivar next_link: Request URL that can be used to query next page of deleted accounts. Returned + when total number of requested deleted accounts exceed maximum page size. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DeletedAccount]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DeletedAccountListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class DeletedShare(msrest.serialization.Model): + """The deleted share to be restored. + + All required parameters must be populated in order to send to Azure. + + :param deleted_share_name: Required. Required. Identify the name of the deleted share that will + be restored. + :type deleted_share_name: str + :param deleted_share_version: Required. Required. Identify the version of the deleted share + that will be restored. + :type deleted_share_version: str + """ + + _validation = { + 'deleted_share_name': {'required': True}, + 'deleted_share_version': {'required': True}, + } + + _attribute_map = { + 'deleted_share_name': {'key': 'deletedShareName', 'type': 'str'}, + 'deleted_share_version': {'key': 'deletedShareVersion', 'type': 'str'}, + } + + def __init__( + self, + *, + deleted_share_name: str, + deleted_share_version: str, + **kwargs + ): + super(DeletedShare, self).__init__(**kwargs) + self.deleted_share_name = deleted_share_name + self.deleted_share_version = deleted_share_version + + +class DeleteRetentionPolicy(msrest.serialization.Model): + """The service properties for soft delete. + + :param enabled: Indicates whether DeleteRetentionPolicy is enabled. + :type enabled: bool + :param days: Indicates the number of days that the deleted item should be retained. The minimum + specified value can be 1 and the maximum value can be 365. + :type days: int + """ + + _validation = { + 'days': {'maximum': 365, 'minimum': 1}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'days': {'key': 'days', 'type': 'int'}, + } + + def __init__( + self, + *, + enabled: Optional[bool] = None, + days: Optional[int] = None, + **kwargs + ): + super(DeleteRetentionPolicy, self).__init__(**kwargs) + self.enabled = enabled + self.days = days + + +class Dimension(msrest.serialization.Model): + """Dimension of blobs, possibly be blob type or access tier. + + :param name: Display name of dimension. + :type name: str + :param display_name: Display name of dimension. + :type display_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display_name: Optional[str] = None, + **kwargs + ): + super(Dimension, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + + +class Encryption(msrest.serialization.Model): + """The encryption settings on the storage account. + + All required parameters must be populated in order to send to Azure. + + :param services: List of services which support encryption. + :type services: ~azure.mgmt.storage.v2021_06_01.models.EncryptionServices + :param key_source: Required. The encryption keySource (provider). Possible values + (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. Possible values include: + "Microsoft.Storage", "Microsoft.Keyvault". Default value: "Microsoft.Storage". + :type key_source: str or ~azure.mgmt.storage.v2021_06_01.models.KeySource + :param require_infrastructure_encryption: A boolean indicating whether or not the service + applies a secondary layer of encryption with platform managed keys for data at rest. + :type require_infrastructure_encryption: bool + :param key_vault_properties: Properties provided by key vault. + :type key_vault_properties: ~azure.mgmt.storage.v2021_06_01.models.KeyVaultProperties + :param encryption_identity: The identity to be used with service-side encryption at rest. + :type encryption_identity: ~azure.mgmt.storage.v2021_06_01.models.EncryptionIdentity + """ + + _validation = { + 'key_source': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'services', 'type': 'EncryptionServices'}, + 'key_source': {'key': 'keySource', 'type': 'str'}, + 'require_infrastructure_encryption': {'key': 'requireInfrastructureEncryption', 'type': 'bool'}, + 'key_vault_properties': {'key': 'keyvaultproperties', 'type': 'KeyVaultProperties'}, + 'encryption_identity': {'key': 'identity', 'type': 'EncryptionIdentity'}, + } + + def __init__( + self, + *, + key_source: Union[str, "KeySource"] = "Microsoft.Storage", + services: Optional["EncryptionServices"] = None, + require_infrastructure_encryption: Optional[bool] = None, + key_vault_properties: Optional["KeyVaultProperties"] = None, + encryption_identity: Optional["EncryptionIdentity"] = None, + **kwargs + ): + super(Encryption, self).__init__(**kwargs) + self.services = services + self.key_source = key_source + self.require_infrastructure_encryption = require_infrastructure_encryption + self.key_vault_properties = key_vault_properties + self.encryption_identity = encryption_identity + + +class EncryptionIdentity(msrest.serialization.Model): + """Encryption identity for the storage account. + + :param encryption_user_assigned_identity: Resource identifier of the UserAssigned identity to + be associated with server-side encryption on the storage account. + :type encryption_user_assigned_identity: str + """ + + _attribute_map = { + 'encryption_user_assigned_identity': {'key': 'userAssignedIdentity', 'type': 'str'}, + } + + def __init__( + self, + *, + encryption_user_assigned_identity: Optional[str] = None, + **kwargs + ): + super(EncryptionIdentity, self).__init__(**kwargs) + self.encryption_user_assigned_identity = encryption_user_assigned_identity + + +class EncryptionScope(Resource): + """The Encryption Scope resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param source: The provider for the encryption scope. Possible values (case-insensitive): + Microsoft.Storage, Microsoft.KeyVault. Possible values include: "Microsoft.Storage", + "Microsoft.KeyVault". + :type source: str or ~azure.mgmt.storage.v2021_06_01.models.EncryptionScopeSource + :param state: The state of the encryption scope. Possible values (case-insensitive): Enabled, + Disabled. Possible values include: "Enabled", "Disabled". + :type state: str or ~azure.mgmt.storage.v2021_06_01.models.EncryptionScopeState + :ivar creation_time: Gets the creation date and time of the encryption scope in UTC. + :vartype creation_time: ~datetime.datetime + :ivar last_modified_time: Gets the last modification date and time of the encryption scope in + UTC. + :vartype last_modified_time: ~datetime.datetime + :param key_vault_properties: The key vault properties for the encryption scope. This is a + required field if encryption scope 'source' attribute is set to 'Microsoft.KeyVault'. + :type key_vault_properties: + ~azure.mgmt.storage.v2021_06_01.models.EncryptionScopeKeyVaultProperties + :param require_infrastructure_encryption: A boolean indicating whether or not the service + applies a secondary layer of encryption with platform managed keys for data at rest. + :type require_infrastructure_encryption: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'source': {'key': 'properties.source', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'key_vault_properties': {'key': 'properties.keyVaultProperties', 'type': 'EncryptionScopeKeyVaultProperties'}, + 'require_infrastructure_encryption': {'key': 'properties.requireInfrastructureEncryption', 'type': 'bool'}, + } + + def __init__( + self, + *, + source: Optional[Union[str, "EncryptionScopeSource"]] = None, + state: Optional[Union[str, "EncryptionScopeState"]] = None, + key_vault_properties: Optional["EncryptionScopeKeyVaultProperties"] = None, + require_infrastructure_encryption: Optional[bool] = None, + **kwargs + ): + super(EncryptionScope, self).__init__(**kwargs) + self.source = source + self.state = state + self.creation_time = None + self.last_modified_time = None + self.key_vault_properties = key_vault_properties + self.require_infrastructure_encryption = require_infrastructure_encryption + + +class EncryptionScopeKeyVaultProperties(msrest.serialization.Model): + """The key vault properties for the encryption scope. This is a required field if encryption scope 'source' attribute is set to 'Microsoft.KeyVault'. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param key_uri: The object identifier for a key vault key object. When applied, the encryption + scope will use the key referenced by the identifier to enable customer-managed key support on + this encryption scope. + :type key_uri: str + :ivar current_versioned_key_identifier: The object identifier of the current versioned Key + Vault Key in use. + :vartype current_versioned_key_identifier: str + :ivar last_key_rotation_timestamp: Timestamp of last rotation of the Key Vault Key. + :vartype last_key_rotation_timestamp: ~datetime.datetime + """ + + _validation = { + 'current_versioned_key_identifier': {'readonly': True}, + 'last_key_rotation_timestamp': {'readonly': True}, + } + + _attribute_map = { + 'key_uri': {'key': 'keyUri', 'type': 'str'}, + 'current_versioned_key_identifier': {'key': 'currentVersionedKeyIdentifier', 'type': 'str'}, + 'last_key_rotation_timestamp': {'key': 'lastKeyRotationTimestamp', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + key_uri: Optional[str] = None, + **kwargs + ): + super(EncryptionScopeKeyVaultProperties, self).__init__(**kwargs) + self.key_uri = key_uri + self.current_versioned_key_identifier = None + self.last_key_rotation_timestamp = None + + +class EncryptionScopeListResult(msrest.serialization.Model): + """List of encryption scopes requested, and if paging is required, a URL to the next page of encryption scopes. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of encryption scopes requested. + :vartype value: list[~azure.mgmt.storage.v2021_06_01.models.EncryptionScope] + :ivar next_link: Request URL that can be used to query next page of encryption scopes. Returned + when total number of requested encryption scopes exceeds the maximum page size. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[EncryptionScope]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EncryptionScopeListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class EncryptionService(msrest.serialization.Model): + """A service that allows server-side encryption to be used. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param enabled: A boolean indicating whether or not the service encrypts the data as it is + stored. + :type enabled: bool + :ivar last_enabled_time: Gets a rough estimate of the date/time when the encryption was last + enabled by the user. Only returned when encryption is enabled. There might be some unencrypted + blobs which were written after this time, as it is just a rough estimate. + :vartype last_enabled_time: ~datetime.datetime + :param key_type: Encryption key type to be used for the encryption service. 'Account' key type + implies that an account-scoped encryption key will be used. 'Service' key type implies that a + default service key is used. Possible values include: "Service", "Account". + :type key_type: str or ~azure.mgmt.storage.v2021_06_01.models.KeyType + """ + + _validation = { + 'last_enabled_time': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, + 'key_type': {'key': 'keyType', 'type': 'str'}, + } + + def __init__( + self, + *, + enabled: Optional[bool] = None, + key_type: Optional[Union[str, "KeyType"]] = None, + **kwargs + ): + super(EncryptionService, self).__init__(**kwargs) + self.enabled = enabled + self.last_enabled_time = None + self.key_type = key_type + + +class EncryptionServices(msrest.serialization.Model): + """A list of services that support encryption. + + :param blob: The encryption function of the blob storage service. + :type blob: ~azure.mgmt.storage.v2021_06_01.models.EncryptionService + :param file: The encryption function of the file storage service. + :type file: ~azure.mgmt.storage.v2021_06_01.models.EncryptionService + :param table: The encryption function of the table storage service. + :type table: ~azure.mgmt.storage.v2021_06_01.models.EncryptionService + :param queue: The encryption function of the queue storage service. + :type queue: ~azure.mgmt.storage.v2021_06_01.models.EncryptionService + """ + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'EncryptionService'}, + 'file': {'key': 'file', 'type': 'EncryptionService'}, + 'table': {'key': 'table', 'type': 'EncryptionService'}, + 'queue': {'key': 'queue', 'type': 'EncryptionService'}, + } + + def __init__( + self, + *, + blob: Optional["EncryptionService"] = None, + file: Optional["EncryptionService"] = None, + table: Optional["EncryptionService"] = None, + queue: Optional["EncryptionService"] = None, + **kwargs + ): + super(EncryptionServices, self).__init__(**kwargs) + self.blob = blob + self.file = file + self.table = table + self.queue = queue + + +class Endpoints(msrest.serialization.Model): + """The URIs that are used to perform a retrieval of a public blob, queue, table, web or dfs object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar blob: Gets the blob endpoint. + :vartype blob: str + :ivar queue: Gets the queue endpoint. + :vartype queue: str + :ivar table: Gets the table endpoint. + :vartype table: str + :ivar file: Gets the file endpoint. + :vartype file: str + :ivar web: Gets the web endpoint. + :vartype web: str + :ivar dfs: Gets the dfs endpoint. + :vartype dfs: str + :param microsoft_endpoints: Gets the microsoft routing storage endpoints. + :type microsoft_endpoints: + ~azure.mgmt.storage.v2021_06_01.models.StorageAccountMicrosoftEndpoints + :param internet_endpoints: Gets the internet routing storage endpoints. + :type internet_endpoints: + ~azure.mgmt.storage.v2021_06_01.models.StorageAccountInternetEndpoints + """ + + _validation = { + 'blob': {'readonly': True}, + 'queue': {'readonly': True}, + 'table': {'readonly': True}, + 'file': {'readonly': True}, + 'web': {'readonly': True}, + 'dfs': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'str'}, + 'queue': {'key': 'queue', 'type': 'str'}, + 'table': {'key': 'table', 'type': 'str'}, + 'file': {'key': 'file', 'type': 'str'}, + 'web': {'key': 'web', 'type': 'str'}, + 'dfs': {'key': 'dfs', 'type': 'str'}, + 'microsoft_endpoints': {'key': 'microsoftEndpoints', 'type': 'StorageAccountMicrosoftEndpoints'}, + 'internet_endpoints': {'key': 'internetEndpoints', 'type': 'StorageAccountInternetEndpoints'}, + } + + def __init__( + self, + *, + microsoft_endpoints: Optional["StorageAccountMicrosoftEndpoints"] = None, + internet_endpoints: Optional["StorageAccountInternetEndpoints"] = None, + **kwargs + ): + super(Endpoints, self).__init__(**kwargs) + self.blob = None + self.queue = None + self.table = None + self.file = None + self.web = None + self.dfs = None + self.microsoft_endpoints = microsoft_endpoints + self.internet_endpoints = internet_endpoints + + +class ErrorResponse(msrest.serialization.Model): + """An error response from the storage resource provider. + + :param error: Azure Storage Resource Provider error response body. + :type error: ~azure.mgmt.storage.v2021_06_01.models.ErrorResponseBody + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponseBody'}, + } + + def __init__( + self, + *, + error: Optional["ErrorResponseBody"] = None, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.error = error + + +class ErrorResponseBody(msrest.serialization.Model): + """Error response body contract. + + :param code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable for display in a user + interface. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + **kwargs + ): + super(ErrorResponseBody, self).__init__(**kwargs) + self.code = code + self.message = message + + +class ExtendedLocation(msrest.serialization.Model): + """The complex type of the extended location. + + :param name: The name of the extended location. + :type name: str + :param type: The type of the extended location. Possible values include: "EdgeZone". + :type type: str or ~azure.mgmt.storage.v2021_06_01.models.ExtendedLocationTypes + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + type: Optional[Union[str, "ExtendedLocationTypes"]] = None, + **kwargs + ): + super(ExtendedLocation, self).__init__(**kwargs) + self.name = name + self.type = type + + +class FileServiceItems(msrest.serialization.Model): + """FileServiceItems. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of file services returned. + :vartype value: list[~azure.mgmt.storage.v2021_06_01.models.FileServiceProperties] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[FileServiceProperties]'}, + } + + def __init__( + self, + **kwargs + ): + super(FileServiceItems, self).__init__(**kwargs) + self.value = None + + +class FileServiceProperties(Resource): + """The properties of File services in storage account. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar sku: Sku name and tier. + :vartype sku: ~azure.mgmt.storage.v2021_06_01.models.Sku + :param cors: Specifies CORS rules for the File service. You can include up to five CorsRule + elements in the request. If no CorsRule elements are included in the request body, all CORS + rules will be deleted, and CORS will be disabled for the File service. + :type cors: ~azure.mgmt.storage.v2021_06_01.models.CorsRules + :param share_delete_retention_policy: The file service properties for share soft delete. + :type share_delete_retention_policy: + ~azure.mgmt.storage.v2021_06_01.models.DeleteRetentionPolicy + :param protocol_settings: Protocol settings for file service. + :type protocol_settings: ~azure.mgmt.storage.v2021_06_01.models.ProtocolSettings + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'sku': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'cors': {'key': 'properties.cors', 'type': 'CorsRules'}, + 'share_delete_retention_policy': {'key': 'properties.shareDeleteRetentionPolicy', 'type': 'DeleteRetentionPolicy'}, + 'protocol_settings': {'key': 'properties.protocolSettings', 'type': 'ProtocolSettings'}, + } + + def __init__( + self, + *, + cors: Optional["CorsRules"] = None, + share_delete_retention_policy: Optional["DeleteRetentionPolicy"] = None, + protocol_settings: Optional["ProtocolSettings"] = None, + **kwargs + ): + super(FileServiceProperties, self).__init__(**kwargs) + self.sku = None + self.cors = cors + self.share_delete_retention_policy = share_delete_retention_policy + self.protocol_settings = protocol_settings + + +class FileShare(AzureEntityResource): + """Properties of the file share, including Id, resource name, resource type, Etag. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :ivar last_modified_time: Returns the date and time the share was last modified. + :vartype last_modified_time: ~datetime.datetime + :param metadata: A name-value pair to associate with the share as metadata. + :type metadata: dict[str, str] + :param share_quota: The maximum size of the share, in gigabytes. Must be greater than 0, and + less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400. + :type share_quota: int + :param enabled_protocols: The authentication protocol that is used for the file share. Can only + be specified when creating a share. Possible values include: "SMB", "NFS". + :type enabled_protocols: str or ~azure.mgmt.storage.v2021_06_01.models.EnabledProtocols + :param root_squash: The property is for NFS share only. The default is NoRootSquash. Possible + values include: "NoRootSquash", "RootSquash", "AllSquash". + :type root_squash: str or ~azure.mgmt.storage.v2021_06_01.models.RootSquashType + :ivar version: The version of the share. + :vartype version: str + :ivar deleted: Indicates whether the share was deleted. + :vartype deleted: bool + :ivar deleted_time: The deleted time if the share was deleted. + :vartype deleted_time: ~datetime.datetime + :ivar remaining_retention_days: Remaining retention days for share that was soft deleted. + :vartype remaining_retention_days: int + :param access_tier: Access tier for specific share. GpV2 account can choose between + TransactionOptimized (default), Hot, and Cool. FileStorage account can choose Premium. Possible + values include: "TransactionOptimized", "Hot", "Cool", "Premium". + :type access_tier: str or ~azure.mgmt.storage.v2021_06_01.models.ShareAccessTier + :ivar access_tier_change_time: Indicates the last modification time for share access tier. + :vartype access_tier_change_time: ~datetime.datetime + :ivar access_tier_status: Indicates if there is a pending transition for access tier. + :vartype access_tier_status: str + :ivar share_usage_bytes: The approximate size of the data stored on the share. Note that this + value may not include all recently created or recently resized files. + :vartype share_usage_bytes: long + :ivar lease_status: The lease status of the share. Possible values include: "Locked", + "Unlocked". + :vartype lease_status: str or ~azure.mgmt.storage.v2021_06_01.models.LeaseStatus + :ivar lease_state: Lease state of the share. Possible values include: "Available", "Leased", + "Expired", "Breaking", "Broken". + :vartype lease_state: str or ~azure.mgmt.storage.v2021_06_01.models.LeaseState + :ivar lease_duration: Specifies whether the lease on a share is of infinite or fixed duration, + only when the share is leased. Possible values include: "Infinite", "Fixed". + :vartype lease_duration: str or ~azure.mgmt.storage.v2021_06_01.models.LeaseDuration + :param signed_identifiers: List of stored access policies specified on the share. + :type signed_identifiers: list[~azure.mgmt.storage.v2021_06_01.models.SignedIdentifier] + :ivar snapshot_time: Creation time of share snapshot returned in the response of list shares + with expand param "snapshots". + :vartype snapshot_time: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'share_quota': {'maximum': 102400, 'minimum': 1}, + 'version': {'readonly': True}, + 'deleted': {'readonly': True}, + 'deleted_time': {'readonly': True}, + 'remaining_retention_days': {'readonly': True}, + 'access_tier_change_time': {'readonly': True}, + 'access_tier_status': {'readonly': True}, + 'share_usage_bytes': {'readonly': True}, + 'lease_status': {'readonly': True}, + 'lease_state': {'readonly': True}, + 'lease_duration': {'readonly': True}, + 'snapshot_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'share_quota': {'key': 'properties.shareQuota', 'type': 'int'}, + 'enabled_protocols': {'key': 'properties.enabledProtocols', 'type': 'str'}, + 'root_squash': {'key': 'properties.rootSquash', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'deleted': {'key': 'properties.deleted', 'type': 'bool'}, + 'deleted_time': {'key': 'properties.deletedTime', 'type': 'iso-8601'}, + 'remaining_retention_days': {'key': 'properties.remainingRetentionDays', 'type': 'int'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'str'}, + 'access_tier_change_time': {'key': 'properties.accessTierChangeTime', 'type': 'iso-8601'}, + 'access_tier_status': {'key': 'properties.accessTierStatus', 'type': 'str'}, + 'share_usage_bytes': {'key': 'properties.shareUsageBytes', 'type': 'long'}, + 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, + 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, + 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, + 'signed_identifiers': {'key': 'properties.signedIdentifiers', 'type': '[SignedIdentifier]'}, + 'snapshot_time': {'key': 'properties.snapshotTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + metadata: Optional[Dict[str, str]] = None, + share_quota: Optional[int] = None, + enabled_protocols: Optional[Union[str, "EnabledProtocols"]] = None, + root_squash: Optional[Union[str, "RootSquashType"]] = None, + access_tier: Optional[Union[str, "ShareAccessTier"]] = None, + signed_identifiers: Optional[List["SignedIdentifier"]] = None, + **kwargs + ): + super(FileShare, self).__init__(**kwargs) + self.last_modified_time = None + self.metadata = metadata + self.share_quota = share_quota + self.enabled_protocols = enabled_protocols + self.root_squash = root_squash + self.version = None + self.deleted = None + self.deleted_time = None + self.remaining_retention_days = None + self.access_tier = access_tier + self.access_tier_change_time = None + self.access_tier_status = None + self.share_usage_bytes = None + self.lease_status = None + self.lease_state = None + self.lease_duration = None + self.signed_identifiers = signed_identifiers + self.snapshot_time = None + + +class FileShareItem(AzureEntityResource): + """The file share properties be listed out. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :ivar last_modified_time: Returns the date and time the share was last modified. + :vartype last_modified_time: ~datetime.datetime + :param metadata: A name-value pair to associate with the share as metadata. + :type metadata: dict[str, str] + :param share_quota: The maximum size of the share, in gigabytes. Must be greater than 0, and + less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400. + :type share_quota: int + :param enabled_protocols: The authentication protocol that is used for the file share. Can only + be specified when creating a share. Possible values include: "SMB", "NFS". + :type enabled_protocols: str or ~azure.mgmt.storage.v2021_06_01.models.EnabledProtocols + :param root_squash: The property is for NFS share only. The default is NoRootSquash. Possible + values include: "NoRootSquash", "RootSquash", "AllSquash". + :type root_squash: str or ~azure.mgmt.storage.v2021_06_01.models.RootSquashType + :ivar version: The version of the share. + :vartype version: str + :ivar deleted: Indicates whether the share was deleted. + :vartype deleted: bool + :ivar deleted_time: The deleted time if the share was deleted. + :vartype deleted_time: ~datetime.datetime + :ivar remaining_retention_days: Remaining retention days for share that was soft deleted. + :vartype remaining_retention_days: int + :param access_tier: Access tier for specific share. GpV2 account can choose between + TransactionOptimized (default), Hot, and Cool. FileStorage account can choose Premium. Possible + values include: "TransactionOptimized", "Hot", "Cool", "Premium". + :type access_tier: str or ~azure.mgmt.storage.v2021_06_01.models.ShareAccessTier + :ivar access_tier_change_time: Indicates the last modification time for share access tier. + :vartype access_tier_change_time: ~datetime.datetime + :ivar access_tier_status: Indicates if there is a pending transition for access tier. + :vartype access_tier_status: str + :ivar share_usage_bytes: The approximate size of the data stored on the share. Note that this + value may not include all recently created or recently resized files. + :vartype share_usage_bytes: long + :ivar lease_status: The lease status of the share. Possible values include: "Locked", + "Unlocked". + :vartype lease_status: str or ~azure.mgmt.storage.v2021_06_01.models.LeaseStatus + :ivar lease_state: Lease state of the share. Possible values include: "Available", "Leased", + "Expired", "Breaking", "Broken". + :vartype lease_state: str or ~azure.mgmt.storage.v2021_06_01.models.LeaseState + :ivar lease_duration: Specifies whether the lease on a share is of infinite or fixed duration, + only when the share is leased. Possible values include: "Infinite", "Fixed". + :vartype lease_duration: str or ~azure.mgmt.storage.v2021_06_01.models.LeaseDuration + :param signed_identifiers: List of stored access policies specified on the share. + :type signed_identifiers: list[~azure.mgmt.storage.v2021_06_01.models.SignedIdentifier] + :ivar snapshot_time: Creation time of share snapshot returned in the response of list shares + with expand param "snapshots". + :vartype snapshot_time: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'share_quota': {'maximum': 102400, 'minimum': 1}, + 'version': {'readonly': True}, + 'deleted': {'readonly': True}, + 'deleted_time': {'readonly': True}, + 'remaining_retention_days': {'readonly': True}, + 'access_tier_change_time': {'readonly': True}, + 'access_tier_status': {'readonly': True}, + 'share_usage_bytes': {'readonly': True}, + 'lease_status': {'readonly': True}, + 'lease_state': {'readonly': True}, + 'lease_duration': {'readonly': True}, + 'snapshot_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'share_quota': {'key': 'properties.shareQuota', 'type': 'int'}, + 'enabled_protocols': {'key': 'properties.enabledProtocols', 'type': 'str'}, + 'root_squash': {'key': 'properties.rootSquash', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'deleted': {'key': 'properties.deleted', 'type': 'bool'}, + 'deleted_time': {'key': 'properties.deletedTime', 'type': 'iso-8601'}, + 'remaining_retention_days': {'key': 'properties.remainingRetentionDays', 'type': 'int'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'str'}, + 'access_tier_change_time': {'key': 'properties.accessTierChangeTime', 'type': 'iso-8601'}, + 'access_tier_status': {'key': 'properties.accessTierStatus', 'type': 'str'}, + 'share_usage_bytes': {'key': 'properties.shareUsageBytes', 'type': 'long'}, + 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, + 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, + 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, + 'signed_identifiers': {'key': 'properties.signedIdentifiers', 'type': '[SignedIdentifier]'}, + 'snapshot_time': {'key': 'properties.snapshotTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + metadata: Optional[Dict[str, str]] = None, + share_quota: Optional[int] = None, + enabled_protocols: Optional[Union[str, "EnabledProtocols"]] = None, + root_squash: Optional[Union[str, "RootSquashType"]] = None, + access_tier: Optional[Union[str, "ShareAccessTier"]] = None, + signed_identifiers: Optional[List["SignedIdentifier"]] = None, + **kwargs + ): + super(FileShareItem, self).__init__(**kwargs) + self.last_modified_time = None + self.metadata = metadata + self.share_quota = share_quota + self.enabled_protocols = enabled_protocols + self.root_squash = root_squash + self.version = None + self.deleted = None + self.deleted_time = None + self.remaining_retention_days = None + self.access_tier = access_tier + self.access_tier_change_time = None + self.access_tier_status = None + self.share_usage_bytes = None + self.lease_status = None + self.lease_state = None + self.lease_duration = None + self.signed_identifiers = signed_identifiers + self.snapshot_time = None + + +class FileShareItems(msrest.serialization.Model): + """Response schema. Contains list of shares returned, and if paging is requested or required, a URL to next page of shares. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of file shares returned. + :vartype value: list[~azure.mgmt.storage.v2021_06_01.models.FileShareItem] + :ivar next_link: Request URL that can be used to query next page of shares. Returned when total + number of requested shares exceed maximum page size. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[FileShareItem]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(FileShareItems, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class GeoReplicationStats(msrest.serialization.Model): + """Statistics related to replication for storage account's Blob, Table, Queue and File services. It is only available when geo-redundant replication is enabled for the storage account. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar status: The status of the secondary location. Possible values are: - Live: Indicates that + the secondary location is active and operational. - Bootstrap: Indicates initial + synchronization from the primary location to the secondary location is in progress.This + typically occurs when replication is first enabled. - Unavailable: Indicates that the secondary + location is temporarily unavailable. Possible values include: "Live", "Bootstrap", + "Unavailable". + :vartype status: str or ~azure.mgmt.storage.v2021_06_01.models.GeoReplicationStatus + :ivar last_sync_time: All primary writes preceding this UTC date/time value are guaranteed to + be available for read operations. Primary writes following this point in time may or may not be + available for reads. Element may be default value if value of LastSyncTime is not available, + this can happen if secondary is offline or we are in bootstrap. + :vartype last_sync_time: ~datetime.datetime + :ivar can_failover: A boolean flag which indicates whether or not account failover is supported + for the account. + :vartype can_failover: bool + """ + + _validation = { + 'status': {'readonly': True}, + 'last_sync_time': {'readonly': True}, + 'can_failover': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'last_sync_time': {'key': 'lastSyncTime', 'type': 'iso-8601'}, + 'can_failover': {'key': 'canFailover', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(GeoReplicationStats, self).__init__(**kwargs) + self.status = None + self.last_sync_time = None + self.can_failover = None + + +class Identity(msrest.serialization.Model): + """Identity for the resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :param type: Required. The identity type. Possible values include: "None", "SystemAssigned", + "UserAssigned", "SystemAssigned,UserAssigned". + :type type: str or ~azure.mgmt.storage.v2021_06_01.models.IdentityType + :param user_assigned_identities: Gets or sets a list of key value pairs that describe the set + of User Assigned identities that will be used with this storage account. The key is the ARM + resource identifier of the identity. Only 1 User Assigned identity is permitted here. + :type user_assigned_identities: dict[str, + ~azure.mgmt.storage.v2021_06_01.models.UserAssignedIdentity] + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, + } + + def __init__( + self, + *, + type: Union[str, "IdentityType"], + user_assigned_identities: Optional[Dict[str, "UserAssignedIdentity"]] = None, + **kwargs + ): + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type + self.user_assigned_identities = user_assigned_identities + + +class ImmutabilityPolicy(AzureEntityResource): + """The ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :param immutability_period_since_creation_in_days: The immutability period for the blobs in the + container since the policy creation, in days. + :type immutability_period_since_creation_in_days: int + :ivar state: The ImmutabilityPolicy state of a blob container, possible values include: Locked + and Unlocked. Possible values include: "Locked", "Unlocked". + :vartype state: str or ~azure.mgmt.storage.v2021_06_01.models.ImmutabilityPolicyState + :param allow_protected_append_writes: This property can only be changed for unlocked time-based + retention policies. When enabled, new blocks can be written to an append blob while maintaining + immutability protection and compliance. Only new blocks can be added and any existing blocks + cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy + API. + :type allow_protected_append_writes: bool + :param allow_protected_append_writes_all: This property can only be changed for unlocked + time-based retention policies. When enabled, new blocks can be written to both 'Append and Bock + Blobs' while maintaining immutability protection and compliance. Only new blocks can be added + and any existing blocks cannot be modified or deleted. This property cannot be changed with + ExtendImmutabilityPolicy API. The 'allowProtectedAppendWrites' and + 'allowProtectedAppendWritesAll' properties are mutually exclusive. + :type allow_protected_append_writes_all: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'allow_protected_append_writes': {'key': 'properties.allowProtectedAppendWrites', 'type': 'bool'}, + 'allow_protected_append_writes_all': {'key': 'properties.allowProtectedAppendWritesAll', 'type': 'bool'}, + } + + def __init__( + self, + *, + immutability_period_since_creation_in_days: Optional[int] = None, + allow_protected_append_writes: Optional[bool] = None, + allow_protected_append_writes_all: Optional[bool] = None, + **kwargs + ): + super(ImmutabilityPolicy, self).__init__(**kwargs) + self.immutability_period_since_creation_in_days = immutability_period_since_creation_in_days + self.state = None + self.allow_protected_append_writes = allow_protected_append_writes + self.allow_protected_append_writes_all = allow_protected_append_writes_all + + +class ImmutabilityPolicyProperties(msrest.serialization.Model): + """The properties of an ImmutabilityPolicy of a blob container. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar etag: ImmutabilityPolicy Etag. + :vartype etag: str + :ivar update_history: The ImmutabilityPolicy update history of the blob container. + :vartype update_history: list[~azure.mgmt.storage.v2021_06_01.models.UpdateHistoryProperty] + :param immutability_period_since_creation_in_days: The immutability period for the blobs in the + container since the policy creation, in days. + :type immutability_period_since_creation_in_days: int + :ivar state: The ImmutabilityPolicy state of a blob container, possible values include: Locked + and Unlocked. Possible values include: "Locked", "Unlocked". + :vartype state: str or ~azure.mgmt.storage.v2021_06_01.models.ImmutabilityPolicyState + :param allow_protected_append_writes: This property can only be changed for unlocked time-based + retention policies. When enabled, new blocks can be written to an append blob while maintaining + immutability protection and compliance. Only new blocks can be added and any existing blocks + cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy + API. + :type allow_protected_append_writes: bool + :param allow_protected_append_writes_all: This property can only be changed for unlocked + time-based retention policies. When enabled, new blocks can be written to both 'Append and Bock + Blobs' while maintaining immutability protection and compliance. Only new blocks can be added + and any existing blocks cannot be modified or deleted. This property cannot be changed with + ExtendImmutabilityPolicy API. The 'allowProtectedAppendWrites' and + 'allowProtectedAppendWritesAll' properties are mutually exclusive. + :type allow_protected_append_writes_all: bool + """ + + _validation = { + 'etag': {'readonly': True}, + 'update_history': {'readonly': True}, + 'state': {'readonly': True}, + } + + _attribute_map = { + 'etag': {'key': 'etag', 'type': 'str'}, + 'update_history': {'key': 'updateHistory', 'type': '[UpdateHistoryProperty]'}, + 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'allow_protected_append_writes': {'key': 'properties.allowProtectedAppendWrites', 'type': 'bool'}, + 'allow_protected_append_writes_all': {'key': 'properties.allowProtectedAppendWritesAll', 'type': 'bool'}, + } + + def __init__( + self, + *, + immutability_period_since_creation_in_days: Optional[int] = None, + allow_protected_append_writes: Optional[bool] = None, + allow_protected_append_writes_all: Optional[bool] = None, + **kwargs + ): + super(ImmutabilityPolicyProperties, self).__init__(**kwargs) + self.etag = None + self.update_history = None + self.immutability_period_since_creation_in_days = immutability_period_since_creation_in_days + self.state = None + self.allow_protected_append_writes = allow_protected_append_writes + self.allow_protected_append_writes_all = allow_protected_append_writes_all + + +class ImmutableStorageAccount(msrest.serialization.Model): + """This property enables and defines account-level immutability. Enabling the feature auto-enables Blob Versioning. + + :param enabled: A boolean flag which enables account-level immutability. All the containers + under such an account have object-level immutability enabled by default. + :type enabled: bool + :param immutability_policy: Specifies the default account-level immutability policy which is + inherited and applied to objects that do not possess an explicit immutability policy at the + object level. The object-level immutability policy has higher precedence than the + container-level immutability policy, which has a higher precedence than the account-level + immutability policy. + :type immutability_policy: + ~azure.mgmt.storage.v2021_06_01.models.AccountImmutabilityPolicyProperties + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'immutability_policy': {'key': 'immutabilityPolicy', 'type': 'AccountImmutabilityPolicyProperties'}, + } + + def __init__( + self, + *, + enabled: Optional[bool] = None, + immutability_policy: Optional["AccountImmutabilityPolicyProperties"] = None, + **kwargs + ): + super(ImmutableStorageAccount, self).__init__(**kwargs) + self.enabled = enabled + self.immutability_policy = immutability_policy + + +class ImmutableStorageWithVersioning(msrest.serialization.Model): + """Object level immutability properties of the container. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param enabled: This is an immutable property, when set to true it enables object level + immutability at the container level. + :type enabled: bool + :ivar time_stamp: Returns the date and time the object level immutability was enabled. + :vartype time_stamp: ~datetime.datetime + :ivar migration_state: This property denotes the container level immutability to object level + immutability migration state. Possible values include: "InProgress", "Completed". + :vartype migration_state: str or ~azure.mgmt.storage.v2021_06_01.models.MigrationState + """ + + _validation = { + 'time_stamp': {'readonly': True}, + 'migration_state': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'time_stamp': {'key': 'timeStamp', 'type': 'iso-8601'}, + 'migration_state': {'key': 'migrationState', 'type': 'str'}, + } + + def __init__( + self, + *, + enabled: Optional[bool] = None, + **kwargs + ): + super(ImmutableStorageWithVersioning, self).__init__(**kwargs) + self.enabled = enabled + self.time_stamp = None + self.migration_state = None + + +class IPRule(msrest.serialization.Model): + """IP rule with specific IP or IP range in CIDR format. + + All required parameters must be populated in order to send to Azure. + + :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR format. Only IPV4 + address is allowed. + :type ip_address_or_range: str + :param action: The action of IP ACL rule. The only acceptable values to pass in are None and + "Allow". The default value is None. + :type action: str + """ + + _validation = { + 'ip_address_or_range': {'required': True}, + } + + _attribute_map = { + 'ip_address_or_range': {'key': 'value', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'str'}, + } + + def __init__( + self, + *, + ip_address_or_range: str, + action: Optional[str] = None, + **kwargs + ): + super(IPRule, self).__init__(**kwargs) + self.ip_address_or_range = ip_address_or_range + self.action = action + + +class KeyCreationTime(msrest.serialization.Model): + """Storage account keys creation time. + + :param key1: + :type key1: ~datetime.datetime + :param key2: + :type key2: ~datetime.datetime + """ + + _attribute_map = { + 'key1': {'key': 'key1', 'type': 'iso-8601'}, + 'key2': {'key': 'key2', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + key1: Optional[datetime.datetime] = None, + key2: Optional[datetime.datetime] = None, + **kwargs + ): + super(KeyCreationTime, self).__init__(**kwargs) + self.key1 = key1 + self.key2 = key2 + + +class KeyPolicy(msrest.serialization.Model): + """KeyPolicy assigned to the storage account. + + All required parameters must be populated in order to send to Azure. + + :param key_expiration_period_in_days: Required. The key expiration period in days. + :type key_expiration_period_in_days: int + """ + + _validation = { + 'key_expiration_period_in_days': {'required': True}, + } + + _attribute_map = { + 'key_expiration_period_in_days': {'key': 'keyExpirationPeriodInDays', 'type': 'int'}, + } + + def __init__( + self, + *, + key_expiration_period_in_days: int, + **kwargs + ): + super(KeyPolicy, self).__init__(**kwargs) + self.key_expiration_period_in_days = key_expiration_period_in_days + + +class KeyVaultProperties(msrest.serialization.Model): + """Properties of key vault. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param key_name: The name of KeyVault key. + :type key_name: str + :param key_version: The version of KeyVault key. + :type key_version: str + :param key_vault_uri: The Uri of KeyVault. + :type key_vault_uri: str + :ivar current_versioned_key_identifier: The object identifier of the current versioned Key + Vault Key in use. + :vartype current_versioned_key_identifier: str + :ivar last_key_rotation_timestamp: Timestamp of last rotation of the Key Vault Key. + :vartype last_key_rotation_timestamp: ~datetime.datetime + """ + + _validation = { + 'current_versioned_key_identifier': {'readonly': True}, + 'last_key_rotation_timestamp': {'readonly': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyname', 'type': 'str'}, + 'key_version': {'key': 'keyversion', 'type': 'str'}, + 'key_vault_uri': {'key': 'keyvaulturi', 'type': 'str'}, + 'current_versioned_key_identifier': {'key': 'currentVersionedKeyIdentifier', 'type': 'str'}, + 'last_key_rotation_timestamp': {'key': 'lastKeyRotationTimestamp', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + key_name: Optional[str] = None, + key_version: Optional[str] = None, + key_vault_uri: Optional[str] = None, + **kwargs + ): + super(KeyVaultProperties, self).__init__(**kwargs) + self.key_name = key_name + self.key_version = key_version + self.key_vault_uri = key_vault_uri + self.current_versioned_key_identifier = None + self.last_key_rotation_timestamp = None + + +class LastAccessTimeTrackingPolicy(msrest.serialization.Model): + """The blob service properties for Last access time based tracking policy. + + All required parameters must be populated in order to send to Azure. + + :param enable: Required. When set to true last access time based tracking is enabled. + :type enable: bool + :param name: Name of the policy. The valid value is AccessTimeTracking. This field is currently + read only. Possible values include: "AccessTimeTracking". + :type name: str or ~azure.mgmt.storage.v2021_06_01.models.Name + :param tracking_granularity_in_days: The field specifies blob object tracking granularity in + days, typically how often the blob object should be tracked.This field is currently read only + with value as 1. + :type tracking_granularity_in_days: int + :param blob_type: An array of predefined supported blob types. Only blockBlob is the supported + value. This field is currently read only. + :type blob_type: list[str] + """ + + _validation = { + 'enable': {'required': True}, + } + + _attribute_map = { + 'enable': {'key': 'enable', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tracking_granularity_in_days': {'key': 'trackingGranularityInDays', 'type': 'int'}, + 'blob_type': {'key': 'blobType', 'type': '[str]'}, + } + + def __init__( + self, + *, + enable: bool, + name: Optional[Union[str, "Name"]] = None, + tracking_granularity_in_days: Optional[int] = None, + blob_type: Optional[List[str]] = None, + **kwargs + ): + super(LastAccessTimeTrackingPolicy, self).__init__(**kwargs) + self.enable = enable + self.name = name + self.tracking_granularity_in_days = tracking_granularity_in_days + self.blob_type = blob_type + + +class LeaseContainerRequest(msrest.serialization.Model): + """Lease Container request schema. + + All required parameters must be populated in order to send to Azure. + + :param action: Required. Specifies the lease action. Can be one of the available actions. + Possible values include: "Acquire", "Renew", "Change", "Release", "Break". + :type action: str or ~azure.mgmt.storage.v2021_06_01.models.LeaseContainerRequestAction + :param lease_id: Identifies the lease. Can be specified in any valid GUID string format. + :type lease_id: str + :param break_period: Optional. For a break action, proposed duration the lease should continue + before it is broken, in seconds, between 0 and 60. + :type break_period: int + :param lease_duration: Required for acquire. Specifies the duration of the lease, in seconds, + or negative one (-1) for a lease that never expires. + :type lease_duration: int + :param proposed_lease_id: Optional for acquire, required for change. Proposed lease ID, in a + GUID string format. + :type proposed_lease_id: str + """ + + _validation = { + 'action': {'required': True}, + } + + _attribute_map = { + 'action': {'key': 'action', 'type': 'str'}, + 'lease_id': {'key': 'leaseId', 'type': 'str'}, + 'break_period': {'key': 'breakPeriod', 'type': 'int'}, + 'lease_duration': {'key': 'leaseDuration', 'type': 'int'}, + 'proposed_lease_id': {'key': 'proposedLeaseId', 'type': 'str'}, + } + + def __init__( + self, + *, + action: Union[str, "LeaseContainerRequestAction"], + lease_id: Optional[str] = None, + break_period: Optional[int] = None, + lease_duration: Optional[int] = None, + proposed_lease_id: Optional[str] = None, + **kwargs + ): + super(LeaseContainerRequest, self).__init__(**kwargs) + self.action = action + self.lease_id = lease_id + self.break_period = break_period + self.lease_duration = lease_duration + self.proposed_lease_id = proposed_lease_id + + +class LeaseContainerResponse(msrest.serialization.Model): + """Lease Container response schema. + + :param lease_id: Returned unique lease ID that must be included with any request to delete the + container, or to renew, change, or release the lease. + :type lease_id: str + :param lease_time_seconds: Approximate time remaining in the lease period, in seconds. + :type lease_time_seconds: str + """ + + _attribute_map = { + 'lease_id': {'key': 'leaseId', 'type': 'str'}, + 'lease_time_seconds': {'key': 'leaseTimeSeconds', 'type': 'str'}, + } + + def __init__( + self, + *, + lease_id: Optional[str] = None, + lease_time_seconds: Optional[str] = None, + **kwargs + ): + super(LeaseContainerResponse, self).__init__(**kwargs) + self.lease_id = lease_id + self.lease_time_seconds = lease_time_seconds + + +class LeaseShareRequest(msrest.serialization.Model): + """Lease Share request schema. + + All required parameters must be populated in order to send to Azure. + + :param action: Required. Specifies the lease action. Can be one of the available actions. + Possible values include: "Acquire", "Renew", "Change", "Release", "Break". + :type action: str or ~azure.mgmt.storage.v2021_06_01.models.LeaseShareAction + :param lease_id: Identifies the lease. Can be specified in any valid GUID string format. + :type lease_id: str + :param break_period: Optional. For a break action, proposed duration the lease should continue + before it is broken, in seconds, between 0 and 60. + :type break_period: int + :param lease_duration: Required for acquire. Specifies the duration of the lease, in seconds, + or negative one (-1) for a lease that never expires. + :type lease_duration: int + :param proposed_lease_id: Optional for acquire, required for change. Proposed lease ID, in a + GUID string format. + :type proposed_lease_id: str + """ + + _validation = { + 'action': {'required': True}, + } + + _attribute_map = { + 'action': {'key': 'action', 'type': 'str'}, + 'lease_id': {'key': 'leaseId', 'type': 'str'}, + 'break_period': {'key': 'breakPeriod', 'type': 'int'}, + 'lease_duration': {'key': 'leaseDuration', 'type': 'int'}, + 'proposed_lease_id': {'key': 'proposedLeaseId', 'type': 'str'}, + } + + def __init__( + self, + *, + action: Union[str, "LeaseShareAction"], + lease_id: Optional[str] = None, + break_period: Optional[int] = None, + lease_duration: Optional[int] = None, + proposed_lease_id: Optional[str] = None, + **kwargs + ): + super(LeaseShareRequest, self).__init__(**kwargs) + self.action = action + self.lease_id = lease_id + self.break_period = break_period + self.lease_duration = lease_duration + self.proposed_lease_id = proposed_lease_id + + +class LeaseShareResponse(msrest.serialization.Model): + """Lease Share response schema. + + :param lease_id: Returned unique lease ID that must be included with any request to delete the + share, or to renew, change, or release the lease. + :type lease_id: str + :param lease_time_seconds: Approximate time remaining in the lease period, in seconds. + :type lease_time_seconds: str + """ + + _attribute_map = { + 'lease_id': {'key': 'leaseId', 'type': 'str'}, + 'lease_time_seconds': {'key': 'leaseTimeSeconds', 'type': 'str'}, + } + + def __init__( + self, + *, + lease_id: Optional[str] = None, + lease_time_seconds: Optional[str] = None, + **kwargs + ): + super(LeaseShareResponse, self).__init__(**kwargs) + self.lease_id = lease_id + self.lease_time_seconds = lease_time_seconds + + +class LegalHold(msrest.serialization.Model): + """The LegalHold property of a blob container. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar has_legal_hold: The hasLegalHold public property is set to true by SRP if there are at + least one existing tag. The hasLegalHold public property is set to false by SRP if all existing + legal hold tags are cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :param tags: Required. A set of tags. Each tag should be 3 to 23 alphanumeric characters and is + normalized to lower case at SRP. + :type tags: list[str] + :param allow_protected_append_writes_all: When enabled, new blocks can be written to both + 'Append and Bock Blobs' while maintaining legal hold protection and compliance. Only new blocks + can be added and any existing blocks cannot be modified or deleted. + :type allow_protected_append_writes_all: bool + """ + + _validation = { + 'has_legal_hold': {'readonly': True}, + 'tags': {'required': True}, + } + + _attribute_map = { + 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, + 'tags': {'key': 'tags', 'type': '[str]'}, + 'allow_protected_append_writes_all': {'key': 'allowProtectedAppendWritesAll', 'type': 'bool'}, + } + + def __init__( + self, + *, + tags: List[str], + allow_protected_append_writes_all: Optional[bool] = None, + **kwargs + ): + super(LegalHold, self).__init__(**kwargs) + self.has_legal_hold = None + self.tags = tags + self.allow_protected_append_writes_all = allow_protected_append_writes_all + + +class LegalHoldProperties(msrest.serialization.Model): + """The LegalHold property of a blob container. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar has_legal_hold: The hasLegalHold public property is set to true by SRP if there are at + least one existing tag. The hasLegalHold public property is set to false by SRP if all existing + legal hold tags are cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :param tags: A set of tags. The list of LegalHold tags of a blob container. + :type tags: list[~azure.mgmt.storage.v2021_06_01.models.TagProperty] + :param protected_append_writes_history: Protected append blob writes history. + :type protected_append_writes_history: + ~azure.mgmt.storage.v2021_06_01.models.ProtectedAppendWritesHistory + """ + + _validation = { + 'has_legal_hold': {'readonly': True}, + } + + _attribute_map = { + 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, + 'tags': {'key': 'tags', 'type': '[TagProperty]'}, + 'protected_append_writes_history': {'key': 'protectedAppendWritesHistory', 'type': 'ProtectedAppendWritesHistory'}, + } + + def __init__( + self, + *, + tags: Optional[List["TagProperty"]] = None, + protected_append_writes_history: Optional["ProtectedAppendWritesHistory"] = None, + **kwargs + ): + super(LegalHoldProperties, self).__init__(**kwargs) + self.has_legal_hold = None + self.tags = tags + self.protected_append_writes_history = protected_append_writes_history + + +class ListAccountSasResponse(msrest.serialization.Model): + """The List SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar account_sas_token: List SAS credentials of storage account. + :vartype account_sas_token: str + """ + + _validation = { + 'account_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'account_sas_token': {'key': 'accountSasToken', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ListAccountSasResponse, self).__init__(**kwargs) + self.account_sas_token = None + + +class ListBlobInventoryPolicy(msrest.serialization.Model): + """List of blob inventory policies returned. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of blob inventory policies. + :vartype value: list[~azure.mgmt.storage.v2021_06_01.models.BlobInventoryPolicy] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BlobInventoryPolicy]'}, + } + + def __init__( + self, + **kwargs + ): + super(ListBlobInventoryPolicy, self).__init__(**kwargs) + self.value = None + + +class ListContainerItem(AzureEntityResource): + """The blob container properties be listed out. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :ivar version: The version of the deleted blob container. + :vartype version: str + :ivar deleted: Indicates whether the blob container was deleted. + :vartype deleted: bool + :ivar deleted_time: Blob container deletion time. + :vartype deleted_time: ~datetime.datetime + :ivar remaining_retention_days: Remaining retention days for soft deleted blob container. + :vartype remaining_retention_days: int + :param default_encryption_scope: Default the container to use specified encryption scope for + all writes. + :type default_encryption_scope: str + :param deny_encryption_scope_override: Block override of encryption scope from the container + default. + :type deny_encryption_scope_override: bool + :param public_access: Specifies whether data in the container may be accessed publicly and the + level of access. Possible values include: "Container", "Blob", "None". + :type public_access: str or ~azure.mgmt.storage.v2021_06_01.models.PublicAccess + :ivar last_modified_time: Returns the date and time the container was last modified. + :vartype last_modified_time: ~datetime.datetime + :ivar lease_status: The lease status of the container. Possible values include: "Locked", + "Unlocked". + :vartype lease_status: str or ~azure.mgmt.storage.v2021_06_01.models.LeaseStatus + :ivar lease_state: Lease state of the container. Possible values include: "Available", + "Leased", "Expired", "Breaking", "Broken". + :vartype lease_state: str or ~azure.mgmt.storage.v2021_06_01.models.LeaseState + :ivar lease_duration: Specifies whether the lease on a container is of infinite or fixed + duration, only when the container is leased. Possible values include: "Infinite", "Fixed". + :vartype lease_duration: str or ~azure.mgmt.storage.v2021_06_01.models.LeaseDuration + :param metadata: A name-value pair to associate with the container as metadata. + :type metadata: dict[str, str] + :ivar immutability_policy: The ImmutabilityPolicy property of the container. + :vartype immutability_policy: + ~azure.mgmt.storage.v2021_06_01.models.ImmutabilityPolicyProperties + :ivar legal_hold: The LegalHold property of the container. + :vartype legal_hold: ~azure.mgmt.storage.v2021_06_01.models.LegalHoldProperties + :ivar has_legal_hold: The hasLegalHold public property is set to true by SRP if there are at + least one existing tag. The hasLegalHold public property is set to false by SRP if all existing + legal hold tags are cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :ivar has_immutability_policy: The hasImmutabilityPolicy public property is set to true by SRP + if ImmutabilityPolicy has been created for this container. The hasImmutabilityPolicy public + property is set to false by SRP if ImmutabilityPolicy has not been created for this container. + :vartype has_immutability_policy: bool + :param immutable_storage_with_versioning: The object level immutability property of the + container. The property is immutable and can only be set to true at the container creation + time. Existing containers must undergo a migration process. + :type immutable_storage_with_versioning: + ~azure.mgmt.storage.v2021_06_01.models.ImmutableStorageWithVersioning + :param enable_nfs_v3_root_squash: Enable NFSv3 root squash on blob container. + :type enable_nfs_v3_root_squash: bool + :param enable_nfs_v3_all_squash: Enable NFSv3 all squash on blob container. + :type enable_nfs_v3_all_squash: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'version': {'readonly': True}, + 'deleted': {'readonly': True}, + 'deleted_time': {'readonly': True}, + 'remaining_retention_days': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'lease_status': {'readonly': True}, + 'lease_state': {'readonly': True}, + 'lease_duration': {'readonly': True}, + 'immutability_policy': {'readonly': True}, + 'legal_hold': {'readonly': True}, + 'has_legal_hold': {'readonly': True}, + 'has_immutability_policy': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'deleted': {'key': 'properties.deleted', 'type': 'bool'}, + 'deleted_time': {'key': 'properties.deletedTime', 'type': 'iso-8601'}, + 'remaining_retention_days': {'key': 'properties.remainingRetentionDays', 'type': 'int'}, + 'default_encryption_scope': {'key': 'properties.defaultEncryptionScope', 'type': 'str'}, + 'deny_encryption_scope_override': {'key': 'properties.denyEncryptionScopeOverride', 'type': 'bool'}, + 'public_access': {'key': 'properties.publicAccess', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, + 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, + 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'immutability_policy': {'key': 'properties.immutabilityPolicy', 'type': 'ImmutabilityPolicyProperties'}, + 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, + 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, + 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, + 'immutable_storage_with_versioning': {'key': 'properties.immutableStorageWithVersioning', 'type': 'ImmutableStorageWithVersioning'}, + 'enable_nfs_v3_root_squash': {'key': 'properties.enableNfsV3RootSquash', 'type': 'bool'}, + 'enable_nfs_v3_all_squash': {'key': 'properties.enableNfsV3AllSquash', 'type': 'bool'}, + } + + def __init__( + self, + *, + default_encryption_scope: Optional[str] = None, + deny_encryption_scope_override: Optional[bool] = None, + public_access: Optional[Union[str, "PublicAccess"]] = None, + metadata: Optional[Dict[str, str]] = None, + immutable_storage_with_versioning: Optional["ImmutableStorageWithVersioning"] = None, + enable_nfs_v3_root_squash: Optional[bool] = None, + enable_nfs_v3_all_squash: Optional[bool] = None, + **kwargs + ): + super(ListContainerItem, self).__init__(**kwargs) + self.version = None + self.deleted = None + self.deleted_time = None + self.remaining_retention_days = None + self.default_encryption_scope = default_encryption_scope + self.deny_encryption_scope_override = deny_encryption_scope_override + self.public_access = public_access + self.last_modified_time = None + self.lease_status = None + self.lease_state = None + self.lease_duration = None + self.metadata = metadata + self.immutability_policy = None + self.legal_hold = None + self.has_legal_hold = None + self.has_immutability_policy = None + self.immutable_storage_with_versioning = immutable_storage_with_versioning + self.enable_nfs_v3_root_squash = enable_nfs_v3_root_squash + self.enable_nfs_v3_all_squash = enable_nfs_v3_all_squash + + +class ListContainerItems(msrest.serialization.Model): + """Response schema. Contains list of blobs returned, and if paging is requested or required, a URL to next page of containers. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of blobs containers returned. + :vartype value: list[~azure.mgmt.storage.v2021_06_01.models.ListContainerItem] + :ivar next_link: Request URL that can be used to query next page of containers. Returned when + total number of requested containers exceed maximum page size. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ListContainerItem]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ListContainerItems, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class ListQueue(Resource): + """ListQueue. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param metadata: A name-value pair that represents queue metadata. + :type metadata: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + } + + def __init__( + self, + *, + metadata: Optional[Dict[str, str]] = None, + **kwargs + ): + super(ListQueue, self).__init__(**kwargs) + self.metadata = metadata + + +class ListQueueResource(msrest.serialization.Model): + """Response schema. Contains list of queues returned. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of queues returned. + :vartype value: list[~azure.mgmt.storage.v2021_06_01.models.ListQueue] + :ivar next_link: Request URL that can be used to list next page of queues. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ListQueue]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ListQueueResource, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class ListQueueServices(msrest.serialization.Model): + """ListQueueServices. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of queue services returned. + :vartype value: list[~azure.mgmt.storage.v2021_06_01.models.QueueServiceProperties] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[QueueServiceProperties]'}, + } + + def __init__( + self, + **kwargs + ): + super(ListQueueServices, self).__init__(**kwargs) + self.value = None + + +class ListServiceSasResponse(msrest.serialization.Model): + """The List service SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar service_sas_token: List service SAS credentials of specific resource. + :vartype service_sas_token: str + """ + + _validation = { + 'service_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'service_sas_token': {'key': 'serviceSasToken', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ListServiceSasResponse, self).__init__(**kwargs) + self.service_sas_token = None + + +class ListTableResource(msrest.serialization.Model): + """Response schema. Contains list of tables returned. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of tables returned. + :vartype value: list[~azure.mgmt.storage.v2021_06_01.models.Table] + :ivar next_link: Request URL that can be used to query next page of tables. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Table]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ListTableResource, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class ListTableServices(msrest.serialization.Model): + """ListTableServices. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of table services returned. + :vartype value: list[~azure.mgmt.storage.v2021_06_01.models.TableServiceProperties] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[TableServiceProperties]'}, + } + + def __init__( + self, + **kwargs + ): + super(ListTableServices, self).__init__(**kwargs) + self.value = None + + +class ManagementPolicy(Resource): + """The Get Storage Account ManagementPolicies operation response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar last_modified_time: Returns the date and time the ManagementPolicies was last modified. + :vartype last_modified_time: ~datetime.datetime + :param policy: The Storage Account ManagementPolicy, in JSON format. See more details in: + https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + :type policy: ~azure.mgmt.storage.v2021_06_01.models.ManagementPolicySchema + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'policy': {'key': 'properties.policy', 'type': 'ManagementPolicySchema'}, + } + + def __init__( + self, + *, + policy: Optional["ManagementPolicySchema"] = None, + **kwargs + ): + super(ManagementPolicy, self).__init__(**kwargs) + self.last_modified_time = None + self.policy = policy + + +class ManagementPolicyAction(msrest.serialization.Model): + """Actions are applied to the filtered blobs when the execution condition is met. + + :param base_blob: The management policy action for base blob. + :type base_blob: ~azure.mgmt.storage.v2021_06_01.models.ManagementPolicyBaseBlob + :param snapshot: The management policy action for snapshot. + :type snapshot: ~azure.mgmt.storage.v2021_06_01.models.ManagementPolicySnapShot + :param version: The management policy action for version. + :type version: ~azure.mgmt.storage.v2021_06_01.models.ManagementPolicyVersion + """ + + _attribute_map = { + 'base_blob': {'key': 'baseBlob', 'type': 'ManagementPolicyBaseBlob'}, + 'snapshot': {'key': 'snapshot', 'type': 'ManagementPolicySnapShot'}, + 'version': {'key': 'version', 'type': 'ManagementPolicyVersion'}, + } + + def __init__( + self, + *, + base_blob: Optional["ManagementPolicyBaseBlob"] = None, + snapshot: Optional["ManagementPolicySnapShot"] = None, + version: Optional["ManagementPolicyVersion"] = None, + **kwargs + ): + super(ManagementPolicyAction, self).__init__(**kwargs) + self.base_blob = base_blob + self.snapshot = snapshot + self.version = version + + +class ManagementPolicyBaseBlob(msrest.serialization.Model): + """Management policy action for base blob. + + :param tier_to_cool: The function to tier blobs to cool storage. Support blobs currently at Hot + tier. + :type tier_to_cool: ~azure.mgmt.storage.v2021_06_01.models.DateAfterModification + :param tier_to_archive: The function to tier blobs to archive storage. Support blobs currently + at Hot or Cool tier. + :type tier_to_archive: ~azure.mgmt.storage.v2021_06_01.models.DateAfterModification + :param delete: The function to delete the blob. + :type delete: ~azure.mgmt.storage.v2021_06_01.models.DateAfterModification + :param enable_auto_tier_to_hot_from_cool: This property enables auto tiering of a blob from + cool to hot on a blob access. This property requires + tierToCool.daysAfterLastAccessTimeGreaterThan. + :type enable_auto_tier_to_hot_from_cool: bool + """ + + _attribute_map = { + 'tier_to_cool': {'key': 'tierToCool', 'type': 'DateAfterModification'}, + 'tier_to_archive': {'key': 'tierToArchive', 'type': 'DateAfterModification'}, + 'delete': {'key': 'delete', 'type': 'DateAfterModification'}, + 'enable_auto_tier_to_hot_from_cool': {'key': 'enableAutoTierToHotFromCool', 'type': 'bool'}, + } + + def __init__( + self, + *, + tier_to_cool: Optional["DateAfterModification"] = None, + tier_to_archive: Optional["DateAfterModification"] = None, + delete: Optional["DateAfterModification"] = None, + enable_auto_tier_to_hot_from_cool: Optional[bool] = None, + **kwargs + ): + super(ManagementPolicyBaseBlob, self).__init__(**kwargs) + self.tier_to_cool = tier_to_cool + self.tier_to_archive = tier_to_archive + self.delete = delete + self.enable_auto_tier_to_hot_from_cool = enable_auto_tier_to_hot_from_cool + + +class ManagementPolicyDefinition(msrest.serialization.Model): + """An object that defines the Lifecycle rule. Each definition is made up with a filters set and an actions set. + + All required parameters must be populated in order to send to Azure. + + :param actions: Required. An object that defines the action set. + :type actions: ~azure.mgmt.storage.v2021_06_01.models.ManagementPolicyAction + :param filters: An object that defines the filter set. + :type filters: ~azure.mgmt.storage.v2021_06_01.models.ManagementPolicyFilter + """ + + _validation = { + 'actions': {'required': True}, + } + + _attribute_map = { + 'actions': {'key': 'actions', 'type': 'ManagementPolicyAction'}, + 'filters': {'key': 'filters', 'type': 'ManagementPolicyFilter'}, + } + + def __init__( + self, + *, + actions: "ManagementPolicyAction", + filters: Optional["ManagementPolicyFilter"] = None, + **kwargs + ): + super(ManagementPolicyDefinition, self).__init__(**kwargs) + self.actions = actions + self.filters = filters + + +class ManagementPolicyFilter(msrest.serialization.Model): + """Filters limit rule actions to a subset of blobs within the storage account. If multiple filters are defined, a logical AND is performed on all filters. + + All required parameters must be populated in order to send to Azure. + + :param prefix_match: An array of strings for prefixes to be match. + :type prefix_match: list[str] + :param blob_types: Required. An array of predefined enum values. Currently blockBlob supports + all tiering and delete actions. Only delete actions are supported for appendBlob. + :type blob_types: list[str] + :param blob_index_match: An array of blob index tag based filters, there can be at most 10 tag + filters. + :type blob_index_match: list[~azure.mgmt.storage.v2021_06_01.models.TagFilter] + """ + + _validation = { + 'blob_types': {'required': True}, + } + + _attribute_map = { + 'prefix_match': {'key': 'prefixMatch', 'type': '[str]'}, + 'blob_types': {'key': 'blobTypes', 'type': '[str]'}, + 'blob_index_match': {'key': 'blobIndexMatch', 'type': '[TagFilter]'}, + } + + def __init__( + self, + *, + blob_types: List[str], + prefix_match: Optional[List[str]] = None, + blob_index_match: Optional[List["TagFilter"]] = None, + **kwargs + ): + super(ManagementPolicyFilter, self).__init__(**kwargs) + self.prefix_match = prefix_match + self.blob_types = blob_types + self.blob_index_match = blob_index_match + + +class ManagementPolicyRule(msrest.serialization.Model): + """An object that wraps the Lifecycle rule. Each rule is uniquely defined by name. + + All required parameters must be populated in order to send to Azure. + + :param enabled: Rule is enabled if set to true. + :type enabled: bool + :param name: Required. A rule name can contain any combination of alpha numeric characters. + Rule name is case-sensitive. It must be unique within a policy. + :type name: str + :param type: Required. The valid value is Lifecycle. Possible values include: "Lifecycle". + :type type: str or ~azure.mgmt.storage.v2021_06_01.models.RuleType + :param definition: Required. An object that defines the Lifecycle rule. + :type definition: ~azure.mgmt.storage.v2021_06_01.models.ManagementPolicyDefinition + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + 'definition': {'required': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'definition': {'key': 'definition', 'type': 'ManagementPolicyDefinition'}, + } + + def __init__( + self, + *, + name: str, + type: Union[str, "RuleType"], + definition: "ManagementPolicyDefinition", + enabled: Optional[bool] = None, + **kwargs + ): + super(ManagementPolicyRule, self).__init__(**kwargs) + self.enabled = enabled + self.name = name + self.type = type + self.definition = definition + + +class ManagementPolicySchema(msrest.serialization.Model): + """The Storage Account ManagementPolicies Rules. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + + All required parameters must be populated in order to send to Azure. + + :param rules: Required. The Storage Account ManagementPolicies Rules. See more details in: + https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + :type rules: list[~azure.mgmt.storage.v2021_06_01.models.ManagementPolicyRule] + """ + + _validation = { + 'rules': {'required': True}, + } + + _attribute_map = { + 'rules': {'key': 'rules', 'type': '[ManagementPolicyRule]'}, + } + + def __init__( + self, + *, + rules: List["ManagementPolicyRule"], + **kwargs + ): + super(ManagementPolicySchema, self).__init__(**kwargs) + self.rules = rules + + +class ManagementPolicySnapShot(msrest.serialization.Model): + """Management policy action for snapshot. + + :param tier_to_cool: The function to tier blob snapshot to cool storage. Support blob snapshot + currently at Hot tier. + :type tier_to_cool: ~azure.mgmt.storage.v2021_06_01.models.DateAfterCreation + :param tier_to_archive: The function to tier blob snapshot to archive storage. Support blob + snapshot currently at Hot or Cool tier. + :type tier_to_archive: ~azure.mgmt.storage.v2021_06_01.models.DateAfterCreation + :param delete: The function to delete the blob snapshot. + :type delete: ~azure.mgmt.storage.v2021_06_01.models.DateAfterCreation + """ + + _attribute_map = { + 'tier_to_cool': {'key': 'tierToCool', 'type': 'DateAfterCreation'}, + 'tier_to_archive': {'key': 'tierToArchive', 'type': 'DateAfterCreation'}, + 'delete': {'key': 'delete', 'type': 'DateAfterCreation'}, + } + + def __init__( + self, + *, + tier_to_cool: Optional["DateAfterCreation"] = None, + tier_to_archive: Optional["DateAfterCreation"] = None, + delete: Optional["DateAfterCreation"] = None, + **kwargs + ): + super(ManagementPolicySnapShot, self).__init__(**kwargs) + self.tier_to_cool = tier_to_cool + self.tier_to_archive = tier_to_archive + self.delete = delete + + +class ManagementPolicyVersion(msrest.serialization.Model): + """Management policy action for blob version. + + :param tier_to_cool: The function to tier blob version to cool storage. Support blob version + currently at Hot tier. + :type tier_to_cool: ~azure.mgmt.storage.v2021_06_01.models.DateAfterCreation + :param tier_to_archive: The function to tier blob version to archive storage. Support blob + version currently at Hot or Cool tier. + :type tier_to_archive: ~azure.mgmt.storage.v2021_06_01.models.DateAfterCreation + :param delete: The function to delete the blob version. + :type delete: ~azure.mgmt.storage.v2021_06_01.models.DateAfterCreation + """ + + _attribute_map = { + 'tier_to_cool': {'key': 'tierToCool', 'type': 'DateAfterCreation'}, + 'tier_to_archive': {'key': 'tierToArchive', 'type': 'DateAfterCreation'}, + 'delete': {'key': 'delete', 'type': 'DateAfterCreation'}, + } + + def __init__( + self, + *, + tier_to_cool: Optional["DateAfterCreation"] = None, + tier_to_archive: Optional["DateAfterCreation"] = None, + delete: Optional["DateAfterCreation"] = None, + **kwargs + ): + super(ManagementPolicyVersion, self).__init__(**kwargs) + self.tier_to_cool = tier_to_cool + self.tier_to_archive = tier_to_archive + self.delete = delete + + +class MetricSpecification(msrest.serialization.Model): + """Metric specification of operation. + + :param name: Name of metric specification. + :type name: str + :param display_name: Display name of metric specification. + :type display_name: str + :param display_description: Display description of metric specification. + :type display_description: str + :param unit: Unit could be Bytes or Count. + :type unit: str + :param dimensions: Dimensions of blobs, including blob type and access tier. + :type dimensions: list[~azure.mgmt.storage.v2021_06_01.models.Dimension] + :param aggregation_type: Aggregation type could be Average. + :type aggregation_type: str + :param fill_gap_with_zero: The property to decide fill gap with zero or not. + :type fill_gap_with_zero: bool + :param category: The category this metric specification belong to, could be Capacity. + :type category: str + :param resource_id_dimension_name_override: Account Resource Id. + :type resource_id_dimension_name_override: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'category': {'key': 'category', 'type': 'str'}, + 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display_name: Optional[str] = None, + display_description: Optional[str] = None, + unit: Optional[str] = None, + dimensions: Optional[List["Dimension"]] = None, + aggregation_type: Optional[str] = None, + fill_gap_with_zero: Optional[bool] = None, + category: Optional[str] = None, + resource_id_dimension_name_override: Optional[str] = None, + **kwargs + ): + super(MetricSpecification, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.display_description = display_description + self.unit = unit + self.dimensions = dimensions + self.aggregation_type = aggregation_type + self.fill_gap_with_zero = fill_gap_with_zero + self.category = category + self.resource_id_dimension_name_override = resource_id_dimension_name_override + + +class Multichannel(msrest.serialization.Model): + """Multichannel setting. Applies to Premium FileStorage only. + + :param enabled: Indicates whether multichannel is enabled. + :type enabled: bool + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__( + self, + *, + enabled: Optional[bool] = None, + **kwargs + ): + super(Multichannel, self).__init__(**kwargs) + self.enabled = enabled + + +class NetworkRuleSet(msrest.serialization.Model): + """Network rule set. + + All required parameters must be populated in order to send to Azure. + + :param bypass: Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. + Possible values are any combination of Logging|Metrics|AzureServices (For example, "Logging, + Metrics"), or None to bypass none of those traffics. Possible values include: "None", + "Logging", "Metrics", "AzureServices". Default value: "AzureServices". + :type bypass: str or ~azure.mgmt.storage.v2021_06_01.models.Bypass + :param resource_access_rules: Sets the resource access rules. + :type resource_access_rules: list[~azure.mgmt.storage.v2021_06_01.models.ResourceAccessRule] + :param virtual_network_rules: Sets the virtual network rules. + :type virtual_network_rules: list[~azure.mgmt.storage.v2021_06_01.models.VirtualNetworkRule] + :param ip_rules: Sets the IP ACL rules. + :type ip_rules: list[~azure.mgmt.storage.v2021_06_01.models.IPRule] + :param default_action: Required. Specifies the default action of allow or deny when no other + rules match. Possible values include: "Allow", "Deny". Default value: "Allow". + :type default_action: str or ~azure.mgmt.storage.v2021_06_01.models.DefaultAction + """ + + _validation = { + 'default_action': {'required': True}, + } + + _attribute_map = { + 'bypass': {'key': 'bypass', 'type': 'str'}, + 'resource_access_rules': {'key': 'resourceAccessRules', 'type': '[ResourceAccessRule]'}, + 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, + 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, + 'default_action': {'key': 'defaultAction', 'type': 'str'}, + } + + def __init__( + self, + *, + default_action: Union[str, "DefaultAction"] = "Allow", + bypass: Optional[Union[str, "Bypass"]] = "AzureServices", + resource_access_rules: Optional[List["ResourceAccessRule"]] = None, + virtual_network_rules: Optional[List["VirtualNetworkRule"]] = None, + ip_rules: Optional[List["IPRule"]] = None, + **kwargs + ): + super(NetworkRuleSet, self).__init__(**kwargs) + self.bypass = bypass + self.resource_access_rules = resource_access_rules + self.virtual_network_rules = virtual_network_rules + self.ip_rules = ip_rules + self.default_action = default_action + + +class ObjectReplicationPolicies(msrest.serialization.Model): + """List storage account object replication policies. + + :param value: The replication policy between two storage accounts. + :type value: list[~azure.mgmt.storage.v2021_06_01.models.ObjectReplicationPolicy] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ObjectReplicationPolicy]'}, + } + + def __init__( + self, + *, + value: Optional[List["ObjectReplicationPolicy"]] = None, + **kwargs + ): + super(ObjectReplicationPolicies, self).__init__(**kwargs) + self.value = value + + +class ObjectReplicationPolicy(Resource): + """The replication policy between two storage accounts. Multiple rules can be defined in one policy. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar policy_id: A unique id for object replication policy. + :vartype policy_id: str + :ivar enabled_time: Indicates when the policy is enabled on the source account. + :vartype enabled_time: ~datetime.datetime + :param source_account: Required. Source account name. It should be full resource id if + allowCrossTenantReplication set to false. + :type source_account: str + :param destination_account: Required. Destination account name. It should be full resource id + if allowCrossTenantReplication set to false. + :type destination_account: str + :param rules: The storage account object replication rules. + :type rules: list[~azure.mgmt.storage.v2021_06_01.models.ObjectReplicationPolicyRule] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'policy_id': {'readonly': True}, + 'enabled_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'policy_id': {'key': 'properties.policyId', 'type': 'str'}, + 'enabled_time': {'key': 'properties.enabledTime', 'type': 'iso-8601'}, + 'source_account': {'key': 'properties.sourceAccount', 'type': 'str'}, + 'destination_account': {'key': 'properties.destinationAccount', 'type': 'str'}, + 'rules': {'key': 'properties.rules', 'type': '[ObjectReplicationPolicyRule]'}, + } + + def __init__( + self, + *, + source_account: Optional[str] = None, + destination_account: Optional[str] = None, + rules: Optional[List["ObjectReplicationPolicyRule"]] = None, + **kwargs + ): + super(ObjectReplicationPolicy, self).__init__(**kwargs) + self.policy_id = None + self.enabled_time = None + self.source_account = source_account + self.destination_account = destination_account + self.rules = rules + + +class ObjectReplicationPolicyFilter(msrest.serialization.Model): + """Filters limit replication to a subset of blobs within the storage account. A logical OR is performed on values in the filter. If multiple filters are defined, a logical AND is performed on all filters. + + :param prefix_match: Optional. Filters the results to replicate only blobs whose names begin + with the specified prefix. + :type prefix_match: list[str] + :param min_creation_time: Blobs created after the time will be replicated to the destination. + It must be in datetime format 'yyyy-MM-ddTHH:mm:ssZ'. Example: 2020-02-19T16:05:00Z. + :type min_creation_time: str + """ + + _attribute_map = { + 'prefix_match': {'key': 'prefixMatch', 'type': '[str]'}, + 'min_creation_time': {'key': 'minCreationTime', 'type': 'str'}, + } + + def __init__( + self, + *, + prefix_match: Optional[List[str]] = None, + min_creation_time: Optional[str] = None, + **kwargs + ): + super(ObjectReplicationPolicyFilter, self).__init__(**kwargs) + self.prefix_match = prefix_match + self.min_creation_time = min_creation_time + + +class ObjectReplicationPolicyRule(msrest.serialization.Model): + """The replication policy rule between two containers. + + All required parameters must be populated in order to send to Azure. + + :param rule_id: Rule Id is auto-generated for each new rule on destination account. It is + required for put policy on source account. + :type rule_id: str + :param source_container: Required. Required. Source container name. + :type source_container: str + :param destination_container: Required. Required. Destination container name. + :type destination_container: str + :param filters: Optional. An object that defines the filter set. + :type filters: ~azure.mgmt.storage.v2021_06_01.models.ObjectReplicationPolicyFilter + """ + + _validation = { + 'source_container': {'required': True}, + 'destination_container': {'required': True}, + } + + _attribute_map = { + 'rule_id': {'key': 'ruleId', 'type': 'str'}, + 'source_container': {'key': 'sourceContainer', 'type': 'str'}, + 'destination_container': {'key': 'destinationContainer', 'type': 'str'}, + 'filters': {'key': 'filters', 'type': 'ObjectReplicationPolicyFilter'}, + } + + def __init__( + self, + *, + source_container: str, + destination_container: str, + rule_id: Optional[str] = None, + filters: Optional["ObjectReplicationPolicyFilter"] = None, + **kwargs + ): + super(ObjectReplicationPolicyRule, self).__init__(**kwargs) + self.rule_id = rule_id + self.source_container = source_container + self.destination_container = destination_container + self.filters = filters + + +class Operation(msrest.serialization.Model): + """Storage REST API operation definition. + + :param name: Operation name: {provider}/{resource}/{operation}. + :type name: str + :param display: Display metadata associated with the operation. + :type display: ~azure.mgmt.storage.v2021_06_01.models.OperationDisplay + :param origin: The origin of operations. + :type origin: str + :param service_specification: One property of operation, include metric specifications. + :type service_specification: ~azure.mgmt.storage.v2021_06_01.models.ServiceSpecification + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display: Optional["OperationDisplay"] = None, + origin: Optional[str] = None, + service_specification: Optional["ServiceSpecification"] = None, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display + self.origin = origin + self.service_specification = service_specification + + +class OperationDisplay(msrest.serialization.Model): + """Display metadata associated with the operation. + + :param provider: Service provider: Microsoft Storage. + :type provider: str + :param resource: Resource on which the operation is performed etc. + :type resource: str + :param operation: Type of operation: get, read, delete, etc. + :type operation: str + :param description: Description of the operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + *, + provider: Optional[str] = None, + resource: Optional[str] = None, + operation: Optional[str] = None, + description: Optional[str] = None, + **kwargs + ): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description + + +class OperationListResult(msrest.serialization.Model): + """Result of the request to list Storage operations. It contains a list of operations and a URL link to get the next set of results. + + :param value: List of Storage operations supported by the Storage resource provider. + :type value: list[~azure.mgmt.storage.v2021_06_01.models.Operation] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + } + + def __init__( + self, + *, + value: Optional[List["Operation"]] = None, + **kwargs + ): + super(OperationListResult, self).__init__(**kwargs) + self.value = value + + +class PrivateEndpoint(msrest.serialization.Model): + """The Private Endpoint resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The ARM identifier for Private Endpoint. + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpoint, self).__init__(**kwargs) + self.id = None + + +class PrivateEndpointConnection(Resource): + """The Private Endpoint Connection resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param private_endpoint: The resource of private end point. + :type private_endpoint: ~azure.mgmt.storage.v2021_06_01.models.PrivateEndpoint + :param private_link_service_connection_state: A collection of information about the state of + the connection between service consumer and provider. + :type private_link_service_connection_state: + ~azure.mgmt.storage.v2021_06_01.models.PrivateLinkServiceConnectionState + :ivar provisioning_state: The provisioning state of the private endpoint connection resource. + Possible values include: "Succeeded", "Creating", "Deleting", "Failed". + :vartype provisioning_state: str or + ~azure.mgmt.storage.v2021_06_01.models.PrivateEndpointConnectionProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + private_endpoint: Optional["PrivateEndpoint"] = None, + private_link_service_connection_state: Optional["PrivateLinkServiceConnectionState"] = None, + **kwargs + ): + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.private_endpoint = private_endpoint + self.private_link_service_connection_state = private_link_service_connection_state + self.provisioning_state = None + + +class PrivateEndpointConnectionListResult(msrest.serialization.Model): + """List of private endpoint connection associated with the specified storage account. + + :param value: Array of private endpoint connections. + :type value: list[~azure.mgmt.storage.v2021_06_01.models.PrivateEndpointConnection] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, + } + + def __init__( + self, + *, + value: Optional[List["PrivateEndpointConnection"]] = None, + **kwargs + ): + super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) + self.value = value + + +class PrivateLinkResource(Resource): + """A private link resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar group_id: The private link resource group id. + :vartype group_id: str + :ivar required_members: The private link resource required member names. + :vartype required_members: list[str] + :param required_zone_names: The private link resource Private link DNS zone name. + :type required_zone_names: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'group_id': {'readonly': True}, + 'required_members': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'group_id': {'key': 'properties.groupId', 'type': 'str'}, + 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, + 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, + } + + def __init__( + self, + *, + required_zone_names: Optional[List[str]] = None, + **kwargs + ): + super(PrivateLinkResource, self).__init__(**kwargs) + self.group_id = None + self.required_members = None + self.required_zone_names = required_zone_names + + +class PrivateLinkResourceListResult(msrest.serialization.Model): + """A list of private link resources. + + :param value: Array of private link resources. + :type value: list[~azure.mgmt.storage.v2021_06_01.models.PrivateLinkResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + } + + def __init__( + self, + *, + value: Optional[List["PrivateLinkResource"]] = None, + **kwargs + ): + super(PrivateLinkResourceListResult, self).__init__(**kwargs) + self.value = value + + +class PrivateLinkServiceConnectionState(msrest.serialization.Model): + """A collection of information about the state of the connection between service consumer and provider. + + :param status: Indicates whether the connection has been Approved/Rejected/Removed by the owner + of the service. Possible values include: "Pending", "Approved", "Rejected". + :type status: str or + ~azure.mgmt.storage.v2021_06_01.models.PrivateEndpointServiceConnectionStatus + :param description: The reason for approval/rejection of the connection. + :type description: str + :param action_required: A message indicating if changes on the service provider require any + updates on the consumer. + :type action_required: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'action_required': {'key': 'actionRequired', 'type': 'str'}, + } + + def __init__( + self, + *, + status: Optional[Union[str, "PrivateEndpointServiceConnectionStatus"]] = None, + description: Optional[str] = None, + action_required: Optional[str] = None, + **kwargs + ): + super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.status = status + self.description = description + self.action_required = action_required + + +class ProtectedAppendWritesHistory(msrest.serialization.Model): + """Protected append writes history setting for the blob container with Legal holds. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param allow_protected_append_writes_all: When enabled, new blocks can be written to both + 'Append and Bock Blobs' while maintaining legal hold protection and compliance. Only new blocks + can be added and any existing blocks cannot be modified or deleted. + :type allow_protected_append_writes_all: bool + :ivar timestamp: Returns the date and time the tag was added. + :vartype timestamp: ~datetime.datetime + """ + + _validation = { + 'timestamp': {'readonly': True}, + } + + _attribute_map = { + 'allow_protected_append_writes_all': {'key': 'allowProtectedAppendWritesAll', 'type': 'bool'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + allow_protected_append_writes_all: Optional[bool] = None, + **kwargs + ): + super(ProtectedAppendWritesHistory, self).__init__(**kwargs) + self.allow_protected_append_writes_all = allow_protected_append_writes_all + self.timestamp = None + + +class ProtocolSettings(msrest.serialization.Model): + """Protocol settings for file service. + + :param smb: Setting for SMB protocol. + :type smb: ~azure.mgmt.storage.v2021_06_01.models.SmbSetting + """ + + _attribute_map = { + 'smb': {'key': 'smb', 'type': 'SmbSetting'}, + } + + def __init__( + self, + *, + smb: Optional["SmbSetting"] = None, + **kwargs + ): + super(ProtocolSettings, self).__init__(**kwargs) + self.smb = smb + + +class QueueServiceProperties(Resource): + """The properties of a storage account’s Queue service. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param cors: Specifies CORS rules for the Queue service. You can include up to five CorsRule + elements in the request. If no CorsRule elements are included in the request body, all CORS + rules will be deleted, and CORS will be disabled for the Queue service. + :type cors: ~azure.mgmt.storage.v2021_06_01.models.CorsRules + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'cors': {'key': 'properties.cors', 'type': 'CorsRules'}, + } + + def __init__( + self, + *, + cors: Optional["CorsRules"] = None, + **kwargs + ): + super(QueueServiceProperties, self).__init__(**kwargs) + self.cors = cors + + +class ResourceAccessRule(msrest.serialization.Model): + """Resource Access Rule. + + :param tenant_id: Tenant Id. + :type tenant_id: str + :param resource_id: Resource Id. + :type resource_id: str + """ + + _attribute_map = { + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + } + + def __init__( + self, + *, + tenant_id: Optional[str] = None, + resource_id: Optional[str] = None, + **kwargs + ): + super(ResourceAccessRule, self).__init__(**kwargs) + self.tenant_id = tenant_id + self.resource_id = resource_id + + +class RestorePolicyProperties(msrest.serialization.Model): + """The blob service properties for blob restore policy. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. Blob restore is enabled if set to true. + :type enabled: bool + :param days: how long this blob can be restored. It should be great than zero and less than + DeleteRetentionPolicy.days. + :type days: int + :ivar last_enabled_time: Deprecated in favor of minRestoreTime property. + :vartype last_enabled_time: ~datetime.datetime + :ivar min_restore_time: Returns the minimum date and time that the restore can be started. + :vartype min_restore_time: ~datetime.datetime + """ + + _validation = { + 'enabled': {'required': True}, + 'days': {'maximum': 365, 'minimum': 1}, + 'last_enabled_time': {'readonly': True}, + 'min_restore_time': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'days': {'key': 'days', 'type': 'int'}, + 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, + 'min_restore_time': {'key': 'minRestoreTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + enabled: bool, + days: Optional[int] = None, + **kwargs + ): + super(RestorePolicyProperties, self).__init__(**kwargs) + self.enabled = enabled + self.days = days + self.last_enabled_time = None + self.min_restore_time = None + + +class Restriction(msrest.serialization.Model): + """The restriction because of which SKU cannot be used. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The type of restrictions. As of now only possible value for this is location. + :vartype type: str + :ivar values: The value of restrictions. If the restriction type is set to location. This would + be different locations where the SKU is restricted. + :vartype values: list[str] + :param reason_code: The reason for the restriction. As of now this can be "QuotaId" or + "NotAvailableForSubscription". Quota Id is set when the SKU has requiredQuotas parameter as the + subscription does not belong to that quota. The "NotAvailableForSubscription" is related to + capacity at DC. Possible values include: "QuotaId", "NotAvailableForSubscription". + :type reason_code: str or ~azure.mgmt.storage.v2021_06_01.models.ReasonCode + """ + + _validation = { + 'type': {'readonly': True}, + 'values': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'reason_code': {'key': 'reasonCode', 'type': 'str'}, + } + + def __init__( + self, + *, + reason_code: Optional[Union[str, "ReasonCode"]] = None, + **kwargs + ): + super(Restriction, self).__init__(**kwargs) + self.type = None + self.values = None + self.reason_code = reason_code + + +class RoutingPreference(msrest.serialization.Model): + """Routing preference defines the type of network, either microsoft or internet routing to be used to deliver the user data, the default option is microsoft routing. + + :param routing_choice: Routing Choice defines the kind of network routing opted by the user. + Possible values include: "MicrosoftRouting", "InternetRouting". + :type routing_choice: str or ~azure.mgmt.storage.v2021_06_01.models.RoutingChoice + :param publish_microsoft_endpoints: A boolean flag which indicates whether microsoft routing + storage endpoints are to be published. + :type publish_microsoft_endpoints: bool + :param publish_internet_endpoints: A boolean flag which indicates whether internet routing + storage endpoints are to be published. + :type publish_internet_endpoints: bool + """ + + _attribute_map = { + 'routing_choice': {'key': 'routingChoice', 'type': 'str'}, + 'publish_microsoft_endpoints': {'key': 'publishMicrosoftEndpoints', 'type': 'bool'}, + 'publish_internet_endpoints': {'key': 'publishInternetEndpoints', 'type': 'bool'}, + } + + def __init__( + self, + *, + routing_choice: Optional[Union[str, "RoutingChoice"]] = None, + publish_microsoft_endpoints: Optional[bool] = None, + publish_internet_endpoints: Optional[bool] = None, + **kwargs + ): + super(RoutingPreference, self).__init__(**kwargs) + self.routing_choice = routing_choice + self.publish_microsoft_endpoints = publish_microsoft_endpoints + self.publish_internet_endpoints = publish_internet_endpoints + + +class SasPolicy(msrest.serialization.Model): + """SasPolicy assigned to the storage account. + + All required parameters must be populated in order to send to Azure. + + :param sas_expiration_period: Required. The SAS expiration period, DD.HH:MM:SS. + :type sas_expiration_period: str + :param expiration_action: Required. The SAS expiration action. Can only be Log. Possible values + include: "Log". Default value: "Log". + :type expiration_action: str or ~azure.mgmt.storage.v2021_06_01.models.ExpirationAction + """ + + _validation = { + 'sas_expiration_period': {'required': True}, + 'expiration_action': {'required': True}, + } + + _attribute_map = { + 'sas_expiration_period': {'key': 'sasExpirationPeriod', 'type': 'str'}, + 'expiration_action': {'key': 'expirationAction', 'type': 'str'}, + } + + def __init__( + self, + *, + sas_expiration_period: str, + expiration_action: Union[str, "ExpirationAction"] = "Log", + **kwargs + ): + super(SasPolicy, self).__init__(**kwargs) + self.sas_expiration_period = sas_expiration_period + self.expiration_action = expiration_action + + +class ServiceSasParameters(msrest.serialization.Model): + """The parameters to list service SAS credentials of a specific resource. + + All required parameters must be populated in order to send to Azure. + + :param canonicalized_resource: Required. The canonical path to the signed resource. + :type canonicalized_resource: str + :param resource: The signed services accessible with the service SAS. Possible values include: + Blob (b), Container (c), File (f), Share (s). Possible values include: "b", "c", "f", "s". + :type resource: str or ~azure.mgmt.storage.v2021_06_01.models.SignedResource + :param permissions: The signed permissions for the service SAS. Possible values include: Read + (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). Possible + values include: "r", "d", "w", "l", "a", "c", "u", "p". + :type permissions: str or ~azure.mgmt.storage.v2021_06_01.models.Permissions + :param ip_address_or_range: An IP address or a range of IP addresses from which to accept + requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the account SAS. Possible + values include: "https,http", "https". + :type protocols: str or ~azure.mgmt.storage.v2021_06_01.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: ~datetime.datetime + :param shared_access_expiry_time: The time at which the shared access signature becomes + invalid. + :type shared_access_expiry_time: ~datetime.datetime + :param identifier: A unique value up to 64 characters in length that correlates to an access + policy specified for the container, queue, or table. + :type identifier: str + :param partition_key_start: The start of partition key. + :type partition_key_start: str + :param partition_key_end: The end of partition key. + :type partition_key_end: str + :param row_key_start: The start of row key. + :type row_key_start: str + :param row_key_end: The end of row key. + :type row_key_end: str + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + :param cache_control: The response header override for cache control. + :type cache_control: str + :param content_disposition: The response header override for content disposition. + :type content_disposition: str + :param content_encoding: The response header override for content encoding. + :type content_encoding: str + :param content_language: The response header override for content language. + :type content_language: str + :param content_type: The response header override for content type. + :type content_type: str + """ + + _validation = { + 'canonicalized_resource': {'required': True}, + 'identifier': {'max_length': 64, 'min_length': 0}, + } + + _attribute_map = { + 'canonicalized_resource': {'key': 'canonicalizedResource', 'type': 'str'}, + 'resource': {'key': 'signedResource', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'str'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'identifier': {'key': 'signedIdentifier', 'type': 'str'}, + 'partition_key_start': {'key': 'startPk', 'type': 'str'}, + 'partition_key_end': {'key': 'endPk', 'type': 'str'}, + 'row_key_start': {'key': 'startRk', 'type': 'str'}, + 'row_key_end': {'key': 'endRk', 'type': 'str'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + 'cache_control': {'key': 'rscc', 'type': 'str'}, + 'content_disposition': {'key': 'rscd', 'type': 'str'}, + 'content_encoding': {'key': 'rsce', 'type': 'str'}, + 'content_language': {'key': 'rscl', 'type': 'str'}, + 'content_type': {'key': 'rsct', 'type': 'str'}, + } + + def __init__( + self, + *, + canonicalized_resource: str, + resource: Optional[Union[str, "SignedResource"]] = None, + permissions: Optional[Union[str, "Permissions"]] = None, + ip_address_or_range: Optional[str] = None, + protocols: Optional[Union[str, "HttpProtocol"]] = None, + shared_access_start_time: Optional[datetime.datetime] = None, + shared_access_expiry_time: Optional[datetime.datetime] = None, + identifier: Optional[str] = None, + partition_key_start: Optional[str] = None, + partition_key_end: Optional[str] = None, + row_key_start: Optional[str] = None, + row_key_end: Optional[str] = None, + key_to_sign: Optional[str] = None, + cache_control: Optional[str] = None, + content_disposition: Optional[str] = None, + content_encoding: Optional[str] = None, + content_language: Optional[str] = None, + content_type: Optional[str] = None, + **kwargs + ): + super(ServiceSasParameters, self).__init__(**kwargs) + self.canonicalized_resource = canonicalized_resource + self.resource = resource + self.permissions = permissions + self.ip_address_or_range = ip_address_or_range + self.protocols = protocols + self.shared_access_start_time = shared_access_start_time + self.shared_access_expiry_time = shared_access_expiry_time + self.identifier = identifier + self.partition_key_start = partition_key_start + self.partition_key_end = partition_key_end + self.row_key_start = row_key_start + self.row_key_end = row_key_end + self.key_to_sign = key_to_sign + self.cache_control = cache_control + self.content_disposition = content_disposition + self.content_encoding = content_encoding + self.content_language = content_language + self.content_type = content_type + + +class ServiceSpecification(msrest.serialization.Model): + """One property of operation, include metric specifications. + + :param metric_specifications: Metric specifications of operation. + :type metric_specifications: list[~azure.mgmt.storage.v2021_06_01.models.MetricSpecification] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + } + + def __init__( + self, + *, + metric_specifications: Optional[List["MetricSpecification"]] = None, + **kwargs + ): + super(ServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = metric_specifications + + +class SignedIdentifier(msrest.serialization.Model): + """SignedIdentifier. + + :param id: An unique identifier of the stored access policy. + :type id: str + :param access_policy: Access policy. + :type access_policy: ~azure.mgmt.storage.v2021_06_01.models.AccessPolicy + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'access_policy': {'key': 'accessPolicy', 'type': 'AccessPolicy'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + access_policy: Optional["AccessPolicy"] = None, + **kwargs + ): + super(SignedIdentifier, self).__init__(**kwargs) + self.id = id + self.access_policy = access_policy + + +class Sku(msrest.serialization.Model): + """The SKU of the storage account. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The SKU name. Required for account creation; optional for update. Note + that in older versions, SKU name was called accountType. Possible values include: + "Standard_LRS", "Standard_GRS", "Standard_RAGRS", "Standard_ZRS", "Premium_LRS", "Premium_ZRS", + "Standard_GZRS", "Standard_RAGZRS". + :type name: str or ~azure.mgmt.storage.v2021_06_01.models.SkuName + :ivar tier: The SKU tier. This is based on the SKU name. Possible values include: "Standard", + "Premium". + :vartype tier: str or ~azure.mgmt.storage.v2021_06_01.models.SkuTier + """ + + _validation = { + 'name': {'required': True}, + 'tier': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Union[str, "SkuName"], + **kwargs + ): + super(Sku, self).__init__(**kwargs) + self.name = name + self.tier = None + + +class SKUCapability(msrest.serialization.Model): + """The capability information in the specified SKU, including file encryption, network ACLs, change notification, etc. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The name of capability, The capability information in the specified SKU, including + file encryption, network ACLs, change notification, etc. + :vartype name: str + :ivar value: A string value to indicate states of given capability. Possibly 'true' or 'false'. + :vartype value: str + """ + + _validation = { + 'name': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SKUCapability, self).__init__(**kwargs) + self.name = None + self.value = None + + +class SkuInformation(msrest.serialization.Model): + """Storage SKU and its properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The SKU name. Required for account creation; optional for update. Note + that in older versions, SKU name was called accountType. Possible values include: + "Standard_LRS", "Standard_GRS", "Standard_RAGRS", "Standard_ZRS", "Premium_LRS", "Premium_ZRS", + "Standard_GZRS", "Standard_RAGZRS". + :type name: str or ~azure.mgmt.storage.v2021_06_01.models.SkuName + :ivar tier: The SKU tier. This is based on the SKU name. Possible values include: "Standard", + "Premium". + :vartype tier: str or ~azure.mgmt.storage.v2021_06_01.models.SkuTier + :ivar resource_type: The type of the resource, usually it is 'storageAccounts'. + :vartype resource_type: str + :ivar kind: Indicates the type of storage account. Possible values include: "Storage", + "StorageV2", "BlobStorage", "FileStorage", "BlockBlobStorage". + :vartype kind: str or ~azure.mgmt.storage.v2021_06_01.models.Kind + :ivar locations: The set of locations that the SKU is available. This will be supported and + registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). + :vartype locations: list[str] + :ivar capabilities: The capability information in the specified SKU, including file encryption, + network ACLs, change notification, etc. + :vartype capabilities: list[~azure.mgmt.storage.v2021_06_01.models.SKUCapability] + :param restrictions: The restrictions because of which SKU cannot be used. This is empty if + there are no restrictions. + :type restrictions: list[~azure.mgmt.storage.v2021_06_01.models.Restriction] + """ + + _validation = { + 'name': {'required': True}, + 'tier': {'readonly': True}, + 'resource_type': {'readonly': True}, + 'kind': {'readonly': True}, + 'locations': {'readonly': True}, + 'capabilities': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[SKUCapability]'}, + 'restrictions': {'key': 'restrictions', 'type': '[Restriction]'}, + } + + def __init__( + self, + *, + name: Union[str, "SkuName"], + restrictions: Optional[List["Restriction"]] = None, + **kwargs + ): + super(SkuInformation, self).__init__(**kwargs) + self.name = name + self.tier = None + self.resource_type = None + self.kind = None + self.locations = None + self.capabilities = None + self.restrictions = restrictions + + +class SmbSetting(msrest.serialization.Model): + """Setting for SMB protocol. + + :param multichannel: Multichannel setting. Applies to Premium FileStorage only. + :type multichannel: ~azure.mgmt.storage.v2021_06_01.models.Multichannel + :param versions: SMB protocol versions supported by server. Valid values are SMB2.1, SMB3.0, + SMB3.1.1. Should be passed as a string with delimiter ';'. + :type versions: str + :param authentication_methods: SMB authentication methods supported by server. Valid values are + NTLMv2, Kerberos. Should be passed as a string with delimiter ';'. + :type authentication_methods: str + :param kerberos_ticket_encryption: Kerberos ticket encryption supported by server. Valid values + are RC4-HMAC, AES-256. Should be passed as a string with delimiter ';'. + :type kerberos_ticket_encryption: str + :param channel_encryption: SMB channel encryption supported by server. Valid values are + AES-128-CCM, AES-128-GCM, AES-256-GCM. Should be passed as a string with delimiter ';'. + :type channel_encryption: str + """ + + _attribute_map = { + 'multichannel': {'key': 'multichannel', 'type': 'Multichannel'}, + 'versions': {'key': 'versions', 'type': 'str'}, + 'authentication_methods': {'key': 'authenticationMethods', 'type': 'str'}, + 'kerberos_ticket_encryption': {'key': 'kerberosTicketEncryption', 'type': 'str'}, + 'channel_encryption': {'key': 'channelEncryption', 'type': 'str'}, + } + + def __init__( + self, + *, + multichannel: Optional["Multichannel"] = None, + versions: Optional[str] = None, + authentication_methods: Optional[str] = None, + kerberos_ticket_encryption: Optional[str] = None, + channel_encryption: Optional[str] = None, + **kwargs + ): + super(SmbSetting, self).__init__(**kwargs) + self.multichannel = multichannel + self.versions = versions + self.authentication_methods = authentication_methods + self.kerberos_ticket_encryption = kerberos_ticket_encryption + self.channel_encryption = channel_encryption + + +class TrackedResource(Resource): + """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives. + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(TrackedResource, self).__init__(**kwargs) + self.tags = tags + self.location = location + + +class StorageAccount(TrackedResource): + """The storage account. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives. + :type location: str + :ivar sku: Gets the SKU. + :vartype sku: ~azure.mgmt.storage.v2021_06_01.models.Sku + :ivar kind: Gets the Kind. Possible values include: "Storage", "StorageV2", "BlobStorage", + "FileStorage", "BlockBlobStorage". + :vartype kind: str or ~azure.mgmt.storage.v2021_06_01.models.Kind + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2021_06_01.models.Identity + :param extended_location: The extendedLocation of the resource. + :type extended_location: ~azure.mgmt.storage.v2021_06_01.models.ExtendedLocation + :ivar provisioning_state: Gets the status of the storage account at the time the operation was + called. Possible values include: "Creating", "ResolvingDNS", "Succeeded". + :vartype provisioning_state: str or ~azure.mgmt.storage.v2021_06_01.models.ProvisioningState + :ivar primary_endpoints: Gets the URLs that are used to perform a retrieval of a public blob, + queue, or table object. Note that Standard_ZRS and Premium_LRS accounts only return the blob + endpoint. + :vartype primary_endpoints: ~azure.mgmt.storage.v2021_06_01.models.Endpoints + :ivar primary_location: Gets the location of the primary data center for the storage account. + :vartype primary_location: str + :ivar status_of_primary: Gets the status indicating whether the primary location of the storage + account is available or unavailable. Possible values include: "available", "unavailable". + :vartype status_of_primary: str or ~azure.mgmt.storage.v2021_06_01.models.AccountStatus + :ivar last_geo_failover_time: Gets the timestamp of the most recent instance of a failover to + the secondary location. Only the most recent timestamp is retained. This element is not + returned if there has never been a failover instance. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype last_geo_failover_time: ~datetime.datetime + :ivar secondary_location: Gets the location of the geo-replicated secondary for the storage + account. Only available if the accountType is Standard_GRS or Standard_RAGRS. + :vartype secondary_location: str + :ivar status_of_secondary: Gets the status indicating whether the secondary location of the + storage account is available or unavailable. Only available if the SKU name is Standard_GRS or + Standard_RAGRS. Possible values include: "available", "unavailable". + :vartype status_of_secondary: str or ~azure.mgmt.storage.v2021_06_01.models.AccountStatus + :ivar creation_time: Gets the creation date and time of the storage account in UTC. + :vartype creation_time: ~datetime.datetime + :ivar custom_domain: Gets the custom domain the user assigned to this storage account. + :vartype custom_domain: ~azure.mgmt.storage.v2021_06_01.models.CustomDomain + :ivar sas_policy: SasPolicy assigned to the storage account. + :vartype sas_policy: ~azure.mgmt.storage.v2021_06_01.models.SasPolicy + :ivar key_policy: KeyPolicy assigned to the storage account. + :vartype key_policy: ~azure.mgmt.storage.v2021_06_01.models.KeyPolicy + :ivar key_creation_time: Storage account keys creation time. + :vartype key_creation_time: ~azure.mgmt.storage.v2021_06_01.models.KeyCreationTime + :ivar secondary_endpoints: Gets the URLs that are used to perform a retrieval of a public blob, + queue, or table object from the secondary location of the storage account. Only available if + the SKU name is Standard_RAGRS. + :vartype secondary_endpoints: ~azure.mgmt.storage.v2021_06_01.models.Endpoints + :ivar encryption: Gets the encryption settings on the account. If unspecified, the account is + unencrypted. + :vartype encryption: ~azure.mgmt.storage.v2021_06_01.models.Encryption + :ivar access_tier: Required for storage accounts where kind = BlobStorage. The access tier used + for billing. Possible values include: "Hot", "Cool". + :vartype access_tier: str or ~azure.mgmt.storage.v2021_06_01.models.AccessTier + :param azure_files_identity_based_authentication: Provides the identity based authentication + settings for Azure Files. + :type azure_files_identity_based_authentication: + ~azure.mgmt.storage.v2021_06_01.models.AzureFilesIdentityBasedAuthentication + :param enable_https_traffic_only: Allows https traffic only to storage service if sets to true. + :type enable_https_traffic_only: bool + :ivar network_rule_set: Network rule set. + :vartype network_rule_set: ~azure.mgmt.storage.v2021_06_01.models.NetworkRuleSet + :param is_hns_enabled: Account HierarchicalNamespace enabled if sets to true. + :type is_hns_enabled: bool + :ivar geo_replication_stats: Geo Replication Stats. + :vartype geo_replication_stats: ~azure.mgmt.storage.v2021_06_01.models.GeoReplicationStats + :ivar failover_in_progress: If the failover is in progress, the value will be true, otherwise, + it will be null. + :vartype failover_in_progress: bool + :param large_file_shares_state: Allow large file shares if sets to Enabled. It cannot be + disabled once it is enabled. Possible values include: "Disabled", "Enabled". + :type large_file_shares_state: str or + ~azure.mgmt.storage.v2021_06_01.models.LargeFileSharesState + :ivar private_endpoint_connections: List of private endpoint connection associated with the + specified storage account. + :vartype private_endpoint_connections: + list[~azure.mgmt.storage.v2021_06_01.models.PrivateEndpointConnection] + :param routing_preference: Maintains information about the network routing choice opted by the + user for data transfer. + :type routing_preference: ~azure.mgmt.storage.v2021_06_01.models.RoutingPreference + :ivar blob_restore_status: Blob restore status. + :vartype blob_restore_status: ~azure.mgmt.storage.v2021_06_01.models.BlobRestoreStatus + :param allow_blob_public_access: Allow or disallow public access to all blobs or containers in + the storage account. The default interpretation is true for this property. + :type allow_blob_public_access: bool + :param minimum_tls_version: Set the minimum TLS version to be permitted on requests to storage. + The default interpretation is TLS 1.0 for this property. Possible values include: "TLS1_0", + "TLS1_1", "TLS1_2". + :type minimum_tls_version: str or ~azure.mgmt.storage.v2021_06_01.models.MinimumTlsVersion + :param allow_shared_key_access: Indicates whether the storage account permits requests to be + authorized with the account access key via Shared Key. If false, then all requests, including + shared access signatures, must be authorized with Azure Active Directory (Azure AD). The + default value is null, which is equivalent to true. + :type allow_shared_key_access: bool + :param enable_nfs_v3: NFS 3.0 protocol support enabled if set to true. + :type enable_nfs_v3: bool + :param allow_cross_tenant_replication: Allow or disallow cross AAD tenant object replication. + The default interpretation is true for this property. + :type allow_cross_tenant_replication: bool + :param default_to_o_auth_authentication: A boolean flag which indicates whether the default + authentication is OAuth or not. The default interpretation is false for this property. + :type default_to_o_auth_authentication: bool + :param public_network_access: Allow or disallow public network access to Storage Account. Value + is optional but if passed in, must be 'Enabled' or 'Disabled'. Possible values include: + "Enabled", "Disabled". + :type public_network_access: str or ~azure.mgmt.storage.v2021_06_01.models.PublicNetworkAccess + :param immutable_storage_with_versioning: The property is immutable and can only be set to true + at the account creation time. When set to true, it enables object level immutability for all + the containers in the account by default. + :type immutable_storage_with_versioning: + ~azure.mgmt.storage.v2021_06_01.models.ImmutableStorageAccount + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'sku': {'readonly': True}, + 'kind': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'primary_endpoints': {'readonly': True}, + 'primary_location': {'readonly': True}, + 'status_of_primary': {'readonly': True}, + 'last_geo_failover_time': {'readonly': True}, + 'secondary_location': {'readonly': True}, + 'status_of_secondary': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'custom_domain': {'readonly': True}, + 'sas_policy': {'readonly': True}, + 'key_policy': {'readonly': True}, + 'key_creation_time': {'readonly': True}, + 'secondary_endpoints': {'readonly': True}, + 'encryption': {'readonly': True}, + 'access_tier': {'readonly': True}, + 'network_rule_set': {'readonly': True}, + 'geo_replication_stats': {'readonly': True}, + 'failover_in_progress': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, + 'blob_restore_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'}, + 'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'}, + 'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'str'}, + 'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'}, + 'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'}, + 'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'sas_policy': {'key': 'properties.sasPolicy', 'type': 'SasPolicy'}, + 'key_policy': {'key': 'properties.keyPolicy', 'type': 'KeyPolicy'}, + 'key_creation_time': {'key': 'properties.keyCreationTime', 'type': 'KeyCreationTime'}, + 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'str'}, + 'azure_files_identity_based_authentication': {'key': 'properties.azureFilesIdentityBasedAuthentication', 'type': 'AzureFilesIdentityBasedAuthentication'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'is_hns_enabled': {'key': 'properties.isHnsEnabled', 'type': 'bool'}, + 'geo_replication_stats': {'key': 'properties.geoReplicationStats', 'type': 'GeoReplicationStats'}, + 'failover_in_progress': {'key': 'properties.failoverInProgress', 'type': 'bool'}, + 'large_file_shares_state': {'key': 'properties.largeFileSharesState', 'type': 'str'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, + 'routing_preference': {'key': 'properties.routingPreference', 'type': 'RoutingPreference'}, + 'blob_restore_status': {'key': 'properties.blobRestoreStatus', 'type': 'BlobRestoreStatus'}, + 'allow_blob_public_access': {'key': 'properties.allowBlobPublicAccess', 'type': 'bool'}, + 'minimum_tls_version': {'key': 'properties.minimumTlsVersion', 'type': 'str'}, + 'allow_shared_key_access': {'key': 'properties.allowSharedKeyAccess', 'type': 'bool'}, + 'enable_nfs_v3': {'key': 'properties.isNfsV3Enabled', 'type': 'bool'}, + 'allow_cross_tenant_replication': {'key': 'properties.allowCrossTenantReplication', 'type': 'bool'}, + 'default_to_o_auth_authentication': {'key': 'properties.defaultToOAuthAuthentication', 'type': 'bool'}, + 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, + 'immutable_storage_with_versioning': {'key': 'properties.immutableStorageWithVersioning', 'type': 'ImmutableStorageAccount'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + identity: Optional["Identity"] = None, + extended_location: Optional["ExtendedLocation"] = None, + azure_files_identity_based_authentication: Optional["AzureFilesIdentityBasedAuthentication"] = None, + enable_https_traffic_only: Optional[bool] = None, + is_hns_enabled: Optional[bool] = None, + large_file_shares_state: Optional[Union[str, "LargeFileSharesState"]] = None, + routing_preference: Optional["RoutingPreference"] = None, + allow_blob_public_access: Optional[bool] = None, + minimum_tls_version: Optional[Union[str, "MinimumTlsVersion"]] = None, + allow_shared_key_access: Optional[bool] = None, + enable_nfs_v3: Optional[bool] = None, + allow_cross_tenant_replication: Optional[bool] = None, + default_to_o_auth_authentication: Optional[bool] = None, + public_network_access: Optional[Union[str, "PublicNetworkAccess"]] = None, + immutable_storage_with_versioning: Optional["ImmutableStorageAccount"] = None, + **kwargs + ): + super(StorageAccount, self).__init__(tags=tags, location=location, **kwargs) + self.sku = None + self.kind = None + self.identity = identity + self.extended_location = extended_location + self.provisioning_state = None + self.primary_endpoints = None + self.primary_location = None + self.status_of_primary = None + self.last_geo_failover_time = None + self.secondary_location = None + self.status_of_secondary = None + self.creation_time = None + self.custom_domain = None + self.sas_policy = None + self.key_policy = None + self.key_creation_time = None + self.secondary_endpoints = None + self.encryption = None + self.access_tier = None + self.azure_files_identity_based_authentication = azure_files_identity_based_authentication + self.enable_https_traffic_only = enable_https_traffic_only + self.network_rule_set = None + self.is_hns_enabled = is_hns_enabled + self.geo_replication_stats = None + self.failover_in_progress = None + self.large_file_shares_state = large_file_shares_state + self.private_endpoint_connections = None + self.routing_preference = routing_preference + self.blob_restore_status = None + self.allow_blob_public_access = allow_blob_public_access + self.minimum_tls_version = minimum_tls_version + self.allow_shared_key_access = allow_shared_key_access + self.enable_nfs_v3 = enable_nfs_v3 + self.allow_cross_tenant_replication = allow_cross_tenant_replication + self.default_to_o_auth_authentication = default_to_o_auth_authentication + self.public_network_access = public_network_access + self.immutable_storage_with_versioning = immutable_storage_with_versioning + + +class StorageAccountCheckNameAvailabilityParameters(msrest.serialization.Model): + """The parameters used to check the availability of the storage account name. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The storage account name. + :type name: str + :ivar type: The type of resource, Microsoft.Storage/storageAccounts. Has constant value: + "Microsoft.Storage/storageAccounts". + :vartype type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.Storage/storageAccounts" + + def __init__( + self, + *, + name: str, + **kwargs + ): + super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = name + + +class StorageAccountCreateParameters(msrest.serialization.Model): + """The parameters used when creating a storage account. + + All required parameters must be populated in order to send to Azure. + + :param sku: Required. Required. Gets or sets the SKU name. + :type sku: ~azure.mgmt.storage.v2021_06_01.models.Sku + :param kind: Required. Required. Indicates the type of storage account. Possible values + include: "Storage", "StorageV2", "BlobStorage", "FileStorage", "BlockBlobStorage". + :type kind: str or ~azure.mgmt.storage.v2021_06_01.models.Kind + :param location: Required. Required. Gets or sets the location of the resource. This will be + one of the supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, + etc.). The geo region of a resource cannot be changed once it is created, but if an identical + geo region is specified on update, the request will succeed. + :type location: str + :param extended_location: Optional. Set the extended location of the resource. If not set, the + storage account will be created in Azure main region. Otherwise it will be created in the + specified extended location. + :type extended_location: ~azure.mgmt.storage.v2021_06_01.models.ExtendedLocation + :param tags: A set of tags. Gets or sets a list of key value pairs that describe the resource. + These tags can be used for viewing and grouping this resource (across resource groups). A + maximum of 15 tags can be provided for a resource. Each tag must have a key with a length no + greater than 128 characters and a value with a length no greater than 256 characters. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2021_06_01.models.Identity + :param public_network_access: Allow or disallow public network access to Storage Account. Value + is optional but if passed in, must be 'Enabled' or 'Disabled'. Possible values include: + "Enabled", "Disabled". + :type public_network_access: str or ~azure.mgmt.storage.v2021_06_01.models.PublicNetworkAccess + :param sas_policy: SasPolicy assigned to the storage account. + :type sas_policy: ~azure.mgmt.storage.v2021_06_01.models.SasPolicy + :param key_policy: KeyPolicy assigned to the storage account. + :type key_policy: ~azure.mgmt.storage.v2021_06_01.models.KeyPolicy + :param custom_domain: User domain assigned to the storage account. Name is the CNAME source. + Only one custom domain is supported per storage account at this time. To clear the existing + custom domain, use an empty string for the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2021_06_01.models.CustomDomain + :param encryption: Not applicable. Azure Storage encryption is enabled for all storage accounts + and cannot be disabled. + :type encryption: ~azure.mgmt.storage.v2021_06_01.models.Encryption + :param network_rule_set: Network rule set. + :type network_rule_set: ~azure.mgmt.storage.v2021_06_01.models.NetworkRuleSet + :param access_tier: Required for storage accounts where kind = BlobStorage. The access tier + used for billing. Possible values include: "Hot", "Cool". + :type access_tier: str or ~azure.mgmt.storage.v2021_06_01.models.AccessTier + :param azure_files_identity_based_authentication: Provides the identity based authentication + settings for Azure Files. + :type azure_files_identity_based_authentication: + ~azure.mgmt.storage.v2021_06_01.models.AzureFilesIdentityBasedAuthentication + :param enable_https_traffic_only: Allows https traffic only to storage service if sets to true. + The default value is true since API version 2019-04-01. + :type enable_https_traffic_only: bool + :param is_hns_enabled: Account HierarchicalNamespace enabled if sets to true. + :type is_hns_enabled: bool + :param large_file_shares_state: Allow large file shares if sets to Enabled. It cannot be + disabled once it is enabled. Possible values include: "Disabled", "Enabled". + :type large_file_shares_state: str or + ~azure.mgmt.storage.v2021_06_01.models.LargeFileSharesState + :param routing_preference: Maintains information about the network routing choice opted by the + user for data transfer. + :type routing_preference: ~azure.mgmt.storage.v2021_06_01.models.RoutingPreference + :param allow_blob_public_access: Allow or disallow public access to all blobs or containers in + the storage account. The default interpretation is true for this property. + :type allow_blob_public_access: bool + :param minimum_tls_version: Set the minimum TLS version to be permitted on requests to storage. + The default interpretation is TLS 1.0 for this property. Possible values include: "TLS1_0", + "TLS1_1", "TLS1_2". + :type minimum_tls_version: str or ~azure.mgmt.storage.v2021_06_01.models.MinimumTlsVersion + :param allow_shared_key_access: Indicates whether the storage account permits requests to be + authorized with the account access key via Shared Key. If false, then all requests, including + shared access signatures, must be authorized with Azure Active Directory (Azure AD). The + default value is null, which is equivalent to true. + :type allow_shared_key_access: bool + :param enable_nfs_v3: NFS 3.0 protocol support enabled if set to true. + :type enable_nfs_v3: bool + :param allow_cross_tenant_replication: Allow or disallow cross AAD tenant object replication. + The default interpretation is true for this property. + :type allow_cross_tenant_replication: bool + :param default_to_o_auth_authentication: A boolean flag which indicates whether the default + authentication is OAuth or not. The default interpretation is false for this property. + :type default_to_o_auth_authentication: bool + :param immutable_storage_with_versioning: The property is immutable and can only be set to true + at the account creation time. When set to true, it enables object level immutability for all + the new containers in the account by default. + :type immutable_storage_with_versioning: + ~azure.mgmt.storage.v2021_06_01.models.ImmutableStorageAccount + """ + + _validation = { + 'sku': {'required': True}, + 'kind': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, + 'sas_policy': {'key': 'properties.sasPolicy', 'type': 'SasPolicy'}, + 'key_policy': {'key': 'properties.keyPolicy', 'type': 'KeyPolicy'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'str'}, + 'azure_files_identity_based_authentication': {'key': 'properties.azureFilesIdentityBasedAuthentication', 'type': 'AzureFilesIdentityBasedAuthentication'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'is_hns_enabled': {'key': 'properties.isHnsEnabled', 'type': 'bool'}, + 'large_file_shares_state': {'key': 'properties.largeFileSharesState', 'type': 'str'}, + 'routing_preference': {'key': 'properties.routingPreference', 'type': 'RoutingPreference'}, + 'allow_blob_public_access': {'key': 'properties.allowBlobPublicAccess', 'type': 'bool'}, + 'minimum_tls_version': {'key': 'properties.minimumTlsVersion', 'type': 'str'}, + 'allow_shared_key_access': {'key': 'properties.allowSharedKeyAccess', 'type': 'bool'}, + 'enable_nfs_v3': {'key': 'properties.isNfsV3Enabled', 'type': 'bool'}, + 'allow_cross_tenant_replication': {'key': 'properties.allowCrossTenantReplication', 'type': 'bool'}, + 'default_to_o_auth_authentication': {'key': 'properties.defaultToOAuthAuthentication', 'type': 'bool'}, + 'immutable_storage_with_versioning': {'key': 'properties.immutableStorageWithVersioning', 'type': 'ImmutableStorageAccount'}, + } + + def __init__( + self, + *, + sku: "Sku", + kind: Union[str, "Kind"], + location: str, + extended_location: Optional["ExtendedLocation"] = None, + tags: Optional[Dict[str, str]] = None, + identity: Optional["Identity"] = None, + public_network_access: Optional[Union[str, "PublicNetworkAccess"]] = None, + sas_policy: Optional["SasPolicy"] = None, + key_policy: Optional["KeyPolicy"] = None, + custom_domain: Optional["CustomDomain"] = None, + encryption: Optional["Encryption"] = None, + network_rule_set: Optional["NetworkRuleSet"] = None, + access_tier: Optional[Union[str, "AccessTier"]] = None, + azure_files_identity_based_authentication: Optional["AzureFilesIdentityBasedAuthentication"] = None, + enable_https_traffic_only: Optional[bool] = None, + is_hns_enabled: Optional[bool] = None, + large_file_shares_state: Optional[Union[str, "LargeFileSharesState"]] = None, + routing_preference: Optional["RoutingPreference"] = None, + allow_blob_public_access: Optional[bool] = None, + minimum_tls_version: Optional[Union[str, "MinimumTlsVersion"]] = None, + allow_shared_key_access: Optional[bool] = None, + enable_nfs_v3: Optional[bool] = None, + allow_cross_tenant_replication: Optional[bool] = None, + default_to_o_auth_authentication: Optional[bool] = None, + immutable_storage_with_versioning: Optional["ImmutableStorageAccount"] = None, + **kwargs + ): + super(StorageAccountCreateParameters, self).__init__(**kwargs) + self.sku = sku + self.kind = kind + self.location = location + self.extended_location = extended_location + self.tags = tags + self.identity = identity + self.public_network_access = public_network_access + self.sas_policy = sas_policy + self.key_policy = key_policy + self.custom_domain = custom_domain + self.encryption = encryption + self.network_rule_set = network_rule_set + self.access_tier = access_tier + self.azure_files_identity_based_authentication = azure_files_identity_based_authentication + self.enable_https_traffic_only = enable_https_traffic_only + self.is_hns_enabled = is_hns_enabled + self.large_file_shares_state = large_file_shares_state + self.routing_preference = routing_preference + self.allow_blob_public_access = allow_blob_public_access + self.minimum_tls_version = minimum_tls_version + self.allow_shared_key_access = allow_shared_key_access + self.enable_nfs_v3 = enable_nfs_v3 + self.allow_cross_tenant_replication = allow_cross_tenant_replication + self.default_to_o_auth_authentication = default_to_o_auth_authentication + self.immutable_storage_with_versioning = immutable_storage_with_versioning + + +class StorageAccountInternetEndpoints(msrest.serialization.Model): + """The URIs that are used to perform a retrieval of a public blob, file, web or dfs object via a internet routing endpoint. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar blob: Gets the blob endpoint. + :vartype blob: str + :ivar file: Gets the file endpoint. + :vartype file: str + :ivar web: Gets the web endpoint. + :vartype web: str + :ivar dfs: Gets the dfs endpoint. + :vartype dfs: str + """ + + _validation = { + 'blob': {'readonly': True}, + 'file': {'readonly': True}, + 'web': {'readonly': True}, + 'dfs': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'str'}, + 'file': {'key': 'file', 'type': 'str'}, + 'web': {'key': 'web', 'type': 'str'}, + 'dfs': {'key': 'dfs', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageAccountInternetEndpoints, self).__init__(**kwargs) + self.blob = None + self.file = None + self.web = None + self.dfs = None + + +class StorageAccountKey(msrest.serialization.Model): + """An access key for the storage account. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar key_name: Name of the key. + :vartype key_name: str + :ivar value: Base 64-encoded value of the key. + :vartype value: str + :ivar permissions: Permissions for the key -- read-only or full permissions. Possible values + include: "Read", "Full". + :vartype permissions: str or ~azure.mgmt.storage.v2021_06_01.models.KeyPermission + :ivar creation_time: Creation time of the key, in round trip date format. + :vartype creation_time: ~datetime.datetime + """ + + _validation = { + 'key_name': {'readonly': True}, + 'value': {'readonly': True}, + 'permissions': {'readonly': True}, + 'creation_time': {'readonly': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'permissions': {'key': 'permissions', 'type': 'str'}, + 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageAccountKey, self).__init__(**kwargs) + self.key_name = None + self.value = None + self.permissions = None + self.creation_time = None + + +class StorageAccountListKeysResult(msrest.serialization.Model): + """The response from the ListKeys operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar keys: Gets the list of storage account keys and their properties for the specified + storage account. + :vartype keys: list[~azure.mgmt.storage.v2021_06_01.models.StorageAccountKey] + """ + + _validation = { + 'keys': {'readonly': True}, + } + + _attribute_map = { + 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageAccountListKeysResult, self).__init__(**kwargs) + self.keys = None + + +class StorageAccountListResult(msrest.serialization.Model): + """The response from the List Storage Accounts operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: Gets the list of storage accounts and their properties. + :vartype value: list[~azure.mgmt.storage.v2021_06_01.models.StorageAccount] + :ivar next_link: Request URL that can be used to query next page of storage accounts. Returned + when total number of requested storage accounts exceed maximum page size. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[StorageAccount]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageAccountListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class StorageAccountMicrosoftEndpoints(msrest.serialization.Model): + """The URIs that are used to perform a retrieval of a public blob, queue, table, web or dfs object via a microsoft routing endpoint. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar blob: Gets the blob endpoint. + :vartype blob: str + :ivar queue: Gets the queue endpoint. + :vartype queue: str + :ivar table: Gets the table endpoint. + :vartype table: str + :ivar file: Gets the file endpoint. + :vartype file: str + :ivar web: Gets the web endpoint. + :vartype web: str + :ivar dfs: Gets the dfs endpoint. + :vartype dfs: str + """ + + _validation = { + 'blob': {'readonly': True}, + 'queue': {'readonly': True}, + 'table': {'readonly': True}, + 'file': {'readonly': True}, + 'web': {'readonly': True}, + 'dfs': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'str'}, + 'queue': {'key': 'queue', 'type': 'str'}, + 'table': {'key': 'table', 'type': 'str'}, + 'file': {'key': 'file', 'type': 'str'}, + 'web': {'key': 'web', 'type': 'str'}, + 'dfs': {'key': 'dfs', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageAccountMicrosoftEndpoints, self).__init__(**kwargs) + self.blob = None + self.queue = None + self.table = None + self.file = None + self.web = None + self.dfs = None + + +class StorageAccountRegenerateKeyParameters(msrest.serialization.Model): + """The parameters used to regenerate the storage account key. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. The name of storage keys that want to be regenerated, possible + values are key1, key2, kerb1, kerb2. + :type key_name: str + """ + + _validation = { + 'key_name': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__( + self, + *, + key_name: str, + **kwargs + ): + super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) + self.key_name = key_name + + +class StorageAccountUpdateParameters(msrest.serialization.Model): + """The parameters that can be provided when updating the storage account properties. + + :param sku: Gets or sets the SKU name. Note that the SKU name cannot be updated to + Standard_ZRS, Premium_LRS or Premium_ZRS, nor can accounts of those SKU names be updated to any + other value. + :type sku: ~azure.mgmt.storage.v2021_06_01.models.Sku + :param tags: A set of tags. Gets or sets a list of key value pairs that describe the resource. + These tags can be used in viewing and grouping this resource (across resource groups). A + maximum of 15 tags can be provided for a resource. Each tag must have a key no greater in + length than 128 characters and a value no greater in length than 256 characters. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2021_06_01.models.Identity + :param kind: Optional. Indicates the type of storage account. Currently only StorageV2 value + supported by server. Possible values include: "Storage", "StorageV2", "BlobStorage", + "FileStorage", "BlockBlobStorage". + :type kind: str or ~azure.mgmt.storage.v2021_06_01.models.Kind + :param custom_domain: Custom domain assigned to the storage account by the user. Name is the + CNAME source. Only one custom domain is supported per storage account at this time. To clear + the existing custom domain, use an empty string for the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2021_06_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. The default setting is + unencrypted. + :type encryption: ~azure.mgmt.storage.v2021_06_01.models.Encryption + :param sas_policy: SasPolicy assigned to the storage account. + :type sas_policy: ~azure.mgmt.storage.v2021_06_01.models.SasPolicy + :param key_policy: KeyPolicy assigned to the storage account. + :type key_policy: ~azure.mgmt.storage.v2021_06_01.models.KeyPolicy + :param access_tier: Required for storage accounts where kind = BlobStorage. The access tier + used for billing. Possible values include: "Hot", "Cool". + :type access_tier: str or ~azure.mgmt.storage.v2021_06_01.models.AccessTier + :param azure_files_identity_based_authentication: Provides the identity based authentication + settings for Azure Files. + :type azure_files_identity_based_authentication: + ~azure.mgmt.storage.v2021_06_01.models.AzureFilesIdentityBasedAuthentication + :param enable_https_traffic_only: Allows https traffic only to storage service if sets to true. + :type enable_https_traffic_only: bool + :param network_rule_set: Network rule set. + :type network_rule_set: ~azure.mgmt.storage.v2021_06_01.models.NetworkRuleSet + :param large_file_shares_state: Allow large file shares if sets to Enabled. It cannot be + disabled once it is enabled. Possible values include: "Disabled", "Enabled". + :type large_file_shares_state: str or + ~azure.mgmt.storage.v2021_06_01.models.LargeFileSharesState + :param routing_preference: Maintains information about the network routing choice opted by the + user for data transfer. + :type routing_preference: ~azure.mgmt.storage.v2021_06_01.models.RoutingPreference + :param allow_blob_public_access: Allow or disallow public access to all blobs or containers in + the storage account. The default interpretation is true for this property. + :type allow_blob_public_access: bool + :param minimum_tls_version: Set the minimum TLS version to be permitted on requests to storage. + The default interpretation is TLS 1.0 for this property. Possible values include: "TLS1_0", + "TLS1_1", "TLS1_2". + :type minimum_tls_version: str or ~azure.mgmt.storage.v2021_06_01.models.MinimumTlsVersion + :param allow_shared_key_access: Indicates whether the storage account permits requests to be + authorized with the account access key via Shared Key. If false, then all requests, including + shared access signatures, must be authorized with Azure Active Directory (Azure AD). The + default value is null, which is equivalent to true. + :type allow_shared_key_access: bool + :param allow_cross_tenant_replication: Allow or disallow cross AAD tenant object replication. + The default interpretation is true for this property. + :type allow_cross_tenant_replication: bool + :param default_to_o_auth_authentication: A boolean flag which indicates whether the default + authentication is OAuth or not. The default interpretation is false for this property. + :type default_to_o_auth_authentication: bool + :param public_network_access: Allow or disallow public network access to Storage Account. Value + is optional but if passed in, must be 'Enabled' or 'Disabled'. Possible values include: + "Enabled", "Disabled". + :type public_network_access: str or ~azure.mgmt.storage.v2021_06_01.models.PublicNetworkAccess + :param immutable_storage_with_versioning: The property is immutable and can only be set to true + at the account creation time. When set to true, it enables object level immutability for all + the containers in the account by default. + :type immutable_storage_with_versioning: + ~azure.mgmt.storage.v2021_06_01.models.ImmutableStorageAccount + """ + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'sas_policy': {'key': 'properties.sasPolicy', 'type': 'SasPolicy'}, + 'key_policy': {'key': 'properties.keyPolicy', 'type': 'KeyPolicy'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'str'}, + 'azure_files_identity_based_authentication': {'key': 'properties.azureFilesIdentityBasedAuthentication', 'type': 'AzureFilesIdentityBasedAuthentication'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'large_file_shares_state': {'key': 'properties.largeFileSharesState', 'type': 'str'}, + 'routing_preference': {'key': 'properties.routingPreference', 'type': 'RoutingPreference'}, + 'allow_blob_public_access': {'key': 'properties.allowBlobPublicAccess', 'type': 'bool'}, + 'minimum_tls_version': {'key': 'properties.minimumTlsVersion', 'type': 'str'}, + 'allow_shared_key_access': {'key': 'properties.allowSharedKeyAccess', 'type': 'bool'}, + 'allow_cross_tenant_replication': {'key': 'properties.allowCrossTenantReplication', 'type': 'bool'}, + 'default_to_o_auth_authentication': {'key': 'properties.defaultToOAuthAuthentication', 'type': 'bool'}, + 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, + 'immutable_storage_with_versioning': {'key': 'properties.immutableStorageWithVersioning', 'type': 'ImmutableStorageAccount'}, + } + + def __init__( + self, + *, + sku: Optional["Sku"] = None, + tags: Optional[Dict[str, str]] = None, + identity: Optional["Identity"] = None, + kind: Optional[Union[str, "Kind"]] = None, + custom_domain: Optional["CustomDomain"] = None, + encryption: Optional["Encryption"] = None, + sas_policy: Optional["SasPolicy"] = None, + key_policy: Optional["KeyPolicy"] = None, + access_tier: Optional[Union[str, "AccessTier"]] = None, + azure_files_identity_based_authentication: Optional["AzureFilesIdentityBasedAuthentication"] = None, + enable_https_traffic_only: Optional[bool] = None, + network_rule_set: Optional["NetworkRuleSet"] = None, + large_file_shares_state: Optional[Union[str, "LargeFileSharesState"]] = None, + routing_preference: Optional["RoutingPreference"] = None, + allow_blob_public_access: Optional[bool] = None, + minimum_tls_version: Optional[Union[str, "MinimumTlsVersion"]] = None, + allow_shared_key_access: Optional[bool] = None, + allow_cross_tenant_replication: Optional[bool] = None, + default_to_o_auth_authentication: Optional[bool] = None, + public_network_access: Optional[Union[str, "PublicNetworkAccess"]] = None, + immutable_storage_with_versioning: Optional["ImmutableStorageAccount"] = None, + **kwargs + ): + super(StorageAccountUpdateParameters, self).__init__(**kwargs) + self.sku = sku + self.tags = tags + self.identity = identity + self.kind = kind + self.custom_domain = custom_domain + self.encryption = encryption + self.sas_policy = sas_policy + self.key_policy = key_policy + self.access_tier = access_tier + self.azure_files_identity_based_authentication = azure_files_identity_based_authentication + self.enable_https_traffic_only = enable_https_traffic_only + self.network_rule_set = network_rule_set + self.large_file_shares_state = large_file_shares_state + self.routing_preference = routing_preference + self.allow_blob_public_access = allow_blob_public_access + self.minimum_tls_version = minimum_tls_version + self.allow_shared_key_access = allow_shared_key_access + self.allow_cross_tenant_replication = allow_cross_tenant_replication + self.default_to_o_auth_authentication = default_to_o_auth_authentication + self.public_network_access = public_network_access + self.immutable_storage_with_versioning = immutable_storage_with_versioning + + +class StorageQueue(Resource): + """StorageQueue. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param metadata: A name-value pair that represents queue metadata. + :type metadata: dict[str, str] + :ivar approximate_message_count: Integer indicating an approximate number of messages in the + queue. This number is not lower than the actual number of messages in the queue, but could be + higher. + :vartype approximate_message_count: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'approximate_message_count': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'approximate_message_count': {'key': 'properties.approximateMessageCount', 'type': 'int'}, + } + + def __init__( + self, + *, + metadata: Optional[Dict[str, str]] = None, + **kwargs + ): + super(StorageQueue, self).__init__(**kwargs) + self.metadata = metadata + self.approximate_message_count = None + + +class StorageSkuListResult(msrest.serialization.Model): + """The response from the List Storage SKUs operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: Get the list result of storage SKUs and their properties. + :vartype value: list[~azure.mgmt.storage.v2021_06_01.models.SkuInformation] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SkuInformation]'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageSkuListResult, self).__init__(**kwargs) + self.value = None + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or ~azure.mgmt.storage.v2021_06_01.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or ~azure.mgmt.storage.v2021_06_01.models.CreatedByType + :param last_modified_at: The timestamp of resource last modification (UTC). + :type last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "CreatedByType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "CreatedByType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, + **kwargs + ): + super(SystemData, self).__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at + + +class Table(Resource): + """Properties of the table, including Id, resource name, resource type. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar table_name: Table name under the specified account. + :vartype table_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'table_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'table_name': {'key': 'properties.tableName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Table, self).__init__(**kwargs) + self.table_name = None + + +class TableServiceProperties(Resource): + """The properties of a storage account’s Table service. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param cors: Specifies CORS rules for the Table service. You can include up to five CorsRule + elements in the request. If no CorsRule elements are included in the request body, all CORS + rules will be deleted, and CORS will be disabled for the Table service. + :type cors: ~azure.mgmt.storage.v2021_06_01.models.CorsRules + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'cors': {'key': 'properties.cors', 'type': 'CorsRules'}, + } + + def __init__( + self, + *, + cors: Optional["CorsRules"] = None, + **kwargs + ): + super(TableServiceProperties, self).__init__(**kwargs) + self.cors = cors + + +class TagFilter(msrest.serialization.Model): + """Blob index tag based filtering for blob objects. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. This is the filter tag name, it can have 1 - 128 characters. + :type name: str + :param op: Required. This is the comparison operator which is used for object comparison and + filtering. Only == (equality operator) is currently supported. + :type op: str + :param value: Required. This is the filter tag value field used for tag based filtering, it can + have 0 - 256 characters. + :type value: str + """ + + _validation = { + 'name': {'required': True, 'max_length': 128, 'min_length': 1}, + 'op': {'required': True}, + 'value': {'required': True, 'max_length': 256, 'min_length': 0}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'op': {'key': 'op', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + *, + name: str, + op: str, + value: str, + **kwargs + ): + super(TagFilter, self).__init__(**kwargs) + self.name = name + self.op = op + self.value = value + + +class TagProperty(msrest.serialization.Model): + """A tag of the LegalHold of a blob container. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar tag: The tag value. + :vartype tag: str + :ivar timestamp: Returns the date and time the tag was added. + :vartype timestamp: ~datetime.datetime + :ivar object_identifier: Returns the Object ID of the user who added the tag. + :vartype object_identifier: str + :ivar tenant_id: Returns the Tenant ID that issued the token for the user who added the tag. + :vartype tenant_id: str + :ivar upn: Returns the User Principal Name of the user who added the tag. + :vartype upn: str + """ + + _validation = { + 'tag': {'readonly': True}, + 'timestamp': {'readonly': True}, + 'object_identifier': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'upn': {'readonly': True}, + } + + _attribute_map = { + 'tag': {'key': 'tag', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'object_identifier': {'key': 'objectIdentifier', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'upn': {'key': 'upn', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TagProperty, self).__init__(**kwargs) + self.tag = None + self.timestamp = None + self.object_identifier = None + self.tenant_id = None + self.upn = None + + +class UpdateHistoryProperty(msrest.serialization.Model): + """An update history of the ImmutabilityPolicy of a blob container. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar update: The ImmutabilityPolicy update type of a blob container, possible values include: + put, lock and extend. Possible values include: "put", "lock", "extend". + :vartype update: str or ~azure.mgmt.storage.v2021_06_01.models.ImmutabilityPolicyUpdateType + :ivar immutability_period_since_creation_in_days: The immutability period for the blobs in the + container since the policy creation, in days. + :vartype immutability_period_since_creation_in_days: int + :ivar timestamp: Returns the date and time the ImmutabilityPolicy was updated. + :vartype timestamp: ~datetime.datetime + :ivar object_identifier: Returns the Object ID of the user who updated the ImmutabilityPolicy. + :vartype object_identifier: str + :ivar tenant_id: Returns the Tenant ID that issued the token for the user who updated the + ImmutabilityPolicy. + :vartype tenant_id: str + :ivar upn: Returns the User Principal Name of the user who updated the ImmutabilityPolicy. + :vartype upn: str + :param allow_protected_append_writes: This property can only be changed for unlocked time-based + retention policies. When enabled, new blocks can be written to an append blob while maintaining + immutability protection and compliance. Only new blocks can be added and any existing blocks + cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy + API. + :type allow_protected_append_writes: bool + :param allow_protected_append_writes_all: This property can only be changed for unlocked + time-based retention policies. When enabled, new blocks can be written to both 'Append and Bock + Blobs' while maintaining immutability protection and compliance. Only new blocks can be added + and any existing blocks cannot be modified or deleted. This property cannot be changed with + ExtendImmutabilityPolicy API. The 'allowProtectedAppendWrites' and + 'allowProtectedAppendWritesAll' properties are mutually exclusive. + :type allow_protected_append_writes_all: bool + """ + + _validation = { + 'update': {'readonly': True}, + 'immutability_period_since_creation_in_days': {'readonly': True}, + 'timestamp': {'readonly': True}, + 'object_identifier': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'upn': {'readonly': True}, + } + + _attribute_map = { + 'update': {'key': 'update', 'type': 'str'}, + 'immutability_period_since_creation_in_days': {'key': 'immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'object_identifier': {'key': 'objectIdentifier', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'upn': {'key': 'upn', 'type': 'str'}, + 'allow_protected_append_writes': {'key': 'allowProtectedAppendWrites', 'type': 'bool'}, + 'allow_protected_append_writes_all': {'key': 'allowProtectedAppendWritesAll', 'type': 'bool'}, + } + + def __init__( + self, + *, + allow_protected_append_writes: Optional[bool] = None, + allow_protected_append_writes_all: Optional[bool] = None, + **kwargs + ): + super(UpdateHistoryProperty, self).__init__(**kwargs) + self.update = None + self.immutability_period_since_creation_in_days = None + self.timestamp = None + self.object_identifier = None + self.tenant_id = None + self.upn = None + self.allow_protected_append_writes = allow_protected_append_writes + self.allow_protected_append_writes_all = allow_protected_append_writes_all + + +class Usage(msrest.serialization.Model): + """Describes Storage Resource Usage. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar unit: Gets the unit of measurement. Possible values include: "Count", "Bytes", "Seconds", + "Percent", "CountsPerSecond", "BytesPerSecond". + :vartype unit: str or ~azure.mgmt.storage.v2021_06_01.models.UsageUnit + :ivar current_value: Gets the current count of the allocated resources in the subscription. + :vartype current_value: int + :ivar limit: Gets the maximum count of the resources that can be allocated in the subscription. + :vartype limit: int + :ivar name: Gets the name of the type of usage. + :vartype name: ~azure.mgmt.storage.v2021_06_01.models.UsageName + """ + + _validation = { + 'unit': {'readonly': True}, + 'current_value': {'readonly': True}, + 'limit': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'str'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + def __init__( + self, + **kwargs + ): + super(Usage, self).__init__(**kwargs) + self.unit = None + self.current_value = None + self.limit = None + self.name = None + + +class UsageListResult(msrest.serialization.Model): + """The response from the List Usages operation. + + :param value: Gets or sets the list of Storage Resource Usages. + :type value: list[~azure.mgmt.storage.v2021_06_01.models.Usage] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Usage]'}, + } + + def __init__( + self, + *, + value: Optional[List["Usage"]] = None, + **kwargs + ): + super(UsageListResult, self).__init__(**kwargs) + self.value = value + + +class UsageName(msrest.serialization.Model): + """The usage names that can be used; currently limited to StorageAccount. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: Gets a string describing the resource name. + :vartype value: str + :ivar localized_value: Gets a localized string describing the resource name. + :vartype localized_value: str + """ + + _validation = { + 'value': {'readonly': True}, + 'localized_value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UsageName, self).__init__(**kwargs) + self.value = None + self.localized_value = None + + +class UserAssignedIdentity(msrest.serialization.Model): + """UserAssignedIdentity for the resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal ID of the identity. + :vartype principal_id: str + :ivar client_id: The client ID of the identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UserAssignedIdentity, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + +class VirtualNetworkRule(msrest.serialization.Model): + """Virtual Network rule. + + All required parameters must be populated in order to send to Azure. + + :param virtual_network_resource_id: Required. Resource ID of a subnet, for example: + /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + :type virtual_network_resource_id: str + :param action: The action of virtual network rule. The only acceptable values to pass in are + None and "Allow". The default value is None. + :type action: str + :param state: Gets the state of virtual network rule. Possible values include: "Provisioning", + "Deprovisioning", "Succeeded", "Failed", "NetworkSourceDeleted". + :type state: str or ~azure.mgmt.storage.v2021_06_01.models.State + """ + + _validation = { + 'virtual_network_resource_id': {'required': True}, + } + + _attribute_map = { + 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__( + self, + *, + virtual_network_resource_id: str, + action: Optional[str] = None, + state: Optional[Union[str, "State"]] = None, + **kwargs + ): + super(VirtualNetworkRule, self).__init__(**kwargs) + self.virtual_network_resource_id = virtual_network_resource_id + self.action = action + self.state = state diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/models/_storage_management_client_enums.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/models/_storage_management_client_enums.py new file mode 100644 index 000000000000..fc867e84f062 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/models/_storage_management_client_enums.py @@ -0,0 +1,528 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class AccessTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Required for storage accounts where kind = BlobStorage. The access tier used for billing. + """ + + HOT = "Hot" + COOL = "Cool" + +class AccountImmutabilityPolicyState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The ImmutabilityPolicy state defines the mode of the policy. Disabled state disables the + policy, Unlocked state allows increase and decrease of immutability retention time and also + allows toggling allowProtectedAppendWrites property, Locked state only allows the increase of + the immutability retention time. A policy can only be created in a Disabled or Unlocked state + and can be toggled between the two states. Only a policy in an Unlocked state can transition to + a Locked state which cannot be reverted. + """ + + UNLOCKED = "Unlocked" + LOCKED = "Locked" + DISABLED = "Disabled" + +class AccountStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Gets the status indicating whether the primary location of the storage account is available or + unavailable. + """ + + AVAILABLE = "available" + UNAVAILABLE = "unavailable" + +class BlobInventoryPolicyName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + DEFAULT = "default" + +class BlobRestoreProgressStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The status of blob restore progress. Possible values are: - InProgress: Indicates that blob + restore is ongoing. - Complete: Indicates that blob restore has been completed successfully. - + Failed: Indicates that blob restore is failed. + """ + + IN_PROGRESS = "InProgress" + COMPLETE = "Complete" + FAILED = "Failed" + +class Bypass(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are + any combination of Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None to + bypass none of those traffics. + """ + + NONE = "None" + LOGGING = "Logging" + METRICS = "Metrics" + AZURE_SERVICES = "AzureServices" + +class CorsRuleAllowedMethodsItem(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + DELETE = "DELETE" + GET = "GET" + HEAD = "HEAD" + MERGE = "MERGE" + POST = "POST" + OPTIONS = "OPTIONS" + PUT = "PUT" + +class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of identity that created the resource. + """ + + USER = "User" + APPLICATION = "Application" + MANAGED_IDENTITY = "ManagedIdentity" + KEY = "Key" + +class DefaultAction(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies the default action of allow or deny when no other rules match. + """ + + ALLOW = "Allow" + DENY = "Deny" + +class DefaultSharePermission(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Default share permission for users using Kerberos authentication if RBAC role is not assigned. + """ + + NONE = "None" + STORAGE_FILE_DATA_SMB_SHARE_READER = "StorageFileDataSmbShareReader" + STORAGE_FILE_DATA_SMB_SHARE_CONTRIBUTOR = "StorageFileDataSmbShareContributor" + STORAGE_FILE_DATA_SMB_SHARE_ELEVATED_CONTRIBUTOR = "StorageFileDataSmbShareElevatedContributor" + +class DirectoryServiceOptions(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Indicates the directory service used. + """ + + NONE = "None" + AADDS = "AADDS" + AD = "AD" + +class EnabledProtocols(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The authentication protocol that is used for the file share. Can only be specified when + creating a share. + """ + + SMB = "SMB" + NFS = "NFS" + +class EncryptionScopeSource(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The provider for the encryption scope. Possible values (case-insensitive): Microsoft.Storage, + Microsoft.KeyVault. + """ + + MICROSOFT_STORAGE = "Microsoft.Storage" + MICROSOFT_KEY_VAULT = "Microsoft.KeyVault" + +class EncryptionScopeState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The state of the encryption scope. Possible values (case-insensitive): Enabled, Disabled. + """ + + ENABLED = "Enabled" + DISABLED = "Disabled" + +class ExpirationAction(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The SAS expiration action. Can only be Log. + """ + + LOG = "Log" + +class ExtendedLocationTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of extendedLocation. + """ + + EDGE_ZONE = "EdgeZone" + +class Format(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """This is a required field, it specifies the format for the inventory files. + """ + + CSV = "Csv" + PARQUET = "Parquet" + +class GeoReplicationStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The status of the secondary location. Possible values are: - Live: Indicates that the secondary + location is active and operational. - Bootstrap: Indicates initial synchronization from the + primary location to the secondary location is in progress.This typically occurs when + replication is first enabled. - Unavailable: Indicates that the secondary location is + temporarily unavailable. + """ + + LIVE = "Live" + BOOTSTRAP = "Bootstrap" + UNAVAILABLE = "Unavailable" + +class HttpProtocol(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The protocol permitted for a request made with the account SAS. + """ + + HTTPS_HTTP = "https,http" + HTTPS = "https" + +class IdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The identity type. + """ + + NONE = "None" + SYSTEM_ASSIGNED = "SystemAssigned" + USER_ASSIGNED = "UserAssigned" + SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned,UserAssigned" + +class ImmutabilityPolicyState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The ImmutabilityPolicy state of a blob container, possible values include: Locked and Unlocked. + """ + + LOCKED = "Locked" + UNLOCKED = "Unlocked" + +class ImmutabilityPolicyUpdateType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The ImmutabilityPolicy update type of a blob container, possible values include: put, lock and + extend. + """ + + PUT = "put" + LOCK = "lock" + EXTEND = "extend" + +class InventoryRuleType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The valid value is Inventory + """ + + INVENTORY = "Inventory" + +class KeyPermission(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Permissions for the key -- read-only or full permissions. + """ + + READ = "Read" + FULL = "Full" + +class KeySource(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The encryption keySource (provider). Possible values (case-insensitive): Microsoft.Storage, + Microsoft.Keyvault + """ + + MICROSOFT_STORAGE = "Microsoft.Storage" + MICROSOFT_KEYVAULT = "Microsoft.Keyvault" + +class KeyType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Encryption key type to be used for the encryption service. 'Account' key type implies that an + account-scoped encryption key will be used. 'Service' key type implies that a default service + key is used. + """ + + SERVICE = "Service" + ACCOUNT = "Account" + +class Kind(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Indicates the type of storage account. + """ + + STORAGE = "Storage" + STORAGE_V2 = "StorageV2" + BLOB_STORAGE = "BlobStorage" + FILE_STORAGE = "FileStorage" + BLOCK_BLOB_STORAGE = "BlockBlobStorage" + +class LargeFileSharesState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled. + """ + + DISABLED = "Disabled" + ENABLED = "Enabled" + +class LeaseContainerRequestAction(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies the lease action. Can be one of the available actions. + """ + + ACQUIRE = "Acquire" + RENEW = "Renew" + CHANGE = "Change" + RELEASE = "Release" + BREAK_ENUM = "Break" + +class LeaseDuration(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies whether the lease on a container is of infinite or fixed duration, only when the + container is leased. + """ + + INFINITE = "Infinite" + FIXED = "Fixed" + +class LeaseShareAction(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies the lease action. Can be one of the available actions. + """ + + ACQUIRE = "Acquire" + RENEW = "Renew" + CHANGE = "Change" + RELEASE = "Release" + BREAK_ENUM = "Break" + +class LeaseState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Lease state of the container. + """ + + AVAILABLE = "Available" + LEASED = "Leased" + EXPIRED = "Expired" + BREAKING = "Breaking" + BROKEN = "Broken" + +class LeaseStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The lease status of the container. + """ + + LOCKED = "Locked" + UNLOCKED = "Unlocked" + +class ListContainersInclude(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + DELETED = "deleted" + +class ManagementPolicyName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + DEFAULT = "default" + +class MigrationState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """This property denotes the container level immutability to object level immutability migration + state. + """ + + IN_PROGRESS = "InProgress" + COMPLETED = "Completed" + +class MinimumTlsVersion(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Set the minimum TLS version to be permitted on requests to storage. The default interpretation + is TLS 1.0 for this property. + """ + + TLS1_0 = "TLS1_0" + TLS1_1 = "TLS1_1" + TLS1_2 = "TLS1_2" + +class Name(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Name of the policy. The valid value is AccessTimeTracking. This field is currently read only + """ + + ACCESS_TIME_TRACKING = "AccessTimeTracking" + +class ObjectType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """This is a required field. This field specifies the scope of the inventory created either at the + blob or container level. + """ + + BLOB = "Blob" + CONTAINER = "Container" + +class Permissions(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The signed permissions for the account SAS. Possible values include: Read (r), Write (w), + Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). + """ + + R = "r" + D = "d" + W = "w" + L = "l" + A = "a" + C = "c" + U = "u" + P = "p" + +class PrivateEndpointConnectionProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The current provisioning state. + """ + + SUCCEEDED = "Succeeded" + CREATING = "Creating" + DELETING = "Deleting" + FAILED = "Failed" + +class PrivateEndpointServiceConnectionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The private endpoint connection status. + """ + + PENDING = "Pending" + APPROVED = "Approved" + REJECTED = "Rejected" + +class ProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Gets the status of the storage account at the time the operation was called. + """ + + CREATING = "Creating" + RESOLVING_DNS = "ResolvingDNS" + SUCCEEDED = "Succeeded" + +class PublicAccess(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies whether data in the container may be accessed publicly and the level of access. + """ + + CONTAINER = "Container" + BLOB = "Blob" + NONE = "None" + +class PublicNetworkAccess(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Allow or disallow public network access to Storage Account. Value is optional but if passed in, + must be 'Enabled' or 'Disabled'. + """ + + ENABLED = "Enabled" + DISABLED = "Disabled" + +class Reason(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Gets the reason that a storage account name could not be used. The Reason element is only + returned if NameAvailable is false. + """ + + ACCOUNT_NAME_INVALID = "AccountNameInvalid" + ALREADY_EXISTS = "AlreadyExists" + +class ReasonCode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The reason for the restriction. As of now this can be "QuotaId" or + "NotAvailableForSubscription". Quota Id is set when the SKU has requiredQuotas parameter as the + subscription does not belong to that quota. The "NotAvailableForSubscription" is related to + capacity at DC. + """ + + QUOTA_ID = "QuotaId" + NOT_AVAILABLE_FOR_SUBSCRIPTION = "NotAvailableForSubscription" + +class RootSquashType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The property is for NFS share only. The default is NoRootSquash. + """ + + NO_ROOT_SQUASH = "NoRootSquash" + ROOT_SQUASH = "RootSquash" + ALL_SQUASH = "AllSquash" + +class RoutingChoice(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Routing Choice defines the kind of network routing opted by the user. + """ + + MICROSOFT_ROUTING = "MicrosoftRouting" + INTERNET_ROUTING = "InternetRouting" + +class RuleType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The valid value is Lifecycle + """ + + LIFECYCLE = "Lifecycle" + +class Schedule(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """This is a required field. This field is used to schedule an inventory formation. + """ + + DAILY = "Daily" + WEEKLY = "Weekly" + +class Services(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The signed services accessible with the account SAS. Possible values include: Blob (b), Queue + (q), Table (t), File (f). + """ + + B = "b" + Q = "q" + T = "t" + F = "f" + +class ShareAccessTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), + Hot, and Cool. FileStorage account can choose Premium. + """ + + TRANSACTION_OPTIMIZED = "TransactionOptimized" + HOT = "Hot" + COOL = "Cool" + PREMIUM = "Premium" + +class SignedResource(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The signed services accessible with the service SAS. Possible values include: Blob (b), + Container (c), File (f), Share (s). + """ + + B = "b" + C = "c" + F = "f" + S = "s" + +class SignedResourceTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The signed resource types that are accessible with the account SAS. Service (s): Access to + service-level APIs; Container (c): Access to container-level APIs; Object (o): Access to + object-level APIs for blobs, queue messages, table entities, and files. + """ + + S = "s" + C = "c" + O = "o" + +class SkuName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The SKU name. Required for account creation; optional for update. Note that in older versions, + SKU name was called accountType. + """ + + STANDARD_LRS = "Standard_LRS" + STANDARD_GRS = "Standard_GRS" + STANDARD_RAGRS = "Standard_RAGRS" + STANDARD_ZRS = "Standard_ZRS" + PREMIUM_LRS = "Premium_LRS" + PREMIUM_ZRS = "Premium_ZRS" + STANDARD_GZRS = "Standard_GZRS" + STANDARD_RAGZRS = "Standard_RAGZRS" + +class SkuTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The SKU tier. This is based on the SKU name. + """ + + STANDARD = "Standard" + PREMIUM = "Premium" + +class State(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Gets the state of virtual network rule. + """ + + PROVISIONING = "Provisioning" + DEPROVISIONING = "Deprovisioning" + SUCCEEDED = "Succeeded" + FAILED = "Failed" + NETWORK_SOURCE_DELETED = "NetworkSourceDeleted" + +class StorageAccountExpand(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + GEO_REPLICATION_STATS = "geoReplicationStats" + BLOB_RESTORE_STATUS = "blobRestoreStatus" + +class UsageUnit(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Gets the unit of measurement. + """ + + COUNT = "Count" + BYTES = "Bytes" + SECONDS = "Seconds" + PERCENT = "Percent" + COUNTS_PER_SECOND = "CountsPerSecond" + BYTES_PER_SECOND = "BytesPerSecond" diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/__init__.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/__init__.py new file mode 100644 index 000000000000..bddcf8c8cb34 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/__init__.py @@ -0,0 +1,49 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operations import Operations +from ._skus_operations import SkusOperations +from ._storage_accounts_operations import StorageAccountsOperations +from ._deleted_accounts_operations import DeletedAccountsOperations +from ._usages_operations import UsagesOperations +from ._management_policies_operations import ManagementPoliciesOperations +from ._blob_inventory_policies_operations import BlobInventoryPoliciesOperations +from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._private_link_resources_operations import PrivateLinkResourcesOperations +from ._object_replication_policies_operations import ObjectReplicationPoliciesOperations +from ._encryption_scopes_operations import EncryptionScopesOperations +from ._blob_services_operations import BlobServicesOperations +from ._blob_containers_operations import BlobContainersOperations +from ._file_services_operations import FileServicesOperations +from ._file_shares_operations import FileSharesOperations +from ._queue_services_operations import QueueServicesOperations +from ._queue_operations import QueueOperations +from ._table_services_operations import TableServicesOperations +from ._table_operations import TableOperations + +__all__ = [ + 'Operations', + 'SkusOperations', + 'StorageAccountsOperations', + 'DeletedAccountsOperations', + 'UsagesOperations', + 'ManagementPoliciesOperations', + 'BlobInventoryPoliciesOperations', + 'PrivateEndpointConnectionsOperations', + 'PrivateLinkResourcesOperations', + 'ObjectReplicationPoliciesOperations', + 'EncryptionScopesOperations', + 'BlobServicesOperations', + 'BlobContainersOperations', + 'FileServicesOperations', + 'FileSharesOperations', + 'QueueServicesOperations', + 'QueueOperations', + 'TableServicesOperations', + 'TableOperations', +] diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_blob_containers_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_blob_containers_operations.py new file mode 100644 index 000000000000..c992b0cbd435 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_blob_containers_operations.py @@ -0,0 +1,1227 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class BlobContainersOperations(object): + """BlobContainersOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2021_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + account_name, # type: str + maxpagesize=None, # type: Optional[str] + filter=None, # type: Optional[str] + include=None, # type: Optional[Union[str, "_models.ListContainersInclude"]] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ListContainerItems"] + """Lists all containers and does not support a prefix like data plane. Also SRP today does not + return continuation token. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param maxpagesize: Optional. Specified maximum number of containers that can be included in + the list. + :type maxpagesize: str + :param filter: Optional. When specified, only container names starting with the filter will be + listed. + :type filter: str + :param include: Optional, used to include the properties for soft deleted blob containers. + :type include: str or ~azure.mgmt.storage.v2021_06_01.models.ListContainersInclude + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListContainerItems or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2021_06_01.models.ListContainerItems] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListContainerItems"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if maxpagesize is not None: + query_parameters['$maxpagesize'] = self._serialize.query("maxpagesize", maxpagesize, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if include is not None: + query_parameters['$include'] = self._serialize.query("include", include, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ListContainerItems', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers'} # type: ignore + + def create( + self, + resource_group_name, # type: str + account_name, # type: str + container_name, # type: str + blob_container, # type: "_models.BlobContainer" + **kwargs # type: Any + ): + # type: (...) -> "_models.BlobContainer" + """Creates a new container under the specified account as described by request body. The container + resource includes metadata and properties for that container. It does not include a list of the + blobs contained by the container. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the specified storage account. + Blob container names must be between 3 and 63 characters in length and use numbers, lower-case + letters and dash (-) only. Every dash (-) character must be immediately preceded and followed + by a letter or number. + :type container_name: str + :param blob_container: Properties of the blob container to create. + :type blob_container: ~azure.mgmt.storage.v2021_06_01.models.BlobContainer + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BlobContainer, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.BlobContainer + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobContainer"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(blob_container, 'BlobContainer') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('BlobContainer', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('BlobContainer', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + account_name, # type: str + container_name, # type: str + blob_container, # type: "_models.BlobContainer" + **kwargs # type: Any + ): + # type: (...) -> "_models.BlobContainer" + """Updates container properties as specified in request body. Properties not mentioned in the + request will be unchanged. Update fails if the specified container doesn't already exist. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the specified storage account. + Blob container names must be between 3 and 63 characters in length and use numbers, lower-case + letters and dash (-) only. Every dash (-) character must be immediately preceded and followed + by a letter or number. + :type container_name: str + :param blob_container: Properties to update for the blob container. + :type blob_container: ~azure.mgmt.storage.v2021_06_01.models.BlobContainer + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BlobContainer, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.BlobContainer + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobContainer"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(blob_container, 'BlobContainer') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BlobContainer', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + account_name, # type: str + container_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.BlobContainer" + """Gets properties of a specified container. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the specified storage account. + Blob container names must be between 3 and 63 characters in length and use numbers, lower-case + letters and dash (-) only. Every dash (-) character must be immediately preceded and followed + by a letter or number. + :type container_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BlobContainer, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.BlobContainer + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobContainer"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BlobContainer', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + account_name, # type: str + container_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes specified container under its account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the specified storage account. + Blob container names must be between 3 and 63 characters in length and use numbers, lower-case + letters and dash (-) only. Every dash (-) character must be immediately preceded and followed + by a letter or number. + :type container_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} # type: ignore + + def set_legal_hold( + self, + resource_group_name, # type: str + account_name, # type: str + container_name, # type: str + legal_hold, # type: "_models.LegalHold" + **kwargs # type: Any + ): + # type: (...) -> "_models.LegalHold" + """Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold + follows an append pattern and does not clear out the existing tags that are not specified in + the request. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the specified storage account. + Blob container names must be between 3 and 63 characters in length and use numbers, lower-case + letters and dash (-) only. Every dash (-) character must be immediately preceded and followed + by a letter or number. + :type container_name: str + :param legal_hold: The LegalHold property that will be set to a blob container. + :type legal_hold: ~azure.mgmt.storage.v2021_06_01.models.LegalHold + :keyword callable cls: A custom type or function that will be passed the direct response + :return: LegalHold, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.LegalHold + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.LegalHold"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.set_legal_hold.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(legal_hold, 'LegalHold') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('LegalHold', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + set_legal_hold.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/setLegalHold'} # type: ignore + + def clear_legal_hold( + self, + resource_group_name, # type: str + account_name, # type: str + container_name, # type: str + legal_hold, # type: "_models.LegalHold" + **kwargs # type: Any + ): + # type: (...) -> "_models.LegalHold" + """Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent + operation. ClearLegalHold clears out only the specified tags in the request. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the specified storage account. + Blob container names must be between 3 and 63 characters in length and use numbers, lower-case + letters and dash (-) only. Every dash (-) character must be immediately preceded and followed + by a letter or number. + :type container_name: str + :param legal_hold: The LegalHold property that will be clear from a blob container. + :type legal_hold: ~azure.mgmt.storage.v2021_06_01.models.LegalHold + :keyword callable cls: A custom type or function that will be passed the direct response + :return: LegalHold, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.LegalHold + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.LegalHold"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.clear_legal_hold.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(legal_hold, 'LegalHold') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('LegalHold', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + clear_legal_hold.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/clearLegalHold'} # type: ignore + + def create_or_update_immutability_policy( + self, + resource_group_name, # type: str + account_name, # type: str + container_name, # type: str + if_match=None, # type: Optional[str] + parameters=None, # type: Optional["_models.ImmutabilityPolicy"] + **kwargs # type: Any + ): + # type: (...) -> "_models.ImmutabilityPolicy" + """Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but + not required for this operation. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the specified storage account. + Blob container names must be between 3 and 63 characters in length and use numbers, lower-case + letters and dash (-) only. Every dash (-) character must be immediately preceded and followed + by a letter or number. + :type container_name: str + :param if_match: The entity state (ETag) version of the immutability policy to update. A value + of "*" can be used to apply the operation only if the immutability policy already exists. If + omitted, this operation will always be applied. + :type if_match: str + :param parameters: The ImmutabilityPolicy Properties that will be created or updated to a blob + container. + :type parameters: ~azure.mgmt.storage.v2021_06_01.models.ImmutabilityPolicy + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ImmutabilityPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.ImmutabilityPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + immutability_policy_name = "default" + api_version = "2021-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_immutability_policy.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'immutabilityPolicyName': self._serialize.url("immutability_policy_name", immutability_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if parameters is not None: + body_content = self._serialize.body(parameters, 'ImmutabilityPolicy') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) + deserialized = self._deserialize('ImmutabilityPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + create_or_update_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}'} # type: ignore + + def get_immutability_policy( + self, + resource_group_name, # type: str + account_name, # type: str + container_name, # type: str + if_match=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.ImmutabilityPolicy" + """Gets the existing immutability policy along with the corresponding ETag in response headers and + body. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the specified storage account. + Blob container names must be between 3 and 63 characters in length and use numbers, lower-case + letters and dash (-) only. Every dash (-) character must be immediately preceded and followed + by a letter or number. + :type container_name: str + :param if_match: The entity state (ETag) version of the immutability policy to update. A value + of "*" can be used to apply the operation only if the immutability policy already exists. If + omitted, this operation will always be applied. + :type if_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ImmutabilityPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.ImmutabilityPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + immutability_policy_name = "default" + api_version = "2021-06-01" + accept = "application/json" + + # Construct URL + url = self.get_immutability_policy.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'immutabilityPolicyName': self._serialize.url("immutability_policy_name", immutability_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) + deserialized = self._deserialize('ImmutabilityPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + get_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}'} # type: ignore + + def delete_immutability_policy( + self, + resource_group_name, # type: str + account_name, # type: str + container_name, # type: str + if_match, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ImmutabilityPolicy" + """Aborts an unlocked immutability policy. The response of delete has + immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is required for this + operation. Deleting a locked immutability policy is not allowed, the only way is to delete the + container after deleting all expired blobs inside the policy locked container. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the specified storage account. + Blob container names must be between 3 and 63 characters in length and use numbers, lower-case + letters and dash (-) only. Every dash (-) character must be immediately preceded and followed + by a letter or number. + :type container_name: str + :param if_match: The entity state (ETag) version of the immutability policy to update. A value + of "*" can be used to apply the operation only if the immutability policy already exists. If + omitted, this operation will always be applied. + :type if_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ImmutabilityPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.ImmutabilityPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + immutability_policy_name = "default" + api_version = "2021-06-01" + accept = "application/json" + + # Construct URL + url = self.delete_immutability_policy.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'immutabilityPolicyName': self._serialize.url("immutability_policy_name", immutability_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) + deserialized = self._deserialize('ImmutabilityPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + delete_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}'} # type: ignore + + def lock_immutability_policy( + self, + resource_group_name, # type: str + account_name, # type: str + container_name, # type: str + if_match, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ImmutabilityPolicy" + """Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is + ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the specified storage account. + Blob container names must be between 3 and 63 characters in length and use numbers, lower-case + letters and dash (-) only. Every dash (-) character must be immediately preceded and followed + by a letter or number. + :type container_name: str + :param if_match: The entity state (ETag) version of the immutability policy to update. A value + of "*" can be used to apply the operation only if the immutability policy already exists. If + omitted, this operation will always be applied. + :type if_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ImmutabilityPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.ImmutabilityPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + # Construct URL + url = self.lock_immutability_policy.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) + deserialized = self._deserialize('ImmutabilityPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + lock_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/lock'} # type: ignore + + def extend_immutability_policy( + self, + resource_group_name, # type: str + account_name, # type: str + container_name, # type: str + if_match, # type: str + parameters=None, # type: Optional["_models.ImmutabilityPolicy"] + **kwargs # type: Any + ): + # type: (...) -> "_models.ImmutabilityPolicy" + """Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only + action allowed on a Locked policy will be this action. ETag in If-Match is required for this + operation. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the specified storage account. + Blob container names must be between 3 and 63 characters in length and use numbers, lower-case + letters and dash (-) only. Every dash (-) character must be immediately preceded and followed + by a letter or number. + :type container_name: str + :param if_match: The entity state (ETag) version of the immutability policy to update. A value + of "*" can be used to apply the operation only if the immutability policy already exists. If + omitted, this operation will always be applied. + :type if_match: str + :param parameters: The ImmutabilityPolicy Properties that will be extended for a blob + container. + :type parameters: ~azure.mgmt.storage.v2021_06_01.models.ImmutabilityPolicy + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ImmutabilityPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.ImmutabilityPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ImmutabilityPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.extend_immutability_policy.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if parameters is not None: + body_content = self._serialize.body(parameters, 'ImmutabilityPolicy') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) + deserialized = self._deserialize('ImmutabilityPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + extend_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/extend'} # type: ignore + + def lease( + self, + resource_group_name, # type: str + account_name, # type: str + container_name, # type: str + parameters=None, # type: Optional["_models.LeaseContainerRequest"] + **kwargs # type: Any + ): + # type: (...) -> "_models.LeaseContainerResponse" + """The Lease Container operation establishes and manages a lock on a container for delete + operations. The lock duration can be 15 to 60 seconds, or can be infinite. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the specified storage account. + Blob container names must be between 3 and 63 characters in length and use numbers, lower-case + letters and dash (-) only. Every dash (-) character must be immediately preceded and followed + by a letter or number. + :type container_name: str + :param parameters: Lease Container request body. + :type parameters: ~azure.mgmt.storage.v2021_06_01.models.LeaseContainerRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: LeaseContainerResponse, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.LeaseContainerResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.LeaseContainerResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.lease.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if parameters is not None: + body_content = self._serialize.body(parameters, 'LeaseContainerRequest') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('LeaseContainerResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + lease.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/lease'} # type: ignore + + def _object_level_worm_initial( + self, + resource_group_name, # type: str + account_name, # type: str + container_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + # Construct URL + url = self._object_level_worm_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _object_level_worm_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/migrate'} # type: ignore + + def begin_object_level_worm( + self, + resource_group_name, # type: str + account_name, # type: str + container_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """This operation migrates a blob container from container level WORM to object level immutability + enabled container. Prerequisites require a container level immutability policy either in locked + or unlocked state, Account level versioning must be enabled and there should be no Legal hold + on the container. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the specified storage account. + Blob container names must be between 3 and 63 characters in length and use numbers, lower-case + letters and dash (-) only. Every dash (-) character must be immediately preceded and followed + by a letter or number. + :type container_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._object_level_worm_initial( + resource_group_name=resource_group_name, + account_name=account_name, + container_name=container_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_object_level_worm.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/migrate'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_blob_inventory_policies_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_blob_inventory_policies_operations.py new file mode 100644 index 000000000000..a4a20167ddfc --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_blob_inventory_policies_operations.py @@ -0,0 +1,334 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class BlobInventoryPoliciesOperations(object): + """BlobInventoryPoliciesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2021_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + resource_group_name, # type: str + account_name, # type: str + blob_inventory_policy_name, # type: Union[str, "_models.BlobInventoryPolicyName"] + **kwargs # type: Any + ): + # type: (...) -> "_models.BlobInventoryPolicy" + """Gets the blob inventory policy associated with the specified storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param blob_inventory_policy_name: The name of the storage account blob inventory policy. It + should always be 'default'. + :type blob_inventory_policy_name: str or ~azure.mgmt.storage.v2021_06_01.models.BlobInventoryPolicyName + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BlobInventoryPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.BlobInventoryPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobInventoryPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'blobInventoryPolicyName': self._serialize.url("blob_inventory_policy_name", blob_inventory_policy_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BlobInventoryPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/inventoryPolicies/{blobInventoryPolicyName}'} # type: ignore + + def create_or_update( + self, + resource_group_name, # type: str + account_name, # type: str + blob_inventory_policy_name, # type: Union[str, "_models.BlobInventoryPolicyName"] + properties, # type: "_models.BlobInventoryPolicy" + **kwargs # type: Any + ): + # type: (...) -> "_models.BlobInventoryPolicy" + """Sets the blob inventory policy to the specified storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param blob_inventory_policy_name: The name of the storage account blob inventory policy. It + should always be 'default'. + :type blob_inventory_policy_name: str or ~azure.mgmt.storage.v2021_06_01.models.BlobInventoryPolicyName + :param properties: The blob inventory policy set to a storage account. + :type properties: ~azure.mgmt.storage.v2021_06_01.models.BlobInventoryPolicy + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BlobInventoryPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.BlobInventoryPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobInventoryPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'blobInventoryPolicyName': self._serialize.url("blob_inventory_policy_name", blob_inventory_policy_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(properties, 'BlobInventoryPolicy') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BlobInventoryPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/inventoryPolicies/{blobInventoryPolicyName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + account_name, # type: str + blob_inventory_policy_name, # type: Union[str, "_models.BlobInventoryPolicyName"] + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes the blob inventory policy associated with the specified storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param blob_inventory_policy_name: The name of the storage account blob inventory policy. It + should always be 'default'. + :type blob_inventory_policy_name: str or ~azure.mgmt.storage.v2021_06_01.models.BlobInventoryPolicyName + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'blobInventoryPolicyName': self._serialize.url("blob_inventory_policy_name", blob_inventory_policy_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/inventoryPolicies/{blobInventoryPolicyName}'} # type: ignore + + def list( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ListBlobInventoryPolicy"] + """Gets the blob inventory policy associated with the specified storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListBlobInventoryPolicy or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2021_06_01.models.ListBlobInventoryPolicy] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListBlobInventoryPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ListBlobInventoryPolicy', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/inventoryPolicies'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_blob_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_blob_services_operations.py new file mode 100644 index 000000000000..9169cd28d4a6 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_blob_services_operations.py @@ -0,0 +1,263 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class BlobServicesOperations(object): + """BlobServicesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2021_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.BlobServiceItems"] + """List blob services of storage account. It returns a collection of one object named default. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either BlobServiceItems or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2021_06_01.models.BlobServiceItems] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobServiceItems"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('BlobServiceItems', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices'} # type: ignore + + def set_service_properties( + self, + resource_group_name, # type: str + account_name, # type: str + parameters, # type: "_models.BlobServiceProperties" + **kwargs # type: Any + ): + # type: (...) -> "_models.BlobServiceProperties" + """Sets the properties of a storage account’s Blob service, including properties for Storage + Analytics and CORS (Cross-Origin Resource Sharing) rules. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param parameters: The properties of a storage account’s Blob service, including properties for + Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + :type parameters: ~azure.mgmt.storage.v2021_06_01.models.BlobServiceProperties + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BlobServiceProperties, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.BlobServiceProperties + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobServiceProperties"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + blob_services_name = "default" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.set_service_properties.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'BlobServicesName': self._serialize.url("blob_services_name", blob_services_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'BlobServiceProperties') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BlobServiceProperties', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + set_service_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/{BlobServicesName}'} # type: ignore + + def get_service_properties( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.BlobServiceProperties" + """Gets the properties of a storage account’s Blob service, including properties for Storage + Analytics and CORS (Cross-Origin Resource Sharing) rules. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BlobServiceProperties, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.BlobServiceProperties + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobServiceProperties"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + blob_services_name = "default" + accept = "application/json" + + # Construct URL + url = self.get_service_properties.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'BlobServicesName': self._serialize.url("blob_services_name", blob_services_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BlobServiceProperties', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_service_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/{BlobServicesName}'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_deleted_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_deleted_accounts_operations.py new file mode 100644 index 000000000000..24e0c28d0422 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_deleted_accounts_operations.py @@ -0,0 +1,174 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class DeletedAccountsOperations(object): + """DeletedAccountsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2021_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DeletedAccountListResult"] + """Lists deleted accounts under the subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DeletedAccountListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2021_06_01.models.DeletedAccountListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DeletedAccountListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DeletedAccountListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/deletedAccounts'} # type: ignore + + def get( + self, + deleted_account_name, # type: str + location, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.DeletedAccount" + """Get properties of specified deleted account resource. + + :param deleted_account_name: Name of the deleted storage account. + :type deleted_account_name: str + :param location: The location of the deleted storage account. + :type location: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DeletedAccount, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.DeletedAccount + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DeletedAccount"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'deletedAccountName': self._serialize.url("deleted_account_name", deleted_account_name, 'str', max_length=24, min_length=3), + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DeletedAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/locations/{location}/deletedAccounts/{deletedAccountName}'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_encryption_scopes_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_encryption_scopes_operations.py new file mode 100644 index 000000000000..ffa54c69dd19 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_encryption_scopes_operations.py @@ -0,0 +1,357 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class EncryptionScopesOperations(object): + """EncryptionScopesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2021_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def put( + self, + resource_group_name, # type: str + account_name, # type: str + encryption_scope_name, # type: str + encryption_scope, # type: "_models.EncryptionScope" + **kwargs # type: Any + ): + # type: (...) -> "_models.EncryptionScope" + """Synchronously creates or updates an encryption scope under the specified storage account. If an + encryption scope is already created and a subsequent request is issued with different + properties, the encryption scope properties will be updated per the specified request. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param encryption_scope_name: The name of the encryption scope within the specified storage + account. Encryption scope names must be between 3 and 63 characters in length and use numbers, + lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type encryption_scope_name: str + :param encryption_scope: Encryption scope properties to be used for the create or update. + :type encryption_scope: ~azure.mgmt.storage.v2021_06_01.models.EncryptionScope + :keyword callable cls: A custom type or function that will be passed the direct response + :return: EncryptionScope, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.EncryptionScope + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.EncryptionScope"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.put.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'encryptionScopeName': self._serialize.url("encryption_scope_name", encryption_scope_name, 'str', max_length=63, min_length=3), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(encryption_scope, 'EncryptionScope') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('EncryptionScope', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('EncryptionScope', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + put.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}'} # type: ignore + + def patch( + self, + resource_group_name, # type: str + account_name, # type: str + encryption_scope_name, # type: str + encryption_scope, # type: "_models.EncryptionScope" + **kwargs # type: Any + ): + # type: (...) -> "_models.EncryptionScope" + """Update encryption scope properties as specified in the request body. Update fails if the + specified encryption scope does not already exist. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param encryption_scope_name: The name of the encryption scope within the specified storage + account. Encryption scope names must be between 3 and 63 characters in length and use numbers, + lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type encryption_scope_name: str + :param encryption_scope: Encryption scope properties to be used for the update. + :type encryption_scope: ~azure.mgmt.storage.v2021_06_01.models.EncryptionScope + :keyword callable cls: A custom type or function that will be passed the direct response + :return: EncryptionScope, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.EncryptionScope + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.EncryptionScope"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.patch.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'encryptionScopeName': self._serialize.url("encryption_scope_name", encryption_scope_name, 'str', max_length=63, min_length=3), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(encryption_scope, 'EncryptionScope') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('EncryptionScope', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + patch.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + account_name, # type: str + encryption_scope_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.EncryptionScope" + """Returns the properties for the specified encryption scope. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param encryption_scope_name: The name of the encryption scope within the specified storage + account. Encryption scope names must be between 3 and 63 characters in length and use numbers, + lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type encryption_scope_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: EncryptionScope, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.EncryptionScope + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.EncryptionScope"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'encryptionScopeName': self._serialize.url("encryption_scope_name", encryption_scope_name, 'str', max_length=63, min_length=3), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('EncryptionScope', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}'} # type: ignore + + def list( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.EncryptionScopeListResult"] + """Lists all the encryption scopes available under the specified storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either EncryptionScopeListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2021_06_01.models.EncryptionScopeListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.EncryptionScopeListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('EncryptionScopeListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_file_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_file_services_operations.py new file mode 100644 index 000000000000..0ebb435eb31f --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_file_services_operations.py @@ -0,0 +1,249 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class FileServicesOperations(object): + """FileServicesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2021_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.FileServiceItems" + """List all file services in storage accounts. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FileServiceItems, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.FileServiceItems + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FileServiceItems"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CloudErrorAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FileServiceItems', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices'} # type: ignore + + def set_service_properties( + self, + resource_group_name, # type: str + account_name, # type: str + parameters, # type: "_models.FileServiceProperties" + **kwargs # type: Any + ): + # type: (...) -> "_models.FileServiceProperties" + """Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource + Sharing) rules. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param parameters: The properties of file services in storage accounts, including CORS + (Cross-Origin Resource Sharing) rules. + :type parameters: ~azure.mgmt.storage.v2021_06_01.models.FileServiceProperties + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FileServiceProperties, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.FileServiceProperties + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FileServiceProperties"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + file_services_name = "default" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.set_service_properties.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'FileServicesName': self._serialize.url("file_services_name", file_services_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'FileServiceProperties') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CloudErrorAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FileServiceProperties', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + set_service_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/{FileServicesName}'} # type: ignore + + def get_service_properties( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.FileServiceProperties" + """Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource + Sharing) rules. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FileServiceProperties, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.FileServiceProperties + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FileServiceProperties"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + file_services_name = "default" + accept = "application/json" + + # Construct URL + url = self.get_service_properties.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'FileServicesName': self._serialize.url("file_services_name", file_services_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CloudErrorAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FileServiceProperties', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_service_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/{FileServicesName}'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_file_shares_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_file_shares_operations.py new file mode 100644 index 000000000000..ee6d098cdab5 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_file_shares_operations.py @@ -0,0 +1,639 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class FileSharesOperations(object): + """FileSharesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2021_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + account_name, # type: str + maxpagesize=None, # type: Optional[str] + filter=None, # type: Optional[str] + expand=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.FileShareItems"] + """Lists all shares. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param maxpagesize: Optional. Specified maximum number of shares that can be included in the + list. + :type maxpagesize: str + :param filter: Optional. When specified, only share names starting with the filter will be + listed. + :type filter: str + :param expand: Optional, used to expand the properties within share's properties. Valid values + are: deleted, snapshots. Should be passed as a string with delimiter ','. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either FileShareItems or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2021_06_01.models.FileShareItems] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FileShareItems"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if maxpagesize is not None: + query_parameters['$maxpagesize'] = self._serialize.query("maxpagesize", maxpagesize, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('FileShareItems', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.CloudErrorAutoGenerated, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares'} # type: ignore + + def create( + self, + resource_group_name, # type: str + account_name, # type: str + share_name, # type: str + file_share, # type: "_models.FileShare" + expand=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.FileShare" + """Creates a new share under the specified account as described by request body. The share + resource includes metadata and properties for that share. It does not include a list of the + files contained by the share. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param share_name: The name of the file share within the specified storage account. File share + names must be between 3 and 63 characters in length and use numbers, lower-case letters and + dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter + or number. + :type share_name: str + :param file_share: Properties of the file share to create. + :type file_share: ~azure.mgmt.storage.v2021_06_01.models.FileShare + :param expand: Optional, used to expand the properties within share's properties. Valid values + are: snapshots. Should be passed as a string with delimiter ','. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FileShare, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.FileShare + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FileShare"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'shareName': self._serialize.url("share_name", share_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(file_share, 'FileShare') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CloudErrorAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('FileShare', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('FileShare', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + account_name, # type: str + share_name, # type: str + file_share, # type: "_models.FileShare" + **kwargs # type: Any + ): + # type: (...) -> "_models.FileShare" + """Updates share properties as specified in request body. Properties not mentioned in the request + will not be changed. Update fails if the specified share does not already exist. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param share_name: The name of the file share within the specified storage account. File share + names must be between 3 and 63 characters in length and use numbers, lower-case letters and + dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter + or number. + :type share_name: str + :param file_share: Properties to update for the file share. + :type file_share: ~azure.mgmt.storage.v2021_06_01.models.FileShare + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FileShare, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.FileShare + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FileShare"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'shareName': self._serialize.url("share_name", share_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(file_share, 'FileShare') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CloudErrorAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FileShare', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + account_name, # type: str + share_name, # type: str + expand=None, # type: Optional[str] + x_ms_snapshot=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.FileShare" + """Gets properties of a specified share. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param share_name: The name of the file share within the specified storage account. File share + names must be between 3 and 63 characters in length and use numbers, lower-case letters and + dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter + or number. + :type share_name: str + :param expand: Optional, used to expand the properties within share's properties. Valid values + are: stats. Should be passed as a string with delimiter ','. + :type expand: str + :param x_ms_snapshot: Optional, used to retrieve properties of a snapshot. + :type x_ms_snapshot: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FileShare, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.FileShare + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.FileShare"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'shareName': self._serialize.url("share_name", share_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if x_ms_snapshot is not None: + header_parameters['x-ms-snapshot'] = self._serialize.header("x_ms_snapshot", x_ms_snapshot, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CloudErrorAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('FileShare', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + account_name, # type: str + share_name, # type: str + x_ms_snapshot=None, # type: Optional[str] + include=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes specified share under its account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param share_name: The name of the file share within the specified storage account. File share + names must be between 3 and 63 characters in length and use numbers, lower-case letters and + dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter + or number. + :type share_name: str + :param x_ms_snapshot: Optional, used to delete a snapshot. + :type x_ms_snapshot: str + :param include: Optional. Valid values are: snapshots, leased-snapshots, none. The default + value is snapshots. For 'snapshots', the file share is deleted including all of its file share + snapshots. If the file share contains leased-snapshots, the deletion fails. For + 'leased-snapshots', the file share is deleted included all of its file share snapshots + (leased/unleased). For 'none', the file share is deleted if it has no share snapshots. If the + file share contains any snapshots (leased or unleased), the deletion fails. + :type include: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'shareName': self._serialize.url("share_name", share_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if include is not None: + query_parameters['$include'] = self._serialize.query("include", include, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if x_ms_snapshot is not None: + header_parameters['x-ms-snapshot'] = self._serialize.header("x_ms_snapshot", x_ms_snapshot, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CloudErrorAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}'} # type: ignore + + def restore( + self, + resource_group_name, # type: str + account_name, # type: str + share_name, # type: str + deleted_share, # type: "_models.DeletedShare" + **kwargs # type: Any + ): + # type: (...) -> None + """Restore a file share within a valid retention days if share soft delete is enabled. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param share_name: The name of the file share within the specified storage account. File share + names must be between 3 and 63 characters in length and use numbers, lower-case letters and + dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter + or number. + :type share_name: str + :param deleted_share: + :type deleted_share: ~azure.mgmt.storage.v2021_06_01.models.DeletedShare + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.restore.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'shareName': self._serialize.url("share_name", share_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(deleted_share, 'DeletedShare') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CloudErrorAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + restore.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}/restore'} # type: ignore + + def lease( + self, + resource_group_name, # type: str + account_name, # type: str + share_name, # type: str + x_ms_snapshot=None, # type: Optional[str] + parameters=None, # type: Optional["_models.LeaseShareRequest"] + **kwargs # type: Any + ): + # type: (...) -> "_models.LeaseShareResponse" + """The Lease Share operation establishes and manages a lock on a share for delete operations. The + lock duration can be 15 to 60 seconds, or can be infinite. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param share_name: The name of the file share within the specified storage account. File share + names must be between 3 and 63 characters in length and use numbers, lower-case letters and + dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter + or number. + :type share_name: str + :param x_ms_snapshot: Optional. Specify the snapshot time to lease a snapshot. + :type x_ms_snapshot: str + :param parameters: Lease Share request body. + :type parameters: ~azure.mgmt.storage.v2021_06_01.models.LeaseShareRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: LeaseShareResponse, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.LeaseShareResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.LeaseShareResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.lease.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'shareName': self._serialize.url("share_name", share_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if x_ms_snapshot is not None: + header_parameters['x-ms-snapshot'] = self._serialize.header("x_ms_snapshot", x_ms_snapshot, 'str') + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if parameters is not None: + body_content = self._serialize.body(parameters, 'LeaseShareRequest') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CloudErrorAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) + deserialized = self._deserialize('LeaseShareResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + lease.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}/lease'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_management_policies_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_management_policies_operations.py new file mode 100644 index 000000000000..d6a65327a004 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_management_policies_operations.py @@ -0,0 +1,249 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ManagementPoliciesOperations(object): + """ManagementPoliciesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2021_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + resource_group_name, # type: str + account_name, # type: str + management_policy_name, # type: Union[str, "_models.ManagementPolicyName"] + **kwargs # type: Any + ): + # type: (...) -> "_models.ManagementPolicy" + """Gets the managementpolicy associated with the specified storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param management_policy_name: The name of the Storage Account Management Policy. It should + always be 'default'. + :type management_policy_name: str or ~azure.mgmt.storage.v2021_06_01.models.ManagementPolicyName + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ManagementPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.ManagementPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagementPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'managementPolicyName': self._serialize.url("management_policy_name", management_policy_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ManagementPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}'} # type: ignore + + def create_or_update( + self, + resource_group_name, # type: str + account_name, # type: str + management_policy_name, # type: Union[str, "_models.ManagementPolicyName"] + properties, # type: "_models.ManagementPolicy" + **kwargs # type: Any + ): + # type: (...) -> "_models.ManagementPolicy" + """Sets the managementpolicy to the specified storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param management_policy_name: The name of the Storage Account Management Policy. It should + always be 'default'. + :type management_policy_name: str or ~azure.mgmt.storage.v2021_06_01.models.ManagementPolicyName + :param properties: The ManagementPolicy set to a storage account. + :type properties: ~azure.mgmt.storage.v2021_06_01.models.ManagementPolicy + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ManagementPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.ManagementPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ManagementPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'managementPolicyName': self._serialize.url("management_policy_name", management_policy_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(properties, 'ManagementPolicy') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ManagementPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + account_name, # type: str + management_policy_name, # type: Union[str, "_models.ManagementPolicyName"] + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes the managementpolicy associated with the specified storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param management_policy_name: The name of the Storage Account Management Policy. It should + always be 'default'. + :type management_policy_name: str or ~azure.mgmt.storage.v2021_06_01.models.ManagementPolicyName + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'managementPolicyName': self._serialize.url("management_policy_name", management_policy_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_object_replication_policies_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_object_replication_policies_operations.py new file mode 100644 index 000000000000..8483558c732b --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_object_replication_policies_operations.py @@ -0,0 +1,341 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ObjectReplicationPoliciesOperations(object): + """ObjectReplicationPoliciesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2021_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ObjectReplicationPolicies"] + """List the object replication policies associated with the storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ObjectReplicationPolicies or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2021_06_01.models.ObjectReplicationPolicies] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ObjectReplicationPolicies"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ObjectReplicationPolicies', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies'} # type: ignore + + def get( + self, + resource_group_name, # type: str + account_name, # type: str + object_replication_policy_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ObjectReplicationPolicy" + """Get the object replication policy of the storage account by policy ID. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param object_replication_policy_id: For the destination account, provide the value 'default'. + Configure the policy on the destination account first. For the source account, provide the + value of the policy ID that is returned when you download the policy that was defined on the + destination account. The policy is downloaded as a JSON file. + :type object_replication_policy_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ObjectReplicationPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.ObjectReplicationPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ObjectReplicationPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'objectReplicationPolicyId': self._serialize.url("object_replication_policy_id", object_replication_policy_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ObjectReplicationPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}'} # type: ignore + + def create_or_update( + self, + resource_group_name, # type: str + account_name, # type: str + object_replication_policy_id, # type: str + properties, # type: "_models.ObjectReplicationPolicy" + **kwargs # type: Any + ): + # type: (...) -> "_models.ObjectReplicationPolicy" + """Create or update the object replication policy of the storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param object_replication_policy_id: For the destination account, provide the value 'default'. + Configure the policy on the destination account first. For the source account, provide the + value of the policy ID that is returned when you download the policy that was defined on the + destination account. The policy is downloaded as a JSON file. + :type object_replication_policy_id: str + :param properties: The object replication policy set to a storage account. A unique policy ID + will be created if absent. + :type properties: ~azure.mgmt.storage.v2021_06_01.models.ObjectReplicationPolicy + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ObjectReplicationPolicy, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.ObjectReplicationPolicy + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ObjectReplicationPolicy"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'objectReplicationPolicyId': self._serialize.url("object_replication_policy_id", object_replication_policy_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(properties, 'ObjectReplicationPolicy') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ObjectReplicationPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + account_name, # type: str + object_replication_policy_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes the object replication policy associated with the specified storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param object_replication_policy_id: For the destination account, provide the value 'default'. + Configure the policy on the destination account first. For the source account, provide the + value of the policy ID that is returned when you download the policy that was defined on the + destination account. The policy is downloaded as a JSON file. + :type object_replication_policy_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'objectReplicationPolicyId': self._serialize.url("object_replication_policy_id", object_replication_policy_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_operations.py new file mode 100644 index 000000000000..87ce91d6dabf --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_operations.py @@ -0,0 +1,109 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class Operations(object): + """Operations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2021_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.OperationListResult"] + """Lists all of the available Storage Rest API operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2021_06_01.models.OperationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('OperationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.Storage/operations'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_private_endpoint_connections_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_private_endpoint_connections_operations.py new file mode 100644 index 000000000000..5ace766fd21c --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_private_endpoint_connections_operations.py @@ -0,0 +1,333 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class PrivateEndpointConnectionsOperations(object): + """PrivateEndpointConnectionsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2021_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.PrivateEndpointConnectionListResult"] + """List all the private endpoint connections associated with the storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PrivateEndpointConnectionListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2021_06_01.models.PrivateEndpointConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('PrivateEndpointConnectionListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections'} # type: ignore + + def get( + self, + resource_group_name, # type: str + account_name, # type: str + private_endpoint_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateEndpointConnection" + """Gets the specified private endpoint connection associated with the storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def put( + self, + resource_group_name, # type: str + account_name, # type: str + private_endpoint_connection_name, # type: str + properties, # type: "_models.PrivateEndpointConnection" + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateEndpointConnection" + """Update the state of specified private endpoint connection associated with the storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. + :type private_endpoint_connection_name: str + :param properties: The private endpoint connection properties. + :type properties: ~azure.mgmt.storage.v2021_06_01.models.PrivateEndpointConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.put.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(properties, 'PrivateEndpointConnection') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + put.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + account_name, # type: str + private_endpoint_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes the specified private endpoint connection associated with the storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_private_link_resources_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_private_link_resources_operations.py new file mode 100644 index 000000000000..e168aa3b06a2 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_private_link_resources_operations.py @@ -0,0 +1,107 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class PrivateLinkResourcesOperations(object): + """PrivateLinkResourcesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2021_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_storage_account( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateLinkResourceListResult" + """Gets the private link resources that need to be created for a storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkResourceListResult, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.PrivateLinkResourceListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + # Construct URL + url = self.list_by_storage_account.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateLinkResourceListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_by_storage_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateLinkResources'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_queue_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_queue_operations.py new file mode 100644 index 000000000000..3af976e8c8a6 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_queue_operations.py @@ -0,0 +1,430 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class QueueOperations(object): + """QueueOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2021_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def create( + self, + resource_group_name, # type: str + account_name, # type: str + queue_name, # type: str + queue, # type: "_models.StorageQueue" + **kwargs # type: Any + ): + # type: (...) -> "_models.StorageQueue" + """Creates a new queue with the specified queue name, under the specified account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param queue_name: A queue name must be unique within a storage account and must be between 3 + and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, + it should begin and end with an alphanumeric character and it cannot have two consecutive + dash(-) characters. + :type queue_name: str + :param queue: Queue properties and metadata to be created with. + :type queue: ~azure.mgmt.storage.v2021_06_01.models.StorageQueue + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StorageQueue, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.StorageQueue + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageQueue"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'queueName': self._serialize.url("queue_name", queue_name, 'str', max_length=63, min_length=3, pattern=r'^[a-z0-9]([a-z0-9]|(-(?!-))){1,61}[a-z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(queue, 'StorageQueue') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CloudErrorAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StorageQueue', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + account_name, # type: str + queue_name, # type: str + queue, # type: "_models.StorageQueue" + **kwargs # type: Any + ): + # type: (...) -> "_models.StorageQueue" + """Creates a new queue with the specified queue name, under the specified account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param queue_name: A queue name must be unique within a storage account and must be between 3 + and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, + it should begin and end with an alphanumeric character and it cannot have two consecutive + dash(-) characters. + :type queue_name: str + :param queue: Queue properties and metadata to be created with. + :type queue: ~azure.mgmt.storage.v2021_06_01.models.StorageQueue + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StorageQueue, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.StorageQueue + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageQueue"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'queueName': self._serialize.url("queue_name", queue_name, 'str', max_length=63, min_length=3, pattern=r'^[a-z0-9]([a-z0-9]|(-(?!-))){1,61}[a-z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(queue, 'StorageQueue') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CloudErrorAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StorageQueue', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + account_name, # type: str + queue_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.StorageQueue" + """Gets the queue with the specified queue name, under the specified account if it exists. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param queue_name: A queue name must be unique within a storage account and must be between 3 + and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, + it should begin and end with an alphanumeric character and it cannot have two consecutive + dash(-) characters. + :type queue_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StorageQueue, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.StorageQueue + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageQueue"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'queueName': self._serialize.url("queue_name", queue_name, 'str', max_length=63, min_length=3, pattern=r'^[a-z0-9]([a-z0-9]|(-(?!-))){1,61}[a-z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CloudErrorAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StorageQueue', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + account_name, # type: str + queue_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes the queue with the specified queue name, under the specified account if it exists. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param queue_name: A queue name must be unique within a storage account and must be between 3 + and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, + it should begin and end with an alphanumeric character and it cannot have two consecutive + dash(-) characters. + :type queue_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'queueName': self._serialize.url("queue_name", queue_name, 'str', max_length=63, min_length=3, pattern=r'^[a-z0-9]([a-z0-9]|(-(?!-))){1,61}[a-z0-9]$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CloudErrorAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}'} # type: ignore + + def list( + self, + resource_group_name, # type: str + account_name, # type: str + maxpagesize=None, # type: Optional[str] + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ListQueueResource"] + """Gets a list of all the queues under the specified storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param maxpagesize: Optional, a maximum number of queues that should be included in a list + queue response. + :type maxpagesize: str + :param filter: Optional, When specified, only the queues with a name starting with the given + filter will be listed. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListQueueResource or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2021_06_01.models.ListQueueResource] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListQueueResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if maxpagesize is not None: + query_parameters['$maxpagesize'] = self._serialize.query("maxpagesize", maxpagesize, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ListQueueResource', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.CloudErrorAutoGenerated, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_queue_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_queue_services_operations.py new file mode 100644 index 000000000000..779f6d26cbaf --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_queue_services_operations.py @@ -0,0 +1,249 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class QueueServicesOperations(object): + """QueueServicesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2021_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ListQueueServices" + """List all queue services for the storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ListQueueServices, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.ListQueueServices + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListQueueServices"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CloudErrorAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ListQueueServices', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices'} # type: ignore + + def set_service_properties( + self, + resource_group_name, # type: str + account_name, # type: str + parameters, # type: "_models.QueueServiceProperties" + **kwargs # type: Any + ): + # type: (...) -> "_models.QueueServiceProperties" + """Sets the properties of a storage account’s Queue service, including properties for Storage + Analytics and CORS (Cross-Origin Resource Sharing) rules. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param parameters: The properties of a storage account’s Queue service, only properties for + Storage Analytics and CORS (Cross-Origin Resource Sharing) rules can be specified. + :type parameters: ~azure.mgmt.storage.v2021_06_01.models.QueueServiceProperties + :keyword callable cls: A custom type or function that will be passed the direct response + :return: QueueServiceProperties, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.QueueServiceProperties + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.QueueServiceProperties"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + queue_service_name = "default" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.set_service_properties.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'queueServiceName': self._serialize.url("queue_service_name", queue_service_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'QueueServiceProperties') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CloudErrorAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('QueueServiceProperties', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + set_service_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/{queueServiceName}'} # type: ignore + + def get_service_properties( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.QueueServiceProperties" + """Gets the properties of a storage account’s Queue service, including properties for Storage + Analytics and CORS (Cross-Origin Resource Sharing) rules. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: QueueServiceProperties, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.QueueServiceProperties + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.QueueServiceProperties"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + queue_service_name = "default" + accept = "application/json" + + # Construct URL + url = self.get_service_properties.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'queueServiceName': self._serialize.url("queue_service_name", queue_service_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CloudErrorAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('QueueServiceProperties', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_service_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/{queueServiceName}'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_skus_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_skus_operations.py new file mode 100644 index 000000000000..eebde5adeaa6 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_skus_operations.py @@ -0,0 +1,113 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class SkusOperations(object): + """SkusOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2021_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.StorageSkuListResult"] + """Lists the available SKUs supported by Microsoft.Storage for given subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StorageSkuListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2021_06_01.models.StorageSkuListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageSkuListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('StorageSkuListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/skus'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_storage_accounts_operations.py new file mode 100644 index 000000000000..a8a7e3f6f67b --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_storage_accounts_operations.py @@ -0,0 +1,1408 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class StorageAccountsOperations(object): + """StorageAccountsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2021_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def check_name_availability( + self, + account_name, # type: "_models.StorageAccountCheckNameAvailabilityParameters" + **kwargs # type: Any + ): + # type: (...) -> "_models.CheckNameAvailabilityResult" + """Checks that the storage account name is valid and is not already in use. + + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: ~azure.mgmt.storage.v2021_06_01.models.StorageAccountCheckNameAvailabilityParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CheckNameAvailabilityResult, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.CheckNameAvailabilityResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameAvailabilityResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.check_name_availability.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(account_name, 'StorageAccountCheckNameAvailabilityParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CheckNameAvailabilityResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability'} # type: ignore + + def _create_initial( + self, + resource_group_name, # type: str + account_name, # type: str + parameters, # type: "_models.StorageAccountCreateParameters" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.StorageAccount"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StorageAccount"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'StorageAccountCreateParameters') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('StorageAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} # type: ignore + + def begin_create( + self, + resource_group_name, # type: str + account_name, # type: str + parameters, # type: "_models.StorageAccountCreateParameters" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.StorageAccount"] + """Asynchronously creates a new storage account with the specified parameters. If an account is + already created and a subsequent create request is issued with different properties, the + account properties will be updated. If an account is already created and a subsequent create or + update request is issued with the exact same set of properties, the request will succeed. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param parameters: The parameters to provide for the created account. + :type parameters: ~azure.mgmt.storage.v2021_06_01.models.StorageAccountCreateParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either StorageAccount or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.storage.v2021_06_01.models.StorageAccount] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_initial( + resource_group_name=resource_group_name, + account_name=account_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('StorageAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a storage account in Microsoft Azure. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} # type: ignore + + def get_properties( + self, + resource_group_name, # type: str + account_name, # type: str + expand=None, # type: Optional[Union[str, "_models.StorageAccountExpand"]] + **kwargs # type: Any + ): + # type: (...) -> "_models.StorageAccount" + """Returns the properties for the specified storage account including but not limited to name, SKU + name, location, and account status. The ListKeys operation should be used to retrieve storage + keys. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param expand: May be used to expand the properties within account's properties. By default, + data is not included when fetching properties. Currently we only support geoReplicationStats + and blobRestoreStatus. + :type expand: str or ~azure.mgmt.storage.v2021_06_01.models.StorageAccountExpand + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StorageAccount, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.StorageAccount + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + # Construct URL + url = self.get_properties.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StorageAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + account_name, # type: str + parameters, # type: "_models.StorageAccountUpdateParameters" + **kwargs # type: Any + ): + # type: (...) -> "_models.StorageAccount" + """The update operation can be used to update the SKU, encryption, access tier, or tags for a + storage account. It can also be used to map the account to a custom domain. Only one custom + domain is supported per storage account; the replacement/change of custom domain is not + supported. In order to replace an old custom domain, the old value must be cleared/unregistered + before a new value can be set. The update of multiple properties is supported. This call does + not change the storage keys for the account. If you want to change the storage account keys, + use the regenerate keys operation. The location and name of the storage account cannot be + changed after creation. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param parameters: The parameters to provide for the updated account. + :type parameters: ~azure.mgmt.storage.v2021_06_01.models.StorageAccountUpdateParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StorageAccount, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.StorageAccount + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccount"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'StorageAccountUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StorageAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} # type: ignore + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.StorageAccountListResult"] + """Lists all the storage accounts available under the subscription. Note that storage keys are not + returned; use the ListKeys operation for this. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StorageAccountListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2021_06_01.models.StorageAccountListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('StorageAccountListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.StorageAccountListResult"] + """Lists all the storage accounts available under the given resource group. Note that storage keys + are not returned; use the ListKeys operation for this. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either StorageAccountListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2021_06_01.models.StorageAccountListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('StorageAccountListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts'} # type: ignore + + def list_keys( + self, + resource_group_name, # type: str + account_name, # type: str + expand="kerb", # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.StorageAccountListKeysResult" + """Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage + account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param expand: Specifies type of the key to be listed. Possible value is kerb. + :type expand: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StorageAccountListKeysResult, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.StorageAccountListKeysResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListKeysResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + # Construct URL + url = self.list_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StorageAccountListKeysResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys'} # type: ignore + + def regenerate_key( + self, + resource_group_name, # type: str + account_name, # type: str + regenerate_key, # type: "_models.StorageAccountRegenerateKeyParameters" + **kwargs # type: Any + ): + # type: (...) -> "_models.StorageAccountListKeysResult" + """Regenerates one of the access keys or Kerberos keys for the specified storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param regenerate_key: Specifies name of the key which should be regenerated -- key1, key2, + kerb1, kerb2. + :type regenerate_key: ~azure.mgmt.storage.v2021_06_01.models.StorageAccountRegenerateKeyParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: StorageAccountListKeysResult, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.StorageAccountListKeysResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageAccountListKeysResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.regenerate_key.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(regenerate_key, 'StorageAccountRegenerateKeyParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('StorageAccountListKeysResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey'} # type: ignore + + def list_account_sas( + self, + resource_group_name, # type: str + account_name, # type: str + parameters, # type: "_models.AccountSasParameters" + **kwargs # type: Any + ): + # type: (...) -> "_models.ListAccountSasResponse" + """List SAS credentials of a storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param parameters: The parameters to provide to list SAS credentials for the storage account. + :type parameters: ~azure.mgmt.storage.v2021_06_01.models.AccountSasParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ListAccountSasResponse, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.ListAccountSasResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListAccountSasResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.list_account_sas.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'AccountSasParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ListAccountSasResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_account_sas.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListAccountSas'} # type: ignore + + def list_service_sas( + self, + resource_group_name, # type: str + account_name, # type: str + parameters, # type: "_models.ServiceSasParameters" + **kwargs # type: Any + ): + # type: (...) -> "_models.ListServiceSasResponse" + """List service SAS credentials of a specific resource. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param parameters: The parameters to provide to list service SAS credentials. + :type parameters: ~azure.mgmt.storage.v2021_06_01.models.ServiceSasParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ListServiceSasResponse, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.ListServiceSasResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListServiceSasResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.list_service_sas.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ServiceSasParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ListServiceSasResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_service_sas.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListServiceSas'} # type: ignore + + def _failover_initial( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + + # Construct URL + url = self._failover_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _failover_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/failover'} # type: ignore + + def begin_failover( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Failover request can be triggered for a storage account in case of availability issues. The + failover occurs from the storage account's primary cluster to secondary cluster for RA-GRS + accounts. The secondary cluster will become primary after failover. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._failover_initial( + resource_group_name=resource_group_name, + account_name=account_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_failover.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/failover'} # type: ignore + + def _hierarchical_namespace_migration_initial( + self, + resource_group_name, # type: str + account_name, # type: str + request_type, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + # Construct URL + url = self._hierarchical_namespace_migration_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['requestType'] = self._serialize.query("request_type", request_type, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _hierarchical_namespace_migration_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/hnsonmigration'} # type: ignore + + def begin_hierarchical_namespace_migration( + self, + resource_group_name, # type: str + account_name, # type: str + request_type, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Live Migration of storage account to enable Hns. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param request_type: Required. Hierarchical namespace migration type can either be a + hierarchical namespace validation request 'HnsOnValidationRequest' or a hydration request + 'HnsOnHydrationRequest'. The validation request will validate the migration whereas the + hydration request will migrate the account. + :type request_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._hierarchical_namespace_migration_initial( + resource_group_name=resource_group_name, + account_name=account_name, + request_type=request_type, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_hierarchical_namespace_migration.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/hnsonmigration'} # type: ignore + + def _abort_hierarchical_namespace_migration_initial( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + # Construct URL + url = self._abort_hierarchical_namespace_migration_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _abort_hierarchical_namespace_migration_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/aborthnsonmigration'} # type: ignore + + def begin_abort_hierarchical_namespace_migration( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Abort live Migration of storage account to enable Hns. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._abort_hierarchical_namespace_migration_initial( + resource_group_name=resource_group_name, + account_name=account_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_abort_hierarchical_namespace_migration.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/aborthnsonmigration'} # type: ignore + + def _restore_blob_ranges_initial( + self, + resource_group_name, # type: str + account_name, # type: str + parameters, # type: "_models.BlobRestoreParameters" + **kwargs # type: Any + ): + # type: (...) -> "_models.BlobRestoreStatus" + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobRestoreStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._restore_blob_ranges_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'BlobRestoreParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('BlobRestoreStatus', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('BlobRestoreStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _restore_blob_ranges_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/restoreBlobRanges'} # type: ignore + + def begin_restore_blob_ranges( + self, + resource_group_name, # type: str + account_name, # type: str + parameters, # type: "_models.BlobRestoreParameters" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.BlobRestoreStatus"] + """Restore blobs in the specified blob ranges. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param parameters: The parameters to provide for restore blob ranges. + :type parameters: ~azure.mgmt.storage.v2021_06_01.models.BlobRestoreParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either BlobRestoreStatus or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.storage.v2021_06_01.models.BlobRestoreStatus] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.BlobRestoreStatus"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._restore_blob_ranges_initial( + resource_group_name=resource_group_name, + account_name=account_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('BlobRestoreStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_restore_blob_ranges.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/restoreBlobRanges'} # type: ignore + + def revoke_user_delegation_keys( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Revoke user delegation keys. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + + # Construct URL + url = self.revoke_user_delegation_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + revoke_user_delegation_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/revokeUserDelegationKeys'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_table_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_table_operations.py new file mode 100644 index 000000000000..4ecdea47a615 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_table_operations.py @@ -0,0 +1,398 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class TableOperations(object): + """TableOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2021_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def create( + self, + resource_group_name, # type: str + account_name, # type: str + table_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Table" + """Creates a new table with the specified table name, under the specified account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param table_name: A table name must be unique within a storage account and must be between 3 + and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin + with a numeric character. + :type table_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Table, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.Table + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Table"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + # Construct URL + url = self.create.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'tableName': self._serialize.url("table_name", table_name, 'str', max_length=63, min_length=3, pattern=r'^[A-Za-z][A-Za-z0-9]{2,62}$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.put(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CloudErrorAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Table', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + account_name, # type: str + table_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Table" + """Creates a new table with the specified table name, under the specified account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param table_name: A table name must be unique within a storage account and must be between 3 + and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin + with a numeric character. + :type table_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Table, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.Table + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Table"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'tableName': self._serialize.url("table_name", table_name, 'str', max_length=63, min_length=3, pattern=r'^[A-Za-z][A-Za-z0-9]{2,62}$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.patch(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CloudErrorAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Table', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + account_name, # type: str + table_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Table" + """Gets the table with the specified table name, under the specified account if it exists. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param table_name: A table name must be unique within a storage account and must be between 3 + and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin + with a numeric character. + :type table_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Table, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.Table + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Table"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'tableName': self._serialize.url("table_name", table_name, 'str', max_length=63, min_length=3, pattern=r'^[A-Za-z][A-Za-z0-9]{2,62}$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CloudErrorAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Table', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + account_name, # type: str + table_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes the table with the specified table name, under the specified account if it exists. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param table_name: A table name must be unique within a storage account and must be between 3 + and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin + with a numeric character. + :type table_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'tableName': self._serialize.url("table_name", table_name, 'str', max_length=63, min_length=3, pattern=r'^[A-Za-z][A-Za-z0-9]{2,62}$'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CloudErrorAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}'} # type: ignore + + def list( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ListTableResource"] + """Gets a list of all the tables under the specified storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ListTableResource or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2021_06_01.models.ListTableResource] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListTableResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ListTableResource', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.CloudErrorAutoGenerated, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_table_services_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_table_services_operations.py new file mode 100644 index 000000000000..fd02c93d04b8 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_table_services_operations.py @@ -0,0 +1,249 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class TableServicesOperations(object): + """TableServicesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2021_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ListTableServices" + """List all table services for the storage account. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ListTableServices, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.ListTableServices + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ListTableServices"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CloudErrorAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ListTableServices', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices'} # type: ignore + + def set_service_properties( + self, + resource_group_name, # type: str + account_name, # type: str + parameters, # type: "_models.TableServiceProperties" + **kwargs # type: Any + ): + # type: (...) -> "_models.TableServiceProperties" + """Sets the properties of a storage account’s Table service, including properties for Storage + Analytics and CORS (Cross-Origin Resource Sharing) rules. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :param parameters: The properties of a storage account’s Table service, only properties for + Storage Analytics and CORS (Cross-Origin Resource Sharing) rules can be specified. + :type parameters: ~azure.mgmt.storage.v2021_06_01.models.TableServiceProperties + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TableServiceProperties, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.TableServiceProperties + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TableServiceProperties"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + table_service_name = "default" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.set_service_properties.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'tableServiceName': self._serialize.url("table_service_name", table_service_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TableServiceProperties') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CloudErrorAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('TableServiceProperties', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + set_service_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/{tableServiceName}'} # type: ignore + + def get_service_properties( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.TableServiceProperties" + """Gets the properties of a storage account’s Table service, including properties for Storage + Analytics and CORS (Cross-Origin Resource Sharing) rules. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the specified resource group. + Storage account names must be between 3 and 24 characters in length and use numbers and + lower-case letters only. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TableServiceProperties, or the result of cls(response) + :rtype: ~azure.mgmt.storage.v2021_06_01.models.TableServiceProperties + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TableServiceProperties"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + table_service_name = "default" + accept = "application/json" + + # Construct URL + url = self.get_service_properties.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'tableServiceName': self._serialize.url("table_service_name", table_service_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CloudErrorAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('TableServiceProperties', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_service_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/{tableServiceName}'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_usages_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_usages_operations.py new file mode 100644 index 000000000000..242d70b8225f --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/operations/_usages_operations.py @@ -0,0 +1,118 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class UsagesOperations(object): + """UsagesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.storage.v2021_06_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_location( + self, + location, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.UsageListResult"] + """Gets the current usage count and the limit for the resources of the location under the + subscription. + + :param location: The location of the Azure Storage resource. + :type location: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either UsageListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2021_06_01.models.UsageListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.UsageListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_location.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'location': self._serialize.url("location", location, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('UsageListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_location.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/locations/{location}/usages'} # type: ignore diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/py.typed b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_06_01/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file From 27b7e7539ad50f53469896cb8e8d7d72ffe39c82 Mon Sep 17 00:00:00 2001 From: msyyc <70930885+msyyc@users.noreply.github.com> Date: Tue, 14 Sep 2021 16:52:11 +0800 Subject: [PATCH 53/85] Update change_log.py (#20680) --- tools/azure-sdk-tools/packaging_tools/change_log.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/azure-sdk-tools/packaging_tools/change_log.py b/tools/azure-sdk-tools/packaging_tools/change_log.py index 64d2ebe0b6b2..10fc7ae47fff 100644 --- a/tools/azure-sdk-tools/packaging_tools/change_log.py +++ b/tools/azure-sdk-tools/packaging_tools/change_log.py @@ -142,7 +142,8 @@ def models(self, diff_entry): def build_change_log(old_report, new_report): change_log = ChangeLog(old_report, new_report) - result = diff(old_report, new_report) + # when diff result is large, compare_lengths=True may cause wrong result + result = diff(old_report, new_report, compare_lengths=False) for diff_line in result: # Operations From 3252969fb687c7fdb7099c1d13ed41d87dc9b08b Mon Sep 17 00:00:00 2001 From: swathipil <76007337+swathipil@users.noreply.github.com> Date: Tue, 14 Sep 2021 09:17:18 -0700 Subject: [PATCH 54/85] [SchemaRegistry] remove codec param in serializer (#20671) * remove codec * changelog --- .../azure-schemaregistry-avroserializer/CHANGELOG.md | 1 + .../avroserializer/_schema_registry_avro_serializer.py | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/schemaregistry/azure-schemaregistry-avroserializer/CHANGELOG.md b/sdk/schemaregistry/azure-schemaregistry-avroserializer/CHANGELOG.md index ce6d28a08c1d..80fb90b1405e 100644 --- a/sdk/schemaregistry/azure-schemaregistry-avroserializer/CHANGELOG.md +++ b/sdk/schemaregistry/azure-schemaregistry-avroserializer/CHANGELOG.md @@ -11,6 +11,7 @@ - `schema_registry` parameter in the `SchemaRegistryAvroSerializer` constructor has been renamed `client`. - `schema_group` parameter in the `SchemaRegistryAvroSerializer` constructor has been renamed `group_name`. - `data` parameter in the `serialize` and `deserialize` methods on `SchemaRegistryAvroSerializer` has been renamed `value`. +- `SchemaRegistryAvroSerializer` constructor no longer takes in the `codec` keyword argument. ### Bugs Fixed diff --git a/sdk/schemaregistry/azure-schemaregistry-avroserializer/azure/schemaregistry/serializer/avroserializer/_schema_registry_avro_serializer.py b/sdk/schemaregistry/azure-schemaregistry-avroserializer/azure/schemaregistry/serializer/avroserializer/_schema_registry_avro_serializer.py index 73eb25a9b31d..1717ce89a093 100644 --- a/sdk/schemaregistry/azure-schemaregistry-avroserializer/azure/schemaregistry/serializer/avroserializer/_schema_registry_avro_serializer.py +++ b/sdk/schemaregistry/azure-schemaregistry-avroserializer/azure/schemaregistry/serializer/avroserializer/_schema_registry_avro_serializer.py @@ -42,7 +42,6 @@ class SchemaRegistryAvroSerializer(object): :param str group_name: Schema group under which schema should be registered. :keyword bool auto_register_schemas: When true, register new schemas passed to serialize. Otherwise, and by default, fail if it has not been pre-registered in the registry. - :keyword str codec: The writer codec. If None, let the avro library decides. """ From 599a099d3e59b4b7b4cb35f58400525108d6ecd2 Mon Sep 17 00:00:00 2001 From: Rakshith Bhyravabhotla Date: Tue, 14 Sep 2021 09:41:19 -0700 Subject: [PATCH 55/85] Handle Errors and Tables in Query (#20658) * initial commit * batch set * batch * tests + changes * more tests * lint * changelog * Apply suggestions from code review * comment * lint * querry * comments --- sdk/monitor/azure-monitor-query/CHANGELOG.md | 6 + .../azure/monitor/query/__init__.py | 7 + .../azure/monitor/query/_exceptions.py | 79 ++++++++ .../azure/monitor/query/_helpers.py | 40 +++- .../azure/monitor/query/_logs_query_client.py | 46 +++-- .../azure/monitor/query/_models.py | 15 +- .../query/aio/_logs_query_client_async.py | 46 +++-- .../samples/sample_batch_query.py | 19 +- .../samples/sample_log_query_client.py | 26 +-- .../tests/async/test_exceptions_async.py | 171 ++++++++++++++++++ .../tests/async/test_logs_client_async.py | 28 ++- .../tests/test_exceptions.py | 163 +++++++++++++++++ .../tests/test_logs_client.py | 36 +++- 13 files changed, 607 insertions(+), 75 deletions(-) create mode 100644 sdk/monitor/azure-monitor-query/azure/monitor/query/_exceptions.py create mode 100644 sdk/monitor/azure-monitor-query/tests/async/test_exceptions_async.py create mode 100644 sdk/monitor/azure-monitor-query/tests/test_exceptions.py diff --git a/sdk/monitor/azure-monitor-query/CHANGELOG.md b/sdk/monitor/azure-monitor-query/CHANGELOG.md index ba96cc2ea4f4..70c9d0b31bfb 100644 --- a/sdk/monitor/azure-monitor-query/CHANGELOG.md +++ b/sdk/monitor/azure-monitor-query/CHANGELOG.md @@ -4,8 +4,14 @@ ### Features Added +- Added `QueryPartialErrorException` and `LogsQueryError` to handle errors. +- Added `partial_error` and `is_error` attributes to `LogsQueryResult`. +- Added an option `allow_partial_errors` that defaults to False, which can be set to not throw if there are any partial errors. + ### Breaking Changes +- `LogsQueryResult` now iterates over the tables directly as a convinience. + ### Bugs Fixed ### Other Changes diff --git a/sdk/monitor/azure-monitor-query/azure/monitor/query/__init__.py b/sdk/monitor/azure-monitor-query/azure/monitor/query/__init__.py index 9043ee10d44c..d33a6f0a5c28 100644 --- a/sdk/monitor/azure-monitor-query/azure/monitor/query/__init__.py +++ b/sdk/monitor/azure-monitor-query/azure/monitor/query/__init__.py @@ -7,6 +7,11 @@ from ._logs_query_client import LogsQueryClient from ._metrics_query_client import MetricsQueryClient +from ._exceptions import ( + LogsQueryError, + QueryPartialErrorException +) + from ._models import ( MetricAggregationType, LogsQueryResult, @@ -30,6 +35,8 @@ "MetricAggregationType", "LogsQueryClient", "LogsQueryResult", + "LogsQueryError", + "QueryPartialErrorException", "LogsTable", "LogsBatchQuery", "MetricsQueryClient", diff --git a/sdk/monitor/azure-monitor-query/azure/monitor/query/_exceptions.py b/sdk/monitor/azure-monitor-query/azure/monitor/query/_exceptions.py new file mode 100644 index 000000000000..f849f93ff6ee --- /dev/null +++ b/sdk/monitor/azure-monitor-query/azure/monitor/query/_exceptions.py @@ -0,0 +1,79 @@ +# +# ------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# -------------------------------------------------------------------------- +from azure.core.exceptions import HttpResponseError + +class LogsQueryError(object): + """The code and message for an error. + + All required parameters must be populated in order to send to Azure. + + :ivar code: A machine readable error code. + :vartype code: str + :ivar message: A human readable error message. + :vartype message: str + :ivar details: error details. + :vartype details: list[~monitor_query_client.models.ErrorDetail] + :ivar innererror: Inner error details if they exist. + :vartype innererror: ~azure.monitor.query.LogsQueryError + :ivar additional_properties: Additional properties that can be provided on the error info + object. + :vartype additional_properties: object + :ivar bool is_error: Boolean check for error item when iterating over list of + results. Always True for an instance of a LogsQueryError. + """ + def __init__( + self, + **kwargs + ): + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.details = kwargs.get('details', None) + self.innererror = kwargs.get('innererror', None) + self.additional_properties = kwargs.get('additional_properties', None) + self.is_error = True + + @classmethod + def _from_generated(cls, generated): + if not generated: + return None + details = None + if generated.details is not None: + details = [d.serialize() for d in generated.details] + return cls( + code=generated.code, + message=generated.message, + innererror=cls._from_generated(generated.innererror) if generated.innererror else None, + additional_properties=generated.additional_properties, + details=details, + ) + +class QueryPartialErrorException(HttpResponseError): + """There is a partial failure in query operation. This is thrown for a single query operation + when allow_partial_errors is set to False. + + :ivar code: A machine readable error code. + :vartype code: str + :ivar message: A human readable error message. + :vartype message: str + :ivar details: error details. + :vartype details: list[~monitor_query_client.models.ErrorDetail] + :ivar innererror: Inner error details if they exist. + :vartype innererror: ~azure.monitor.query.LogsQueryError + :ivar additional_properties: Additional properties that can be provided on the error info + object. + :vartype additional_properties: object + """ + + def __init__(self, **kwargs): + error = kwargs.pop('error', None) + if error: + self.code = error.code + self.message = error.message + self.details = [d.serialize() for d in error.details] if error.details else None + self.innererror = LogsQueryError._from_generated(error.innererror) if error.innererror else None + self.additional_properties = error.additional_properties + super(QueryPartialErrorException, self).__init__(message=self.message) diff --git a/sdk/monitor/azure-monitor-query/azure/monitor/query/_helpers.py b/sdk/monitor/azure-monitor-query/azure/monitor/query/_helpers.py index 8b3194f3dc14..5adf5bc095d9 100644 --- a/sdk/monitor/azure-monitor-query/azure/monitor/query/_helpers.py +++ b/sdk/monitor/azure-monitor-query/azure/monitor/query/_helpers.py @@ -41,13 +41,21 @@ def get_metrics_authentication_policy( raise TypeError("Unsupported credential") -def process_error(exception): - raise_error = HttpResponseError - raise raise_error(message=exception.message, response=exception.response) - -def order_results(request_order, mapping, obj): +def order_results(request_order, mapping, obj, err, allow_partial_errors=False): ordered = [mapping[id] for id in request_order] - return [obj._from_generated(rsp) for rsp in ordered] # pylint: disable=protected-access + results = [] + for item in ordered: + if not item.body.error: + results.append(obj._from_generated(item.body)) # pylint: disable=protected-access + else: + error = item.body.error + if allow_partial_errors and error.code == 'PartialError': + res = obj._from_generated(item.body) # pylint: disable=protected-access + res.partial_error = err._from_generated(error) # pylint: disable=protected-access + results.append(res) + else: + results.append(err._from_generated(error)) # pylint: disable=protected-access + return results def construct_iso8601(timespan=None): if not timespan: @@ -90,3 +98,23 @@ def native_col_type(col_type, value): def process_row(col_types, row): return [native_col_type(col_types[ind], val) for ind, val in enumerate(row)] + +def process_error(error, model): + try: + model = model._from_generated(error.model.error) # pylint: disable=protected-access + except AttributeError: # model can be none + pass + raise HttpResponseError( + message=error.message, + response=error.response, + model=model) + +def process_prefer(server_timeout, include_statistics, include_visualization): + prefer = "" + if server_timeout: + prefer += "wait=" + str(server_timeout) + "," + if include_statistics: + prefer += "include-statistics=true," + if include_visualization: + prefer += "include-render=true" + return prefer.rstrip(",") diff --git a/sdk/monitor/azure-monitor-query/azure/monitor/query/_logs_query_client.py b/sdk/monitor/azure-monitor-query/azure/monitor/query/_logs_query_client.py index b555985d44aa..ccb68fdd6414 100644 --- a/sdk/monitor/azure-monitor-query/azure/monitor/query/_logs_query_client.py +++ b/sdk/monitor/azure-monitor-query/azure/monitor/query/_logs_query_client.py @@ -12,8 +12,9 @@ from ._generated._monitor_query_client import MonitorQueryClient from ._generated.models import BatchRequest, QueryBody as LogsQueryBody -from ._helpers import get_authentication_policy, process_error, construct_iso8601, order_results +from ._helpers import get_authentication_policy, construct_iso8601, order_results, process_error, process_prefer from ._models import LogsBatchQuery, LogsQueryResult +from ._exceptions import LogsQueryError, QueryPartialErrorException if TYPE_CHECKING: from azure.core.credentials import TokenCredential @@ -76,6 +77,8 @@ def query(self, workspace_id, query, **kwargs): :keyword additional_workspaces: A list of workspaces that are included in the query. These can be qualified workspace names, workspace Ids, or Azure resource Ids. :paramtype additional_workspaces: list[str] + :keyword allow_partial_errors: Defaults to False. If set to true, partial errors are not thrown. + :paramtype allow_partial_errors: bool :return: LogsQueryResult, or the result of cls(response) :rtype: ~azure.monitor.query.LogsQueryResult :raises: ~azure.core.exceptions.HttpResponseError @@ -89,6 +92,7 @@ def query(self, workspace_id, query, **kwargs): :dedent: 0 :caption: Get a response for a single Log Query """ + allow_partial_errors = kwargs.pop('allow_partial_errors', False) if 'timespan' not in kwargs: raise TypeError("query() missing 1 required keyword-only argument: 'timespan'") timespan = construct_iso8601(kwargs.pop('timespan')) @@ -97,17 +101,7 @@ def query(self, workspace_id, query, **kwargs): server_timeout = kwargs.pop("server_timeout", None) workspaces = kwargs.pop("additional_workspaces", None) - prefer = "" - if server_timeout: - prefer += "wait=" + str(server_timeout) - if include_statistics: - if len(prefer) > 0: - prefer += "," - prefer += "include-statistics=true" - if include_visualization: - if len(prefer) > 0: - prefer += "," - prefer += "include-render=true" + prefer = process_prefer(server_timeout, include_statistics, include_visualization) body = LogsQueryBody( query=query, @@ -117,14 +111,23 @@ def query(self, workspace_id, query, **kwargs): ) try: - return LogsQueryResult._from_generated(self._query_op.execute( # pylint: disable=protected-access + generated_response = self._query_op.execute( # pylint: disable=protected-access workspace_id=workspace_id, body=body, prefer=prefer, **kwargs - )) - except HttpResponseError as e: - process_error(e) + ) + except HttpResponseError as err: + process_error(err, LogsQueryError) + response = LogsQueryResult._from_generated(generated_response) # pylint: disable=protected-access + if not generated_response.error: + return response + if not allow_partial_errors: + raise QueryPartialErrorException(error=generated_response.error) + response.partial_error = LogsQueryError._from_generated( # pylint: disable=protected-access + generated_response.error + ) + return response @distributed_trace def query_batch(self, queries, **kwargs): @@ -136,6 +139,9 @@ def query_batch(self, queries, **kwargs): :param queries: The list of Kusto queries to execute. :type queries: list[dict] or list[~azure.monitor.query.LogsBatchQuery] + :keyword bool allow_partial_errors: If set to True, a `LogsQueryResult` object is returned + when a partial error occurs. The error can be accessed using the `partial_error` + attribute in the object. :return: List of LogsQueryResult, or the result of cls(response) :rtype: list[~azure.monitor.query.LogsQueryResult] :raises: ~azure.core.exceptions.HttpResponseError @@ -149,6 +155,7 @@ def query_batch(self, queries, **kwargs): :dedent: 0 :caption: Get a response for multiple Log Queries. """ + allow_partial_errors = kwargs.pop('allow_partial_errors', False) try: queries = [LogsBatchQuery(**q) for q in queries] except (KeyError, TypeError): @@ -161,7 +168,12 @@ def query_batch(self, queries, **kwargs): batch = BatchRequest(requests=queries) generated = self._query_op.batch(batch, **kwargs) mapping = {item.id: item for item in generated.responses} - return order_results(request_order, mapping, LogsQueryResult) + return order_results( + request_order, + mapping, + LogsQueryResult, + LogsQueryError, + allow_partial_errors) def close(self): # type: () -> None diff --git a/sdk/monitor/azure-monitor-query/azure/monitor/query/_models.py b/sdk/monitor/azure-monitor-query/azure/monitor/query/_models.py index 84e0a05f4cd1..4532f1ab468e 100644 --- a/sdk/monitor/azure-monitor-query/azure/monitor/query/_models.py +++ b/sdk/monitor/azure-monitor-query/azure/monitor/query/_models.py @@ -165,21 +165,27 @@ class LogsQueryResult(object): :ivar visualization: This will include a visualization property in the response that specifies the type of visualization selected by the query and any properties for that visualization. :vartype visualization: object - :ivar error: Any error info. - :vartype error: ~azure.core.exceptions.HttpResponseError + :ivar partial_error: Any error info. This is none except in the case where `allow_partial_errors` + is explicitly set to True. + :vartype partial_error: ~azure.core.exceptions.HttpResponseError + :ivar bool is_error: Boolean check for error item when iterating over list of + results. Always False for an instance of a LogsQueryResult. """ def __init__( self, **kwargs ): self.tables = kwargs.get('tables', None) - self.error = kwargs.get('error', None) + self.partial_error = None self.statistics = kwargs.get('statistics', None) self.visualization = kwargs.get('visualization', None) + self.is_error = False + + def __iter__(self): + return iter(self.tables) @classmethod def _from_generated(cls, generated): - if not generated: return cls() tables = None @@ -195,7 +201,6 @@ def _from_generated(cls, generated): tables=tables, statistics=generated.statistics, visualization=generated.render, - error=generated.error ) diff --git a/sdk/monitor/azure-monitor-query/azure/monitor/query/aio/_logs_query_client_async.py b/sdk/monitor/azure-monitor-query/azure/monitor/query/aio/_logs_query_client_async.py index 090fcceb9ed8..e31806a110fa 100644 --- a/sdk/monitor/azure-monitor-query/azure/monitor/query/aio/_logs_query_client_async.py +++ b/sdk/monitor/azure-monitor-query/azure/monitor/query/aio/_logs_query_client_async.py @@ -7,15 +7,16 @@ from datetime import datetime, timedelta from typing import Any, Tuple, Union, Sequence, Dict, List, TYPE_CHECKING -from azure.core.exceptions import HttpResponseError from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.exceptions import HttpResponseError from .._generated.aio._monitor_query_client import MonitorQueryClient from .._generated.models import BatchRequest, QueryBody as LogsQueryBody -from .._helpers import process_error, construct_iso8601, order_results +from .._helpers import construct_iso8601, order_results, process_error, process_prefer from .._models import LogsQueryResult, LogsBatchQuery from ._helpers_asyc import get_authentication_policy +from .._exceptions import LogsQueryError, QueryPartialErrorException if TYPE_CHECKING: from azure.core.credentials_async import AsyncTokenCredential @@ -75,23 +76,14 @@ async def query( :rtype: ~azure.monitor.query.LogsQueryResult :raises: ~azure.core.exceptions.HttpResponseError """ + allow_partial_errors = kwargs.pop('allow_partial_errors', False) timespan = construct_iso8601(timespan) include_statistics = kwargs.pop("include_statistics", False) include_visualization = kwargs.pop("include_visualization", False) server_timeout = kwargs.pop("server_timeout", None) additional_workspaces = kwargs.pop("additional_workspaces", None) - prefer = "" - if server_timeout: - prefer += "wait=" + str(server_timeout) - if include_statistics: - if len(prefer) > 0: - prefer += "," - prefer += "include-statistics=true" - if include_visualization: - if len(prefer) > 0: - prefer += "," - prefer += "include-render=true" + prefer = process_prefer(server_timeout, include_statistics, include_visualization) body = LogsQueryBody( query=query, @@ -101,14 +93,23 @@ async def query( ) try: - return LogsQueryResult._from_generated(await self._query_op.execute( # pylint: disable=protected-access + generated_response = await self._query_op.execute( # pylint: disable=protected-access workspace_id=workspace_id, body=body, prefer=prefer, **kwargs - )) - except HttpResponseError as e: - process_error(e) + ) + except HttpResponseError as err: + process_error(err, LogsQueryError) + response = LogsQueryResult._from_generated(generated_response) # pylint: disable=protected-access + if not generated_response.error: + return response + if not allow_partial_errors: + raise QueryPartialErrorException(error=generated_response.error) + response.partial_error = LogsQueryError._from_generated( # pylint: disable=protected-access + generated_response.error + ) + return response @distributed_trace_async async def query_batch( @@ -123,10 +124,14 @@ async def query_batch( :param queries: The list of Kusto queries to execute. :type queries: list[dict] or list[~azure.monitor.query.LogsBatchQuery] + :keyword bool allow_partial_errors: If set to True, a `LogsQueryResult` object is returned + when a partial error occurs. The error can be accessed using the `partial_error` + attribute in the object. :return: list of LogsQueryResult objects, or the result of cls(response) :rtype: list[~azure.monitor.query.LogsQueryResult] :raises: ~azure.core.exceptions.HttpResponseError """ + allow_partial_errors = kwargs.pop('allow_partial_errors', False) try: queries = [LogsBatchQuery(**q) for q in queries] except (KeyError, TypeError): @@ -139,7 +144,12 @@ async def query_batch( batch = BatchRequest(requests=queries) generated = await self._query_op.batch(batch, **kwargs) mapping = {item.id: item for item in generated.responses} - return order_results(request_order, mapping, LogsQueryResult) + return order_results( + request_order, + mapping, + LogsQueryResult, + LogsQueryError, + allow_partial_errors) async def __aenter__(self) -> "LogsQueryClient": await self._client.__aenter__() diff --git a/sdk/monitor/azure-monitor-query/samples/sample_batch_query.py b/sdk/monitor/azure-monitor-query/samples/sample_batch_query.py index c0838643dce4..43444c369c3c 100644 --- a/sdk/monitor/azure-monitor-query/samples/sample_batch_query.py +++ b/sdk/monitor/azure-monitor-query/samples/sample_batch_query.py @@ -20,27 +20,30 @@ workspace_id= os.environ['LOG_WORKSPACE_ID'] ), LogsBatchQuery( - query= """AppRequests | take 10 | - summarize avgRequestDuration=avg(DurationMs) by bin(TimeGenerated, 10m), _ResourceId""", - timespan=(datetime(2021, 6, 2), timedelta(hours=1)), + query= """AppRequestsss | take 10""", + timespan=(datetime(2021, 6, 2), timedelta(days=1)), workspace_id= os.environ['LOG_WORKSPACE_ID'] ), LogsBatchQuery( - query= "AppRequests | take 5", + query= """let Weight = 92233720368547758; + range x from 1 to 3 step 1 + | summarize percentilesw(x, Weight * 100, 50)""", workspace_id= os.environ['LOG_WORKSPACE_ID'], timespan=(datetime(2021, 6, 2), datetime(2021, 6, 3)), include_statistics=True ), ] -responses = client.query_batch(requests) +responses = client.query_batch(requests, allow_partial_errors=False) for response in responses: - try: + if not response.is_error: table = response.tables[0] df = pd.DataFrame(table.rows, columns=table.columns) print(df) print("\n\n-------------------------\n\n") - except TypeError: - print(response.error.innererror) + else: + error = response + print(error.message) + # [END send_query_batch] \ No newline at end of file diff --git a/sdk/monitor/azure-monitor-query/samples/sample_log_query_client.py b/sdk/monitor/azure-monitor-query/samples/sample_log_query_client.py index 917f6a16e698..5bda7d0e0f3a 100644 --- a/sdk/monitor/azure-monitor-query/samples/sample_log_query_client.py +++ b/sdk/monitor/azure-monitor-query/samples/sample_log_query_client.py @@ -4,7 +4,8 @@ import os import pandas as pd from datetime import timedelta -from azure.monitor.query import LogsQueryClient +from azure.monitor.query import LogsQueryClient, QueryPartialErrorException +from azure.core.exceptions import HttpResponseError from azure.identity import DefaultAzureCredential # [START client_auth_with_token_cred] @@ -16,21 +17,20 @@ # Response time trend # request duration over the last 12 hours. # [START send_logs_query] -query = """AppRequests | -summarize avgRequestDuration=avg(DurationMs) by bin(TimeGenerated, 10m), _ResourceId""" +query = """AppRwequests | take 5""" # returns LogsQueryResult -response = client.query(os.environ['LOG_WORKSPACE_ID'], query, timespan=timedelta(days=1)) +try: + response = client.query(os.environ['LOG_WORKSPACE_ID'], query, timespan=timedelta(days=1)) + for table in response: + print(table) +except QueryPartialErrorException as err: + print("this is a partial error") + print(err.details) +except HttpResponseError as err: + print("something fatal happened") + print (err) -if not response.tables: - print("No results for the query") - -for table in response.tables: - try: - df = pd.DataFrame(table.rows, columns=table.columns) - print(df) - except TypeError: - print(response.error) # [END send_logs_query] """ TimeGenerated _ResourceId avgRequestDuration diff --git a/sdk/monitor/azure-monitor-query/tests/async/test_exceptions_async.py b/sdk/monitor/azure-monitor-query/tests/async/test_exceptions_async.py new file mode 100644 index 000000000000..cf46756a6ddf --- /dev/null +++ b/sdk/monitor/azure-monitor-query/tests/async/test_exceptions_async.py @@ -0,0 +1,171 @@ +from datetime import timedelta, datetime +import pytest +import os +from azure.identity.aio import ClientSecretCredential +from azure.core.exceptions import HttpResponseError +from azure.monitor.query import LogsBatchQuery, LogsQueryError,LogsQueryResult, QueryPartialErrorException +from azure.monitor.query.aio import LogsQueryClient + +def _credential(): + credential = ClientSecretCredential( + client_id = os.environ['AZURE_CLIENT_ID'], + client_secret = os.environ['AZURE_CLIENT_SECRET'], + tenant_id = os.environ['AZURE_TENANT_ID'] + ) + return credential + +@pytest.mark.live_test_only +@pytest.mark.asyncio +async def test_logs_single_query_fatal_exception(): + credential = _credential() + client = LogsQueryClient(credential) + with pytest.raises(HttpResponseError): + await client.query('bad_workspace_id', 'AppRequests', timespan=None) + +@pytest.mark.live_test_only +@pytest.mark.asyncio +async def test_logs_single_query_partial_exception_not_allowed(): + credential = _credential() + client = LogsQueryClient(credential) + query = """let Weight = 92233720368547758; + range x from 1 to 3 step 1 + | summarize percentilesw(x, Weight * 100, 50)""" + with pytest.raises(QueryPartialErrorException) as err: + await client.query(os.environ['LOG_WORKSPACE_ID'], query, timespan=timedelta(days=1)) + +@pytest.mark.live_test_only +@pytest.mark.asyncio +async def test_logs_single_query_partial_exception_allowed(): + credential = _credential() + client = LogsQueryClient(credential) + query = """let Weight = 92233720368547758; + range x from 1 to 3 step 1 + | summarize percentilesw(x, Weight * 100, 50)""" + response = await client.query(os.environ['LOG_WORKSPACE_ID'], query, timespan=timedelta(days=1), allow_partial_errors=True) + assert response.partial_error is not None + assert response.partial_error.code == 'PartialError' + assert response.partial_error.__class__ == LogsQueryError + +@pytest.mark.live_test_only +@pytest.mark.asyncio +async def test_logs_batch_query_fatal_exception(): + credential = ClientSecretCredential( + client_id = os.environ['AZURE_CLIENT_ID'], + client_secret = 'bad_secret', + tenant_id = os.environ['AZURE_TENANT_ID'] + ) + client = LogsQueryClient(credential) + requests = [ + LogsBatchQuery( + query="AzureActivity | summarize count()", + timespan=timedelta(hours=1), + workspace_id= os.environ['LOG_WORKSPACE_ID'] + ), + LogsBatchQuery( + query= """AppRequestsss | take 10""", + timespan=(datetime(2021, 6, 2), timedelta(days=1)), + workspace_id= os.environ['LOG_WORKSPACE_ID'] + ), + LogsBatchQuery( + query= """let Weight = 92233720368547758; + range x from 1 to 3 step 1 + | summarize percentilesw(x, Weight * 100, 50)""", + workspace_id= os.environ['LOG_WORKSPACE_ID'], + timespan=(datetime(2021, 6, 2), datetime(2021, 6, 3)), + include_statistics=True + ), + ] + with pytest.raises(HttpResponseError): + await client.query_batch(requests, allow_partial_errors=True) + +@pytest.mark.live_test_only +@pytest.mark.asyncio +async def test_logs_batch_query_partial_exception_not_allowed(): + credential = _credential() + client = LogsQueryClient(credential) + requests = [ + LogsBatchQuery( + query="AzureActivity | summarize count()", + timespan=timedelta(hours=1), + workspace_id= os.environ['LOG_WORKSPACE_ID'] + ), + LogsBatchQuery( + query= """AppRequests | take 10""", + timespan=(datetime(2021, 6, 2), timedelta(days=1)), + workspace_id= os.environ['LOG_WORKSPACE_ID'] + ), + LogsBatchQuery( + query= """let Weight = 92233720368547758; + range x from 1 to 3 step 1 + | summarize percentilesw(x, Weight * 100, 50)""", + workspace_id= os.environ['LOG_WORKSPACE_ID'], + timespan=(datetime(2021, 6, 2), datetime(2021, 6, 3)), + include_statistics=True + ), + ] + responses = await client.query_batch(requests) + r1, r2, r3 = responses[0], responses[1], responses[2] + assert r1.__class__ == LogsQueryResult + assert r2.__class__ == LogsQueryResult + assert r3.__class__ == LogsQueryError + +@pytest.mark.live_test_only +@pytest.mark.asyncio +async def test_logs_batch_query_partial_exception_allowed(): + credential = _credential() + client = LogsQueryClient(credential) + requests = [ + LogsBatchQuery( + query="AzureActivity | summarize count()", + timespan=timedelta(hours=1), + workspace_id= os.environ['LOG_WORKSPACE_ID'] + ), + LogsBatchQuery( + query= """AppRequests | take 10""", + timespan=(datetime(2021, 6, 2), timedelta(days=1)), + workspace_id= os.environ['LOG_WORKSPACE_ID'] + ), + LogsBatchQuery( + query= """let Weight = 92233720368547758; + range x from 1 to 3 step 1 + | summarize percentilesw(x, Weight * 100, 50)""", + workspace_id= os.environ['LOG_WORKSPACE_ID'], + timespan=(datetime(2021, 6, 2), datetime(2021, 6, 3)), + include_statistics=True + ), + ] + responses = await client.query_batch(requests, allow_partial_errors=True) + r1, r2, r3 = responses[0], responses[1], responses[2] + assert r1.__class__ == LogsQueryResult + assert r2.__class__ == LogsQueryResult + assert r3.__class__ == LogsQueryResult + assert r3.partial_error is not None + +@pytest.mark.live_test_only +@pytest.mark.asyncio +async def test_logs_batch_query_non_fatal_exception(): + credential = _credential() + client = LogsQueryClient(credential) + requests = [ + LogsBatchQuery( + query="AzureActivity | summarize count()", + timespan=timedelta(hours=1), + workspace_id= os.environ['LOG_WORKSPACE_ID'] + ), + LogsBatchQuery( + query= """AppRequests | take 10""", + timespan=(datetime(2021, 6, 2), timedelta(days=1)), + workspace_id= os.environ['LOG_WORKSPACE_ID'] + ), + LogsBatchQuery( + query= """Bad Query""", + workspace_id= os.environ['LOG_WORKSPACE_ID'], + timespan=(datetime(2021, 6, 2), datetime(2021, 6, 3)), + include_statistics=True + ), + ] + responses = await client.query_batch(requests) + r1, r2, r3 = responses[0], responses[1], responses[2] + assert r1.__class__ == LogsQueryResult + assert r2.__class__ == LogsQueryResult + assert r3.__class__ == LogsQueryError diff --git a/sdk/monitor/azure-monitor-query/tests/async/test_logs_client_async.py b/sdk/monitor/azure-monitor-query/tests/async/test_logs_client_async.py index bf7ade3b9ad2..c7675081ed5a 100644 --- a/sdk/monitor/azure-monitor-query/tests/async/test_logs_client_async.py +++ b/sdk/monitor/azure-monitor-query/tests/async/test_logs_client_async.py @@ -4,7 +4,7 @@ import os from azure.identity.aio import ClientSecretCredential from azure.core.exceptions import HttpResponseError -from azure.monitor.query import LogsBatchQuery +from azure.monitor.query import LogsBatchQuery, LogsQueryError, LogsTable, LogsQueryResult from azure.monitor.query.aio import LogsQueryClient def _credential(): @@ -100,7 +100,7 @@ async def test_logs_query_batch_default(): assert r1.tables[0].columns[1] == '_ResourceId' assert r1.tables[0].columns[2] == 'avgRequestDuration' r2 = response[2] - assert r2.error is not None + assert r2.__class__ == LogsQueryError @pytest.mark.skip('https://github.com/Azure/azure-sdk-for-python/issues/19382') @pytest.mark.live_test_only @@ -178,3 +178,27 @@ async def test_logs_single_query_with_render_and_stats(): assert response.visualization is not None assert response.statistics is not None + +@pytest.mark.live_test_only +@pytest.mark.asyncio +async def test_logs_query_result_iterate_over_tables(): + client = LogsQueryClient(_credential()) + + query = "AppRequests; AppRequests | take 5" + + response = await client.query( + os.environ['LOG_WORKSPACE_ID'], + query, + timespan=None, + include_statistics=True, + include_visualization=True + ) + + ## should iterate over tables + for item in response: + assert item.__class__ == LogsTable + + assert response.statistics is not None + assert response.visualization is not None + assert len(response.tables) == 2 + assert response.__class__ == LogsQueryResult diff --git a/sdk/monitor/azure-monitor-query/tests/test_exceptions.py b/sdk/monitor/azure-monitor-query/tests/test_exceptions.py new file mode 100644 index 000000000000..92d28cd75dd9 --- /dev/null +++ b/sdk/monitor/azure-monitor-query/tests/test_exceptions.py @@ -0,0 +1,163 @@ +from datetime import timedelta, datetime +import pytest +import os +from azure.identity import ClientSecretCredential +from azure.core.exceptions import HttpResponseError +from azure.monitor.query import LogsQueryClient, LogsBatchQuery, LogsQueryError,LogsQueryResult, QueryPartialErrorException + +def _credential(): + credential = ClientSecretCredential( + client_id = os.environ['AZURE_CLIENT_ID'], + client_secret = os.environ['AZURE_CLIENT_SECRET'], + tenant_id = os.environ['AZURE_TENANT_ID'] + ) + return credential + +@pytest.mark.live_test_only +def test_logs_single_query_fatal_exception(): + credential = _credential() + client = LogsQueryClient(credential) + with pytest.raises(HttpResponseError): + client.query('bad_workspace_id', 'AppRequests', timespan=None) + +@pytest.mark.live_test_only +def test_logs_single_query_partial_exception_not_allowed(): + credential = _credential() + client = LogsQueryClient(credential) + query = """let Weight = 92233720368547758; + range x from 1 to 3 step 1 + | summarize percentilesw(x, Weight * 100, 50)""" + with pytest.raises(QueryPartialErrorException) as err: + client.query(os.environ['LOG_WORKSPACE_ID'], query, timespan=timedelta(days=1)) + +@pytest.mark.live_test_only +def test_logs_single_query_partial_exception_allowed(): + credential = _credential() + client = LogsQueryClient(credential) + query = """let Weight = 92233720368547758; + range x from 1 to 3 step 1 + | summarize percentilesw(x, Weight * 100, 50)""" + response = client.query(os.environ['LOG_WORKSPACE_ID'], query, timespan=timedelta(days=1), allow_partial_errors=True) + assert response.partial_error is not None + assert response.partial_error.code == 'PartialError' + assert response.partial_error.__class__ == LogsQueryError + +@pytest.mark.live_test_only +def test_logs_batch_query_fatal_exception(): + credential = ClientSecretCredential( + client_id = os.environ['AZURE_CLIENT_ID'], + client_secret = 'bad_secret', + tenant_id = os.environ['AZURE_TENANT_ID'] + ) + client = LogsQueryClient(credential) + requests = [ + LogsBatchQuery( + query="AzureActivity | summarize count()", + timespan=timedelta(hours=1), + workspace_id= os.environ['LOG_WORKSPACE_ID'] + ), + LogsBatchQuery( + query= """AppRequestsss | take 10""", + timespan=(datetime(2021, 6, 2), timedelta(days=1)), + workspace_id= os.environ['LOG_WORKSPACE_ID'] + ), + LogsBatchQuery( + query= """let Weight = 92233720368547758; + range x from 1 to 3 step 1 + | summarize percentilesw(x, Weight * 100, 50)""", + workspace_id= os.environ['LOG_WORKSPACE_ID'], + timespan=(datetime(2021, 6, 2), datetime(2021, 6, 3)), + include_statistics=True + ), + ] + with pytest.raises(HttpResponseError): + responses = client.query_batch(requests, allow_partial_errors=True) + +@pytest.mark.live_test_only +def test_logs_batch_query_partial_exception_not_allowed(): + credential = _credential() + client = LogsQueryClient(credential) + requests = [ + LogsBatchQuery( + query="AzureActivity | summarize count()", + timespan=timedelta(hours=1), + workspace_id= os.environ['LOG_WORKSPACE_ID'] + ), + LogsBatchQuery( + query= """AppRequests | take 10""", + timespan=(datetime(2021, 6, 2), timedelta(days=1)), + workspace_id= os.environ['LOG_WORKSPACE_ID'] + ), + LogsBatchQuery( + query= """let Weight = 92233720368547758; + range x from 1 to 3 step 1 + | summarize percentilesw(x, Weight * 100, 50)""", + workspace_id= os.environ['LOG_WORKSPACE_ID'], + timespan=(datetime(2021, 6, 2), datetime(2021, 6, 3)), + include_statistics=True + ), + ] + responses = client.query_batch(requests) + r1, r2, r3 = responses[0], responses[1], responses[2] + assert r1.__class__ == LogsQueryResult + assert r2.__class__ == LogsQueryResult + assert r3.__class__ == LogsQueryError + +@pytest.mark.live_test_only +def test_logs_batch_query_partial_exception_allowed(): + credential = _credential() + client = LogsQueryClient(credential) + requests = [ + LogsBatchQuery( + query="AzureActivity | summarize count()", + timespan=timedelta(hours=1), + workspace_id= os.environ['LOG_WORKSPACE_ID'] + ), + LogsBatchQuery( + query= """AppRequests | take 10""", + timespan=(datetime(2021, 6, 2), timedelta(days=1)), + workspace_id= os.environ['LOG_WORKSPACE_ID'] + ), + LogsBatchQuery( + query= """let Weight = 92233720368547758; + range x from 1 to 3 step 1 + | summarize percentilesw(x, Weight * 100, 50)""", + workspace_id= os.environ['LOG_WORKSPACE_ID'], + timespan=(datetime(2021, 6, 2), datetime(2021, 6, 3)), + include_statistics=True + ), + ] + responses = client.query_batch(requests, allow_partial_errors=True) + r1, r2, r3 = responses[0], responses[1], responses[2] + assert r1.__class__ == LogsQueryResult + assert r2.__class__ == LogsQueryResult + assert r3.__class__ == LogsQueryResult + assert r3.partial_error is not None + +@pytest.mark.live_test_only +def test_logs_batch_query_non_fatal_exception(): + credential = _credential() + client = LogsQueryClient(credential) + requests = [ + LogsBatchQuery( + query="AzureActivity | summarize count()", + timespan=timedelta(hours=1), + workspace_id= os.environ['LOG_WORKSPACE_ID'] + ), + LogsBatchQuery( + query= """AppRequests | take 10""", + timespan=(datetime(2021, 6, 2), timedelta(days=1)), + workspace_id= os.environ['LOG_WORKSPACE_ID'] + ), + LogsBatchQuery( + query= """Bad Query""", + workspace_id= os.environ['LOG_WORKSPACE_ID'], + timespan=(datetime(2021, 6, 2), datetime(2021, 6, 3)), + include_statistics=True + ), + ] + responses = client.query_batch(requests) + r1, r2, r3 = responses[0], responses[1], responses[2] + assert r1.__class__ == LogsQueryResult + assert r2.__class__ == LogsQueryResult + assert r3.__class__ == LogsQueryError diff --git a/sdk/monitor/azure-monitor-query/tests/test_logs_client.py b/sdk/monitor/azure-monitor-query/tests/test_logs_client.py index 248f44796cbe..34b00e201dc5 100644 --- a/sdk/monitor/azure-monitor-query/tests/test_logs_client.py +++ b/sdk/monitor/azure-monitor-query/tests/test_logs_client.py @@ -3,7 +3,7 @@ import os from azure.identity import ClientSecretCredential from azure.core.exceptions import HttpResponseError -from azure.monitor.query import LogsQueryClient, LogsBatchQuery +from azure.monitor.query import LogsQueryClient, LogsBatchQuery, LogsQueryError, LogsTable, LogsQueryResult def _credential(): credential = ClientSecretCredential( @@ -55,11 +55,12 @@ def test_logs_single_query_with_non_200(): def test_logs_single_query_with_partial_success(): credential = _credential() client = LogsQueryClient(credential) - query = "set truncationmaxrecords=1; union * | project TimeGenerated | take 10" + query = """let Weight = 92233720368547758; + range x from 1 to 3 step 1 + | summarize percentilesw(x, Weight * 100, 50)""" + response = client.query(os.environ['LOG_WORKSPACE_ID'], query, timespan=None, allow_partial_errors=True) - response = client.query(os.environ['LOG_WORKSPACE_ID'], query, timespan=None) - - assert response is not None + assert response.partial_error is not None @pytest.mark.skip("https://github.com/Azure/azure-sdk-for-python/issues/19917") @pytest.mark.live_test_only @@ -108,7 +109,7 @@ def test_logs_query_batch_default(): assert r1.tables[0].columns[1] == '_ResourceId' assert r1.tables[0].columns[2] == 'avgRequestDuration' r2 = response[2] - assert r2.error is not None + assert r2.__class__ == LogsQueryError @pytest.mark.live_test_only def test_logs_single_query_with_statistics(): @@ -221,3 +222,26 @@ def test_logs_query_batch_additional_workspaces(): for resp in response: assert len(resp.tables[0].rows) == 2 + +@pytest.mark.live_test_only +def test_logs_query_result_iterate_over_tables(): + client = LogsQueryClient(_credential()) + + query = "AppRequests; AppRequests | take 5" + + response = client.query( + os.environ['LOG_WORKSPACE_ID'], + query, + timespan=None, + include_statistics=True, + include_visualization=True + ) + + ## should iterate over tables + for item in response: + assert item.__class__ == LogsTable + + assert response.statistics is not None + assert response.visualization is not None + assert len(response.tables) == 2 + assert response.__class__ == LogsQueryResult From 080f88d25322f304c4e30269321dd13cc86f8403 Mon Sep 17 00:00:00 2001 From: swathipil <76007337+swathipil@users.noreply.github.com> Date: Tue, 14 Sep 2021 13:01:32 -0700 Subject: [PATCH 56/85] [SchemaRegistry] update type of `schema` in `serialize` (#20683) * update type * update sample naming --- .../CHANGELOG.md | 1 + .../_schema_registry_avro_serializer.py | 2 +- .../samples/avro_serializer.py | 4 +-- .../samples/eventhub_receive_integration.py | 4 +-- .../samples/eventhub_send_integration.py | 4 +-- .../sample_code_schemaregistry_async.py | 20 +++++++------- .../async_samples/schema_registry_async.py | 24 ++++++++--------- .../sample_code_schemaregistry.py | 20 +++++++------- .../samples/sync_samples/schema_registry.py | 27 +++++++++---------- 9 files changed, 53 insertions(+), 53 deletions(-) diff --git a/sdk/schemaregistry/azure-schemaregistry-avroserializer/CHANGELOG.md b/sdk/schemaregistry/azure-schemaregistry-avroserializer/CHANGELOG.md index 80fb90b1405e..c0c620b6c1b5 100644 --- a/sdk/schemaregistry/azure-schemaregistry-avroserializer/CHANGELOG.md +++ b/sdk/schemaregistry/azure-schemaregistry-avroserializer/CHANGELOG.md @@ -11,6 +11,7 @@ - `schema_registry` parameter in the `SchemaRegistryAvroSerializer` constructor has been renamed `client`. - `schema_group` parameter in the `SchemaRegistryAvroSerializer` constructor has been renamed `group_name`. - `data` parameter in the `serialize` and `deserialize` methods on `SchemaRegistryAvroSerializer` has been renamed `value`. +- `schema` parameter in the `serialize` method on `SchemaRegistryAvroSerializer` no longer accepts argument of type `bytes`. - `SchemaRegistryAvroSerializer` constructor no longer takes in the `codec` keyword argument. ### Bugs Fixed diff --git a/sdk/schemaregistry/azure-schemaregistry-avroserializer/azure/schemaregistry/serializer/avroserializer/_schema_registry_avro_serializer.py b/sdk/schemaregistry/azure-schemaregistry-avroserializer/azure/schemaregistry/serializer/avroserializer/_schema_registry_avro_serializer.py index 1717ce89a093..e385630a81e2 100644 --- a/sdk/schemaregistry/azure-schemaregistry-avroserializer/azure/schemaregistry/serializer/avroserializer/_schema_registry_avro_serializer.py +++ b/sdk/schemaregistry/azure-schemaregistry-avroserializer/azure/schemaregistry/serializer/avroserializer/_schema_registry_avro_serializer.py @@ -129,7 +129,7 @@ def serialize(self, value, schema, **kwargs): :param value: The data to be encoded. :type value: Dict[str, Any] :param schema: The schema used to encode the data. - :type schema: Union[str, bytes] + :type schema: str :rtype: bytes """ raw_input_schema = schema diff --git a/sdk/schemaregistry/azure-schemaregistry-avroserializer/samples/avro_serializer.py b/sdk/schemaregistry/azure-schemaregistry-avroserializer/samples/avro_serializer.py index 031ce09c7aa6..c7a40e56104e 100644 --- a/sdk/schemaregistry/azure-schemaregistry-avroserializer/samples/avro_serializer.py +++ b/sdk/schemaregistry/azure-schemaregistry-avroserializer/samples/avro_serializer.py @@ -34,7 +34,7 @@ CLIENT_SECRET=os.environ['SCHEMA_REGISTRY_AZURE_CLIENT_SECRET'] SCHEMA_REGISTRY_ENDPOINT=os.environ['SCHEMA_REGISTRY_ENDPOINT'] -SCHEMA_GROUP=os.environ['SCHEMA_REGISTRY_GROUP'] +GROUP_NAME=os.environ['SCHEMA_REGISTRY_GROUP'] SCHEMA_STRING = """ {"namespace": "example.avro", "type": "record", @@ -80,7 +80,7 @@ def deserialize(serializer, bytes_payload): if __name__ == '__main__': schema_registry = SchemaRegistryClient(endpoint=SCHEMA_REGISTRY_ENDPOINT, credential=token_credential) - serializer = SchemaRegistryAvroSerializer(schema_registry, SCHEMA_GROUP) + serializer = SchemaRegistryAvroSerializer(schema_registry, GROUP_NAME) bytes_data_ben, bytes_data_alice = serialize(serializer) dict_data_ben = deserialize(serializer, bytes_data_ben) dict_data_alice = deserialize(serializer, bytes_data_alice) diff --git a/sdk/schemaregistry/azure-schemaregistry-avroserializer/samples/eventhub_receive_integration.py b/sdk/schemaregistry/azure-schemaregistry-avroserializer/samples/eventhub_receive_integration.py index 6d4fc4a8933b..783fc7167603 100644 --- a/sdk/schemaregistry/azure-schemaregistry-avroserializer/samples/eventhub_receive_integration.py +++ b/sdk/schemaregistry/azure-schemaregistry-avroserializer/samples/eventhub_receive_integration.py @@ -20,7 +20,7 @@ EVENTHUB_NAME = os.environ['EVENT_HUB_NAME'] SCHEMA_REGISTRY_ENDPOINT = os.environ['SCHEMA_REGISTRY_ENDPOINT'] -SCHEMA_GROUP = os.environ['SCHEMA_REGISTRY_GROUP'] +GROUP_NAME = os.environ['SCHEMA_REGISTRY_GROUP'] def on_event(partition_context, event): @@ -50,7 +50,7 @@ def on_event(partition_context, event): endpoint=SCHEMA_REGISTRY_ENDPOINT, credential=DefaultAzureCredential() ), - group_name=SCHEMA_GROUP + group_name=GROUP_NAME ) diff --git a/sdk/schemaregistry/azure-schemaregistry-avroserializer/samples/eventhub_send_integration.py b/sdk/schemaregistry/azure-schemaregistry-avroserializer/samples/eventhub_send_integration.py index 960ba3a47ffa..8169e9ea2734 100644 --- a/sdk/schemaregistry/azure-schemaregistry-avroserializer/samples/eventhub_send_integration.py +++ b/sdk/schemaregistry/azure-schemaregistry-avroserializer/samples/eventhub_send_integration.py @@ -21,7 +21,7 @@ EVENTHUB_NAME = os.environ['EVENT_HUB_NAME'] SCHEMA_REGISTRY_ENDPOINT = os.environ['SCHEMA_REGISTRY_ENDPOINT'] -SCHEMA_GROUP = os.environ['SCHEMA_REGISTRY_GROUP'] +GROUP_NAME = os.environ['SCHEMA_REGISTRY_GROUP'] SCHEMA_STRING = """ {"namespace": "example.avro", @@ -64,7 +64,7 @@ def send_event_data_batch(producer, serializer): endpoint=SCHEMA_REGISTRY_ENDPOINT, credential=DefaultAzureCredential() ), - group_name=SCHEMA_GROUP + group_name=GROUP_NAME ) diff --git a/sdk/schemaregistry/azure-schemaregistry/samples/async_samples/sample_code_schemaregistry_async.py b/sdk/schemaregistry/azure-schemaregistry/samples/async_samples/sample_code_schemaregistry_async.py index 6b64971132e2..6d4b8aaa8540 100644 --- a/sdk/schemaregistry/azure-schemaregistry/samples/async_samples/sample_code_schemaregistry_async.py +++ b/sdk/schemaregistry/azure-schemaregistry/samples/async_samples/sample_code_schemaregistry_async.py @@ -47,32 +47,32 @@ def create_client(): async def register_schema(schema_registry_client): # [START register_schema_async] - SCHEMA_GROUP = os.environ['SCHEMA_REGISTRY_GROUP'] - SCHEMA_NAME = 'your-schema-name' + GROUP_NAME = os.environ['SCHEMA_REGISTRY_GROUP'] + NAME = 'your-schema-name' SERIALIZATION_TYPE = SerializationType.AVRO - SCHEMA_CONTENT = """{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}""" - schema_properties = await schema_registry_client.register_schema(SCHEMA_GROUP, SCHEMA_NAME, SCHEMA_CONTENT, SERIALIZATION_TYPE) + CONTENT = """{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}""" + schema_properties = await schema_registry_client.register_schema(GROUP_NAME, NAME, CONTENT, SERIALIZATION_TYPE) schema_id = schema_properties.id # [END register_schema_async] return schema_id -async def get_schema(schema_registry_client, schema_id): +async def get_schema(schema_registry_client, id): # [START get_schema_async] - schema = await schema_registry_client.get_schema(schema_id) + schema = await schema_registry_client.get_schema(id) schema_content = schema.content # [END get_schema_async] return schema_content async def get_schema_id(schema_registry_client): - schema_group = os.environ['SCHEMA_REGISTRY_GROUP'] - schema_name = 'your-schema-name' + group_name = os.environ['SCHEMA_REGISTRY_GROUP'] + name = 'your-schema-name' serialization_type = SerializationType.AVRO - schema_content = """{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}""" + content = """{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}""" # [START get_schema_id_async] - schema_properties = await schema_registry_client.get_schema_properties(schema_group, schema_name, schema_content, serialization_type) + schema_properties = await schema_registry_client.get_schema_properties(group_name, name, content, serialization_type) schema_id = schema_properties.id # [END get_schema_id_async] return schema_id diff --git a/sdk/schemaregistry/azure-schemaregistry/samples/async_samples/schema_registry_async.py b/sdk/schemaregistry/azure-schemaregistry/samples/async_samples/schema_registry_async.py index 766d6075ba67..d115aa4ccbc6 100644 --- a/sdk/schemaregistry/azure-schemaregistry/samples/async_samples/schema_registry_async.py +++ b/sdk/schemaregistry/azure-schemaregistry/samples/async_samples/schema_registry_async.py @@ -23,31 +23,31 @@ CLIENT_SECRET = os.environ['SCHEMA_REGISTRY_AZURE_CLIENT_SECRET'] SCHEMA_REGISTRY_ENDPOINT = os.environ['SCHEMA_REGISTRY_ENDPOINT'] -SCHEMA_GROUP = os.environ['SCHEMA_REGISTRY_GROUP'] -SCHEMA_NAME = 'your-schema-name' +GROUP_NAME = os.environ['SCHEMA_REGISTRY_GROUP'] +NAME = 'your-schema-name' SERIALIZATION_TYPE = SerializationType.AVRO SCHEMA_STRING = """{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}""" -async def register_schema(client, schema_group, schema_name, schema_string, serialization_type): +async def register_schema(client, group_name, name, schema_string, serialization_type): print("Registering schema...") - schema_properties = await client.register_schema(schema_group, schema_name, schema_string, serialization_type) + schema_properties = await client.register_schema(group_name, name, schema_string, serialization_type) print("Schema registered, returned schema id is {}".format(schema_properties.id)) print("Schema properties are {}".format(schema_properties)) return schema_properties.id -async def get_schema_by_id(client, schema_id): +async def get_schema_by_id(client, id): print("Getting schema by id...") - schema = await client.get_schema(schema_id) - print("The schema string of schema id: {} string is {}".format(schema_id, schema.content)) - print("Schema properties are {}".format(schema_id)) + schema = await client.get_schema(id) + print("The schema string of schema id: {} string is {}".format(id, schema.content)) + print("Schema properties are {}".format(id)) return schema.content -async def get_schema_id(client, schema_group, schema_name, schema_string, serialization_type): +async def get_schema_id(client, group_name, name, schema_string, serialization_type): print("Getting schema id...") - schema_properties = await client.get_schema_properties(schema_group, schema_name, schema_string, serialization_type) + schema_properties = await client.get_schema_properties(group_name, name, schema_string, serialization_type) print("The schema id is: {}".format(schema_properties.id)) print("Schema properties are {}".format(schema_properties)) return schema_properties.id @@ -61,9 +61,9 @@ async def main(): ) schema_registry_client = SchemaRegistryClient(endpoint=SCHEMA_REGISTRY_ENDPOINT, credential=token_credential) async with token_credential, schema_registry_client: - schema_id = await register_schema(schema_registry_client, SCHEMA_GROUP, SCHEMA_NAME, SCHEMA_STRING, SERIALIZATION_TYPE) + schema_id = await register_schema(schema_registry_client, GROUP_NAME, NAME, SCHEMA_STRING, SERIALIZATION_TYPE) schema_str = await get_schema_by_id(schema_registry_client, schema_id) - schema_id = await get_schema_id(schema_registry_client, SCHEMA_GROUP, SCHEMA_NAME, SCHEMA_STRING, SERIALIZATION_TYPE) + schema_id = await get_schema_id(schema_registry_client, GROUP_NAME, NAME, SCHEMA_STRING, SERIALIZATION_TYPE) loop = asyncio.get_event_loop() diff --git a/sdk/schemaregistry/azure-schemaregistry/samples/sync_samples/sample_code_schemaregistry.py b/sdk/schemaregistry/azure-schemaregistry/samples/sync_samples/sample_code_schemaregistry.py index 001182601c38..1f3d638fb5bd 100644 --- a/sdk/schemaregistry/azure-schemaregistry/samples/sync_samples/sample_code_schemaregistry.py +++ b/sdk/schemaregistry/azure-schemaregistry/samples/sync_samples/sample_code_schemaregistry.py @@ -45,11 +45,11 @@ def create_client(): def register_schema(schema_registry_client): # [START register_schema_sync] - SCHEMA_GROUP = os.environ['SCHEMA_REGISTRY_GROUP'] - SCHEMA_NAME = 'your-schema-name' + GROUP_NAME = os.environ['SCHEMA_REGISTRY_GROUP'] + NAME = 'your-schema-name' SERIALIZATION_TYPE = SerializationType.AVRO - SCHEMA_CONTENT = """{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}""" - schema_properties = schema_registry_client.register_schema(SCHEMA_GROUP, SCHEMA_NAME, SCHEMA_CONTENT, SERIALIZATION_TYPE) + CONTENT = """{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}""" + schema_properties = schema_registry_client.register_schema(GROUP_NAME, NAME, CONTENT, SERIALIZATION_TYPE) schema_id = schema_properties.id # [END register_schema_sync] @@ -63,9 +63,9 @@ def register_schema(schema_registry_client): return schema_id -def get_schema(schema_registry_client, schema_id): +def get_schema(schema_registry_client, id): # [START get_schema_sync] - schema = schema_registry_client.get_schema(schema_id) + schema = schema_registry_client.get_schema(id) schema_content = schema.content # [END get_schema_sync] @@ -77,12 +77,12 @@ def get_schema(schema_registry_client, schema_id): def get_schema_id(schema_registry_client): - schema_group = os.environ['SCHEMA_REGISTRY_GROUP'] - schema_name = 'your-schema-name' + group_name = os.environ['SCHEMA_REGISTRY_GROUP'] + name = 'your-schema-name' serialization_type = SerializationType.AVRO - schema_content = """{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}""" + content = """{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}""" # [START get_schema_id_sync] - schema_properties = schema_registry_client.get_schema_properties(schema_group, schema_name, schema_content, serialization_type) + schema_properties = schema_registry_client.get_schema_properties(group_name, name, content, serialization_type) schema_id = schema_properties.id # [END get_schema_id_sync] return schema_id diff --git a/sdk/schemaregistry/azure-schemaregistry/samples/sync_samples/schema_registry.py b/sdk/schemaregistry/azure-schemaregistry/samples/sync_samples/schema_registry.py index 78ba7271526f..1d9338b2d055 100644 --- a/sdk/schemaregistry/azure-schemaregistry/samples/sync_samples/schema_registry.py +++ b/sdk/schemaregistry/azure-schemaregistry/samples/sync_samples/schema_registry.py @@ -43,8 +43,8 @@ CLIENT_SECRET = os.environ['SCHEMA_REGISTRY_AZURE_CLIENT_SECRET'] SCHEMA_REGISTRY_ENDPOINT = os.environ['SCHEMA_REGISTRY_ENDPOINT'] -SCHEMA_GROUP = os.environ['SCHEMA_REGISTRY_GROUP'] -SCHEMA_NAME = 'your-schema-name' +GROUP_NAME = os.environ['SCHEMA_REGISTRY_GROUP'] +NAME = 'your-schema-name' SERIALIZATION_TYPE = SerializationType.AVRO SCHEMA_JSON = { @@ -69,25 +69,25 @@ SCHEMA_STRING = json.dumps(SCHEMA_JSON, separators=(',', ':')) -def register_schema(client, schema_group, schema_name, schema_string, serialization_type): +def register_schema(client, group_name, name, schema_string, serialization_type): print("Registering schema...") - schema_properties = client.register_schema(schema_group, schema_name, schema_string, serialization_type) + schema_properties = client.register_schema(group_name, name, schema_string, serialization_type) print("Schema registered, returned schema id is {}".format(schema_properties.id)) print("Schema properties are {}".format(schema_properties)) return schema_properties.id -def get_schema_by_id(client, schema_id): +def get_schema_by_id(client, id): print("Getting schema by id...") - schema = client.get_schema(schema_id) - print("The schema string of schema id: {} string is {}".format(schema_id, schema.content)) - print("Schema properties are {}".format(schema_id)) + schema = client.get_schema(id) + print("The schema string of schema id: {} string is {}".format(id, schema.content)) + print("Schema properties are {}".format(id)) return schema.content -def get_schema_id(client, schema_group, schema_name, schema_string, serialization_type): +def get_schema_id(client, group_name, name, schema_string, serialization_type): print("Getting schema id...") - schema_properties = client.get_schema_properties(schema_group, schema_name, schema_string, serialization_type) + schema_properties = client.get_schema_properties(group_name, name, schema_string, serialization_type) print("The schema id is: {}".format(schema_properties.id)) print("Schema properties are {}".format(schema_properties)) return schema_properties.id @@ -101,7 +101,6 @@ def get_schema_id(client, schema_group, schema_name, schema_string, serializatio ) schema_registry_client = SchemaRegistryClient(endpoint=SCHEMA_REGISTRY_ENDPOINT, credential=token_credential) with schema_registry_client: - schema_id = register_schema(schema_registry_client, SCHEMA_GROUP, SCHEMA_NAME, SCHEMA_STRING, SERIALIZATION_TYPE) - schema_str = get_schema_by_id(schema_registry_client, schema_id=schema_id) - schema_id = get_schema_id(schema_registry_client, SCHEMA_GROUP, SCHEMA_NAME, SCHEMA_STRING, SERIALIZATION_TYPE) - + schema_id = register_schema(schema_registry_client, GROUP_NAME, NAME, SCHEMA_STRING, SERIALIZATION_TYPE) + schema_str = get_schema_by_id(schema_registry_client, schema_id) + schema_id = get_schema_id(schema_registry_client, GROUP_NAME, NAME, SCHEMA_STRING, SERIALIZATION_TYPE) From 5016742d0d68f670ab35becdb3cb3d59cdedc35f Mon Sep 17 00:00:00 2001 From: luc <44377201+LuChen-Microsoft@users.noreply.github.com> Date: Tue, 14 Sep 2021 13:09:43 -0700 Subject: [PATCH 57/85] Update changelog date (#20686) * update swagger * update release date --- sdk/communication/azure-communication-chat/CHANGELOG.md | 2 +- .../azure/communication/chat/_version.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/communication/azure-communication-chat/CHANGELOG.md b/sdk/communication/azure-communication-chat/CHANGELOG.md index 5d6e923f9b5a..be7af070f13d 100644 --- a/sdk/communication/azure-communication-chat/CHANGELOG.md +++ b/sdk/communication/azure-communication-chat/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 1.1.0 (Unreleased) +## 1.1.0 (2021-09-15) - Updated `azure-communication-chat` version. ## 1.1.0b1 (2021-08-16) diff --git a/sdk/communication/azure-communication-chat/azure/communication/chat/_version.py b/sdk/communication/azure-communication-chat/azure/communication/chat/_version.py index a83b9274f4f8..c274994f7969 100644 --- a/sdk/communication/azure-communication-chat/azure/communication/chat/_version.py +++ b/sdk/communication/azure-communication-chat/azure/communication/chat/_version.py @@ -4,6 +4,6 @@ # license information. # -------------------------------------------------------------------------- -VERSION = "1.1.0b1" +VERSION = "1.1.0" SDK_MONIKER = "communication-chat/{}".format(VERSION) # type: str From 279e7ebdb9c8a9fc30c7fa963f9a69cf339c06be Mon Sep 17 00:00:00 2001 From: Rakshith Bhyravabhotla Date: Tue, 14 Sep 2021 15:22:05 -0700 Subject: [PATCH 58/85] Add a new row type in query (#20685) * Add row type * Add a new row type * add test * lint * Apply suggestions from code review * changes --- sdk/monitor/azure-monitor-query/CHANGELOG.md | 2 + .../azure/monitor/query/__init__.py | 2 + .../monitor/query/_metrics_query_client.py | 4 +- .../azure/monitor/query/_models.py | 45 ++++++++++++++++++- .../samples/sample_log_query_client.py | 5 ++- .../tests/async/test_logs_client_async.py | 22 ++++++++- .../tests/test_logs_client.py | 21 ++++++++- 7 files changed, 93 insertions(+), 8 deletions(-) diff --git a/sdk/monitor/azure-monitor-query/CHANGELOG.md b/sdk/monitor/azure-monitor-query/CHANGELOG.md index 70c9d0b31bfb..5f2d861f2b22 100644 --- a/sdk/monitor/azure-monitor-query/CHANGELOG.md +++ b/sdk/monitor/azure-monitor-query/CHANGELOG.md @@ -7,10 +7,12 @@ - Added `QueryPartialErrorException` and `LogsQueryError` to handle errors. - Added `partial_error` and `is_error` attributes to `LogsQueryResult`. - Added an option `allow_partial_errors` that defaults to False, which can be set to not throw if there are any partial errors. +- Added a new `LogsTableRow` type that represents a single row in a table. ### Breaking Changes - `LogsQueryResult` now iterates over the tables directly as a convinience. +- `metric_namespace` is renamed to `namespace` and is a keyword-only argument in `list_metric_definitions` API. ### Bugs Fixed diff --git a/sdk/monitor/azure-monitor-query/azure/monitor/query/__init__.py b/sdk/monitor/azure-monitor-query/azure/monitor/query/__init__.py index d33a6f0a5c28..1171a0562dfc 100644 --- a/sdk/monitor/azure-monitor-query/azure/monitor/query/__init__.py +++ b/sdk/monitor/azure-monitor-query/azure/monitor/query/__init__.py @@ -16,6 +16,7 @@ MetricAggregationType, LogsQueryResult, LogsTable, + LogsTableRow, MetricsResult, LogsBatchQuery, MetricNamespace, @@ -38,6 +39,7 @@ "LogsQueryError", "QueryPartialErrorException", "LogsTable", + "LogsTableRow", "LogsBatchQuery", "MetricsQueryClient", "MetricNamespace", diff --git a/sdk/monitor/azure-monitor-query/azure/monitor/query/_metrics_query_client.py b/sdk/monitor/azure-monitor-query/azure/monitor/query/_metrics_query_client.py index 30a99f6f82a0..78f168bb59de 100644 --- a/sdk/monitor/azure-monitor-query/azure/monitor/query/_metrics_query_client.py +++ b/sdk/monitor/azure-monitor-query/azure/monitor/query/_metrics_query_client.py @@ -148,8 +148,8 @@ def list_metric_namespaces(self, resource_uri, **kwargs): **kwargs) @distributed_trace - def list_metric_definitions(self, resource_uri, metric_namespace=None, **kwargs): - # type: (str, str, Any) -> ItemPaged[MetricDefinition] + def list_metric_definitions(self, resource_uri, **kwargs): + # type: (str, Any) -> ItemPaged[MetricDefinition] """Lists the metric definitions for the resource. :param resource_uri: The identifier of the resource. diff --git a/sdk/monitor/azure-monitor-query/azure/monitor/query/_models.py b/sdk/monitor/azure-monitor-query/azure/monitor/query/_models.py index 4532f1ab468e..daa4977803fc 100644 --- a/sdk/monitor/azure-monitor-query/azure/monitor/query/_models.py +++ b/sdk/monitor/azure-monitor-query/azure/monitor/query/_models.py @@ -28,7 +28,7 @@ class LogsTable(object): :ivar column_types: The types of columns in this table. :vartype columns: list[object] :ivar rows: Required. The resulting rows from this query. - :vartype rows: list[list[object]] + :vartype rows: list[~azure.monitor.query.LogsTableRow] """ def __init__(self, **kwargs): # type: (Any) -> None @@ -36,7 +36,14 @@ def __init__(self, **kwargs): self.columns = kwargs.pop('columns', None) # type: Optional[str] self.columns_types = kwargs.pop('column_types', None) # type: Optional[Any] _rows = kwargs.pop('rows', None) - self.rows = [process_row(self.columns_types, row) for row in _rows] + self.rows = [ + LogsTableRow( + row=row, + row_index=ind, + col_types=self.columns_types, + columns=self.columns + ) for ind, row in enumerate(_rows) + ] @classmethod def _from_generated(cls, generated): @@ -48,6 +55,40 @@ def _from_generated(cls, generated): ) +class LogsTableRow(object): + """Represents a single row in logs table. + + ivar list row: The collection of values in the row. + ivar int row_index: The index of the row in the table + """ + def __init__(self, **kwargs): + # type: (Any) -> None + _col_types = kwargs['col_types'] + row = kwargs['row'] + self.row = process_row(_col_types, row) + self.row_index = kwargs['row_index'] + _columns = kwargs['columns'] + self._row_dict = { + _columns[i]: self.row[i] for i in range(len(self.row)) + } + + def __iter__(self): + """This will iterate over the row directly. + """ + return iter(self.row) + + def __getitem__(self, column): + """This type must be subscriptable directly to row. + Must be gettableby both column name and row index + Example: row[0] -> returns the first element of row and + row[column_name] -> returns the row element against the given column name. + """ + try: + return self._row_dict[column] + except KeyError: + return self.row[column] + + class MetricsResult(object): """The response to a metrics query. diff --git a/sdk/monitor/azure-monitor-query/samples/sample_log_query_client.py b/sdk/monitor/azure-monitor-query/samples/sample_log_query_client.py index 5bda7d0e0f3a..d16d38513f65 100644 --- a/sdk/monitor/azure-monitor-query/samples/sample_log_query_client.py +++ b/sdk/monitor/azure-monitor-query/samples/sample_log_query_client.py @@ -17,13 +17,14 @@ # Response time trend # request duration over the last 12 hours. # [START send_logs_query] -query = """AppRwequests | take 5""" +query = """AppRequests | take 5""" # returns LogsQueryResult try: response = client.query(os.environ['LOG_WORKSPACE_ID'], query, timespan=timedelta(days=1)) for table in response: - print(table) + df = pd.DataFrame(data=table.rows, columns=table.columns) + print(df) except QueryPartialErrorException as err: print("this is a partial error") print(err.details) diff --git a/sdk/monitor/azure-monitor-query/tests/async/test_logs_client_async.py b/sdk/monitor/azure-monitor-query/tests/async/test_logs_client_async.py index c7675081ed5a..1894d2de3d84 100644 --- a/sdk/monitor/azure-monitor-query/tests/async/test_logs_client_async.py +++ b/sdk/monitor/azure-monitor-query/tests/async/test_logs_client_async.py @@ -4,7 +4,7 @@ import os from azure.identity.aio import ClientSecretCredential from azure.core.exceptions import HttpResponseError -from azure.monitor.query import LogsBatchQuery, LogsQueryError, LogsTable, LogsQueryResult +from azure.monitor.query import LogsBatchQuery, LogsQueryError, LogsTable, LogsQueryResult, LogsTableRow from azure.monitor.query.aio import LogsQueryClient def _credential(): @@ -202,3 +202,23 @@ async def test_logs_query_result_iterate_over_tables(): assert response.visualization is not None assert len(response.tables) == 2 assert response.__class__ == LogsQueryResult + +@pytest.mark.live_test_only +@pytest.mark.asyncio +async def test_logs_query_result_row_type(): + client = LogsQueryClient(_credential()) + + query = "AppRequests | take 5" + + response = await client.query( + os.environ['LOG_WORKSPACE_ID'], + query, + timespan=None, + ) + + ## should iterate over tables + for table in response: + assert table.__class__ == LogsTable + + for row in table.rows: + assert row.__class__ == LogsTableRow diff --git a/sdk/monitor/azure-monitor-query/tests/test_logs_client.py b/sdk/monitor/azure-monitor-query/tests/test_logs_client.py index 34b00e201dc5..a9036055eb0d 100644 --- a/sdk/monitor/azure-monitor-query/tests/test_logs_client.py +++ b/sdk/monitor/azure-monitor-query/tests/test_logs_client.py @@ -3,7 +3,7 @@ import os from azure.identity import ClientSecretCredential from azure.core.exceptions import HttpResponseError -from azure.monitor.query import LogsQueryClient, LogsBatchQuery, LogsQueryError, LogsTable, LogsQueryResult +from azure.monitor.query import LogsQueryClient, LogsBatchQuery, LogsQueryError, LogsTable, LogsQueryResult, LogsTableRow def _credential(): credential = ClientSecretCredential( @@ -245,3 +245,22 @@ def test_logs_query_result_iterate_over_tables(): assert response.visualization is not None assert len(response.tables) == 2 assert response.__class__ == LogsQueryResult + +@pytest.mark.live_test_only +def test_logs_query_result_row_type(): + client = LogsQueryClient(_credential()) + + query = "AppRequests | take 5" + + response = client.query( + os.environ['LOG_WORKSPACE_ID'], + query, + timespan=None, + ) + + ## should iterate over tables + for table in response: + assert table.__class__ == LogsTable + + for row in table.rows: + assert row.__class__ == LogsTableRow From 3fdbaa75e5ef2cd9f0151a71992d50d0c7820739 Mon Sep 17 00:00:00 2001 From: swathipil <76007337+swathipil@users.noreply.github.com> Date: Tue, 14 Sep 2021 16:27:06 -0700 Subject: [PATCH 59/85] [EventHub] update arm template with storage conn str (#20376) * update test resources * fix * fix failing tests * adams comments * pylint * remove dateutil * adams comments * nit --- .../checkpointstoretable/_tablestoragecs.py | 36 +++++++---- .../test_storage_table_partition_manager.py | 33 +++++----- sdk/eventhub/test-resources.json | 64 ++++++++++++++++++- 3 files changed, 105 insertions(+), 28 deletions(-) diff --git a/sdk/eventhub/azure-eventhub-checkpointstoretable/azure/eventhub/extensions/checkpointstoretable/_tablestoragecs.py b/sdk/eventhub/azure-eventhub-checkpointstoretable/azure/eventhub/extensions/checkpointstoretable/_tablestoragecs.py index d88cb4b417ca..168927875bb3 100644 --- a/sdk/eventhub/azure-eventhub-checkpointstoretable/azure/eventhub/extensions/checkpointstoretable/_tablestoragecs.py +++ b/sdk/eventhub/azure-eventhub-checkpointstoretable/azure/eventhub/extensions/checkpointstoretable/_tablestoragecs.py @@ -7,7 +7,6 @@ import time import logging import calendar -import dateutil.parser from azure.core import MatchConditions from azure.eventhub import CheckpointStore # type: ignore # pylint: disable=no-name-in-module from azure.eventhub.exceptions import OwnershipLostError # type: ignore @@ -18,6 +17,8 @@ ) from ._vendor.data.tables import TableClient, UpdateMode from ._vendor.data.tables._base_client import parse_connection_str +from ._vendor.data.tables._deserialize import clean_up_dotnet_timestamps +from ._vendor.data.tables._common_conversion import TZ_UTC logger = logging.getLogger(__name__) @@ -39,6 +40,19 @@ def _to_timestamp(date): timestamp += date.microsecond / 1e6 return timestamp +def _timestamp_to_datetime(value): + # Cosmos returns this with a decimal point that throws an error on deserialization + cleaned_value = clean_up_dotnet_timestamps(value) + try: + dt_obj = datetime.datetime.strptime(cleaned_value, "%Y-%m-%dT%H:%M:%S.%fZ").replace( + tzinfo=TZ_UTC + ) + except ValueError: + dt_obj = datetime.datetime.strptime(cleaned_value, "%Y-%m-%dT%H:%M:%SZ").replace( + tzinfo=TZ_UTC + ) + return dt_obj + class TableCheckpointStore(CheckpointStore): """A CheckpointStore that uses Azure Table Storage to store the partition ownership and checkpoint data. @@ -113,13 +127,13 @@ def _create_ownership_entity(cls, ownership): Create a dictionary with the `ownership` attributes. """ ownership_entity = { - "PartitionKey": "{} {} {} Ownership".format( + "PartitionKey": u"{} {} {} Ownership".format( ownership["fully_qualified_namespace"], ownership["eventhub_name"], ownership["consumer_group"], ), - "RowKey": ownership["partition_id"], - "ownerid": ownership["owner_id"], + "RowKey": u"{}".format(ownership["partition_id"]), + "ownerid": u"{}".format(ownership["owner_id"]), } return ownership_entity @@ -129,21 +143,21 @@ def _create_checkpoint_entity(cls, checkpoint): Create a dictionary with `checkpoint` attributes. """ checkpoint_entity = { - "PartitionKey": "{} {} {} Checkpoint".format( + "PartitionKey": u"{} {} {} Checkpoint".format( checkpoint["fully_qualified_namespace"], checkpoint["eventhub_name"], checkpoint["consumer_group"], ), - "RowKey": checkpoint["partition_id"], - "offset": checkpoint["offset"], - "sequencenumber": checkpoint["sequence_number"], + "RowKey": u"{}".format(checkpoint["partition_id"]), + "offset": u"{}".format(checkpoint["offset"]), + "sequencenumber": u"{}".format(checkpoint["sequence_number"]), } return checkpoint_entity def _update_ownership(self, ownership, **kwargs): """_update_ownership mutates the passed in ownership.""" + ownership_entity = TableCheckpointStore._create_ownership_entity(ownership) try: - ownership_entity = TableCheckpointStore._create_ownership_entity(ownership) metadata = self._table_client.update_entity( mode=UpdateMode.REPLACE, entity=ownership_entity, @@ -166,7 +180,7 @@ def _update_ownership(self, ownership, **kwargs): ) ownership["etag"] = metadata["etag"] ownership["last_modified_time"] = _to_timestamp( - dateutil.parser.isoparse(metadata["content"]["Timestamp"]) + _timestamp_to_datetime(metadata["content"]["Timestamp"]) ) def _claim_one_partition(self, ownership, **kwargs): @@ -289,7 +303,7 @@ def list_checkpoints( "eventhub_name": eventhub_name, "consumer_group": consumer_group, "partition_id": entity[u"RowKey"], - "sequence_number": entity[u"sequencenumber"], + "sequence_number": int(entity[u"sequencenumber"]), "offset": str(entity[u"offset"]), } checkpoints_list.append(checkpoint) diff --git a/sdk/eventhub/azure-eventhub-checkpointstoretable/tests/test_storage_table_partition_manager.py b/sdk/eventhub/azure-eventhub-checkpointstoretable/tests/test_storage_table_partition_manager.py index 33e60c134464..c19b0cb6ffc4 100644 --- a/sdk/eventhub/azure-eventhub-checkpointstoretable/tests/test_storage_table_partition_manager.py +++ b/sdk/eventhub/azure-eventhub-checkpointstoretable/tests/test_storage_table_partition_manager.py @@ -13,14 +13,15 @@ from azure.eventhub.extensions.checkpointstoretable import TableCheckpointStore from azure.eventhub.exceptions import OwnershipLostError -STORAGE_CONN_STR = [ - #os.environ.get("AZURE_STORAGE_CONN_STR", "Azure Storage Connection String"), - os.environ.get("AZURE_COSMOS_CONN_STR", "Azure Storage Connection String"), +STORAGE_ENV_KEYS = [ + "AZURE_TABLES_CONN_STR", + "AZURE_COSMOS_CONN_STR" ] -def get_live_storage_table_client(storage_connection_str): +def get_live_storage_table_client(conn_str_env_key): try: + storage_connection_str = os.environ[conn_str_env_key] table_name = "table{}".format(uuid.uuid4().hex) table_service_client = TableServiceClient.from_connection_string( storage_connection_str @@ -176,11 +177,11 @@ def _update_and_list_checkpoint(storage_connection_str, table_name): assert checkpoint_list[0]["offset"] == "30" -@pytest.mark.parametrize("storage_connection_str", STORAGE_CONN_STR) -@pytest.mark.skip("update after adding conn str env var") -def test_claim_ownership_exception(storage_connection_str): +@pytest.mark.parametrize("conn_str_env_key", STORAGE_ENV_KEYS) +@pytest.mark.liveTest +def test_claim_ownership_exception(conn_str_env_key): storage_connection_str, table_name = get_live_storage_table_client( - storage_connection_str + conn_str_env_key ) try: _claim_ownership_exception_test(storage_connection_str, table_name) @@ -188,11 +189,11 @@ def test_claim_ownership_exception(storage_connection_str): remove_live_storage_table_client(storage_connection_str, table_name) -@pytest.mark.parametrize("storage_connection_str", STORAGE_CONN_STR) -@pytest.mark.skip("update after adding conn str env var") -def test_claim_and_list_ownership(storage_connection_str): +@pytest.mark.parametrize("conn_str_env_key", STORAGE_ENV_KEYS) +@pytest.mark.liveTest +def test_claim_and_list_ownership(conn_str_env_key): storage_connection_str, table_name = get_live_storage_table_client( - storage_connection_str + conn_str_env_key ) try: _claim_and_list_ownership(storage_connection_str, table_name) @@ -200,11 +201,11 @@ def test_claim_and_list_ownership(storage_connection_str): remove_live_storage_table_client(storage_connection_str, table_name) -@pytest.mark.parametrize("storage_connection_str", STORAGE_CONN_STR) -@pytest.mark.skip("update after adding conn str env var") -def test_update_checkpoint(storage_connection_str): +@pytest.mark.parametrize("conn_str_env_key", STORAGE_ENV_KEYS) +@pytest.mark.liveTest +def test_update_checkpoint(conn_str_env_key): storage_connection_str, table_name = get_live_storage_table_client( - storage_connection_str + conn_str_env_key ) try: _update_and_list_checkpoint(storage_connection_str, table_name) diff --git a/sdk/eventhub/test-resources.json b/sdk/eventhub/test-resources.json index 3566eb9745f9..f66ea2ac3756 100644 --- a/sdk/eventhub/test-resources.json +++ b/sdk/eventhub/test-resources.json @@ -70,11 +70,14 @@ "eventHubsNamespace": "[concat('eh-', parameters('baseName'))]", "eventHubName": "[concat('eh-', parameters('baseName'), '-hub')]", "eventHubAuthRuleName": "[concat('eh-', parameters('baseName'), '-hub-auth-rule')]", - "storageAccount": "[concat('blb', parameters('baseName'))]", + "storageAccount": "[concat('storage', parameters('baseName'))]", "containerName": "your-blob-container-name", "defaultSASKeyName": "RootManageSharedAccessKey", "eventHubsAuthRuleResourceId": "[resourceId('Microsoft.EventHub/namespaces/authorizationRules', variables('eventHubsNamespace'), variables('defaultSASKeyName'))]", "storageAccountId": "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccount'))]", + "tablesMgmtApiVersion": "2019-04-01", + "tablesAuthorizationApiVersion": "2018-09-01-preview", + "tableDataContributorRoleId": "0a9a7e1f-b9d0-4cc4-a60d-0319b160aaa3" }, "resources": [ { @@ -140,6 +143,48 @@ } ] }, + { + "type": "Microsoft.DocumentDB/databaseAccounts", + "apiVersion": "2020-04-01", + "name": "[variables('storageAccount')]", + "location": "[parameters('location')]", + "tags": { + "defaultExperience": "Azure Table", + "hidden-cosmos-mmspecial": "", + "CosmosAccountType": "Non-Production" + }, + "kind": "GlobalDocumentDB", + "properties": { + "publicNetworkAccess": "Enabled", + "enableAutomaticFailover": false, + "enableMultipleWriteLocations": false, + "isVirtualNetworkFilterEnabled": false, + "virtualNetworkRules": [], + "disableKeyBasedMetadataWriteAccess": false, + "enableFreeTier": false, + "enableAnalyticalStorage": false, + "databaseAccountOfferType": "Standard", + "consistencyPolicy": { + "defaultConsistencyLevel": "BoundedStaleness", + "maxIntervalInSeconds": 86400, + "maxStalenessPrefix": 1000000 + }, + "locations": [ + { + "locationName": "[parameters('location')]", + "provisioningState": "Succeeded", + "failoverPriority": 0, + "isZoneRedundant": false + } + ], + "capabilities": [ + { + "name": "EnableTable" + } + ], + "ipRules": [] + } + }, { "type": "Microsoft.Authorization/roleAssignments", "apiVersion": "2019-04-01-preview", @@ -159,6 +204,15 @@ "principalId": "[parameters('testApplicationOid')]", "scope": "[resourceGroup().id]" } + }, + { + "type": "Microsoft.Authorization/roleAssignments", + "apiVersion": "[variables('tablesAuthorizationApiVersion')]", + "name": "[guid(concat('tableDataContributorRoleId', resourceGroup().id))]", + "properties": { + "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', variables('tableDataContributorRoleId'))]", + "principalId": "[parameters('testApplicationOid')]" + } } ], "outputs": { @@ -197,6 +251,14 @@ "AZURE_STORAGE_ACCESS_KEY":{ "type": "string", "value": "[listKeys(variables('storageAccountId'), providers('Microsoft.Storage', 'storageAccounts').apiVersions[0]).keys[0].value]" + }, + "AZURE_TABLES_CONN_STR": { + "type": "string", + "value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccount'), ';AccountKey=', listKeys(variables('storageAccountId'), providers('Microsoft.Storage', 'storageAccounts').apiVersions[0]).keys[0].value, ';EndpointSuffix=', parameters('storageEndpointSuffix'))]" + }, + "AZURE_COSMOS_CONN_STR": { + "type": "string", + "value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccount'), ';AccountKey=', listKeys(resourceId('Microsoft.DocumentDB/databaseAccounts', variables('storageAccount')), '2020-04-01').primaryMasterKey, ';TableEndpoint=https://', variables('storageAccount'), '.table.cosmos.azure.com:443/')]" } } } From 6a06b0e5a2376da73a8849fcb393d241aff55c7b Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Tue, 14 Sep 2021 16:56:19 -0700 Subject: [PATCH 60/85] Add for multiple levels of Atx Headers in the CHANGELOG.md (#20694) Co-authored-by: Chidozie Ononiwu --- eng/common/scripts/ChangeLog-Operations.ps1 | 25 ++++++++++++++++----- eng/common/scripts/Prepare-Release.ps1 | 2 +- eng/common/scripts/Update-ChangeLog.ps1 | 6 ++--- 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/eng/common/scripts/ChangeLog-Operations.ps1 b/eng/common/scripts/ChangeLog-Operations.ps1 index 2de780150145..af71628442de 100644 --- a/eng/common/scripts/ChangeLog-Operations.ps1 +++ b/eng/common/scripts/ChangeLog-Operations.ps1 @@ -3,7 +3,7 @@ . "${PSScriptRoot}\SemVer.ps1" $RELEASE_TITLE_REGEX = "(?^\#+\s+(?$([AzureEngSemanticVersion]::SEMVER_REGEX))(\s+(?\(.+\))))" -$SECTIONS_HEADER_REGEX = "^###\s(?.*)" +$SECTIONS_HEADER_REGEX = "^###+\s(?.*)" $CHANGELOG_UNRELEASED_STATUS = "(Unreleased)" $CHANGELOG_DATE_FORMAT = "yyyy-MM-dd" $RecommendedSectionHeaders = @("Features Added", "Breaking Changes", "Bugs Fixed", "Other Changes") @@ -42,6 +42,16 @@ function Get-ChangeLogEntriesFromContent { $changelogEntry = $null $sectionName = $null $changeLogEntries = [Ordered]@{} + $initialAtxHeader= "#" + + if ($changeLogContent[0] -match "(?^#+)\s.*") + { + $initialAtxHeader = $matches["HeaderLevel"] + } + + $changeLogEntries | Add-Member -NotePropertyName "InitialAtxHeader" -NotePropertyValue $initialAtxHeader + $releaseTitleAtxHeader = $initialAtxHeader + "#" + try { # walk the document, finding where the version specifiers are and creating lists foreach ($line in $changeLogContent) { @@ -49,7 +59,7 @@ function Get-ChangeLogEntriesFromContent { $changeLogEntry = [pscustomobject]@{ ReleaseVersion = $matches["version"] ReleaseStatus = $matches["releaseStatus"] - ReleaseTitle = "## {0} {1}" -f $matches["version"], $matches["releaseStatus"] + ReleaseTitle = "$releaseTitleAtxHeader {0} {1}" -f $matches["version"], $matches["releaseStatus"] ReleaseContent = @() Sections = @{} } @@ -210,6 +220,7 @@ function New-ChangeLogEntry { [ValidateNotNullOrEmpty()] [String]$Version, [String]$Status=$CHANGELOG_UNRELEASED_STATUS, + [String]$InitialAtxHeader="#", [String[]]$Content ) @@ -239,17 +250,20 @@ function New-ChangeLogEntry { $Content = @() $Content += "" + $sectionsAtxHeader = $InitialAtxHeader + "##" foreach ($recommendedHeader in $RecommendedSectionHeaders) { - $Content += "### $recommendedHeader" + $Content += "$sectionsAtxHeader $recommendedHeader" $Content += "" } } + $releaseTitleAtxHeader = $initialAtxHeader + "#" + $newChangeLogEntry = [pscustomobject]@{ ReleaseVersion = $Version ReleaseStatus = $Status - ReleaseTitle = "## $Version $Status" + ReleaseTitle = "$releaseTitleAtxHeader $Version $Status" ReleaseContent = $Content } @@ -265,7 +279,7 @@ function Set-ChangeLogContent { ) $changeLogContent = @() - $changeLogContent += "# Release History" + $changeLogContent += "$($ChangeLogEntries.InitialAtxHeader) Release History" $changeLogContent += "" try @@ -298,7 +312,6 @@ function Remove-EmptySections { ) $releaseContent = $ChangeLogEntry.ReleaseContent - $sectionsToRemove = @() if ($releaseContent.Count -gt 0) { diff --git a/eng/common/scripts/Prepare-Release.ps1 b/eng/common/scripts/Prepare-Release.ps1 index cee038dd18a0..21f4f256830e 100644 --- a/eng/common/scripts/Prepare-Release.ps1 +++ b/eng/common/scripts/Prepare-Release.ps1 @@ -188,7 +188,7 @@ $changelogIsValid = Confirm-ChangeLogEntry -ChangeLogLocation $packageProperties if (!$changelogIsValid) { - Write-Host "The changelog [$($packageProperties.ChangeLogPath)] is not valid for release. Please make sure it is valid before queuing release build." -ForegroundColor Red + Write-Warning "The changelog [$($packageProperties.ChangeLogPath)] is not valid for release. Please make sure it is valid before queuing release build." } git diff -s --exit-code $packageProperties.DirectoryPath diff --git a/eng/common/scripts/Update-ChangeLog.ps1 b/eng/common/scripts/Update-ChangeLog.ps1 index 43e97918bea1..9b9797e083a7 100644 --- a/eng/common/scripts/Update-ChangeLog.ps1 +++ b/eng/common/scripts/Update-ChangeLog.ps1 @@ -113,7 +113,7 @@ if ($ReplaceLatestEntryTitle) { $entryToBeUpdated = Remove-EmptySections -ChangeLogEntry $entryToBeUpdated } - $newChangeLogEntry = New-ChangeLogEntry -Version $Version -Status $ReleaseStatus -Content $entryToBeUpdated + $newChangeLogEntry = New-ChangeLogEntry -Version $Version -Status $ReleaseStatus -InitialAtxHeader $ChangeLogEntries.InitialAtxHeader -Content $entryToBeUpdated LogDebug "Resetting latest entry title to [$($newChangeLogEntry.ReleaseTitle)]" $ChangeLogEntries.Remove($LatestVersion) if ($newChangeLogEntry) { @@ -128,7 +128,7 @@ elseif ($ChangeLogEntries.Contains($Version)) { LogDebug "Updating ReleaseStatus for Version [$Version] to [$($ReleaseStatus)]" $ChangeLogEntries[$Version].ReleaseStatus = $ReleaseStatus - $ChangeLogEntries[$Version].ReleaseTitle = "## $Version $ReleaseStatus" + $ChangeLogEntries[$Version].ReleaseTitle = "$($ChangeLogEntries.InitialAtxHeader)# $Version $ReleaseStatus" if ($SanitizeEntry) { $ChangeLogEntries[$Version] = Remove-EmptySections -ChangeLogEntry $ChangeLogEntries[$Version] @@ -137,7 +137,7 @@ elseif ($ChangeLogEntries.Contains($Version)) else { LogDebug "Adding new ChangeLog entry for Version [$Version]" - $newChangeLogEntry = New-ChangeLogEntry -Version $Version -Status $ReleaseStatus + $newChangeLogEntry = New-ChangeLogEntry -Version $Version -Status $ReleaseStatus -InitialAtxHeader $ChangeLogEntries.InitialAtxHeader if ($newChangeLogEntry) { $ChangeLogEntries.Insert(0, $Version, $newChangeLogEntry) } From 1efff7ff709f3dc91963e5feb7f5eb5d63dfa14b Mon Sep 17 00:00:00 2001 From: Travis Prescott Date: Wed, 15 Sep 2021 10:53:42 -0700 Subject: [PATCH 61/85] [Search] Add skillset validation (#20669) * Add client-side validation and test. * Add skillset validation test. * Make code more Pythonic. --- .../azure-search-documents/CHANGELOG.md | 1 + .../indexes/_search_indexer_client.py | 50 +++++++++++++- .../documents/indexes/models/_models.py | 14 ++-- ...t_live.test_create_or_update_skillset.yaml | 46 ++++++------- ...reate_or_update_skillset_if_unchanged.yaml | 34 ++++----- ...est_create_or_update_skillset_inplace.yaml | 46 ++++++------- ...nt_skillset_live.test_create_skillset.yaml | 69 +++---------------- ...nt_skillset_live.test_delete_skillset.yaml | 38 +++++----- ...ive.test_delete_skillset_if_unchanged.yaml | 34 ++++----- ...lient_skillset_live.test_get_skillset.yaml | 34 ++++----- ...ient_skillset_live.test_get_skillsets.yaml | 34 ++++----- .../tests/search_service_preparer.py | 2 +- .../test_search_index_client_skillset_live.py | 39 +++++++++-- 13 files changed, 233 insertions(+), 208 deletions(-) diff --git a/sdk/search/azure-search-documents/CHANGELOG.md b/sdk/search/azure-search-documents/CHANGELOG.md index 6d44c481b52e..c5911ab8e9a2 100644 --- a/sdk/search/azure-search-documents/CHANGELOG.md +++ b/sdk/search/azure-search-documents/CHANGELOG.md @@ -11,6 +11,7 @@ - Renamed `SearchClient.speller` to `SearchClient.query_speller`. - Removed keyword arguments from `SearchClient`: `answers` and `captions`. +- `SentimentSkill`, `EntityRecognitionSkill`: added client-side validation to prevent sending unsupported parameters. ### Bugs Fixed diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/_search_indexer_client.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/_search_indexer_client.py index 061e7d54462f..27a083e917f6 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/_search_indexer_client.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/_search_indexer_client.py @@ -15,7 +15,11 @@ get_access_conditions, normalize_endpoint, ) -from .models import SearchIndexerDataSourceConnection +from .models import ( + EntityRecognitionSkillVersion, + SearchIndexerDataSourceConnection, + SentimentSkillVersion +) from .._api_versions import DEFAULT_VERSION from .._headers_mixin import HeadersMixin from .._utils import get_authentication_policy @@ -564,7 +568,9 @@ def create_skillset(self, skillset, **kwargs): """ kwargs["headers"] = self._merge_client_headers(kwargs.get("headers")) + _validate_skillset(skillset) skillset = skillset._to_generated() if hasattr(skillset, '_to_generated') else skillset # pylint:disable=protected-access + result = self._client.skillsets.create(skillset, **kwargs) return SearchIndexerSkillset._from_generated(result) # pylint:disable=protected-access @@ -587,6 +593,7 @@ def create_or_update_skillset(self, skillset, **kwargs): skillset, kwargs.pop("match_condition", MatchConditions.Unconditionally) ) kwargs.update(access_condition) + _validate_skillset(skillset) skillset = skillset._to_generated() if hasattr(skillset, '_to_generated') else skillset # pylint:disable=protected-access result = self._client.skillsets.create_or_update( @@ -596,3 +603,44 @@ def create_or_update_skillset(self, skillset, **kwargs): **kwargs ) return SearchIndexerSkillset._from_generated(result) # pylint:disable=protected-access + +def _validate_skillset(skillset): + """Validates any multi-version skills in the skillset to verify that unsupported + parameters are not supplied by the user. + """ + skills = getattr(skillset, 'skills', None) + if not skills: + return + + error_strings = [] + for skill in skills: + try: + skill_version = skill.get('skill_version') + except AttributeError: + skill_version = getattr(skill, 'skill_version', None) + if not skill_version: + continue + + if skill_version == SentimentSkillVersion.V1: + unsupported = ['model_version', 'include_opinion_mining'] + elif skill_version == SentimentSkillVersion.V3: + unsupported = [] + elif skill_version == EntityRecognitionSkillVersion.V1: + unsupported = ['model_version'] + elif skill_version == EntityRecognitionSkillVersion.V3: + unsupported = ['include_typeless_entities'] + + errors = [] + for item in unsupported: + try: + if skill.get(item, None): + errors.append(item) + except AttributeError: + if skill.__dict__.get(item, None): + errors.append(item) + if errors: + error_strings.append("Unsupported parameters for skill version {}: {}".format( + skill_version, ", ".join(errors)) + ) + if error_strings: + raise ValueError("\n".join(error_strings)) diff --git a/sdk/search/azure-search-documents/azure/search/documents/indexes/models/_models.py b/sdk/search/azure-search-documents/azure/search/documents/indexes/models/_models.py index baa2aea92ebf..9a88f0e0b1b7 100644 --- a/sdk/search/azure-search-documents/azure/search/documents/indexes/models/_models.py +++ b/sdk/search/azure-search-documents/azure/search/documents/indexes/models/_models.py @@ -181,6 +181,7 @@ class EntityRecognitionSkill(SearchIndexerSkill): 'include_typeless_entities': {'key': 'includeTypelessEntities', 'type': 'bool'}, 'minimum_precision': {'key': 'minimumPrecision', 'type': 'float'}, 'model_version': {'key': 'modelVersion', 'type': 'str'}, + 'skill_version': {'key': 'skillVersion', 'type': 'str'} } def __init__( @@ -210,8 +211,7 @@ def _to_generated(self): categories=self.categories, default_language_code=self.default_language_code, include_typeless_entities=self.include_typeless_entities, - minimum_precision=self.minimum_precision, - model_version=self.model_version + minimum_precision=self.minimum_precision ) if self.skill_version in [EntityRecognitionSkillVersion.V3, EntityRecognitionSkillVersion.LATEST]: return _EntityRecognitionSkillV3( @@ -221,7 +221,6 @@ def _to_generated(self): odata_type=self.odata_type, categories=self.categories, default_language_code=self.default_language_code, - include_typeless_entities=self.include_typeless_entities, minimum_precision=self.minimum_precision, model_version=self.model_version ) @@ -318,6 +317,7 @@ class SentimentSkill(SearchIndexerSkill): 'default_language_code': {'key': 'defaultLanguageCode', 'type': 'str'}, 'include_opinion_mining': {'key': 'includeOpinionMining', 'type': 'bool'}, 'model_version': {'key': 'modelVersion', 'type': 'str'}, + 'skill_version': {'key': 'skillVersion', 'type': 'str'} } def __init__( @@ -331,7 +331,7 @@ def __init__( self.skill_version = skill_version self.odata_type = self.skill_version # type: str self.default_language_code = kwargs.get('default_language_code', None) - self.include_opinion_mining = kwargs.get('include_opinion_mining', False) + self.include_opinion_mining = kwargs.get('include_opinion_mining', None) self.model_version = kwargs.get('model_version', None) def _to_generated(self): @@ -341,10 +341,8 @@ def _to_generated(self): outputs=self.outputs, name=self.name, odata_type=self.odata_type, - default_language_code=self.default_language_code, - include_opinion_mining=self.include_opinion_mining, - model_version=self.model_version - ) + default_language_code=self.default_language_code + ) if self.skill_version in [SentimentSkillVersion.V3, SentimentSkillVersion.LATEST]: return _SentimentSkillV3( inputs=self.inputs, diff --git a/sdk/search/azure-search-documents/tests/recordings/test_search_index_client_skillset_live.test_create_or_update_skillset.yaml b/sdk/search/azure-search-documents/tests/recordings/test_search_index_client_skillset_live.test_create_or_update_skillset.yaml index beac00b106ed..f3fc2646770f 100644 --- a/sdk/search/azure-search-documents/tests/recordings/test_search_index_client_skillset_live.test_create_or_update_skillset.yaml +++ b/sdk/search/azure-search-documents/tests/recordings/test_search_index_client_skillset_live.test_create_or_update_skillset.yaml @@ -18,12 +18,12 @@ interactions: Prefer: - return=representation User-Agent: - - azsdk-python-search-documents/11.3.0b3 Python/3.9.2 (Windows-10-10.0.19041-SP0) + - azsdk-python-search-documents/11.3.0b4 Python/3.9.2 (Windows-10-10.0.19041-SP0) method: PUT uri: https://searche2bf1c71.search.windows.net/skillsets('test-ss')?api-version=2021-04-30-Preview response: body: - string: '{"@odata.context":"https://searche2bf1c71.search.windows.net/$metadata#skillsets/$entity","@odata.etag":"\"0x8D96E6871C89346\"","name":"test-ss","description":"desc1","skills":[{"@odata.type":"#Microsoft.Skills.Text.EntityRecognitionSkill","name":null,"description":null,"context":null,"categories":[],"defaultLanguageCode":null,"minimumPrecision":null,"includeTypelessEntities":null,"inputs":[{"name":"text","source":"/document/content","sourceContext":null,"inputs":[]}],"outputs":[{"name":"organizations","targetName":"organizations"}]}],"cognitiveServices":null,"knowledgeStore":null,"encryptionKey":null}' + string: '{"@odata.context":"https://searche2bf1c71.search.windows.net/$metadata#skillsets/$entity","@odata.etag":"\"0x8D977BF242A141A\"","name":"test-ss","description":"desc1","skills":[{"@odata.type":"#Microsoft.Skills.Text.EntityRecognitionSkill","name":null,"description":null,"context":null,"categories":[],"defaultLanguageCode":null,"minimumPrecision":null,"includeTypelessEntities":null,"inputs":[{"name":"text","source":"/document/content","sourceContext":null,"inputs":[]}],"outputs":[{"name":"organizations","targetName":"organizations"}]}],"cognitiveServices":null,"knowledgeStore":null,"encryptionKey":null}' headers: cache-control: - no-cache @@ -32,11 +32,11 @@ interactions: content-type: - application/json; odata.metadata=minimal date: - - Thu, 02 Sep 2021 23:21:51 GMT + - Tue, 14 Sep 2021 20:35:07 GMT elapsed-time: - - '1433' + - '2124' etag: - - W/"0x8D96E6871C89346" + - W/"0x8D977BF242A141A" expires: - '-1' location: @@ -48,7 +48,7 @@ interactions: preference-applied: - odata.include-annotations="*" request-id: - - 8ded272a-0c44-11ec-ac43-74c63bed1137 + - 3ff59952-159b-11ec-bda5-74c63bed1137 strict-transport-security: - max-age=15724800; includeSubDomains status: @@ -73,12 +73,12 @@ interactions: Prefer: - return=representation User-Agent: - - azsdk-python-search-documents/11.3.0b3 Python/3.9.2 (Windows-10-10.0.19041-SP0) + - azsdk-python-search-documents/11.3.0b4 Python/3.9.2 (Windows-10-10.0.19041-SP0) method: PUT uri: https://searche2bf1c71.search.windows.net/skillsets('test-ss')?api-version=2021-04-30-Preview response: body: - string: '{"@odata.context":"https://searche2bf1c71.search.windows.net/$metadata#skillsets/$entity","@odata.etag":"\"0x8D96E6871DB3571\"","name":"test-ss","description":"desc2","skills":[{"@odata.type":"#Microsoft.Skills.Text.EntityRecognitionSkill","name":null,"description":null,"context":null,"categories":[],"defaultLanguageCode":null,"minimumPrecision":null,"includeTypelessEntities":null,"inputs":[{"name":"text","source":"/document/content","sourceContext":null,"inputs":[]}],"outputs":[{"name":"organizations","targetName":"organizations"}]}],"cognitiveServices":null,"knowledgeStore":null,"encryptionKey":null}' + string: '{"@odata.context":"https://searche2bf1c71.search.windows.net/$metadata#skillsets/$entity","@odata.etag":"\"0x8D977BF243E8A49\"","name":"test-ss","description":"desc2","skills":[{"@odata.type":"#Microsoft.Skills.Text.EntityRecognitionSkill","name":null,"description":null,"context":null,"categories":[],"defaultLanguageCode":null,"minimumPrecision":null,"includeTypelessEntities":null,"inputs":[{"name":"text","source":"/document/content","sourceContext":null,"inputs":[]}],"outputs":[{"name":"organizations","targetName":"organizations"}]}],"cognitiveServices":null,"knowledgeStore":null,"encryptionKey":null}' headers: cache-control: - no-cache @@ -87,11 +87,11 @@ interactions: content-type: - application/json; odata.metadata=minimal date: - - Thu, 02 Sep 2021 23:21:51 GMT + - Tue, 14 Sep 2021 20:35:07 GMT elapsed-time: - - '46' + - '85' etag: - - W/"0x8D96E6871DB3571" + - W/"0x8D977BF243E8A49" expires: - '-1' odata-version: @@ -101,7 +101,7 @@ interactions: preference-applied: - odata.include-annotations="*" request-id: - - 8ef2919c-0c44-11ec-a88c-74c63bed1137 + - 41558274-159b-11ec-bc0f-74c63bed1137 strict-transport-security: - max-age=15724800; includeSubDomains vary: @@ -119,12 +119,12 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-search-documents/11.3.0b3 Python/3.9.2 (Windows-10-10.0.19041-SP0) + - azsdk-python-search-documents/11.3.0b4 Python/3.9.2 (Windows-10-10.0.19041-SP0) method: GET uri: https://searche2bf1c71.search.windows.net/skillsets?api-version=2021-04-30-Preview response: body: - string: '{"@odata.context":"https://searche2bf1c71.search.windows.net/$metadata#skillsets","value":[{"@odata.etag":"\"0x8D96E6871DB3571\"","name":"test-ss","description":"desc2","skills":[{"@odata.type":"#Microsoft.Skills.Text.EntityRecognitionSkill","name":"#1","description":null,"context":"/document","categories":["Person","Quantity","Organization","URL","Email","Location","DateTime"],"defaultLanguageCode":"en","minimumPrecision":null,"includeTypelessEntities":null,"inputs":[{"name":"text","source":"/document/content","sourceContext":null,"inputs":[]}],"outputs":[{"name":"organizations","targetName":"organizations"}]}],"cognitiveServices":null,"knowledgeStore":null,"encryptionKey":null}]}' + string: '{"@odata.context":"https://searche2bf1c71.search.windows.net/$metadata#skillsets","value":[{"@odata.etag":"\"0x8D977BF243E8A49\"","name":"test-ss","description":"desc2","skills":[{"@odata.type":"#Microsoft.Skills.Text.EntityRecognitionSkill","name":"#1","description":null,"context":"/document","categories":["Person","Quantity","Organization","URL","Email","Location","DateTime"],"defaultLanguageCode":"en","minimumPrecision":null,"includeTypelessEntities":null,"inputs":[{"name":"text","source":"/document/content","sourceContext":null,"inputs":[]}],"outputs":[{"name":"organizations","targetName":"organizations"}]}],"cognitiveServices":null,"knowledgeStore":null,"encryptionKey":null}]}' headers: cache-control: - no-cache @@ -133,9 +133,9 @@ interactions: content-type: - application/json; odata.metadata=minimal date: - - Thu, 02 Sep 2021 23:21:51 GMT + - Tue, 14 Sep 2021 20:35:07 GMT elapsed-time: - - '139' + - '69' expires: - '-1' odata-version: @@ -145,7 +145,7 @@ interactions: preference-applied: - odata.include-annotations="*" request-id: - - 8f03c3cb-0c44-11ec-94e8-74c63bed1137 + - 4169c877-159b-11ec-9f5a-74c63bed1137 strict-transport-security: - max-age=15724800; includeSubDomains vary: @@ -163,12 +163,12 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-search-documents/11.3.0b3 Python/3.9.2 (Windows-10-10.0.19041-SP0) + - azsdk-python-search-documents/11.3.0b4 Python/3.9.2 (Windows-10-10.0.19041-SP0) method: GET uri: https://searche2bf1c71.search.windows.net/skillsets('test-ss')?api-version=2021-04-30-Preview response: body: - string: '{"@odata.context":"https://searche2bf1c71.search.windows.net/$metadata#skillsets/$entity","@odata.etag":"\"0x8D96E6871DB3571\"","name":"test-ss","description":"desc2","skills":[{"@odata.type":"#Microsoft.Skills.Text.EntityRecognitionSkill","name":"#1","description":null,"context":"/document","categories":["Person","Quantity","Organization","URL","Email","Location","DateTime"],"defaultLanguageCode":"en","minimumPrecision":null,"includeTypelessEntities":null,"inputs":[{"name":"text","source":"/document/content","sourceContext":null,"inputs":[]}],"outputs":[{"name":"organizations","targetName":"organizations"}]}],"cognitiveServices":null,"knowledgeStore":null,"encryptionKey":null}' + string: '{"@odata.context":"https://searche2bf1c71.search.windows.net/$metadata#skillsets/$entity","@odata.etag":"\"0x8D977BF243E8A49\"","name":"test-ss","description":"desc2","skills":[{"@odata.type":"#Microsoft.Skills.Text.EntityRecognitionSkill","name":"#1","description":null,"context":"/document","categories":["Person","Quantity","Organization","URL","Email","Location","DateTime"],"defaultLanguageCode":"en","minimumPrecision":null,"includeTypelessEntities":null,"inputs":[{"name":"text","source":"/document/content","sourceContext":null,"inputs":[]}],"outputs":[{"name":"organizations","targetName":"organizations"}]}],"cognitiveServices":null,"knowledgeStore":null,"encryptionKey":null}' headers: cache-control: - no-cache @@ -177,11 +177,11 @@ interactions: content-type: - application/json; odata.metadata=minimal date: - - Thu, 02 Sep 2021 23:21:51 GMT + - Tue, 14 Sep 2021 20:35:07 GMT elapsed-time: - - '13' + - '15' etag: - - W/"0x8D96E6871DB3571" + - W/"0x8D977BF243E8A49" expires: - '-1' odata-version: @@ -191,7 +191,7 @@ interactions: preference-applied: - odata.include-annotations="*" request-id: - - 8f22fc82-0c44-11ec-8c37-74c63bed1137 + - 417b5016-159b-11ec-acf0-74c63bed1137 strict-transport-security: - max-age=15724800; includeSubDomains vary: diff --git a/sdk/search/azure-search-documents/tests/recordings/test_search_index_client_skillset_live.test_create_or_update_skillset_if_unchanged.yaml b/sdk/search/azure-search-documents/tests/recordings/test_search_index_client_skillset_live.test_create_or_update_skillset_if_unchanged.yaml index 13b7ebb493f8..7f3fecf24c0b 100644 --- a/sdk/search/azure-search-documents/tests/recordings/test_search_index_client_skillset_live.test_create_or_update_skillset_if_unchanged.yaml +++ b/sdk/search/azure-search-documents/tests/recordings/test_search_index_client_skillset_live.test_create_or_update_skillset_if_unchanged.yaml @@ -18,12 +18,12 @@ interactions: Prefer: - return=representation User-Agent: - - azsdk-python-search-documents/11.3.0b3 Python/3.9.2 (Windows-10-10.0.19041-SP0) + - azsdk-python-search-documents/11.3.0b4 Python/3.9.2 (Windows-10-10.0.19041-SP0) method: PUT uri: https://search792321ab.search.windows.net/skillsets('test-ss')?api-version=2021-04-30-Preview response: body: - string: '{"@odata.context":"https://search792321ab.search.windows.net/$metadata#skillsets/$entity","@odata.etag":"\"0x8D96E687D620A16\"","name":"test-ss","description":"desc1","skills":[{"@odata.type":"#Microsoft.Skills.Text.EntityRecognitionSkill","name":null,"description":null,"context":null,"categories":[],"defaultLanguageCode":null,"minimumPrecision":null,"includeTypelessEntities":null,"inputs":[{"name":"text","source":"/document/content","sourceContext":null,"inputs":[]}],"outputs":[{"name":"organizations","targetName":"organizations"}]}],"cognitiveServices":null,"knowledgeStore":null,"encryptionKey":null}' + string: '{"@odata.context":"https://search792321ab.search.windows.net/$metadata#skillsets/$entity","@odata.etag":"\"0x8D977CB70C7008A\"","name":"test-ss","description":"desc1","skills":[{"@odata.type":"#Microsoft.Skills.Text.EntityRecognitionSkill","name":null,"description":null,"context":null,"categories":[],"defaultLanguageCode":null,"minimumPrecision":null,"includeTypelessEntities":null,"inputs":[{"name":"text","source":"/document/content","sourceContext":null,"inputs":[]}],"outputs":[{"name":"organizations","targetName":"organizations"}]}],"cognitiveServices":null,"knowledgeStore":null,"encryptionKey":null}' headers: cache-control: - no-cache @@ -32,11 +32,11 @@ interactions: content-type: - application/json; odata.metadata=minimal date: - - Thu, 02 Sep 2021 23:22:10 GMT + - Tue, 14 Sep 2021 22:03:10 GMT elapsed-time: - - '1575' + - '2131' etag: - - W/"0x8D96E687D620A16" + - W/"0x8D977CB70C7008A" expires: - '-1' location: @@ -48,7 +48,7 @@ interactions: preference-applied: - odata.include-annotations="*" request-id: - - 9973fe7a-0c44-11ec-88b9-74c63bed1137 + - 8ca7995e-15a7-11ec-aa34-74c63bed1137 strict-transport-security: - max-age=15724800; includeSubDomains status: @@ -73,12 +73,12 @@ interactions: Prefer: - return=representation User-Agent: - - azsdk-python-search-documents/11.3.0b3 Python/3.9.2 (Windows-10-10.0.19041-SP0) + - azsdk-python-search-documents/11.3.0b4 Python/3.9.2 (Windows-10-10.0.19041-SP0) method: PUT uri: https://search792321ab.search.windows.net/skillsets('test-ss')?api-version=2021-04-30-Preview response: body: - string: '{"@odata.context":"https://search792321ab.search.windows.net/$metadata#skillsets/$entity","@odata.etag":"\"0x8D96E687D79414B\"","name":"test-ss","description":"desc2","skills":[{"@odata.type":"#Microsoft.Skills.Text.EntityRecognitionSkill","name":null,"description":null,"context":null,"categories":[],"defaultLanguageCode":null,"minimumPrecision":null,"includeTypelessEntities":null,"inputs":[{"name":"text","source":"/document/content","sourceContext":null,"inputs":[]}],"outputs":[{"name":"organizations","targetName":"organizations"}]}],"cognitiveServices":null,"knowledgeStore":null,"encryptionKey":null}' + string: '{"@odata.context":"https://search792321ab.search.windows.net/$metadata#skillsets/$entity","@odata.etag":"\"0x8D977CB70D7F380\"","name":"test-ss","description":"desc2","skills":[{"@odata.type":"#Microsoft.Skills.Text.EntityRecognitionSkill","name":null,"description":null,"context":null,"categories":[],"defaultLanguageCode":null,"minimumPrecision":null,"includeTypelessEntities":null,"inputs":[{"name":"text","source":"/document/content","sourceContext":null,"inputs":[]}],"outputs":[{"name":"organizations","targetName":"organizations"}]}],"cognitiveServices":null,"knowledgeStore":null,"encryptionKey":null}' headers: cache-control: - no-cache @@ -87,11 +87,11 @@ interactions: content-type: - application/json; odata.metadata=minimal date: - - Thu, 02 Sep 2021 23:22:10 GMT + - Tue, 14 Sep 2021 22:03:10 GMT elapsed-time: - - '55' + - '61' etag: - - W/"0x8D96E687D79414B" + - W/"0x8D977CB70D7F380" expires: - '-1' odata-version: @@ -101,7 +101,7 @@ interactions: preference-applied: - odata.include-annotations="*" request-id: - - 9a8fb59e-0c44-11ec-b124-74c63bed1137 + - 8e04f88a-15a7-11ec-8243-74c63bed1137 strict-transport-security: - max-age=15724800; includeSubDomains vary: @@ -119,12 +119,12 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-search-documents/11.3.0b3 Python/3.9.2 (Windows-10-10.0.19041-SP0) + - azsdk-python-search-documents/11.3.0b4 Python/3.9.2 (Windows-10-10.0.19041-SP0) method: GET uri: https://search792321ab.search.windows.net/skillsets?api-version=2021-04-30-Preview response: body: - string: '{"@odata.context":"https://search792321ab.search.windows.net/$metadata#skillsets","value":[{"@odata.etag":"\"0x8D96E687D79414B\"","name":"test-ss","description":"desc2","skills":[{"@odata.type":"#Microsoft.Skills.Text.EntityRecognitionSkill","name":"#1","description":null,"context":"/document","categories":["Person","Quantity","Organization","URL","Email","Location","DateTime"],"defaultLanguageCode":"en","minimumPrecision":null,"includeTypelessEntities":null,"inputs":[{"name":"text","source":"/document/content","sourceContext":null,"inputs":[]}],"outputs":[{"name":"organizations","targetName":"organizations"}]}],"cognitiveServices":null,"knowledgeStore":null,"encryptionKey":null}]}' + string: '{"@odata.context":"https://search792321ab.search.windows.net/$metadata#skillsets","value":[{"@odata.etag":"\"0x8D977CB70D7F380\"","name":"test-ss","description":"desc2","skills":[{"@odata.type":"#Microsoft.Skills.Text.EntityRecognitionSkill","name":"#1","description":null,"context":"/document","categories":["Person","Quantity","Organization","URL","Email","Location","DateTime"],"defaultLanguageCode":"en","minimumPrecision":null,"includeTypelessEntities":null,"inputs":[{"name":"text","source":"/document/content","sourceContext":null,"inputs":[]}],"outputs":[{"name":"organizations","targetName":"organizations"}]}],"cognitiveServices":null,"knowledgeStore":null,"encryptionKey":null}]}' headers: cache-control: - no-cache @@ -133,9 +133,9 @@ interactions: content-type: - application/json; odata.metadata=minimal date: - - Thu, 02 Sep 2021 23:22:10 GMT + - Tue, 14 Sep 2021 22:03:10 GMT elapsed-time: - - '38' + - '75' expires: - '-1' odata-version: @@ -145,7 +145,7 @@ interactions: preference-applied: - odata.include-annotations="*" request-id: - - 9aa208dc-0c44-11ec-90cd-74c63bed1137 + - 8e159a1f-15a7-11ec-bf98-74c63bed1137 strict-transport-security: - max-age=15724800; includeSubDomains vary: diff --git a/sdk/search/azure-search-documents/tests/recordings/test_search_index_client_skillset_live.test_create_or_update_skillset_inplace.yaml b/sdk/search/azure-search-documents/tests/recordings/test_search_index_client_skillset_live.test_create_or_update_skillset_inplace.yaml index ac139c653307..1fd4894cba5c 100644 --- a/sdk/search/azure-search-documents/tests/recordings/test_search_index_client_skillset_live.test_create_or_update_skillset_inplace.yaml +++ b/sdk/search/azure-search-documents/tests/recordings/test_search_index_client_skillset_live.test_create_or_update_skillset_inplace.yaml @@ -18,12 +18,12 @@ interactions: Prefer: - return=representation User-Agent: - - azsdk-python-search-documents/11.3.0b3 Python/3.9.2 (Windows-10-10.0.19041-SP0) + - azsdk-python-search-documents/11.3.0b4 Python/3.9.2 (Windows-10-10.0.19041-SP0) method: PUT uri: https://searchd4ef1fac.search.windows.net/skillsets('test-ss')?api-version=2021-04-30-Preview response: body: - string: '{"@odata.context":"https://searchd4ef1fac.search.windows.net/$metadata#skillsets/$entity","@odata.etag":"\"0x8D96E6887F54272\"","name":"test-ss","description":"desc1","skills":[{"@odata.type":"#Microsoft.Skills.Text.EntityRecognitionSkill","name":null,"description":null,"context":null,"categories":[],"defaultLanguageCode":null,"minimumPrecision":null,"includeTypelessEntities":null,"inputs":[{"name":"text","source":"/document/content","sourceContext":null,"inputs":[]}],"outputs":[{"name":"organizations","targetName":"organizations"}]}],"cognitiveServices":null,"knowledgeStore":null,"encryptionKey":null}' + string: '{"@odata.context":"https://searchd4ef1fac.search.windows.net/$metadata#skillsets/$entity","@odata.etag":"\"0x8D977C87A42B270\"","name":"test-ss","description":"desc1","skills":[{"@odata.type":"#Microsoft.Skills.Text.EntityRecognitionSkill","name":null,"description":null,"context":null,"categories":[],"defaultLanguageCode":null,"minimumPrecision":null,"includeTypelessEntities":null,"inputs":[{"name":"text","source":"/document/content","sourceContext":null,"inputs":[]}],"outputs":[{"name":"organizations","targetName":"organizations"}]}],"cognitiveServices":null,"knowledgeStore":null,"encryptionKey":null}' headers: cache-control: - no-cache @@ -32,11 +32,11 @@ interactions: content-type: - application/json; odata.metadata=minimal date: - - Thu, 02 Sep 2021 23:22:28 GMT + - Tue, 14 Sep 2021 21:41:57 GMT elapsed-time: - - '1212' + - '1916' etag: - - W/"0x8D96E6887F54272" + - W/"0x8D977C87A42B270" expires: - '-1' location: @@ -48,7 +48,7 @@ interactions: preference-applied: - odata.include-annotations="*" request-id: - - a4424b77-0c44-11ec-881a-74c63bed1137 + - 963d1c9d-15a4-11ec-9672-74c63bed1137 strict-transport-security: - max-age=15724800; includeSubDomains status: @@ -73,12 +73,12 @@ interactions: Prefer: - return=representation User-Agent: - - azsdk-python-search-documents/11.3.0b3 Python/3.9.2 (Windows-10-10.0.19041-SP0) + - azsdk-python-search-documents/11.3.0b4 Python/3.9.2 (Windows-10-10.0.19041-SP0) method: PUT uri: https://searchd4ef1fac.search.windows.net/skillsets('test-ss')?api-version=2021-04-30-Preview response: body: - string: '{"@odata.context":"https://searchd4ef1fac.search.windows.net/$metadata#skillsets/$entity","@odata.etag":"\"0x8D96E6888074840\"","name":"test-ss","description":"desc2","skills":[{"@odata.type":"#Microsoft.Skills.Text.EntityRecognitionSkill","name":null,"description":null,"context":null,"categories":[],"defaultLanguageCode":null,"minimumPrecision":null,"includeTypelessEntities":null,"inputs":[{"name":"text","source":"/document/content","sourceContext":null,"inputs":[]}],"outputs":[{"name":"organizations","targetName":"organizations"}]}],"cognitiveServices":null,"knowledgeStore":null,"encryptionKey":null}' + string: '{"@odata.context":"https://searchd4ef1fac.search.windows.net/$metadata#skillsets/$entity","@odata.etag":"\"0x8D977C87A5B209B\"","name":"test-ss","description":"desc2","skills":[{"@odata.type":"#Microsoft.Skills.Text.EntityRecognitionSkill","name":null,"description":null,"context":null,"categories":[],"defaultLanguageCode":null,"minimumPrecision":null,"includeTypelessEntities":null,"inputs":[{"name":"text","source":"/document/content","sourceContext":null,"inputs":[]}],"outputs":[{"name":"organizations","targetName":"organizations"}]}],"cognitiveServices":null,"knowledgeStore":null,"encryptionKey":null}' headers: cache-control: - no-cache @@ -87,11 +87,11 @@ interactions: content-type: - application/json; odata.metadata=minimal date: - - Thu, 02 Sep 2021 23:22:28 GMT + - Tue, 14 Sep 2021 21:41:57 GMT elapsed-time: - - '47' + - '79' etag: - - W/"0x8D96E6888074840" + - W/"0x8D977C87A5B209B" expires: - '-1' odata-version: @@ -101,7 +101,7 @@ interactions: preference-applied: - odata.include-annotations="*" request-id: - - a51fabef-0c44-11ec-b060-74c63bed1137 + - 977f2425-15a4-11ec-ac05-74c63bed1137 strict-transport-security: - max-age=15724800; includeSubDomains vary: @@ -119,12 +119,12 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-search-documents/11.3.0b3 Python/3.9.2 (Windows-10-10.0.19041-SP0) + - azsdk-python-search-documents/11.3.0b4 Python/3.9.2 (Windows-10-10.0.19041-SP0) method: GET uri: https://searchd4ef1fac.search.windows.net/skillsets?api-version=2021-04-30-Preview response: body: - string: '{"@odata.context":"https://searchd4ef1fac.search.windows.net/$metadata#skillsets","value":[{"@odata.etag":"\"0x8D96E6888074840\"","name":"test-ss","description":"desc2","skills":[{"@odata.type":"#Microsoft.Skills.Text.EntityRecognitionSkill","name":"#1","description":null,"context":"/document","categories":["Person","Quantity","Organization","URL","Email","Location","DateTime"],"defaultLanguageCode":"en","minimumPrecision":null,"includeTypelessEntities":null,"inputs":[{"name":"text","source":"/document/content","sourceContext":null,"inputs":[]}],"outputs":[{"name":"organizations","targetName":"organizations"}]}],"cognitiveServices":null,"knowledgeStore":null,"encryptionKey":null}]}' + string: '{"@odata.context":"https://searchd4ef1fac.search.windows.net/$metadata#skillsets","value":[{"@odata.etag":"\"0x8D977C87A5B209B\"","name":"test-ss","description":"desc2","skills":[{"@odata.type":"#Microsoft.Skills.Text.EntityRecognitionSkill","name":"#1","description":null,"context":"/document","categories":["Person","Quantity","Organization","URL","Email","Location","DateTime"],"defaultLanguageCode":"en","minimumPrecision":null,"includeTypelessEntities":null,"inputs":[{"name":"text","source":"/document/content","sourceContext":null,"inputs":[]}],"outputs":[{"name":"organizations","targetName":"organizations"}]}],"cognitiveServices":null,"knowledgeStore":null,"encryptionKey":null}]}' headers: cache-control: - no-cache @@ -133,9 +133,9 @@ interactions: content-type: - application/json; odata.metadata=minimal date: - - Thu, 02 Sep 2021 23:22:28 GMT + - Tue, 14 Sep 2021 21:41:57 GMT elapsed-time: - - '36' + - '67' expires: - '-1' odata-version: @@ -145,7 +145,7 @@ interactions: preference-applied: - odata.include-annotations="*" request-id: - - a52fad4e-0c44-11ec-b35f-74c63bed1137 + - 97945ba1-15a4-11ec-95bc-74c63bed1137 strict-transport-security: - max-age=15724800; includeSubDomains vary: @@ -163,12 +163,12 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-search-documents/11.3.0b3 Python/3.9.2 (Windows-10-10.0.19041-SP0) + - azsdk-python-search-documents/11.3.0b4 Python/3.9.2 (Windows-10-10.0.19041-SP0) method: GET uri: https://searchd4ef1fac.search.windows.net/skillsets('test-ss')?api-version=2021-04-30-Preview response: body: - string: '{"@odata.context":"https://searchd4ef1fac.search.windows.net/$metadata#skillsets/$entity","@odata.etag":"\"0x8D96E6888074840\"","name":"test-ss","description":"desc2","skills":[{"@odata.type":"#Microsoft.Skills.Text.EntityRecognitionSkill","name":"#1","description":null,"context":"/document","categories":["Person","Quantity","Organization","URL","Email","Location","DateTime"],"defaultLanguageCode":"en","minimumPrecision":null,"includeTypelessEntities":null,"inputs":[{"name":"text","source":"/document/content","sourceContext":null,"inputs":[]}],"outputs":[{"name":"organizations","targetName":"organizations"}]}],"cognitiveServices":null,"knowledgeStore":null,"encryptionKey":null}' + string: '{"@odata.context":"https://searchd4ef1fac.search.windows.net/$metadata#skillsets/$entity","@odata.etag":"\"0x8D977C87A5B209B\"","name":"test-ss","description":"desc2","skills":[{"@odata.type":"#Microsoft.Skills.Text.EntityRecognitionSkill","name":"#1","description":null,"context":"/document","categories":["Person","Quantity","Organization","URL","Email","Location","DateTime"],"defaultLanguageCode":"en","minimumPrecision":null,"includeTypelessEntities":null,"inputs":[{"name":"text","source":"/document/content","sourceContext":null,"inputs":[]}],"outputs":[{"name":"organizations","targetName":"organizations"}]}],"cognitiveServices":null,"knowledgeStore":null,"encryptionKey":null}' headers: cache-control: - no-cache @@ -177,11 +177,11 @@ interactions: content-type: - application/json; odata.metadata=minimal date: - - Thu, 02 Sep 2021 23:22:28 GMT + - Tue, 14 Sep 2021 21:41:57 GMT elapsed-time: - - '11' + - '14' etag: - - W/"0x8D96E6888074840" + - W/"0x8D977C87A5B209B" expires: - '-1' odata-version: @@ -191,7 +191,7 @@ interactions: preference-applied: - odata.include-annotations="*" request-id: - - a53c5426-0c44-11ec-bf70-74c63bed1137 + - 97a7b2a7-15a4-11ec-aed2-74c63bed1137 strict-transport-security: - max-age=15724800; includeSubDomains vary: diff --git a/sdk/search/azure-search-documents/tests/recordings/test_search_index_client_skillset_live.test_create_skillset.yaml b/sdk/search/azure-search-documents/tests/recordings/test_search_index_client_skillset_live.test_create_skillset.yaml index ebb45a75662b..0e61e15a6ac6 100644 --- a/sdk/search/azure-search-documents/tests/recordings/test_search_index_client_skillset_live.test_create_skillset.yaml +++ b/sdk/search/azure-search-documents/tests/recordings/test_search_index_client_skillset_live.test_create_skillset.yaml @@ -1,51 +1,4 @@ interactions: -- request: - body: null - headers: - Accept: - - application/json;odata.metadata=minimal - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '0' - User-Agent: - - azsdk-python-search-documents/11.3.0b3 Python/3.9.2 (Windows-10-10.0.19041-SP0) - method: DELETE - uri: https://searchd998184f.search.windows.net/skillsets('test-ss')?api-version=2021-04-30-Preview - response: - body: - string: '{"error":{"code":"","message":"No skillset with the name ''test-ss'' - was found in a service named ''searchd998184f''."}}' - headers: - cache-control: - - no-cache - content-language: - - en - content-length: - - '116' - content-type: - - application/json; odata.metadata=minimal - date: - - Thu, 02 Sep 2021 23:22:43 GMT - elapsed-time: - - '38' - expires: - - '-1' - odata-version: - - '4.0' - pragma: - - no-cache - preference-applied: - - odata.include-annotations="*" - request-id: - - adcd5521-0c44-11ec-99c1-74c63bed1137 - strict-transport-security: - - max-age=15724800; includeSubDomains - status: - code: 404 - message: Not Found - request: body: '{"name": "test-ss", "description": "desc", "skills": [{"@odata.type": "#Microsoft.Skills.Text.EntityRecognitionSkill", "description": "Skill Version 1", "inputs": [{"name": "text", "source": "/document/content"}], @@ -73,12 +26,12 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-search-documents/11.3.0b3 Python/3.9.2 (Windows-10-10.0.19041-SP0) + - azsdk-python-search-documents/11.3.0b4 Python/3.9.2 (Windows-10-10.0.19041-SP0) method: POST uri: https://searchd998184f.search.windows.net/skillsets?api-version=2021-04-30-Preview response: body: - string: '{"@odata.context":"https://searchd998184f.search.windows.net/$metadata#skillsets/$entity","@odata.etag":"\"0x8D96E6890F19808\"","name":"test-ss","description":"desc","skills":[{"@odata.type":"#Microsoft.Skills.Text.EntityRecognitionSkill","name":null,"description":"Skill + string: '{"@odata.context":"https://searchd998184f.search.windows.net/$metadata#skillsets/$entity","@odata.etag":"\"0x8D977C13CD227F9\"","name":"test-ss","description":"desc","skills":[{"@odata.type":"#Microsoft.Skills.Text.EntityRecognitionSkill","name":null,"description":"Skill Version 1","context":null,"categories":[],"defaultLanguageCode":null,"minimumPrecision":null,"includeTypelessEntities":true,"inputs":[{"name":"text","source":"/document/content","sourceContext":null,"inputs":[]}],"outputs":[{"name":"organizations","targetName":"organizationsS1"}]},{"@odata.type":"#Microsoft.Skills.Text.V3.EntityRecognitionSkill","name":null,"description":"Skill Version 3","context":null,"categories":[],"defaultLanguageCode":null,"minimumPrecision":null,"modelVersion":"3","inputs":[{"name":"text","source":"/document/content","sourceContext":null,"inputs":[]}],"outputs":[{"name":"organizations","targetName":"organizationsS2"}]},{"@odata.type":"#Microsoft.Skills.Text.SentimentSkill","name":null,"description":"Sentiment V1","context":null,"defaultLanguageCode":null,"inputs":[{"name":"text","source":"/document/content","sourceContext":null,"inputs":[]}],"outputs":[{"name":"score","targetName":"scoreS3"}]},{"@odata.type":"#Microsoft.Skills.Text.V3.SentimentSkill","name":null,"description":"Sentiment @@ -91,11 +44,11 @@ interactions: content-type: - application/json; odata.metadata=minimal date: - - Thu, 02 Sep 2021 23:22:43 GMT + - Tue, 14 Sep 2021 20:50:08 GMT elapsed-time: - - '104' + - '2192' etag: - - W/"0x8D96E6890F19808" + - W/"0x8D977C13CD227F9" expires: - '-1' location: @@ -107,7 +60,7 @@ interactions: preference-applied: - odata.include-annotations="*" request-id: - - ae01135c-0c44-11ec-9160-74c63bed1137 + - 5895d1df-159d-11ec-ab13-74c63bed1137 strict-transport-security: - max-age=15724800; includeSubDomains status: @@ -123,12 +76,12 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-search-documents/11.3.0b3 Python/3.9.2 (Windows-10-10.0.19041-SP0) + - azsdk-python-search-documents/11.3.0b4 Python/3.9.2 (Windows-10-10.0.19041-SP0) method: GET uri: https://searchd998184f.search.windows.net/skillsets?api-version=2021-04-30-Preview response: body: - string: '{"@odata.context":"https://searchd998184f.search.windows.net/$metadata#skillsets","value":[{"@odata.etag":"\"0x8D96E6890F19808\"","name":"test-ss","description":"desc","skills":[{"@odata.type":"#Microsoft.Skills.Text.EntityRecognitionSkill","name":"#1","description":"Skill + string: '{"@odata.context":"https://searchd998184f.search.windows.net/$metadata#skillsets","value":[{"@odata.etag":"\"0x8D977C13CD227F9\"","name":"test-ss","description":"desc","skills":[{"@odata.type":"#Microsoft.Skills.Text.EntityRecognitionSkill","name":"#1","description":"Skill Version 1","context":"/document","categories":["Person","Quantity","Organization","URL","Email","Location","DateTime"],"defaultLanguageCode":"en","minimumPrecision":null,"includeTypelessEntities":true,"inputs":[{"name":"text","source":"/document/content","sourceContext":null,"inputs":[]}],"outputs":[{"name":"organizations","targetName":"organizationsS1"}]},{"@odata.type":"#Microsoft.Skills.Text.V3.EntityRecognitionSkill","name":"#2","description":"Skill Version 3","context":"/document","categories":["Product","Phone Number","Person","Quantity","IP Address","Organization","URL","Email","Event","Skill","Location","PersonType","Address","DateTime"],"defaultLanguageCode":"en","minimumPrecision":null,"modelVersion":"3","inputs":[{"name":"text","source":"/document/content","sourceContext":null,"inputs":[]}],"outputs":[{"name":"organizations","targetName":"organizationsS2"}]},{"@odata.type":"#Microsoft.Skills.Text.SentimentSkill","name":"#3","description":"Sentiment @@ -142,9 +95,9 @@ interactions: content-type: - application/json; odata.metadata=minimal date: - - Thu, 02 Sep 2021 23:22:43 GMT + - Tue, 14 Sep 2021 20:50:08 GMT elapsed-time: - - '40' + - '118' expires: - '-1' odata-version: @@ -154,7 +107,7 @@ interactions: preference-applied: - odata.include-annotations="*" request-id: - - ae1b2686-0c44-11ec-b21b-74c63bed1137 + - 59ff6a42-159d-11ec-b22c-74c63bed1137 strict-transport-security: - max-age=15724800; includeSubDomains vary: diff --git a/sdk/search/azure-search-documents/tests/recordings/test_search_index_client_skillset_live.test_delete_skillset.yaml b/sdk/search/azure-search-documents/tests/recordings/test_search_index_client_skillset_live.test_delete_skillset.yaml index 2938135169a2..6014d767b83b 100644 --- a/sdk/search/azure-search-documents/tests/recordings/test_search_index_client_skillset_live.test_delete_skillset.yaml +++ b/sdk/search/azure-search-documents/tests/recordings/test_search_index_client_skillset_live.test_delete_skillset.yaml @@ -15,12 +15,12 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-search-documents/11.3.0b3 Python/3.9.2 (Windows-10-10.0.19041-SP0) + - azsdk-python-search-documents/11.3.0b4 Python/3.9.2 (Windows-10-10.0.19041-SP0) method: POST uri: https://searchd97c184e.search.windows.net/skillsets?api-version=2021-04-30-Preview response: body: - string: '{"@odata.context":"https://searchd97c184e.search.windows.net/$metadata#skillsets/$entity","@odata.etag":"\"0x8D96E6899DB4B6E\"","name":"test-ss","description":"desc","skills":[{"@odata.type":"#Microsoft.Skills.Text.EntityRecognitionSkill","name":null,"description":null,"context":null,"categories":[],"defaultLanguageCode":null,"minimumPrecision":null,"includeTypelessEntities":null,"inputs":[{"name":"text","source":"/document/content","sourceContext":null,"inputs":[]}],"outputs":[{"name":"organizations","targetName":"organizations"}]}],"cognitiveServices":null,"knowledgeStore":null,"encryptionKey":null}' + string: '{"@odata.context":"https://searchd97c184e.search.windows.net/$metadata#skillsets/$entity","@odata.etag":"\"0x8D977C15538E247\"","name":"test-ss","description":"desc","skills":[{"@odata.type":"#Microsoft.Skills.Text.EntityRecognitionSkill","name":null,"description":null,"context":null,"categories":[],"defaultLanguageCode":null,"minimumPrecision":null,"includeTypelessEntities":null,"inputs":[{"name":"text","source":"/document/content","sourceContext":null,"inputs":[]}],"outputs":[{"name":"organizations","targetName":"organizations"}]}],"cognitiveServices":null,"knowledgeStore":null,"encryptionKey":null}' headers: cache-control: - no-cache @@ -29,11 +29,11 @@ interactions: content-type: - application/json; odata.metadata=minimal date: - - Thu, 02 Sep 2021 23:22:57 GMT + - Tue, 14 Sep 2021 20:50:49 GMT elapsed-time: - - '40' + - '2250' etag: - - W/"0x8D96E6899DB4B6E" + - W/"0x8D977C15538E247" expires: - '-1' location: @@ -45,7 +45,7 @@ interactions: preference-applied: - odata.include-annotations="*" request-id: - - b6c2e706-0c44-11ec-b97f-74c63bed1137 + - 70f8e527-159d-11ec-8600-74c63bed1137 strict-transport-security: - max-age=15724800; includeSubDomains status: @@ -61,12 +61,12 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-search-documents/11.3.0b3 Python/3.9.2 (Windows-10-10.0.19041-SP0) + - azsdk-python-search-documents/11.3.0b4 Python/3.9.2 (Windows-10-10.0.19041-SP0) method: GET uri: https://searchd97c184e.search.windows.net/skillsets?api-version=2021-04-30-Preview response: body: - string: '{"@odata.context":"https://searchd97c184e.search.windows.net/$metadata#skillsets","value":[{"@odata.etag":"\"0x8D96E6899DB4B6E\"","name":"test-ss","description":"desc","skills":[{"@odata.type":"#Microsoft.Skills.Text.EntityRecognitionSkill","name":"#1","description":null,"context":"/document","categories":["Person","Quantity","Organization","URL","Email","Location","DateTime"],"defaultLanguageCode":"en","minimumPrecision":null,"includeTypelessEntities":null,"inputs":[{"name":"text","source":"/document/content","sourceContext":null,"inputs":[]}],"outputs":[{"name":"organizations","targetName":"organizations"}]}],"cognitiveServices":null,"knowledgeStore":null,"encryptionKey":null}]}' + string: '{"@odata.context":"https://searchd97c184e.search.windows.net/$metadata#skillsets","value":[{"@odata.etag":"\"0x8D977C15538E247\"","name":"test-ss","description":"desc","skills":[{"@odata.type":"#Microsoft.Skills.Text.EntityRecognitionSkill","name":"#1","description":null,"context":"/document","categories":["Person","Quantity","Organization","URL","Email","Location","DateTime"],"defaultLanguageCode":"en","minimumPrecision":null,"includeTypelessEntities":null,"inputs":[{"name":"text","source":"/document/content","sourceContext":null,"inputs":[]}],"outputs":[{"name":"organizations","targetName":"organizations"}]}],"cognitiveServices":null,"knowledgeStore":null,"encryptionKey":null}]}' headers: cache-control: - no-cache @@ -75,9 +75,9 @@ interactions: content-type: - application/json; odata.metadata=minimal date: - - Thu, 02 Sep 2021 23:22:57 GMT + - Tue, 14 Sep 2021 20:50:49 GMT elapsed-time: - - '17' + - '92' expires: - '-1' odata-version: @@ -87,7 +87,7 @@ interactions: preference-applied: - odata.include-annotations="*" request-id: - - b704089c-0c44-11ec-8ba2-74c63bed1137 + - 72684c35-159d-11ec-9149-74c63bed1137 strict-transport-security: - max-age=15724800; includeSubDomains vary: @@ -107,7 +107,7 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-search-documents/11.3.0b3 Python/3.9.2 (Windows-10-10.0.19041-SP0) + - azsdk-python-search-documents/11.3.0b4 Python/3.9.2 (Windows-10-10.0.19041-SP0) method: DELETE uri: https://searchd97c184e.search.windows.net/skillsets('test-ss')?api-version=2021-04-30-Preview response: @@ -117,15 +117,15 @@ interactions: cache-control: - no-cache date: - - Thu, 02 Sep 2021 23:22:57 GMT + - Tue, 14 Sep 2021 20:50:49 GMT elapsed-time: - - '25' + - '40' expires: - '-1' pragma: - no-cache request-id: - - b710b746-0c44-11ec-83f1-74c63bed1137 + - 727d7ca6-159d-11ec-9b97-74c63bed1137 strict-transport-security: - max-age=15724800; includeSubDomains status: @@ -141,7 +141,7 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-search-documents/11.3.0b3 Python/3.9.2 (Windows-10-10.0.19041-SP0) + - azsdk-python-search-documents/11.3.0b4 Python/3.9.2 (Windows-10-10.0.19041-SP0) method: GET uri: https://searchd97c184e.search.windows.net/skillsets?api-version=2021-04-30-Preview response: @@ -155,9 +155,9 @@ interactions: content-type: - application/json; odata.metadata=minimal date: - - Thu, 02 Sep 2021 23:22:58 GMT + - Tue, 14 Sep 2021 20:50:49 GMT elapsed-time: - - '6' + - '9' expires: - '-1' odata-version: @@ -167,7 +167,7 @@ interactions: preference-applied: - odata.include-annotations="*" request-id: - - b71bb2dd-0c44-11ec-b98e-74c63bed1137 + - 728a490a-159d-11ec-bc59-74c63bed1137 strict-transport-security: - max-age=15724800; includeSubDomains vary: diff --git a/sdk/search/azure-search-documents/tests/recordings/test_search_index_client_skillset_live.test_delete_skillset_if_unchanged.yaml b/sdk/search/azure-search-documents/tests/recordings/test_search_index_client_skillset_live.test_delete_skillset_if_unchanged.yaml index 7bfa6376fc3d..86f1bf8de282 100644 --- a/sdk/search/azure-search-documents/tests/recordings/test_search_index_client_skillset_live.test_delete_skillset_if_unchanged.yaml +++ b/sdk/search/azure-search-documents/tests/recordings/test_search_index_client_skillset_live.test_delete_skillset_if_unchanged.yaml @@ -15,12 +15,12 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-search-documents/11.3.0b3 Python/3.9.2 (Windows-10-10.0.19041-SP0) + - azsdk-python-search-documents/11.3.0b4 Python/3.9.2 (Windows-10-10.0.19041-SP0) method: POST uri: https://search3a191d88.search.windows.net/skillsets?api-version=2021-04-30-Preview response: body: - string: '{"@odata.context":"https://search3a191d88.search.windows.net/$metadata#skillsets/$entity","@odata.etag":"\"0x8D96E68A28D3F51\"","name":"test-ss","description":"desc","skills":[{"@odata.type":"#Microsoft.Skills.Text.EntityRecognitionSkill","name":null,"description":null,"context":null,"categories":[],"defaultLanguageCode":null,"minimumPrecision":null,"includeTypelessEntities":null,"inputs":[{"name":"text","source":"/document/content","sourceContext":null,"inputs":[]}],"outputs":[{"name":"organizations","targetName":"organizations"}]}],"cognitiveServices":null,"knowledgeStore":null,"encryptionKey":null}' + string: '{"@odata.context":"https://search3a191d88.search.windows.net/$metadata#skillsets/$entity","@odata.etag":"\"0x8D977C34C46233E\"","name":"test-ss","description":"desc","skills":[{"@odata.type":"#Microsoft.Skills.Text.EntityRecognitionSkill","name":null,"description":null,"context":null,"categories":[],"defaultLanguageCode":null,"minimumPrecision":null,"includeTypelessEntities":null,"inputs":[{"name":"text","source":"/document/content","sourceContext":null,"inputs":[]}],"outputs":[{"name":"organizations","targetName":"organizations"}]}],"cognitiveServices":null,"knowledgeStore":null,"encryptionKey":null}' headers: cache-control: - no-cache @@ -29,11 +29,11 @@ interactions: content-type: - application/json; odata.metadata=minimal date: - - Thu, 02 Sep 2021 23:23:12 GMT + - Tue, 14 Sep 2021 21:04:53 GMT elapsed-time: - - '85' + - '2226' etag: - - W/"0x8D96E68A28D3F51" + - W/"0x8D977C34C46233E" expires: - '-1' location: @@ -45,7 +45,7 @@ interactions: preference-applied: - odata.include-annotations="*" request-id: - - bf84a894-0c44-11ec-a6bb-74c63bed1137 + - 680ad3a0-159f-11ec-9d34-74c63bed1137 strict-transport-security: - max-age=15724800; includeSubDomains status: @@ -70,12 +70,12 @@ interactions: Prefer: - return=representation User-Agent: - - azsdk-python-search-documents/11.3.0b3 Python/3.9.2 (Windows-10-10.0.19041-SP0) + - azsdk-python-search-documents/11.3.0b4 Python/3.9.2 (Windows-10-10.0.19041-SP0) method: PUT uri: https://search3a191d88.search.windows.net/skillsets('test-ss')?api-version=2021-04-30-Preview response: body: - string: '{"@odata.context":"https://search3a191d88.search.windows.net/$metadata#skillsets/$entity","@odata.etag":"\"0x8D96E68A29C3723\"","name":"test-ss","description":"updated","skills":[{"@odata.type":"#Microsoft.Skills.Text.EntityRecognitionSkill","name":null,"description":null,"context":null,"categories":[],"defaultLanguageCode":null,"minimumPrecision":null,"includeTypelessEntities":null,"inputs":[{"name":"text","source":"/document/content","sourceContext":null,"inputs":[]}],"outputs":[{"name":"organizations","targetName":"organizations"}]}],"cognitiveServices":null,"knowledgeStore":null,"encryptionKey":null}' + string: '{"@odata.context":"https://search3a191d88.search.windows.net/$metadata#skillsets/$entity","@odata.etag":"\"0x8D977C34C593993\"","name":"test-ss","description":"updated","skills":[{"@odata.type":"#Microsoft.Skills.Text.EntityRecognitionSkill","name":null,"description":null,"context":null,"categories":[],"defaultLanguageCode":null,"minimumPrecision":null,"includeTypelessEntities":null,"inputs":[{"name":"text","source":"/document/content","sourceContext":null,"inputs":[]}],"outputs":[{"name":"organizations","targetName":"organizations"}]}],"cognitiveServices":null,"knowledgeStore":null,"encryptionKey":null}' headers: cache-control: - no-cache @@ -84,11 +84,11 @@ interactions: content-type: - application/json; odata.metadata=minimal date: - - Thu, 02 Sep 2021 23:23:12 GMT + - Tue, 14 Sep 2021 21:04:53 GMT elapsed-time: - - '51' + - '68' etag: - - W/"0x8D96E68A29C3723" + - W/"0x8D977C34C593993" expires: - '-1' odata-version: @@ -98,7 +98,7 @@ interactions: preference-applied: - odata.include-annotations="*" request-id: - - bfb5a199-0c44-11ec-9ff5-74c63bed1137 + - 69782ec6-159f-11ec-ab05-74c63bed1137 strict-transport-security: - max-age=15724800; includeSubDomains vary: @@ -118,9 +118,9 @@ interactions: Content-Length: - '0' If-Match: - - '"0x8D96E68A28D3F51"' + - '"0x8D977C34C46233E"' User-Agent: - - azsdk-python-search-documents/11.3.0b3 Python/3.9.2 (Windows-10-10.0.19041-SP0) + - azsdk-python-search-documents/11.3.0b4 Python/3.9.2 (Windows-10-10.0.19041-SP0) method: DELETE uri: https://search3a191d88.search.windows.net/skillsets('test-ss')?api-version=2021-04-30-Preview response: @@ -138,9 +138,9 @@ interactions: content-type: - application/json; odata.metadata=minimal date: - - Thu, 02 Sep 2021 23:23:12 GMT + - Tue, 14 Sep 2021 21:04:53 GMT elapsed-time: - - '13' + - '20' expires: - '-1' odata-version: @@ -150,7 +150,7 @@ interactions: preference-applied: - odata.include-annotations="*" request-id: - - bfc58d8e-0c44-11ec-b48e-74c63bed1137 + - 698a3438-159f-11ec-8044-74c63bed1137 strict-transport-security: - max-age=15724800; includeSubDomains status: diff --git a/sdk/search/azure-search-documents/tests/recordings/test_search_index_client_skillset_live.test_get_skillset.yaml b/sdk/search/azure-search-documents/tests/recordings/test_search_index_client_skillset_live.test_get_skillset.yaml index c772ef5316ed..71191fd5bb71 100644 --- a/sdk/search/azure-search-documents/tests/recordings/test_search_index_client_skillset_live.test_get_skillset.yaml +++ b/sdk/search/azure-search-documents/tests/recordings/test_search_index_client_skillset_live.test_get_skillset.yaml @@ -15,12 +15,12 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-search-documents/11.3.0b3 Python/3.9.2 (Windows-10-10.0.19041-SP0) + - azsdk-python-search-documents/11.3.0b4 Python/3.9.2 (Windows-10-10.0.19041-SP0) method: POST uri: https://search9274171b.search.windows.net/skillsets?api-version=2021-04-30-Preview response: body: - string: '{"@odata.context":"https://search9274171b.search.windows.net/$metadata#skillsets/$entity","@odata.etag":"\"0x8D96E68AB8A58B0\"","name":"test-ss","description":"desc","skills":[{"@odata.type":"#Microsoft.Skills.Text.EntityRecognitionSkill","name":null,"description":null,"context":null,"categories":[],"defaultLanguageCode":null,"minimumPrecision":null,"includeTypelessEntities":null,"inputs":[{"name":"text","source":"/document/content","sourceContext":null,"inputs":[]}],"outputs":[{"name":"organizations","targetName":"organizations"}]}],"cognitiveServices":null,"knowledgeStore":null,"encryptionKey":null}' + string: '{"@odata.context":"https://search9274171b.search.windows.net/$metadata#skillsets/$entity","@odata.etag":"\"0x8D977C3591A39FF\"","name":"test-ss","description":"desc","skills":[{"@odata.type":"#Microsoft.Skills.Text.EntityRecognitionSkill","name":null,"description":null,"context":null,"categories":[],"defaultLanguageCode":null,"minimumPrecision":null,"includeTypelessEntities":null,"inputs":[{"name":"text","source":"/document/content","sourceContext":null,"inputs":[]}],"outputs":[{"name":"organizations","targetName":"organizations"}]}],"cognitiveServices":null,"knowledgeStore":null,"encryptionKey":null}' headers: cache-control: - no-cache @@ -29,11 +29,11 @@ interactions: content-type: - application/json; odata.metadata=minimal date: - - Thu, 02 Sep 2021 23:23:27 GMT + - Tue, 14 Sep 2021 21:05:14 GMT elapsed-time: - - '66' + - '2058' etag: - - W/"0x8D96E68AB8A58B0" + - W/"0x8D977C3591A39FF" expires: - '-1' location: @@ -45,7 +45,7 @@ interactions: preference-applied: - odata.include-annotations="*" request-id: - - c8807327-0c44-11ec-8f54-74c63bed1137 + - 74f3cf64-159f-11ec-886a-74c63bed1137 strict-transport-security: - max-age=15724800; includeSubDomains status: @@ -61,12 +61,12 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-search-documents/11.3.0b3 Python/3.9.2 (Windows-10-10.0.19041-SP0) + - azsdk-python-search-documents/11.3.0b4 Python/3.9.2 (Windows-10-10.0.19041-SP0) method: GET uri: https://search9274171b.search.windows.net/skillsets?api-version=2021-04-30-Preview response: body: - string: '{"@odata.context":"https://search9274171b.search.windows.net/$metadata#skillsets","value":[{"@odata.etag":"\"0x8D96E68AB8A58B0\"","name":"test-ss","description":"desc","skills":[{"@odata.type":"#Microsoft.Skills.Text.EntityRecognitionSkill","name":"#1","description":null,"context":"/document","categories":["Person","Quantity","Organization","URL","Email","Location","DateTime"],"defaultLanguageCode":"en","minimumPrecision":null,"includeTypelessEntities":null,"inputs":[{"name":"text","source":"/document/content","sourceContext":null,"inputs":[]}],"outputs":[{"name":"organizations","targetName":"organizations"}]}],"cognitiveServices":null,"knowledgeStore":null,"encryptionKey":null}]}' + string: '{"@odata.context":"https://search9274171b.search.windows.net/$metadata#skillsets","value":[{"@odata.etag":"\"0x8D977C3591A39FF\"","name":"test-ss","description":"desc","skills":[{"@odata.type":"#Microsoft.Skills.Text.EntityRecognitionSkill","name":"#1","description":null,"context":"/document","categories":["Person","Quantity","Organization","URL","Email","Location","DateTime"],"defaultLanguageCode":"en","minimumPrecision":null,"includeTypelessEntities":null,"inputs":[{"name":"text","source":"/document/content","sourceContext":null,"inputs":[]}],"outputs":[{"name":"organizations","targetName":"organizations"}]}],"cognitiveServices":null,"knowledgeStore":null,"encryptionKey":null}]}' headers: cache-control: - no-cache @@ -75,9 +75,9 @@ interactions: content-type: - application/json; odata.metadata=minimal date: - - Thu, 02 Sep 2021 23:23:27 GMT + - Tue, 14 Sep 2021 21:05:14 GMT elapsed-time: - - '16' + - '82' expires: - '-1' odata-version: @@ -87,7 +87,7 @@ interactions: preference-applied: - odata.include-annotations="*" request-id: - - c8b283be-0c44-11ec-a75e-74c63bed1137 + - 764ad3c7-159f-11ec-84fe-74c63bed1137 strict-transport-security: - max-age=15724800; includeSubDomains vary: @@ -105,12 +105,12 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-search-documents/11.3.0b3 Python/3.9.2 (Windows-10-10.0.19041-SP0) + - azsdk-python-search-documents/11.3.0b4 Python/3.9.2 (Windows-10-10.0.19041-SP0) method: GET uri: https://search9274171b.search.windows.net/skillsets('test-ss')?api-version=2021-04-30-Preview response: body: - string: '{"@odata.context":"https://search9274171b.search.windows.net/$metadata#skillsets/$entity","@odata.etag":"\"0x8D96E68AB8A58B0\"","name":"test-ss","description":"desc","skills":[{"@odata.type":"#Microsoft.Skills.Text.EntityRecognitionSkill","name":"#1","description":null,"context":"/document","categories":["Person","Quantity","Organization","URL","Email","Location","DateTime"],"defaultLanguageCode":"en","minimumPrecision":null,"includeTypelessEntities":null,"inputs":[{"name":"text","source":"/document/content","sourceContext":null,"inputs":[]}],"outputs":[{"name":"organizations","targetName":"organizations"}]}],"cognitiveServices":null,"knowledgeStore":null,"encryptionKey":null}' + string: '{"@odata.context":"https://search9274171b.search.windows.net/$metadata#skillsets/$entity","@odata.etag":"\"0x8D977C3591A39FF\"","name":"test-ss","description":"desc","skills":[{"@odata.type":"#Microsoft.Skills.Text.EntityRecognitionSkill","name":"#1","description":null,"context":"/document","categories":["Person","Quantity","Organization","URL","Email","Location","DateTime"],"defaultLanguageCode":"en","minimumPrecision":null,"includeTypelessEntities":null,"inputs":[{"name":"text","source":"/document/content","sourceContext":null,"inputs":[]}],"outputs":[{"name":"organizations","targetName":"organizations"}]}],"cognitiveServices":null,"knowledgeStore":null,"encryptionKey":null}' headers: cache-control: - no-cache @@ -119,11 +119,11 @@ interactions: content-type: - application/json; odata.metadata=minimal date: - - Thu, 02 Sep 2021 23:23:27 GMT + - Tue, 14 Sep 2021 21:05:14 GMT elapsed-time: - - '10' + - '17' etag: - - W/"0x8D96E68AB8A58B0" + - W/"0x8D977C3591A39FF" expires: - '-1' odata-version: @@ -133,7 +133,7 @@ interactions: preference-applied: - odata.include-annotations="*" request-id: - - c8bbb142-0c44-11ec-bccc-74c63bed1137 + - 765f5d84-159f-11ec-be78-74c63bed1137 strict-transport-security: - max-age=15724800; includeSubDomains vary: diff --git a/sdk/search/azure-search-documents/tests/recordings/test_search_index_client_skillset_live.test_get_skillsets.yaml b/sdk/search/azure-search-documents/tests/recordings/test_search_index_client_skillset_live.test_get_skillsets.yaml index 68bbda1f01c7..38903fbd94fc 100644 --- a/sdk/search/azure-search-documents/tests/recordings/test_search_index_client_skillset_live.test_get_skillsets.yaml +++ b/sdk/search/azure-search-documents/tests/recordings/test_search_index_client_skillset_live.test_get_skillsets.yaml @@ -16,12 +16,12 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-search-documents/11.3.0b3 Python/3.9.2 (Windows-10-10.0.19041-SP0) + - azsdk-python-search-documents/11.3.0b4 Python/3.9.2 (Windows-10-10.0.19041-SP0) method: POST uri: https://searchaa02178e.search.windows.net/skillsets?api-version=2021-04-30-Preview response: body: - string: '{"@odata.context":"https://searchaa02178e.search.windows.net/$metadata#skillsets/$entity","@odata.etag":"\"0x8D96E68B42CDF74\"","name":"test-ss-1","description":"desc1","skills":[{"@odata.type":"#Microsoft.Skills.Text.EntityRecognitionSkill","name":null,"description":null,"context":null,"categories":[],"defaultLanguageCode":null,"minimumPrecision":null,"includeTypelessEntities":null,"inputs":[{"name":"text","source":"/document/content","sourceContext":null,"inputs":[]}],"outputs":[{"name":"organizations","targetName":"organizations"}]}],"cognitiveServices":null,"knowledgeStore":null,"encryptionKey":null}' + string: '{"@odata.context":"https://searchaa02178e.search.windows.net/$metadata#skillsets/$entity","@odata.etag":"\"0x8D977C3656261D4\"","name":"test-ss-1","description":"desc1","skills":[{"@odata.type":"#Microsoft.Skills.Text.EntityRecognitionSkill","name":null,"description":null,"context":null,"categories":[],"defaultLanguageCode":null,"minimumPrecision":null,"includeTypelessEntities":null,"inputs":[{"name":"text","source":"/document/content","sourceContext":null,"inputs":[]}],"outputs":[{"name":"organizations","targetName":"organizations"}]}],"cognitiveServices":null,"knowledgeStore":null,"encryptionKey":null}' headers: cache-control: - no-cache @@ -30,11 +30,11 @@ interactions: content-type: - application/json; odata.metadata=minimal date: - - Thu, 02 Sep 2021 23:23:42 GMT + - Tue, 14 Sep 2021 21:05:35 GMT elapsed-time: - - '51' + - '2127' etag: - - W/"0x8D96E68B42CDF74" + - W/"0x8D977C3656261D4" expires: - '-1' location: @@ -46,7 +46,7 @@ interactions: preference-applied: - odata.include-annotations="*" request-id: - - d12da940-0c44-11ec-8a11-74c63bed1137 + - 8133f1db-159f-11ec-9110-74c63bed1137 strict-transport-security: - max-age=15724800; includeSubDomains status: @@ -69,12 +69,12 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-search-documents/11.3.0b3 Python/3.9.2 (Windows-10-10.0.19041-SP0) + - azsdk-python-search-documents/11.3.0b4 Python/3.9.2 (Windows-10-10.0.19041-SP0) method: POST uri: https://searchaa02178e.search.windows.net/skillsets?api-version=2021-04-30-Preview response: body: - string: '{"@odata.context":"https://searchaa02178e.search.windows.net/$metadata#skillsets/$entity","@odata.etag":"\"0x8D96E68B43AC58E\"","name":"test-ss-2","description":"desc2","skills":[{"@odata.type":"#Microsoft.Skills.Text.EntityRecognitionSkill","name":null,"description":null,"context":null,"categories":[],"defaultLanguageCode":null,"minimumPrecision":null,"includeTypelessEntities":null,"inputs":[{"name":"text","source":"/document/content","sourceContext":null,"inputs":[]}],"outputs":[{"name":"organizations","targetName":"organizations"}]}],"cognitiveServices":null,"knowledgeStore":null,"encryptionKey":null}' + string: '{"@odata.context":"https://searchaa02178e.search.windows.net/$metadata#skillsets/$entity","@odata.etag":"\"0x8D977C365713281\"","name":"test-ss-2","description":"desc2","skills":[{"@odata.type":"#Microsoft.Skills.Text.EntityRecognitionSkill","name":null,"description":null,"context":null,"categories":[],"defaultLanguageCode":null,"minimumPrecision":null,"includeTypelessEntities":null,"inputs":[{"name":"text","source":"/document/content","sourceContext":null,"inputs":[]}],"outputs":[{"name":"organizations","targetName":"organizations"}]}],"cognitiveServices":null,"knowledgeStore":null,"encryptionKey":null}' headers: cache-control: - no-cache @@ -83,11 +83,11 @@ interactions: content-type: - application/json; odata.metadata=minimal date: - - Thu, 02 Sep 2021 23:23:42 GMT + - Tue, 14 Sep 2021 21:05:35 GMT elapsed-time: - - '46' + - '50' etag: - - W/"0x8D96E68B43AC58E" + - W/"0x8D977C365713281" expires: - '-1' location: @@ -99,7 +99,7 @@ interactions: preference-applied: - odata.include-annotations="*" request-id: - - d1554d7a-0c44-11ec-9dfb-74c63bed1137 + - 829337aa-159f-11ec-9b0e-74c63bed1137 strict-transport-security: - max-age=15724800; includeSubDomains status: @@ -115,12 +115,12 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-search-documents/11.3.0b3 Python/3.9.2 (Windows-10-10.0.19041-SP0) + - azsdk-python-search-documents/11.3.0b4 Python/3.9.2 (Windows-10-10.0.19041-SP0) method: GET uri: https://searchaa02178e.search.windows.net/skillsets?api-version=2021-04-30-Preview response: body: - string: '{"@odata.context":"https://searchaa02178e.search.windows.net/$metadata#skillsets","value":[{"@odata.etag":"\"0x8D96E68B42CDF74\"","name":"test-ss-1","description":"desc1","skills":[{"@odata.type":"#Microsoft.Skills.Text.EntityRecognitionSkill","name":"#1","description":null,"context":"/document","categories":["Person","Quantity","Organization","URL","Email","Location","DateTime"],"defaultLanguageCode":"en","minimumPrecision":null,"includeTypelessEntities":null,"inputs":[{"name":"text","source":"/document/content","sourceContext":null,"inputs":[]}],"outputs":[{"name":"organizations","targetName":"organizations"}]}],"cognitiveServices":null,"knowledgeStore":null,"encryptionKey":null},{"@odata.etag":"\"0x8D96E68B43AC58E\"","name":"test-ss-2","description":"desc2","skills":[{"@odata.type":"#Microsoft.Skills.Text.EntityRecognitionSkill","name":"#1","description":null,"context":"/document","categories":["Person","Quantity","Organization","URL","Email","Location","DateTime"],"defaultLanguageCode":"en","minimumPrecision":null,"includeTypelessEntities":null,"inputs":[{"name":"text","source":"/document/content","sourceContext":null,"inputs":[]}],"outputs":[{"name":"organizations","targetName":"organizations"}]}],"cognitiveServices":null,"knowledgeStore":null,"encryptionKey":null}]}' + string: '{"@odata.context":"https://searchaa02178e.search.windows.net/$metadata#skillsets","value":[{"@odata.etag":"\"0x8D977C3656261D4\"","name":"test-ss-1","description":"desc1","skills":[{"@odata.type":"#Microsoft.Skills.Text.EntityRecognitionSkill","name":"#1","description":null,"context":"/document","categories":["Person","Quantity","Organization","URL","Email","Location","DateTime"],"defaultLanguageCode":"en","minimumPrecision":null,"includeTypelessEntities":null,"inputs":[{"name":"text","source":"/document/content","sourceContext":null,"inputs":[]}],"outputs":[{"name":"organizations","targetName":"organizations"}]}],"cognitiveServices":null,"knowledgeStore":null,"encryptionKey":null},{"@odata.etag":"\"0x8D977C365713281\"","name":"test-ss-2","description":"desc2","skills":[{"@odata.type":"#Microsoft.Skills.Text.EntityRecognitionSkill","name":"#1","description":null,"context":"/document","categories":["Person","Quantity","Organization","URL","Email","Location","DateTime"],"defaultLanguageCode":"en","minimumPrecision":null,"includeTypelessEntities":null,"inputs":[{"name":"text","source":"/document/content","sourceContext":null,"inputs":[]}],"outputs":[{"name":"organizations","targetName":"organizations"}]}],"cognitiveServices":null,"knowledgeStore":null,"encryptionKey":null}]}' headers: cache-control: - no-cache @@ -129,9 +129,9 @@ interactions: content-type: - application/json; odata.metadata=minimal date: - - Thu, 02 Sep 2021 23:23:42 GMT + - Tue, 14 Sep 2021 21:05:35 GMT elapsed-time: - - '23' + - '95' expires: - '-1' odata-version: @@ -141,7 +141,7 @@ interactions: preference-applied: - odata.include-annotations="*" request-id: - - d163c491-0c44-11ec-8ccb-74c63bed1137 + - 82a27edc-159f-11ec-9983-74c63bed1137 strict-transport-security: - max-age=15724800; includeSubDomains vary: diff --git a/sdk/search/azure-search-documents/tests/search_service_preparer.py b/sdk/search/azure-search-documents/tests/search_service_preparer.py index 4bef849223ac..ada16aafc06c 100644 --- a/sdk/search/azure-search-documents/tests/search_service_preparer.py +++ b/sdk/search/azure-search-documents/tests/search_service_preparer.py @@ -90,7 +90,7 @@ def create_resource(self, name, **kwargs): # create the search service from azure.mgmt.search.models import SearchService, Sku - service_config = SearchService(location="West US", sku=Sku(name="free")) + service_config = SearchService(location="West US", sku=Sku(name="basic")) resource = self.mgmt_client.services.begin_create_or_update( group_name, self.service_name, service_config ) diff --git a/sdk/search/azure-search-documents/tests/test_search_index_client_skillset_live.py b/sdk/search/azure-search-documents/tests/test_search_index_client_skillset_live.py index cd586a816deb..b0fc016d2633 100644 --- a/sdk/search/azure-search-documents/tests/test_search_index_client_skillset_live.py +++ b/sdk/search/azure-search-documents/tests/test_search_index_client_skillset_live.py @@ -47,20 +47,17 @@ def test_create_skillset(self, api_key, endpoint, index_name, **kwargs): s1 = EntityRecognitionSkill(inputs=[InputFieldMappingEntry(name="text", source="/document/content")], outputs=[OutputFieldMappingEntry(name="organizations", target_name="organizationsS1")], description="Skill Version 1", - model_version="1", include_typeless_entities=True) s2 = EntityRecognitionSkill(inputs=[InputFieldMappingEntry(name="text", source="/document/content")], outputs=[OutputFieldMappingEntry(name="organizations", target_name="organizationsS2")], skill_version=EntityRecognitionSkillVersion.LATEST, description="Skill Version 3", - model_version="3", - include_typeless_entities=True) + model_version="3") s3 = SentimentSkill(inputs=[InputFieldMappingEntry(name="text", source="/document/content")], outputs=[OutputFieldMappingEntry(name="score", target_name="scoreS3")], skill_version=SentimentSkillVersion.V1, - description="Sentiment V1", - include_opinion_mining=True) + description="Sentiment V1") s4 = SentimentSkill(inputs=[InputFieldMappingEntry(name="text", source="/document/content")], outputs=[OutputFieldMappingEntry(name="confidenceScores", target_name="scoreS4")], @@ -74,8 +71,6 @@ def test_create_skillset(self, api_key, endpoint, index_name, **kwargs): skillset = SearchIndexerSkillset(name=name, skills=list([s1, s2, s3, s4, s5]), description="desc") - client.delete_skillset(name) - dict_skills = [skill.as_dict() for skill in skillset.skills] skillset.skills = dict_skills @@ -99,6 +94,36 @@ def test_create_skillset(self, api_key, endpoint, index_name, **kwargs): assert len(client.get_skillsets()) == 1 + + def test_create_skillset_validation(self, **kwargs): + with pytest.raises(ValueError) as err: + client = SearchIndexerClient("fake_endpoint", AzureKeyCredential("fake_key")) + name = "test-ss" + + s1 = EntityRecognitionSkill(inputs=[InputFieldMappingEntry(name="text", source="/document/content")], + outputs=[OutputFieldMappingEntry(name="organizations", target_name="organizationsS1")], + description="Skill Version 1", + model_version="1", + include_typeless_entities=True) + + s2 = EntityRecognitionSkill(inputs=[InputFieldMappingEntry(name="text", source="/document/content")], + outputs=[OutputFieldMappingEntry(name="organizations", target_name="organizationsS2")], + skill_version=EntityRecognitionSkillVersion.LATEST, + description="Skill Version 3", + model_version="3", + include_typeless_entities=True) + s3 = SentimentSkill(inputs=[InputFieldMappingEntry(name="text", source="/document/content")], + outputs=[OutputFieldMappingEntry(name="score", target_name="scoreS3")], + skill_version=SentimentSkillVersion.V1, + description="Sentiment V1", + include_opinion_mining=True) + skillset = SearchIndexerSkillset(name=name, skills=list([s1, s2, s3]), description="desc") + client.create_skillset(skillset) + assert 'include_typeless_entities' in str(err.value) + assert 'model_version' in str(err.value) + assert 'include_opinion_mining' in str(err.value) + + @SearchResourceGroupPreparer(random_name_enabled=True) @SearchServicePreparer(schema=SCHEMA, index_batch=BATCH) def test_delete_skillset(self, api_key, endpoint, index_name, **kwargs): From c80e26e42735085d82afad9b09f862f37da323ef Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Wed, 15 Sep 2021 12:45:42 -0700 Subject: [PATCH 62/85] Sync eng/common directory with azure-sdk-tools for PR 2009 (#20672) * Skip PSModule caching in container jobs * Add succeeded check to condition Co-authored-by: Wes Haggard Co-authored-by: Ben Broderick Phillips Co-authored-by: Ben Broderick Phillips Co-authored-by: Wes Haggard --- eng/common/pipelines/templates/steps/cache-ps-modules.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/eng/common/pipelines/templates/steps/cache-ps-modules.yml b/eng/common/pipelines/templates/steps/cache-ps-modules.yml index 563dba40294f..ac136803164f 100644 --- a/eng/common/pipelines/templates/steps/cache-ps-modules.yml +++ b/eng/common/pipelines/templates/steps/cache-ps-modules.yml @@ -3,8 +3,12 @@ steps: . ./eng/common/scripts/Helpers/PSModule-Helpers.ps1 Write-Host "##vso[task.setvariable variable=CachedPSModulePath]$global:CurrentUserModulePath" displayName: Set PS Modules Cache Directory + # Containers should bake modules into the image to save on pipeline time + condition: and(succeeded(), eq(variables['Container'], '')) - task: Cache@2 inputs: key: 'PSModulePath | $(CacheSalt) | $(Agent.OS) | $(Build.SourcesDirectory)/eng/common/scripts/Import-AzModules.ps1' path: $(CachedPSModulePath) - displayName: Cache PS Modules \ No newline at end of file + displayName: Cache PS Modules + # Containers should bake modules into the image to save on pipeline time + condition: and(succeeded(), eq(variables['Container'], '')) From 87e0f99a6b6949dcf459d2cc6ef67547bab7f342 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Wed, 15 Sep 2021 15:32:41 -0700 Subject: [PATCH 63/85] Sync eng/common directory with azure-sdk-tools for PR 2016 (#20706) * Make ServiceName optional for verify-changelog In cases like go where we don't pass a service name having this default to "not-specified" breaks things so we should allow for ServiceName and/or ServiceDirectory to be empty. * Put quotes around the strings to allow for empty Co-authored-by: Wes Haggard --- eng/common/pipelines/templates/steps/verify-changelog.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/eng/common/pipelines/templates/steps/verify-changelog.yml b/eng/common/pipelines/templates/steps/verify-changelog.yml index 8173c8ec599b..887ad1a97d90 100644 --- a/eng/common/pipelines/templates/steps/verify-changelog.yml +++ b/eng/common/pipelines/templates/steps/verify-changelog.yml @@ -4,7 +4,7 @@ parameters: default: 'not-specified' - name: ServiceName type: string - default: 'not-specified' + default: '' - name: ServiceDirectory type: string default: '' @@ -17,10 +17,10 @@ steps: inputs: filePath: $(Build.SourcesDirectory)/eng/common/scripts/Verify-ChangeLog.ps1 arguments: > - -PackageName ${{ parameters.PackageName }} - -ServiceDirectory ${{ coalesce(parameters.ServiceDirectory, parameters.ServiceName) }} + -PackageName '${{ parameters.PackageName }}' + -ServiceDirectory '${{ coalesce(parameters.ServiceDirectory, parameters.ServiceName) }}' -ForRelease $${{ parameters.ForRelease }} pwsh: true workingDirectory: $(Pipeline.Workspace) displayName: Verify ChangeLogEntry for ${{ parameters.PackageName }} - continueOnError: false \ No newline at end of file + continueOnError: false From 81c6aa0a21c542f65827304b6aa313d7af7e4910 Mon Sep 17 00:00:00 2001 From: Xiang Yan Date: Thu, 16 Sep 2021 08:33:08 -0700 Subject: [PATCH 64/85] add troubleshoot doc (#20684) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add troubleshoot doc * fix typo * update * update * update * Update sdk/identity/azure-identity/Troubleshoot.md Co-authored-by: McCoy Patiño <39780829+mccoyp@users.noreply.github.com> * Update sdk/identity/azure-identity/Troubleshoot.md Co-authored-by: McCoy Patiño <39780829+mccoyp@users.noreply.github.com> * Update sdk/identity/azure-identity/Troubleshoot.md Co-authored-by: McCoy Patiño <39780829+mccoyp@users.noreply.github.com> * Update sdk/identity/azure-identity/Troubleshoot.md Co-authored-by: McCoy Patiño <39780829+mccoyp@users.noreply.github.com> * Update sdk/identity/azure-identity/Troubleshoot.md Co-authored-by: McCoy Patiño <39780829+mccoyp@users.noreply.github.com> * Update sdk/identity/azure-identity/Troubleshoot.md Co-authored-by: McCoy Patiño <39780829+mccoyp@users.noreply.github.com> * Update sdk/identity/azure-identity/Troubleshoot.md Co-authored-by: McCoy Patiño <39780829+mccoyp@users.noreply.github.com> * Update sdk/identity/azure-identity/Troubleshoot.md Co-authored-by: McCoy Patiño <39780829+mccoyp@users.noreply.github.com> * Update sdk/identity/azure-identity/Troubleshoot.md Co-authored-by: McCoy Patiño <39780829+mccoyp@users.noreply.github.com> * Update sdk/identity/azure-identity/Troubleshoot.md Co-authored-by: McCoy Patiño <39780829+mccoyp@users.noreply.github.com> * Update sdk/identity/azure-identity/Troubleshoot.md Co-authored-by: Charles Lowell * Update sdk/identity/azure-identity/Troubleshoot.md Co-authored-by: Charles Lowell * Update sdk/identity/azure-identity/Troubleshoot.md Co-authored-by: Charles Lowell * Update sdk/identity/azure-identity/Troubleshoot.md Co-authored-by: Charles Lowell * Update sdk/identity/azure-identity/Troubleshoot.md Co-authored-by: Charles Lowell * Update sdk/identity/azure-identity/Troubleshoot.md Co-authored-by: Charles Lowell * Update sdk/identity/azure-identity/Troubleshoot.md Co-authored-by: Charles Lowell * Update sdk/identity/azure-identity/Troubleshoot.md Co-authored-by: Charles Lowell * Update sdk/identity/azure-identity/Troubleshoot.md Co-authored-by: Charles Lowell * Update Troubleshoot.md * update error log Co-authored-by: McCoy Patiño <39780829+mccoyp@users.noreply.github.com> Co-authored-by: Charles Lowell --- sdk/identity/azure-identity/Troubleshoot.md | 218 ++++++++++++++++++ .../azure/identity/_credentials/azure_cli.py | 5 +- .../identity/_credentials/azure_powershell.py | 5 +- .../azure/identity/_credentials/chained.py | 4 +- .../identity/_credentials/environment.py | 4 +- .../identity/_credentials/managed_identity.py | 7 +- .../identity/aio/_credentials/azure_cli.py | 5 +- .../aio/_credentials/azure_powershell.py | 10 +- .../identity/aio/_credentials/chained.py | 4 +- .../identity/aio/_credentials/environment.py | 4 +- .../aio/_credentials/managed_identity.py | 7 +- 11 files changed, 262 insertions(+), 11 deletions(-) create mode 100644 sdk/identity/azure-identity/Troubleshoot.md diff --git a/sdk/identity/azure-identity/Troubleshoot.md b/sdk/identity/azure-identity/Troubleshoot.md new file mode 100644 index 000000000000..0b6b938a4168 --- /dev/null +++ b/sdk/identity/azure-identity/Troubleshoot.md @@ -0,0 +1,218 @@ +# Troubleshooting Azure Identity Authentication Issues + +The Azure Identity SDK offers various `TokenCredential` implementations. These implementations typically throw `CredentialUnavailableError` and `ClientAuthenticationError` exceptions. +The `CredentialUnavailableError` indicates that the credential cannot execute in the current environment setup due to lack of required configuration. +The `ClientAuthenticationError` indicates that the credential was able to run/execute but ran into an authentication issue from the server's end. This can happen due to invalid configuration/details passed in to the credential at construction time. +This troubleshooting guide covers mitigation steps to resolve these exceptions thrown by various `TokenCredential` implementations in the Azure Identity Python client library. + +## Table of contents + +- [Troubleshooting Default Azure Credential Authentication Issues](#troubleshooting-default-azure-credential-authentication-issues) +- [Troubleshooting Environment Credential Authentication Issues](#troubleshooting-environment-credential-authentication-issues) +- [Troubleshooting Service Principal Authentication Issues](#troubleshooting-service-principal-authentication-issues) +- [Troubleshooting Username Password Authentication Issues](#troubleshooting-username-password-authentication-issues) +- [Troubleshooting Managed Identity Authentication Issues](#troubleshooting-managed-identity-authentication-issues) +- [Troubleshooting Visual Studio Code Authentication Issues](#troubleshooting-visual-studio-code-authentication-issues) +- [Troubleshooting Azure CLI Authentication Issues](#troubleshooting-azure-cli-authentication-issues) +- [Troubleshooting Azure Powershell Authentication Issues](#troubleshooting-azure-powershell-authentication-issues) + +## Troubleshooting Default Azure Credential Authentication Issues + +### Credential Unavailable Error + +The `DefaultAzureCredential` attempts to retrieve an access token by sequentially invoking a chain of credentials. The `ClientAuthenticationError` in this scenario signifies that all the credentials in the chain failed to retrieve the token in the current environment setup/configuration. You need to follow the configuration instructions for the respective credential you're looking to use via `DefaultAzureCredential` chain, so that the credential can work in your environment. + +Please follow the configuration instructions in the `Credential Unavailable Error` section of the troubleshooting guidelines below for the respective credential/authentication type you want to use via `DefaultAzureCredential`: + +| Credential Type | Troubleshoot Guide | +| --- | --- | +| Environment Credential | [Environment Credential Troubleshooting Guide](#troubleshooting-environment-credential-authentication-issues) | +| Managed Identity Credential | [Managed Identity Troubleshooting Guide](#troubleshooting-managed-identity-authentication-issues) | +| Visual Studio Code Credential | [Visual Studio Code Troubleshooting Guide](#troubleshooting-visual-studio-code-authentication-issues) | +| Azure CLI Credential | [Azure CLI Troubleshooting Guide](#troubleshooting-azure-cli-authentication-issues) | +| Azure Powershell Credential | [Azure Powershell Troubleshooting Guide](#troubleshooting-azure-powershell-authentication-issues) | + +## Troubleshooting Environment Credential Authentication Issues + +### Credential Unavailable Error + +#### Environment variables not configured + +The `EnvironmentCredential` supports Service Principal authentication and Username + Password authentication. To utilize the desired way of authentication via `EnvironmentCredential`, you need to ensure the environment variables below are configured properly and the application is able to read them. + +##### Service principal with secret + +| Variable Name | Value | +| --- | --- | +AZURE_CLIENT_ID | ID of an Azure Active Directory application. | +AZURE_TENANT_ID |ID of the application's Azure Active Directory tenant. | +AZURE_CLIENT_SECRET | One of the application's client secrets. | + +##### Service principal with certificate + +| Variable name | Value | +| --- | --- | +AZURE_CLIENT_ID |ID of an Azure Active Directory application. | +AZURE_TENANT_ID | ID of the application's Azure Active Directory tenant. | +AZURE_CLIENT_CERTIFICATE_PATH | Path to a PEM-encoded or PKCS12 certificate file including private key (without password protection). | + +##### Username and password + +| Variable name | Value | +| --- | --- | +AZURE_CLIENT_ID | ID of an Azure Active Directory application. | +AZURE_USERNAME | A username (usually an email address). | +AZURE_PASSWORD | The associated password for the given username. | + +### Client Authentication Error + +The `EnvironmentCredential` supports Service Principal authentication and Username + Password authentication. +Please follow the troubleshooting guidelines below for the respective authentication which you tried and failed. + +| Authentication Type | Troubleshoot Guide | +| --- | --- | +| Service Principal | [Service Principal Auth Troubleshooting Guide](#troubleshooting-username-password-authentication-issues) | +| Username Password | [Username Password Auth Troubleshooting Guide](#troubleshooting-username-password-authentication-issues) | + +## Troubleshooting Username Password Authentication Issues + +### Two Factor Authentication Required Error + +The `UsernamePassword` credential works only for users whose two factor authentication has been disabled in Azure Active Directory. You can change the Multi Factor Authentication in Azure Portal by following the steps [here](https://docs.microsoft.com/azure/active-directory/authentication/howto-mfa-userstates#change-the-status-for-a-user). + +## Troubleshooting Service Principal Authentication Issues + +### Illegal/Invalid Argument Issues + +#### Client Id + +The Client Id is the application Id of the registered application / service principal in Azure Active Directory. +It is a required parameter for `ClientSecretCredential` and `ClientCertificateCredential`. If you have already created your service principal +then you can retrieve the client/app id by following the instructions [here](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal#get-tenant-and-app-id-values-for-signing-in). + +#### Tenant Id + +The tenant id is te Global Unique Identifier (GUID) that identifies your organization. It is a required parameter for +`ClientSecretCredential` and `ClientCertificateCredential`. If you have already created your service principal +then you can retrieve the client/app id by following the instructions [here](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal#get-tenant-and-app-id-values-for-signing-in). + +### Client Secret Credential Issues + +#### Client Secret Argument + +The client secret is the secret string that the application uses to prove its identity when requesting a token; this can also can be referred to as an application password. +If you have already created a service principal you can follow the instructions [here](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal#option-2-create-a-new-application-secret) to create a client secret for your application. + +### Client Certificate Credential Issues + +#### Client Certificate Argument + +The `Client Certificate Credential` accepts `pfx` and `pem` certificates. The certificate needs to be associated with your registered application/service principal. To create and associate a certificate with your registered app, please follow the instructions [here](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal#option-1-upload-a-certificate). + +### Create a new service principal + +Please follow the instructions [here](https://docs.microsoft.com/cli/azure/create-an-azure-service-principal-azure-cli) to create a new service principal. + +## Troubleshooting Managed Identity Authentication Issues + +### Credential Unavailable Error + +#### Connection Timed Out / Connection could not be established / Target Environment could not be determined + +Currently azure-identity supports [managed identity authentication](https://docs.microsoft.com/azure/active-directory/managed-identities-azure-resources/overview) +in the below listed Azure services; ensure you're running your application on one of these resources and have enabled the Managed Identity on +them by following the instructions at their configuration links below. + +Azure Service | Managed Identity Configuration +--- | --- | +[Azure Virtual Machines](https://docs.microsoft.com/azure/active-directory/managed-identities-azure-resources/how-to-use-vm-token) | [Configuration Instructions](https://docs.microsoft.com/azure/active-directory/managed-identities-azure-resources/qs-configure-portal-windows-vm) +[Azure App Service](https://docs.microsoft.com/azure/app-service/overview-managed-identity?tabs=python) | [Configuration Instructions](https://docs.microsoft.com/azure/app-service/overview-managed-identity?tabs=python) +[Azure Kubernetes Service](https://docs.microsoft.com/azure/aks/use-managed-identity) | [Configuration Instructions](https://docs.microsoft.com/azure/aks/use-managed-identity) +[Azure Cloud Shell](https://docs.microsoft.com/azure/cloud-shell/msi-authorization) | | +[Azure Arc](https://docs.microsoft.com/azure/azure-arc/servers/managed-identity-authentication) | [Configuration Instructions](https://docs.microsoft.com/azure/azure-arc/servers/security-overview#using-a-managed-identity-with-arc-enabled-servers) +[Azure Service Fabric](https://docs.microsoft.com/azure/service-fabric/concepts-managed-identity) | [Configuration Instructions](https://docs.microsoft.com/azure/service-fabric/configure-existing-cluster-enable-managed-identity-token-service) + +## Troubleshooting Visual Studio Code Authentication Issues + +### Credential Unavailable Error + +#### Failed To Read VS Code Credentials / Authenticate via Azure Tools plugin in VS Code + +THe `VS Code Credential` failed to read the credential details from the cache. + +The Visual Studio Code authentication is handled by an integration with the Azure Account extension. +To use this form of authentication, ensure that you have installed the Azure Account extension, +then use View > Command Palette to execute the Azure: Sign In command. This command opens a browser window and displays a page that allows you +to sign in to Azure. After you've completed the login process, you can close the browser as directed. Running your application +(either in the debugger or anywhere on the development machine) will use the credential from your sign-in. + +If you already had the Azure Account extension installed and had logged in to your account. Then try logging out and logging in again, as +that will re-populate the cache on the disk and potentially mitigate the error you're getting. + +#### Msal Interaction Required Error + +THe `VS Code Credential` was able to read the cached credentials from the cache but the cached token is likely expired. +Log into the Azure Account extension by via View > Command Palette to execute the Azure: Sign In command in the VS Code IDE. + +#### ADFS Tenant Not Supported + +The ADFS Tenants are not supported via the Azure Account extension in VS Code currently. +The supported clouds are: + +Azure Cloud | Cloud Authority Host +--- | --- | +AZURE PUBLIC CLOUD | https://login.microsoftonline.com/ +AZURE GERMANY | https://login.microsoftonline.de/ +AZURE CHINA | https://login.chinacloudapi.cn/ +AZURE GOVERNMENT | https://login.microsoftonline.us/ + +## Troubleshooting Azure CLI Authentication Issues + +### Credential Unavailable Error + +#### Azure CLI Not Installed + +To use Azure CLI credential, the Azure CLI needs to be installed, please follow the instructions [here](https://docs.microsoft.com/cli/azure/install-azure-cli) +to install it for your platform and then try running the credential again. + +#### Azure account not logged in + +`AzureCliCredential` authenticates as the identity currently logged in to Azure CLI. +You need to login to your account in Azure CLI via `az login` command. You can further read instructions to [Sign in with Azure CLI](https://docs.microsoft.com/cli/azure/authenticate-azure-cli). +Once logged in try running the credential again. + +### Illegal State + +#### Safe Working Directory Not Located + +The `Azure CLI Credential` was not able to locate a value for System Environment property `SystemRoot` to execute in. +Please ensure the `SystemRoot` environment variable is configured to a safe working directory and then try running the credential again. + +## Troubleshooting Azure Powershell Authentication Issues + +### Credential Unavailable Error + +#### Powershell not installed + +Please ensure PowerShell is installed on your platform by following the instructions [here](https://docs.microsoft.com/powershell/scripting/install/installing-powershell?view=powershell-7.1). + +#### Azure Az Module Not Installed + +Please follow the instructions [here](https://docs.microsoft.com/powershell/azure/install-az-ps) +to install the Azure Az PowerShell module. + +#### Azure account not logged in + +Log in via the `Connect-AzAccount` command. See [Sign in with Azure Powershell](https://docs.microsoft.com/powershell/azure/authenticate-azureps) for more information. + +#### Deserialization error + +The `Azure Powershell Credential` was able to retrieve a response from the Azure Powershell when attempting to get an access token but failed +to parse that response. +In your local powershell window, run the following command to ensure that Azure Powershell is returning an access token in correct format. + +```pwsh +Get-AzAccessToken -ResourceUrl "" +``` + +In the event above command is not working properly, follow the instructions to resolve the Azure Powershell issue being faced and then try running the credential again. diff --git a/sdk/identity/azure-identity/azure/identity/_credentials/azure_cli.py b/sdk/identity/azure-identity/azure/identity/_credentials/azure_cli.py index 24e160d768c4..d535a286adb7 100644 --- a/sdk/identity/azure-identity/azure/identity/_credentials/azure_cli.py +++ b/sdk/identity/azure-identity/azure/identity/_credentials/azure_cli.py @@ -83,7 +83,10 @@ def get_token(self, *scopes, **kwargs): token = parse_token(output) if not token: sanitized_output = sanitize_output(output) - raise ClientAuthenticationError(message="Unexpected output from Azure CLI: '{}'".format(sanitized_output)) + raise ClientAuthenticationError( + message="Unexpected output from Azure CLI: '{}'. \n" + "To mitigate this issue, please refer to the troubleshooting guidelines here at " + "https://aka.ms/azsdk/python/identity/azclicredential/troubleshoot.".format(sanitized_output)) return token diff --git a/sdk/identity/azure-identity/azure/identity/_credentials/azure_powershell.py b/sdk/identity/azure-identity/azure/identity/_credentials/azure_powershell.py index 8ce657c6e261..17869fbde253 100644 --- a/sdk/identity/azure-identity/azure/identity/_credentials/azure_powershell.py +++ b/sdk/identity/azure-identity/azure/identity/_credentials/azure_powershell.py @@ -119,7 +119,10 @@ def run_command_line(command_line): # (handling Exception here because subprocess.SubprocessError and .TimeoutExpired were added in 3.3) if proc and not proc.returncode: proc.kill() - error = CredentialUnavailableError(message="Failed to invoke PowerShell") + error = CredentialUnavailableError( + message="Failed to invoke PowerShell.\n" + "To mitigate this issue, please refer to the troubleshooting guidelines here at " + "https://aka.ms/azsdk/python/identity/powershellcredential/troubleshoot.") six.raise_from(error, ex) raise_for_error(proc.returncode, stdout, stderr) diff --git a/sdk/identity/azure-identity/azure/identity/_credentials/chained.py b/sdk/identity/azure-identity/azure/identity/_credentials/chained.py index 35936acb7679..6002b87d82f5 100644 --- a/sdk/identity/azure-identity/azure/identity/_credentials/chained.py +++ b/sdk/identity/azure-identity/azure/identity/_credentials/chained.py @@ -101,6 +101,8 @@ def get_token(self, *scopes, **kwargs): # pylint:disable=unused-argument within_credential_chain.set(False) attempts = _get_error_message(history) - message = self.__class__.__name__ + " failed to retrieve a token from the included credentials." + attempts + message = self.__class__.__name__ + " failed to retrieve a token from the included credentials." + attempts \ + + "\nTo mitigate this issue, please refer to the troubleshooting guidelines here at " \ + "https://aka.ms/azsdk/python/identity/defaultazurecredential/troubleshoot." _LOGGER.warning(message) raise ClientAuthenticationError(message=message) diff --git a/sdk/identity/azure-identity/azure/identity/_credentials/environment.py b/sdk/identity/azure-identity/azure/identity/_credentials/environment.py index c874646218de..8d0e7401d8b2 100644 --- a/sdk/identity/azure-identity/azure/identity/_credentials/environment.py +++ b/sdk/identity/azure-identity/azure/identity/_credentials/environment.py @@ -132,7 +132,9 @@ def get_token(self, *scopes, **kwargs): # pylint:disable=unused-argument """ if not self._credential: message = ( - "EnvironmentCredential authentication unavailable. Environment variables are not fully configured." + "EnvironmentCredential authentication unavailable. Environment variables are not fully configured.\n" + "Visit https://aka.ms/azsdk/python/identity/environmentcredential/troubleshoot to troubleshoot." + "this issue." ) raise CredentialUnavailableError(message=message) return self._credential.get_token(*scopes, **kwargs) diff --git a/sdk/identity/azure-identity/azure/identity/_credentials/managed_identity.py b/sdk/identity/azure-identity/azure/identity/_credentials/managed_identity.py index d602c4d4d4e3..c1ce731dd21c 100644 --- a/sdk/identity/azure-identity/azure/identity/_credentials/managed_identity.py +++ b/sdk/identity/azure-identity/azure/identity/_credentials/managed_identity.py @@ -110,5 +110,10 @@ def get_token(self, *scopes, **kwargs): """ if not self._credential: - raise CredentialUnavailableError(message="No managed identity endpoint found.") + raise CredentialUnavailableError( + message="No managed identity endpoint found. \n" + "The Target Azure platform could not be determined from environment variables. \n" + "Visit https://aka.ms/azsdk/python/identity/managedidentitycredential/troubleshoot to " + "troubleshoot this issue." + ) return self._credential.get_token(*scopes, **kwargs) diff --git a/sdk/identity/azure-identity/azure/identity/aio/_credentials/azure_cli.py b/sdk/identity/azure-identity/azure/identity/aio/_credentials/azure_cli.py index d01a3619462d..944a2211d023 100644 --- a/sdk/identity/azure-identity/azure/identity/aio/_credentials/azure_cli.py +++ b/sdk/identity/azure-identity/azure/identity/aio/_credentials/azure_cli.py @@ -71,7 +71,10 @@ async def get_token(self, *scopes: str, **kwargs: "Any") -> "AccessToken": token = parse_token(output) if not token: sanitized_output = sanitize_output(output) - raise ClientAuthenticationError(message="Unexpected output from Azure CLI: '{}'".format(sanitized_output)) + raise ClientAuthenticationError( + message="Unexpected output from Azure CLI: '{}'. \n" + "To mitigate this issue, please refer to the troubleshooting guidelines here at " + "https://aka.ms/azsdk/python/identity/azclicredential/troubleshoot.".format(sanitized_output)) return token diff --git a/sdk/identity/azure-identity/azure/identity/aio/_credentials/azure_powershell.py b/sdk/identity/azure-identity/azure/identity/aio/_credentials/azure_powershell.py index c99433bb13d4..cfb3cd4331a1 100644 --- a/sdk/identity/azure-identity/azure/identity/aio/_credentials/azure_powershell.py +++ b/sdk/identity/azure-identity/azure/identity/aio/_credentials/azure_powershell.py @@ -83,11 +83,17 @@ async def run_command_line(command_line: "List[str]") -> str: except OSError as ex: # failed to execute "cmd" or "/bin/sh"; Azure PowerShell may or may not be installed - error = CredentialUnavailableError(message='Failed to execute "{}"'.format(command_line[0])) + error = CredentialUnavailableError( + message='Failed to execute "{}".\n' + 'To mitigate this issue, please refer to the troubleshooting guidelines here at ' + 'https://aka.ms/azsdk/python/identity/powershellcredential/troubleshoot.'.format(command_line[0])) raise error from ex except asyncio.TimeoutError as ex: proc.kill() - raise CredentialUnavailableError(message="Timed out waiting for Azure PowerShell") from ex + raise CredentialUnavailableError( + message="Timed out waiting for Azure PowerShell.\n" + "To mitigate this issue, please refer to the troubleshooting guidelines here at " + "https://aka.ms/azsdk/python/identity/powershellcredential/troubleshoot.") from ex decoded_stdout = stdout.decode() diff --git a/sdk/identity/azure-identity/azure/identity/aio/_credentials/chained.py b/sdk/identity/azure-identity/azure/identity/aio/_credentials/chained.py index c0e86ebc3397..c0a6a9ba5b89 100644 --- a/sdk/identity/azure-identity/azure/identity/aio/_credentials/chained.py +++ b/sdk/identity/azure-identity/azure/identity/aio/_credentials/chained.py @@ -78,5 +78,7 @@ async def get_token(self, *scopes: str, **kwargs: "Any") -> "AccessToken": within_credential_chain.set(False) attempts = _get_error_message(history) - message = self.__class__.__name__ + " failed to retrieve a token from the included credentials." + attempts + message = self.__class__.__name__ + " failed to retrieve a token from the included credentials." + attempts \ + + "\nTo mitigate this issue, please refer to the troubleshooting guidelines here at " \ + "https://aka.ms/azsdk/python/identity/defaultazurecredential/troubleshoot." raise ClientAuthenticationError(message=message) diff --git a/sdk/identity/azure-identity/azure/identity/aio/_credentials/environment.py b/sdk/identity/azure-identity/azure/identity/aio/_credentials/environment.py index 61a0dc795c89..d4c0bdff2047 100644 --- a/sdk/identity/azure-identity/azure/identity/aio/_credentials/environment.py +++ b/sdk/identity/azure-identity/azure/identity/aio/_credentials/environment.py @@ -100,7 +100,9 @@ async def get_token(self, *scopes: str, **kwargs: "Any") -> "AccessToken": """ if not self._credential: message = ( - "EnvironmentCredential authentication unavailable. Environment variables are not fully configured." + "EnvironmentCredential authentication unavailable. Environment variables are not fully configured.\n" + "Visit https://aka.ms/azsdk/python/identity/environmentcredential/troubleshoot to troubleshoot." + "this issue." ) raise CredentialUnavailableError(message=message) return await self._credential.get_token(*scopes, **kwargs) diff --git a/sdk/identity/azure-identity/azure/identity/aio/_credentials/managed_identity.py b/sdk/identity/azure-identity/azure/identity/aio/_credentials/managed_identity.py index dabb1be0b21f..caaf8a120398 100644 --- a/sdk/identity/azure-identity/azure/identity/aio/_credentials/managed_identity.py +++ b/sdk/identity/azure-identity/azure/identity/aio/_credentials/managed_identity.py @@ -103,5 +103,10 @@ async def get_token(self, *scopes: str, **kwargs: "Any") -> "AccessToken": :raises ~azure.identity.CredentialUnavailableError: managed identity isn't available in the hosting environment """ if not self._credential: - raise CredentialUnavailableError(message="No managed identity endpoint found.") + raise CredentialUnavailableError( + message="No managed identity endpoint found. \n" + "The Target Azure platform could not be determined from environment variables. " + "Visit https://aka.ms/azsdk/python/identity/managedidentitycredential/troubleshoot to " + "troubleshoot this issue." + ) return await self._credential.get_token(*scopes, **kwargs) From 44e2acfd2e429fc08269823ddccd0aa90090c6da Mon Sep 17 00:00:00 2001 From: Scott Beddall <45376673+scbedd@users.noreply.github.com> Date: Thu, 16 Sep 2021 10:57:23 -0700 Subject: [PATCH 65/85] protobuf to handle python 2.7 issues (#20725) --- eng/test_tools.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/eng/test_tools.txt b/eng/test_tools.txt index b7f808980878..27baeebf2d50 100644 --- a/eng/test_tools.txt +++ b/eng/test_tools.txt @@ -10,6 +10,7 @@ pytest-xdist==1.32.0 # we pin coverage to 4.5.4 because there is an bug with `pytest-cov`. the generated coverage files cannot be `coverage combine`ed coverage==4.5.4 bandit==1.6.2 +protobuf==3.17.3; python_version == '2.7' # locking packages defined as deps from azure-sdk-tools or azure-devtools pytoml==0.1.21 From e1166605fcbb6b71b39333de9b836225818aa77a Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Thu, 16 Sep 2021 12:33:48 -0700 Subject: [PATCH 66/85] Sync eng/common directory with azure-sdk-tools for PR 2011 (#20702) * Common pipeline template and script to detect API changes * Cahnges as per review comments * Review comment changes * CCahgnes as per review comments * Show warning for list of failed packages to detect API changes * Apply suggestions from code review Co-authored-by: Wes Haggard Co-authored-by: praveenkuttappan Co-authored-by: praveenkuttappan <55455725+praveenkuttappan@users.noreply.github.com> Co-authored-by: Wes Haggard --- .../templates/steps/detect-api-changes.yml | 19 +++ eng/common/scripts/Detect-Api-Changes.ps1 | 119 ++++++++++++++++++ 2 files changed, 138 insertions(+) create mode 100644 eng/common/pipelines/templates/steps/detect-api-changes.yml create mode 100644 eng/common/scripts/Detect-Api-Changes.ps1 diff --git a/eng/common/pipelines/templates/steps/detect-api-changes.yml b/eng/common/pipelines/templates/steps/detect-api-changes.yml new file mode 100644 index 000000000000..de4dd5675417 --- /dev/null +++ b/eng/common/pipelines/templates/steps/detect-api-changes.yml @@ -0,0 +1,19 @@ +parameters: + ArtifactPath: $(Build.ArtifactStagingDirectory) + Artifacts: [] + +steps: + - task: Powershell@2 + inputs: + filePath: $(Build.SourcesDirectory)/eng/common/scripts/Detect-Api-Changes.ps1 + arguments: > + -ArtifactList ('${{ convertToJson(parameters.Artifacts) }}' | ConvertFrom-Json | Select-Object Name) + -ArtifactPath ${{parameters.ArtifactPath}} + -CommitSha '$(Build.SourceVersion)' + -BuildId $(Build.BuildId) + -PullRequestNumber $(System.PullRequest.PullRequestNumber) + -RepoFullName $(Build.Repository.Name) + pwsh: true + workingDirectory: $(Pipeline.Workspace) + displayName: Detect API changes + condition: and(succeededOrFailed(), eq(variables['Build.Reason'],'PullRequest')) diff --git a/eng/common/scripts/Detect-Api-Changes.ps1 b/eng/common/scripts/Detect-Api-Changes.ps1 new file mode 100644 index 000000000000..375210171794 --- /dev/null +++ b/eng/common/scripts/Detect-Api-Changes.ps1 @@ -0,0 +1,119 @@ +[CmdletBinding()] +Param ( + [Parameter(Mandatory=$True)] + [string] $ArtifactPath, + [Parameter(Mandatory=$True)] + [string] $PullRequestNumber, + [Parameter(Mandatory=$True)] + [string] $BuildId, + [Parameter(Mandatory=$True)] + [string] $CommitSha, + [Parameter(Mandatory=$True)] + [array] $ArtifactList, + [string] $RepoFullName = "", + [string] $ArtifactName = "packages", + [string] $APIViewUri = "https://apiview.dev/PullRequest/DetectApiChanges" +) + +# Submit API review request and return status whether current revision is approved or pending or failed to create review +function Submit-Request($filePath) +{ + $repoName = $RepoFullName + if (!$repoName) { + $repoName = "azure/azure-sdk-for-$LanguageShort" + } + $query = [System.Web.HttpUtility]::ParseQueryString('') + $query.Add('artifactName', $ArtifactName) + $query.Add('buildId', $BuildId) + $query.Add('filePath', $filePath) + $query.Add('commitSha', $CommitSha) + $query.Add('repoName', $repoName) + $query.Add('pullRequestNumber', $PullRequestNumber) + $uri = [System.UriBuilder]$APIViewUri + $uri.query = $query.toString() + Write-Host "Request URI: $($uri.Uri.OriginalString)" + try + { + $Response = Invoke-WebRequest -Method 'GET' -Uri $uri.Uri -MaximumRetryCount 3 + $StatusCode = $Response.StatusCode + } + catch + { + Write-Host "Error $StatusCode - Exception details: $($_.Exception.Response)" + $StatusCode = $_.Exception.Response.StatusCode + } + + return $StatusCode +} + +function Should-Process-Package($pkgPath, $packageName) +{ + $pkg = Split-Path -Leaf $pkgPath + $configFileDir = Join-Path -Path $ArtifactPath "PackageInfo" + $pkgPropPath = Join-Path -Path $configFileDir "$packageName.json" + if (!(Test-Path $pkgPropPath)) + { + Write-Host " Package property file path $($pkgPropPath) is invalid." + return $False + } + # Get package info from json file created before updating version to daily dev + $pkgInfo = Get-Content $pkgPropPath | ConvertFrom-Json + Write-Host "SDK Type: $($pkgInfo.SdkType)" + return ($pkgInfo.SdkType -eq "client" -and $pkgInfo.IsNewSdk) +} + +function Log-Input-Params() +{ + Write-Host "Artifact Path: $($ArtifactPath)" + Write-Host "Artifact Name: $($ArtifactName)" + Write-Host "PullRequest Number: $($PullRequestNumber)" + Write-Host "BuildId: $($BuildId)" + Write-Host "Language: $($Language)" + Write-Host "Commit SHA: $($CommitSha)" + Write-Host "Repo Name: $($RepoFullName)" +} + +. (Join-Path $PSScriptRoot common.ps1) +Log-Input-Params + +if (!($FindArtifactForApiReviewFn -and (Test-Path "Function:$FindArtifactForApiReviewFn"))) +{ + Write-Host "The function for 'FindArtifactForApiReviewFn' was not found.` + Make sure it is present in eng/scripts/Language-Settings.ps1 and referenced in eng/common/scripts/common.ps1.` + See https://github.com/Azure/azure-sdk-tools/blob/main/doc/common/common_engsys.md#code-structure" + exit 1 +} + +$responses = @{} +foreach ($artifact in $ArtifactList) +{ + Write-Host "Processing $($artifact.name)" + $packages = &$FindArtifactForApiReviewFn $ArtifactPath $artifact.name + if ($packages) + { + $pkgPath = $packages.Values[0] + if (Should-Process-Package -pkgPath $pkgPath -packageName $artifact.name) + { + $filePath = $pkgPath.Replace($ArtifactPath , "").Replace("\", "/") + $respCode = Submit-Request -filePath $filePath + if ($respCode -ne '200') + { + $responses[$artifact.name] = $respCode + } + } + } + else + { + Write-Host "No package is found in artifact path to find API changes for $($artifact.name)" + } +} + +if ($responses) +{ + # Will update this with a link to wiki on how to resolve + Write-Warning "API change detection failed for following packages. Please check above for package level error details." + foreach($pkg in $responses.keys) + { + Write-Host "$pkg failed with $($responses[$pkg]) code" + } +} From ddf49b1129dcc42499c6ad25eb4e413fed113846 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?McCoy=20Pati=C3=B1o?= <39780829+mccoyp@users.noreply.github.com> Date: Thu, 16 Sep 2021 15:27:08 -0700 Subject: [PATCH 67/85] [Test proxy] Add migration guide (#20469) --- doc/dev/test_proxy_migration_guide.md | 176 ++++++++++++++++++ .../devtools_testutils/proxy_testcase.py | 4 + 2 files changed, 180 insertions(+) create mode 100644 doc/dev/test_proxy_migration_guide.md diff --git a/doc/dev/test_proxy_migration_guide.md b/doc/dev/test_proxy_migration_guide.md new file mode 100644 index 000000000000..ff31703912b9 --- /dev/null +++ b/doc/dev/test_proxy_migration_guide.md @@ -0,0 +1,176 @@ +# Guide for migrating to the test proxy from vcrpy + +This guide describes the changes that service SDKs should make to their test frameworks in order to take advantage of +the Azure SDK test proxy. + +Documentation of the motivations and goals of the test proxy can be found [here][general_docs] in the azure-sdk-tools +GitHub repository, and documentation of how to set up and use the proxy can be found [here][detailed_docs]. + +## Update existing tests + +### Current test structure + +Test classes currently inherit from AzureTestCase, and test methods can optionally use decorators: + +```py +from devtools_testutils import AzureTestCase + +class TestExample(AzureTestCase): + + def test_example(self): + ... + + @ExamplePreparer() + def test_example_with_preparer(self): + ... +``` + +### New test structure + +To use the proxy, test classes should inherit from AzureRecordedTestCase and recorded test methods should use a +RecordedByProxy decorator: + +```py +from devtools_testutils import AzureRecordedTestCase, RecordedByProxy + +class TestExample(AzureRecordedTestCase): + + @RecordedByProxy + def test_example(self): + ... + + @ExamplePreparer() + @RecordedByProxy + def test_example_with_preparer(self): + ... +``` + +For async tests, import the RecordedByProxyAsync decorator from `devtools_testutils.aio` and use it in the same +way as RecordedByProxy. + +> **Note:** since AzureRecordedTestCase doesn't inherit from `unittest.TestCase`, test class names need to start +> with "Test" in order to be properly collected by pytest by default. For more information, please refer to +> [pytest's documentation][pytest_collection]. + +## Run the tests + +### Perform one-time setup + +The test proxy is made available for your tests via a Docker container. Some tests require an SSL connection to work, so +the Docker image used for the container has a certificate imported that you need to trust on your machine. Instructions +on how to do so can be found [here][proxy_cert_docs]. + +### Start the proxy server + +There is a [PowerShell script][docker_start_proxy] in `eng/common/testproxy` that will fetch the proxy Docker image if +you don't already have it, and will start or stop a container running the image for you. You can run the following +command from the root of the `azure-sdk-for-python` directory to start the container whenever you want to make the test +proxy available for running tests: + +```powershell +.\eng\common\testproxy\docker-start-proxy.ps1 "start" +``` + +Note that the proxy is available as long as the container is running. In other words, you don't need to start and +stop the container for each test run or between tests for different SDKs. You can run the above command in the morning +and just stop the container whenever you'd like. To stop the container, run the same command but with `"stop"` in place +of `"start"`. In the future, the proxy container will be set up and started automatically when tests are run, and +starting it manually will be optional. + +For more details on proxy startup, please refer to the [proxy documentation][detailed_docs]. + +### Record or play back tests + +Configuring live and playback tests is done with the `AZURE_TEST_RUN_LIVE` environment variable. When this variable is +set to "true" or "yes", live tests will run and produce recordings. When this variable is set to "false" or "no", or +not set at all, tests will run in playback mode and attempt to match existing recordings. + +Recordings for a given package will end up in that package's `/tests/recordings` directory, just like they currently +do. + +> **Note:** at this time, support for configuring live or playback tests with a `testsettings_local.cfg` file has been +> deprecated in favor of using just `AZURE_TEST_RUN_LIVE`. + +### Register sanitizers + +Since the test proxy doesn't use [`vcrpy`][vcrpy], tests don't use a scrubber to sanitize values in recordings. +Instead, sanitizers (as well as matchers and transforms) can be registered on the proxy as detailed in +[this][sanitizers] section of the proxy documentation. At the time of writing, sanitizers can be registered via the +`add_sanitizer` method in `devtools_testutils`. + +Sanitizers, matchers, and transforms remain registered until the proxy container is stopped, so for any sanitizers that +are shared by different tests, using a session fixture declared in a `conftest.py` file is recommended. Please refer to +[pytest's scoped fixture documentation][pytest_fixtures] for more details. + +For example, to sanitize URIs in recordings, you can set up a URI sanitizer for all tests in the pytest session by +adding something like the following in the package's `conftest.py` file: + +```python +from devtools_testutils import add_sanitizer + +@pytest.fixture(scope="session") +def sanitize_uris(): + add_sanitizer(ProxyRecordingSanitizer.URI, value="fakeendpoint") +``` + +`add_sanitizer` accepts a sanitizer, matcher, or transform type from the ProxyRecordingSanitizer enum as a required +parameter. Keyword-only arguments can be provided to customize the sanitizer; for example, in the snippet above, any +request URIs that match the default URI regular expression will have their domain name replaced with "fakeendpoint". A +request made to `https://tableaccount.table.core.windows.net` will be recorded as being made to +`https://fakeendpoint.table.core.windows.net`. + +## Implementation details + +### What does the test proxy do? + +The gist of the test proxy is that it stands in between your tests and the service. What this means is that test +requests which would usually go straight to the service should instead point to the locally-hosted test proxy. + +For example, if an operation would typically make a GET request to +`https://fakeazsdktestaccount.table.core.windows.net/Tables`, that operation should now be sent to +`https://localhost:5001/Tables` instead. The original endpoint should be stored in an `x-recording-upstream-base-uri` -- +the proxy will send the original request and record the result. + +The RecordedByProxy and RecordedByProxyAsync decorators patch test requests to do this for you. + +### How does the test proxy know when and what to record or play back? + +This is achieved by making POST requests to the proxy server that say whether to start or stop recording or playing +back, as well as what test is being run. + +To start recording a test, the server should be primed with a POST request: + +``` +URL: https://localhost:5001/record/start +headers { + "x-recording-file": "/recordings/." +} +``` + +This will return a recording ID in an `x-recording-id` header. This ID should be sent as an `x-recording-id` header in +all further requests during the test. + +After the test has finished, a POST request should be sent to indicate that recording is complete: + +``` +URL: https://localhost:5001/record/stop +headers { + "x-recording-id": "" +} +``` + +Running tests in playback follows the same pattern, except that requests will be sent to `/playback/start` and +`/playback/stop` instead. A header, `x-recording-mode`, should be set to `record` for all requests when recording and +`playback` when playing recordings back. More details can be found [here][detailed_docs]. + +The RecordedByProxy and RecordedByProxyAsync decorators send the appropriate requests at the start and end of each test +case. + +[detailed_docs]: https://github.com/Azure/azure-sdk-tools/tree/main/tools/test-proxy/Azure.Sdk.Tools.TestProxy/README.md +[docker_start_proxy]: https://github.com/Azure/azure-sdk-for-python/blob/main/eng/common/testproxy/docker-start-proxy.ps1 +[general_docs]: https://github.com/Azure/azure-sdk-tools/blob/main/tools/test-proxy/README.md +[proxy_cert_docs]: https://github.com/Azure/azure-sdk-tools/blob/main/tools/test-proxy/documentation/trusting-cert-per-language.md +[pytest_collection]: https://docs.pytest.org/latest/goodpractices.html#test-discovery +[pytest_fixtures]: https://docs.pytest.org/latest/fixture.html#scope-sharing-fixtures-across-classes-modules-packages-or-session +[sanitizers]: https://github.com/Azure/azure-sdk-tools/blob/main/tools/test-proxy/Azure.Sdk.Tools.TestProxy/README.md#session-and-test-level-transforms-sanitiziers-and-matchers +[vcrpy]: https://vcrpy.readthedocs.io diff --git a/tools/azure-sdk-tools/devtools_testutils/proxy_testcase.py b/tools/azure-sdk-tools/devtools_testutils/proxy_testcase.py index 53cc41bf9064..78918ab0063b 100644 --- a/tools/azure-sdk-tools/devtools_testutils/proxy_testcase.py +++ b/tools/azure-sdk-tools/devtools_testutils/proxy_testcase.py @@ -24,6 +24,10 @@ from .config import PROXY_URL +# To learn about how to migrate SDK tests to the test proxy, please refer to the migration guide at +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/test_proxy_migration_guide.md + + # defaults RECORDING_START_URL = "{}/record/start".format(PROXY_URL) RECORDING_STOP_URL = "{}/record/stop".format(PROXY_URL) From 0645f499eb0aaf253f45fb5146f8f456fd9baa25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?McCoy=20Pati=C3=B1o?= <39780829+mccoyp@users.noreply.github.com> Date: Thu, 16 Sep 2021 15:58:10 -0700 Subject: [PATCH 68/85] [Test Proxy] Make add_sanitizer a module-level method (#20701) --- .../devtools_testutils/__init__.py | 3 +- .../azure_recorded_testcase.py | 44 +++++++++++++------ 2 files changed, 33 insertions(+), 14 deletions(-) diff --git a/tools/azure-sdk-tools/devtools_testutils/__init__.py b/tools/azure-sdk-tools/devtools_testutils/__init__.py index 69db6f41dfb3..c58ea74788c2 100644 --- a/tools/azure-sdk-tools/devtools_testutils/__init__.py +++ b/tools/azure-sdk-tools/devtools_testutils/__init__.py @@ -1,5 +1,5 @@ from .mgmt_testcase import AzureMgmtTestCase, AzureMgmtPreparer -from .azure_recorded_testcase import AzureRecordedTestCase +from .azure_recorded_testcase import add_sanitizer, AzureRecordedTestCase from .azure_testcase import AzureTestCase, is_live, get_region_override from .resource_testcase import ( FakeResource, @@ -21,6 +21,7 @@ from .fake_credential import FakeTokenCredential __all__ = [ + "add_sanitizer", "AzureMgmtTestCase", "AzureMgmtPreparer", "AzureRecordedTestCase", diff --git a/tools/azure-sdk-tools/devtools_testutils/azure_recorded_testcase.py b/tools/azure-sdk-tools/devtools_testutils/azure_recorded_testcase.py index d39cfe79960c..96452251da3d 100644 --- a/tools/azure-sdk-tools/devtools_testutils/azure_recorded_testcase.py +++ b/tools/azure-sdk-tools/devtools_testutils/azure_recorded_testcase.py @@ -31,12 +31,42 @@ pass if TYPE_CHECKING: - from typing import Optional + from typing import Any load_dotenv(find_dotenv()) +def add_sanitizer(sanitizer, **kwargs): + # type: (ProxyRecordingSanitizer, **Any) -> None + """Registers a sanitizer, matcher, or transform with the test proxy. + + :param sanitizer: The name of the sanitizer, matcher, or transform you want to add. + :type sanitizer: ProxyRecordingSanitizer or str + + :keyword str value: The substitution value. + :keyword str regex: A regex for a sanitizer. Can be defined as a simple regex, or if a ``group_for_replace`` is + provided, a substitution operation. + :keyword str group_for_replace: The capture group that needs to be operated upon. Do not provide if you're invoking + a simple replacement operation. + """ + request_args = {} + request_args["value"] = kwargs.get("value") or "fakevalue" + request_args["regex"] = kwargs.get("regex") or "[a-z]+(?=(?:-secondary)\\.(?:table|blob|queue)\\.core\\.windows\\.net)" + request_args["group_for_replace"] = kwargs.get("group_for_replace") + + if sanitizer == ProxyRecordingSanitizer.URI: + requests.post( + "{}/Admin/AddSanitizer".format(PROXY_URL), + headers={"x-abstraction-identifier": ProxyRecordingSanitizer.URI.value}, + json={ + "regex": request_args["regex"], + "value": request_args["value"], + "groupForReplace": request_args["group_for_replace"] + }, + ) + + def is_live(): """A module version of is_live, that could be used in pytest marker.""" if not hasattr(is_live, "_cache"): @@ -81,18 +111,6 @@ def in_recording(self): def recording_processors(self): return [] - def add_sanitizer(self, sanitizer, regex=None, value=None): - # type: (ProxyRecordingSanitizer, Optional[str], Optional[str]) -> None - if sanitizer == ProxyRecordingSanitizer.URI: - requests.post( - "{}/Admin/AddSanitizer".format(PROXY_URL), - headers={"x-abstraction-identifier": ProxyRecordingSanitizer.URI.value}, - json={ - "regex": regex or "[a-z]+(?=(?:-secondary)\\.(?:table|blob|queue)\\.core\\.windows\\.net)", - "value": value or "fakevalue" - }, - ) - def is_playback(self): return not self.is_live From 9b63801e53ce6f88c70869da6428f7143244f608 Mon Sep 17 00:00:00 2001 From: Azure CLI Bot Date: Fri, 17 Sep 2021 15:00:44 +0800 Subject: [PATCH 69/85] [AutoRelease] t2-azurearcdata-2021-09-15-74995 (#20714) * CodeGen from PR 15874 in Azure/azure-rest-api-specs Adding 202 Accepted for deletion call (#15874) * Adding 202 for deletion call * Adding headers to suppress warnings * version,CHANGELOG Co-authored-by: SDKAuto Co-authored-by: PythonSdkPipelines --- .../azure-mgmt-azurearcdata/CHANGELOG.md | 5 + .../azure-mgmt-azurearcdata/MANIFEST.in | 6 + .../azure-mgmt-azurearcdata/README.md | 27 + .../azure-mgmt-azurearcdata/_meta.json | 11 + .../azure-mgmt-azurearcdata/azure/__init__.py | 1 + .../azure/mgmt/__init__.py | 1 + .../azure/mgmt/azurearcdata/__init__.py | 19 + .../_azure_arc_data_management_client.py | 104 ++ .../azure/mgmt/azurearcdata/_configuration.py | 71 + .../azure/mgmt/azurearcdata/_metadata.json | 106 ++ .../azure/mgmt/azurearcdata/_version.py | 9 + .../azure/mgmt/azurearcdata/aio/__init__.py | 10 + .../aio/_azure_arc_data_management_client.py | 97 + .../mgmt/azurearcdata/aio/_configuration.py | 67 + .../azurearcdata/aio/operations/__init__.py | 19 + .../_data_controllers_operations.py | 550 ++++++ .../aio/operations/_operations.py | 105 ++ .../_sql_managed_instances_operations.py | 550 ++++++ .../_sql_server_instances_operations.py | 550 ++++++ .../mgmt/azurearcdata/models/__init__.py | 152 ++ ..._azure_arc_data_management_client_enums.py | 118 ++ .../azure/mgmt/azurearcdata/models/_models.py | 1442 +++++++++++++++ .../mgmt/azurearcdata/models/_models_py3.py | 1605 +++++++++++++++++ .../mgmt/azurearcdata/operations/__init__.py | 19 + .../_data_controllers_operations.py | 562 ++++++ .../azurearcdata/operations/_operations.py | 110 ++ .../_sql_managed_instances_operations.py | 562 ++++++ .../_sql_server_instances_operations.py | 562 ++++++ .../azure/mgmt/azurearcdata/py.typed | 1 + .../sdk_packaging.toml | 9 + .../azure-mgmt-azurearcdata/setup.cfg | 2 + .../azure-mgmt-azurearcdata/setup.py | 90 + sdk/azurearcdata/ci.yml | 33 + shared_requirements.txt | 1 + 34 files changed, 7576 insertions(+) create mode 100644 sdk/azurearcdata/azure-mgmt-azurearcdata/CHANGELOG.md create mode 100644 sdk/azurearcdata/azure-mgmt-azurearcdata/MANIFEST.in create mode 100644 sdk/azurearcdata/azure-mgmt-azurearcdata/README.md create mode 100644 sdk/azurearcdata/azure-mgmt-azurearcdata/_meta.json create mode 100644 sdk/azurearcdata/azure-mgmt-azurearcdata/azure/__init__.py create mode 100644 sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/__init__.py create mode 100644 sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/__init__.py create mode 100644 sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/_azure_arc_data_management_client.py create mode 100644 sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/_configuration.py create mode 100644 sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/_metadata.json create mode 100644 sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/_version.py create mode 100644 sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/__init__.py create mode 100644 sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/_azure_arc_data_management_client.py create mode 100644 sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/_configuration.py create mode 100644 sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/operations/__init__.py create mode 100644 sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/operations/_data_controllers_operations.py create mode 100644 sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/operations/_operations.py create mode 100644 sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/operations/_sql_managed_instances_operations.py create mode 100644 sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/operations/_sql_server_instances_operations.py create mode 100644 sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/models/__init__.py create mode 100644 sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/models/_azure_arc_data_management_client_enums.py create mode 100644 sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/models/_models.py create mode 100644 sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/models/_models_py3.py create mode 100644 sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/operations/__init__.py create mode 100644 sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/operations/_data_controllers_operations.py create mode 100644 sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/operations/_operations.py create mode 100644 sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/operations/_sql_managed_instances_operations.py create mode 100644 sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/operations/_sql_server_instances_operations.py create mode 100644 sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/py.typed create mode 100644 sdk/azurearcdata/azure-mgmt-azurearcdata/sdk_packaging.toml create mode 100644 sdk/azurearcdata/azure-mgmt-azurearcdata/setup.cfg create mode 100644 sdk/azurearcdata/azure-mgmt-azurearcdata/setup.py create mode 100644 sdk/azurearcdata/ci.yml diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/CHANGELOG.md b/sdk/azurearcdata/azure-mgmt-azurearcdata/CHANGELOG.md new file mode 100644 index 000000000000..f24747b3b8cc --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0b1 (2021-09-15) + +* Initial Release diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/MANIFEST.in b/sdk/azurearcdata/azure-mgmt-azurearcdata/MANIFEST.in new file mode 100644 index 000000000000..3a9b6517412b --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/MANIFEST.in @@ -0,0 +1,6 @@ +include _meta.json +recursive-include tests *.py *.yaml +include *.md +include azure/__init__.py +include azure/mgmt/__init__.py + diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/README.md b/sdk/azurearcdata/azure-mgmt-azurearcdata/README.md new file mode 100644 index 000000000000..98453a844f83 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/README.md @@ -0,0 +1,27 @@ +# Microsoft Azure SDK for Python + +This is the Microsoft Azure Azurearcdata Management Client Library. +This package has been tested with Python 2.7, 3.6+. +For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all). + + +# Usage + + +To learn how to use this package, see the [quickstart guide](https://aka.ms/azsdk/python/mgmt) + + + +For docs and references, see [Python SDK References](https://docs.microsoft.com/python/api/overview/azure/) +Code samples for this package can be found at [Azurearcdata Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com. +Additional code samples for different Azure services are available at [Samples Repo](https://aka.ms/azsdk/python/mgmt/samples) + + +# Provide Feedback + +If you encounter any bugs or have suggestions, please file an issue in the +[Issues](https://github.com/Azure/azure-sdk-for-python/issues) +section of the project. + + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-azurearcdata%2FREADME.png) diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/_meta.json b/sdk/azurearcdata/azure-mgmt-azurearcdata/_meta.json new file mode 100644 index 000000000000..39f2055663a1 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/_meta.json @@ -0,0 +1,11 @@ +{ + "autorest": "3.4.5", + "use": [ + "@autorest/python@5.8.4", + "@autorest/modelerfour@4.19.2" + ], + "commit": "e23a590abc2f98437bafac9da5ccd608b2981a45", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "autorest_command": "autorest specification/azurearcdata/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.4 --use=@autorest/modelerfour@4.19.2 --version=3.4.5", + "readme": "specification/azurearcdata/resource-manager/readme.md" +} \ No newline at end of file diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/__init__.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/__init__.py new file mode 100644 index 000000000000..8db66d3d0f0f --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/__init__.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/__init__.py new file mode 100644 index 000000000000..8db66d3d0f0f --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/__init__.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/__init__.py new file mode 100644 index 000000000000..34107556bef3 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/__init__.py @@ -0,0 +1,19 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._azure_arc_data_management_client import AzureArcDataManagementClient +from ._version import VERSION + +__version__ = VERSION +__all__ = ['AzureArcDataManagementClient'] + +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/_azure_arc_data_management_client.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/_azure_arc_data_management_client.py new file mode 100644 index 000000000000..8ddeb5be5dc3 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/_azure_arc_data_management_client.py @@ -0,0 +1,104 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + from azure.core.credentials import TokenCredential + from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from ._configuration import AzureArcDataManagementClientConfiguration +from .operations import Operations +from .operations import SqlManagedInstancesOperations +from .operations import SqlServerInstancesOperations +from .operations import DataControllersOperations +from . import models + + +class AzureArcDataManagementClient(object): + """The AzureArcData management API provides a RESTful set of web APIs to manage Azure Data Services on Azure Arc Resources. + + :ivar operations: Operations operations + :vartype operations: azure_arc_data_management_client.operations.Operations + :ivar sql_managed_instances: SqlManagedInstancesOperations operations + :vartype sql_managed_instances: azure_arc_data_management_client.operations.SqlManagedInstancesOperations + :ivar sql_server_instances: SqlServerInstancesOperations operations + :vartype sql_server_instances: azure_arc_data_management_client.operations.SqlServerInstancesOperations + :ivar data_controllers: DataControllersOperations operations + :vartype data_controllers: azure_arc_data_management_client.operations.DataControllersOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The ID of the Azure subscription. + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = AzureArcDataManagementClientConfiguration(credential, subscription_id, **kwargs) + self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.sql_managed_instances = SqlManagedInstancesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.sql_server_instances = SqlServerInstancesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.data_controllers = DataControllersOperations( + self._client, self._config, self._serialize, self._deserialize) + + def _send_request(self, http_request, **kwargs): + # type: (HttpRequest, Any) -> HttpResponse + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.HttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> AzureArcDataManagementClient + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/_configuration.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/_configuration.py new file mode 100644 index 000000000000..06e0bd8f8958 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/_configuration.py @@ -0,0 +1,71 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +from ._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + + +class AzureArcDataManagementClientConfiguration(Configuration): + """Configuration for AzureArcDataManagementClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The ID of the Azure subscription. + :type subscription_id: str + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(AzureArcDataManagementClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2021-08-01" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-azurearcdata/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/_metadata.json b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/_metadata.json new file mode 100644 index 000000000000..cf806c606565 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/_metadata.json @@ -0,0 +1,106 @@ +{ + "chosen_version": "2021-08-01", + "total_api_version_list": ["2021-08-01"], + "client": { + "name": "AzureArcDataManagementClient", + "filename": "_azure_arc_data_management_client", + "description": "The AzureArcData management API provides a RESTful set of web APIs to manage Azure Data Services on Azure Arc Resources.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true, + "client_side_validation": false, + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"AzureArcDataManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"AzureArcDataManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + }, + "global_parameters": { + "sync": { + "credential": { + "signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "The ID of the Azure subscription.", + "docstring_type": "str", + "required": true + } + }, + "async": { + "credential": { + "signature": "credential: \"AsyncTokenCredential\",", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id: str,", + "description": "The ID of the Azure subscription.", + "docstring_type": "str", + "required": true + } + }, + "constant": { + }, + "call": "credential, subscription_id", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url=None, # type: Optional[str]", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "async": { + "api_version": { + "signature": "api_version: Optional[str] = None,", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url: Optional[str] = None,", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } + }, + "config": { + "credential": true, + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null, + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" + }, + "operation_groups": { + "operations": "Operations", + "sql_managed_instances": "SqlManagedInstancesOperations", + "sql_server_instances": "SqlServerInstancesOperations", + "data_controllers": "DataControllersOperations" + } +} \ No newline at end of file diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/_version.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/_version.py new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/_version.py @@ -0,0 +1,9 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +VERSION = "1.0.0b1" diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/__init__.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/__init__.py new file mode 100644 index 000000000000..57b761c5d123 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/__init__.py @@ -0,0 +1,10 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._azure_arc_data_management_client import AzureArcDataManagementClient +__all__ = ['AzureArcDataManagementClient'] diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/_azure_arc_data_management_client.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/_azure_arc_data_management_client.py new file mode 100644 index 000000000000..c134ef59a1b8 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/_azure_arc_data_management_client.py @@ -0,0 +1,97 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional, TYPE_CHECKING + +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +from ._configuration import AzureArcDataManagementClientConfiguration +from .operations import Operations +from .operations import SqlManagedInstancesOperations +from .operations import SqlServerInstancesOperations +from .operations import DataControllersOperations +from .. import models + + +class AzureArcDataManagementClient(object): + """The AzureArcData management API provides a RESTful set of web APIs to manage Azure Data Services on Azure Arc Resources. + + :ivar operations: Operations operations + :vartype operations: azure_arc_data_management_client.aio.operations.Operations + :ivar sql_managed_instances: SqlManagedInstancesOperations operations + :vartype sql_managed_instances: azure_arc_data_management_client.aio.operations.SqlManagedInstancesOperations + :ivar sql_server_instances: SqlServerInstancesOperations operations + :vartype sql_server_instances: azure_arc_data_management_client.aio.operations.SqlServerInstancesOperations + :ivar data_controllers: DataControllersOperations operations + :vartype data_controllers: azure_arc_data_management_client.aio.operations.DataControllersOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The ID of the Azure subscription. + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = AzureArcDataManagementClientConfiguration(credential, subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.sql_managed_instances = SqlManagedInstancesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.sql_server_instances = SqlServerInstancesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.data_controllers = DataControllersOperations( + self._client, self._config, self._serialize, self._deserialize) + + async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "AzureArcDataManagementClient": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/_configuration.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/_configuration.py new file mode 100644 index 000000000000..dbff5e916631 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/_configuration.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +from .._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + + +class AzureArcDataManagementClientConfiguration(Configuration): + """Configuration for AzureArcDataManagementClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The ID of the Azure subscription. + :type subscription_id: str + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(AzureArcDataManagementClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2021-08-01" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-azurearcdata/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs: Any + ) -> None: + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/operations/__init__.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/operations/__init__.py new file mode 100644 index 000000000000..71f1823a000e --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/operations/__init__.py @@ -0,0 +1,19 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operations import Operations +from ._sql_managed_instances_operations import SqlManagedInstancesOperations +from ._sql_server_instances_operations import SqlServerInstancesOperations +from ._data_controllers_operations import DataControllersOperations + +__all__ = [ + 'Operations', + 'SqlManagedInstancesOperations', + 'SqlServerInstancesOperations', + 'DataControllersOperations', +] diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/operations/_data_controllers_operations.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/operations/_data_controllers_operations.py new file mode 100644 index 000000000000..a2358f6cad23 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/operations/_data_controllers_operations.py @@ -0,0 +1,550 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class DataControllersOperations: + """DataControllersOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_arc_data_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_in_subscription( + self, + **kwargs: Any + ) -> AsyncIterable["_models.PageOfDataControllerResource"]: + """List dataController resources in the subscription. + + List dataController resources in the subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PageOfDataControllerResource or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure_arc_data_management_client.models.PageOfDataControllerResource] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PageOfDataControllerResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_in_subscription.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('PageOfDataControllerResource', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_in_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AzureArcData/dataControllers'} # type: ignore + + def list_in_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.PageOfDataControllerResource"]: + """List dataController resources in the resource group. + + List dataController resources in the resource group. + + :param resource_group_name: The name of the Azure resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PageOfDataControllerResource or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure_arc_data_management_client.models.PageOfDataControllerResource] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PageOfDataControllerResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_in_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('PageOfDataControllerResource', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_in_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/dataControllers'} # type: ignore + + async def _put_data_controller_initial( + self, + resource_group_name: str, + data_controller_name: str, + data_controller_resource: "_models.DataControllerResource", + **kwargs: Any + ) -> "_models.DataControllerResource": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DataControllerResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._put_data_controller_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'dataControllerName': self._serialize.url("data_controller_name", data_controller_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(data_controller_resource, 'DataControllerResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('DataControllerResource', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('DataControllerResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _put_data_controller_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/dataControllers/{dataControllerName}'} # type: ignore + + async def begin_put_data_controller( + self, + resource_group_name: str, + data_controller_name: str, + data_controller_resource: "_models.DataControllerResource", + **kwargs: Any + ) -> AsyncLROPoller["_models.DataControllerResource"]: + """Creates or replaces a dataController resource. + + :param resource_group_name: The name of the Azure resource group. + :type resource_group_name: str + :param data_controller_name: + :type data_controller_name: str + :param data_controller_resource: desc. + :type data_controller_resource: ~azure_arc_data_management_client.models.DataControllerResource + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either DataControllerResource or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure_arc_data_management_client.models.DataControllerResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DataControllerResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._put_data_controller_initial( + resource_group_name=resource_group_name, + data_controller_name=data_controller_name, + data_controller_resource=data_controller_resource, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('DataControllerResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'dataControllerName': self._serialize.url("data_controller_name", data_controller_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_put_data_controller.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/dataControllers/{dataControllerName}'} # type: ignore + + async def _delete_data_controller_initial( + self, + resource_group_name: str, + data_controller_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self._delete_data_controller_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'dataControllerName': self._serialize.url("data_controller_name", data_controller_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_data_controller_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/dataControllers/{dataControllerName}'} # type: ignore + + async def begin_delete_data_controller( + self, + resource_group_name: str, + data_controller_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a dataController resource. + + :param resource_group_name: The name of the Azure resource group. + :type resource_group_name: str + :param data_controller_name: + :type data_controller_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_data_controller_initial( + resource_group_name=resource_group_name, + data_controller_name=data_controller_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'dataControllerName': self._serialize.url("data_controller_name", data_controller_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete_data_controller.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/dataControllers/{dataControllerName}'} # type: ignore + + async def get_data_controller( + self, + resource_group_name: str, + data_controller_name: str, + **kwargs: Any + ) -> "_models.DataControllerResource": + """Retrieves a dataController resource. + + :param resource_group_name: The name of the Azure resource group. + :type resource_group_name: str + :param data_controller_name: + :type data_controller_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataControllerResource, or the result of cls(response) + :rtype: ~azure_arc_data_management_client.models.DataControllerResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DataControllerResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.get_data_controller.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'dataControllerName': self._serialize.url("data_controller_name", data_controller_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DataControllerResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_data_controller.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/dataControllers/{dataControllerName}'} # type: ignore + + async def patch_data_controller( + self, + resource_group_name: str, + data_controller_name: str, + data_controller_resource: "_models.DataControllerUpdate", + **kwargs: Any + ) -> "_models.DataControllerResource": + """Updates a dataController resource. + + :param resource_group_name: The name of the Azure resource group. + :type resource_group_name: str + :param data_controller_name: + :type data_controller_name: str + :param data_controller_resource: The update data controller resource. + :type data_controller_resource: ~azure_arc_data_management_client.models.DataControllerUpdate + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataControllerResource, or the result of cls(response) + :rtype: ~azure_arc_data_management_client.models.DataControllerResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DataControllerResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.patch_data_controller.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'dataControllerName': self._serialize.url("data_controller_name", data_controller_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(data_controller_resource, 'DataControllerUpdate') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DataControllerResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + patch_data_controller.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/dataControllers/{dataControllerName}'} # type: ignore diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/operations/_operations.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/operations/_operations.py new file mode 100644 index 000000000000..90194487b71b --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/operations/_operations.py @@ -0,0 +1,105 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class Operations: + """Operations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_arc_data_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs: Any + ) -> AsyncIterable["_models.OperationListResult"]: + """Lists all of the available Azure Data Services on Azure Arc API operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure_arc_data_management_client.models.OperationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('OperationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.AzureArcData/operations'} # type: ignore diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/operations/_sql_managed_instances_operations.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/operations/_sql_managed_instances_operations.py new file mode 100644 index 000000000000..ba47da5e7381 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/operations/_sql_managed_instances_operations.py @@ -0,0 +1,550 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class SqlManagedInstancesOperations: + """SqlManagedInstancesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_arc_data_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs: Any + ) -> AsyncIterable["_models.SqlManagedInstanceListResult"]: + """List sqlManagedInstance resources in the subscription. + + List sqlManagedInstance resources in the subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SqlManagedInstanceListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure_arc_data_management_client.models.SqlManagedInstanceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SqlManagedInstanceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SqlManagedInstanceListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AzureArcData/sqlManagedInstances'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.SqlManagedInstanceListResult"]: + """List sqlManagedInstance resources in the resource group. + + Gets all sqlManagedInstances in a resource group. + + :param resource_group_name: The name of the Azure resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SqlManagedInstanceListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure_arc_data_management_client.models.SqlManagedInstanceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SqlManagedInstanceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SqlManagedInstanceListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlManagedInstances'} # type: ignore + + async def get( + self, + resource_group_name: str, + sql_managed_instance_name: str, + **kwargs: Any + ) -> "_models.SqlManagedInstance": + """Retrieves a SQL Managed Instance resource. + + :param resource_group_name: The name of the Azure resource group. + :type resource_group_name: str + :param sql_managed_instance_name: Name of SQL Managed Instance. + :type sql_managed_instance_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SqlManagedInstance, or the result of cls(response) + :rtype: ~azure_arc_data_management_client.models.SqlManagedInstance + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SqlManagedInstance"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'sqlManagedInstanceName': self._serialize.url("sql_managed_instance_name", sql_managed_instance_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SqlManagedInstance', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlManagedInstances/{sqlManagedInstanceName}'} # type: ignore + + async def _create_initial( + self, + resource_group_name: str, + sql_managed_instance_name: str, + sql_managed_instance: "_models.SqlManagedInstance", + **kwargs: Any + ) -> "_models.SqlManagedInstance": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SqlManagedInstance"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'sqlManagedInstanceName': self._serialize.url("sql_managed_instance_name", sql_managed_instance_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(sql_managed_instance, 'SqlManagedInstance') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SqlManagedInstance', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SqlManagedInstance', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlManagedInstances/{sqlManagedInstanceName}'} # type: ignore + + async def begin_create( + self, + resource_group_name: str, + sql_managed_instance_name: str, + sql_managed_instance: "_models.SqlManagedInstance", + **kwargs: Any + ) -> AsyncLROPoller["_models.SqlManagedInstance"]: + """Creates or replaces a SQL Managed Instance resource. + + :param resource_group_name: The name of the Azure resource group. + :type resource_group_name: str + :param sql_managed_instance_name: The name of SQL Managed Instances. + :type sql_managed_instance_name: str + :param sql_managed_instance: The SQL Managed Instance to be created or updated. + :type sql_managed_instance: ~azure_arc_data_management_client.models.SqlManagedInstance + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either SqlManagedInstance or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure_arc_data_management_client.models.SqlManagedInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SqlManagedInstance"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_initial( + resource_group_name=resource_group_name, + sql_managed_instance_name=sql_managed_instance_name, + sql_managed_instance=sql_managed_instance, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('SqlManagedInstance', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'sqlManagedInstanceName': self._serialize.url("sql_managed_instance_name", sql_managed_instance_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlManagedInstances/{sqlManagedInstanceName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + sql_managed_instance_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'sqlManagedInstanceName': self._serialize.url("sql_managed_instance_name", sql_managed_instance_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlManagedInstances/{sqlManagedInstanceName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + sql_managed_instance_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a SQL Managed Instance resource. + + :param resource_group_name: The name of the Azure resource group. + :type resource_group_name: str + :param sql_managed_instance_name: The name of Sql Managed Instances. + :type sql_managed_instance_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + sql_managed_instance_name=sql_managed_instance_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'sqlManagedInstanceName': self._serialize.url("sql_managed_instance_name", sql_managed_instance_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlManagedInstances/{sqlManagedInstanceName}'} # type: ignore + + async def update( + self, + resource_group_name: str, + sql_managed_instance_name: str, + parameters: "_models.SqlManagedInstanceUpdate", + **kwargs: Any + ) -> "_models.SqlManagedInstance": + """Updates a SQL Managed Instance resource. + + :param resource_group_name: The name of the Azure resource group. + :type resource_group_name: str + :param sql_managed_instance_name: Name of sqlManagedInstance. + :type sql_managed_instance_name: str + :param parameters: The SQL Managed Instance. + :type parameters: ~azure_arc_data_management_client.models.SqlManagedInstanceUpdate + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SqlManagedInstance, or the result of cls(response) + :rtype: ~azure_arc_data_management_client.models.SqlManagedInstance + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SqlManagedInstance"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'sqlManagedInstanceName': self._serialize.url("sql_managed_instance_name", sql_managed_instance_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'SqlManagedInstanceUpdate') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SqlManagedInstance', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlManagedInstances/{sqlManagedInstanceName}'} # type: ignore diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/operations/_sql_server_instances_operations.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/operations/_sql_server_instances_operations.py new file mode 100644 index 000000000000..31bb1b0649ba --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/operations/_sql_server_instances_operations.py @@ -0,0 +1,550 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class SqlServerInstancesOperations: + """SqlServerInstancesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_arc_data_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs: Any + ) -> AsyncIterable["_models.SqlServerInstanceListResult"]: + """List sqlServerInstance resources in the subscription. + + List sqlServerInstance resources in the subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SqlServerInstanceListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure_arc_data_management_client.models.SqlServerInstanceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SqlServerInstanceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SqlServerInstanceListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AzureArcData/sqlServerInstances'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.SqlServerInstanceListResult"]: + """List sqlServerInstance resources in the resource group. + + Gets all sqlServerInstances in a resource group. + + :param resource_group_name: The name of the Azure resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SqlServerInstanceListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure_arc_data_management_client.models.SqlServerInstanceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SqlServerInstanceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SqlServerInstanceListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances'} # type: ignore + + async def get( + self, + resource_group_name: str, + sql_server_instance_name: str, + **kwargs: Any + ) -> "_models.SqlServerInstance": + """Retrieves a SQL Server Instance resource. + + :param resource_group_name: The name of the Azure resource group. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. + :type sql_server_instance_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SqlServerInstance, or the result of cls(response) + :rtype: ~azure_arc_data_management_client.models.SqlServerInstance + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SqlServerInstance"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'sqlServerInstanceName': self._serialize.url("sql_server_instance_name", sql_server_instance_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SqlServerInstance', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}'} # type: ignore + + async def _create_initial( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance: "_models.SqlServerInstance", + **kwargs: Any + ) -> "_models.SqlServerInstance": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SqlServerInstance"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'sqlServerInstanceName': self._serialize.url("sql_server_instance_name", sql_server_instance_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(sql_server_instance, 'SqlServerInstance') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SqlServerInstance', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SqlServerInstance', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}'} # type: ignore + + async def begin_create( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance: "_models.SqlServerInstance", + **kwargs: Any + ) -> AsyncLROPoller["_models.SqlServerInstance"]: + """Creates or replaces a SQL Server Instance resource. + + :param resource_group_name: The name of the Azure resource group. + :type resource_group_name: str + :param sql_server_instance_name: The name of SQL Server Instance. + :type sql_server_instance_name: str + :param sql_server_instance: The SQL Server Instance to be created or updated. + :type sql_server_instance: ~azure_arc_data_management_client.models.SqlServerInstance + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either SqlServerInstance or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure_arc_data_management_client.models.SqlServerInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SqlServerInstance"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_initial( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_name, + sql_server_instance=sql_server_instance, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('SqlServerInstance', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'sqlServerInstanceName': self._serialize.url("sql_server_instance_name", sql_server_instance_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + sql_server_instance_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'sqlServerInstanceName': self._serialize.url("sql_server_instance_name", sql_server_instance_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + sql_server_instance_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a SQL Server Instance resource. + + :param resource_group_name: The name of the Azure resource group. + :type resource_group_name: str + :param sql_server_instance_name: The name of SQL Server Instance. + :type sql_server_instance_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'sqlServerInstanceName': self._serialize.url("sql_server_instance_name", sql_server_instance_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}'} # type: ignore + + async def update( + self, + resource_group_name: str, + sql_server_instance_name: str, + parameters: "_models.SqlServerInstanceUpdate", + **kwargs: Any + ) -> "_models.SqlServerInstance": + """Updates a SQL Server Instance resource. + + :param resource_group_name: The name of the Azure resource group. + :type resource_group_name: str + :param sql_server_instance_name: Name of sqlServerInstance. + :type sql_server_instance_name: str + :param parameters: The SQL Server Instance. + :type parameters: ~azure_arc_data_management_client.models.SqlServerInstanceUpdate + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SqlServerInstance, or the result of cls(response) + :rtype: ~azure_arc_data_management_client.models.SqlServerInstance + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SqlServerInstance"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'sqlServerInstanceName': self._serialize.url("sql_server_instance_name", sql_server_instance_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'SqlServerInstanceUpdate') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SqlServerInstance', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}'} # type: ignore diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/models/__init__.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/models/__init__.py new file mode 100644 index 000000000000..be72068b045e --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/models/__init__.py @@ -0,0 +1,152 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import BasicLoginInformation + from ._models_py3 import CommonSku + from ._models_py3 import DataControllerProperties + from ._models_py3 import DataControllerResource + from ._models_py3 import DataControllerUpdate + from ._models_py3 import ErrorResponse + from ._models_py3 import ErrorResponseBody + from ._models_py3 import ExtendedLocation + from ._models_py3 import Identity + from ._models_py3 import K8SResourceRequirements + from ._models_py3 import K8SScheduling + from ._models_py3 import K8SSchedulingOptions + from ._models_py3 import LogAnalyticsWorkspaceConfig + from ._models_py3 import ODataError + from ._models_py3 import OnPremiseProperty + from ._models_py3 import Operation + from ._models_py3 import OperationDisplay + from ._models_py3 import OperationListResult + from ._models_py3 import PageOfDataControllerResource + from ._models_py3 import Plan + from ._models_py3 import ProxyResource + from ._models_py3 import Resource + from ._models_py3 import ResourceSku + from ._models_py3 import SqlManagedInstance + from ._models_py3 import SqlManagedInstanceK8SRaw + from ._models_py3 import SqlManagedInstanceK8SSpec + from ._models_py3 import SqlManagedInstanceListResult + from ._models_py3 import SqlManagedInstanceProperties + from ._models_py3 import SqlManagedInstanceSku + from ._models_py3 import SqlManagedInstanceUpdate + from ._models_py3 import SqlServerInstance + from ._models_py3 import SqlServerInstanceListResult + from ._models_py3 import SqlServerInstanceProperties + from ._models_py3 import SqlServerInstanceUpdate + from ._models_py3 import SystemData + from ._models_py3 import TrackedResource + from ._models_py3 import UploadServicePrincipal + from ._models_py3 import UploadWatermark +except (SyntaxError, ImportError): + from ._models import BasicLoginInformation # type: ignore + from ._models import CommonSku # type: ignore + from ._models import DataControllerProperties # type: ignore + from ._models import DataControllerResource # type: ignore + from ._models import DataControllerUpdate # type: ignore + from ._models import ErrorResponse # type: ignore + from ._models import ErrorResponseBody # type: ignore + from ._models import ExtendedLocation # type: ignore + from ._models import Identity # type: ignore + from ._models import K8SResourceRequirements # type: ignore + from ._models import K8SScheduling # type: ignore + from ._models import K8SSchedulingOptions # type: ignore + from ._models import LogAnalyticsWorkspaceConfig # type: ignore + from ._models import ODataError # type: ignore + from ._models import OnPremiseProperty # type: ignore + from ._models import Operation # type: ignore + from ._models import OperationDisplay # type: ignore + from ._models import OperationListResult # type: ignore + from ._models import PageOfDataControllerResource # type: ignore + from ._models import Plan # type: ignore + from ._models import ProxyResource # type: ignore + from ._models import Resource # type: ignore + from ._models import ResourceSku # type: ignore + from ._models import SqlManagedInstance # type: ignore + from ._models import SqlManagedInstanceK8SRaw # type: ignore + from ._models import SqlManagedInstanceK8SSpec # type: ignore + from ._models import SqlManagedInstanceListResult # type: ignore + from ._models import SqlManagedInstanceProperties # type: ignore + from ._models import SqlManagedInstanceSku # type: ignore + from ._models import SqlManagedInstanceUpdate # type: ignore + from ._models import SqlServerInstance # type: ignore + from ._models import SqlServerInstanceListResult # type: ignore + from ._models import SqlServerInstanceProperties # type: ignore + from ._models import SqlServerInstanceUpdate # type: ignore + from ._models import SystemData # type: ignore + from ._models import TrackedResource # type: ignore + from ._models import UploadServicePrincipal # type: ignore + from ._models import UploadWatermark # type: ignore + +from ._azure_arc_data_management_client_enums import ( + ArcSqlManagedInstanceLicenseType, + ArcSqlServerLicenseType, + ConnectionStatus, + DefenderStatus, + EditionType, + ExtendedLocationTypes, + IdentityType, + Infrastructure, + OperationOrigin, + SqlManagedInstanceSkuTier, + SqlVersion, +) + +__all__ = [ + 'BasicLoginInformation', + 'CommonSku', + 'DataControllerProperties', + 'DataControllerResource', + 'DataControllerUpdate', + 'ErrorResponse', + 'ErrorResponseBody', + 'ExtendedLocation', + 'Identity', + 'K8SResourceRequirements', + 'K8SScheduling', + 'K8SSchedulingOptions', + 'LogAnalyticsWorkspaceConfig', + 'ODataError', + 'OnPremiseProperty', + 'Operation', + 'OperationDisplay', + 'OperationListResult', + 'PageOfDataControllerResource', + 'Plan', + 'ProxyResource', + 'Resource', + 'ResourceSku', + 'SqlManagedInstance', + 'SqlManagedInstanceK8SRaw', + 'SqlManagedInstanceK8SSpec', + 'SqlManagedInstanceListResult', + 'SqlManagedInstanceProperties', + 'SqlManagedInstanceSku', + 'SqlManagedInstanceUpdate', + 'SqlServerInstance', + 'SqlServerInstanceListResult', + 'SqlServerInstanceProperties', + 'SqlServerInstanceUpdate', + 'SystemData', + 'TrackedResource', + 'UploadServicePrincipal', + 'UploadWatermark', + 'ArcSqlManagedInstanceLicenseType', + 'ArcSqlServerLicenseType', + 'ConnectionStatus', + 'DefenderStatus', + 'EditionType', + 'ExtendedLocationTypes', + 'IdentityType', + 'Infrastructure', + 'OperationOrigin', + 'SqlManagedInstanceSkuTier', + 'SqlVersion', +] diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/models/_azure_arc_data_management_client_enums.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/models/_azure_arc_data_management_client_enums.py new file mode 100644 index 000000000000..fac1c2934e44 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/models/_azure_arc_data_management_client_enums.py @@ -0,0 +1,118 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class ArcSqlManagedInstanceLicenseType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The license type to apply for this managed instance. + """ + + BASE_PRICE = "BasePrice" + LICENSE_INCLUDED = "LicenseIncluded" + +class ArcSqlServerLicenseType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """SQL Server license type. + """ + + PAID = "Paid" + FREE = "Free" + HADR = "HADR" + UNDEFINED = "Undefined" + +class ConnectionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The cloud connectivity status. + """ + + CONNECTED = "Connected" + DISCONNECTED = "Disconnected" + UNKNOWN = "Unknown" + +class DefenderStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Status of Azure Defender. + """ + + PROTECTED = "Protected" + UNPROTECTED = "Unprotected" + UNKNOWN = "Unknown" + +class EditionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """SQL Server edition. + """ + + EVALUATION = "Evaluation" + ENTERPRISE = "Enterprise" + STANDARD = "Standard" + WEB = "Web" + DEVELOPER = "Developer" + EXPRESS = "Express" + +class ExtendedLocationTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of extendedLocation. + """ + + CUSTOM_LOCATION = "CustomLocation" + +class IdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of identity that creates/modifies resources + """ + + USER = "User" + APPLICATION = "Application" + MANAGED_IDENTITY = "ManagedIdentity" + KEY = "Key" + +class Infrastructure(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The infrastructure the data controller is running on. + """ + + AZURE = "azure" + GCP = "gcp" + AWS = "aws" + ALIBABA = "alibaba" + ONPREMISES = "onpremises" + OTHER = "other" + +class OperationOrigin(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The intended executor of the operation. + """ + + USER = "user" + SYSTEM = "system" + +class SqlManagedInstanceSkuTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The pricing tier for the instance. + """ + + GENERAL_PURPOSE = "GeneralPurpose" + BUSINESS_CRITICAL = "BusinessCritical" + +class SqlVersion(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """SQL Server version. + """ + + SQL_SERVER2019 = "SQL Server 2019" + SQL_SERVER2017 = "SQL Server 2017" + SQL_SERVER2016 = "SQL Server 2016" diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/models/_models.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/models/_models.py new file mode 100644 index 000000000000..1cfa963b8a04 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/models/_models.py @@ -0,0 +1,1442 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + + +class BasicLoginInformation(msrest.serialization.Model): + """Username and password for basic login authentication. + + :param username: Login username. + :type username: str + :param password: Login password. + :type password: str + """ + + _attribute_map = { + 'username': {'key': 'username', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(BasicLoginInformation, self).__init__(**kwargs) + self.username = kwargs.get('username', None) + self.password = kwargs.get('password', None) + + +class CommonSku(msrest.serialization.Model): + """The resource model definition representing SKU for ARM resources. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the SKU. It is typically a letter+number code. + :type name: str + :param dev: Whether dev/test is enabled. When the dev field is set to true, the resource is + used for dev/test purpose. + :type dev: bool + :param size: The SKU size. When the name field is the combination of tier and some other value, + this would be the standalone code. + :type size: str + :param family: If the service has different generations of hardware, for the same SKU, then + that can be captured here. + :type family: str + :param capacity: If the SKU supports scale out/in then the capacity integer should be included. + If scale out/in is not possible for the resource this may be omitted. + :type capacity: int + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'dev': {'key': 'dev', 'type': 'bool'}, + 'size': {'key': 'size', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(CommonSku, self).__init__(**kwargs) + self.name = kwargs['name'] + self.dev = kwargs.get('dev', True) + self.size = kwargs.get('size', None) + self.family = kwargs.get('family', None) + self.capacity = kwargs.get('capacity', None) + + +class DataControllerProperties(msrest.serialization.Model): + """The data controller properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param infrastructure: The infrastructure the data controller is running on. Possible values + include: "azure", "gcp", "aws", "alibaba", "onpremises", "other". Default value: "other". + :type infrastructure: str or ~azure_arc_data_management_client.models.Infrastructure + :param on_premise_property: Properties from the Kubernetes data controller. + :type on_premise_property: ~azure_arc_data_management_client.models.OnPremiseProperty + :param k8_s_raw: The raw kubernetes information. + :type k8_s_raw: any + :param upload_watermark: Properties on upload watermark. Mostly timestamp for each upload data + type. + :type upload_watermark: ~azure_arc_data_management_client.models.UploadWatermark + :param last_uploaded_date: Last uploaded date from Kubernetes cluster. Defaults to current date + time. + :type last_uploaded_date: ~datetime.datetime + :param basic_login_information: Username and password for basic login authentication. + :type basic_login_information: ~azure_arc_data_management_client.models.BasicLoginInformation + :param log_analytics_workspace_config: Log analytics workspace id and primary key. + :type log_analytics_workspace_config: + ~azure_arc_data_management_client.models.LogAnalyticsWorkspaceConfig + :param upload_service_principal: Service principal for uploading billing, metrics and logs. + :type upload_service_principal: ~azure_arc_data_management_client.models.UploadServicePrincipal + :ivar provisioning_state: + :vartype provisioning_state: str + :param cluster_id: If a CustomLocation is provided, this contains the ARM id of the connected + cluster the custom location belongs to. + :type cluster_id: str + :param extension_id: If a CustomLocation is provided, this contains the ARM id of the extension + the custom location belongs to. + :type extension_id: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'infrastructure': {'key': 'infrastructure', 'type': 'str'}, + 'on_premise_property': {'key': 'onPremiseProperty', 'type': 'OnPremiseProperty'}, + 'k8_s_raw': {'key': 'k8sRaw', 'type': 'object'}, + 'upload_watermark': {'key': 'uploadWatermark', 'type': 'UploadWatermark'}, + 'last_uploaded_date': {'key': 'lastUploadedDate', 'type': 'iso-8601'}, + 'basic_login_information': {'key': 'basicLoginInformation', 'type': 'BasicLoginInformation'}, + 'log_analytics_workspace_config': {'key': 'logAnalyticsWorkspaceConfig', 'type': 'LogAnalyticsWorkspaceConfig'}, + 'upload_service_principal': {'key': 'uploadServicePrincipal', 'type': 'UploadServicePrincipal'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'cluster_id': {'key': 'clusterId', 'type': 'str'}, + 'extension_id': {'key': 'extensionId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DataControllerProperties, self).__init__(**kwargs) + self.infrastructure = kwargs.get('infrastructure', "other") + self.on_premise_property = kwargs.get('on_premise_property', None) + self.k8_s_raw = kwargs.get('k8_s_raw', None) + self.upload_watermark = kwargs.get('upload_watermark', None) + self.last_uploaded_date = kwargs.get('last_uploaded_date', None) + self.basic_login_information = kwargs.get('basic_login_information', None) + self.log_analytics_workspace_config = kwargs.get('log_analytics_workspace_config', None) + self.upload_service_principal = kwargs.get('upload_service_principal', None) + self.provisioning_state = None + self.cluster_id = kwargs.get('cluster_id', None) + self.extension_id = kwargs.get('extension_id', None) + + +class Resource(msrest.serialization.Model): + """Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or + Microsoft.Storage/storageAccounts. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class TrackedResource(Resource): + """The resource model definition for a ARM tracked top level resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or + Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives. + :type location: str + :ivar system_data: Read only system data. + :vartype system_data: ~azure_arc_data_management_client.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + def __init__( + self, + **kwargs + ): + super(TrackedResource, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.location = kwargs['location'] + self.system_data = None + + +class DataControllerResource(TrackedResource): + """Data controller resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or + Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives. + :type location: str + :ivar system_data: Read only system data. + :vartype system_data: ~azure_arc_data_management_client.models.SystemData + :param extended_location: The extendedLocation of the resource. + :type extended_location: ~azure_arc_data_management_client.models.ExtendedLocation + :param properties: Required. The data controller's properties. + :type properties: ~azure_arc_data_management_client.models.DataControllerProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'system_data': {'readonly': True}, + 'properties': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'properties': {'key': 'properties', 'type': 'DataControllerProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(DataControllerResource, self).__init__(**kwargs) + self.extended_location = kwargs.get('extended_location', None) + self.properties = kwargs['properties'] + + +class DataControllerUpdate(msrest.serialization.Model): + """Used for updating a data controller resource. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(DataControllerUpdate, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + + +class ErrorResponse(msrest.serialization.Model): + """An error response from the Azure Data on Azure Arc service. + + :param error: null. + :type error: ~azure_arc_data_management_client.models.ErrorResponseBody + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponseBody'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class ErrorResponseBody(msrest.serialization.Model): + """An error response from the Batch service. + + :param code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable for display in a user + interface. + :type message: str + :param target: The target of the particular error. For example, the name of the property in + error. + :type target: str + :param details: A list of additional details about the error. + :type details: list[~azure_arc_data_management_client.models.ErrorResponseBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorResponseBody]'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponseBody, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) + self.details = kwargs.get('details', None) + + +class ExtendedLocation(msrest.serialization.Model): + """The complex type of the extended location. + + :param name: The name of the extended location. + :type name: str + :param type: The type of the extended location. Possible values include: "CustomLocation". + :type type: str or ~azure_arc_data_management_client.models.ExtendedLocationTypes + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExtendedLocation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + + +class Identity(msrest.serialization.Model): + """Identity for the resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :param type: The identity type. The only acceptable values to pass in are None and + "SystemAssigned". The default value is None. + :type type: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = kwargs.get('type', None) + + +class K8SResourceRequirements(msrest.serialization.Model): + """The kubernetes resource limits and requests used to restrict or reserve resource usage. + + :param additional_properties: Unmatched properties from the message are deserialized to this + collection. + :type additional_properties: dict[str, any] + :param requests: Requests for a kubernetes resource type (e.g 'cpu', 'memory'). The 'cpu' + request must be less than or equal to 'cpu' limit. Default 'cpu' is 2, minimum is 1. Default + 'memory' is '4Gi', minimum is '2Gi. If sku.tier is GeneralPurpose, maximum 'cpu' is 24 and + maximum 'memory' is '128Gi'. + :type requests: dict[str, str] + :param limits: Limits for a kubernetes resource type (e.g 'cpu', 'memory'). The 'cpu' request + must be less than or equal to 'cpu' limit. Default 'cpu' is 2, minimum is 1. Default 'memory' + is '4Gi', minimum is '2Gi. If sku.tier is GeneralPurpose, maximum 'cpu' is 24 and maximum + 'memory' is '128Gi'. + :type limits: dict[str, str] + """ + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'requests': {'key': 'requests', 'type': '{str}'}, + 'limits': {'key': 'limits', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(K8SResourceRequirements, self).__init__(**kwargs) + self.additional_properties = kwargs.get('additional_properties', None) + self.requests = kwargs.get('requests', None) + self.limits = kwargs.get('limits', None) + + +class K8SScheduling(msrest.serialization.Model): + """The kubernetes scheduling information. + + :param additional_properties: Unmatched properties from the message are deserialized to this + collection. + :type additional_properties: dict[str, any] + :param default: The kubernetes scheduling options. It describes restrictions used to help + Kubernetes select appropriate nodes to host the database service. + :type default: ~azure_arc_data_management_client.models.K8SSchedulingOptions + """ + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'default': {'key': 'default', 'type': 'K8SSchedulingOptions'}, + } + + def __init__( + self, + **kwargs + ): + super(K8SScheduling, self).__init__(**kwargs) + self.additional_properties = kwargs.get('additional_properties', None) + self.default = kwargs.get('default', None) + + +class K8SSchedulingOptions(msrest.serialization.Model): + """The kubernetes scheduling options. It describes restrictions used to help Kubernetes select appropriate nodes to host the database service. + + :param additional_properties: Unmatched properties from the message are deserialized to this + collection. + :type additional_properties: dict[str, any] + :param resources: The kubernetes resource limits and requests used to restrict or reserve + resource usage. + :type resources: ~azure_arc_data_management_client.models.K8SResourceRequirements + """ + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'resources': {'key': 'resources', 'type': 'K8SResourceRequirements'}, + } + + def __init__( + self, + **kwargs + ): + super(K8SSchedulingOptions, self).__init__(**kwargs) + self.additional_properties = kwargs.get('additional_properties', None) + self.resources = kwargs.get('resources', None) + + +class LogAnalyticsWorkspaceConfig(msrest.serialization.Model): + """Log analytics workspace id and primary key. + + :param workspace_id: Azure Log Analytics workspace ID. + :type workspace_id: str + :param primary_key: Primary key of the workspace. + :type primary_key: str + """ + + _attribute_map = { + 'workspace_id': {'key': 'workspaceId', 'type': 'str'}, + 'primary_key': {'key': 'primaryKey', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LogAnalyticsWorkspaceConfig, self).__init__(**kwargs) + self.workspace_id = kwargs.get('workspace_id', None) + self.primary_key = kwargs.get('primary_key', None) + + +class ODataError(msrest.serialization.Model): + """Information about an error. + + :param code: A language-independent error name. + :type code: str + :param message: The error message. + :type message: str + :param target: The target of the error (for example, the name of the property in error). + :type target: str + :param details: The error details. + :type details: list[~azure_arc_data_management_client.models.ODataError] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ODataError]'}, + } + + def __init__( + self, + **kwargs + ): + super(ODataError, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) + self.details = kwargs.get('details', None) + + +class OnPremiseProperty(msrest.serialization.Model): + """Properties from the Kubernetes data controller. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. A globally unique ID identifying the associated Kubernetes cluster. + :type id: str + :param public_signing_key: Required. Certificate that contains the Kubernetes cluster public + key used to verify signing. + :type public_signing_key: str + :param signing_certificate_thumbprint: Unique thumbprint returned to customer to verify the + certificate being uploaded. + :type signing_certificate_thumbprint: str + """ + + _validation = { + 'id': {'required': True}, + 'public_signing_key': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'public_signing_key': {'key': 'publicSigningKey', 'type': 'str'}, + 'signing_certificate_thumbprint': {'key': 'signingCertificateThumbprint', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OnPremiseProperty, self).__init__(**kwargs) + self.id = kwargs['id'] + self.public_signing_key = kwargs['public_signing_key'] + self.signing_certificate_thumbprint = kwargs.get('signing_certificate_thumbprint', None) + + +class Operation(msrest.serialization.Model): + """Azure Data Services on Azure Arc operation definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the operation being performed on this particular object. + :type name: str + :param display: Required. The localized display information for this particular operation / + action. + :type display: ~azure_arc_data_management_client.models.OperationDisplay + :ivar origin: The intended executor of the operation. Possible values include: "user", + "system". + :vartype origin: str or ~azure_arc_data_management_client.models.OperationOrigin + :param is_data_action: Required. Indicates whether the operation is a data action. + :type is_data_action: bool + :ivar properties: Additional descriptions for the operation. + :vartype properties: dict[str, any] + """ + + _validation = { + 'name': {'required': True}, + 'display': {'required': True}, + 'origin': {'readonly': True}, + 'is_data_action': {'required': True}, + 'properties': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'properties': {'key': 'properties', 'type': '{object}'}, + } + + def __init__( + self, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.name = kwargs['name'] + self.display = kwargs['display'] + self.origin = None + self.is_data_action = kwargs['is_data_action'] + self.properties = None + + +class OperationDisplay(msrest.serialization.Model): + """Display metadata associated with the operation. + + All required parameters must be populated in order to send to Azure. + + :param provider: Required. The localized friendly form of the resource provider name. + :type provider: str + :param resource: Required. The localized friendly form of the resource type related to this + action/operation. + :type resource: str + :param operation: Required. The localized friendly name for the operation. + :type operation: str + :param description: Required. The localized friendly description for the operation. + :type description: str + """ + + _validation = { + 'provider': {'required': True}, + 'resource': {'required': True}, + 'operation': {'required': True}, + 'description': {'required': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs['provider'] + self.resource = kwargs['resource'] + self.operation = kwargs['operation'] + self.description = kwargs['description'] + + +class OperationListResult(msrest.serialization.Model): + """Result of the request to list Azure Data Services on Azure Arc operations. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: Array of results. + :vartype value: list[~azure_arc_data_management_client.models.Operation] + :ivar next_link: Link to retrieve next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class PageOfDataControllerResource(msrest.serialization.Model): + """PageOfDataControllerResource. + + :param value: + :type value: list[~azure_arc_data_management_client.models.DataControllerResource] + :param next_link: Link to retrieve next page of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DataControllerResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PageOfDataControllerResource, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class Plan(msrest.serialization.Model): + """Plan for the resource. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. A user defined name of the 3rd Party Artifact that is being procured. + :type name: str + :param publisher: Required. The publisher of the 3rd Party Artifact that is being bought. E.g. + NewRelic. + :type publisher: str + :param product: Required. The 3rd Party artifact that is being procured. E.g. NewRelic. Product + maps to the OfferID specified for the artifact at the time of Data Market onboarding. + :type product: str + :param promotion_code: A publisher provided promotion code as provisioned in Data Market for + the said product/artifact. + :type promotion_code: str + :param version: The version of the desired product/artifact. + :type version: str + """ + + _validation = { + 'name': {'required': True}, + 'publisher': {'required': True}, + 'product': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'product': {'key': 'product', 'type': 'str'}, + 'promotion_code': {'key': 'promotionCode', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Plan, self).__init__(**kwargs) + self.name = kwargs['name'] + self.publisher = kwargs['publisher'] + self.product = kwargs['product'] + self.promotion_code = kwargs.get('promotion_code', None) + self.version = kwargs.get('version', None) + + +class ProxyResource(Resource): + """The resource model definition for a ARM proxy resource. It will have everything other than required location and tags. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or + Microsoft.Storage/storageAccounts. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProxyResource, self).__init__(**kwargs) + + +class ResourceSku(msrest.serialization.Model): + """ResourceSku. + + :param capacity: + :type capacity: int + :param family: + :type family: str + :param name: + :type name: str + :param size: + :type size: str + :param tier: + :type tier: str + """ + + _attribute_map = { + 'capacity': {'key': 'capacity', 'type': 'int'}, + 'family': {'key': 'family', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceSku, self).__init__(**kwargs) + self.capacity = kwargs.get('capacity', None) + self.family = kwargs.get('family', None) + self.name = kwargs.get('name', None) + self.size = kwargs.get('size', None) + self.tier = kwargs.get('tier', None) + + +class SqlManagedInstance(TrackedResource): + """A SqlManagedInstance. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or + Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives. + :type location: str + :ivar system_data: Read only system data. + :vartype system_data: ~azure_arc_data_management_client.models.SystemData + :param properties: Required. null. + :type properties: ~azure_arc_data_management_client.models.SqlManagedInstanceProperties + :param extended_location: The extendedLocation of the resource. + :type extended_location: ~azure_arc_data_management_client.models.ExtendedLocation + :param sku: Resource sku. + :type sku: ~azure_arc_data_management_client.models.SqlManagedInstanceSku + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'system_data': {'readonly': True}, + 'properties': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'properties': {'key': 'properties', 'type': 'SqlManagedInstanceProperties'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'sku': {'key': 'sku', 'type': 'SqlManagedInstanceSku'}, + } + + def __init__( + self, + **kwargs + ): + super(SqlManagedInstance, self).__init__(**kwargs) + self.properties = kwargs['properties'] + self.extended_location = kwargs.get('extended_location', None) + self.sku = kwargs.get('sku', None) + + +class SqlManagedInstanceK8SRaw(msrest.serialization.Model): + """The raw kubernetes information. + + :param additional_properties: Unmatched properties from the message are deserialized to this + collection. + :type additional_properties: dict[str, any] + :param spec: The kubernetes spec information. + :type spec: ~azure_arc_data_management_client.models.SqlManagedInstanceK8SSpec + """ + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'spec': {'key': 'spec', 'type': 'SqlManagedInstanceK8SSpec'}, + } + + def __init__( + self, + **kwargs + ): + super(SqlManagedInstanceK8SRaw, self).__init__(**kwargs) + self.additional_properties = kwargs.get('additional_properties', None) + self.spec = kwargs.get('spec', None) + + +class SqlManagedInstanceK8SSpec(msrest.serialization.Model): + """The kubernetes spec information. + + :param additional_properties: Unmatched properties from the message are deserialized to this + collection. + :type additional_properties: dict[str, any] + :param scheduling: The kubernetes scheduling information. + :type scheduling: ~azure_arc_data_management_client.models.K8SScheduling + :param replicas: This option specifies the number of SQL Managed Instance replicas that will be + deployed in your Kubernetes cluster for high availability purposes. If sku.tier is + BusinessCritical, allowed values are '2' or '3' with default of '3'. If sku.tier is + GeneralPurpose, replicas must be '1'. + :type replicas: int + """ + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'scheduling': {'key': 'scheduling', 'type': 'K8SScheduling'}, + 'replicas': {'key': 'replicas', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(SqlManagedInstanceK8SSpec, self).__init__(**kwargs) + self.additional_properties = kwargs.get('additional_properties', None) + self.scheduling = kwargs.get('scheduling', None) + self.replicas = kwargs.get('replicas', None) + + +class SqlManagedInstanceListResult(msrest.serialization.Model): + """A list of SqlManagedInstance. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: Array of results. + :vartype value: list[~azure_arc_data_management_client.models.SqlManagedInstance] + :ivar next_link: Link to retrieve next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SqlManagedInstance]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SqlManagedInstanceListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class SqlManagedInstanceProperties(msrest.serialization.Model): + """Properties of sqlManagedInstance. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param data_controller_id: null. + :type data_controller_id: str + :param admin: The instance admin user. + :type admin: str + :param start_time: The instance start time. + :type start_time: str + :param end_time: The instance end time. + :type end_time: str + :param k8_s_raw: The raw kubernetes information. + :type k8_s_raw: ~azure_arc_data_management_client.models.SqlManagedInstanceK8SRaw + :param basic_login_information: Username and password for basic authentication. + :type basic_login_information: ~azure_arc_data_management_client.models.BasicLoginInformation + :param last_uploaded_date: Last uploaded date from Kubernetes cluster. Defaults to current date + time. + :type last_uploaded_date: ~datetime.datetime + :ivar provisioning_state: + :vartype provisioning_state: str + :param license_type: The license type to apply for this managed instance. Possible values + include: "BasePrice", "LicenseIncluded". Default value: "BasePrice". + :type license_type: str or + ~azure_arc_data_management_client.models.ArcSqlManagedInstanceLicenseType + :param cluster_id: If a CustomLocation is provided, this contains the ARM id of the connected + cluster the custom location belongs to. + :type cluster_id: str + :param extension_id: If a CustomLocation is provided, this contains the ARM id of the extension + the custom location belongs to. + :type extension_id: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'data_controller_id': {'key': 'dataControllerId', 'type': 'str'}, + 'admin': {'key': 'admin', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'str'}, + 'end_time': {'key': 'endTime', 'type': 'str'}, + 'k8_s_raw': {'key': 'k8sRaw', 'type': 'SqlManagedInstanceK8SRaw'}, + 'basic_login_information': {'key': 'basicLoginInformation', 'type': 'BasicLoginInformation'}, + 'last_uploaded_date': {'key': 'lastUploadedDate', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'license_type': {'key': 'licenseType', 'type': 'str'}, + 'cluster_id': {'key': 'clusterId', 'type': 'str'}, + 'extension_id': {'key': 'extensionId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SqlManagedInstanceProperties, self).__init__(**kwargs) + self.data_controller_id = kwargs.get('data_controller_id', None) + self.admin = kwargs.get('admin', None) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.k8_s_raw = kwargs.get('k8_s_raw', None) + self.basic_login_information = kwargs.get('basic_login_information', None) + self.last_uploaded_date = kwargs.get('last_uploaded_date', None) + self.provisioning_state = None + self.license_type = kwargs.get('license_type', "BasePrice") + self.cluster_id = kwargs.get('cluster_id', None) + self.extension_id = kwargs.get('extension_id', None) + + +class SqlManagedInstanceSku(msrest.serialization.Model): + """The resource model definition representing SKU for Azure Managed Instance - Azure Arc. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar name: The name of the SKU. Has constant value: "vCore". + :vartype name: str + :param tier: The pricing tier for the instance. Possible values include: "GeneralPurpose", + "BusinessCritical". Default value: "GeneralPurpose". + :type tier: str or ~azure_arc_data_management_client.models.SqlManagedInstanceSkuTier + :param dev: Whether dev/test is enabled. When the dev field is set to true, the resource is + used for dev/test purpose. + :type dev: bool + :param size: The SKU size. When the name field is the combination of tier and some other value, + this would be the standalone code. + :type size: str + :param family: + :type family: str + :param capacity: + :type capacity: int + """ + + _validation = { + 'name': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'dev': {'key': 'dev', 'type': 'bool'}, + 'size': {'key': 'size', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + name = "vCore" + + def __init__( + self, + **kwargs + ): + super(SqlManagedInstanceSku, self).__init__(**kwargs) + self.tier = kwargs.get('tier', "GeneralPurpose") + self.dev = kwargs.get('dev', True) + self.size = kwargs.get('size', None) + self.family = kwargs.get('family', None) + self.capacity = kwargs.get('capacity', None) + + +class SqlManagedInstanceUpdate(msrest.serialization.Model): + """An update to a SQL Managed Instance. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(SqlManagedInstanceUpdate, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + + +class SqlServerInstance(TrackedResource): + """A SqlServerInstance. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or + Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives. + :type location: str + :ivar system_data: Read only system data. + :vartype system_data: ~azure_arc_data_management_client.models.SystemData + :param properties: null. + :type properties: ~azure_arc_data_management_client.models.SqlServerInstanceProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'properties': {'key': 'properties', 'type': 'SqlServerInstanceProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(SqlServerInstance, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class SqlServerInstanceListResult(msrest.serialization.Model): + """A list of SqlServerInstance. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: Array of results. + :vartype value: list[~azure_arc_data_management_client.models.SqlServerInstance] + :ivar next_link: Link to retrieve next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SqlServerInstance]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SqlServerInstanceListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class SqlServerInstanceProperties(msrest.serialization.Model): + """Properties of SqlServerInstance. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param version: SQL Server version. Possible values include: "SQL Server 2019", "SQL Server + 2017", "SQL Server 2016". + :type version: str or ~azure_arc_data_management_client.models.SqlVersion + :param edition: SQL Server edition. Possible values include: "Evaluation", "Enterprise", + "Standard", "Web", "Developer", "Express". + :type edition: str or ~azure_arc_data_management_client.models.EditionType + :param container_resource_id: Required. ARM Resource id of the container resource (Azure Arc + for Servers). + :type container_resource_id: str + :ivar create_time: The time when the resource was created. + :vartype create_time: str + :param v_core: The number of logical processors used by the SQL Server instance. + :type v_core: str + :param status: Required. The cloud connectivity status. Possible values include: "Connected", + "Disconnected", "Unknown". + :type status: str or ~azure_arc_data_management_client.models.ConnectionStatus + :param patch_level: SQL Server update level. + :type patch_level: str + :param collation: SQL Server collation. + :type collation: str + :param current_version: SQL Server current version. + :type current_version: str + :param instance_name: SQL Server instance name. + :type instance_name: str + :param tcp_dynamic_ports: Dynamic TCP ports used by SQL Server. + :type tcp_dynamic_ports: str + :param tcp_static_ports: Static TCP ports used by SQL Server. + :type tcp_static_ports: str + :param product_id: SQL Server product ID. + :type product_id: str + :param license_type: SQL Server license type. Possible values include: "Paid", "Free", "HADR", + "Undefined". + :type license_type: str or ~azure_arc_data_management_client.models.ArcSqlServerLicenseType + :param azure_defender_status_last_updated: Timestamp of last Azure Defender status update. + :type azure_defender_status_last_updated: ~datetime.datetime + :param azure_defender_status: Status of Azure Defender. Possible values include: "Protected", + "Unprotected", "Unknown". + :type azure_defender_status: str or ~azure_arc_data_management_client.models.DefenderStatus + :ivar provisioning_state: + :vartype provisioning_state: str + """ + + _validation = { + 'container_resource_id': {'required': True}, + 'create_time': {'readonly': True}, + 'status': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'version': {'key': 'version', 'type': 'str'}, + 'edition': {'key': 'edition', 'type': 'str'}, + 'container_resource_id': {'key': 'containerResourceId', 'type': 'str'}, + 'create_time': {'key': 'createTime', 'type': 'str'}, + 'v_core': {'key': 'vCore', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'patch_level': {'key': 'patchLevel', 'type': 'str'}, + 'collation': {'key': 'collation', 'type': 'str'}, + 'current_version': {'key': 'currentVersion', 'type': 'str'}, + 'instance_name': {'key': 'instanceName', 'type': 'str'}, + 'tcp_dynamic_ports': {'key': 'tcpDynamicPorts', 'type': 'str'}, + 'tcp_static_ports': {'key': 'tcpStaticPorts', 'type': 'str'}, + 'product_id': {'key': 'productId', 'type': 'str'}, + 'license_type': {'key': 'licenseType', 'type': 'str'}, + 'azure_defender_status_last_updated': {'key': 'azureDefenderStatusLastUpdated', 'type': 'iso-8601'}, + 'azure_defender_status': {'key': 'azureDefenderStatus', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SqlServerInstanceProperties, self).__init__(**kwargs) + self.version = kwargs.get('version', None) + self.edition = kwargs.get('edition', None) + self.container_resource_id = kwargs['container_resource_id'] + self.create_time = None + self.v_core = kwargs.get('v_core', None) + self.status = kwargs['status'] + self.patch_level = kwargs.get('patch_level', None) + self.collation = kwargs.get('collation', None) + self.current_version = kwargs.get('current_version', None) + self.instance_name = kwargs.get('instance_name', None) + self.tcp_dynamic_ports = kwargs.get('tcp_dynamic_ports', None) + self.tcp_static_ports = kwargs.get('tcp_static_ports', None) + self.product_id = kwargs.get('product_id', None) + self.license_type = kwargs.get('license_type', None) + self.azure_defender_status_last_updated = kwargs.get('azure_defender_status_last_updated', None) + self.azure_defender_status = kwargs.get('azure_defender_status', None) + self.provisioning_state = None + + +class SqlServerInstanceUpdate(msrest.serialization.Model): + """An update to a SQL Server Instance. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(SqlServerInstanceUpdate, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + + +class SystemData(msrest.serialization.Model): + """Read only system data. + + :param created_by: An identifier for the identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or ~azure_arc_data_management_client.models.IdentityType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: An identifier for the identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or ~azure_arc_data_management_client.models.IdentityType + :param last_modified_at: The timestamp of resource last modification (UTC). + :type last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(SystemData, self).__init__(**kwargs) + self.created_by = kwargs.get('created_by', None) + self.created_by_type = kwargs.get('created_by_type', None) + self.created_at = kwargs.get('created_at', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.last_modified_by_type = kwargs.get('last_modified_by_type', None) + self.last_modified_at = kwargs.get('last_modified_at', None) + + +class UploadServicePrincipal(msrest.serialization.Model): + """Service principal for uploading billing, metrics and logs. + + :param client_id: Client ID of the service principal for uploading data. + :type client_id: str + :param tenant_id: Tenant ID of the service principal. + :type tenant_id: str + :param authority: Authority for the service principal. Example: + https://login.microsoftonline.com/. + :type authority: str + :param client_secret: Secret of the service principal. + :type client_secret: str + """ + + _attribute_map = { + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'authority': {'key': 'authority', 'type': 'str'}, + 'client_secret': {'key': 'clientSecret', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UploadServicePrincipal, self).__init__(**kwargs) + self.client_id = kwargs.get('client_id', None) + self.tenant_id = kwargs.get('tenant_id', None) + self.authority = kwargs.get('authority', None) + self.client_secret = kwargs.get('client_secret', None) + + +class UploadWatermark(msrest.serialization.Model): + """Properties on upload watermark. Mostly timestamp for each upload data type. + + :param metrics: Last uploaded date for metrics from kubernetes cluster. Defaults to current + date time. + :type metrics: ~datetime.datetime + :param logs: Last uploaded date for logs from kubernetes cluster. Defaults to current date + time. + :type logs: ~datetime.datetime + :param usages: Last uploaded date for usages from kubernetes cluster. Defaults to current date + time. + :type usages: ~datetime.datetime + """ + + _attribute_map = { + 'metrics': {'key': 'metrics', 'type': 'iso-8601'}, + 'logs': {'key': 'logs', 'type': 'iso-8601'}, + 'usages': {'key': 'usages', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(UploadWatermark, self).__init__(**kwargs) + self.metrics = kwargs.get('metrics', None) + self.logs = kwargs.get('logs', None) + self.usages = kwargs.get('usages', None) diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/models/_models_py3.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/models/_models_py3.py new file mode 100644 index 000000000000..822cf32d7820 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/models/_models_py3.py @@ -0,0 +1,1605 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +import datetime +from typing import Any, Dict, List, Optional, Union + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + +from ._azure_arc_data_management_client_enums import * + + +class BasicLoginInformation(msrest.serialization.Model): + """Username and password for basic login authentication. + + :param username: Login username. + :type username: str + :param password: Login password. + :type password: str + """ + + _attribute_map = { + 'username': {'key': 'username', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + } + + def __init__( + self, + *, + username: Optional[str] = None, + password: Optional[str] = None, + **kwargs + ): + super(BasicLoginInformation, self).__init__(**kwargs) + self.username = username + self.password = password + + +class CommonSku(msrest.serialization.Model): + """The resource model definition representing SKU for ARM resources. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the SKU. It is typically a letter+number code. + :type name: str + :param dev: Whether dev/test is enabled. When the dev field is set to true, the resource is + used for dev/test purpose. + :type dev: bool + :param size: The SKU size. When the name field is the combination of tier and some other value, + this would be the standalone code. + :type size: str + :param family: If the service has different generations of hardware, for the same SKU, then + that can be captured here. + :type family: str + :param capacity: If the SKU supports scale out/in then the capacity integer should be included. + If scale out/in is not possible for the resource this may be omitted. + :type capacity: int + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'dev': {'key': 'dev', 'type': 'bool'}, + 'size': {'key': 'size', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__( + self, + *, + name: str, + dev: Optional[bool] = True, + size: Optional[str] = None, + family: Optional[str] = None, + capacity: Optional[int] = None, + **kwargs + ): + super(CommonSku, self).__init__(**kwargs) + self.name = name + self.dev = dev + self.size = size + self.family = family + self.capacity = capacity + + +class DataControllerProperties(msrest.serialization.Model): + """The data controller properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param infrastructure: The infrastructure the data controller is running on. Possible values + include: "azure", "gcp", "aws", "alibaba", "onpremises", "other". Default value: "other". + :type infrastructure: str or ~azure_arc_data_management_client.models.Infrastructure + :param on_premise_property: Properties from the Kubernetes data controller. + :type on_premise_property: ~azure_arc_data_management_client.models.OnPremiseProperty + :param k8_s_raw: The raw kubernetes information. + :type k8_s_raw: any + :param upload_watermark: Properties on upload watermark. Mostly timestamp for each upload data + type. + :type upload_watermark: ~azure_arc_data_management_client.models.UploadWatermark + :param last_uploaded_date: Last uploaded date from Kubernetes cluster. Defaults to current date + time. + :type last_uploaded_date: ~datetime.datetime + :param basic_login_information: Username and password for basic login authentication. + :type basic_login_information: ~azure_arc_data_management_client.models.BasicLoginInformation + :param log_analytics_workspace_config: Log analytics workspace id and primary key. + :type log_analytics_workspace_config: + ~azure_arc_data_management_client.models.LogAnalyticsWorkspaceConfig + :param upload_service_principal: Service principal for uploading billing, metrics and logs. + :type upload_service_principal: ~azure_arc_data_management_client.models.UploadServicePrincipal + :ivar provisioning_state: + :vartype provisioning_state: str + :param cluster_id: If a CustomLocation is provided, this contains the ARM id of the connected + cluster the custom location belongs to. + :type cluster_id: str + :param extension_id: If a CustomLocation is provided, this contains the ARM id of the extension + the custom location belongs to. + :type extension_id: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'infrastructure': {'key': 'infrastructure', 'type': 'str'}, + 'on_premise_property': {'key': 'onPremiseProperty', 'type': 'OnPremiseProperty'}, + 'k8_s_raw': {'key': 'k8sRaw', 'type': 'object'}, + 'upload_watermark': {'key': 'uploadWatermark', 'type': 'UploadWatermark'}, + 'last_uploaded_date': {'key': 'lastUploadedDate', 'type': 'iso-8601'}, + 'basic_login_information': {'key': 'basicLoginInformation', 'type': 'BasicLoginInformation'}, + 'log_analytics_workspace_config': {'key': 'logAnalyticsWorkspaceConfig', 'type': 'LogAnalyticsWorkspaceConfig'}, + 'upload_service_principal': {'key': 'uploadServicePrincipal', 'type': 'UploadServicePrincipal'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'cluster_id': {'key': 'clusterId', 'type': 'str'}, + 'extension_id': {'key': 'extensionId', 'type': 'str'}, + } + + def __init__( + self, + *, + infrastructure: Optional[Union[str, "Infrastructure"]] = "other", + on_premise_property: Optional["OnPremiseProperty"] = None, + k8_s_raw: Optional[Any] = None, + upload_watermark: Optional["UploadWatermark"] = None, + last_uploaded_date: Optional[datetime.datetime] = None, + basic_login_information: Optional["BasicLoginInformation"] = None, + log_analytics_workspace_config: Optional["LogAnalyticsWorkspaceConfig"] = None, + upload_service_principal: Optional["UploadServicePrincipal"] = None, + cluster_id: Optional[str] = None, + extension_id: Optional[str] = None, + **kwargs + ): + super(DataControllerProperties, self).__init__(**kwargs) + self.infrastructure = infrastructure + self.on_premise_property = on_premise_property + self.k8_s_raw = k8_s_raw + self.upload_watermark = upload_watermark + self.last_uploaded_date = last_uploaded_date + self.basic_login_information = basic_login_information + self.log_analytics_workspace_config = log_analytics_workspace_config + self.upload_service_principal = upload_service_principal + self.provisioning_state = None + self.cluster_id = cluster_id + self.extension_id = extension_id + + +class Resource(msrest.serialization.Model): + """Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or + Microsoft.Storage/storageAccounts. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class TrackedResource(Resource): + """The resource model definition for a ARM tracked top level resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or + Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives. + :type location: str + :ivar system_data: Read only system data. + :vartype system_data: ~azure_arc_data_management_client.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(TrackedResource, self).__init__(**kwargs) + self.tags = tags + self.location = location + self.system_data = None + + +class DataControllerResource(TrackedResource): + """Data controller resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or + Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives. + :type location: str + :ivar system_data: Read only system data. + :vartype system_data: ~azure_arc_data_management_client.models.SystemData + :param extended_location: The extendedLocation of the resource. + :type extended_location: ~azure_arc_data_management_client.models.ExtendedLocation + :param properties: Required. The data controller's properties. + :type properties: ~azure_arc_data_management_client.models.DataControllerProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'system_data': {'readonly': True}, + 'properties': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'properties': {'key': 'properties', 'type': 'DataControllerProperties'}, + } + + def __init__( + self, + *, + location: str, + properties: "DataControllerProperties", + tags: Optional[Dict[str, str]] = None, + extended_location: Optional["ExtendedLocation"] = None, + **kwargs + ): + super(DataControllerResource, self).__init__(tags=tags, location=location, **kwargs) + self.extended_location = extended_location + self.properties = properties + + +class DataControllerUpdate(msrest.serialization.Model): + """Used for updating a data controller resource. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(DataControllerUpdate, self).__init__(**kwargs) + self.tags = tags + + +class ErrorResponse(msrest.serialization.Model): + """An error response from the Azure Data on Azure Arc service. + + :param error: null. + :type error: ~azure_arc_data_management_client.models.ErrorResponseBody + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponseBody'}, + } + + def __init__( + self, + *, + error: Optional["ErrorResponseBody"] = None, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.error = error + + +class ErrorResponseBody(msrest.serialization.Model): + """An error response from the Batch service. + + :param code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable for display in a user + interface. + :type message: str + :param target: The target of the particular error. For example, the name of the property in + error. + :type target: str + :param details: A list of additional details about the error. + :type details: list[~azure_arc_data_management_client.models.ErrorResponseBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorResponseBody]'}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + target: Optional[str] = None, + details: Optional[List["ErrorResponseBody"]] = None, + **kwargs + ): + super(ErrorResponseBody, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + + +class ExtendedLocation(msrest.serialization.Model): + """The complex type of the extended location. + + :param name: The name of the extended location. + :type name: str + :param type: The type of the extended location. Possible values include: "CustomLocation". + :type type: str or ~azure_arc_data_management_client.models.ExtendedLocationTypes + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + type: Optional[Union[str, "ExtendedLocationTypes"]] = None, + **kwargs + ): + super(ExtendedLocation, self).__init__(**kwargs) + self.name = name + self.type = type + + +class Identity(msrest.serialization.Model): + """Identity for the resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :param type: The identity type. The only acceptable values to pass in are None and + "SystemAssigned". The default value is None. + :type type: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + type: Optional[str] = None, + **kwargs + ): + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type + + +class K8SResourceRequirements(msrest.serialization.Model): + """The kubernetes resource limits and requests used to restrict or reserve resource usage. + + :param additional_properties: Unmatched properties from the message are deserialized to this + collection. + :type additional_properties: dict[str, any] + :param requests: Requests for a kubernetes resource type (e.g 'cpu', 'memory'). The 'cpu' + request must be less than or equal to 'cpu' limit. Default 'cpu' is 2, minimum is 1. Default + 'memory' is '4Gi', minimum is '2Gi. If sku.tier is GeneralPurpose, maximum 'cpu' is 24 and + maximum 'memory' is '128Gi'. + :type requests: dict[str, str] + :param limits: Limits for a kubernetes resource type (e.g 'cpu', 'memory'). The 'cpu' request + must be less than or equal to 'cpu' limit. Default 'cpu' is 2, minimum is 1. Default 'memory' + is '4Gi', minimum is '2Gi. If sku.tier is GeneralPurpose, maximum 'cpu' is 24 and maximum + 'memory' is '128Gi'. + :type limits: dict[str, str] + """ + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'requests': {'key': 'requests', 'type': '{str}'}, + 'limits': {'key': 'limits', 'type': '{str}'}, + } + + def __init__( + self, + *, + additional_properties: Optional[Dict[str, Any]] = None, + requests: Optional[Dict[str, str]] = None, + limits: Optional[Dict[str, str]] = None, + **kwargs + ): + super(K8SResourceRequirements, self).__init__(**kwargs) + self.additional_properties = additional_properties + self.requests = requests + self.limits = limits + + +class K8SScheduling(msrest.serialization.Model): + """The kubernetes scheduling information. + + :param additional_properties: Unmatched properties from the message are deserialized to this + collection. + :type additional_properties: dict[str, any] + :param default: The kubernetes scheduling options. It describes restrictions used to help + Kubernetes select appropriate nodes to host the database service. + :type default: ~azure_arc_data_management_client.models.K8SSchedulingOptions + """ + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'default': {'key': 'default', 'type': 'K8SSchedulingOptions'}, + } + + def __init__( + self, + *, + additional_properties: Optional[Dict[str, Any]] = None, + default: Optional["K8SSchedulingOptions"] = None, + **kwargs + ): + super(K8SScheduling, self).__init__(**kwargs) + self.additional_properties = additional_properties + self.default = default + + +class K8SSchedulingOptions(msrest.serialization.Model): + """The kubernetes scheduling options. It describes restrictions used to help Kubernetes select appropriate nodes to host the database service. + + :param additional_properties: Unmatched properties from the message are deserialized to this + collection. + :type additional_properties: dict[str, any] + :param resources: The kubernetes resource limits and requests used to restrict or reserve + resource usage. + :type resources: ~azure_arc_data_management_client.models.K8SResourceRequirements + """ + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'resources': {'key': 'resources', 'type': 'K8SResourceRequirements'}, + } + + def __init__( + self, + *, + additional_properties: Optional[Dict[str, Any]] = None, + resources: Optional["K8SResourceRequirements"] = None, + **kwargs + ): + super(K8SSchedulingOptions, self).__init__(**kwargs) + self.additional_properties = additional_properties + self.resources = resources + + +class LogAnalyticsWorkspaceConfig(msrest.serialization.Model): + """Log analytics workspace id and primary key. + + :param workspace_id: Azure Log Analytics workspace ID. + :type workspace_id: str + :param primary_key: Primary key of the workspace. + :type primary_key: str + """ + + _attribute_map = { + 'workspace_id': {'key': 'workspaceId', 'type': 'str'}, + 'primary_key': {'key': 'primaryKey', 'type': 'str'}, + } + + def __init__( + self, + *, + workspace_id: Optional[str] = None, + primary_key: Optional[str] = None, + **kwargs + ): + super(LogAnalyticsWorkspaceConfig, self).__init__(**kwargs) + self.workspace_id = workspace_id + self.primary_key = primary_key + + +class ODataError(msrest.serialization.Model): + """Information about an error. + + :param code: A language-independent error name. + :type code: str + :param message: The error message. + :type message: str + :param target: The target of the error (for example, the name of the property in error). + :type target: str + :param details: The error details. + :type details: list[~azure_arc_data_management_client.models.ODataError] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ODataError]'}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + target: Optional[str] = None, + details: Optional[List["ODataError"]] = None, + **kwargs + ): + super(ODataError, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + + +class OnPremiseProperty(msrest.serialization.Model): + """Properties from the Kubernetes data controller. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. A globally unique ID identifying the associated Kubernetes cluster. + :type id: str + :param public_signing_key: Required. Certificate that contains the Kubernetes cluster public + key used to verify signing. + :type public_signing_key: str + :param signing_certificate_thumbprint: Unique thumbprint returned to customer to verify the + certificate being uploaded. + :type signing_certificate_thumbprint: str + """ + + _validation = { + 'id': {'required': True}, + 'public_signing_key': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'public_signing_key': {'key': 'publicSigningKey', 'type': 'str'}, + 'signing_certificate_thumbprint': {'key': 'signingCertificateThumbprint', 'type': 'str'}, + } + + def __init__( + self, + *, + id: str, + public_signing_key: str, + signing_certificate_thumbprint: Optional[str] = None, + **kwargs + ): + super(OnPremiseProperty, self).__init__(**kwargs) + self.id = id + self.public_signing_key = public_signing_key + self.signing_certificate_thumbprint = signing_certificate_thumbprint + + +class Operation(msrest.serialization.Model): + """Azure Data Services on Azure Arc operation definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the operation being performed on this particular object. + :type name: str + :param display: Required. The localized display information for this particular operation / + action. + :type display: ~azure_arc_data_management_client.models.OperationDisplay + :ivar origin: The intended executor of the operation. Possible values include: "user", + "system". + :vartype origin: str or ~azure_arc_data_management_client.models.OperationOrigin + :param is_data_action: Required. Indicates whether the operation is a data action. + :type is_data_action: bool + :ivar properties: Additional descriptions for the operation. + :vartype properties: dict[str, any] + """ + + _validation = { + 'name': {'required': True}, + 'display': {'required': True}, + 'origin': {'readonly': True}, + 'is_data_action': {'required': True}, + 'properties': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'properties': {'key': 'properties', 'type': '{object}'}, + } + + def __init__( + self, + *, + name: str, + display: "OperationDisplay", + is_data_action: bool, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display + self.origin = None + self.is_data_action = is_data_action + self.properties = None + + +class OperationDisplay(msrest.serialization.Model): + """Display metadata associated with the operation. + + All required parameters must be populated in order to send to Azure. + + :param provider: Required. The localized friendly form of the resource provider name. + :type provider: str + :param resource: Required. The localized friendly form of the resource type related to this + action/operation. + :type resource: str + :param operation: Required. The localized friendly name for the operation. + :type operation: str + :param description: Required. The localized friendly description for the operation. + :type description: str + """ + + _validation = { + 'provider': {'required': True}, + 'resource': {'required': True}, + 'operation': {'required': True}, + 'description': {'required': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + *, + provider: str, + resource: str, + operation: str, + description: str, + **kwargs + ): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description + + +class OperationListResult(msrest.serialization.Model): + """Result of the request to list Azure Data Services on Azure Arc operations. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: Array of results. + :vartype value: list[~azure_arc_data_management_client.models.Operation] + :ivar next_link: Link to retrieve next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class PageOfDataControllerResource(msrest.serialization.Model): + """PageOfDataControllerResource. + + :param value: + :type value: list[~azure_arc_data_management_client.models.DataControllerResource] + :param next_link: Link to retrieve next page of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DataControllerResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["DataControllerResource"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(PageOfDataControllerResource, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class Plan(msrest.serialization.Model): + """Plan for the resource. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. A user defined name of the 3rd Party Artifact that is being procured. + :type name: str + :param publisher: Required. The publisher of the 3rd Party Artifact that is being bought. E.g. + NewRelic. + :type publisher: str + :param product: Required. The 3rd Party artifact that is being procured. E.g. NewRelic. Product + maps to the OfferID specified for the artifact at the time of Data Market onboarding. + :type product: str + :param promotion_code: A publisher provided promotion code as provisioned in Data Market for + the said product/artifact. + :type promotion_code: str + :param version: The version of the desired product/artifact. + :type version: str + """ + + _validation = { + 'name': {'required': True}, + 'publisher': {'required': True}, + 'product': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'product': {'key': 'product', 'type': 'str'}, + 'promotion_code': {'key': 'promotionCode', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__( + self, + *, + name: str, + publisher: str, + product: str, + promotion_code: Optional[str] = None, + version: Optional[str] = None, + **kwargs + ): + super(Plan, self).__init__(**kwargs) + self.name = name + self.publisher = publisher + self.product = product + self.promotion_code = promotion_code + self.version = version + + +class ProxyResource(Resource): + """The resource model definition for a ARM proxy resource. It will have everything other than required location and tags. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or + Microsoft.Storage/storageAccounts. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProxyResource, self).__init__(**kwargs) + + +class ResourceSku(msrest.serialization.Model): + """ResourceSku. + + :param capacity: + :type capacity: int + :param family: + :type family: str + :param name: + :type name: str + :param size: + :type size: str + :param tier: + :type tier: str + """ + + _attribute_map = { + 'capacity': {'key': 'capacity', 'type': 'int'}, + 'family': {'key': 'family', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__( + self, + *, + capacity: Optional[int] = None, + family: Optional[str] = None, + name: Optional[str] = None, + size: Optional[str] = None, + tier: Optional[str] = None, + **kwargs + ): + super(ResourceSku, self).__init__(**kwargs) + self.capacity = capacity + self.family = family + self.name = name + self.size = size + self.tier = tier + + +class SqlManagedInstance(TrackedResource): + """A SqlManagedInstance. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or + Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives. + :type location: str + :ivar system_data: Read only system data. + :vartype system_data: ~azure_arc_data_management_client.models.SystemData + :param properties: Required. null. + :type properties: ~azure_arc_data_management_client.models.SqlManagedInstanceProperties + :param extended_location: The extendedLocation of the resource. + :type extended_location: ~azure_arc_data_management_client.models.ExtendedLocation + :param sku: Resource sku. + :type sku: ~azure_arc_data_management_client.models.SqlManagedInstanceSku + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'system_data': {'readonly': True}, + 'properties': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'properties': {'key': 'properties', 'type': 'SqlManagedInstanceProperties'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'sku': {'key': 'sku', 'type': 'SqlManagedInstanceSku'}, + } + + def __init__( + self, + *, + location: str, + properties: "SqlManagedInstanceProperties", + tags: Optional[Dict[str, str]] = None, + extended_location: Optional["ExtendedLocation"] = None, + sku: Optional["SqlManagedInstanceSku"] = None, + **kwargs + ): + super(SqlManagedInstance, self).__init__(tags=tags, location=location, **kwargs) + self.properties = properties + self.extended_location = extended_location + self.sku = sku + + +class SqlManagedInstanceK8SRaw(msrest.serialization.Model): + """The raw kubernetes information. + + :param additional_properties: Unmatched properties from the message are deserialized to this + collection. + :type additional_properties: dict[str, any] + :param spec: The kubernetes spec information. + :type spec: ~azure_arc_data_management_client.models.SqlManagedInstanceK8SSpec + """ + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'spec': {'key': 'spec', 'type': 'SqlManagedInstanceK8SSpec'}, + } + + def __init__( + self, + *, + additional_properties: Optional[Dict[str, Any]] = None, + spec: Optional["SqlManagedInstanceK8SSpec"] = None, + **kwargs + ): + super(SqlManagedInstanceK8SRaw, self).__init__(**kwargs) + self.additional_properties = additional_properties + self.spec = spec + + +class SqlManagedInstanceK8SSpec(msrest.serialization.Model): + """The kubernetes spec information. + + :param additional_properties: Unmatched properties from the message are deserialized to this + collection. + :type additional_properties: dict[str, any] + :param scheduling: The kubernetes scheduling information. + :type scheduling: ~azure_arc_data_management_client.models.K8SScheduling + :param replicas: This option specifies the number of SQL Managed Instance replicas that will be + deployed in your Kubernetes cluster for high availability purposes. If sku.tier is + BusinessCritical, allowed values are '2' or '3' with default of '3'. If sku.tier is + GeneralPurpose, replicas must be '1'. + :type replicas: int + """ + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'scheduling': {'key': 'scheduling', 'type': 'K8SScheduling'}, + 'replicas': {'key': 'replicas', 'type': 'int'}, + } + + def __init__( + self, + *, + additional_properties: Optional[Dict[str, Any]] = None, + scheduling: Optional["K8SScheduling"] = None, + replicas: Optional[int] = None, + **kwargs + ): + super(SqlManagedInstanceK8SSpec, self).__init__(**kwargs) + self.additional_properties = additional_properties + self.scheduling = scheduling + self.replicas = replicas + + +class SqlManagedInstanceListResult(msrest.serialization.Model): + """A list of SqlManagedInstance. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: Array of results. + :vartype value: list[~azure_arc_data_management_client.models.SqlManagedInstance] + :ivar next_link: Link to retrieve next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SqlManagedInstance]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SqlManagedInstanceListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class SqlManagedInstanceProperties(msrest.serialization.Model): + """Properties of sqlManagedInstance. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param data_controller_id: null. + :type data_controller_id: str + :param admin: The instance admin user. + :type admin: str + :param start_time: The instance start time. + :type start_time: str + :param end_time: The instance end time. + :type end_time: str + :param k8_s_raw: The raw kubernetes information. + :type k8_s_raw: ~azure_arc_data_management_client.models.SqlManagedInstanceK8SRaw + :param basic_login_information: Username and password for basic authentication. + :type basic_login_information: ~azure_arc_data_management_client.models.BasicLoginInformation + :param last_uploaded_date: Last uploaded date from Kubernetes cluster. Defaults to current date + time. + :type last_uploaded_date: ~datetime.datetime + :ivar provisioning_state: + :vartype provisioning_state: str + :param license_type: The license type to apply for this managed instance. Possible values + include: "BasePrice", "LicenseIncluded". Default value: "BasePrice". + :type license_type: str or + ~azure_arc_data_management_client.models.ArcSqlManagedInstanceLicenseType + :param cluster_id: If a CustomLocation is provided, this contains the ARM id of the connected + cluster the custom location belongs to. + :type cluster_id: str + :param extension_id: If a CustomLocation is provided, this contains the ARM id of the extension + the custom location belongs to. + :type extension_id: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'data_controller_id': {'key': 'dataControllerId', 'type': 'str'}, + 'admin': {'key': 'admin', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'str'}, + 'end_time': {'key': 'endTime', 'type': 'str'}, + 'k8_s_raw': {'key': 'k8sRaw', 'type': 'SqlManagedInstanceK8SRaw'}, + 'basic_login_information': {'key': 'basicLoginInformation', 'type': 'BasicLoginInformation'}, + 'last_uploaded_date': {'key': 'lastUploadedDate', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'license_type': {'key': 'licenseType', 'type': 'str'}, + 'cluster_id': {'key': 'clusterId', 'type': 'str'}, + 'extension_id': {'key': 'extensionId', 'type': 'str'}, + } + + def __init__( + self, + *, + data_controller_id: Optional[str] = None, + admin: Optional[str] = None, + start_time: Optional[str] = None, + end_time: Optional[str] = None, + k8_s_raw: Optional["SqlManagedInstanceK8SRaw"] = None, + basic_login_information: Optional["BasicLoginInformation"] = None, + last_uploaded_date: Optional[datetime.datetime] = None, + license_type: Optional[Union[str, "ArcSqlManagedInstanceLicenseType"]] = "BasePrice", + cluster_id: Optional[str] = None, + extension_id: Optional[str] = None, + **kwargs + ): + super(SqlManagedInstanceProperties, self).__init__(**kwargs) + self.data_controller_id = data_controller_id + self.admin = admin + self.start_time = start_time + self.end_time = end_time + self.k8_s_raw = k8_s_raw + self.basic_login_information = basic_login_information + self.last_uploaded_date = last_uploaded_date + self.provisioning_state = None + self.license_type = license_type + self.cluster_id = cluster_id + self.extension_id = extension_id + + +class SqlManagedInstanceSku(msrest.serialization.Model): + """The resource model definition representing SKU for Azure Managed Instance - Azure Arc. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar name: The name of the SKU. Has constant value: "vCore". + :vartype name: str + :param tier: The pricing tier for the instance. Possible values include: "GeneralPurpose", + "BusinessCritical". Default value: "GeneralPurpose". + :type tier: str or ~azure_arc_data_management_client.models.SqlManagedInstanceSkuTier + :param dev: Whether dev/test is enabled. When the dev field is set to true, the resource is + used for dev/test purpose. + :type dev: bool + :param size: The SKU size. When the name field is the combination of tier and some other value, + this would be the standalone code. + :type size: str + :param family: + :type family: str + :param capacity: + :type capacity: int + """ + + _validation = { + 'name': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'dev': {'key': 'dev', 'type': 'bool'}, + 'size': {'key': 'size', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + name = "vCore" + + def __init__( + self, + *, + tier: Optional[Union[str, "SqlManagedInstanceSkuTier"]] = "GeneralPurpose", + dev: Optional[bool] = True, + size: Optional[str] = None, + family: Optional[str] = None, + capacity: Optional[int] = None, + **kwargs + ): + super(SqlManagedInstanceSku, self).__init__(**kwargs) + self.tier = tier + self.dev = dev + self.size = size + self.family = family + self.capacity = capacity + + +class SqlManagedInstanceUpdate(msrest.serialization.Model): + """An update to a SQL Managed Instance. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(SqlManagedInstanceUpdate, self).__init__(**kwargs) + self.tags = tags + + +class SqlServerInstance(TrackedResource): + """A SqlServerInstance. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or + Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives. + :type location: str + :ivar system_data: Read only system data. + :vartype system_data: ~azure_arc_data_management_client.models.SystemData + :param properties: null. + :type properties: ~azure_arc_data_management_client.models.SqlServerInstanceProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'properties': {'key': 'properties', 'type': 'SqlServerInstanceProperties'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + properties: Optional["SqlServerInstanceProperties"] = None, + **kwargs + ): + super(SqlServerInstance, self).__init__(tags=tags, location=location, **kwargs) + self.properties = properties + + +class SqlServerInstanceListResult(msrest.serialization.Model): + """A list of SqlServerInstance. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: Array of results. + :vartype value: list[~azure_arc_data_management_client.models.SqlServerInstance] + :ivar next_link: Link to retrieve next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SqlServerInstance]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SqlServerInstanceListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class SqlServerInstanceProperties(msrest.serialization.Model): + """Properties of SqlServerInstance. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param version: SQL Server version. Possible values include: "SQL Server 2019", "SQL Server + 2017", "SQL Server 2016". + :type version: str or ~azure_arc_data_management_client.models.SqlVersion + :param edition: SQL Server edition. Possible values include: "Evaluation", "Enterprise", + "Standard", "Web", "Developer", "Express". + :type edition: str or ~azure_arc_data_management_client.models.EditionType + :param container_resource_id: Required. ARM Resource id of the container resource (Azure Arc + for Servers). + :type container_resource_id: str + :ivar create_time: The time when the resource was created. + :vartype create_time: str + :param v_core: The number of logical processors used by the SQL Server instance. + :type v_core: str + :param status: Required. The cloud connectivity status. Possible values include: "Connected", + "Disconnected", "Unknown". + :type status: str or ~azure_arc_data_management_client.models.ConnectionStatus + :param patch_level: SQL Server update level. + :type patch_level: str + :param collation: SQL Server collation. + :type collation: str + :param current_version: SQL Server current version. + :type current_version: str + :param instance_name: SQL Server instance name. + :type instance_name: str + :param tcp_dynamic_ports: Dynamic TCP ports used by SQL Server. + :type tcp_dynamic_ports: str + :param tcp_static_ports: Static TCP ports used by SQL Server. + :type tcp_static_ports: str + :param product_id: SQL Server product ID. + :type product_id: str + :param license_type: SQL Server license type. Possible values include: "Paid", "Free", "HADR", + "Undefined". + :type license_type: str or ~azure_arc_data_management_client.models.ArcSqlServerLicenseType + :param azure_defender_status_last_updated: Timestamp of last Azure Defender status update. + :type azure_defender_status_last_updated: ~datetime.datetime + :param azure_defender_status: Status of Azure Defender. Possible values include: "Protected", + "Unprotected", "Unknown". + :type azure_defender_status: str or ~azure_arc_data_management_client.models.DefenderStatus + :ivar provisioning_state: + :vartype provisioning_state: str + """ + + _validation = { + 'container_resource_id': {'required': True}, + 'create_time': {'readonly': True}, + 'status': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'version': {'key': 'version', 'type': 'str'}, + 'edition': {'key': 'edition', 'type': 'str'}, + 'container_resource_id': {'key': 'containerResourceId', 'type': 'str'}, + 'create_time': {'key': 'createTime', 'type': 'str'}, + 'v_core': {'key': 'vCore', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'patch_level': {'key': 'patchLevel', 'type': 'str'}, + 'collation': {'key': 'collation', 'type': 'str'}, + 'current_version': {'key': 'currentVersion', 'type': 'str'}, + 'instance_name': {'key': 'instanceName', 'type': 'str'}, + 'tcp_dynamic_ports': {'key': 'tcpDynamicPorts', 'type': 'str'}, + 'tcp_static_ports': {'key': 'tcpStaticPorts', 'type': 'str'}, + 'product_id': {'key': 'productId', 'type': 'str'}, + 'license_type': {'key': 'licenseType', 'type': 'str'}, + 'azure_defender_status_last_updated': {'key': 'azureDefenderStatusLastUpdated', 'type': 'iso-8601'}, + 'azure_defender_status': {'key': 'azureDefenderStatus', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + container_resource_id: str, + status: Union[str, "ConnectionStatus"], + version: Optional[Union[str, "SqlVersion"]] = None, + edition: Optional[Union[str, "EditionType"]] = None, + v_core: Optional[str] = None, + patch_level: Optional[str] = None, + collation: Optional[str] = None, + current_version: Optional[str] = None, + instance_name: Optional[str] = None, + tcp_dynamic_ports: Optional[str] = None, + tcp_static_ports: Optional[str] = None, + product_id: Optional[str] = None, + license_type: Optional[Union[str, "ArcSqlServerLicenseType"]] = None, + azure_defender_status_last_updated: Optional[datetime.datetime] = None, + azure_defender_status: Optional[Union[str, "DefenderStatus"]] = None, + **kwargs + ): + super(SqlServerInstanceProperties, self).__init__(**kwargs) + self.version = version + self.edition = edition + self.container_resource_id = container_resource_id + self.create_time = None + self.v_core = v_core + self.status = status + self.patch_level = patch_level + self.collation = collation + self.current_version = current_version + self.instance_name = instance_name + self.tcp_dynamic_ports = tcp_dynamic_ports + self.tcp_static_ports = tcp_static_ports + self.product_id = product_id + self.license_type = license_type + self.azure_defender_status_last_updated = azure_defender_status_last_updated + self.azure_defender_status = azure_defender_status + self.provisioning_state = None + + +class SqlServerInstanceUpdate(msrest.serialization.Model): + """An update to a SQL Server Instance. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(SqlServerInstanceUpdate, self).__init__(**kwargs) + self.tags = tags + + +class SystemData(msrest.serialization.Model): + """Read only system data. + + :param created_by: An identifier for the identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or ~azure_arc_data_management_client.models.IdentityType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: An identifier for the identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or ~azure_arc_data_management_client.models.IdentityType + :param last_modified_at: The timestamp of resource last modification (UTC). + :type last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "IdentityType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "IdentityType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, + **kwargs + ): + super(SystemData, self).__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at + + +class UploadServicePrincipal(msrest.serialization.Model): + """Service principal for uploading billing, metrics and logs. + + :param client_id: Client ID of the service principal for uploading data. + :type client_id: str + :param tenant_id: Tenant ID of the service principal. + :type tenant_id: str + :param authority: Authority for the service principal. Example: + https://login.microsoftonline.com/. + :type authority: str + :param client_secret: Secret of the service principal. + :type client_secret: str + """ + + _attribute_map = { + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'authority': {'key': 'authority', 'type': 'str'}, + 'client_secret': {'key': 'clientSecret', 'type': 'str'}, + } + + def __init__( + self, + *, + client_id: Optional[str] = None, + tenant_id: Optional[str] = None, + authority: Optional[str] = None, + client_secret: Optional[str] = None, + **kwargs + ): + super(UploadServicePrincipal, self).__init__(**kwargs) + self.client_id = client_id + self.tenant_id = tenant_id + self.authority = authority + self.client_secret = client_secret + + +class UploadWatermark(msrest.serialization.Model): + """Properties on upload watermark. Mostly timestamp for each upload data type. + + :param metrics: Last uploaded date for metrics from kubernetes cluster. Defaults to current + date time. + :type metrics: ~datetime.datetime + :param logs: Last uploaded date for logs from kubernetes cluster. Defaults to current date + time. + :type logs: ~datetime.datetime + :param usages: Last uploaded date for usages from kubernetes cluster. Defaults to current date + time. + :type usages: ~datetime.datetime + """ + + _attribute_map = { + 'metrics': {'key': 'metrics', 'type': 'iso-8601'}, + 'logs': {'key': 'logs', 'type': 'iso-8601'}, + 'usages': {'key': 'usages', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + metrics: Optional[datetime.datetime] = None, + logs: Optional[datetime.datetime] = None, + usages: Optional[datetime.datetime] = None, + **kwargs + ): + super(UploadWatermark, self).__init__(**kwargs) + self.metrics = metrics + self.logs = logs + self.usages = usages diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/operations/__init__.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/operations/__init__.py new file mode 100644 index 000000000000..71f1823a000e --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/operations/__init__.py @@ -0,0 +1,19 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operations import Operations +from ._sql_managed_instances_operations import SqlManagedInstancesOperations +from ._sql_server_instances_operations import SqlServerInstancesOperations +from ._data_controllers_operations import DataControllersOperations + +__all__ = [ + 'Operations', + 'SqlManagedInstancesOperations', + 'SqlServerInstancesOperations', + 'DataControllersOperations', +] diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/operations/_data_controllers_operations.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/operations/_data_controllers_operations.py new file mode 100644 index 000000000000..c0afcbc34fac --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/operations/_data_controllers_operations.py @@ -0,0 +1,562 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class DataControllersOperations(object): + """DataControllersOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_arc_data_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_in_subscription( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.PageOfDataControllerResource"] + """List dataController resources in the subscription. + + List dataController resources in the subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PageOfDataControllerResource or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure_arc_data_management_client.models.PageOfDataControllerResource] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PageOfDataControllerResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_in_subscription.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('PageOfDataControllerResource', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_in_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AzureArcData/dataControllers'} # type: ignore + + def list_in_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.PageOfDataControllerResource"] + """List dataController resources in the resource group. + + List dataController resources in the resource group. + + :param resource_group_name: The name of the Azure resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PageOfDataControllerResource or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure_arc_data_management_client.models.PageOfDataControllerResource] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PageOfDataControllerResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_in_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('PageOfDataControllerResource', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_in_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/dataControllers'} # type: ignore + + def _put_data_controller_initial( + self, + resource_group_name, # type: str + data_controller_name, # type: str + data_controller_resource, # type: "_models.DataControllerResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.DataControllerResource" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DataControllerResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._put_data_controller_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'dataControllerName': self._serialize.url("data_controller_name", data_controller_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(data_controller_resource, 'DataControllerResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('DataControllerResource', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('DataControllerResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _put_data_controller_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/dataControllers/{dataControllerName}'} # type: ignore + + def begin_put_data_controller( + self, + resource_group_name, # type: str + data_controller_name, # type: str + data_controller_resource, # type: "_models.DataControllerResource" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.DataControllerResource"] + """Creates or replaces a dataController resource. + + :param resource_group_name: The name of the Azure resource group. + :type resource_group_name: str + :param data_controller_name: + :type data_controller_name: str + :param data_controller_resource: desc. + :type data_controller_resource: ~azure_arc_data_management_client.models.DataControllerResource + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either DataControllerResource or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure_arc_data_management_client.models.DataControllerResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DataControllerResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._put_data_controller_initial( + resource_group_name=resource_group_name, + data_controller_name=data_controller_name, + data_controller_resource=data_controller_resource, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('DataControllerResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'dataControllerName': self._serialize.url("data_controller_name", data_controller_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_put_data_controller.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/dataControllers/{dataControllerName}'} # type: ignore + + def _delete_data_controller_initial( + self, + resource_group_name, # type: str + data_controller_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self._delete_data_controller_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'dataControllerName': self._serialize.url("data_controller_name", data_controller_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_data_controller_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/dataControllers/{dataControllerName}'} # type: ignore + + def begin_delete_data_controller( + self, + resource_group_name, # type: str + data_controller_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes a dataController resource. + + :param resource_group_name: The name of the Azure resource group. + :type resource_group_name: str + :param data_controller_name: + :type data_controller_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_data_controller_initial( + resource_group_name=resource_group_name, + data_controller_name=data_controller_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'dataControllerName': self._serialize.url("data_controller_name", data_controller_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete_data_controller.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/dataControllers/{dataControllerName}'} # type: ignore + + def get_data_controller( + self, + resource_group_name, # type: str + data_controller_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.DataControllerResource" + """Retrieves a dataController resource. + + :param resource_group_name: The name of the Azure resource group. + :type resource_group_name: str + :param data_controller_name: + :type data_controller_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataControllerResource, or the result of cls(response) + :rtype: ~azure_arc_data_management_client.models.DataControllerResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DataControllerResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.get_data_controller.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'dataControllerName': self._serialize.url("data_controller_name", data_controller_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DataControllerResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_data_controller.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/dataControllers/{dataControllerName}'} # type: ignore + + def patch_data_controller( + self, + resource_group_name, # type: str + data_controller_name, # type: str + data_controller_resource, # type: "_models.DataControllerUpdate" + **kwargs # type: Any + ): + # type: (...) -> "_models.DataControllerResource" + """Updates a dataController resource. + + :param resource_group_name: The name of the Azure resource group. + :type resource_group_name: str + :param data_controller_name: + :type data_controller_name: str + :param data_controller_resource: The update data controller resource. + :type data_controller_resource: ~azure_arc_data_management_client.models.DataControllerUpdate + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataControllerResource, or the result of cls(response) + :rtype: ~azure_arc_data_management_client.models.DataControllerResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DataControllerResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.patch_data_controller.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'dataControllerName': self._serialize.url("data_controller_name", data_controller_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(data_controller_resource, 'DataControllerUpdate') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DataControllerResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + patch_data_controller.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/dataControllers/{dataControllerName}'} # type: ignore diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/operations/_operations.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/operations/_operations.py new file mode 100644 index 000000000000..94732fb29a25 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/operations/_operations.py @@ -0,0 +1,110 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class Operations(object): + """Operations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_arc_data_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.OperationListResult"] + """Lists all of the available Azure Data Services on Azure Arc API operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure_arc_data_management_client.models.OperationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('OperationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.AzureArcData/operations'} # type: ignore diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/operations/_sql_managed_instances_operations.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/operations/_sql_managed_instances_operations.py new file mode 100644 index 000000000000..9c06d6b09103 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/operations/_sql_managed_instances_operations.py @@ -0,0 +1,562 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class SqlManagedInstancesOperations(object): + """SqlManagedInstancesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_arc_data_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SqlManagedInstanceListResult"] + """List sqlManagedInstance resources in the subscription. + + List sqlManagedInstance resources in the subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SqlManagedInstanceListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure_arc_data_management_client.models.SqlManagedInstanceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SqlManagedInstanceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SqlManagedInstanceListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AzureArcData/sqlManagedInstances'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SqlManagedInstanceListResult"] + """List sqlManagedInstance resources in the resource group. + + Gets all sqlManagedInstances in a resource group. + + :param resource_group_name: The name of the Azure resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SqlManagedInstanceListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure_arc_data_management_client.models.SqlManagedInstanceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SqlManagedInstanceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SqlManagedInstanceListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlManagedInstances'} # type: ignore + + def get( + self, + resource_group_name, # type: str + sql_managed_instance_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SqlManagedInstance" + """Retrieves a SQL Managed Instance resource. + + :param resource_group_name: The name of the Azure resource group. + :type resource_group_name: str + :param sql_managed_instance_name: Name of SQL Managed Instance. + :type sql_managed_instance_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SqlManagedInstance, or the result of cls(response) + :rtype: ~azure_arc_data_management_client.models.SqlManagedInstance + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SqlManagedInstance"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'sqlManagedInstanceName': self._serialize.url("sql_managed_instance_name", sql_managed_instance_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SqlManagedInstance', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlManagedInstances/{sqlManagedInstanceName}'} # type: ignore + + def _create_initial( + self, + resource_group_name, # type: str + sql_managed_instance_name, # type: str + sql_managed_instance, # type: "_models.SqlManagedInstance" + **kwargs # type: Any + ): + # type: (...) -> "_models.SqlManagedInstance" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SqlManagedInstance"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'sqlManagedInstanceName': self._serialize.url("sql_managed_instance_name", sql_managed_instance_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(sql_managed_instance, 'SqlManagedInstance') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SqlManagedInstance', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SqlManagedInstance', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlManagedInstances/{sqlManagedInstanceName}'} # type: ignore + + def begin_create( + self, + resource_group_name, # type: str + sql_managed_instance_name, # type: str + sql_managed_instance, # type: "_models.SqlManagedInstance" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.SqlManagedInstance"] + """Creates or replaces a SQL Managed Instance resource. + + :param resource_group_name: The name of the Azure resource group. + :type resource_group_name: str + :param sql_managed_instance_name: The name of SQL Managed Instances. + :type sql_managed_instance_name: str + :param sql_managed_instance: The SQL Managed Instance to be created or updated. + :type sql_managed_instance: ~azure_arc_data_management_client.models.SqlManagedInstance + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either SqlManagedInstance or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure_arc_data_management_client.models.SqlManagedInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SqlManagedInstance"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_initial( + resource_group_name=resource_group_name, + sql_managed_instance_name=sql_managed_instance_name, + sql_managed_instance=sql_managed_instance, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('SqlManagedInstance', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'sqlManagedInstanceName': self._serialize.url("sql_managed_instance_name", sql_managed_instance_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlManagedInstances/{sqlManagedInstanceName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + sql_managed_instance_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'sqlManagedInstanceName': self._serialize.url("sql_managed_instance_name", sql_managed_instance_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlManagedInstances/{sqlManagedInstanceName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + sql_managed_instance_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes a SQL Managed Instance resource. + + :param resource_group_name: The name of the Azure resource group. + :type resource_group_name: str + :param sql_managed_instance_name: The name of Sql Managed Instances. + :type sql_managed_instance_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + sql_managed_instance_name=sql_managed_instance_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'sqlManagedInstanceName': self._serialize.url("sql_managed_instance_name", sql_managed_instance_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlManagedInstances/{sqlManagedInstanceName}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + sql_managed_instance_name, # type: str + parameters, # type: "_models.SqlManagedInstanceUpdate" + **kwargs # type: Any + ): + # type: (...) -> "_models.SqlManagedInstance" + """Updates a SQL Managed Instance resource. + + :param resource_group_name: The name of the Azure resource group. + :type resource_group_name: str + :param sql_managed_instance_name: Name of sqlManagedInstance. + :type sql_managed_instance_name: str + :param parameters: The SQL Managed Instance. + :type parameters: ~azure_arc_data_management_client.models.SqlManagedInstanceUpdate + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SqlManagedInstance, or the result of cls(response) + :rtype: ~azure_arc_data_management_client.models.SqlManagedInstance + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SqlManagedInstance"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'sqlManagedInstanceName': self._serialize.url("sql_managed_instance_name", sql_managed_instance_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'SqlManagedInstanceUpdate') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SqlManagedInstance', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlManagedInstances/{sqlManagedInstanceName}'} # type: ignore diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/operations/_sql_server_instances_operations.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/operations/_sql_server_instances_operations.py new file mode 100644 index 000000000000..768ad1eaf582 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/operations/_sql_server_instances_operations.py @@ -0,0 +1,562 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class SqlServerInstancesOperations(object): + """SqlServerInstancesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_arc_data_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SqlServerInstanceListResult"] + """List sqlServerInstance resources in the subscription. + + List sqlServerInstance resources in the subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SqlServerInstanceListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure_arc_data_management_client.models.SqlServerInstanceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SqlServerInstanceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SqlServerInstanceListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AzureArcData/sqlServerInstances'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SqlServerInstanceListResult"] + """List sqlServerInstance resources in the resource group. + + Gets all sqlServerInstances in a resource group. + + :param resource_group_name: The name of the Azure resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SqlServerInstanceListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure_arc_data_management_client.models.SqlServerInstanceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SqlServerInstanceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SqlServerInstanceListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances'} # type: ignore + + def get( + self, + resource_group_name, # type: str + sql_server_instance_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SqlServerInstance" + """Retrieves a SQL Server Instance resource. + + :param resource_group_name: The name of the Azure resource group. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. + :type sql_server_instance_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SqlServerInstance, or the result of cls(response) + :rtype: ~azure_arc_data_management_client.models.SqlServerInstance + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SqlServerInstance"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'sqlServerInstanceName': self._serialize.url("sql_server_instance_name", sql_server_instance_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SqlServerInstance', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}'} # type: ignore + + def _create_initial( + self, + resource_group_name, # type: str + sql_server_instance_name, # type: str + sql_server_instance, # type: "_models.SqlServerInstance" + **kwargs # type: Any + ): + # type: (...) -> "_models.SqlServerInstance" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SqlServerInstance"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'sqlServerInstanceName': self._serialize.url("sql_server_instance_name", sql_server_instance_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(sql_server_instance, 'SqlServerInstance') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SqlServerInstance', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SqlServerInstance', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}'} # type: ignore + + def begin_create( + self, + resource_group_name, # type: str + sql_server_instance_name, # type: str + sql_server_instance, # type: "_models.SqlServerInstance" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.SqlServerInstance"] + """Creates or replaces a SQL Server Instance resource. + + :param resource_group_name: The name of the Azure resource group. + :type resource_group_name: str + :param sql_server_instance_name: The name of SQL Server Instance. + :type sql_server_instance_name: str + :param sql_server_instance: The SQL Server Instance to be created or updated. + :type sql_server_instance: ~azure_arc_data_management_client.models.SqlServerInstance + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either SqlServerInstance or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure_arc_data_management_client.models.SqlServerInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SqlServerInstance"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_initial( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_name, + sql_server_instance=sql_server_instance, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('SqlServerInstance', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'sqlServerInstanceName': self._serialize.url("sql_server_instance_name", sql_server_instance_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + sql_server_instance_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'sqlServerInstanceName': self._serialize.url("sql_server_instance_name", sql_server_instance_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + sql_server_instance_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes a SQL Server Instance resource. + + :param resource_group_name: The name of the Azure resource group. + :type resource_group_name: str + :param sql_server_instance_name: The name of SQL Server Instance. + :type sql_server_instance_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'sqlServerInstanceName': self._serialize.url("sql_server_instance_name", sql_server_instance_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + sql_server_instance_name, # type: str + parameters, # type: "_models.SqlServerInstanceUpdate" + **kwargs # type: Any + ): + # type: (...) -> "_models.SqlServerInstance" + """Updates a SQL Server Instance resource. + + :param resource_group_name: The name of the Azure resource group. + :type resource_group_name: str + :param sql_server_instance_name: Name of sqlServerInstance. + :type sql_server_instance_name: str + :param parameters: The SQL Server Instance. + :type parameters: ~azure_arc_data_management_client.models.SqlServerInstanceUpdate + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SqlServerInstance, or the result of cls(response) + :rtype: ~azure_arc_data_management_client.models.SqlServerInstance + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SqlServerInstance"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'sqlServerInstanceName': self._serialize.url("sql_server_instance_name", sql_server_instance_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'SqlServerInstanceUpdate') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SqlServerInstance', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}'} # type: ignore diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/py.typed b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/sdk_packaging.toml b/sdk/azurearcdata/azure-mgmt-azurearcdata/sdk_packaging.toml new file mode 100644 index 000000000000..e7ca90eac1d5 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/sdk_packaging.toml @@ -0,0 +1,9 @@ +[packaging] +package_name = "azure-mgmt-azurearcdata" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "Azurearcdata Management" +package_doc_id = "" +is_stable = false +is_arm = true +need_msrestazure = false +need_azuremgmtcore = true diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/setup.cfg b/sdk/azurearcdata/azure-mgmt-azurearcdata/setup.cfg new file mode 100644 index 000000000000..3c6e79cf31da --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/setup.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/setup.py new file mode 100644 index 000000000000..e8339e57c249 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/setup.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python + +#------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +#-------------------------------------------------------------------------- + +import re +import os.path +from io import open +from setuptools import find_packages, setup + +# Change the PACKAGE_NAME only to change folder and different name +PACKAGE_NAME = "azure-mgmt-azurearcdata" +PACKAGE_PPRINT_NAME = "Azurearcdata Management" + +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace('-', '/') +# a-b-c => a.b.c +namespace_name = PACKAGE_NAME.replace('-', '.') + +# azure v0.x is not compatible with this package +# azure v0.x used to have a __version__ attribute (newer versions don't) +try: + import azure + try: + ver = azure.__version__ + raise Exception( + 'This package is incompatible with azure=={}. '.format(ver) + + 'Uninstall it with "pip uninstall azure".' + ) + except AttributeError: + pass +except ImportError: + pass + +# Version extraction inspired from 'requests' +with open(os.path.join(package_folder_path, 'version.py') + if os.path.exists(os.path.join(package_folder_path, 'version.py')) + else os.path.join(package_folder_path, '_version.py'), 'r') as fd: + version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', + fd.read(), re.MULTILINE).group(1) + +if not version: + raise RuntimeError('Cannot find version information') + +with open('README.md', encoding='utf-8') as f: + readme = f.read() +with open('CHANGELOG.md', encoding='utf-8') as f: + changelog = f.read() + +setup( + name=PACKAGE_NAME, + version=version, + description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), + long_description=readme + '\n\n' + changelog, + long_description_content_type='text/markdown', + license='MIT License', + author='Microsoft Corporation', + author_email='azpysdkhelp@microsoft.com', + url='https://github.com/Azure/azure-sdk-for-python', + classifiers=[ + 'Development Status :: 4 - Beta', + 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'License :: OSI Approved :: MIT License', + ], + zip_safe=False, + packages=find_packages(exclude=[ + 'tests', + # Exclude packages that will be covered by PEP420 or nspkg + 'azure', + 'azure.mgmt', + ]), + install_requires=[ + 'msrest>=0.6.21', + 'azure-common~=1.1', + 'azure-mgmt-core>=1.2.0,<2.0.0', + ], + extras_require={ + ":python_version<'3.0'": ['azure-mgmt-nspkg'], + } +) diff --git a/sdk/azurearcdata/ci.yml b/sdk/azurearcdata/ci.yml new file mode 100644 index 000000000000..48168494a8e0 --- /dev/null +++ b/sdk/azurearcdata/ci.yml @@ -0,0 +1,33 @@ +# DO NOT EDIT THIS FILE +# This file is generated automatically and any changes will be lost. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + - restapi* + paths: + include: + - sdk/azurearcdata/ + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + - restapi* + paths: + include: + - sdk/azurearcdata/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: azurearcdata + Artifacts: + - name: azure-mgmt-azurearcdata + safeName: azuremgmtazurearcdata diff --git a/shared_requirements.txt b/shared_requirements.txt index bc96cd664b58..04535562eb8e 100644 --- a/shared_requirements.txt +++ b/shared_requirements.txt @@ -344,3 +344,4 @@ opentelemetry-sdk<2.0.0,>=1.0.0 #override azure-mgmt-security msrest>=0.6.21 #override azure-mgmt-apimanagement msrest>=0.6.21 #override azure-mgmt-relay msrest>=0.6.21 +#override azure-mgmt-azurearcdata msrest>=0.6.21 From ea5eceaaaf43e29364d00f1b1f7cf1c0a717b9d7 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Fri, 17 Sep 2021 10:19:31 -0700 Subject: [PATCH 70/85] Sync eng/common directory with azure-sdk-tools for PR 2010 (#20729) * Remove empty sections in changelog entry as part of prepare release * Update SECTIONS_HEADER_REGEX to accomodate various header levels Co-authored-by: Chidozie Ononiwu --- eng/common/scripts/ChangeLog-Operations.ps1 | 28 ++++++++++++++------- eng/common/scripts/Prepare-Release.ps1 | 2 +- eng/common/scripts/Update-ChangeLog.ps1 | 15 ++--------- 3 files changed, 22 insertions(+), 23 deletions(-) diff --git a/eng/common/scripts/ChangeLog-Operations.ps1 b/eng/common/scripts/ChangeLog-Operations.ps1 index af71628442de..02f498130246 100644 --- a/eng/common/scripts/ChangeLog-Operations.ps1 +++ b/eng/common/scripts/ChangeLog-Operations.ps1 @@ -3,7 +3,7 @@ . "${PSScriptRoot}\SemVer.ps1" $RELEASE_TITLE_REGEX = "(?^\#+\s+(?$([AzureEngSemanticVersion]::SEMVER_REGEX))(\s+(?\(.+\))))" -$SECTIONS_HEADER_REGEX = "^###+\s(?.*)" +$SECTION_HEADER_REGEX_SUFFIX = "##\s(?.*)" $CHANGELOG_UNRELEASED_STATUS = "(Unreleased)" $CHANGELOG_DATE_FORMAT = "yyyy-MM-dd" $RecommendedSectionHeaders = @("Features Added", "Breaking Changes", "Bugs Fixed", "Other Changes") @@ -49,6 +49,7 @@ function Get-ChangeLogEntriesFromContent { $initialAtxHeader = $matches["HeaderLevel"] } + $sectionHeaderRegex = "^${initialAtxHeader}${SECTION_HEADER_REGEX_SUFFIX}" $changeLogEntries | Add-Member -NotePropertyName "InitialAtxHeader" -NotePropertyValue $initialAtxHeader $releaseTitleAtxHeader = $initialAtxHeader + "#" @@ -67,7 +68,7 @@ function Get-ChangeLogEntriesFromContent { } else { if ($changeLogEntry) { - if ($line.Trim() -match $SECTIONS_HEADER_REGEX) + if ($line.Trim() -match $sectionHeaderRegex) { $sectionName = $matches["sectionName"].Trim() $changeLogEntry.Sections[$sectionName] = @() @@ -136,16 +137,24 @@ function Confirm-ChangeLogEntry { [String]$ChangeLogLocation, [Parameter(Mandatory = $true)] [String]$VersionString, - [boolean]$ForRelease = $false + [boolean]$ForRelease = $false, + [Switch]$SantizeEntry ) - $changeLogEntry = Get-ChangeLogEntry -ChangeLogLocation $ChangeLogLocation -VersionString $VersionString + $changeLogEntries = Get-ChangeLogEntries -ChangeLogLocation $ChangeLogLocation + $changeLogEntry = $changeLogEntries[$VersionString] if (!$changeLogEntry) { LogError "ChangeLog[${ChangeLogLocation}] does not have an entry for version ${VersionString}." return $false } + if ($SantizeEntry) + { + Remove-EmptySections -ChangeLogEntry $changeLogEntry -InitialAtxHeader $changeLogEntries.InitialAtxHeader + Set-ChangeLogContent -ChangeLogLocation $ChangeLogLocation -ChangeLogEntries $changeLogEntries + } + Write-Host "Found the following change log entry for version '${VersionString}' in [${ChangeLogLocation}]." Write-Host "-----" Write-Host (ChangeLogEntryAsString $changeLogEntry) @@ -308,9 +317,11 @@ function Set-ChangeLogContent { function Remove-EmptySections { param ( [Parameter(Mandatory = $true)] - $ChangeLogEntry + $ChangeLogEntry, + $InitialAtxHeader = "#" ) + $sectionHeaderRegex = "^${InitialAtxHeader}${SECTION_HEADER_REGEX_SUFFIX}" $releaseContent = $ChangeLogEntry.ReleaseContent if ($releaseContent.Count -gt 0) @@ -318,14 +329,14 @@ function Remove-EmptySections { $parsedSections = $ChangeLogEntry.Sections $sanitizedReleaseContent = New-Object System.Collections.ArrayList(,$releaseContent) - foreach ($key in @($parsedSections.Key)) + foreach ($key in @($parsedSections.Keys)) { if ([System.String]::IsNullOrWhiteSpace($parsedSections[$key])) { for ($i = 0; $i -lt $sanitizedReleaseContent.Count; $i++) { $line = $sanitizedReleaseContent[$i] - if ($line -match $SECTIONS_HEADER_REGEX -and $matches["sectionName"].Trim() -eq $key) + if ($line -match $sectionHeaderRegex -and $matches["sectionName"].Trim() -eq $key) { $sanitizedReleaseContent.RemoveAt($i) while($i -lt $sanitizedReleaseContent.Count -and [System.String]::IsNullOrWhiteSpace($sanitizedReleaseContent[$i])) @@ -340,5 +351,4 @@ function Remove-EmptySections { } $ChangeLogEntry.ReleaseContent = $sanitizedReleaseContent.ToArray() } - return $changeLogEntry -} +} \ No newline at end of file diff --git a/eng/common/scripts/Prepare-Release.ps1 b/eng/common/scripts/Prepare-Release.ps1 index 21f4f256830e..2005347822fd 100644 --- a/eng/common/scripts/Prepare-Release.ps1 +++ b/eng/common/scripts/Prepare-Release.ps1 @@ -184,7 +184,7 @@ else exit 1 } -$changelogIsValid = Confirm-ChangeLogEntry -ChangeLogLocation $packageProperties.ChangeLogPath -VersionString $newVersion -ForRelease $true +$changelogIsValid = Confirm-ChangeLogEntry -ChangeLogLocation $packageProperties.ChangeLogPath -VersionString $newVersion -ForRelease $true -SantizeEntry if (!$changelogIsValid) { diff --git a/eng/common/scripts/Update-ChangeLog.ps1 b/eng/common/scripts/Update-ChangeLog.ps1 index 9b9797e083a7..6e09f369cec1 100644 --- a/eng/common/scripts/Update-ChangeLog.ps1 +++ b/eng/common/scripts/Update-ChangeLog.ps1 @@ -4,7 +4,6 @@ # Version : Version to add or replace in change log # Unreleased: Default is true. If it is set to false, then today's date will be set in verion title. If it is True then title will show "Unreleased" # ReplaceLatestEntryTitle: Replaces the latest changelog entry title. -# SanitizeEntry: Removes all empty section in the entry that is updated param ( [Parameter(Mandatory = $true)] @@ -14,8 +13,7 @@ param ( [Boolean]$Unreleased = $true, [Boolean]$ReplaceLatestEntryTitle = $false, [String]$ChangelogPath, - [String]$ReleaseDate, - [Boolean]$SanitizeEntry = $false + [String]$ReleaseDate ) Set-StrictMode -Version 3 @@ -108,12 +106,7 @@ if ($LatestsSorted[0] -ne $Version) { if ($ReplaceLatestEntryTitle) { - $entryToBeUpdated = $ChangeLogEntries[$LatestVersion] - if ($SanitizeEntry) - { - $entryToBeUpdated = Remove-EmptySections -ChangeLogEntry $entryToBeUpdated - } - $newChangeLogEntry = New-ChangeLogEntry -Version $Version -Status $ReleaseStatus -InitialAtxHeader $ChangeLogEntries.InitialAtxHeader -Content $entryToBeUpdated + $newChangeLogEntry = New-ChangeLogEntry -Version $Version -Status $ReleaseStatus -InitialAtxHeader $ChangeLogEntries.InitialAtxHeader -Content $ChangeLogEntries[$LatestVersion].ReleaseContent LogDebug "Resetting latest entry title to [$($newChangeLogEntry.ReleaseTitle)]" $ChangeLogEntries.Remove($LatestVersion) if ($newChangeLogEntry) { @@ -129,10 +122,6 @@ elseif ($ChangeLogEntries.Contains($Version)) LogDebug "Updating ReleaseStatus for Version [$Version] to [$($ReleaseStatus)]" $ChangeLogEntries[$Version].ReleaseStatus = $ReleaseStatus $ChangeLogEntries[$Version].ReleaseTitle = "$($ChangeLogEntries.InitialAtxHeader)# $Version $ReleaseStatus" - if ($SanitizeEntry) - { - $ChangeLogEntries[$Version] = Remove-EmptySections -ChangeLogEntry $ChangeLogEntries[$Version] - } } else { From cbfacbd735eb3981b11fcd7ed1d3b2090e1b2348 Mon Sep 17 00:00:00 2001 From: Xiaoxi Fu <49707495+xiafu-msft@users.noreply.github.com> Date: Fri, 17 Sep 2021 14:04:28 -0700 Subject: [PATCH 71/85] [Storage]Unify service version and update changelog (#20723) * [Storage]Unify service version and update changelog * fix test --- sdk/storage/azure-storage-blob/CHANGELOG.md | 7 +++++ .../azure/storage/blob/_blob_client.py | 3 +-- .../storage/blob/_blob_service_client.py | 3 +-- .../azure/storage/blob/_container_client.py | 3 +-- .../azure/storage/blob/_serialize.py | 6 ++--- .../azure/storage/blob/_version.py | 2 +- .../storage/blob/aio/_blob_client_async.py | 3 +-- .../blob/aio/_blob_service_client_async.py | 3 +-- .../blob/aio/_container_client_async.py | 3 +-- sdk/storage/azure-storage-blob/setup.py | 2 +- .../azure-storage-file-datalake/CHANGELOG.md | 5 ++++ .../_data_lake_directory_client.py | 2 ++ .../filedatalake/_data_lake_service_client.py | 9 ++++++- .../filedatalake/_file_system_client.py | 7 ++++- .../storage/filedatalake/_path_client.py | 8 +++++- .../azure/storage/filedatalake/_serialize.py | 22 ++++++++++++++++ .../azure/storage/filedatalake/_version.py | 2 +- .../aio/_data_lake_directory_client_async.py | 2 ++ .../aio/_data_lake_service_client_async.py | 5 ++++ .../aio/_file_system_client_async.py | 7 +++++ .../filedatalake/aio/_path_client_async.py | 5 ++++ .../azure-storage-file-datalake/setup.py | 2 +- .../tests/test_directory.py | 25 ++++++++++++++++++ .../tests/test_directory_async.py | 24 +++++++++++++++++ .../azure-storage-file-share/CHANGELOG.md | 5 ++++ .../storage/fileshare/_directory_client.py | 3 +-- .../azure/storage/fileshare/_file_client.py | 3 +-- .../azure/storage/fileshare/_serialize.py | 8 +++--- .../azure/storage/fileshare/_share_client.py | 3 +-- .../fileshare/_share_service_client.py | 3 +-- .../azure/storage/fileshare/_version.py | 2 +- .../fileshare/aio/_directory_client_async.py | 3 +-- .../fileshare/aio/_file_client_async.py | 3 +-- .../fileshare/aio/_share_client_async.py | 3 +-- .../aio/_share_service_client_async.py | 3 +-- sdk/storage/azure-storage-file-share/setup.py | 2 +- .../azure/storage/queue/_queue_client.py | 4 +-- .../storage/queue/_queue_service_client.py | 4 +-- .../azure/storage/queue/_serialize.py | 26 +++++++++++++++++++ .../storage/queue/aio/_queue_client_async.py | 4 +-- .../queue/aio/_queue_service_client_async.py | 4 +-- .../tests/test_queue_api_version.py | 5 ++-- .../tests/test_queue_api_version_async.py | 5 ++-- .../tests/test_queue_client.py | 3 +++ .../tests/test_queue_client_async.py | 2 ++ 45 files changed, 203 insertions(+), 55 deletions(-) create mode 100644 sdk/storage/azure-storage-queue/azure/storage/queue/_serialize.py diff --git a/sdk/storage/azure-storage-blob/CHANGELOG.md b/sdk/storage/azure-storage-blob/CHANGELOG.md index 0142c75381fa..6d927065b034 100644 --- a/sdk/storage/azure-storage-blob/CHANGELOG.md +++ b/sdk/storage/azure-storage-blob/CHANGELOG.md @@ -1,5 +1,12 @@ # Release History +## 12.9.0 (2021-09-15) +**Stable release of preview features** +- Added support for service version 2020-10-02 (STG78) +- Added support for object level immutability policy with versioning (Version Level WORM). +- Added support for listing deleted root blobs that have versions. +- Added OAuth support for sync copy blob source. + ## 12.9.0b1 (2021-07-27) **New Features** - Added support for object level immutability policy with versioning (Version Level WORM). diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_blob_client.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_blob_client.py index e1b1b51e8e78..902c01338b80 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_blob_client.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_blob_client.py @@ -176,8 +176,7 @@ def __init__( self._query_str, credential = self._format_query_string(sas_token, credential, snapshot=self.snapshot) super(BlobClient, self).__init__(parsed_url, service='blob', credential=credential, **kwargs) self._client = AzureBlobStorage(self.url, pipeline=self._pipeline) - default_api_version = self._client._config.version # pylint: disable=protected-access - self._client._config.version = get_api_version(kwargs, default_api_version) # pylint: disable=protected-access + self._client._config.version = get_api_version(kwargs) # pylint: disable=protected-access def _format_url(self, hostname): container_name = self.container_name diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_blob_service_client.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_blob_service_client.py index d277a094921a..33b61202934e 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_blob_service_client.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_blob_service_client.py @@ -134,8 +134,7 @@ def __init__( self._query_str, credential = self._format_query_string(sas_token, credential) super(BlobServiceClient, self).__init__(parsed_url, service='blob', credential=credential, **kwargs) self._client = AzureBlobStorage(self.url, pipeline=self._pipeline) - default_api_version = self._client._config.version # pylint: disable=protected-access - self._client._config.version = get_api_version(kwargs, default_api_version) # pylint: disable=protected-access + self._client._config.version = get_api_version(kwargs) # pylint: disable=protected-access def _format_url(self, hostname): """Format the endpoint URL according to the current location diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_container_client.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_container_client.py index 82bfe1b04110..59f17d6cfd9b 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_container_client.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_container_client.py @@ -156,8 +156,7 @@ def __init__( self._query_str, credential = self._format_query_string(sas_token, credential) super(ContainerClient, self).__init__(parsed_url, service='blob', credential=credential, **kwargs) self._client = AzureBlobStorage(self.url, pipeline=self._pipeline) - default_api_version = self._client._config.version # pylint: disable=protected-access - self._client._config.version = get_api_version(kwargs, default_api_version) # pylint: disable=protected-access + self._client._config.version = get_api_version(kwargs) # pylint: disable=protected-access def _format_url(self, hostname): container_name = self.container_name diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_serialize.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_serialize.py index 701a88ae408e..d44c5ade481b 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_serialize.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_serialize.py @@ -126,13 +126,13 @@ def get_container_cpk_scope_info(kwargs): return None -def get_api_version(kwargs, default): +def get_api_version(kwargs): # type: (Dict[str, Any], str) -> str - api_version = kwargs.pop('api_version', None) + api_version = kwargs.get('api_version', None) if api_version and api_version not in _SUPPORTED_API_VERSIONS: versions = '\n'.join(_SUPPORTED_API_VERSIONS) raise ValueError("Unsupported API version '{}'. Please select from:\n{}".format(api_version, versions)) - return api_version or default + return api_version or _SUPPORTED_API_VERSIONS[-1] def serialize_blob_tags_header(tags=None): diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_version.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_version.py index b21fcd5488bb..68dc9539e3f5 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_version.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_version.py @@ -4,4 +4,4 @@ # license information. # -------------------------------------------------------------------------- -VERSION = "12.9.0b1" +VERSION = "12.9.0" diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_blob_client_async.py b/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_blob_client_async.py index d75943b97c97..97b412ec1b0f 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_blob_client_async.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_blob_client_async.py @@ -120,8 +120,7 @@ def __init__( credential=credential, **kwargs) self._client = AzureBlobStorage(url=self.url, pipeline=self._pipeline) - default_api_version = self._client._config.version # pylint: disable=protected-access - self._client._config.version = get_api_version(kwargs, default_api_version) # pylint: disable=protected-access + self._client._config.version = get_api_version(kwargs) # pylint: disable=protected-access @distributed_trace_async async def get_account_information(self, **kwargs): # type: ignore diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_blob_service_client_async.py b/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_blob_service_client_async.py index d50661d8e2d7..9cb1563f9f43 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_blob_service_client_async.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_blob_service_client_async.py @@ -118,8 +118,7 @@ def __init__( credential=credential, **kwargs) self._client = AzureBlobStorage(url=self.url, pipeline=self._pipeline) - default_api_version = self._client._config.version # pylint: disable=protected-access - self._client._config.version = get_api_version(kwargs, default_api_version) # pylint: disable=protected-access + self._client._config.version = get_api_version(kwargs) # pylint: disable=protected-access @distributed_trace_async async def get_user_delegation_key(self, key_start_time, # type: datetime diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_container_client_async.py b/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_container_client_async.py index 794bc55c7f84..2f73b9c077e5 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_container_client_async.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_container_client_async.py @@ -117,8 +117,7 @@ def __init__( credential=credential, **kwargs) self._client = AzureBlobStorage(url=self.url, pipeline=self._pipeline) - default_api_version = self._client._config.version # pylint: disable=protected-access - self._client._config.version = get_api_version(kwargs, default_api_version) # pylint: disable=protected-access + self._client._config.version = get_api_version(kwargs) # pylint: disable=protected-access @distributed_trace_async async def create_container(self, metadata=None, public_access=None, **kwargs): diff --git a/sdk/storage/azure-storage-blob/setup.py b/sdk/storage/azure-storage-blob/setup.py index 41aa96cccedd..dad24446aab3 100644 --- a/sdk/storage/azure-storage-blob/setup.py +++ b/sdk/storage/azure-storage-blob/setup.py @@ -72,7 +72,7 @@ author_email='ascl@microsoft.com', url='https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/storage/azure-storage-blob', classifiers=[ - 'Development Status :: 4 - Beta', + "Development Status :: 5 - Production/Stable", 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', diff --git a/sdk/storage/azure-storage-file-datalake/CHANGELOG.md b/sdk/storage/azure-storage-file-datalake/CHANGELOG.md index 26b20a054ad1..7dee9165ed9f 100644 --- a/sdk/storage/azure-storage-file-datalake/CHANGELOG.md +++ b/sdk/storage/azure-storage-file-datalake/CHANGELOG.md @@ -1,5 +1,10 @@ # Release History +## 12.5.0 (2021-09-15) +**Stable release of preview features** +- Added support for service version 2020-10-02 (STG78) +- Added support for quick query parquet + ## 12.5.0b1 (2021-07-27) **New features** - Added support for quick query parquet diff --git a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_data_lake_directory_client.py b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_data_lake_directory_client.py index c42391e6071b..042fa0551590 100644 --- a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_data_lake_directory_client.py +++ b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_data_lake_directory_client.py @@ -527,6 +527,7 @@ def get_file_client(self, file # type: Union[FileProperties, str] ) return DataLakeFileClient( self.url, self.file_system_name, file_path=file_path, credential=self._raw_credential, + api_version=self.api_version, _hosts=self._hosts, _configuration=self._config, _pipeline=self._pipeline, require_encryption=self.require_encryption, key_encryption_key=self.key_encryption_key, @@ -557,6 +558,7 @@ def get_sub_directory_client(self, sub_directory # type: Union[DirectoryPropert ) return DataLakeDirectoryClient( self.url, self.file_system_name, directory_name=subdir_path, credential=self._raw_credential, + api_version=self.api_version, _hosts=self._hosts, _configuration=self._config, _pipeline=self._pipeline, require_encryption=self.require_encryption, key_encryption_key=self.key_encryption_key, diff --git a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_data_lake_service_client.py b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_data_lake_service_client.py index 211df05827c2..776b98cda9d6 100644 --- a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_data_lake_service_client.py +++ b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_data_lake_service_client.py @@ -20,7 +20,8 @@ from ._data_lake_directory_client import DataLakeDirectoryClient from ._data_lake_file_client import DataLakeFileClient from ._models import UserDelegationKey, FileSystemPropertiesPaged, LocationMode -from ._serialize import convert_dfs_url_to_blob_url +from ._serialize import convert_dfs_url_to_blob_url, get_api_version +from ._generated import AzureDataLakeStorageRESTAPI class DataLakeServiceClient(StorageAccountHostsMixin): @@ -94,6 +95,9 @@ def __init__( # ADLS doesn't support secondary endpoint, make sure it's empty self._hosts[LocationMode.SECONDARY] = "" + self._client = AzureDataLakeStorageRESTAPI(self.url, pipeline=self._pipeline) + self._client._config.version = get_api_version(kwargs) #pylint: disable=protected-access + def __enter__(self): self._blob_service_client.__enter__() return self @@ -388,6 +392,7 @@ def get_file_system_client(self, file_system # type: Union[FileSystemProperties policies=self._pipeline._impl_policies # pylint: disable = protected-access ) return FileSystemClient(self.url, file_system_name, credential=self._raw_credential, + api_version=self.api_version, _configuration=self._config, _pipeline=_pipeline, _hosts=self._hosts, require_encryption=self.require_encryption, key_encryption_key=self.key_encryption_key, @@ -436,6 +441,7 @@ def get_directory_client(self, file_system, # type: Union[FileSystemProperties, ) return DataLakeDirectoryClient(self.url, file_system_name, directory_name=directory_name, credential=self._raw_credential, + api_version=self.api_version, _configuration=self._config, _pipeline=_pipeline, _hosts=self._hosts, require_encryption=self.require_encryption, @@ -486,6 +492,7 @@ def get_file_client(self, file_system, # type: Union[FileSystemProperties, str] ) return DataLakeFileClient( self.url, file_system_name, file_path=file_path, credential=self._raw_credential, + api_version=self.api_version, _hosts=self._hosts, _configuration=self._config, _pipeline=_pipeline, require_encryption=self.require_encryption, key_encryption_key=self.key_encryption_key, diff --git a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_file_system_client.py b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_file_system_client.py index 94af506b5a3f..148943c12cda 100644 --- a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_file_system_client.py +++ b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_file_system_client.py @@ -19,7 +19,7 @@ from azure.core.paging import ItemPaged from azure.storage.blob import ContainerClient from ._shared.base_client import TransportWrapper, StorageAccountHostsMixin, parse_query, parse_connection_str -from ._serialize import convert_dfs_url_to_blob_url +from ._serialize import convert_dfs_url_to_blob_url, get_api_version from ._list_paths_helper import DeletedPathPropertiesPaged from ._models import LocationMode, FileSystemProperties, PublicAccess, DeletedPathProperties, FileProperties, \ DirectoryProperties @@ -105,9 +105,12 @@ def __init__( # ADLS doesn't support secondary endpoint, make sure it's empty self._hosts[LocationMode.SECONDARY] = "" self._client = AzureDataLakeStorageRESTAPI(self.url, file_system=file_system_name, pipeline=self._pipeline) + api_version = get_api_version(kwargs) + self._client._config.version = api_version # pylint: disable=protected-access self._datalake_client_for_blob_operation = AzureDataLakeStorageRESTAPI(self._container_client.url, file_system=file_system_name, pipeline=self._pipeline) + self._datalake_client_for_blob_operation._config.version = api_version # pylint: disable=protected-access def _format_url(self, hostname): file_system_name = self.file_system_name @@ -839,6 +842,7 @@ def get_directory_client(self, directory # type: Union[DirectoryProperties, str ) return DataLakeDirectoryClient(self.url, self.file_system_name, directory_name=directory_name, credential=self._raw_credential, + api_version=self.api_version, _configuration=self._config, _pipeline=_pipeline, _hosts=self._hosts, require_encryption=self.require_encryption, @@ -879,6 +883,7 @@ def get_file_client(self, file_path # type: Union[FileProperties, str] ) return DataLakeFileClient( self.url, self.file_system_name, file_path=file_path, credential=self._raw_credential, + api_version=self.api_version, _hosts=self._hosts, _configuration=self._config, _pipeline=_pipeline, require_encryption=self.require_encryption, key_encryption_key=self.key_encryption_key, diff --git a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_path_client.py b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_path_client.py index 8f0f58869fe3..16983811ed5a 100644 --- a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_path_client.py +++ b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_path_client.py @@ -22,7 +22,8 @@ from ._models import LocationMode, DirectoryProperties, AccessControlChangeResult, AccessControlChanges, \ AccessControlChangeCounters, AccessControlChangeFailure from ._serialize import convert_dfs_url_to_blob_url, get_mod_conditions, \ - get_path_http_headers, add_metadata_headers, get_lease_id, get_source_mod_conditions, get_access_conditions + get_path_http_headers, add_metadata_headers, get_lease_id, get_source_mod_conditions, get_access_conditions, \ + get_api_version from ._shared.base_client import StorageAccountHostsMixin, parse_query from ._shared.response_handlers import return_response_headers, return_headers_and_deserialized @@ -81,13 +82,18 @@ def __init__( _hosts=datalake_hosts, **kwargs) # ADLS doesn't support secondary endpoint, make sure it's empty self._hosts[LocationMode.SECONDARY] = "" + api_version = get_api_version(kwargs) + self._client = AzureDataLakeStorageRESTAPI(self.url, file_system=file_system_name, path=path_name, pipeline=self._pipeline) + self._client._config.version = api_version # pylint: disable=protected-access + self._datalake_client_for_blob_operation = AzureDataLakeStorageRESTAPI( self._blob_client.url, file_system=file_system_name, path=path_name, pipeline=self._pipeline) + self._datalake_client_for_blob_operation._config.version = api_version # pylint: disable=protected-access def __exit__(self, *args): self._blob_client.close() diff --git a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_serialize.py b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_serialize.py index 9d700bfb029f..304e043629fa 100644 --- a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_serialize.py +++ b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_serialize.py @@ -9,6 +9,28 @@ SourceModifiedAccessConditions, LeaseAccessConditions +_SUPPORTED_API_VERSIONS = [ + '2019-02-02', + '2019-07-07', + '2019-10-10', + '2019-12-12', + '2020-02-10', + '2020-04-08', + '2020-06-12', + '2020-08-04', + '2020-10-02' +] + + +def get_api_version(kwargs): + # type: (Dict[str, Any], str) -> str + api_version = kwargs.get('api_version', None) + if api_version and api_version not in _SUPPORTED_API_VERSIONS: + versions = '\n'.join(_SUPPORTED_API_VERSIONS) + raise ValueError("Unsupported API version '{}'. Please select from:\n{}".format(api_version, versions)) + return api_version or _SUPPORTED_API_VERSIONS[-1] + + def convert_dfs_url_to_blob_url(dfs_account_url): return dfs_account_url.replace('.dfs.', '.blob.', 1) diff --git a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_version.py b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_version.py index bfd3230dfa42..d731da5c4072 100644 --- a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_version.py +++ b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_version.py @@ -4,4 +4,4 @@ # license information. # -------------------------------------------------------------------------- -VERSION = "12.5.0b1" +VERSION = "12.5.0" diff --git a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_data_lake_directory_client_async.py b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_data_lake_directory_client_async.py index 7d0adefd2680..6254efbbfa9f 100644 --- a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_data_lake_directory_client_async.py +++ b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_data_lake_directory_client_async.py @@ -506,6 +506,7 @@ def get_file_client(self, file # type: Union[FileProperties, str] ) return DataLakeFileClient( self.url, self.file_system_name, file_path=file_path, credential=self._raw_credential, + api_version=self.api_version, _hosts=self._hosts, _configuration=self._config, _pipeline=self._pipeline, _location_mode=self._location_mode, require_encryption=self.require_encryption, key_encryption_key=self.key_encryption_key, @@ -545,6 +546,7 @@ def get_sub_directory_client(self, sub_directory # type: Union[DirectoryPropert ) return DataLakeDirectoryClient( self.url, self.file_system_name, directory_name=subdir_path, credential=self._raw_credential, + api_version=self.api_version, _hosts=self._hosts, _configuration=self._config, _pipeline=self._pipeline, _location_mode=self._location_mode, require_encryption=self.require_encryption, key_encryption_key=self.key_encryption_key, diff --git a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_data_lake_service_client_async.py b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_data_lake_service_client_async.py index 76493e89c5b6..44aae0a5e85f 100644 --- a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_data_lake_service_client_async.py +++ b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_data_lake_service_client_async.py @@ -10,6 +10,7 @@ from azure.core.pipeline import AsyncPipeline from azure.storage.blob.aio import BlobServiceClient +from .._serialize import get_api_version from .._generated.aio import AzureDataLakeStorageRESTAPI from .._deserialize import get_datalake_service_properties from .._shared.base_client_async import AsyncTransportWrapper, AsyncStorageAccountHostsMixin @@ -80,6 +81,7 @@ def __init__( self._blob_service_client = BlobServiceClient(self._blob_account_url, credential, **kwargs) self._blob_service_client._hosts[LocationMode.SECONDARY] = "" #pylint: disable=protected-access self._client = AzureDataLakeStorageRESTAPI(self.url, pipeline=self._pipeline) + self._client._config.version = get_api_version(kwargs) #pylint: disable=protected-access self._loop = kwargs.get('loop', None) async def __aenter__(self): @@ -337,6 +339,7 @@ def get_file_system_client(self, file_system # type: Union[FileSystemProperties policies=self._pipeline._impl_policies # pylint: disable = protected-access ) return FileSystemClient(self.url, file_system_name, credential=self._raw_credential, + api_version=self.api_version, _configuration=self._config, _pipeline=self._pipeline, _hosts=self._hosts, require_encryption=self.require_encryption, key_encryption_key=self.key_encryption_key, @@ -385,6 +388,7 @@ def get_directory_client(self, file_system, # type: Union[FileSystemProperties, ) return DataLakeDirectoryClient(self.url, file_system_name, directory_name=directory_name, credential=self._raw_credential, + api_version=self.api_version, _configuration=self._config, _pipeline=self._pipeline, _hosts=self._hosts, require_encryption=self.require_encryption, @@ -435,6 +439,7 @@ def get_file_client(self, file_system, # type: Union[FileSystemProperties, str] ) return DataLakeFileClient( self.url, file_system_name, file_path=file_path, credential=self._raw_credential, + api_version=self.api_version, _hosts=self._hosts, _configuration=self._config, _pipeline=self._pipeline, require_encryption=self.require_encryption, key_encryption_key=self.key_encryption_key, diff --git a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_file_system_client_async.py b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_file_system_client_async.py index 02f71424e1a0..90ace3e50697 100644 --- a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_file_system_client_async.py +++ b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_file_system_client_async.py @@ -18,6 +18,7 @@ from azure.core.tracing.decorator_async import distributed_trace_async from azure.storage.blob.aio import ContainerClient +from .._serialize import get_api_version from .._deserialize import process_storage_error, is_file_path from .._generated.models import ListBlobsIncludeItem @@ -98,6 +99,10 @@ def __init__( self._datalake_client_for_blob_operation = AzureDataLakeStorageRESTAPI(self._container_client.url, file_system=file_system_name, pipeline=self._pipeline) + api_version = get_api_version(kwargs) + self._client._config.version = api_version # pylint: disable=protected-access + self._datalake_client_for_blob_operation._config.version = api_version # pylint: disable=protected-access + self._loop = kwargs.get('loop', None) async def __aexit__(self, *args): @@ -787,6 +792,7 @@ def get_directory_client(self, directory # type: Union[DirectoryProperties, str ) return DataLakeDirectoryClient(self.url, self.file_system_name, directory_name=directory_name, credential=self._raw_credential, + api_version=self.api_version, _configuration=self._config, _pipeline=_pipeline, _hosts=self._hosts, require_encryption=self.require_encryption, @@ -828,6 +834,7 @@ def get_file_client(self, file_path # type: Union[FileProperties, str] ) return DataLakeFileClient( self.url, self.file_system_name, file_path=file_path, credential=self._raw_credential, + api_version=self.api_version, _hosts=self._hosts, _configuration=self._config, _pipeline=_pipeline, require_encryption=self.require_encryption, key_encryption_key=self.key_encryption_key, diff --git a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_path_client_async.py b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_path_client_async.py index 80c43d77704d..42d783c4350d 100644 --- a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_path_client_async.py +++ b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_path_client_async.py @@ -9,6 +9,7 @@ from azure.core.exceptions import AzureError, HttpResponseError from azure.storage.blob.aio import BlobClient +from .._serialize import get_api_version from .._shared.base_client_async import AsyncStorageAccountHostsMixin from .._path_client import PathClient as PathClientBase from .._models import DirectoryProperties, AccessControlChangeResult, AccessControlChangeFailure, \ @@ -53,6 +54,10 @@ def __init__( file_system=file_system_name, path=path_name, pipeline=self._pipeline) + api_version = get_api_version(kwargs) + self._client._config.version = api_version # pylint: disable=protected-access + self._datalake_client_for_blob_operation._config.version = api_version # pylint: disable=protected-access + self._loop = kwargs.get('loop', None) async def __aexit__(self, *args): diff --git a/sdk/storage/azure-storage-file-datalake/setup.py b/sdk/storage/azure-storage-file-datalake/setup.py index 371bef74bbbb..7c4e0eea3688 100644 --- a/sdk/storage/azure-storage-file-datalake/setup.py +++ b/sdk/storage/azure-storage-file-datalake/setup.py @@ -73,7 +73,7 @@ author_email='ascl@microsoft.com', url='https://github.com/Azure/azure-sdk-for-python', classifiers=[ - 'Development Status :: 4 - Beta', + "Development Status :: 5 - Production/Stable", 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', diff --git a/sdk/storage/azure-storage-file-datalake/tests/test_directory.py b/sdk/storage/azure-storage-file-datalake/tests/test_directory.py index 95afd9d4a3c4..f92fd49a1745 100644 --- a/sdk/storage/azure-storage-file-datalake/tests/test_directory.py +++ b/sdk/storage/azure-storage-file-datalake/tests/test_directory.py @@ -16,6 +16,8 @@ generate_file_system_sas, FileSystemSasPermissions from azure.storage.filedatalake import DataLakeServiceClient, generate_directory_sas from azure.storage.filedatalake._models import AccessControlChangeResult, AccessControlChangeCounters +from azure.storage.filedatalake._serialize import _SUPPORTED_API_VERSIONS + from testcase import ( StorageTestCase, @@ -1113,6 +1115,29 @@ def test_using_directory_sas_to_create_file(self, datalake_storage_account_name, with self.assertRaises(HttpResponseError): directory_client.delete_directory() + + @DataLakePreparer() + def test_using_directory_sas_to_create_file(self, datalake_storage_account_name, datalake_storage_account_key): + newest_api_version = _SUPPORTED_API_VERSIONS[-1] + + service_client = DataLakeServiceClient("https://abc.dfs.core.windows.net", credential='fake') + filesys_client = service_client.get_file_system_client("filesys") + dir_client = DataLakeDirectoryClient("https://abc.dfs.core.windows.net", "filesys", "dir", credential='fake') + file_client = dir_client.get_file_client("file") + self.assertEqual(service_client.api_version, newest_api_version) + self.assertEqual(filesys_client.api_version, newest_api_version) + self.assertEqual(dir_client.api_version, newest_api_version) + self.assertEqual(file_client.api_version, newest_api_version) + + service_client2 = DataLakeServiceClient("https://abc.dfs.core.windows.net", credential='fake', api_version="2019-02-02") + filesys_client2 = service_client2.get_file_system_client("filesys") + dir_client2 = DataLakeDirectoryClient("https://abc.dfs.core.windows.net", "filesys", "dir", credential='fake', api_version="2019-02-02") + file_client2 = dir_client2.get_file_client("file") + self.assertEqual(service_client2.api_version, "2019-02-02") + self.assertEqual(filesys_client2.api_version, "2019-02-02") + self.assertEqual(dir_client2.api_version, "2019-02-02") + self.assertEqual(file_client2.api_version, "2019-02-02") + # ------------------------------------------------------------------------------ if __name__ == '__main__': unittest.main() diff --git a/sdk/storage/azure-storage-file-datalake/tests/test_directory_async.py b/sdk/storage/azure-storage-file-datalake/tests/test_directory_async.py index 6a2845d39e8c..75b6d0c3d5e9 100644 --- a/sdk/storage/azure-storage-file-datalake/tests/test_directory_async.py +++ b/sdk/storage/azure-storage-file-datalake/tests/test_directory_async.py @@ -21,6 +21,7 @@ from azure.storage.filedatalake import generate_directory_sas from azure.storage.filedatalake.aio import DataLakeServiceClient, DataLakeDirectoryClient from azure.storage.filedatalake import AccessControlChangeResult, AccessControlChangeCounters +from azure.storage.filedatalake._serialize import _SUPPORTED_API_VERSIONS from asynctestcase import ( StorageTestCase, @@ -1086,6 +1087,29 @@ async def test_using_directory_sas_to_create_async(self, datalake_storage_accoun response = await directory_client.create_directory() self.assertIsNotNone(response) + @DataLakePreparer() + def test_using_directory_sas_to_create_file(self, datalake_storage_account_name, datalake_storage_account_key): + newest_api_version = _SUPPORTED_API_VERSIONS[-1] + + service_client = DataLakeServiceClient("https://abc.dfs.core.windows.net", credential='fake') + filesys_client = service_client.get_file_system_client("filesys") + dir_client = DataLakeDirectoryClient("https://abc.dfs.core.windows.net", "filesys", "dir", credential='fake') + file_client = dir_client.get_file_client("file") + self.assertEqual(service_client.api_version, newest_api_version) + self.assertEqual(filesys_client.api_version, newest_api_version) + self.assertEqual(dir_client.api_version, newest_api_version) + self.assertEqual(file_client.api_version, newest_api_version) + + service_client2 = DataLakeServiceClient("https://abc.dfs.core.windows.net", credential='fake', + api_version="2019-02-02") + filesys_client2 = service_client2.get_file_system_client("filesys") + dir_client2 = DataLakeDirectoryClient("https://abc.dfs.core.windows.net", "filesys", "dir", credential='fake', + api_version="2019-02-02") + file_client2 = dir_client2.get_file_client("file") + self.assertEqual(service_client2.api_version, "2019-02-02") + self.assertEqual(filesys_client2.api_version, "2019-02-02") + self.assertEqual(dir_client2.api_version, "2019-02-02") + self.assertEqual(file_client2.api_version, "2019-02-02") # ------------------------------------------------------------------------------ if __name__ == '__main__': diff --git a/sdk/storage/azure-storage-file-share/CHANGELOG.md b/sdk/storage/azure-storage-file-share/CHANGELOG.md index 38fb1e05b25d..e61e3980d687 100644 --- a/sdk/storage/azure-storage-file-share/CHANGELOG.md +++ b/sdk/storage/azure-storage-file-share/CHANGELOG.md @@ -1,5 +1,10 @@ # Release History +## 12.6.0 (2021-09-15) +**Stable release of preview features** +- Added support for service version 2020-10-02 (STG78) +- Added OAuth support for file copy source. + ## 12.6.0b1 (2021-07-27) **New features** - Added OAuth support for file copy source. diff --git a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_directory_client.py b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_directory_client.py index 7f8b22d5a56d..1c9d5f176ebd 100644 --- a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_directory_client.py +++ b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_directory_client.py @@ -118,8 +118,7 @@ def __init__( # type: ignore sas_token, credential, share_snapshot=self.snapshot) super(ShareDirectoryClient, self).__init__(parsed_url, service='file-share', credential=credential, **kwargs) self._client = AzureFileStorage(url=self.url, pipeline=self._pipeline) - default_api_version = self._client._config.version # pylint: disable=protected-access - self._client._config.version = get_api_version(kwargs, default_api_version) # pylint: disable=protected-access + self._client._config.version = get_api_version(kwargs) # pylint: disable=protected-access @classmethod def from_directory_url(cls, directory_url, # type: str diff --git a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_file_client.py b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_file_client.py index 24d731fe7885..5f8f979d0376 100644 --- a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_file_client.py +++ b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_file_client.py @@ -172,8 +172,7 @@ def __init__( # type: ignore sas_token, credential, share_snapshot=self.snapshot) super(ShareFileClient, self).__init__(parsed_url, service='file-share', credential=credential, **kwargs) self._client = AzureFileStorage(url=self.url, pipeline=self._pipeline) - default_api_version = self._client._config.version # pylint: disable=protected-access - self._client._config.version = get_api_version(kwargs, default_api_version) # pylint: disable=protected-access + self._client._config.version = get_api_version(kwargs) # pylint: disable=protected-access @classmethod def from_file_url( diff --git a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_serialize.py b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_serialize.py index 6fa74259f62c..9a050dae3339 100644 --- a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_serialize.py +++ b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_serialize.py @@ -14,6 +14,7 @@ _SUPPORTED_API_VERSIONS = [ '2019-02-02', '2019-07-07', + '2019-10-10', '2019-12-12', '2020-02-10', '2020-04-08', @@ -108,10 +109,11 @@ def get_smb_properties(kwargs): } -def get_api_version(kwargs, default): + +def get_api_version(kwargs): # type: (Dict[str, Any]) -> str - api_version = kwargs.pop('api_version', None) + api_version = kwargs.get('api_version', None) if api_version and api_version not in _SUPPORTED_API_VERSIONS: versions = '\n'.join(_SUPPORTED_API_VERSIONS) raise ValueError("Unsupported API version '{}'. Please select from:\n{}".format(api_version, versions)) - return api_version or default + return api_version or _SUPPORTED_API_VERSIONS[-1] diff --git a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_share_client.py b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_share_client.py index 3d9f707973b9..a0b317bde7ef 100644 --- a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_share_client.py +++ b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_share_client.py @@ -115,8 +115,7 @@ def __init__( # type: ignore sas_token, credential, share_snapshot=self.snapshot) super(ShareClient, self).__init__(parsed_url, service='file-share', credential=credential, **kwargs) self._client = AzureFileStorage(url=self.url, pipeline=self._pipeline) - default_api_version = self._client._config.version # pylint: disable=protected-access - self._client._config.version = get_api_version(kwargs, default_api_version) # pylint: disable=protected-access + self._client._config.version = get_api_version(kwargs) # pylint: disable=protected-access @classmethod def from_share_url(cls, share_url, # type: str diff --git a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_share_service_client.py b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_share_service_client.py index 3f2de840b603..537a0e5ee2fc 100644 --- a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_share_service_client.py +++ b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_share_service_client.py @@ -105,8 +105,7 @@ def __init__( self._query_str, credential = self._format_query_string(sas_token, credential) super(ShareServiceClient, self).__init__(parsed_url, service='file-share', credential=credential, **kwargs) self._client = AzureFileStorage(url=self.url, pipeline=self._pipeline) - default_api_version = self._client._config.version # pylint: disable=protected-access - self._client._config.version = get_api_version(kwargs, default_api_version) # pylint: disable=protected-access + self._client._config.version = get_api_version(kwargs) # pylint: disable=protected-access def _format_url(self, hostname): """Format the endpoint URL according to the current location diff --git a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_version.py b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_version.py index 202620c82c6d..c9d0e6003207 100644 --- a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_version.py +++ b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_version.py @@ -4,4 +4,4 @@ # license information. # -------------------------------------------------------------------------- -VERSION = "12.6.0b1" +VERSION = "12.6.0" diff --git a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/aio/_directory_client_async.py b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/aio/_directory_client_async.py index 8da17a039362..ae7767da2a60 100644 --- a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/aio/_directory_client_async.py +++ b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/aio/_directory_client_async.py @@ -90,8 +90,7 @@ def __init__( # type: ignore loop=loop, **kwargs) self._client = AzureFileStorage(url=self.url, pipeline=self._pipeline, loop=loop) - default_api_version = self._client._config.version # pylint: disable=protected-access - self._client._config.version = get_api_version(kwargs, default_api_version) # pylint: disable=protected-access + self._client._config.version = get_api_version(kwargs) # pylint: disable=protected-access self._loop = loop def get_file_client(self, file_name, **kwargs): diff --git a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/aio/_file_client_async.py b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/aio/_file_client_async.py index a5c936efc4b5..f4ee50fb1aad 100644 --- a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/aio/_file_client_async.py +++ b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/aio/_file_client_async.py @@ -137,8 +137,7 @@ def __init__( # type: ignore credential=credential, loop=loop, **kwargs ) self._client = AzureFileStorage(url=self.url, pipeline=self._pipeline, loop=loop) - default_api_version = self._client._config.version # pylint: disable=protected-access - self._client._config.version = get_api_version(kwargs, default_api_version) # pylint: disable=protected-access + self._client._config.version = get_api_version(kwargs) # pylint: disable=protected-access self._loop = loop @distributed_trace_async diff --git a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/aio/_share_client_async.py b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/aio/_share_client_async.py index 0d3d61778400..f8ded64403b5 100644 --- a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/aio/_share_client_async.py +++ b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/aio/_share_client_async.py @@ -85,8 +85,7 @@ def __init__( # type: ignore loop=loop, **kwargs) self._client = AzureFileStorage(url=self.url, pipeline=self._pipeline, loop=loop) - default_api_version = self._client._config.version # pylint: disable=protected-access - self._client._config.version = get_api_version(kwargs, default_api_version) # pylint: disable=protected-access + self._client._config.version = get_api_version(kwargs) # pylint: disable=protected-access self._loop = loop def get_directory_client(self, directory_path=None): diff --git a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/aio/_share_service_client_async.py b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/aio/_share_service_client_async.py index d6df0334d5c1..dc9ef0823a3f 100644 --- a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/aio/_share_service_client_async.py +++ b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/aio/_share_service_client_async.py @@ -90,8 +90,7 @@ def __init__( loop=loop, **kwargs) self._client = AzureFileStorage(url=self.url, pipeline=self._pipeline, loop=loop) - default_api_version = self._client._config.version # pylint: disable=protected-access - self._client._config.version = get_api_version(kwargs, default_api_version) # pylint: disable=protected-access + self._client._config.version = get_api_version(kwargs) # pylint: disable=protected-access self._loop = loop @distributed_trace_async diff --git a/sdk/storage/azure-storage-file-share/setup.py b/sdk/storage/azure-storage-file-share/setup.py index af2e8d3ebf1a..752f8c5df2af 100644 --- a/sdk/storage/azure-storage-file-share/setup.py +++ b/sdk/storage/azure-storage-file-share/setup.py @@ -59,7 +59,7 @@ author_email='ascl@microsoft.com', url='https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/storage/azure-storage-file-share', classifiers=[ - 'Development Status :: 4 - Beta', + "Development Status :: 5 - Production/Stable", 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', diff --git a/sdk/storage/azure-storage-queue/azure/storage/queue/_queue_client.py b/sdk/storage/azure-storage-queue/azure/storage/queue/_queue_client.py index 14ca7acf62d9..677105147ebe 100644 --- a/sdk/storage/azure-storage-queue/azure/storage/queue/_queue_client.py +++ b/sdk/storage/azure-storage-queue/azure/storage/queue/_queue_client.py @@ -19,6 +19,7 @@ from azure.core.exceptions import HttpResponseError from azure.core.paging import ItemPaged from azure.core.tracing.decorator import distributed_trace +from ._serialize import get_api_version from ._shared.base_client import StorageAccountHostsMixin, parse_connection_str, parse_query from ._shared.request_handlers import add_metadata_headers, serialize_iso from ._shared.response_handlers import ( @@ -105,8 +106,7 @@ def __init__( self._config.message_encode_policy = kwargs.get('message_encode_policy', None) or NoEncodePolicy() self._config.message_decode_policy = kwargs.get('message_decode_policy', None) or NoDecodePolicy() self._client = AzureQueueStorage(self.url, pipeline=self._pipeline) - default_api_version = self._client._config.version # pylint: disable=protected-access - self._client._config.version = kwargs.get('api_version', default_api_version) # pylint: disable=protected-access + self._client._config.version = get_api_version(kwargs) # pylint: disable=protected-access def _format_url(self, hostname): """Format the endpoint URL according to the current location diff --git a/sdk/storage/azure-storage-queue/azure/storage/queue/_queue_service_client.py b/sdk/storage/azure-storage-queue/azure/storage/queue/_queue_service_client.py index cdaf88032695..ee4595fb74eb 100644 --- a/sdk/storage/azure-storage-queue/azure/storage/queue/_queue_service_client.py +++ b/sdk/storage/azure-storage-queue/azure/storage/queue/_queue_service_client.py @@ -17,6 +17,7 @@ from azure.core.paging import ItemPaged from azure.core.pipeline import Pipeline from azure.core.tracing.decorator import distributed_trace +from ._serialize import get_api_version from ._shared.models import LocationMode from ._shared.base_client import StorageAccountHostsMixin, TransportWrapper, parse_connection_str, parse_query from ._shared.response_handlers import process_storage_error @@ -108,8 +109,7 @@ def __init__( self._query_str, credential = self._format_query_string(sas_token, credential) super(QueueServiceClient, self).__init__(parsed_url, service='queue', credential=credential, **kwargs) self._client = AzureQueueStorage(self.url, pipeline=self._pipeline) - default_api_version = self._client._config.version # pylint: disable=protected-access - self._client._config.version = kwargs.get('api_version', default_api_version) # pylint: disable=protected-access + self._client._config.version = get_api_version(kwargs) # pylint: disable=protected-access def _format_url(self, hostname): """Format the endpoint URL according to the current location diff --git a/sdk/storage/azure-storage-queue/azure/storage/queue/_serialize.py b/sdk/storage/azure-storage-queue/azure/storage/queue/_serialize.py new file mode 100644 index 000000000000..6aafbc170bec --- /dev/null +++ b/sdk/storage/azure-storage-queue/azure/storage/queue/_serialize.py @@ -0,0 +1,26 @@ +# ------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# -------------------------------------------------------------------------- + +_SUPPORTED_API_VERSIONS = [ + '2019-02-02', + '2019-07-07', + '2019-10-10', + '2019-12-12', + '2020-02-10', + '2020-04-08', + '2020-06-12', + '2020-08-04', + '2020-10-02' +] + + +def get_api_version(kwargs): + # type: (Dict[str, Any], str) -> str + api_version = kwargs.get('api_version', None) + if api_version and api_version not in _SUPPORTED_API_VERSIONS: + versions = '\n'.join(_SUPPORTED_API_VERSIONS) + raise ValueError("Unsupported API version '{}'. Please select from:\n{}".format(api_version, versions)) + return api_version or _SUPPORTED_API_VERSIONS[-1] diff --git a/sdk/storage/azure-storage-queue/azure/storage/queue/aio/_queue_client_async.py b/sdk/storage/azure-storage-queue/azure/storage/queue/aio/_queue_client_async.py index 34ecba6b6fe2..4b8f3f0c4282 100644 --- a/sdk/storage/azure-storage-queue/azure/storage/queue/aio/_queue_client_async.py +++ b/sdk/storage/azure-storage-queue/azure/storage/queue/aio/_queue_client_async.py @@ -31,6 +31,7 @@ from azure.core.async_paging import AsyncItemPaged +from .._serialize import get_api_version from .._shared.base_client_async import AsyncStorageAccountHostsMixin from .._shared.request_handlers import add_metadata_headers, serialize_iso from .._shared.response_handlers import ( @@ -111,8 +112,7 @@ def __init__( account_url, queue_name=queue_name, credential=credential, loop=loop, **kwargs ) self._client = AzureQueueStorage(self.url, pipeline=self._pipeline, loop=loop) # type: ignore - default_api_version = self._client._config.version # pylint: disable=protected-access - self._client._config.version = kwargs.get('api_version', default_api_version) # pylint: disable=protected-access + self._client._config.version = get_api_version(kwargs) # pylint: disable=protected-access self._loop = loop @distributed_trace_async diff --git a/sdk/storage/azure-storage-queue/azure/storage/queue/aio/_queue_service_client_async.py b/sdk/storage/azure-storage-queue/azure/storage/queue/aio/_queue_service_client_async.py index 805ed41b7cc5..ee0fc0f8af22 100644 --- a/sdk/storage/azure-storage-queue/azure/storage/queue/aio/_queue_service_client_async.py +++ b/sdk/storage/azure-storage-queue/azure/storage/queue/aio/_queue_service_client_async.py @@ -20,6 +20,7 @@ from azure.core.pipeline import AsyncPipeline from azure.core.tracing.decorator_async import distributed_trace_async +from .._serialize import get_api_version from .._shared.policies_async import ExponentialRetry from .._queue_service_client import QueueServiceClient as QueueServiceClientBase from .._shared.models import LocationMode @@ -101,8 +102,7 @@ def __init__( loop=loop, **kwargs) self._client = AzureQueueStorage(url=self.url, pipeline=self._pipeline, loop=loop) # type: ignore - default_api_version = self._client._config.version # pylint: disable=protected-access - self._client._config.version = kwargs.get('api_version', default_api_version) # pylint: disable=protected-access + self._client._config.version = get_api_version(kwargs) # pylint: disable=protected-access self._loop = loop @distributed_trace_async diff --git a/sdk/storage/azure-storage-queue/tests/test_queue_api_version.py b/sdk/storage/azure-storage-queue/tests/test_queue_api_version.py index f03aaa5b2c68..55fc24674b21 100644 --- a/sdk/storage/azure-storage-queue/tests/test_queue_api_version.py +++ b/sdk/storage/azure-storage-queue/tests/test_queue_api_version.py @@ -13,6 +13,7 @@ QueueServiceClient, QueueClient ) +from azure.storage.queue._serialize import _SUPPORTED_API_VERSIONS from _shared.testcase import GlobalStorageAccountPreparer, StorageTestCase # ------------------------------------------------------------------------------ @@ -21,7 +22,7 @@ class StorageClientTest(StorageTestCase): def setUp(self): super(StorageClientTest, self).setUp() self.api_version_1 = "2019-02-02" - self.api_version_2 = '2018-03-28' + self.api_version_2 = _SUPPORTED_API_VERSIONS[-1] # --Test Cases-------------------------------------------------------------- @@ -46,7 +47,7 @@ def test_service_client_api_version_property(self): self.assertEqual(queue_client.api_version, self.api_version_1) self.assertEqual(queue_client._client._config.version, self.api_version_1) - def test_blob_client_api_version_property(self): + def test_queue_client_api_version_property(self): queue_client = QueueClient( "https://foo.queue.core.windows.net/account", "queue_name", diff --git a/sdk/storage/azure-storage-queue/tests/test_queue_api_version_async.py b/sdk/storage/azure-storage-queue/tests/test_queue_api_version_async.py index 6433f57fa043..b397846355e7 100644 --- a/sdk/storage/azure-storage-queue/tests/test_queue_api_version_async.py +++ b/sdk/storage/azure-storage-queue/tests/test_queue_api_version_async.py @@ -13,6 +13,7 @@ QueueServiceClient, QueueClient ) +from azure.storage.queue._serialize import _SUPPORTED_API_VERSIONS from _shared.testcase import GlobalStorageAccountPreparer from _shared.asynctestcase import AsyncStorageTestCase @@ -22,7 +23,7 @@ class StorageClientTest(AsyncStorageTestCase): def setUp(self): super(StorageClientTest, self).setUp() self.api_version_1 = "2019-02-02" - self.api_version_2 = '2018-03-28' + self.api_version_2 = _SUPPORTED_API_VERSIONS[-1] # --Test Cases-------------------------------------------------------------- @@ -47,7 +48,7 @@ def test_service_client_api_version_property(self): self.assertEqual(queue_client.api_version, self.api_version_1) self.assertEqual(queue_client._client._config.version, self.api_version_1) - def test_blob_client_api_version_property(self): + def test_queue_client_api_version_property(self): queue_client = QueueClient( "https://foo.queue.core.windows.net/account", "queue_name", diff --git a/sdk/storage/azure-storage-queue/tests/test_queue_client.py b/sdk/storage/azure-storage-queue/tests/test_queue_client.py index 75fe784dbf5a..5bea41109afe 100644 --- a/sdk/storage/azure-storage-queue/tests/test_queue_client.py +++ b/sdk/storage/azure-storage-queue/tests/test_queue_client.py @@ -12,6 +12,7 @@ QueueServiceClient, QueueClient, ) +from azure.storage.queue._serialize import _SUPPORTED_API_VERSIONS from _shared.testcase import GlobalStorageAccountPreparer, StorageTestCase # ------------------------------------------------------------------------------ @@ -484,6 +485,8 @@ def test_closing_pipeline_client_simple(self, resource_group, location, storage_ service = client( self.account_url(storage_account, "queue"), credential=storage_account_key, queue_name='queue') service.close() + + # ------------------------------------------------------------------------------ if __name__ == '__main__': unittest.main() diff --git a/sdk/storage/azure-storage-queue/tests/test_queue_client_async.py b/sdk/storage/azure-storage-queue/tests/test_queue_client_async.py index 9710c3eb3305..d2c91d8c29b8 100644 --- a/sdk/storage/azure-storage-queue/tests/test_queue_client_async.py +++ b/sdk/storage/azure-storage-queue/tests/test_queue_client_async.py @@ -15,6 +15,7 @@ QueueServiceClient, QueueClient ) +from azure.storage.queue._serialize import _SUPPORTED_API_VERSIONS from _shared.asynctestcase import AsyncStorageTestCase from _shared.testcase import GlobalStorageAccountPreparer # ------------------------------------------------------------------------------ @@ -482,6 +483,7 @@ async def test_closing_pipeline_client_simple_async(self, resource_group, locati self.account_url(storage_account, "queue"), credential=storage_account_key, queue_name='queue') await service.close() + # ------------------------------------------------------------------------------ if __name__ == '__main__': unittest.main() From 29d98e85803249e64fbd410037609588132005c5 Mon Sep 17 00:00:00 2001 From: "Chidozie Ononiwu (His Righteousness)" <31145988+chidozieononiwu@users.noreply.github.com> Date: Fri, 17 Sep 2021 17:27:57 -0700 Subject: [PATCH 72/85] Fix broken link in python repo (#20746) --- doc/dev/README.md | 2 +- doc/dev/docstring_typehint.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/dev/README.md b/doc/dev/README.md index 6b3e6ce09fed..02185160ea01 100644 --- a/doc/dev/README.md +++ b/doc/dev/README.md @@ -6,7 +6,7 @@ Overview of the documents: - [Developer Set-Up](https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/dev_setup.md) : How to create a development environment for this repo - [Release](https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/release.md) : How to release a package when ready - [Packaging](https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/packaging.md) : How to organize packaging information for packages under `azure` -- [Testing](./tests.md): How to write unit and functional tests for a library +- [Testing](https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/tests.md): How to write unit and functional tests for a library - [Docstrings and Type hints](https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/docstring_typehint.md): How to document an SDK for compatability with internal tools (API View) and our documentation at [MS Docs][ms_docs] and the [azure.github.io][azure_github_io] site. The [mgmt](https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/mgmt) folder contains information specific to management packages (i.e. packages prefixed by `azure-mgmt`) diff --git a/doc/dev/docstring_typehint.md b/doc/dev/docstring_typehint.md index 2f8e17f8e253..0df46f8b3345 100644 --- a/doc/dev/docstring_typehint.md +++ b/doc/dev/docstring_typehint.md @@ -4,7 +4,7 @@ All public methods should have docstrings to document the parameters, keywords, * [Docstrings](#docstrings) * [Method Docstrings](#method_docstrings) - * [Model and Client Docstrings](#Model_and_Client_Docstrings) + * [Model and Client Docstrings](#model_and_Client_Docstrings) * [Type Hints](#type_hints) * [Type Hints for Python 2.7 and 3.5+](#type_hints_for_python_2.7_and_3.5+) * [Type Hints for Python 3.5+](#type_hints_for_python_3.5+) From 7832c5a5c7b489ef29dce55ec50a89420f3540eb Mon Sep 17 00:00:00 2001 From: Azure CLI Bot Date: Sat, 18 Sep 2021 09:34:11 +0800 Subject: [PATCH 73/85] [AutoRelease] t2-eventhub-2021-09-17-55263(Do not merge) (#20739) * CodeGen from PR 15979 in Azure/azure-rest-api-specs EventHub: Added missing Cluster API in 2021-06-01-preview (#15979) * Added missing Cluster APIs to 2021-01-01-preview * added cluster API in 2021-06-01-preview * updated lint errors * update 1 * added listbysubscription * fixed ModelValidation Co-authored-by: v-ajnava * version,CHANGELOG Co-authored-by: SDKAuto Co-authored-by: v-ajnava Co-authored-by: PythonSdkPipelines --- sdk/eventhub/azure-mgmt-eventhub/CHANGELOG.md | 10 + sdk/eventhub/azure-mgmt-eventhub/_meta.json | 10 +- .../eventhub/_event_hub_management_client.py | 31 + .../azure/mgmt/eventhub/_version.py | 2 +- .../aio/_event_hub_management_client.py | 31 + .../mgmt/eventhub/v2015_08_01/__init__.py | 3 + .../eventhub/v2015_08_01/_configuration.py | 3 +- .../mgmt/eventhub/v2015_08_01/_version.py | 9 + .../v2015_08_01/aio/_configuration.py | 3 +- .../mgmt/eventhub/v2017_04_01/__init__.py | 3 + .../eventhub/v2017_04_01/_configuration.py | 3 +- .../mgmt/eventhub/v2017_04_01/_version.py | 9 + .../v2017_04_01/aio/_configuration.py | 3 +- .../eventhub/v2018_01_01_preview/__init__.py | 3 + .../v2018_01_01_preview/_configuration.py | 3 +- .../eventhub/v2018_01_01_preview/_version.py | 9 + .../v2018_01_01_preview/aio/_configuration.py | 3 +- .../v2018_01_01_preview/models/_models.py | 39 +- .../v2018_01_01_preview/models/_models_py3.py | 41 +- .../eventhub/v2021_01_01_preview/__init__.py | 3 + .../v2021_01_01_preview/_configuration.py | 3 +- .../eventhub/v2021_01_01_preview/_version.py | 9 + .../v2021_01_01_preview/aio/_configuration.py | 3 +- .../v2021_01_01_preview/models/_models.py | 21 +- .../v2021_01_01_preview/models/_models_py3.py | 22 +- .../eventhub/v2021_06_01_preview/__init__.py | 19 + .../v2021_06_01_preview/_configuration.py | 71 + .../_event_hub_management_client.py | 129 ++ .../v2021_06_01_preview/_metadata.json | 111 + .../eventhub/v2021_06_01_preview/_version.py | 9 + .../v2021_06_01_preview/aio/__init__.py | 10 + .../v2021_06_01_preview/aio/_configuration.py | 67 + .../aio/_event_hub_management_client.py | 122 ++ .../aio/operations/__init__.py | 29 + .../aio/operations/_clusters_operations.py | 720 +++++++ .../operations/_configuration_operations.py | 174 ++ .../operations/_consumer_groups_operations.py | 340 +++ .../_disaster_recovery_configs_operations.py | 714 +++++++ .../aio/operations/_event_hubs_operations.py | 752 +++++++ .../aio/operations/_namespaces_operations.py | 1143 +++++++++++ .../aio/operations/_operations.py | 105 + ...private_endpoint_connections_operations.py | 375 ++++ .../_private_link_resources_operations.py | 100 + .../v2021_06_01_preview/models/__init__.py | 191 ++ .../_event_hub_management_client_enums.py | 171 ++ .../v2021_06_01_preview/models/_models.py | 1671 +++++++++++++++ .../v2021_06_01_preview/models/_models_py3.py | 1824 +++++++++++++++++ .../operations/__init__.py | 29 + .../operations/_clusters_operations.py | 735 +++++++ .../operations/_configuration_operations.py | 180 ++ .../operations/_consumer_groups_operations.py | 348 ++++ .../_disaster_recovery_configs_operations.py | 728 +++++++ .../operations/_event_hubs_operations.py | 766 +++++++ .../operations/_namespaces_operations.py | 1164 +++++++++++ .../operations/_operations.py | 110 + ...private_endpoint_connections_operations.py | 384 ++++ .../_private_link_resources_operations.py | 105 + .../eventhub/v2021_06_01_preview/py.typed | 1 + 58 files changed, 13594 insertions(+), 82 deletions(-) create mode 100644 sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/_version.py create mode 100644 sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/_version.py create mode 100644 sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/_version.py create mode 100644 sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_01_01_preview/_version.py create mode 100644 sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/__init__.py create mode 100644 sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/_configuration.py create mode 100644 sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/_event_hub_management_client.py create mode 100644 sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/_metadata.json create mode 100644 sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/_version.py create mode 100644 sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/aio/__init__.py create mode 100644 sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/aio/_configuration.py create mode 100644 sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/aio/_event_hub_management_client.py create mode 100644 sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/aio/operations/__init__.py create mode 100644 sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/aio/operations/_clusters_operations.py create mode 100644 sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/aio/operations/_configuration_operations.py create mode 100644 sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/aio/operations/_consumer_groups_operations.py create mode 100644 sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/aio/operations/_disaster_recovery_configs_operations.py create mode 100644 sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/aio/operations/_event_hubs_operations.py create mode 100644 sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/aio/operations/_namespaces_operations.py create mode 100644 sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/aio/operations/_operations.py create mode 100644 sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/aio/operations/_private_endpoint_connections_operations.py create mode 100644 sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/aio/operations/_private_link_resources_operations.py create mode 100644 sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/models/__init__.py create mode 100644 sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/models/_event_hub_management_client_enums.py create mode 100644 sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/models/_models.py create mode 100644 sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/models/_models_py3.py create mode 100644 sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/operations/__init__.py create mode 100644 sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/operations/_clusters_operations.py create mode 100644 sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/operations/_configuration_operations.py create mode 100644 sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/operations/_consumer_groups_operations.py create mode 100644 sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/operations/_disaster_recovery_configs_operations.py create mode 100644 sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/operations/_event_hubs_operations.py create mode 100644 sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/operations/_namespaces_operations.py create mode 100644 sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/operations/_operations.py create mode 100644 sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/operations/_private_endpoint_connections_operations.py create mode 100644 sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/operations/_private_link_resources_operations.py create mode 100644 sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/py.typed diff --git a/sdk/eventhub/azure-mgmt-eventhub/CHANGELOG.md b/sdk/eventhub/azure-mgmt-eventhub/CHANGELOG.md index 331bb73192fa..dceaea924cd1 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/CHANGELOG.md +++ b/sdk/eventhub/azure-mgmt-eventhub/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 9.1.0 (2021-09-17) + +**Features** + + - Model Cluster has a new parameter system_data + - Model EHNamespace has a new parameter disable_local_auth + - Model EHNamespace has a new parameter status + - Model NetworkRuleSet has a new parameter public_network_access + - Added operation ClustersOperations.list_by_subscription + ## 9.0.0 (2021-05-25) **Features** diff --git a/sdk/eventhub/azure-mgmt-eventhub/_meta.json b/sdk/eventhub/azure-mgmt-eventhub/_meta.json index 720230c56131..76188907d20b 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/_meta.json +++ b/sdk/eventhub/azure-mgmt-eventhub/_meta.json @@ -1,11 +1,11 @@ { - "autorest": "3.4.2", + "autorest": "3.4.5", "use": [ - "@autorest/python@5.8.0", - "@autorest/modelerfour@4.19.1" + "@autorest/python@5.8.4", + "@autorest/modelerfour@4.19.2" ], - "commit": "243dc16d38ca0f0d251efa2d216468a670cd8beb", + "commit": "c9992af7235a6550087d4fed8f081ed35019f605", "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest_command": "autorest specification/eventhub/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.0 --use=@autorest/modelerfour@4.19.1 --version=3.4.2", + "autorest_command": "autorest specification/eventhub/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.4 --use=@autorest/modelerfour@4.19.2 --version=3.4.5", "readme": "specification/eventhub/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/_event_hub_management_client.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/_event_hub_management_client.py index 8d43eb07f8b5..54186c7530a8 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/_event_hub_management_client.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/_event_hub_management_client.py @@ -95,6 +95,7 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2017-04-01: :mod:`v2017_04_01.models` * 2018-01-01-preview: :mod:`v2018_01_01_preview.models` * 2021-01-01-preview: :mod:`v2021_01_01_preview.models` + * 2021-06-01-preview: :mod:`v2021_06_01_preview.models` """ if api_version == '2015-08-01': from .v2015_08_01 import models @@ -108,6 +109,9 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2021-01-01-preview': from .v2021_01_01_preview import models return models + elif api_version == '2021-06-01-preview': + from .v2021_06_01_preview import models + return models raise ValueError("API version {} is not available".format(api_version)) @property @@ -115,10 +119,13 @@ def clusters(self): """Instance depends on the API version: * 2018-01-01-preview: :class:`ClustersOperations` + * 2021-06-01-preview: :class:`ClustersOperations` """ api_version = self._get_api_version('clusters') if api_version == '2018-01-01-preview': from .v2018_01_01_preview.operations import ClustersOperations as OperationClass + elif api_version == '2021-06-01-preview': + from .v2021_06_01_preview.operations import ClustersOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'clusters'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -128,10 +135,13 @@ def configuration(self): """Instance depends on the API version: * 2018-01-01-preview: :class:`ConfigurationOperations` + * 2021-06-01-preview: :class:`ConfigurationOperations` """ api_version = self._get_api_version('configuration') if api_version == '2018-01-01-preview': from .v2018_01_01_preview.operations import ConfigurationOperations as OperationClass + elif api_version == '2021-06-01-preview': + from .v2021_06_01_preview.operations import ConfigurationOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'configuration'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -144,6 +154,7 @@ def consumer_groups(self): * 2017-04-01: :class:`ConsumerGroupsOperations` * 2018-01-01-preview: :class:`ConsumerGroupsOperations` * 2021-01-01-preview: :class:`ConsumerGroupsOperations` + * 2021-06-01-preview: :class:`ConsumerGroupsOperations` """ api_version = self._get_api_version('consumer_groups') if api_version == '2015-08-01': @@ -154,6 +165,8 @@ def consumer_groups(self): from .v2018_01_01_preview.operations import ConsumerGroupsOperations as OperationClass elif api_version == '2021-01-01-preview': from .v2021_01_01_preview.operations import ConsumerGroupsOperations as OperationClass + elif api_version == '2021-06-01-preview': + from .v2021_06_01_preview.operations import ConsumerGroupsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'consumer_groups'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -165,6 +178,7 @@ def disaster_recovery_configs(self): * 2017-04-01: :class:`DisasterRecoveryConfigsOperations` * 2018-01-01-preview: :class:`DisasterRecoveryConfigsOperations` * 2021-01-01-preview: :class:`DisasterRecoveryConfigsOperations` + * 2021-06-01-preview: :class:`DisasterRecoveryConfigsOperations` """ api_version = self._get_api_version('disaster_recovery_configs') if api_version == '2017-04-01': @@ -173,6 +187,8 @@ def disaster_recovery_configs(self): from .v2018_01_01_preview.operations import DisasterRecoveryConfigsOperations as OperationClass elif api_version == '2021-01-01-preview': from .v2021_01_01_preview.operations import DisasterRecoveryConfigsOperations as OperationClass + elif api_version == '2021-06-01-preview': + from .v2021_06_01_preview.operations import DisasterRecoveryConfigsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'disaster_recovery_configs'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -185,6 +201,7 @@ def event_hubs(self): * 2017-04-01: :class:`EventHubsOperations` * 2018-01-01-preview: :class:`EventHubsOperations` * 2021-01-01-preview: :class:`EventHubsOperations` + * 2021-06-01-preview: :class:`EventHubsOperations` """ api_version = self._get_api_version('event_hubs') if api_version == '2015-08-01': @@ -195,6 +212,8 @@ def event_hubs(self): from .v2018_01_01_preview.operations import EventHubsOperations as OperationClass elif api_version == '2021-01-01-preview': from .v2021_01_01_preview.operations import EventHubsOperations as OperationClass + elif api_version == '2021-06-01-preview': + from .v2021_06_01_preview.operations import EventHubsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'event_hubs'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -207,6 +226,7 @@ def namespaces(self): * 2017-04-01: :class:`NamespacesOperations` * 2018-01-01-preview: :class:`NamespacesOperations` * 2021-01-01-preview: :class:`NamespacesOperations` + * 2021-06-01-preview: :class:`NamespacesOperations` """ api_version = self._get_api_version('namespaces') if api_version == '2015-08-01': @@ -217,6 +237,8 @@ def namespaces(self): from .v2018_01_01_preview.operations import NamespacesOperations as OperationClass elif api_version == '2021-01-01-preview': from .v2021_01_01_preview.operations import NamespacesOperations as OperationClass + elif api_version == '2021-06-01-preview': + from .v2021_06_01_preview.operations import NamespacesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'namespaces'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -229,6 +251,7 @@ def operations(self): * 2017-04-01: :class:`Operations` * 2018-01-01-preview: :class:`Operations` * 2021-01-01-preview: :class:`Operations` + * 2021-06-01-preview: :class:`Operations` """ api_version = self._get_api_version('operations') if api_version == '2015-08-01': @@ -239,6 +262,8 @@ def operations(self): from .v2018_01_01_preview.operations import Operations as OperationClass elif api_version == '2021-01-01-preview': from .v2021_01_01_preview.operations import Operations as OperationClass + elif api_version == '2021-06-01-preview': + from .v2021_06_01_preview.operations import Operations as OperationClass else: raise ValueError("API version {} does not have operation group 'operations'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -249,12 +274,15 @@ def private_endpoint_connections(self): * 2018-01-01-preview: :class:`PrivateEndpointConnectionsOperations` * 2021-01-01-preview: :class:`PrivateEndpointConnectionsOperations` + * 2021-06-01-preview: :class:`PrivateEndpointConnectionsOperations` """ api_version = self._get_api_version('private_endpoint_connections') if api_version == '2018-01-01-preview': from .v2018_01_01_preview.operations import PrivateEndpointConnectionsOperations as OperationClass elif api_version == '2021-01-01-preview': from .v2021_01_01_preview.operations import PrivateEndpointConnectionsOperations as OperationClass + elif api_version == '2021-06-01-preview': + from .v2021_06_01_preview.operations import PrivateEndpointConnectionsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'private_endpoint_connections'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -265,12 +293,15 @@ def private_link_resources(self): * 2018-01-01-preview: :class:`PrivateLinkResourcesOperations` * 2021-01-01-preview: :class:`PrivateLinkResourcesOperations` + * 2021-06-01-preview: :class:`PrivateLinkResourcesOperations` """ api_version = self._get_api_version('private_link_resources') if api_version == '2018-01-01-preview': from .v2018_01_01_preview.operations import PrivateLinkResourcesOperations as OperationClass elif api_version == '2021-01-01-preview': from .v2021_01_01_preview.operations import PrivateLinkResourcesOperations as OperationClass + elif api_version == '2021-06-01-preview': + from .v2021_06_01_preview.operations import PrivateLinkResourcesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'private_link_resources'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/_version.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/_version.py index 14d0091047ac..2bcd3a3e386b 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/_version.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/_version.py @@ -5,4 +5,4 @@ # license information. # -------------------------------------------------------------------------- -VERSION = "9.0.0" +VERSION = "9.1.0" diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/aio/_event_hub_management_client.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/aio/_event_hub_management_client.py index d228ab439d9c..d9c6cc69154b 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/aio/_event_hub_management_client.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/aio/_event_hub_management_client.py @@ -93,6 +93,7 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2017-04-01: :mod:`v2017_04_01.models` * 2018-01-01-preview: :mod:`v2018_01_01_preview.models` * 2021-01-01-preview: :mod:`v2021_01_01_preview.models` + * 2021-06-01-preview: :mod:`v2021_06_01_preview.models` """ if api_version == '2015-08-01': from ..v2015_08_01 import models @@ -106,6 +107,9 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2021-01-01-preview': from ..v2021_01_01_preview import models return models + elif api_version == '2021-06-01-preview': + from ..v2021_06_01_preview import models + return models raise ValueError("API version {} is not available".format(api_version)) @property @@ -113,10 +117,13 @@ def clusters(self): """Instance depends on the API version: * 2018-01-01-preview: :class:`ClustersOperations` + * 2021-06-01-preview: :class:`ClustersOperations` """ api_version = self._get_api_version('clusters') if api_version == '2018-01-01-preview': from ..v2018_01_01_preview.aio.operations import ClustersOperations as OperationClass + elif api_version == '2021-06-01-preview': + from ..v2021_06_01_preview.aio.operations import ClustersOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'clusters'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -126,10 +133,13 @@ def configuration(self): """Instance depends on the API version: * 2018-01-01-preview: :class:`ConfigurationOperations` + * 2021-06-01-preview: :class:`ConfigurationOperations` """ api_version = self._get_api_version('configuration') if api_version == '2018-01-01-preview': from ..v2018_01_01_preview.aio.operations import ConfigurationOperations as OperationClass + elif api_version == '2021-06-01-preview': + from ..v2021_06_01_preview.aio.operations import ConfigurationOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'configuration'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -142,6 +152,7 @@ def consumer_groups(self): * 2017-04-01: :class:`ConsumerGroupsOperations` * 2018-01-01-preview: :class:`ConsumerGroupsOperations` * 2021-01-01-preview: :class:`ConsumerGroupsOperations` + * 2021-06-01-preview: :class:`ConsumerGroupsOperations` """ api_version = self._get_api_version('consumer_groups') if api_version == '2015-08-01': @@ -152,6 +163,8 @@ def consumer_groups(self): from ..v2018_01_01_preview.aio.operations import ConsumerGroupsOperations as OperationClass elif api_version == '2021-01-01-preview': from ..v2021_01_01_preview.aio.operations import ConsumerGroupsOperations as OperationClass + elif api_version == '2021-06-01-preview': + from ..v2021_06_01_preview.aio.operations import ConsumerGroupsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'consumer_groups'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -163,6 +176,7 @@ def disaster_recovery_configs(self): * 2017-04-01: :class:`DisasterRecoveryConfigsOperations` * 2018-01-01-preview: :class:`DisasterRecoveryConfigsOperations` * 2021-01-01-preview: :class:`DisasterRecoveryConfigsOperations` + * 2021-06-01-preview: :class:`DisasterRecoveryConfigsOperations` """ api_version = self._get_api_version('disaster_recovery_configs') if api_version == '2017-04-01': @@ -171,6 +185,8 @@ def disaster_recovery_configs(self): from ..v2018_01_01_preview.aio.operations import DisasterRecoveryConfigsOperations as OperationClass elif api_version == '2021-01-01-preview': from ..v2021_01_01_preview.aio.operations import DisasterRecoveryConfigsOperations as OperationClass + elif api_version == '2021-06-01-preview': + from ..v2021_06_01_preview.aio.operations import DisasterRecoveryConfigsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'disaster_recovery_configs'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -183,6 +199,7 @@ def event_hubs(self): * 2017-04-01: :class:`EventHubsOperations` * 2018-01-01-preview: :class:`EventHubsOperations` * 2021-01-01-preview: :class:`EventHubsOperations` + * 2021-06-01-preview: :class:`EventHubsOperations` """ api_version = self._get_api_version('event_hubs') if api_version == '2015-08-01': @@ -193,6 +210,8 @@ def event_hubs(self): from ..v2018_01_01_preview.aio.operations import EventHubsOperations as OperationClass elif api_version == '2021-01-01-preview': from ..v2021_01_01_preview.aio.operations import EventHubsOperations as OperationClass + elif api_version == '2021-06-01-preview': + from ..v2021_06_01_preview.aio.operations import EventHubsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'event_hubs'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -205,6 +224,7 @@ def namespaces(self): * 2017-04-01: :class:`NamespacesOperations` * 2018-01-01-preview: :class:`NamespacesOperations` * 2021-01-01-preview: :class:`NamespacesOperations` + * 2021-06-01-preview: :class:`NamespacesOperations` """ api_version = self._get_api_version('namespaces') if api_version == '2015-08-01': @@ -215,6 +235,8 @@ def namespaces(self): from ..v2018_01_01_preview.aio.operations import NamespacesOperations as OperationClass elif api_version == '2021-01-01-preview': from ..v2021_01_01_preview.aio.operations import NamespacesOperations as OperationClass + elif api_version == '2021-06-01-preview': + from ..v2021_06_01_preview.aio.operations import NamespacesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'namespaces'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -227,6 +249,7 @@ def operations(self): * 2017-04-01: :class:`Operations` * 2018-01-01-preview: :class:`Operations` * 2021-01-01-preview: :class:`Operations` + * 2021-06-01-preview: :class:`Operations` """ api_version = self._get_api_version('operations') if api_version == '2015-08-01': @@ -237,6 +260,8 @@ def operations(self): from ..v2018_01_01_preview.aio.operations import Operations as OperationClass elif api_version == '2021-01-01-preview': from ..v2021_01_01_preview.aio.operations import Operations as OperationClass + elif api_version == '2021-06-01-preview': + from ..v2021_06_01_preview.aio.operations import Operations as OperationClass else: raise ValueError("API version {} does not have operation group 'operations'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -247,12 +272,15 @@ def private_endpoint_connections(self): * 2018-01-01-preview: :class:`PrivateEndpointConnectionsOperations` * 2021-01-01-preview: :class:`PrivateEndpointConnectionsOperations` + * 2021-06-01-preview: :class:`PrivateEndpointConnectionsOperations` """ api_version = self._get_api_version('private_endpoint_connections') if api_version == '2018-01-01-preview': from ..v2018_01_01_preview.aio.operations import PrivateEndpointConnectionsOperations as OperationClass elif api_version == '2021-01-01-preview': from ..v2021_01_01_preview.aio.operations import PrivateEndpointConnectionsOperations as OperationClass + elif api_version == '2021-06-01-preview': + from ..v2021_06_01_preview.aio.operations import PrivateEndpointConnectionsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'private_endpoint_connections'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -263,12 +291,15 @@ def private_link_resources(self): * 2018-01-01-preview: :class:`PrivateLinkResourcesOperations` * 2021-01-01-preview: :class:`PrivateLinkResourcesOperations` + * 2021-06-01-preview: :class:`PrivateLinkResourcesOperations` """ api_version = self._get_api_version('private_link_resources') if api_version == '2018-01-01-preview': from ..v2018_01_01_preview.aio.operations import PrivateLinkResourcesOperations as OperationClass elif api_version == '2021-01-01-preview': from ..v2021_01_01_preview.aio.operations import PrivateLinkResourcesOperations as OperationClass + elif api_version == '2021-06-01-preview': + from ..v2021_06_01_preview.aio.operations import PrivateLinkResourcesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'private_link_resources'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/__init__.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/__init__.py index 72f93dd9db6c..b65464aa7533 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/__init__.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/__init__.py @@ -7,6 +7,9 @@ # -------------------------------------------------------------------------- from ._event_hub_management_client import EventHubManagementClient +from ._version import VERSION + +__version__ = VERSION __all__ = ['EventHubManagementClient'] try: diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/_configuration.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/_configuration.py index f698e6e92d49..0a35e98603e4 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/_configuration.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/_configuration.py @@ -12,13 +12,14 @@ from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from ._version import VERSION + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any from azure.core.credentials import TokenCredential -VERSION = "unknown" class EventHubManagementClientConfiguration(Configuration): """Configuration for EventHubManagementClient. diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/_version.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/_version.py new file mode 100644 index 000000000000..f89ed38360ab --- /dev/null +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/_version.py @@ -0,0 +1,9 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +VERSION = "9.1.0" diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/_configuration.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/_configuration.py index 004a7b9d0e26..8087c2bd45ee 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/_configuration.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/_configuration.py @@ -12,11 +12,12 @@ from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from .._version import VERSION + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -VERSION = "unknown" class EventHubManagementClientConfiguration(Configuration): """Configuration for EventHubManagementClient. diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/__init__.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/__init__.py index 72f93dd9db6c..b65464aa7533 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/__init__.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/__init__.py @@ -7,6 +7,9 @@ # -------------------------------------------------------------------------- from ._event_hub_management_client import EventHubManagementClient +from ._version import VERSION + +__version__ = VERSION __all__ = ['EventHubManagementClient'] try: diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/_configuration.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/_configuration.py index 82776d7e4da1..f8469b0d1c00 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/_configuration.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/_configuration.py @@ -12,13 +12,14 @@ from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from ._version import VERSION + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any from azure.core.credentials import TokenCredential -VERSION = "unknown" class EventHubManagementClientConfiguration(Configuration): """Configuration for EventHubManagementClient. diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/_version.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/_version.py new file mode 100644 index 000000000000..f89ed38360ab --- /dev/null +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/_version.py @@ -0,0 +1,9 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +VERSION = "9.1.0" diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/_configuration.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/_configuration.py index 587b01b0f3f1..09fe8c679363 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/_configuration.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/_configuration.py @@ -12,11 +12,12 @@ from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from .._version import VERSION + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -VERSION = "unknown" class EventHubManagementClientConfiguration(Configuration): """Configuration for EventHubManagementClient. diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/__init__.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/__init__.py index 72f93dd9db6c..b65464aa7533 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/__init__.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/__init__.py @@ -7,6 +7,9 @@ # -------------------------------------------------------------------------- from ._event_hub_management_client import EventHubManagementClient +from ._version import VERSION + +__version__ = VERSION __all__ = ['EventHubManagementClient'] try: diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/_configuration.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/_configuration.py index 78cc5d1b0649..86da104bd0b7 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/_configuration.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/_configuration.py @@ -12,13 +12,14 @@ from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from ._version import VERSION + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any from azure.core.credentials import TokenCredential -VERSION = "unknown" class EventHubManagementClientConfiguration(Configuration): """Configuration for EventHubManagementClient. diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/_version.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/_version.py new file mode 100644 index 000000000000..f89ed38360ab --- /dev/null +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/_version.py @@ -0,0 +1,9 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +VERSION = "9.1.0" diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/_configuration.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/_configuration.py index 5ca84445a1f4..06b48560341b 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/_configuration.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/aio/_configuration.py @@ -12,11 +12,12 @@ from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from .._version import VERSION + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -VERSION = "unknown" class EventHubManagementClientConfiguration(Configuration): """Configuration for EventHubManagementClient. diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/_models.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/_models.py index 1287e38dd97e..195086f8199a 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/_models.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/_models.py @@ -566,7 +566,7 @@ class ClusterSku(msrest.serialization.Model): _validation = { 'name': {'required': True}, - 'capacity': {'maximum': 32, 'minimum': 1}, + 'capacity': {'minimum': 1}, } _attribute_map = { @@ -735,6 +735,8 @@ class EHNamespace(TrackedResource): :type identity: ~azure.mgmt.eventhub.v2018_01_01_preview.models.Identity :ivar provisioning_state: Provisioning state of the Namespace. :vartype provisioning_state: str + :ivar status: Status of the Namespace. + :vartype status: str :ivar created_at: The time the Namespace was created. :vartype created_at: ~datetime.datetime :ivar updated_at: The time the Namespace was updated. @@ -765,6 +767,7 @@ class EHNamespace(TrackedResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, 'created_at': {'readonly': True}, 'updated_at': {'readonly': True}, 'service_bus_endpoint': {'readonly': True}, @@ -781,6 +784,7 @@ class EHNamespace(TrackedResource): 'sku': {'key': 'sku', 'type': 'Sku'}, 'identity': {'key': 'identity', 'type': 'Identity'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, 'updated_at': {'key': 'properties.updatedAt', 'type': 'iso-8601'}, 'service_bus_endpoint': {'key': 'properties.serviceBusEndpoint', 'type': 'str'}, @@ -801,6 +805,7 @@ def __init__( self.sku = kwargs.get('sku', None) self.identity = kwargs.get('identity', None) self.provisioning_state = None + self.status = None self.created_at = None self.updated_at = None self.service_bus_endpoint = None @@ -878,33 +883,27 @@ def __init__( class Encryption(msrest.serialization.Model): """Properties to configure Encryption. - Variables are only populated by the server, and will be ignored when sending a request. - :param key_vault_properties: Properties of KeyVault. :type key_vault_properties: list[~azure.mgmt.eventhub.v2018_01_01_preview.models.KeyVaultProperties] - :ivar key_source: Enumerates the possible value of keySource for Encryption. Default value: + :param key_source: Enumerates the possible value of keySource for Encryption. The only + acceptable values to pass in are None and "Microsoft.KeyVault". The default value is "Microsoft.KeyVault". - :vartype key_source: str + :type key_source: str """ - _validation = { - 'key_source': {'constant': True}, - } - _attribute_map = { 'key_vault_properties': {'key': 'keyVaultProperties', 'type': '[KeyVaultProperties]'}, 'key_source': {'key': 'keySource', 'type': 'str'}, } - key_source = "Microsoft.KeyVault" - def __init__( self, **kwargs ): super(Encryption, self).__init__(**kwargs) self.key_vault_properties = kwargs.get('key_vault_properties', None) + self.key_source = kwargs.get('key_source', "Microsoft.KeyVault") class ErrorResponse(msrest.serialization.Model): @@ -1026,29 +1025,22 @@ def __init__( class Identity(msrest.serialization.Model): """Properties to configure Identity for Bring your Own Keys. - Variables are only populated by the server, and will be ignored when sending a request. - :param principal_id: ObjectId from the KeyVault. :type principal_id: str :param tenant_id: TenantId from the KeyVault. :type tenant_id: str - :ivar type: Enumerates the possible value Identity type, which currently supports only - 'SystemAssigned'. Default value: "SystemAssigned". - :vartype type: str + :param type: Enumerates the possible value Identity type, which currently supports only + 'SystemAssigned'. The only acceptable values to pass in are None and "SystemAssigned". The + default value is "SystemAssigned". + :type type: str """ - _validation = { - 'type': {'constant': True}, - } - _attribute_map = { 'principal_id': {'key': 'principalId', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, } - type = "SystemAssigned" - def __init__( self, **kwargs @@ -1056,6 +1048,7 @@ def __init__( super(Identity, self).__init__(**kwargs) self.principal_id = kwargs.get('principal_id', None) self.tenant_id = kwargs.get('tenant_id', None) + self.type = kwargs.get('type', "SystemAssigned") class IpFilterRule(Resource): @@ -1646,7 +1639,7 @@ class Sku(msrest.serialization.Model): _validation = { 'name': {'required': True}, - 'capacity': {'maximum': 20, 'minimum': 0}, + 'capacity': {'minimum': 0}, } _attribute_map = { diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/_models_py3.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/_models_py3.py index f9539a1d126e..b77e8ceb7310 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/_models_py3.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2018_01_01_preview/models/_models_py3.py @@ -608,7 +608,7 @@ class ClusterSku(msrest.serialization.Model): _validation = { 'name': {'required': True}, - 'capacity': {'maximum': 32, 'minimum': 1}, + 'capacity': {'minimum': 1}, } _attribute_map = { @@ -793,6 +793,8 @@ class EHNamespace(TrackedResource): :type identity: ~azure.mgmt.eventhub.v2018_01_01_preview.models.Identity :ivar provisioning_state: Provisioning state of the Namespace. :vartype provisioning_state: str + :ivar status: Status of the Namespace. + :vartype status: str :ivar created_at: The time the Namespace was created. :vartype created_at: ~datetime.datetime :ivar updated_at: The time the Namespace was updated. @@ -823,6 +825,7 @@ class EHNamespace(TrackedResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, 'created_at': {'readonly': True}, 'updated_at': {'readonly': True}, 'service_bus_endpoint': {'readonly': True}, @@ -839,6 +842,7 @@ class EHNamespace(TrackedResource): 'sku': {'key': 'sku', 'type': 'Sku'}, 'identity': {'key': 'identity', 'type': 'Identity'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, 'updated_at': {'key': 'properties.updatedAt', 'type': 'iso-8601'}, 'service_bus_endpoint': {'key': 'properties.serviceBusEndpoint', 'type': 'str'}, @@ -870,6 +874,7 @@ def __init__( self.sku = sku self.identity = identity self.provisioning_state = None + self.status = None self.created_at = None self.updated_at = None self.service_bus_endpoint = None @@ -954,35 +959,30 @@ def __init__( class Encryption(msrest.serialization.Model): """Properties to configure Encryption. - Variables are only populated by the server, and will be ignored when sending a request. - :param key_vault_properties: Properties of KeyVault. :type key_vault_properties: list[~azure.mgmt.eventhub.v2018_01_01_preview.models.KeyVaultProperties] - :ivar key_source: Enumerates the possible value of keySource for Encryption. Default value: + :param key_source: Enumerates the possible value of keySource for Encryption. The only + acceptable values to pass in are None and "Microsoft.KeyVault". The default value is "Microsoft.KeyVault". - :vartype key_source: str + :type key_source: str """ - _validation = { - 'key_source': {'constant': True}, - } - _attribute_map = { 'key_vault_properties': {'key': 'keyVaultProperties', 'type': '[KeyVaultProperties]'}, 'key_source': {'key': 'keySource', 'type': 'str'}, } - key_source = "Microsoft.KeyVault" - def __init__( self, *, key_vault_properties: Optional[List["KeyVaultProperties"]] = None, + key_source: Optional[str] = "Microsoft.KeyVault", **kwargs ): super(Encryption, self).__init__(**kwargs) self.key_vault_properties = key_vault_properties + self.key_source = key_source class ErrorResponse(msrest.serialization.Model): @@ -1115,39 +1115,34 @@ def __init__( class Identity(msrest.serialization.Model): """Properties to configure Identity for Bring your Own Keys. - Variables are only populated by the server, and will be ignored when sending a request. - :param principal_id: ObjectId from the KeyVault. :type principal_id: str :param tenant_id: TenantId from the KeyVault. :type tenant_id: str - :ivar type: Enumerates the possible value Identity type, which currently supports only - 'SystemAssigned'. Default value: "SystemAssigned". - :vartype type: str + :param type: Enumerates the possible value Identity type, which currently supports only + 'SystemAssigned'. The only acceptable values to pass in are None and "SystemAssigned". The + default value is "SystemAssigned". + :type type: str """ - _validation = { - 'type': {'constant': True}, - } - _attribute_map = { 'principal_id': {'key': 'principalId', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, } - type = "SystemAssigned" - def __init__( self, *, principal_id: Optional[str] = None, tenant_id: Optional[str] = None, + type: Optional[str] = "SystemAssigned", **kwargs ): super(Identity, self).__init__(**kwargs) self.principal_id = principal_id self.tenant_id = tenant_id + self.type = type class IpFilterRule(Resource): @@ -1790,7 +1785,7 @@ class Sku(msrest.serialization.Model): _validation = { 'name': {'required': True}, - 'capacity': {'maximum': 20, 'minimum': 0}, + 'capacity': {'minimum': 0}, } _attribute_map = { diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_01_01_preview/__init__.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_01_01_preview/__init__.py index 72f93dd9db6c..b65464aa7533 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_01_01_preview/__init__.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_01_01_preview/__init__.py @@ -7,6 +7,9 @@ # -------------------------------------------------------------------------- from ._event_hub_management_client import EventHubManagementClient +from ._version import VERSION + +__version__ = VERSION __all__ = ['EventHubManagementClient'] try: diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_01_01_preview/_configuration.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_01_01_preview/_configuration.py index 491686092882..fe795e13f108 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_01_01_preview/_configuration.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_01_01_preview/_configuration.py @@ -12,13 +12,14 @@ from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from ._version import VERSION + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any from azure.core.credentials import TokenCredential -VERSION = "unknown" class EventHubManagementClientConfiguration(Configuration): """Configuration for EventHubManagementClient. diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_01_01_preview/_version.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_01_01_preview/_version.py new file mode 100644 index 000000000000..f89ed38360ab --- /dev/null +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_01_01_preview/_version.py @@ -0,0 +1,9 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +VERSION = "9.1.0" diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_01_01_preview/aio/_configuration.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_01_01_preview/aio/_configuration.py index 17c6db93518a..175aa96d6665 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_01_01_preview/aio/_configuration.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_01_01_preview/aio/_configuration.py @@ -12,11 +12,12 @@ from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from .._version import VERSION + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -VERSION = "unknown" class EventHubManagementClientConfiguration(Configuration): """Configuration for EventHubManagementClient. diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_01_01_preview/models/_models.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_01_01_preview/models/_models.py index 28906af33b90..f1080cbf888e 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_01_01_preview/models/_models.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_01_01_preview/models/_models.py @@ -606,6 +606,8 @@ class EHNamespace(TrackedResource): :vartype system_data: ~azure.mgmt.eventhub.v2021_01_01_preview.models.SystemData :ivar provisioning_state: Provisioning state of the Namespace. :vartype provisioning_state: str + :ivar status: Status of the Namespace. + :vartype status: str :ivar created_at: The time the Namespace was created. :vartype created_at: ~datetime.datetime :ivar updated_at: The time the Namespace was updated. @@ -640,6 +642,7 @@ class EHNamespace(TrackedResource): 'type': {'readonly': True}, 'system_data': {'readonly': True}, 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, 'created_at': {'readonly': True}, 'updated_at': {'readonly': True}, 'service_bus_endpoint': {'readonly': True}, @@ -657,6 +660,7 @@ class EHNamespace(TrackedResource): 'identity': {'key': 'identity', 'type': 'Identity'}, 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, 'updated_at': {'key': 'properties.updatedAt', 'type': 'iso-8601'}, 'service_bus_endpoint': {'key': 'properties.serviceBusEndpoint', 'type': 'str'}, @@ -679,6 +683,7 @@ def __init__( self.identity = kwargs.get('identity', None) self.system_data = None self.provisioning_state = None + self.status = None self.created_at = None self.updated_at = None self.service_bus_endpoint = None @@ -719,36 +724,30 @@ def __init__( class Encryption(msrest.serialization.Model): """Properties to configure Encryption. - Variables are only populated by the server, and will be ignored when sending a request. - :param key_vault_properties: Properties of KeyVault. :type key_vault_properties: list[~azure.mgmt.eventhub.v2021_01_01_preview.models.KeyVaultProperties] - :ivar key_source: Enumerates the possible value of keySource for Encryption. Default value: + :param key_source: Enumerates the possible value of keySource for Encryption. The only + acceptable values to pass in are None and "Microsoft.KeyVault". The default value is "Microsoft.KeyVault". - :vartype key_source: str + :type key_source: str :param require_infrastructure_encryption: Enable Infrastructure Encryption (Double Encryption). :type require_infrastructure_encryption: bool """ - _validation = { - 'key_source': {'constant': True}, - } - _attribute_map = { 'key_vault_properties': {'key': 'keyVaultProperties', 'type': '[KeyVaultProperties]'}, 'key_source': {'key': 'keySource', 'type': 'str'}, 'require_infrastructure_encryption': {'key': 'requireInfrastructureEncryption', 'type': 'bool'}, } - key_source = "Microsoft.KeyVault" - def __init__( self, **kwargs ): super(Encryption, self).__init__(**kwargs) self.key_vault_properties = kwargs.get('key_vault_properties', None) + self.key_source = kwargs.get('key_source', "Microsoft.KeyVault") self.require_infrastructure_encryption = kwargs.get('require_infrastructure_encryption', None) @@ -1348,7 +1347,7 @@ class Sku(msrest.serialization.Model): _validation = { 'name': {'required': True}, - 'capacity': {'maximum': 20, 'minimum': 0}, + 'capacity': {'minimum': 0}, } _attribute_map = { diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_01_01_preview/models/_models_py3.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_01_01_preview/models/_models_py3.py index 476a37dcd549..0bfac6b984e8 100644 --- a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_01_01_preview/models/_models_py3.py +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_01_01_preview/models/_models_py3.py @@ -649,6 +649,8 @@ class EHNamespace(TrackedResource): :vartype system_data: ~azure.mgmt.eventhub.v2021_01_01_preview.models.SystemData :ivar provisioning_state: Provisioning state of the Namespace. :vartype provisioning_state: str + :ivar status: Status of the Namespace. + :vartype status: str :ivar created_at: The time the Namespace was created. :vartype created_at: ~datetime.datetime :ivar updated_at: The time the Namespace was updated. @@ -683,6 +685,7 @@ class EHNamespace(TrackedResource): 'type': {'readonly': True}, 'system_data': {'readonly': True}, 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, 'created_at': {'readonly': True}, 'updated_at': {'readonly': True}, 'service_bus_endpoint': {'readonly': True}, @@ -700,6 +703,7 @@ class EHNamespace(TrackedResource): 'identity': {'key': 'identity', 'type': 'Identity'}, 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, 'updated_at': {'key': 'properties.updatedAt', 'type': 'iso-8601'}, 'service_bus_endpoint': {'key': 'properties.serviceBusEndpoint', 'type': 'str'}, @@ -734,6 +738,7 @@ def __init__( self.identity = identity self.system_data = None self.provisioning_state = None + self.status = None self.created_at = None self.updated_at = None self.service_bus_endpoint = None @@ -777,39 +782,34 @@ def __init__( class Encryption(msrest.serialization.Model): """Properties to configure Encryption. - Variables are only populated by the server, and will be ignored when sending a request. - :param key_vault_properties: Properties of KeyVault. :type key_vault_properties: list[~azure.mgmt.eventhub.v2021_01_01_preview.models.KeyVaultProperties] - :ivar key_source: Enumerates the possible value of keySource for Encryption. Default value: + :param key_source: Enumerates the possible value of keySource for Encryption. The only + acceptable values to pass in are None and "Microsoft.KeyVault". The default value is "Microsoft.KeyVault". - :vartype key_source: str + :type key_source: str :param require_infrastructure_encryption: Enable Infrastructure Encryption (Double Encryption). :type require_infrastructure_encryption: bool """ - _validation = { - 'key_source': {'constant': True}, - } - _attribute_map = { 'key_vault_properties': {'key': 'keyVaultProperties', 'type': '[KeyVaultProperties]'}, 'key_source': {'key': 'keySource', 'type': 'str'}, 'require_infrastructure_encryption': {'key': 'requireInfrastructureEncryption', 'type': 'bool'}, } - key_source = "Microsoft.KeyVault" - def __init__( self, *, key_vault_properties: Optional[List["KeyVaultProperties"]] = None, + key_source: Optional[str] = "Microsoft.KeyVault", require_infrastructure_encryption: Optional[bool] = None, **kwargs ): super(Encryption, self).__init__(**kwargs) self.key_vault_properties = key_vault_properties + self.key_source = key_source self.require_infrastructure_encryption = require_infrastructure_encryption @@ -1463,7 +1463,7 @@ class Sku(msrest.serialization.Model): _validation = { 'name': {'required': True}, - 'capacity': {'maximum': 20, 'minimum': 0}, + 'capacity': {'minimum': 0}, } _attribute_map = { diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/__init__.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/__init__.py new file mode 100644 index 000000000000..b65464aa7533 --- /dev/null +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/__init__.py @@ -0,0 +1,19 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._event_hub_management_client import EventHubManagementClient +from ._version import VERSION + +__version__ = VERSION +__all__ = ['EventHubManagementClient'] + +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/_configuration.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/_configuration.py new file mode 100644 index 000000000000..b9bf44ea4e36 --- /dev/null +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/_configuration.py @@ -0,0 +1,71 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +from ._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + + +class EventHubManagementClientConfiguration(Configuration): + """Configuration for EventHubManagementClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :type subscription_id: str + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(EventHubManagementClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2021-06-01-preview" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/_event_hub_management_client.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/_event_hub_management_client.py new file mode 100644 index 000000000000..beeaa7db93c5 --- /dev/null +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/_event_hub_management_client.py @@ -0,0 +1,129 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + from azure.core.credentials import TokenCredential + from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from ._configuration import EventHubManagementClientConfiguration +from .operations import ClustersOperations +from .operations import ConfigurationOperations +from .operations import NamespacesOperations +from .operations import PrivateEndpointConnectionsOperations +from .operations import PrivateLinkResourcesOperations +from .operations import Operations +from .operations import EventHubsOperations +from .operations import DisasterRecoveryConfigsOperations +from .operations import ConsumerGroupsOperations +from . import models + + +class EventHubManagementClient(object): + """Azure Event Hubs client for managing Event Hubs Cluster, IPFilter Rules and VirtualNetworkRules resources. + + :ivar clusters: ClustersOperations operations + :vartype clusters: azure.mgmt.eventhub.v2021_06_01_preview.operations.ClustersOperations + :ivar configuration: ConfigurationOperations operations + :vartype configuration: azure.mgmt.eventhub.v2021_06_01_preview.operations.ConfigurationOperations + :ivar namespaces: NamespacesOperations operations + :vartype namespaces: azure.mgmt.eventhub.v2021_06_01_preview.operations.NamespacesOperations + :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations + :vartype private_endpoint_connections: azure.mgmt.eventhub.v2021_06_01_preview.operations.PrivateEndpointConnectionsOperations + :ivar private_link_resources: PrivateLinkResourcesOperations operations + :vartype private_link_resources: azure.mgmt.eventhub.v2021_06_01_preview.operations.PrivateLinkResourcesOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.eventhub.v2021_06_01_preview.operations.Operations + :ivar event_hubs: EventHubsOperations operations + :vartype event_hubs: azure.mgmt.eventhub.v2021_06_01_preview.operations.EventHubsOperations + :ivar disaster_recovery_configs: DisasterRecoveryConfigsOperations operations + :vartype disaster_recovery_configs: azure.mgmt.eventhub.v2021_06_01_preview.operations.DisasterRecoveryConfigsOperations + :ivar consumer_groups: ConsumerGroupsOperations operations + :vartype consumer_groups: azure.mgmt.eventhub.v2021_06_01_preview.operations.ConsumerGroupsOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = EventHubManagementClientConfiguration(credential, subscription_id, **kwargs) + self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + self.clusters = ClustersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.configuration = ConfigurationOperations( + self._client, self._config, self._serialize, self._deserialize) + self.namespaces = NamespacesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.event_hubs = EventHubsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.disaster_recovery_configs = DisasterRecoveryConfigsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.consumer_groups = ConsumerGroupsOperations( + self._client, self._config, self._serialize, self._deserialize) + + def _send_request(self, http_request, **kwargs): + # type: (HttpRequest, Any) -> HttpResponse + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.HttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> EventHubManagementClient + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/_metadata.json b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/_metadata.json new file mode 100644 index 000000000000..8a86fd3ac377 --- /dev/null +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/_metadata.json @@ -0,0 +1,111 @@ +{ + "chosen_version": "2021-06-01-preview", + "total_api_version_list": ["2021-06-01-preview"], + "client": { + "name": "EventHubManagementClient", + "filename": "_event_hub_management_client", + "description": "Azure Event Hubs client for managing Event Hubs Cluster, IPFilter Rules and VirtualNetworkRules resources.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true, + "client_side_validation": false, + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"EventHubManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"EventHubManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + }, + "global_parameters": { + "sync": { + "credential": { + "signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + "docstring_type": "str", + "required": true + } + }, + "async": { + "credential": { + "signature": "credential: \"AsyncTokenCredential\",", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id: str,", + "description": "Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + "docstring_type": "str", + "required": true + } + }, + "constant": { + }, + "call": "credential, subscription_id", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url=None, # type: Optional[str]", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "async": { + "api_version": { + "signature": "api_version: Optional[str] = None,", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url: Optional[str] = None,", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } + }, + "config": { + "credential": true, + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null, + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" + }, + "operation_groups": { + "clusters": "ClustersOperations", + "configuration": "ConfigurationOperations", + "namespaces": "NamespacesOperations", + "private_endpoint_connections": "PrivateEndpointConnectionsOperations", + "private_link_resources": "PrivateLinkResourcesOperations", + "operations": "Operations", + "event_hubs": "EventHubsOperations", + "disaster_recovery_configs": "DisasterRecoveryConfigsOperations", + "consumer_groups": "ConsumerGroupsOperations" + } +} \ No newline at end of file diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/_version.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/_version.py new file mode 100644 index 000000000000..f89ed38360ab --- /dev/null +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/_version.py @@ -0,0 +1,9 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +VERSION = "9.1.0" diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/aio/__init__.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/aio/__init__.py new file mode 100644 index 000000000000..7cb0ca65be40 --- /dev/null +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/aio/__init__.py @@ -0,0 +1,10 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._event_hub_management_client import EventHubManagementClient +__all__ = ['EventHubManagementClient'] diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/aio/_configuration.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/aio/_configuration.py new file mode 100644 index 000000000000..f5a3a9c9dde4 --- /dev/null +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/aio/_configuration.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +from .._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + + +class EventHubManagementClientConfiguration(Configuration): + """Configuration for EventHubManagementClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :type subscription_id: str + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(EventHubManagementClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2021-06-01-preview" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs: Any + ) -> None: + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/aio/_event_hub_management_client.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/aio/_event_hub_management_client.py new file mode 100644 index 000000000000..b36eca3aa4b0 --- /dev/null +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/aio/_event_hub_management_client.py @@ -0,0 +1,122 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional, TYPE_CHECKING + +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +from ._configuration import EventHubManagementClientConfiguration +from .operations import ClustersOperations +from .operations import ConfigurationOperations +from .operations import NamespacesOperations +from .operations import PrivateEndpointConnectionsOperations +from .operations import PrivateLinkResourcesOperations +from .operations import Operations +from .operations import EventHubsOperations +from .operations import DisasterRecoveryConfigsOperations +from .operations import ConsumerGroupsOperations +from .. import models + + +class EventHubManagementClient(object): + """Azure Event Hubs client for managing Event Hubs Cluster, IPFilter Rules and VirtualNetworkRules resources. + + :ivar clusters: ClustersOperations operations + :vartype clusters: azure.mgmt.eventhub.v2021_06_01_preview.aio.operations.ClustersOperations + :ivar configuration: ConfigurationOperations operations + :vartype configuration: azure.mgmt.eventhub.v2021_06_01_preview.aio.operations.ConfigurationOperations + :ivar namespaces: NamespacesOperations operations + :vartype namespaces: azure.mgmt.eventhub.v2021_06_01_preview.aio.operations.NamespacesOperations + :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations + :vartype private_endpoint_connections: azure.mgmt.eventhub.v2021_06_01_preview.aio.operations.PrivateEndpointConnectionsOperations + :ivar private_link_resources: PrivateLinkResourcesOperations operations + :vartype private_link_resources: azure.mgmt.eventhub.v2021_06_01_preview.aio.operations.PrivateLinkResourcesOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.eventhub.v2021_06_01_preview.aio.operations.Operations + :ivar event_hubs: EventHubsOperations operations + :vartype event_hubs: azure.mgmt.eventhub.v2021_06_01_preview.aio.operations.EventHubsOperations + :ivar disaster_recovery_configs: DisasterRecoveryConfigsOperations operations + :vartype disaster_recovery_configs: azure.mgmt.eventhub.v2021_06_01_preview.aio.operations.DisasterRecoveryConfigsOperations + :ivar consumer_groups: ConsumerGroupsOperations operations + :vartype consumer_groups: azure.mgmt.eventhub.v2021_06_01_preview.aio.operations.ConsumerGroupsOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :type subscription_id: str + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = EventHubManagementClientConfiguration(credential, subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + self.clusters = ClustersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.configuration = ConfigurationOperations( + self._client, self._config, self._serialize, self._deserialize) + self.namespaces = NamespacesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.event_hubs = EventHubsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.disaster_recovery_configs = DisasterRecoveryConfigsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.consumer_groups = ConsumerGroupsOperations( + self._client, self._config, self._serialize, self._deserialize) + + async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "EventHubManagementClient": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/aio/operations/__init__.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/aio/operations/__init__.py new file mode 100644 index 000000000000..11daeaa7c220 --- /dev/null +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/aio/operations/__init__.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._clusters_operations import ClustersOperations +from ._configuration_operations import ConfigurationOperations +from ._namespaces_operations import NamespacesOperations +from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._private_link_resources_operations import PrivateLinkResourcesOperations +from ._operations import Operations +from ._event_hubs_operations import EventHubsOperations +from ._disaster_recovery_configs_operations import DisasterRecoveryConfigsOperations +from ._consumer_groups_operations import ConsumerGroupsOperations + +__all__ = [ + 'ClustersOperations', + 'ConfigurationOperations', + 'NamespacesOperations', + 'PrivateEndpointConnectionsOperations', + 'PrivateLinkResourcesOperations', + 'Operations', + 'EventHubsOperations', + 'DisasterRecoveryConfigsOperations', + 'ConsumerGroupsOperations', +] diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/aio/operations/_clusters_operations.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/aio/operations/_clusters_operations.py new file mode 100644 index 000000000000..2a1e46327dc1 --- /dev/null +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/aio/operations/_clusters_operations.py @@ -0,0 +1,720 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ClustersOperations: + """ClustersOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.eventhub.v2021_06_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def list_available_cluster_region( + self, + **kwargs: Any + ) -> "_models.AvailableClustersList": + """List the quantity of available pre-provisioned Event Hubs Clusters, indexed by Azure region. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AvailableClustersList, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2021_06_01_preview.models.AvailableClustersList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableClustersList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.list_available_cluster_region.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AvailableClustersList', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_available_cluster_region.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EventHub/availableClusterRegions'} # type: ignore + + def list_by_subscription( + self, + **kwargs: Any + ) -> AsyncIterable["_models.ClusterListResult"]: + """Lists the available Event Hubs Clusters within an ARM resource group. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ClusterListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.eventhub.v2021_06_01_preview.models.ClusterListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ClusterListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ClusterListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EventHub/clusters'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.ClusterListResult"]: + """Lists the available Event Hubs Clusters within an ARM resource group. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ClusterListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.eventhub.v2021_06_01_preview.models.ClusterListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ClusterListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ClusterListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters'} # type: ignore + + async def get( + self, + resource_group_name: str, + cluster_name: str, + **kwargs: Any + ) -> "_models.Cluster": + """Gets the resource description of the specified Event Hubs Cluster. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param cluster_name: The name of the Event Hubs Cluster. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Cluster, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2021_06_01_preview.models.Cluster + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Cluster"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=50, min_length=6), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Cluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters/{clusterName}'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + cluster_name: str, + parameters: "_models.Cluster", + **kwargs: Any + ) -> Optional["_models.Cluster"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Cluster"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=50, min_length=6), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'Cluster') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Cluster', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Cluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters/{clusterName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + cluster_name: str, + parameters: "_models.Cluster", + **kwargs: Any + ) -> AsyncLROPoller["_models.Cluster"]: + """Creates or updates an instance of an Event Hubs Cluster. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param cluster_name: The name of the Event Hubs Cluster. + :type cluster_name: str + :param parameters: Parameters for creating a eventhub cluster resource. + :type parameters: ~azure.mgmt.eventhub.v2021_06_01_preview.models.Cluster + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Cluster or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.eventhub.v2021_06_01_preview.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Cluster"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Cluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=50, min_length=6), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters/{clusterName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + cluster_name: str, + parameters: "_models.Cluster", + **kwargs: Any + ) -> Optional["_models.Cluster"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Cluster"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=50, min_length=6), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'Cluster') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Cluster', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Cluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters/{clusterName}'} # type: ignore + + async def begin_update( + self, + resource_group_name: str, + cluster_name: str, + parameters: "_models.Cluster", + **kwargs: Any + ) -> AsyncLROPoller["_models.Cluster"]: + """Modifies mutable properties on the Event Hubs Cluster. This operation is idempotent. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param cluster_name: The name of the Event Hubs Cluster. + :type cluster_name: str + :param parameters: The properties of the Event Hubs Cluster which should be updated. + :type parameters: ~azure.mgmt.eventhub.v2021_06_01_preview.models.Cluster + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Cluster or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.eventhub.v2021_06_01_preview.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Cluster"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Cluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=50, min_length=6), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters/{clusterName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + cluster_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=50, min_length=6), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters/{clusterName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + cluster_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes an existing Event Hubs Cluster. This operation is idempotent. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param cluster_name: The name of the Event Hubs Cluster. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=50, min_length=6), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters/{clusterName}'} # type: ignore + + async def list_namespaces( + self, + resource_group_name: str, + cluster_name: str, + **kwargs: Any + ) -> "_models.EHNamespaceIdListResult": + """List all Event Hubs Namespace IDs in an Event Hubs Dedicated Cluster. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param cluster_name: The name of the Event Hubs Cluster. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: EHNamespaceIdListResult, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2021_06_01_preview.models.EHNamespaceIdListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.EHNamespaceIdListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.list_namespaces.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=50, min_length=6), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('EHNamespaceIdListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_namespaces.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters/{clusterName}/namespaces'} # type: ignore diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/aio/operations/_configuration_operations.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/aio/operations/_configuration_operations.py new file mode 100644 index 000000000000..376ff8ea4f20 --- /dev/null +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/aio/operations/_configuration_operations.py @@ -0,0 +1,174 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ConfigurationOperations: + """ConfigurationOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.eventhub.v2021_06_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def patch( + self, + resource_group_name: str, + cluster_name: str, + parameters: "_models.ClusterQuotaConfigurationProperties", + **kwargs: Any + ) -> Optional["_models.ClusterQuotaConfigurationProperties"]: + """Replace all specified Event Hubs Cluster settings with those contained in the request body. + Leaves the settings not specified in the request body unmodified. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param cluster_name: The name of the Event Hubs Cluster. + :type cluster_name: str + :param parameters: Parameters for creating an Event Hubs Cluster resource. + :type parameters: ~azure.mgmt.eventhub.v2021_06_01_preview.models.ClusterQuotaConfigurationProperties + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ClusterQuotaConfigurationProperties, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2021_06_01_preview.models.ClusterQuotaConfigurationProperties or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ClusterQuotaConfigurationProperties"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.patch.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=50, min_length=6), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ClusterQuotaConfigurationProperties') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ClusterQuotaConfigurationProperties', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ClusterQuotaConfigurationProperties', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + patch.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters/{clusterName}/quotaConfiguration/default'} # type: ignore + + async def get( + self, + resource_group_name: str, + cluster_name: str, + **kwargs: Any + ) -> "_models.ClusterQuotaConfigurationProperties": + """Get all Event Hubs Cluster settings - a collection of key/value pairs which represent the + quotas and settings imposed on the cluster. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param cluster_name: The name of the Event Hubs Cluster. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ClusterQuotaConfigurationProperties, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2021_06_01_preview.models.ClusterQuotaConfigurationProperties + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ClusterQuotaConfigurationProperties"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=50, min_length=6), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ClusterQuotaConfigurationProperties', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters/{clusterName}/quotaConfiguration/default'} # type: ignore diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/aio/operations/_consumer_groups_operations.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/aio/operations/_consumer_groups_operations.py new file mode 100644 index 000000000000..ea56378f586c --- /dev/null +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/aio/operations/_consumer_groups_operations.py @@ -0,0 +1,340 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ConsumerGroupsOperations: + """ConsumerGroupsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.eventhub.v2021_06_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def create_or_update( + self, + resource_group_name: str, + namespace_name: str, + event_hub_name: str, + consumer_group_name: str, + parameters: "_models.ConsumerGroup", + **kwargs: Any + ) -> "_models.ConsumerGroup": + """Creates or updates an Event Hubs consumer group as a nested resource within a Namespace. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param event_hub_name: The Event Hub name. + :type event_hub_name: str + :param consumer_group_name: The consumer group name. + :type consumer_group_name: str + :param parameters: Parameters supplied to create or update a consumer group resource. + :type parameters: ~azure.mgmt.eventhub.v2021_06_01_preview.models.ConsumerGroup + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ConsumerGroup, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2021_06_01_preview.models.ConsumerGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConsumerGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), + 'consumerGroupName': self._serialize.url("consumer_group_name", consumer_group_name, 'str', max_length=50, min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ConsumerGroup') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ConsumerGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/consumergroups/{consumerGroupName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + namespace_name: str, + event_hub_name: str, + consumer_group_name: str, + **kwargs: Any + ) -> None: + """Deletes a consumer group from the specified Event Hub and resource group. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param event_hub_name: The Event Hub name. + :type event_hub_name: str + :param consumer_group_name: The consumer group name. + :type consumer_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), + 'consumerGroupName': self._serialize.url("consumer_group_name", consumer_group_name, 'str', max_length=50, min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/consumergroups/{consumerGroupName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + namespace_name: str, + event_hub_name: str, + consumer_group_name: str, + **kwargs: Any + ) -> "_models.ConsumerGroup": + """Gets a description for the specified consumer group. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param event_hub_name: The Event Hub name. + :type event_hub_name: str + :param consumer_group_name: The consumer group name. + :type consumer_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ConsumerGroup, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2021_06_01_preview.models.ConsumerGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConsumerGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), + 'consumerGroupName': self._serialize.url("consumer_group_name", consumer_group_name, 'str', max_length=50, min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ConsumerGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/consumergroups/{consumerGroupName}'} # type: ignore + + def list_by_event_hub( + self, + resource_group_name: str, + namespace_name: str, + event_hub_name: str, + skip: Optional[int] = None, + top: Optional[int] = None, + **kwargs: Any + ) -> AsyncIterable["_models.ConsumerGroupListResult"]: + """Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group + exists in the Namespace. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param event_hub_name: The Event Hub name. + :type event_hub_name: str + :param skip: Skip is only used if a previous operation returned a partial result. If a previous + response contains a nextLink element, the value of the nextLink element will include a skip + parameter that specifies a starting point to use for subsequent calls. + :type skip: int + :param top: May be used to limit the number of results to the most recent N usageDetails. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ConsumerGroupListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.eventhub.v2021_06_01_preview.models.ConsumerGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConsumerGroupListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_event_hub.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', maximum=1000, minimum=0) + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ConsumerGroupListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_event_hub.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/consumergroups'} # type: ignore diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/aio/operations/_disaster_recovery_configs_operations.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/aio/operations/_disaster_recovery_configs_operations.py new file mode 100644 index 000000000000..d6e7c63e233c --- /dev/null +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/aio/operations/_disaster_recovery_configs_operations.py @@ -0,0 +1,714 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class DisasterRecoveryConfigsOperations: + """DisasterRecoveryConfigsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.eventhub.v2021_06_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def check_name_availability( + self, + resource_group_name: str, + namespace_name: str, + parameters: "_models.CheckNameAvailabilityParameter", + **kwargs: Any + ) -> "_models.CheckNameAvailabilityResult": + """Check the give Namespace name availability. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param parameters: Parameters to check availability of the given Alias name. + :type parameters: ~azure.mgmt.eventhub.v2021_06_01_preview.models.CheckNameAvailabilityParameter + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CheckNameAvailabilityResult, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2021_06_01_preview.models.CheckNameAvailabilityResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameAvailabilityResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.check_name_availability.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'CheckNameAvailabilityParameter') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CheckNameAvailabilityResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/checkNameAvailability'} # type: ignore + + def list( + self, + resource_group_name: str, + namespace_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.ArmDisasterRecoveryListResult"]: + """Gets all Alias(Disaster Recovery configurations). + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ArmDisasterRecoveryListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.eventhub.v2021_06_01_preview.models.ArmDisasterRecoveryListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArmDisasterRecoveryListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ArmDisasterRecoveryListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs'} # type: ignore + + async def create_or_update( + self, + resource_group_name: str, + namespace_name: str, + alias: str, + parameters: "_models.ArmDisasterRecovery", + **kwargs: Any + ) -> Optional["_models.ArmDisasterRecovery"]: + """Creates or updates a new Alias(Disaster Recovery configuration). + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param alias: The Disaster Recovery configuration name. + :type alias: str + :param parameters: Parameters required to create an Alias(Disaster Recovery configuration). + :type parameters: ~azure.mgmt.eventhub.v2021_06_01_preview.models.ArmDisasterRecovery + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ArmDisasterRecovery, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2021_06_01_preview.models.ArmDisasterRecovery or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ArmDisasterRecovery"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'alias': self._serialize.url("alias", alias, 'str', max_length=50, min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ArmDisasterRecovery') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ArmDisasterRecovery', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + namespace_name: str, + alias: str, + **kwargs: Any + ) -> None: + """Deletes an Alias(Disaster Recovery configuration). + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param alias: The Disaster Recovery configuration name. + :type alias: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'alias': self._serialize.url("alias", alias, 'str', max_length=50, min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}'} # type: ignore + + async def get( + self, + resource_group_name: str, + namespace_name: str, + alias: str, + **kwargs: Any + ) -> "_models.ArmDisasterRecovery": + """Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param alias: The Disaster Recovery configuration name. + :type alias: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ArmDisasterRecovery, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2021_06_01_preview.models.ArmDisasterRecovery + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArmDisasterRecovery"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'alias': self._serialize.url("alias", alias, 'str', max_length=50, min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ArmDisasterRecovery', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}'} # type: ignore + + async def break_pairing( + self, + resource_group_name: str, + namespace_name: str, + alias: str, + **kwargs: Any + ) -> None: + """This operation disables the Disaster Recovery and stops replicating changes from primary to + secondary namespaces. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param alias: The Disaster Recovery configuration name. + :type alias: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.break_pairing.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'alias': self._serialize.url("alias", alias, 'str', max_length=50, min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + break_pairing.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/breakPairing'} # type: ignore + + async def fail_over( + self, + resource_group_name: str, + namespace_name: str, + alias: str, + **kwargs: Any + ) -> None: + """Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param alias: The Disaster Recovery configuration name. + :type alias: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.fail_over.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'alias': self._serialize.url("alias", alias, 'str', max_length=50, min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + fail_over.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/failover'} # type: ignore + + def list_authorization_rules( + self, + resource_group_name: str, + namespace_name: str, + alias: str, + **kwargs: Any + ) -> AsyncIterable["_models.AuthorizationRuleListResult"]: + """Gets a list of authorization rules for a Namespace. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param alias: The Disaster Recovery configuration name. + :type alias: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AuthorizationRuleListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.eventhub.v2021_06_01_preview.models.AuthorizationRuleListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationRuleListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_authorization_rules.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'alias': self._serialize.url("alias", alias, 'str', max_length=50, min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AuthorizationRuleListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_authorization_rules.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/authorizationRules'} # type: ignore + + async def get_authorization_rule( + self, + resource_group_name: str, + namespace_name: str, + alias: str, + authorization_rule_name: str, + **kwargs: Any + ) -> "_models.AuthorizationRule": + """Gets an AuthorizationRule for a Namespace by rule name. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param alias: The Disaster Recovery configuration name. + :type alias: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AuthorizationRule, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2021_06_01_preview.models.AuthorizationRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.get_authorization_rule.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'alias': self._serialize.url("alias", alias, 'str', max_length=50, min_length=1), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AuthorizationRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/authorizationRules/{authorizationRuleName}'} # type: ignore + + async def list_keys( + self, + resource_group_name: str, + namespace_name: str, + alias: str, + authorization_rule_name: str, + **kwargs: Any + ) -> "_models.AccessKeys": + """Gets the primary and secondary connection strings for the Namespace. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param alias: The Disaster Recovery configuration name. + :type alias: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AccessKeys, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2021_06_01_preview.models.AccessKeys + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessKeys"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.list_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'alias': self._serialize.url("alias", alias, 'str', max_length=50, min_length=1), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AccessKeys', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/authorizationRules/{authorizationRuleName}/listKeys'} # type: ignore diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/aio/operations/_event_hubs_operations.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/aio/operations/_event_hubs_operations.py new file mode 100644 index 000000000000..673871fa8c51 --- /dev/null +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/aio/operations/_event_hubs_operations.py @@ -0,0 +1,752 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class EventHubsOperations: + """EventHubsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.eventhub.v2021_06_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_namespace( + self, + resource_group_name: str, + namespace_name: str, + skip: Optional[int] = None, + top: Optional[int] = None, + **kwargs: Any + ) -> AsyncIterable["_models.EventHubListResult"]: + """Gets all the Event Hubs in a Namespace. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param skip: Skip is only used if a previous operation returned a partial result. If a previous + response contains a nextLink element, the value of the nextLink element will include a skip + parameter that specifies a starting point to use for subsequent calls. + :type skip: int + :param top: May be used to limit the number of results to the most recent N usageDetails. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either EventHubListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.eventhub.v2021_06_01_preview.models.EventHubListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.EventHubListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_namespace.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', maximum=1000, minimum=0) + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('EventHubListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_namespace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs'} # type: ignore + + async def create_or_update( + self, + resource_group_name: str, + namespace_name: str, + event_hub_name: str, + parameters: "_models.Eventhub", + **kwargs: Any + ) -> "_models.Eventhub": + """Creates or updates a new Event Hub as a nested resource within a Namespace. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param event_hub_name: The Event Hub name. + :type event_hub_name: str + :param parameters: Parameters supplied to create an Event Hub resource. + :type parameters: ~azure.mgmt.eventhub.v2021_06_01_preview.models.Eventhub + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Eventhub, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2021_06_01_preview.models.Eventhub + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Eventhub"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'Eventhub') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Eventhub', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + namespace_name: str, + event_hub_name: str, + **kwargs: Any + ) -> None: + """Deletes an Event Hub from the specified Namespace and resource group. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param event_hub_name: The Event Hub name. + :type event_hub_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + namespace_name: str, + event_hub_name: str, + **kwargs: Any + ) -> "_models.Eventhub": + """Gets an Event Hubs description for the specified Event Hub. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param event_hub_name: The Event Hub name. + :type event_hub_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Eventhub, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2021_06_01_preview.models.Eventhub + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Eventhub"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Eventhub', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}'} # type: ignore + + def list_authorization_rules( + self, + resource_group_name: str, + namespace_name: str, + event_hub_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.AuthorizationRuleListResult"]: + """Gets the authorization rules for an Event Hub. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param event_hub_name: The Event Hub name. + :type event_hub_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AuthorizationRuleListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.eventhub.v2021_06_01_preview.models.AuthorizationRuleListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationRuleListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_authorization_rules.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AuthorizationRuleListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_authorization_rules.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules'} # type: ignore + + async def create_or_update_authorization_rule( + self, + resource_group_name: str, + namespace_name: str, + event_hub_name: str, + authorization_rule_name: str, + parameters: "_models.AuthorizationRule", + **kwargs: Any + ) -> "_models.AuthorizationRule": + """Creates or updates an AuthorizationRule for the specified Event Hub. Creation/update of the + AuthorizationRule will take a few seconds to take effect. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param event_hub_name: The Event Hub name. + :type event_hub_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :param parameters: The shared access AuthorizationRule. + :type parameters: ~azure.mgmt.eventhub.v2021_06_01_preview.models.AuthorizationRule + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AuthorizationRule, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2021_06_01_preview.models.AuthorizationRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_authorization_rule.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'AuthorizationRule') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AuthorizationRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}'} # type: ignore + + async def get_authorization_rule( + self, + resource_group_name: str, + namespace_name: str, + event_hub_name: str, + authorization_rule_name: str, + **kwargs: Any + ) -> "_models.AuthorizationRule": + """Gets an AuthorizationRule for an Event Hub by rule name. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param event_hub_name: The Event Hub name. + :type event_hub_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AuthorizationRule, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2021_06_01_preview.models.AuthorizationRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.get_authorization_rule.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AuthorizationRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}'} # type: ignore + + async def delete_authorization_rule( + self, + resource_group_name: str, + namespace_name: str, + event_hub_name: str, + authorization_rule_name: str, + **kwargs: Any + ) -> None: + """Deletes an Event Hub AuthorizationRule. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param event_hub_name: The Event Hub name. + :type event_hub_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete_authorization_rule.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}'} # type: ignore + + async def list_keys( + self, + resource_group_name: str, + namespace_name: str, + event_hub_name: str, + authorization_rule_name: str, + **kwargs: Any + ) -> "_models.AccessKeys": + """Gets the ACS and SAS connection strings for the Event Hub. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param event_hub_name: The Event Hub name. + :type event_hub_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AccessKeys, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2021_06_01_preview.models.AccessKeys + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessKeys"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.list_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AccessKeys', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}/listKeys'} # type: ignore + + async def regenerate_keys( + self, + resource_group_name: str, + namespace_name: str, + event_hub_name: str, + authorization_rule_name: str, + parameters: "_models.RegenerateAccessKeyParameters", + **kwargs: Any + ) -> "_models.AccessKeys": + """Regenerates the ACS and SAS connection strings for the Event Hub. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param event_hub_name: The Event Hub name. + :type event_hub_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :param parameters: Parameters supplied to regenerate the AuthorizationRule Keys + (PrimaryKey/SecondaryKey). + :type parameters: ~azure.mgmt.eventhub.v2021_06_01_preview.models.RegenerateAccessKeyParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AccessKeys, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2021_06_01_preview.models.AccessKeys + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessKeys"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.regenerate_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'RegenerateAccessKeyParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AccessKeys', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + regenerate_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}/regenerateKeys'} # type: ignore diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/aio/operations/_namespaces_operations.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/aio/operations/_namespaces_operations.py new file mode 100644 index 000000000000..12510f5a7785 --- /dev/null +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/aio/operations/_namespaces_operations.py @@ -0,0 +1,1143 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class NamespacesOperations: + """NamespacesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.eventhub.v2021_06_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs: Any + ) -> AsyncIterable["_models.EHNamespaceListResult"]: + """Lists all the available Namespaces within a subscription, irrespective of the resource groups. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either EHNamespaceListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.eventhub.v2021_06_01_preview.models.EHNamespaceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.EHNamespaceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('EHNamespaceListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EventHub/namespaces'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.EHNamespaceListResult"]: + """Lists the available Namespaces within a resource group. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either EHNamespaceListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.eventhub.v2021_06_01_preview.models.EHNamespaceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.EHNamespaceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('EHNamespaceListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + namespace_name: str, + parameters: "_models.EHNamespace", + **kwargs: Any + ) -> Optional["_models.EHNamespace"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EHNamespace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'EHNamespace') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('EHNamespace', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('EHNamespace', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + namespace_name: str, + parameters: "_models.EHNamespace", + **kwargs: Any + ) -> AsyncLROPoller["_models.EHNamespace"]: + """Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. + This operation is idempotent. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param parameters: Parameters for creating a namespace resource. + :type parameters: ~azure.mgmt.eventhub.v2021_06_01_preview.models.EHNamespace + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either EHNamespace or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.eventhub.v2021_06_01_preview.models.EHNamespace] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EHNamespace"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('EHNamespace', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + namespace_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + namespace_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes an existing namespace. This operation also removes all associated resources under the + namespace. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + namespace_name: str, + **kwargs: Any + ) -> "_models.EHNamespace": + """Gets the description of the specified namespace. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: EHNamespace, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2021_06_01_preview.models.EHNamespace + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.EHNamespace"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('EHNamespace', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}'} # type: ignore + + async def update( + self, + resource_group_name: str, + namespace_name: str, + parameters: "_models.EHNamespace", + **kwargs: Any + ) -> Optional["_models.EHNamespace"]: + """Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. + This operation is idempotent. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param parameters: Parameters for updating a namespace resource. + :type parameters: ~azure.mgmt.eventhub.v2021_06_01_preview.models.EHNamespace + :keyword callable cls: A custom type or function that will be passed the direct response + :return: EHNamespace, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2021_06_01_preview.models.EHNamespace or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EHNamespace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'EHNamespace') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('EHNamespace', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('EHNamespace', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}'} # type: ignore + + async def create_or_update_network_rule_set( + self, + resource_group_name: str, + namespace_name: str, + parameters: "_models.NetworkRuleSet", + **kwargs: Any + ) -> "_models.NetworkRuleSet": + """Create or update NetworkRuleSet for a Namespace. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param parameters: The Namespace IpFilterRule. + :type parameters: ~azure.mgmt.eventhub.v2021_06_01_preview.models.NetworkRuleSet + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkRuleSet, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2021_06_01_preview.models.NetworkRuleSet + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkRuleSet"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_network_rule_set.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'NetworkRuleSet') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkRuleSet', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_network_rule_set.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/networkRuleSets/default'} # type: ignore + + async def get_network_rule_set( + self, + resource_group_name: str, + namespace_name: str, + **kwargs: Any + ) -> "_models.NetworkRuleSet": + """Gets NetworkRuleSet for a Namespace. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkRuleSet, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2021_06_01_preview.models.NetworkRuleSet + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkRuleSet"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.get_network_rule_set.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkRuleSet', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_network_rule_set.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/networkRuleSets/default'} # type: ignore + + def list_authorization_rules( + self, + resource_group_name: str, + namespace_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.AuthorizationRuleListResult"]: + """Gets a list of authorization rules for a Namespace. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AuthorizationRuleListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.eventhub.v2021_06_01_preview.models.AuthorizationRuleListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationRuleListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_authorization_rules.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AuthorizationRuleListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_authorization_rules.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules'} # type: ignore + + async def create_or_update_authorization_rule( + self, + resource_group_name: str, + namespace_name: str, + authorization_rule_name: str, + parameters: "_models.AuthorizationRule", + **kwargs: Any + ) -> "_models.AuthorizationRule": + """Creates or updates an AuthorizationRule for a Namespace. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :param parameters: The shared access AuthorizationRule. + :type parameters: ~azure.mgmt.eventhub.v2021_06_01_preview.models.AuthorizationRule + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AuthorizationRule, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2021_06_01_preview.models.AuthorizationRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_authorization_rule.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'AuthorizationRule') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AuthorizationRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}'} # type: ignore + + async def delete_authorization_rule( + self, + resource_group_name: str, + namespace_name: str, + authorization_rule_name: str, + **kwargs: Any + ) -> None: + """Deletes an AuthorizationRule for a Namespace. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete_authorization_rule.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}'} # type: ignore + + async def get_authorization_rule( + self, + resource_group_name: str, + namespace_name: str, + authorization_rule_name: str, + **kwargs: Any + ) -> "_models.AuthorizationRule": + """Gets an AuthorizationRule for a Namespace by rule name. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AuthorizationRule, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2021_06_01_preview.models.AuthorizationRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.get_authorization_rule.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AuthorizationRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}'} # type: ignore + + async def list_keys( + self, + resource_group_name: str, + namespace_name: str, + authorization_rule_name: str, + **kwargs: Any + ) -> "_models.AccessKeys": + """Gets the primary and secondary connection strings for the Namespace. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AccessKeys, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2021_06_01_preview.models.AccessKeys + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessKeys"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.list_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AccessKeys', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}/listKeys'} # type: ignore + + async def regenerate_keys( + self, + resource_group_name: str, + namespace_name: str, + authorization_rule_name: str, + parameters: "_models.RegenerateAccessKeyParameters", + **kwargs: Any + ) -> "_models.AccessKeys": + """Regenerates the primary or secondary connection strings for the specified Namespace. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :param parameters: Parameters required to regenerate the connection string. + :type parameters: ~azure.mgmt.eventhub.v2021_06_01_preview.models.RegenerateAccessKeyParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AccessKeys, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2021_06_01_preview.models.AccessKeys + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessKeys"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.regenerate_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'RegenerateAccessKeyParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AccessKeys', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + regenerate_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}/regenerateKeys'} # type: ignore + + async def check_name_availability( + self, + parameters: "_models.CheckNameAvailabilityParameter", + **kwargs: Any + ) -> "_models.CheckNameAvailabilityResult": + """Check the give Namespace name availability. + + :param parameters: Parameters to check availability of the given Namespace name. + :type parameters: ~azure.mgmt.eventhub.v2021_06_01_preview.models.CheckNameAvailabilityParameter + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CheckNameAvailabilityResult, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2021_06_01_preview.models.CheckNameAvailabilityResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameAvailabilityResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.check_name_availability.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'CheckNameAvailabilityParameter') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CheckNameAvailabilityResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EventHub/checkNameAvailability'} # type: ignore diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/aio/operations/_operations.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/aio/operations/_operations.py new file mode 100644 index 000000000000..b25217f8e540 --- /dev/null +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/aio/operations/_operations.py @@ -0,0 +1,105 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class Operations: + """Operations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.eventhub.v2021_06_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs: Any + ) -> AsyncIterable["_models.OperationListResult"]: + """Lists all of the available Event Hub REST API operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.eventhub.v2021_06_01_preview.models.OperationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('OperationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.EventHub/operations'} # type: ignore diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/aio/operations/_private_endpoint_connections_operations.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/aio/operations/_private_endpoint_connections_operations.py new file mode 100644 index 000000000000..254f850de138 --- /dev/null +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/aio/operations/_private_endpoint_connections_operations.py @@ -0,0 +1,375 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class PrivateEndpointConnectionsOperations: + """PrivateEndpointConnectionsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.eventhub.v2021_06_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + namespace_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.PrivateEndpointConnectionListResult"]: + """Gets the available PrivateEndpointConnections within a namespace. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PrivateEndpointConnectionListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.eventhub.v2021_06_01_preview.models.PrivateEndpointConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('PrivateEndpointConnectionListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/privateEndpointConnections'} # type: ignore + + async def create_or_update( + self, + resource_group_name: str, + namespace_name: str, + private_endpoint_connection_name: str, + parameters: "_models.PrivateEndpointConnection", + **kwargs: Any + ) -> "_models.PrivateEndpointConnection": + """Creates or updates PrivateEndpointConnections of service namespace. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param private_endpoint_connection_name: The PrivateEndpointConnection name. + :type private_endpoint_connection_name: str + :param parameters: Parameters supplied to update Status of PrivateEndPoint Connection to + namespace resource. + :type parameters: ~azure.mgmt.eventhub.v2021_06_01_preview.models.PrivateEndpointConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2021_06_01_preview.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'PrivateEndpointConnection') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + namespace_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + namespace_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes an existing namespace. This operation also removes all associated resources under the + namespace. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param private_endpoint_connection_name: The PrivateEndpointConnection name. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + private_endpoint_connection_name=private_endpoint_connection_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + namespace_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> "_models.PrivateEndpointConnection": + """Gets a description for the specified Private Endpoint Connection name. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param private_endpoint_connection_name: The PrivateEndpointConnection name. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2021_06_01_preview.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/aio/operations/_private_link_resources_operations.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/aio/operations/_private_link_resources_operations.py new file mode 100644 index 000000000000..ad20793fc87f --- /dev/null +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/aio/operations/_private_link_resources_operations.py @@ -0,0 +1,100 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class PrivateLinkResourcesOperations: + """PrivateLinkResourcesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.eventhub.v2021_06_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + resource_group_name: str, + namespace_name: str, + **kwargs: Any + ) -> "_models.PrivateLinkResourcesListResult": + """Gets lists of resources that supports Privatelinks. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkResourcesListResult, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2021_06_01_preview.models.PrivateLinkResourcesListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourcesListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateLinkResourcesListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/privateLinkResources'} # type: ignore diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/models/__init__.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/models/__init__.py new file mode 100644 index 000000000000..0a7089481bd0 --- /dev/null +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/models/__init__.py @@ -0,0 +1,191 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import AccessKeys + from ._models_py3 import ArmDisasterRecovery + from ._models_py3 import ArmDisasterRecoveryListResult + from ._models_py3 import AuthorizationRule + from ._models_py3 import AuthorizationRuleListResult + from ._models_py3 import AvailableCluster + from ._models_py3 import AvailableClustersList + from ._models_py3 import CaptureDescription + from ._models_py3 import CheckNameAvailabilityParameter + from ._models_py3 import CheckNameAvailabilityResult + from ._models_py3 import Cluster + from ._models_py3 import ClusterListResult + from ._models_py3 import ClusterQuotaConfigurationProperties + from ._models_py3 import ClusterSku + from ._models_py3 import ConnectionState + from ._models_py3 import ConsumerGroup + from ._models_py3 import ConsumerGroupListResult + from ._models_py3 import Destination + from ._models_py3 import EHNamespace + from ._models_py3 import EHNamespaceIdContainer + from ._models_py3 import EHNamespaceIdListResult + from ._models_py3 import EHNamespaceListResult + from ._models_py3 import Encryption + from ._models_py3 import ErrorResponse + from ._models_py3 import EventHubListResult + from ._models_py3 import Eventhub + from ._models_py3 import Identity + from ._models_py3 import KeyVaultProperties + from ._models_py3 import NWRuleSetIpRules + from ._models_py3 import NWRuleSetVirtualNetworkRules + from ._models_py3 import NetworkRuleSet + from ._models_py3 import Operation + from ._models_py3 import OperationDisplay + from ._models_py3 import OperationListResult + from ._models_py3 import PrivateEndpoint + from ._models_py3 import PrivateEndpointConnection + from ._models_py3 import PrivateEndpointConnectionListResult + from ._models_py3 import PrivateLinkResource + from ._models_py3 import PrivateLinkResourcesListResult + from ._models_py3 import RegenerateAccessKeyParameters + from ._models_py3 import Resource + from ._models_py3 import Sku + from ._models_py3 import Subnet + from ._models_py3 import SystemData + from ._models_py3 import TrackedResource + from ._models_py3 import UserAssignedIdentity + from ._models_py3 import UserAssignedIdentityProperties +except (SyntaxError, ImportError): + from ._models import AccessKeys # type: ignore + from ._models import ArmDisasterRecovery # type: ignore + from ._models import ArmDisasterRecoveryListResult # type: ignore + from ._models import AuthorizationRule # type: ignore + from ._models import AuthorizationRuleListResult # type: ignore + from ._models import AvailableCluster # type: ignore + from ._models import AvailableClustersList # type: ignore + from ._models import CaptureDescription # type: ignore + from ._models import CheckNameAvailabilityParameter # type: ignore + from ._models import CheckNameAvailabilityResult # type: ignore + from ._models import Cluster # type: ignore + from ._models import ClusterListResult # type: ignore + from ._models import ClusterQuotaConfigurationProperties # type: ignore + from ._models import ClusterSku # type: ignore + from ._models import ConnectionState # type: ignore + from ._models import ConsumerGroup # type: ignore + from ._models import ConsumerGroupListResult # type: ignore + from ._models import Destination # type: ignore + from ._models import EHNamespace # type: ignore + from ._models import EHNamespaceIdContainer # type: ignore + from ._models import EHNamespaceIdListResult # type: ignore + from ._models import EHNamespaceListResult # type: ignore + from ._models import Encryption # type: ignore + from ._models import ErrorResponse # type: ignore + from ._models import EventHubListResult # type: ignore + from ._models import Eventhub # type: ignore + from ._models import Identity # type: ignore + from ._models import KeyVaultProperties # type: ignore + from ._models import NWRuleSetIpRules # type: ignore + from ._models import NWRuleSetVirtualNetworkRules # type: ignore + from ._models import NetworkRuleSet # type: ignore + from ._models import Operation # type: ignore + from ._models import OperationDisplay # type: ignore + from ._models import OperationListResult # type: ignore + from ._models import PrivateEndpoint # type: ignore + from ._models import PrivateEndpointConnection # type: ignore + from ._models import PrivateEndpointConnectionListResult # type: ignore + from ._models import PrivateLinkResource # type: ignore + from ._models import PrivateLinkResourcesListResult # type: ignore + from ._models import RegenerateAccessKeyParameters # type: ignore + from ._models import Resource # type: ignore + from ._models import Sku # type: ignore + from ._models import Subnet # type: ignore + from ._models import SystemData # type: ignore + from ._models import TrackedResource # type: ignore + from ._models import UserAssignedIdentity # type: ignore + from ._models import UserAssignedIdentityProperties # type: ignore + +from ._event_hub_management_client_enums import ( + AccessRights, + ClusterSkuName, + CreatedByType, + DefaultAction, + EncodingCaptureDescription, + EndPointProvisioningState, + EntityStatus, + KeyType, + ManagedServiceIdentityType, + NetworkRuleIPAction, + PrivateLinkConnectionStatus, + ProvisioningStateDR, + PublicNetworkAccessFlag, + RoleDisasterRecovery, + SkuName, + SkuTier, + UnavailableReason, +) + +__all__ = [ + 'AccessKeys', + 'ArmDisasterRecovery', + 'ArmDisasterRecoveryListResult', + 'AuthorizationRule', + 'AuthorizationRuleListResult', + 'AvailableCluster', + 'AvailableClustersList', + 'CaptureDescription', + 'CheckNameAvailabilityParameter', + 'CheckNameAvailabilityResult', + 'Cluster', + 'ClusterListResult', + 'ClusterQuotaConfigurationProperties', + 'ClusterSku', + 'ConnectionState', + 'ConsumerGroup', + 'ConsumerGroupListResult', + 'Destination', + 'EHNamespace', + 'EHNamespaceIdContainer', + 'EHNamespaceIdListResult', + 'EHNamespaceListResult', + 'Encryption', + 'ErrorResponse', + 'EventHubListResult', + 'Eventhub', + 'Identity', + 'KeyVaultProperties', + 'NWRuleSetIpRules', + 'NWRuleSetVirtualNetworkRules', + 'NetworkRuleSet', + 'Operation', + 'OperationDisplay', + 'OperationListResult', + 'PrivateEndpoint', + 'PrivateEndpointConnection', + 'PrivateEndpointConnectionListResult', + 'PrivateLinkResource', + 'PrivateLinkResourcesListResult', + 'RegenerateAccessKeyParameters', + 'Resource', + 'Sku', + 'Subnet', + 'SystemData', + 'TrackedResource', + 'UserAssignedIdentity', + 'UserAssignedIdentityProperties', + 'AccessRights', + 'ClusterSkuName', + 'CreatedByType', + 'DefaultAction', + 'EncodingCaptureDescription', + 'EndPointProvisioningState', + 'EntityStatus', + 'KeyType', + 'ManagedServiceIdentityType', + 'NetworkRuleIPAction', + 'PrivateLinkConnectionStatus', + 'ProvisioningStateDR', + 'PublicNetworkAccessFlag', + 'RoleDisasterRecovery', + 'SkuName', + 'SkuTier', + 'UnavailableReason', +] diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/models/_event_hub_management_client_enums.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/models/_event_hub_management_client_enums.py new file mode 100644 index 000000000000..bdaf61eccdfc --- /dev/null +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/models/_event_hub_management_client_enums.py @@ -0,0 +1,171 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class AccessRights(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + MANAGE = "Manage" + SEND = "Send" + LISTEN = "Listen" + +class ClusterSkuName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Name of this SKU. + """ + + DEDICATED = "Dedicated" + +class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of identity that created the resource. + """ + + USER = "User" + APPLICATION = "Application" + MANAGED_IDENTITY = "ManagedIdentity" + KEY = "Key" + +class DefaultAction(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Default Action for Network Rule Set + """ + + ALLOW = "Allow" + DENY = "Deny" + +class EncodingCaptureDescription(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Enumerates the possible values for the encoding format of capture description. Note: + 'AvroDeflate' will be deprecated in New API Version + """ + + AVRO = "Avro" + AVRO_DEFLATE = "AvroDeflate" + +class EndPointProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Provisioning state of the Private Endpoint Connection. + """ + + CREATING = "Creating" + UPDATING = "Updating" + DELETING = "Deleting" + SUCCEEDED = "Succeeded" + CANCELED = "Canceled" + FAILED = "Failed" + +class EntityStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Enumerates the possible values for the status of the Event Hub. + """ + + ACTIVE = "Active" + DISABLED = "Disabled" + RESTORING = "Restoring" + SEND_DISABLED = "SendDisabled" + RECEIVE_DISABLED = "ReceiveDisabled" + CREATING = "Creating" + DELETING = "Deleting" + RENAMING = "Renaming" + UNKNOWN = "Unknown" + +class KeyType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The access key to regenerate. + """ + + PRIMARY_KEY = "PrimaryKey" + SECONDARY_KEY = "SecondaryKey" + +class ManagedServiceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of managed service identity. + """ + + SYSTEM_ASSIGNED = "SystemAssigned" + USER_ASSIGNED = "UserAssigned" + SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned, UserAssigned" + NONE = "None" + +class NetworkRuleIPAction(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The IP Filter Action + """ + + ALLOW = "Allow" + +class PrivateLinkConnectionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Status of the connection. + """ + + PENDING = "Pending" + APPROVED = "Approved" + REJECTED = "Rejected" + DISCONNECTED = "Disconnected" + +class ProvisioningStateDR(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Provisioning state of the Alias(Disaster Recovery configuration) - possible values 'Accepted' + or 'Succeeded' or 'Failed' + """ + + ACCEPTED = "Accepted" + SUCCEEDED = "Succeeded" + FAILED = "Failed" + +class PublicNetworkAccessFlag(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """This determines if traffic is allowed over public network. By default it is enabled. + """ + + ENABLED = "Enabled" + DISABLED = "Disabled" + +class RoleDisasterRecovery(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """role of namespace in GEO DR - possible values 'Primary' or 'PrimaryNotReplicating' or + 'Secondary' + """ + + PRIMARY = "Primary" + PRIMARY_NOT_REPLICATING = "PrimaryNotReplicating" + SECONDARY = "Secondary" + +class SkuName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Name of this SKU. + """ + + BASIC = "Basic" + STANDARD = "Standard" + PREMIUM = "Premium" + +class SkuTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The billing tier of this particular SKU. + """ + + BASIC = "Basic" + STANDARD = "Standard" + PREMIUM = "Premium" + +class UnavailableReason(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies the reason for the unavailability of the service. + """ + + NONE = "None" + INVALID_NAME = "InvalidName" + SUBSCRIPTION_IS_DISABLED = "SubscriptionIsDisabled" + NAME_IN_USE = "NameInUse" + NAME_IN_LOCKDOWN = "NameInLockdown" + TOO_MANY_NAMESPACE_IN_CURRENT_SUBSCRIPTION = "TooManyNamespaceInCurrentSubscription" diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/models/_models.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/models/_models.py new file mode 100644 index 000000000000..098183c8cdbb --- /dev/null +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/models/_models.py @@ -0,0 +1,1671 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + + +class AccessKeys(msrest.serialization.Model): + """Namespace/EventHub Connection String. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar primary_connection_string: Primary connection string of the created namespace + AuthorizationRule. + :vartype primary_connection_string: str + :ivar secondary_connection_string: Secondary connection string of the created namespace + AuthorizationRule. + :vartype secondary_connection_string: str + :ivar alias_primary_connection_string: Primary connection string of the alias if GEO DR is + enabled. + :vartype alias_primary_connection_string: str + :ivar alias_secondary_connection_string: Secondary connection string of the alias if GEO DR is + enabled. + :vartype alias_secondary_connection_string: str + :ivar primary_key: A base64-encoded 256-bit primary key for signing and validating the SAS + token. + :vartype primary_key: str + :ivar secondary_key: A base64-encoded 256-bit primary key for signing and validating the SAS + token. + :vartype secondary_key: str + :ivar key_name: A string that describes the AuthorizationRule. + :vartype key_name: str + """ + + _validation = { + 'primary_connection_string': {'readonly': True}, + 'secondary_connection_string': {'readonly': True}, + 'alias_primary_connection_string': {'readonly': True}, + 'alias_secondary_connection_string': {'readonly': True}, + 'primary_key': {'readonly': True}, + 'secondary_key': {'readonly': True}, + 'key_name': {'readonly': True}, + } + + _attribute_map = { + 'primary_connection_string': {'key': 'primaryConnectionString', 'type': 'str'}, + 'secondary_connection_string': {'key': 'secondaryConnectionString', 'type': 'str'}, + 'alias_primary_connection_string': {'key': 'aliasPrimaryConnectionString', 'type': 'str'}, + 'alias_secondary_connection_string': {'key': 'aliasSecondaryConnectionString', 'type': 'str'}, + 'primary_key': {'key': 'primaryKey', 'type': 'str'}, + 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AccessKeys, self).__init__(**kwargs) + self.primary_connection_string = None + self.secondary_connection_string = None + self.alias_primary_connection_string = None + self.alias_secondary_connection_string = None + self.primary_key = None + self.secondary_key = None + self.key_name = None + + +class Resource(msrest.serialization.Model): + """The resource definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class ArmDisasterRecovery(Resource): + """Single item in List or Get Alias(Disaster Recovery configuration) operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system meta data relating to this resource. + :vartype system_data: ~azure.mgmt.eventhub.v2021_06_01_preview.models.SystemData + :ivar provisioning_state: Provisioning state of the Alias(Disaster Recovery configuration) - + possible values 'Accepted' or 'Succeeded' or 'Failed'. Possible values include: "Accepted", + "Succeeded", "Failed". + :vartype provisioning_state: str or + ~azure.mgmt.eventhub.v2021_06_01_preview.models.ProvisioningStateDR + :param partner_namespace: ARM Id of the Primary/Secondary eventhub namespace name, which is + part of GEO DR pairing. + :type partner_namespace: str + :param alternate_name: Alternate name specified when alias and namespace names are same. + :type alternate_name: str + :ivar role: role of namespace in GEO DR - possible values 'Primary' or 'PrimaryNotReplicating' + or 'Secondary'. Possible values include: "Primary", "PrimaryNotReplicating", "Secondary". + :vartype role: str or ~azure.mgmt.eventhub.v2021_06_01_preview.models.RoleDisasterRecovery + :ivar pending_replication_operations_count: Number of entities pending to be replicated. + :vartype pending_replication_operations_count: long + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'role': {'readonly': True}, + 'pending_replication_operations_count': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'partner_namespace': {'key': 'properties.partnerNamespace', 'type': 'str'}, + 'alternate_name': {'key': 'properties.alternateName', 'type': 'str'}, + 'role': {'key': 'properties.role', 'type': 'str'}, + 'pending_replication_operations_count': {'key': 'properties.pendingReplicationOperationsCount', 'type': 'long'}, + } + + def __init__( + self, + **kwargs + ): + super(ArmDisasterRecovery, self).__init__(**kwargs) + self.system_data = None + self.provisioning_state = None + self.partner_namespace = kwargs.get('partner_namespace', None) + self.alternate_name = kwargs.get('alternate_name', None) + self.role = None + self.pending_replication_operations_count = None + + +class ArmDisasterRecoveryListResult(msrest.serialization.Model): + """The result of the List Alias(Disaster Recovery configuration) operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: List of Alias(Disaster Recovery configurations). + :type value: list[~azure.mgmt.eventhub.v2021_06_01_preview.models.ArmDisasterRecovery] + :ivar next_link: Link to the next set of results. Not empty if Value contains incomplete list + of Alias(Disaster Recovery configuration). + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ArmDisasterRecovery]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ArmDisasterRecoveryListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class AuthorizationRule(Resource): + """Single item in a List or Get AuthorizationRule operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system meta data relating to this resource. + :vartype system_data: ~azure.mgmt.eventhub.v2021_06_01_preview.models.SystemData + :param rights: The rights associated with the rule. + :type rights: list[str or ~azure.mgmt.eventhub.v2021_06_01_preview.models.AccessRights] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'rights': {'key': 'properties.rights', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(AuthorizationRule, self).__init__(**kwargs) + self.system_data = None + self.rights = kwargs.get('rights', None) + + +class AuthorizationRuleListResult(msrest.serialization.Model): + """The response from the List namespace operation. + + :param value: Result of the List Authorization Rules operation. + :type value: list[~azure.mgmt.eventhub.v2021_06_01_preview.models.AuthorizationRule] + :param next_link: Link to the next set of results. Not empty if Value contains an incomplete + list of Authorization Rules. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AuthorizationRule]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AuthorizationRuleListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class AvailableCluster(msrest.serialization.Model): + """Pre-provisioned and readily available Event Hubs Cluster count per region. + + :param location: Location fo the Available Cluster. + :type location: str + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AvailableCluster, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + + +class AvailableClustersList(msrest.serialization.Model): + """The response of the List Available Clusters operation. + + :param value: The count of readily available and pre-provisioned Event Hubs Clusters per + region. + :type value: list[~azure.mgmt.eventhub.v2021_06_01_preview.models.AvailableCluster] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AvailableCluster]'}, + } + + def __init__( + self, + **kwargs + ): + super(AvailableClustersList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class CaptureDescription(msrest.serialization.Model): + """Properties to configure capture description for eventhub. + + :param enabled: A value that indicates whether capture description is enabled. + :type enabled: bool + :param encoding: Enumerates the possible values for the encoding format of capture description. + Note: 'AvroDeflate' will be deprecated in New API Version. Possible values include: "Avro", + "AvroDeflate". + :type encoding: str or + ~azure.mgmt.eventhub.v2021_06_01_preview.models.EncodingCaptureDescription + :param interval_in_seconds: The time window allows you to set the frequency with which the + capture to Azure Blobs will happen, value should between 60 to 900 seconds. + :type interval_in_seconds: int + :param size_limit_in_bytes: The size window defines the amount of data built up in your Event + Hub before an capture operation, value should be between 10485760 to 524288000 bytes. + :type size_limit_in_bytes: int + :param destination: Properties of Destination where capture will be stored. (Storage Account, + Blob Names). + :type destination: ~azure.mgmt.eventhub.v2021_06_01_preview.models.Destination + :param skip_empty_archives: A value that indicates whether to Skip Empty Archives. + :type skip_empty_archives: bool + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'encoding': {'key': 'encoding', 'type': 'str'}, + 'interval_in_seconds': {'key': 'intervalInSeconds', 'type': 'int'}, + 'size_limit_in_bytes': {'key': 'sizeLimitInBytes', 'type': 'int'}, + 'destination': {'key': 'destination', 'type': 'Destination'}, + 'skip_empty_archives': {'key': 'skipEmptyArchives', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(CaptureDescription, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.encoding = kwargs.get('encoding', None) + self.interval_in_seconds = kwargs.get('interval_in_seconds', None) + self.size_limit_in_bytes = kwargs.get('size_limit_in_bytes', None) + self.destination = kwargs.get('destination', None) + self.skip_empty_archives = kwargs.get('skip_empty_archives', None) + + +class CheckNameAvailabilityParameter(msrest.serialization.Model): + """Parameter supplied to check Namespace name availability operation. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Name to check the namespace name availability. + :type name: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CheckNameAvailabilityParameter, self).__init__(**kwargs) + self.name = kwargs['name'] + + +class CheckNameAvailabilityResult(msrest.serialization.Model): + """The Result of the CheckNameAvailability operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar message: The detailed info regarding the reason associated with the Namespace. + :vartype message: str + :param name_available: Value indicating Namespace is availability, true if the Namespace is + available; otherwise, false. + :type name_available: bool + :param reason: The reason for unavailability of a Namespace. Possible values include: "None", + "InvalidName", "SubscriptionIsDisabled", "NameInUse", "NameInLockdown", + "TooManyNamespaceInCurrentSubscription". + :type reason: str or ~azure.mgmt.eventhub.v2021_06_01_preview.models.UnavailableReason + """ + + _validation = { + 'message': {'readonly': True}, + } + + _attribute_map = { + 'message': {'key': 'message', 'type': 'str'}, + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.message = None + self.name_available = kwargs.get('name_available', None) + self.reason = kwargs.get('reason', None) + + +class TrackedResource(Resource): + """Definition of resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(TrackedResource, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + + +class Cluster(TrackedResource): + """Single Event Hubs Cluster resource in List or Get operations. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param sku: Properties of the cluster SKU. + :type sku: ~azure.mgmt.eventhub.v2021_06_01_preview.models.ClusterSku + :ivar system_data: The system meta data relating to this resource. + :vartype system_data: ~azure.mgmt.eventhub.v2021_06_01_preview.models.SystemData + :ivar created_at: The UTC time when the Event Hubs Cluster was created. + :vartype created_at: str + :ivar updated_at: The UTC time when the Event Hubs Cluster was last updated. + :vartype updated_at: str + :ivar metric_id: The metric ID of the cluster resource. Provided by the service and not + modifiable by the user. + :vartype metric_id: str + :ivar status: Status of the Cluster resource. + :vartype status: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'created_at': {'readonly': True}, + 'updated_at': {'readonly': True}, + 'metric_id': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'ClusterSku'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'str'}, + 'updated_at': {'key': 'properties.updatedAt', 'type': 'str'}, + 'metric_id': {'key': 'properties.metricId', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Cluster, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.system_data = None + self.created_at = None + self.updated_at = None + self.metric_id = None + self.status = None + + +class ClusterListResult(msrest.serialization.Model): + """The response of the List Event Hubs Clusters operation. + + :param value: The Event Hubs Clusters present in the List Event Hubs operation results. + :type value: list[~azure.mgmt.eventhub.v2021_06_01_preview.models.Cluster] + :param next_link: Link to the next set of results. Empty unless the value parameter contains an + incomplete list of Event Hubs Clusters. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Cluster]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ClusterListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class ClusterQuotaConfigurationProperties(msrest.serialization.Model): + """Contains all settings for the cluster. + + :param settings: All possible Cluster settings - a collection of key/value paired settings + which apply to quotas and configurations imposed on the cluster. + :type settings: dict[str, str] + """ + + _attribute_map = { + 'settings': {'key': 'settings', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(ClusterQuotaConfigurationProperties, self).__init__(**kwargs) + self.settings = kwargs.get('settings', None) + + +class ClusterSku(msrest.serialization.Model): + """SKU parameters particular to a cluster instance. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Name of this SKU. Possible values include: "Dedicated". + :type name: str or ~azure.mgmt.eventhub.v2021_06_01_preview.models.ClusterSkuName + :param capacity: The quantity of Event Hubs Cluster Capacity Units contained in this cluster. + :type capacity: int + """ + + _validation = { + 'name': {'required': True}, + 'capacity': {'minimum': 1}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(ClusterSku, self).__init__(**kwargs) + self.name = kwargs['name'] + self.capacity = kwargs.get('capacity', None) + + +class ConnectionState(msrest.serialization.Model): + """ConnectionState information. + + :param status: Status of the connection. Possible values include: "Pending", "Approved", + "Rejected", "Disconnected". + :type status: str or + ~azure.mgmt.eventhub.v2021_06_01_preview.models.PrivateLinkConnectionStatus + :param description: Description of the connection state. + :type description: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ConnectionState, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.description = kwargs.get('description', None) + + +class ConsumerGroup(Resource): + """Single item in List or Get Consumer group operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system meta data relating to this resource. + :vartype system_data: ~azure.mgmt.eventhub.v2021_06_01_preview.models.SystemData + :ivar created_at: Exact time the message was created. + :vartype created_at: ~datetime.datetime + :ivar updated_at: The exact time the message was updated. + :vartype updated_at: ~datetime.datetime + :param user_metadata: User Metadata is a placeholder to store user-defined string data with + maximum length 1024. e.g. it can be used to store descriptive data, such as list of teams and + their contact information also user-defined configuration settings can be stored. + :type user_metadata: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'created_at': {'readonly': True}, + 'updated_at': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + 'updated_at': {'key': 'properties.updatedAt', 'type': 'iso-8601'}, + 'user_metadata': {'key': 'properties.userMetadata', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ConsumerGroup, self).__init__(**kwargs) + self.system_data = None + self.created_at = None + self.updated_at = None + self.user_metadata = kwargs.get('user_metadata', None) + + +class ConsumerGroupListResult(msrest.serialization.Model): + """The result to the List Consumer Group operation. + + :param value: Result of the List Consumer Group operation. + :type value: list[~azure.mgmt.eventhub.v2021_06_01_preview.models.ConsumerGroup] + :param next_link: Link to the next set of results. Not empty if Value contains incomplete list + of Consumer Group. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ConsumerGroup]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ConsumerGroupListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class Destination(msrest.serialization.Model): + """Capture storage details for capture description. + + :param name: Name for capture destination. + :type name: str + :param storage_account_resource_id: Resource id of the storage account to be used to create the + blobs. + :type storage_account_resource_id: str + :param blob_container: Blob container Name. + :type blob_container: str + :param archive_name_format: Blob naming convention for archive, e.g. + {Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}. Here all + the parameters (Namespace,EventHub .. etc) are mandatory irrespective of order. + :type archive_name_format: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'storage_account_resource_id': {'key': 'properties.storageAccountResourceId', 'type': 'str'}, + 'blob_container': {'key': 'properties.blobContainer', 'type': 'str'}, + 'archive_name_format': {'key': 'properties.archiveNameFormat', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Destination, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.storage_account_resource_id = kwargs.get('storage_account_resource_id', None) + self.blob_container = kwargs.get('blob_container', None) + self.archive_name_format = kwargs.get('archive_name_format', None) + + +class EHNamespace(TrackedResource): + """Single Namespace item in List or Get Operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param sku: Properties of sku resource. + :type sku: ~azure.mgmt.eventhub.v2021_06_01_preview.models.Sku + :param identity: Properties of BYOK Identity description. + :type identity: ~azure.mgmt.eventhub.v2021_06_01_preview.models.Identity + :ivar system_data: The system meta data relating to this resource. + :vartype system_data: ~azure.mgmt.eventhub.v2021_06_01_preview.models.SystemData + :ivar provisioning_state: Provisioning state of the Namespace. + :vartype provisioning_state: str + :ivar status: Status of the Namespace. + :vartype status: str + :ivar created_at: The time the Namespace was created. + :vartype created_at: ~datetime.datetime + :ivar updated_at: The time the Namespace was updated. + :vartype updated_at: ~datetime.datetime + :ivar service_bus_endpoint: Endpoint you can use to perform Service Bus operations. + :vartype service_bus_endpoint: str + :param cluster_arm_id: Cluster ARM ID of the Namespace. + :type cluster_arm_id: str + :ivar metric_id: Identifier for Azure Insights metrics. + :vartype metric_id: str + :param is_auto_inflate_enabled: Value that indicates whether AutoInflate is enabled for + eventhub namespace. + :type is_auto_inflate_enabled: bool + :param maximum_throughput_units: Upper limit of throughput units when AutoInflate is enabled, + value should be within 0 to 20 throughput units. ( '0' if AutoInflateEnabled = true). + :type maximum_throughput_units: int + :param kafka_enabled: Value that indicates whether Kafka is enabled for eventhub namespace. + :type kafka_enabled: bool + :param zone_redundant: Enabling this property creates a Standard Event Hubs Namespace in + regions supported availability zones. + :type zone_redundant: bool + :param encryption: Properties of BYOK Encryption description. + :type encryption: ~azure.mgmt.eventhub.v2021_06_01_preview.models.Encryption + :param private_endpoint_connections: List of private endpoint connections. + :type private_endpoint_connections: + list[~azure.mgmt.eventhub.v2021_06_01_preview.models.PrivateEndpointConnection] + :param disable_local_auth: This property disables SAS authentication for the Event Hubs + namespace. + :type disable_local_auth: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + 'created_at': {'readonly': True}, + 'updated_at': {'readonly': True}, + 'service_bus_endpoint': {'readonly': True}, + 'metric_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + 'updated_at': {'key': 'properties.updatedAt', 'type': 'iso-8601'}, + 'service_bus_endpoint': {'key': 'properties.serviceBusEndpoint', 'type': 'str'}, + 'cluster_arm_id': {'key': 'properties.clusterArmId', 'type': 'str'}, + 'metric_id': {'key': 'properties.metricId', 'type': 'str'}, + 'is_auto_inflate_enabled': {'key': 'properties.isAutoInflateEnabled', 'type': 'bool'}, + 'maximum_throughput_units': {'key': 'properties.maximumThroughputUnits', 'type': 'int'}, + 'kafka_enabled': {'key': 'properties.kafkaEnabled', 'type': 'bool'}, + 'zone_redundant': {'key': 'properties.zoneRedundant', 'type': 'bool'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, + 'disable_local_auth': {'key': 'properties.disableLocalAuth', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(EHNamespace, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.identity = kwargs.get('identity', None) + self.system_data = None + self.provisioning_state = None + self.status = None + self.created_at = None + self.updated_at = None + self.service_bus_endpoint = None + self.cluster_arm_id = kwargs.get('cluster_arm_id', None) + self.metric_id = None + self.is_auto_inflate_enabled = kwargs.get('is_auto_inflate_enabled', None) + self.maximum_throughput_units = kwargs.get('maximum_throughput_units', None) + self.kafka_enabled = kwargs.get('kafka_enabled', None) + self.zone_redundant = kwargs.get('zone_redundant', None) + self.encryption = kwargs.get('encryption', None) + self.private_endpoint_connections = kwargs.get('private_endpoint_connections', None) + self.disable_local_auth = kwargs.get('disable_local_auth', None) + + +class EHNamespaceIdContainer(msrest.serialization.Model): + """The full ARM ID of an Event Hubs Namespace. + + :param id: id parameter. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EHNamespaceIdContainer, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + +class EHNamespaceIdListResult(msrest.serialization.Model): + """The response of the List Namespace IDs operation. + + :param value: Result of the List Namespace IDs operation. + :type value: list[~azure.mgmt.eventhub.v2021_06_01_preview.models.EHNamespaceIdContainer] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[EHNamespaceIdContainer]'}, + } + + def __init__( + self, + **kwargs + ): + super(EHNamespaceIdListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class EHNamespaceListResult(msrest.serialization.Model): + """The response of the List Namespace operation. + + :param value: Result of the List Namespace operation. + :type value: list[~azure.mgmt.eventhub.v2021_06_01_preview.models.EHNamespace] + :param next_link: Link to the next set of results. Not empty if Value contains incomplete list + of namespaces. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[EHNamespace]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EHNamespaceListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class Encryption(msrest.serialization.Model): + """Properties to configure Encryption. + + :param key_vault_properties: Properties of KeyVault. + :type key_vault_properties: + list[~azure.mgmt.eventhub.v2021_06_01_preview.models.KeyVaultProperties] + :param key_source: Enumerates the possible value of keySource for Encryption. The only + acceptable values to pass in are None and "Microsoft.KeyVault". The default value is + "Microsoft.KeyVault". + :type key_source: str + :param require_infrastructure_encryption: Enable Infrastructure Encryption (Double Encryption). + :type require_infrastructure_encryption: bool + """ + + _attribute_map = { + 'key_vault_properties': {'key': 'keyVaultProperties', 'type': '[KeyVaultProperties]'}, + 'key_source': {'key': 'keySource', 'type': 'str'}, + 'require_infrastructure_encryption': {'key': 'requireInfrastructureEncryption', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(Encryption, self).__init__(**kwargs) + self.key_vault_properties = kwargs.get('key_vault_properties', None) + self.key_source = kwargs.get('key_source', "Microsoft.KeyVault") + self.require_infrastructure_encryption = kwargs.get('require_infrastructure_encryption', None) + + +class ErrorResponse(msrest.serialization.Model): + """Error response indicates Event Hub service is not able to process the incoming request. The reason is provided in the error message. + + :param code: Error code. + :type code: str + :param message: Error message indicating why the operation failed. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + + +class Eventhub(Resource): + """Single item in List or Get Event Hub operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system meta data relating to this resource. + :vartype system_data: ~azure.mgmt.eventhub.v2021_06_01_preview.models.SystemData + :ivar partition_ids: Current number of shards on the Event Hub. + :vartype partition_ids: list[str] + :ivar created_at: Exact time the Event Hub was created. + :vartype created_at: ~datetime.datetime + :ivar updated_at: The exact time the message was updated. + :vartype updated_at: ~datetime.datetime + :param message_retention_in_days: Number of days to retain the events for this Event Hub, value + should be 1 to 7 days. + :type message_retention_in_days: long + :param partition_count: Number of partitions created for the Event Hub, allowed values are from + 1 to 32 partitions. + :type partition_count: long + :param status: Enumerates the possible values for the status of the Event Hub. Possible values + include: "Active", "Disabled", "Restoring", "SendDisabled", "ReceiveDisabled", "Creating", + "Deleting", "Renaming", "Unknown". + :type status: str or ~azure.mgmt.eventhub.v2021_06_01_preview.models.EntityStatus + :param capture_description: Properties of capture description. + :type capture_description: ~azure.mgmt.eventhub.v2021_06_01_preview.models.CaptureDescription + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'partition_ids': {'readonly': True}, + 'created_at': {'readonly': True}, + 'updated_at': {'readonly': True}, + 'message_retention_in_days': {'minimum': 1}, + 'partition_count': {'minimum': 1}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'partition_ids': {'key': 'properties.partitionIds', 'type': '[str]'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + 'updated_at': {'key': 'properties.updatedAt', 'type': 'iso-8601'}, + 'message_retention_in_days': {'key': 'properties.messageRetentionInDays', 'type': 'long'}, + 'partition_count': {'key': 'properties.partitionCount', 'type': 'long'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'capture_description': {'key': 'properties.captureDescription', 'type': 'CaptureDescription'}, + } + + def __init__( + self, + **kwargs + ): + super(Eventhub, self).__init__(**kwargs) + self.system_data = None + self.partition_ids = None + self.created_at = None + self.updated_at = None + self.message_retention_in_days = kwargs.get('message_retention_in_days', None) + self.partition_count = kwargs.get('partition_count', None) + self.status = kwargs.get('status', None) + self.capture_description = kwargs.get('capture_description', None) + + +class EventHubListResult(msrest.serialization.Model): + """The result of the List EventHubs operation. + + :param value: Result of the List EventHubs operation. + :type value: list[~azure.mgmt.eventhub.v2021_06_01_preview.models.Eventhub] + :param next_link: Link to the next set of results. Not empty if Value contains incomplete list + of EventHubs. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Eventhub]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EventHubListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class Identity(msrest.serialization.Model): + """Properties to configure Identity for Bring your Own Keys. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: ObjectId from the KeyVault. + :vartype principal_id: str + :ivar tenant_id: TenantId from the KeyVault. + :vartype tenant_id: str + :param type: Type of managed service identity. Possible values include: "SystemAssigned", + "UserAssigned", "SystemAssigned, UserAssigned", "None". + :type type: str or ~azure.mgmt.eventhub.v2021_06_01_preview.models.ManagedServiceIdentityType + :param user_assigned_identities: Properties for User Assigned Identities. + :type user_assigned_identities: dict[str, + ~azure.mgmt.eventhub.v2021_06_01_preview.models.UserAssignedIdentity] + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, + } + + def __init__( + self, + **kwargs + ): + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = kwargs.get('type', None) + self.user_assigned_identities = kwargs.get('user_assigned_identities', None) + + +class KeyVaultProperties(msrest.serialization.Model): + """Properties to configure keyVault Properties. + + :param key_name: Name of the Key from KeyVault. + :type key_name: str + :param key_vault_uri: Uri of KeyVault. + :type key_vault_uri: str + :param key_version: Key Version. + :type key_version: str + :param identity: + :type identity: ~azure.mgmt.eventhub.v2021_06_01_preview.models.UserAssignedIdentityProperties + """ + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'key_vault_uri': {'key': 'keyVaultUri', 'type': 'str'}, + 'key_version': {'key': 'keyVersion', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'UserAssignedIdentityProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(KeyVaultProperties, self).__init__(**kwargs) + self.key_name = kwargs.get('key_name', None) + self.key_vault_uri = kwargs.get('key_vault_uri', None) + self.key_version = kwargs.get('key_version', None) + self.identity = kwargs.get('identity', None) + + +class NetworkRuleSet(Resource): + """Description of topic resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system meta data relating to this resource. + :vartype system_data: ~azure.mgmt.eventhub.v2021_06_01_preview.models.SystemData + :param trusted_service_access_enabled: Value that indicates whether Trusted Service Access is + Enabled or not. + :type trusted_service_access_enabled: bool + :param default_action: Default Action for Network Rule Set. Possible values include: "Allow", + "Deny". + :type default_action: str or ~azure.mgmt.eventhub.v2021_06_01_preview.models.DefaultAction + :param virtual_network_rules: List VirtualNetwork Rules. + :type virtual_network_rules: + list[~azure.mgmt.eventhub.v2021_06_01_preview.models.NWRuleSetVirtualNetworkRules] + :param ip_rules: List of IpRules. + :type ip_rules: list[~azure.mgmt.eventhub.v2021_06_01_preview.models.NWRuleSetIpRules] + :param public_network_access: This determines if traffic is allowed over public network. By + default it is enabled. Possible values include: "Enabled", "Disabled". Default value: + "Enabled". + :type public_network_access: str or + ~azure.mgmt.eventhub.v2021_06_01_preview.models.PublicNetworkAccessFlag + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'trusted_service_access_enabled': {'key': 'properties.trustedServiceAccessEnabled', 'type': 'bool'}, + 'default_action': {'key': 'properties.defaultAction', 'type': 'str'}, + 'virtual_network_rules': {'key': 'properties.virtualNetworkRules', 'type': '[NWRuleSetVirtualNetworkRules]'}, + 'ip_rules': {'key': 'properties.ipRules', 'type': '[NWRuleSetIpRules]'}, + 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkRuleSet, self).__init__(**kwargs) + self.system_data = None + self.trusted_service_access_enabled = kwargs.get('trusted_service_access_enabled', None) + self.default_action = kwargs.get('default_action', None) + self.virtual_network_rules = kwargs.get('virtual_network_rules', None) + self.ip_rules = kwargs.get('ip_rules', None) + self.public_network_access = kwargs.get('public_network_access', "Enabled") + + +class NWRuleSetIpRules(msrest.serialization.Model): + """The response from the List namespace operation. + + :param ip_mask: IP Mask. + :type ip_mask: str + :param action: The IP Filter Action. Possible values include: "Allow". + :type action: str or ~azure.mgmt.eventhub.v2021_06_01_preview.models.NetworkRuleIPAction + """ + + _attribute_map = { + 'ip_mask': {'key': 'ipMask', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NWRuleSetIpRules, self).__init__(**kwargs) + self.ip_mask = kwargs.get('ip_mask', None) + self.action = kwargs.get('action', None) + + +class NWRuleSetVirtualNetworkRules(msrest.serialization.Model): + """The response from the List namespace operation. + + :param subnet: Subnet properties. + :type subnet: ~azure.mgmt.eventhub.v2021_06_01_preview.models.Subnet + :param ignore_missing_vnet_service_endpoint: Value that indicates whether to ignore missing + Vnet Service Endpoint. + :type ignore_missing_vnet_service_endpoint: bool + """ + + _attribute_map = { + 'subnet': {'key': 'subnet', 'type': 'Subnet'}, + 'ignore_missing_vnet_service_endpoint': {'key': 'ignoreMissingVnetServiceEndpoint', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(NWRuleSetVirtualNetworkRules, self).__init__(**kwargs) + self.subnet = kwargs.get('subnet', None) + self.ignore_missing_vnet_service_endpoint = kwargs.get('ignore_missing_vnet_service_endpoint', None) + + +class Operation(msrest.serialization.Model): + """A Event Hub REST API operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Operation name: {provider}/{resource}/{operation}. + :vartype name: str + :param display: The object that represents the operation. + :type display: ~azure.mgmt.eventhub.v2021_06_01_preview.models.OperationDisplay + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__( + self, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.name = None + self.display = kwargs.get('display', None) + + +class OperationDisplay(msrest.serialization.Model): + """The object that represents the operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provider: Service provider: Microsoft.EventHub. + :vartype provider: str + :ivar resource: Resource on which the operation is performed: Invoice, etc. + :vartype resource: str + :ivar operation: Operation type: Read, write, delete, etc. + :vartype operation: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None + + +class OperationListResult(msrest.serialization.Model): + """Result of the request to list Event Hub operations. It contains a list of operations and a URL link to get the next set of results. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of Event Hub operations supported by the Microsoft.EventHub resource + provider. + :vartype value: list[~azure.mgmt.eventhub.v2021_06_01_preview.models.Operation] + :ivar next_link: URL to get the next set of operation list results if there are any. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class PrivateEndpoint(msrest.serialization.Model): + """PrivateEndpoint information. + + :param id: The ARM identifier for Private Endpoint. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpoint, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + +class PrivateEndpointConnection(Resource): + """Properties of the PrivateEndpointConnection. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system meta data relating to this resource. + :vartype system_data: ~azure.mgmt.eventhub.v2021_06_01_preview.models.SystemData + :param private_endpoint: The Private Endpoint resource for this Connection. + :type private_endpoint: ~azure.mgmt.eventhub.v2021_06_01_preview.models.PrivateEndpoint + :param private_link_service_connection_state: Details about the state of the connection. + :type private_link_service_connection_state: + ~azure.mgmt.eventhub.v2021_06_01_preview.models.ConnectionState + :param provisioning_state: Provisioning state of the Private Endpoint Connection. Possible + values include: "Creating", "Updating", "Deleting", "Succeeded", "Canceled", "Failed". + :type provisioning_state: str or + ~azure.mgmt.eventhub.v2021_06_01_preview.models.EndPointProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'ConnectionState'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.system_data = None + self.private_endpoint = kwargs.get('private_endpoint', None) + self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + + +class PrivateEndpointConnectionListResult(msrest.serialization.Model): + """Result of the list of all private endpoint connections operation. + + :param value: A collection of private endpoint connection resources. + :type value: list[~azure.mgmt.eventhub.v2021_06_01_preview.models.PrivateEndpointConnection] + :param next_link: A link for the next page of private endpoint connection resources. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class PrivateLinkResource(msrest.serialization.Model): + """Information of the private link resource. + + :param id: Fully qualified identifier of the resource. + :type id: str + :param name: Name of the resource. + :type name: str + :param type: Type of the resource. + :type type: str + :param group_id: The private link resource group id. + :type group_id: str + :param required_members: The private link resource required member names. + :type required_members: list[str] + :param required_zone_names: The private link resource Private link DNS zone name. + :type required_zone_names: list[str] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'group_id': {'key': 'properties.groupId', 'type': 'str'}, + 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, + 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkResource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + self.group_id = kwargs.get('group_id', None) + self.required_members = kwargs.get('required_members', None) + self.required_zone_names = kwargs.get('required_zone_names', None) + + +class PrivateLinkResourcesListResult(msrest.serialization.Model): + """Result of the List private link resources operation. + + :param value: A collection of private link resources. + :type value: list[~azure.mgmt.eventhub.v2021_06_01_preview.models.PrivateLinkResource] + :param next_link: A link for the next page of private link resources. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkResourcesListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class RegenerateAccessKeyParameters(msrest.serialization.Model): + """Parameters supplied to the Regenerate Authorization Rule operation, specifies which key needs to be reset. + + All required parameters must be populated in order to send to Azure. + + :param key_type: Required. The access key to regenerate. Possible values include: "PrimaryKey", + "SecondaryKey". + :type key_type: str or ~azure.mgmt.eventhub.v2021_06_01_preview.models.KeyType + :param key: Optional, if the key value provided, is set for KeyType or autogenerated Key value + set for keyType. + :type key: str + """ + + _validation = { + 'key_type': {'required': True}, + } + + _attribute_map = { + 'key_type': {'key': 'keyType', 'type': 'str'}, + 'key': {'key': 'key', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RegenerateAccessKeyParameters, self).__init__(**kwargs) + self.key_type = kwargs['key_type'] + self.key = kwargs.get('key', None) + + +class Sku(msrest.serialization.Model): + """SKU parameters supplied to the create namespace operation. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Name of this SKU. Possible values include: "Basic", "Standard", + "Premium". + :type name: str or ~azure.mgmt.eventhub.v2021_06_01_preview.models.SkuName + :param tier: The billing tier of this particular SKU. Possible values include: "Basic", + "Standard", "Premium". + :type tier: str or ~azure.mgmt.eventhub.v2021_06_01_preview.models.SkuTier + :param capacity: The Event Hubs throughput units for Basic or Standard tiers, where value + should be 0 to 20 throughput units. The Event Hubs premium units for Premium tier, where value + should be 0 to 10 premium units. + :type capacity: int + """ + + _validation = { + 'name': {'required': True}, + 'capacity': {'minimum': 0}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(Sku, self).__init__(**kwargs) + self.name = kwargs['name'] + self.tier = kwargs.get('tier', None) + self.capacity = kwargs.get('capacity', None) + + +class Subnet(msrest.serialization.Model): + """Properties supplied for Subnet. + + :param id: Resource ID of Virtual Network Subnet. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Subnet, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or ~azure.mgmt.eventhub.v2021_06_01_preview.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or + ~azure.mgmt.eventhub.v2021_06_01_preview.models.CreatedByType + :param last_modified_at: The type of identity that last modified the resource. + :type last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(SystemData, self).__init__(**kwargs) + self.created_by = kwargs.get('created_by', None) + self.created_by_type = kwargs.get('created_by_type', None) + self.created_at = kwargs.get('created_at', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.last_modified_by_type = kwargs.get('last_modified_by_type', None) + self.last_modified_at = kwargs.get('last_modified_at', None) + + +class UserAssignedIdentity(msrest.serialization.Model): + """Recognized Dictionary value. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: Principal Id of user assigned identity. + :vartype principal_id: str + :ivar client_id: Client Id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UserAssignedIdentity, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + +class UserAssignedIdentityProperties(msrest.serialization.Model): + """UserAssignedIdentityProperties. + + :param user_assigned_identity: ARM ID of user Identity selected for encryption. + :type user_assigned_identity: str + """ + + _attribute_map = { + 'user_assigned_identity': {'key': 'userAssignedIdentity', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UserAssignedIdentityProperties, self).__init__(**kwargs) + self.user_assigned_identity = kwargs.get('user_assigned_identity', None) diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/models/_models_py3.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/models/_models_py3.py new file mode 100644 index 000000000000..d43fd908426a --- /dev/null +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/models/_models_py3.py @@ -0,0 +1,1824 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +import datetime +from typing import Dict, List, Optional, Union + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + +from ._event_hub_management_client_enums import * + + +class AccessKeys(msrest.serialization.Model): + """Namespace/EventHub Connection String. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar primary_connection_string: Primary connection string of the created namespace + AuthorizationRule. + :vartype primary_connection_string: str + :ivar secondary_connection_string: Secondary connection string of the created namespace + AuthorizationRule. + :vartype secondary_connection_string: str + :ivar alias_primary_connection_string: Primary connection string of the alias if GEO DR is + enabled. + :vartype alias_primary_connection_string: str + :ivar alias_secondary_connection_string: Secondary connection string of the alias if GEO DR is + enabled. + :vartype alias_secondary_connection_string: str + :ivar primary_key: A base64-encoded 256-bit primary key for signing and validating the SAS + token. + :vartype primary_key: str + :ivar secondary_key: A base64-encoded 256-bit primary key for signing and validating the SAS + token. + :vartype secondary_key: str + :ivar key_name: A string that describes the AuthorizationRule. + :vartype key_name: str + """ + + _validation = { + 'primary_connection_string': {'readonly': True}, + 'secondary_connection_string': {'readonly': True}, + 'alias_primary_connection_string': {'readonly': True}, + 'alias_secondary_connection_string': {'readonly': True}, + 'primary_key': {'readonly': True}, + 'secondary_key': {'readonly': True}, + 'key_name': {'readonly': True}, + } + + _attribute_map = { + 'primary_connection_string': {'key': 'primaryConnectionString', 'type': 'str'}, + 'secondary_connection_string': {'key': 'secondaryConnectionString', 'type': 'str'}, + 'alias_primary_connection_string': {'key': 'aliasPrimaryConnectionString', 'type': 'str'}, + 'alias_secondary_connection_string': {'key': 'aliasSecondaryConnectionString', 'type': 'str'}, + 'primary_key': {'key': 'primaryKey', 'type': 'str'}, + 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AccessKeys, self).__init__(**kwargs) + self.primary_connection_string = None + self.secondary_connection_string = None + self.alias_primary_connection_string = None + self.alias_secondary_connection_string = None + self.primary_key = None + self.secondary_key = None + self.key_name = None + + +class Resource(msrest.serialization.Model): + """The resource definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class ArmDisasterRecovery(Resource): + """Single item in List or Get Alias(Disaster Recovery configuration) operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system meta data relating to this resource. + :vartype system_data: ~azure.mgmt.eventhub.v2021_06_01_preview.models.SystemData + :ivar provisioning_state: Provisioning state of the Alias(Disaster Recovery configuration) - + possible values 'Accepted' or 'Succeeded' or 'Failed'. Possible values include: "Accepted", + "Succeeded", "Failed". + :vartype provisioning_state: str or + ~azure.mgmt.eventhub.v2021_06_01_preview.models.ProvisioningStateDR + :param partner_namespace: ARM Id of the Primary/Secondary eventhub namespace name, which is + part of GEO DR pairing. + :type partner_namespace: str + :param alternate_name: Alternate name specified when alias and namespace names are same. + :type alternate_name: str + :ivar role: role of namespace in GEO DR - possible values 'Primary' or 'PrimaryNotReplicating' + or 'Secondary'. Possible values include: "Primary", "PrimaryNotReplicating", "Secondary". + :vartype role: str or ~azure.mgmt.eventhub.v2021_06_01_preview.models.RoleDisasterRecovery + :ivar pending_replication_operations_count: Number of entities pending to be replicated. + :vartype pending_replication_operations_count: long + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'role': {'readonly': True}, + 'pending_replication_operations_count': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'partner_namespace': {'key': 'properties.partnerNamespace', 'type': 'str'}, + 'alternate_name': {'key': 'properties.alternateName', 'type': 'str'}, + 'role': {'key': 'properties.role', 'type': 'str'}, + 'pending_replication_operations_count': {'key': 'properties.pendingReplicationOperationsCount', 'type': 'long'}, + } + + def __init__( + self, + *, + partner_namespace: Optional[str] = None, + alternate_name: Optional[str] = None, + **kwargs + ): + super(ArmDisasterRecovery, self).__init__(**kwargs) + self.system_data = None + self.provisioning_state = None + self.partner_namespace = partner_namespace + self.alternate_name = alternate_name + self.role = None + self.pending_replication_operations_count = None + + +class ArmDisasterRecoveryListResult(msrest.serialization.Model): + """The result of the List Alias(Disaster Recovery configuration) operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param value: List of Alias(Disaster Recovery configurations). + :type value: list[~azure.mgmt.eventhub.v2021_06_01_preview.models.ArmDisasterRecovery] + :ivar next_link: Link to the next set of results. Not empty if Value contains incomplete list + of Alias(Disaster Recovery configuration). + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ArmDisasterRecovery]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["ArmDisasterRecovery"]] = None, + **kwargs + ): + super(ArmDisasterRecoveryListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class AuthorizationRule(Resource): + """Single item in a List or Get AuthorizationRule operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system meta data relating to this resource. + :vartype system_data: ~azure.mgmt.eventhub.v2021_06_01_preview.models.SystemData + :param rights: The rights associated with the rule. + :type rights: list[str or ~azure.mgmt.eventhub.v2021_06_01_preview.models.AccessRights] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'rights': {'key': 'properties.rights', 'type': '[str]'}, + } + + def __init__( + self, + *, + rights: Optional[List[Union[str, "AccessRights"]]] = None, + **kwargs + ): + super(AuthorizationRule, self).__init__(**kwargs) + self.system_data = None + self.rights = rights + + +class AuthorizationRuleListResult(msrest.serialization.Model): + """The response from the List namespace operation. + + :param value: Result of the List Authorization Rules operation. + :type value: list[~azure.mgmt.eventhub.v2021_06_01_preview.models.AuthorizationRule] + :param next_link: Link to the next set of results. Not empty if Value contains an incomplete + list of Authorization Rules. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AuthorizationRule]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["AuthorizationRule"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(AuthorizationRuleListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class AvailableCluster(msrest.serialization.Model): + """Pre-provisioned and readily available Event Hubs Cluster count per region. + + :param location: Location fo the Available Cluster. + :type location: str + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + **kwargs + ): + super(AvailableCluster, self).__init__(**kwargs) + self.location = location + + +class AvailableClustersList(msrest.serialization.Model): + """The response of the List Available Clusters operation. + + :param value: The count of readily available and pre-provisioned Event Hubs Clusters per + region. + :type value: list[~azure.mgmt.eventhub.v2021_06_01_preview.models.AvailableCluster] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AvailableCluster]'}, + } + + def __init__( + self, + *, + value: Optional[List["AvailableCluster"]] = None, + **kwargs + ): + super(AvailableClustersList, self).__init__(**kwargs) + self.value = value + + +class CaptureDescription(msrest.serialization.Model): + """Properties to configure capture description for eventhub. + + :param enabled: A value that indicates whether capture description is enabled. + :type enabled: bool + :param encoding: Enumerates the possible values for the encoding format of capture description. + Note: 'AvroDeflate' will be deprecated in New API Version. Possible values include: "Avro", + "AvroDeflate". + :type encoding: str or + ~azure.mgmt.eventhub.v2021_06_01_preview.models.EncodingCaptureDescription + :param interval_in_seconds: The time window allows you to set the frequency with which the + capture to Azure Blobs will happen, value should between 60 to 900 seconds. + :type interval_in_seconds: int + :param size_limit_in_bytes: The size window defines the amount of data built up in your Event + Hub before an capture operation, value should be between 10485760 to 524288000 bytes. + :type size_limit_in_bytes: int + :param destination: Properties of Destination where capture will be stored. (Storage Account, + Blob Names). + :type destination: ~azure.mgmt.eventhub.v2021_06_01_preview.models.Destination + :param skip_empty_archives: A value that indicates whether to Skip Empty Archives. + :type skip_empty_archives: bool + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'encoding': {'key': 'encoding', 'type': 'str'}, + 'interval_in_seconds': {'key': 'intervalInSeconds', 'type': 'int'}, + 'size_limit_in_bytes': {'key': 'sizeLimitInBytes', 'type': 'int'}, + 'destination': {'key': 'destination', 'type': 'Destination'}, + 'skip_empty_archives': {'key': 'skipEmptyArchives', 'type': 'bool'}, + } + + def __init__( + self, + *, + enabled: Optional[bool] = None, + encoding: Optional[Union[str, "EncodingCaptureDescription"]] = None, + interval_in_seconds: Optional[int] = None, + size_limit_in_bytes: Optional[int] = None, + destination: Optional["Destination"] = None, + skip_empty_archives: Optional[bool] = None, + **kwargs + ): + super(CaptureDescription, self).__init__(**kwargs) + self.enabled = enabled + self.encoding = encoding + self.interval_in_seconds = interval_in_seconds + self.size_limit_in_bytes = size_limit_in_bytes + self.destination = destination + self.skip_empty_archives = skip_empty_archives + + +class CheckNameAvailabilityParameter(msrest.serialization.Model): + """Parameter supplied to check Namespace name availability operation. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Name to check the namespace name availability. + :type name: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + *, + name: str, + **kwargs + ): + super(CheckNameAvailabilityParameter, self).__init__(**kwargs) + self.name = name + + +class CheckNameAvailabilityResult(msrest.serialization.Model): + """The Result of the CheckNameAvailability operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar message: The detailed info regarding the reason associated with the Namespace. + :vartype message: str + :param name_available: Value indicating Namespace is availability, true if the Namespace is + available; otherwise, false. + :type name_available: bool + :param reason: The reason for unavailability of a Namespace. Possible values include: "None", + "InvalidName", "SubscriptionIsDisabled", "NameInUse", "NameInLockdown", + "TooManyNamespaceInCurrentSubscription". + :type reason: str or ~azure.mgmt.eventhub.v2021_06_01_preview.models.UnavailableReason + """ + + _validation = { + 'message': {'readonly': True}, + } + + _attribute_map = { + 'message': {'key': 'message', 'type': 'str'}, + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + } + + def __init__( + self, + *, + name_available: Optional[bool] = None, + reason: Optional[Union[str, "UnavailableReason"]] = None, + **kwargs + ): + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.message = None + self.name_available = name_available + self.reason = reason + + +class TrackedResource(Resource): + """Definition of resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(TrackedResource, self).__init__(**kwargs) + self.location = location + self.tags = tags + + +class Cluster(TrackedResource): + """Single Event Hubs Cluster resource in List or Get operations. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param sku: Properties of the cluster SKU. + :type sku: ~azure.mgmt.eventhub.v2021_06_01_preview.models.ClusterSku + :ivar system_data: The system meta data relating to this resource. + :vartype system_data: ~azure.mgmt.eventhub.v2021_06_01_preview.models.SystemData + :ivar created_at: The UTC time when the Event Hubs Cluster was created. + :vartype created_at: str + :ivar updated_at: The UTC time when the Event Hubs Cluster was last updated. + :vartype updated_at: str + :ivar metric_id: The metric ID of the cluster resource. Provided by the service and not + modifiable by the user. + :vartype metric_id: str + :ivar status: Status of the Cluster resource. + :vartype status: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'created_at': {'readonly': True}, + 'updated_at': {'readonly': True}, + 'metric_id': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'ClusterSku'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'str'}, + 'updated_at': {'key': 'properties.updatedAt', 'type': 'str'}, + 'metric_id': {'key': 'properties.metricId', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + sku: Optional["ClusterSku"] = None, + **kwargs + ): + super(Cluster, self).__init__(location=location, tags=tags, **kwargs) + self.sku = sku + self.system_data = None + self.created_at = None + self.updated_at = None + self.metric_id = None + self.status = None + + +class ClusterListResult(msrest.serialization.Model): + """The response of the List Event Hubs Clusters operation. + + :param value: The Event Hubs Clusters present in the List Event Hubs operation results. + :type value: list[~azure.mgmt.eventhub.v2021_06_01_preview.models.Cluster] + :param next_link: Link to the next set of results. Empty unless the value parameter contains an + incomplete list of Event Hubs Clusters. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Cluster]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["Cluster"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(ClusterListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ClusterQuotaConfigurationProperties(msrest.serialization.Model): + """Contains all settings for the cluster. + + :param settings: All possible Cluster settings - a collection of key/value paired settings + which apply to quotas and configurations imposed on the cluster. + :type settings: dict[str, str] + """ + + _attribute_map = { + 'settings': {'key': 'settings', 'type': '{str}'}, + } + + def __init__( + self, + *, + settings: Optional[Dict[str, str]] = None, + **kwargs + ): + super(ClusterQuotaConfigurationProperties, self).__init__(**kwargs) + self.settings = settings + + +class ClusterSku(msrest.serialization.Model): + """SKU parameters particular to a cluster instance. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Name of this SKU. Possible values include: "Dedicated". + :type name: str or ~azure.mgmt.eventhub.v2021_06_01_preview.models.ClusterSkuName + :param capacity: The quantity of Event Hubs Cluster Capacity Units contained in this cluster. + :type capacity: int + """ + + _validation = { + 'name': {'required': True}, + 'capacity': {'minimum': 1}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__( + self, + *, + name: Union[str, "ClusterSkuName"], + capacity: Optional[int] = None, + **kwargs + ): + super(ClusterSku, self).__init__(**kwargs) + self.name = name + self.capacity = capacity + + +class ConnectionState(msrest.serialization.Model): + """ConnectionState information. + + :param status: Status of the connection. Possible values include: "Pending", "Approved", + "Rejected", "Disconnected". + :type status: str or + ~azure.mgmt.eventhub.v2021_06_01_preview.models.PrivateLinkConnectionStatus + :param description: Description of the connection state. + :type description: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + *, + status: Optional[Union[str, "PrivateLinkConnectionStatus"]] = None, + description: Optional[str] = None, + **kwargs + ): + super(ConnectionState, self).__init__(**kwargs) + self.status = status + self.description = description + + +class ConsumerGroup(Resource): + """Single item in List or Get Consumer group operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system meta data relating to this resource. + :vartype system_data: ~azure.mgmt.eventhub.v2021_06_01_preview.models.SystemData + :ivar created_at: Exact time the message was created. + :vartype created_at: ~datetime.datetime + :ivar updated_at: The exact time the message was updated. + :vartype updated_at: ~datetime.datetime + :param user_metadata: User Metadata is a placeholder to store user-defined string data with + maximum length 1024. e.g. it can be used to store descriptive data, such as list of teams and + their contact information also user-defined configuration settings can be stored. + :type user_metadata: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'created_at': {'readonly': True}, + 'updated_at': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + 'updated_at': {'key': 'properties.updatedAt', 'type': 'iso-8601'}, + 'user_metadata': {'key': 'properties.userMetadata', 'type': 'str'}, + } + + def __init__( + self, + *, + user_metadata: Optional[str] = None, + **kwargs + ): + super(ConsumerGroup, self).__init__(**kwargs) + self.system_data = None + self.created_at = None + self.updated_at = None + self.user_metadata = user_metadata + + +class ConsumerGroupListResult(msrest.serialization.Model): + """The result to the List Consumer Group operation. + + :param value: Result of the List Consumer Group operation. + :type value: list[~azure.mgmt.eventhub.v2021_06_01_preview.models.ConsumerGroup] + :param next_link: Link to the next set of results. Not empty if Value contains incomplete list + of Consumer Group. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ConsumerGroup]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["ConsumerGroup"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(ConsumerGroupListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class Destination(msrest.serialization.Model): + """Capture storage details for capture description. + + :param name: Name for capture destination. + :type name: str + :param storage_account_resource_id: Resource id of the storage account to be used to create the + blobs. + :type storage_account_resource_id: str + :param blob_container: Blob container Name. + :type blob_container: str + :param archive_name_format: Blob naming convention for archive, e.g. + {Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}. Here all + the parameters (Namespace,EventHub .. etc) are mandatory irrespective of order. + :type archive_name_format: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'storage_account_resource_id': {'key': 'properties.storageAccountResourceId', 'type': 'str'}, + 'blob_container': {'key': 'properties.blobContainer', 'type': 'str'}, + 'archive_name_format': {'key': 'properties.archiveNameFormat', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + storage_account_resource_id: Optional[str] = None, + blob_container: Optional[str] = None, + archive_name_format: Optional[str] = None, + **kwargs + ): + super(Destination, self).__init__(**kwargs) + self.name = name + self.storage_account_resource_id = storage_account_resource_id + self.blob_container = blob_container + self.archive_name_format = archive_name_format + + +class EHNamespace(TrackedResource): + """Single Namespace item in List or Get Operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param sku: Properties of sku resource. + :type sku: ~azure.mgmt.eventhub.v2021_06_01_preview.models.Sku + :param identity: Properties of BYOK Identity description. + :type identity: ~azure.mgmt.eventhub.v2021_06_01_preview.models.Identity + :ivar system_data: The system meta data relating to this resource. + :vartype system_data: ~azure.mgmt.eventhub.v2021_06_01_preview.models.SystemData + :ivar provisioning_state: Provisioning state of the Namespace. + :vartype provisioning_state: str + :ivar status: Status of the Namespace. + :vartype status: str + :ivar created_at: The time the Namespace was created. + :vartype created_at: ~datetime.datetime + :ivar updated_at: The time the Namespace was updated. + :vartype updated_at: ~datetime.datetime + :ivar service_bus_endpoint: Endpoint you can use to perform Service Bus operations. + :vartype service_bus_endpoint: str + :param cluster_arm_id: Cluster ARM ID of the Namespace. + :type cluster_arm_id: str + :ivar metric_id: Identifier for Azure Insights metrics. + :vartype metric_id: str + :param is_auto_inflate_enabled: Value that indicates whether AutoInflate is enabled for + eventhub namespace. + :type is_auto_inflate_enabled: bool + :param maximum_throughput_units: Upper limit of throughput units when AutoInflate is enabled, + value should be within 0 to 20 throughput units. ( '0' if AutoInflateEnabled = true). + :type maximum_throughput_units: int + :param kafka_enabled: Value that indicates whether Kafka is enabled for eventhub namespace. + :type kafka_enabled: bool + :param zone_redundant: Enabling this property creates a Standard Event Hubs Namespace in + regions supported availability zones. + :type zone_redundant: bool + :param encryption: Properties of BYOK Encryption description. + :type encryption: ~azure.mgmt.eventhub.v2021_06_01_preview.models.Encryption + :param private_endpoint_connections: List of private endpoint connections. + :type private_endpoint_connections: + list[~azure.mgmt.eventhub.v2021_06_01_preview.models.PrivateEndpointConnection] + :param disable_local_auth: This property disables SAS authentication for the Event Hubs + namespace. + :type disable_local_auth: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + 'created_at': {'readonly': True}, + 'updated_at': {'readonly': True}, + 'service_bus_endpoint': {'readonly': True}, + 'metric_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + 'updated_at': {'key': 'properties.updatedAt', 'type': 'iso-8601'}, + 'service_bus_endpoint': {'key': 'properties.serviceBusEndpoint', 'type': 'str'}, + 'cluster_arm_id': {'key': 'properties.clusterArmId', 'type': 'str'}, + 'metric_id': {'key': 'properties.metricId', 'type': 'str'}, + 'is_auto_inflate_enabled': {'key': 'properties.isAutoInflateEnabled', 'type': 'bool'}, + 'maximum_throughput_units': {'key': 'properties.maximumThroughputUnits', 'type': 'int'}, + 'kafka_enabled': {'key': 'properties.kafkaEnabled', 'type': 'bool'}, + 'zone_redundant': {'key': 'properties.zoneRedundant', 'type': 'bool'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, + 'disable_local_auth': {'key': 'properties.disableLocalAuth', 'type': 'bool'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + sku: Optional["Sku"] = None, + identity: Optional["Identity"] = None, + cluster_arm_id: Optional[str] = None, + is_auto_inflate_enabled: Optional[bool] = None, + maximum_throughput_units: Optional[int] = None, + kafka_enabled: Optional[bool] = None, + zone_redundant: Optional[bool] = None, + encryption: Optional["Encryption"] = None, + private_endpoint_connections: Optional[List["PrivateEndpointConnection"]] = None, + disable_local_auth: Optional[bool] = None, + **kwargs + ): + super(EHNamespace, self).__init__(location=location, tags=tags, **kwargs) + self.sku = sku + self.identity = identity + self.system_data = None + self.provisioning_state = None + self.status = None + self.created_at = None + self.updated_at = None + self.service_bus_endpoint = None + self.cluster_arm_id = cluster_arm_id + self.metric_id = None + self.is_auto_inflate_enabled = is_auto_inflate_enabled + self.maximum_throughput_units = maximum_throughput_units + self.kafka_enabled = kafka_enabled + self.zone_redundant = zone_redundant + self.encryption = encryption + self.private_endpoint_connections = private_endpoint_connections + self.disable_local_auth = disable_local_auth + + +class EHNamespaceIdContainer(msrest.serialization.Model): + """The full ARM ID of an Event Hubs Namespace. + + :param id: id parameter. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + **kwargs + ): + super(EHNamespaceIdContainer, self).__init__(**kwargs) + self.id = id + + +class EHNamespaceIdListResult(msrest.serialization.Model): + """The response of the List Namespace IDs operation. + + :param value: Result of the List Namespace IDs operation. + :type value: list[~azure.mgmt.eventhub.v2021_06_01_preview.models.EHNamespaceIdContainer] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[EHNamespaceIdContainer]'}, + } + + def __init__( + self, + *, + value: Optional[List["EHNamespaceIdContainer"]] = None, + **kwargs + ): + super(EHNamespaceIdListResult, self).__init__(**kwargs) + self.value = value + + +class EHNamespaceListResult(msrest.serialization.Model): + """The response of the List Namespace operation. + + :param value: Result of the List Namespace operation. + :type value: list[~azure.mgmt.eventhub.v2021_06_01_preview.models.EHNamespace] + :param next_link: Link to the next set of results. Not empty if Value contains incomplete list + of namespaces. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[EHNamespace]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["EHNamespace"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(EHNamespaceListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class Encryption(msrest.serialization.Model): + """Properties to configure Encryption. + + :param key_vault_properties: Properties of KeyVault. + :type key_vault_properties: + list[~azure.mgmt.eventhub.v2021_06_01_preview.models.KeyVaultProperties] + :param key_source: Enumerates the possible value of keySource for Encryption. The only + acceptable values to pass in are None and "Microsoft.KeyVault". The default value is + "Microsoft.KeyVault". + :type key_source: str + :param require_infrastructure_encryption: Enable Infrastructure Encryption (Double Encryption). + :type require_infrastructure_encryption: bool + """ + + _attribute_map = { + 'key_vault_properties': {'key': 'keyVaultProperties', 'type': '[KeyVaultProperties]'}, + 'key_source': {'key': 'keySource', 'type': 'str'}, + 'require_infrastructure_encryption': {'key': 'requireInfrastructureEncryption', 'type': 'bool'}, + } + + def __init__( + self, + *, + key_vault_properties: Optional[List["KeyVaultProperties"]] = None, + key_source: Optional[str] = "Microsoft.KeyVault", + require_infrastructure_encryption: Optional[bool] = None, + **kwargs + ): + super(Encryption, self).__init__(**kwargs) + self.key_vault_properties = key_vault_properties + self.key_source = key_source + self.require_infrastructure_encryption = require_infrastructure_encryption + + +class ErrorResponse(msrest.serialization.Model): + """Error response indicates Event Hub service is not able to process the incoming request. The reason is provided in the error message. + + :param code: Error code. + :type code: str + :param message: Error message indicating why the operation failed. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.code = code + self.message = message + + +class Eventhub(Resource): + """Single item in List or Get Event Hub operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system meta data relating to this resource. + :vartype system_data: ~azure.mgmt.eventhub.v2021_06_01_preview.models.SystemData + :ivar partition_ids: Current number of shards on the Event Hub. + :vartype partition_ids: list[str] + :ivar created_at: Exact time the Event Hub was created. + :vartype created_at: ~datetime.datetime + :ivar updated_at: The exact time the message was updated. + :vartype updated_at: ~datetime.datetime + :param message_retention_in_days: Number of days to retain the events for this Event Hub, value + should be 1 to 7 days. + :type message_retention_in_days: long + :param partition_count: Number of partitions created for the Event Hub, allowed values are from + 1 to 32 partitions. + :type partition_count: long + :param status: Enumerates the possible values for the status of the Event Hub. Possible values + include: "Active", "Disabled", "Restoring", "SendDisabled", "ReceiveDisabled", "Creating", + "Deleting", "Renaming", "Unknown". + :type status: str or ~azure.mgmt.eventhub.v2021_06_01_preview.models.EntityStatus + :param capture_description: Properties of capture description. + :type capture_description: ~azure.mgmt.eventhub.v2021_06_01_preview.models.CaptureDescription + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'partition_ids': {'readonly': True}, + 'created_at': {'readonly': True}, + 'updated_at': {'readonly': True}, + 'message_retention_in_days': {'minimum': 1}, + 'partition_count': {'minimum': 1}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'partition_ids': {'key': 'properties.partitionIds', 'type': '[str]'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + 'updated_at': {'key': 'properties.updatedAt', 'type': 'iso-8601'}, + 'message_retention_in_days': {'key': 'properties.messageRetentionInDays', 'type': 'long'}, + 'partition_count': {'key': 'properties.partitionCount', 'type': 'long'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'capture_description': {'key': 'properties.captureDescription', 'type': 'CaptureDescription'}, + } + + def __init__( + self, + *, + message_retention_in_days: Optional[int] = None, + partition_count: Optional[int] = None, + status: Optional[Union[str, "EntityStatus"]] = None, + capture_description: Optional["CaptureDescription"] = None, + **kwargs + ): + super(Eventhub, self).__init__(**kwargs) + self.system_data = None + self.partition_ids = None + self.created_at = None + self.updated_at = None + self.message_retention_in_days = message_retention_in_days + self.partition_count = partition_count + self.status = status + self.capture_description = capture_description + + +class EventHubListResult(msrest.serialization.Model): + """The result of the List EventHubs operation. + + :param value: Result of the List EventHubs operation. + :type value: list[~azure.mgmt.eventhub.v2021_06_01_preview.models.Eventhub] + :param next_link: Link to the next set of results. Not empty if Value contains incomplete list + of EventHubs. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Eventhub]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["Eventhub"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(EventHubListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class Identity(msrest.serialization.Model): + """Properties to configure Identity for Bring your Own Keys. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: ObjectId from the KeyVault. + :vartype principal_id: str + :ivar tenant_id: TenantId from the KeyVault. + :vartype tenant_id: str + :param type: Type of managed service identity. Possible values include: "SystemAssigned", + "UserAssigned", "SystemAssigned, UserAssigned", "None". + :type type: str or ~azure.mgmt.eventhub.v2021_06_01_preview.models.ManagedServiceIdentityType + :param user_assigned_identities: Properties for User Assigned Identities. + :type user_assigned_identities: dict[str, + ~azure.mgmt.eventhub.v2021_06_01_preview.models.UserAssignedIdentity] + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "ManagedServiceIdentityType"]] = None, + user_assigned_identities: Optional[Dict[str, "UserAssignedIdentity"]] = None, + **kwargs + ): + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type + self.user_assigned_identities = user_assigned_identities + + +class KeyVaultProperties(msrest.serialization.Model): + """Properties to configure keyVault Properties. + + :param key_name: Name of the Key from KeyVault. + :type key_name: str + :param key_vault_uri: Uri of KeyVault. + :type key_vault_uri: str + :param key_version: Key Version. + :type key_version: str + :param identity: + :type identity: ~azure.mgmt.eventhub.v2021_06_01_preview.models.UserAssignedIdentityProperties + """ + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'key_vault_uri': {'key': 'keyVaultUri', 'type': 'str'}, + 'key_version': {'key': 'keyVersion', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'UserAssignedIdentityProperties'}, + } + + def __init__( + self, + *, + key_name: Optional[str] = None, + key_vault_uri: Optional[str] = None, + key_version: Optional[str] = None, + identity: Optional["UserAssignedIdentityProperties"] = None, + **kwargs + ): + super(KeyVaultProperties, self).__init__(**kwargs) + self.key_name = key_name + self.key_vault_uri = key_vault_uri + self.key_version = key_version + self.identity = identity + + +class NetworkRuleSet(Resource): + """Description of topic resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system meta data relating to this resource. + :vartype system_data: ~azure.mgmt.eventhub.v2021_06_01_preview.models.SystemData + :param trusted_service_access_enabled: Value that indicates whether Trusted Service Access is + Enabled or not. + :type trusted_service_access_enabled: bool + :param default_action: Default Action for Network Rule Set. Possible values include: "Allow", + "Deny". + :type default_action: str or ~azure.mgmt.eventhub.v2021_06_01_preview.models.DefaultAction + :param virtual_network_rules: List VirtualNetwork Rules. + :type virtual_network_rules: + list[~azure.mgmt.eventhub.v2021_06_01_preview.models.NWRuleSetVirtualNetworkRules] + :param ip_rules: List of IpRules. + :type ip_rules: list[~azure.mgmt.eventhub.v2021_06_01_preview.models.NWRuleSetIpRules] + :param public_network_access: This determines if traffic is allowed over public network. By + default it is enabled. Possible values include: "Enabled", "Disabled". Default value: + "Enabled". + :type public_network_access: str or + ~azure.mgmt.eventhub.v2021_06_01_preview.models.PublicNetworkAccessFlag + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'trusted_service_access_enabled': {'key': 'properties.trustedServiceAccessEnabled', 'type': 'bool'}, + 'default_action': {'key': 'properties.defaultAction', 'type': 'str'}, + 'virtual_network_rules': {'key': 'properties.virtualNetworkRules', 'type': '[NWRuleSetVirtualNetworkRules]'}, + 'ip_rules': {'key': 'properties.ipRules', 'type': '[NWRuleSetIpRules]'}, + 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, + } + + def __init__( + self, + *, + trusted_service_access_enabled: Optional[bool] = None, + default_action: Optional[Union[str, "DefaultAction"]] = None, + virtual_network_rules: Optional[List["NWRuleSetVirtualNetworkRules"]] = None, + ip_rules: Optional[List["NWRuleSetIpRules"]] = None, + public_network_access: Optional[Union[str, "PublicNetworkAccessFlag"]] = "Enabled", + **kwargs + ): + super(NetworkRuleSet, self).__init__(**kwargs) + self.system_data = None + self.trusted_service_access_enabled = trusted_service_access_enabled + self.default_action = default_action + self.virtual_network_rules = virtual_network_rules + self.ip_rules = ip_rules + self.public_network_access = public_network_access + + +class NWRuleSetIpRules(msrest.serialization.Model): + """The response from the List namespace operation. + + :param ip_mask: IP Mask. + :type ip_mask: str + :param action: The IP Filter Action. Possible values include: "Allow". + :type action: str or ~azure.mgmt.eventhub.v2021_06_01_preview.models.NetworkRuleIPAction + """ + + _attribute_map = { + 'ip_mask': {'key': 'ipMask', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'str'}, + } + + def __init__( + self, + *, + ip_mask: Optional[str] = None, + action: Optional[Union[str, "NetworkRuleIPAction"]] = None, + **kwargs + ): + super(NWRuleSetIpRules, self).__init__(**kwargs) + self.ip_mask = ip_mask + self.action = action + + +class NWRuleSetVirtualNetworkRules(msrest.serialization.Model): + """The response from the List namespace operation. + + :param subnet: Subnet properties. + :type subnet: ~azure.mgmt.eventhub.v2021_06_01_preview.models.Subnet + :param ignore_missing_vnet_service_endpoint: Value that indicates whether to ignore missing + Vnet Service Endpoint. + :type ignore_missing_vnet_service_endpoint: bool + """ + + _attribute_map = { + 'subnet': {'key': 'subnet', 'type': 'Subnet'}, + 'ignore_missing_vnet_service_endpoint': {'key': 'ignoreMissingVnetServiceEndpoint', 'type': 'bool'}, + } + + def __init__( + self, + *, + subnet: Optional["Subnet"] = None, + ignore_missing_vnet_service_endpoint: Optional[bool] = None, + **kwargs + ): + super(NWRuleSetVirtualNetworkRules, self).__init__(**kwargs) + self.subnet = subnet + self.ignore_missing_vnet_service_endpoint = ignore_missing_vnet_service_endpoint + + +class Operation(msrest.serialization.Model): + """A Event Hub REST API operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Operation name: {provider}/{resource}/{operation}. + :vartype name: str + :param display: The object that represents the operation. + :type display: ~azure.mgmt.eventhub.v2021_06_01_preview.models.OperationDisplay + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__( + self, + *, + display: Optional["OperationDisplay"] = None, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.name = None + self.display = display + + +class OperationDisplay(msrest.serialization.Model): + """The object that represents the operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provider: Service provider: Microsoft.EventHub. + :vartype provider: str + :ivar resource: Resource on which the operation is performed: Invoice, etc. + :vartype resource: str + :ivar operation: Operation type: Read, write, delete, etc. + :vartype operation: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None + + +class OperationListResult(msrest.serialization.Model): + """Result of the request to list Event Hub operations. It contains a list of operations and a URL link to get the next set of results. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of Event Hub operations supported by the Microsoft.EventHub resource + provider. + :vartype value: list[~azure.mgmt.eventhub.v2021_06_01_preview.models.Operation] + :ivar next_link: URL to get the next set of operation list results if there are any. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class PrivateEndpoint(msrest.serialization.Model): + """PrivateEndpoint information. + + :param id: The ARM identifier for Private Endpoint. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + **kwargs + ): + super(PrivateEndpoint, self).__init__(**kwargs) + self.id = id + + +class PrivateEndpointConnection(Resource): + """Properties of the PrivateEndpointConnection. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: The system meta data relating to this resource. + :vartype system_data: ~azure.mgmt.eventhub.v2021_06_01_preview.models.SystemData + :param private_endpoint: The Private Endpoint resource for this Connection. + :type private_endpoint: ~azure.mgmt.eventhub.v2021_06_01_preview.models.PrivateEndpoint + :param private_link_service_connection_state: Details about the state of the connection. + :type private_link_service_connection_state: + ~azure.mgmt.eventhub.v2021_06_01_preview.models.ConnectionState + :param provisioning_state: Provisioning state of the Private Endpoint Connection. Possible + values include: "Creating", "Updating", "Deleting", "Succeeded", "Canceled", "Failed". + :type provisioning_state: str or + ~azure.mgmt.eventhub.v2021_06_01_preview.models.EndPointProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'ConnectionState'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + private_endpoint: Optional["PrivateEndpoint"] = None, + private_link_service_connection_state: Optional["ConnectionState"] = None, + provisioning_state: Optional[Union[str, "EndPointProvisioningState"]] = None, + **kwargs + ): + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.system_data = None + self.private_endpoint = private_endpoint + self.private_link_service_connection_state = private_link_service_connection_state + self.provisioning_state = provisioning_state + + +class PrivateEndpointConnectionListResult(msrest.serialization.Model): + """Result of the list of all private endpoint connections operation. + + :param value: A collection of private endpoint connection resources. + :type value: list[~azure.mgmt.eventhub.v2021_06_01_preview.models.PrivateEndpointConnection] + :param next_link: A link for the next page of private endpoint connection resources. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["PrivateEndpointConnection"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class PrivateLinkResource(msrest.serialization.Model): + """Information of the private link resource. + + :param id: Fully qualified identifier of the resource. + :type id: str + :param name: Name of the resource. + :type name: str + :param type: Type of the resource. + :type type: str + :param group_id: The private link resource group id. + :type group_id: str + :param required_members: The private link resource required member names. + :type required_members: list[str] + :param required_zone_names: The private link resource Private link DNS zone name. + :type required_zone_names: list[str] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'group_id': {'key': 'properties.groupId', 'type': 'str'}, + 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, + 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + type: Optional[str] = None, + group_id: Optional[str] = None, + required_members: Optional[List[str]] = None, + required_zone_names: Optional[List[str]] = None, + **kwargs + ): + super(PrivateLinkResource, self).__init__(**kwargs) + self.id = id + self.name = name + self.type = type + self.group_id = group_id + self.required_members = required_members + self.required_zone_names = required_zone_names + + +class PrivateLinkResourcesListResult(msrest.serialization.Model): + """Result of the List private link resources operation. + + :param value: A collection of private link resources. + :type value: list[~azure.mgmt.eventhub.v2021_06_01_preview.models.PrivateLinkResource] + :param next_link: A link for the next page of private link resources. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["PrivateLinkResource"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(PrivateLinkResourcesListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class RegenerateAccessKeyParameters(msrest.serialization.Model): + """Parameters supplied to the Regenerate Authorization Rule operation, specifies which key needs to be reset. + + All required parameters must be populated in order to send to Azure. + + :param key_type: Required. The access key to regenerate. Possible values include: "PrimaryKey", + "SecondaryKey". + :type key_type: str or ~azure.mgmt.eventhub.v2021_06_01_preview.models.KeyType + :param key: Optional, if the key value provided, is set for KeyType or autogenerated Key value + set for keyType. + :type key: str + """ + + _validation = { + 'key_type': {'required': True}, + } + + _attribute_map = { + 'key_type': {'key': 'keyType', 'type': 'str'}, + 'key': {'key': 'key', 'type': 'str'}, + } + + def __init__( + self, + *, + key_type: Union[str, "KeyType"], + key: Optional[str] = None, + **kwargs + ): + super(RegenerateAccessKeyParameters, self).__init__(**kwargs) + self.key_type = key_type + self.key = key + + +class Sku(msrest.serialization.Model): + """SKU parameters supplied to the create namespace operation. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Name of this SKU. Possible values include: "Basic", "Standard", + "Premium". + :type name: str or ~azure.mgmt.eventhub.v2021_06_01_preview.models.SkuName + :param tier: The billing tier of this particular SKU. Possible values include: "Basic", + "Standard", "Premium". + :type tier: str or ~azure.mgmt.eventhub.v2021_06_01_preview.models.SkuTier + :param capacity: The Event Hubs throughput units for Basic or Standard tiers, where value + should be 0 to 20 throughput units. The Event Hubs premium units for Premium tier, where value + should be 0 to 10 premium units. + :type capacity: int + """ + + _validation = { + 'name': {'required': True}, + 'capacity': {'minimum': 0}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__( + self, + *, + name: Union[str, "SkuName"], + tier: Optional[Union[str, "SkuTier"]] = None, + capacity: Optional[int] = None, + **kwargs + ): + super(Sku, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.capacity = capacity + + +class Subnet(msrest.serialization.Model): + """Properties supplied for Subnet. + + :param id: Resource ID of Virtual Network Subnet. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + **kwargs + ): + super(Subnet, self).__init__(**kwargs) + self.id = id + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or ~azure.mgmt.eventhub.v2021_06_01_preview.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or + ~azure.mgmt.eventhub.v2021_06_01_preview.models.CreatedByType + :param last_modified_at: The type of identity that last modified the resource. + :type last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "CreatedByType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "CreatedByType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, + **kwargs + ): + super(SystemData, self).__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at + + +class UserAssignedIdentity(msrest.serialization.Model): + """Recognized Dictionary value. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: Principal Id of user assigned identity. + :vartype principal_id: str + :ivar client_id: Client Id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UserAssignedIdentity, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + +class UserAssignedIdentityProperties(msrest.serialization.Model): + """UserAssignedIdentityProperties. + + :param user_assigned_identity: ARM ID of user Identity selected for encryption. + :type user_assigned_identity: str + """ + + _attribute_map = { + 'user_assigned_identity': {'key': 'userAssignedIdentity', 'type': 'str'}, + } + + def __init__( + self, + *, + user_assigned_identity: Optional[str] = None, + **kwargs + ): + super(UserAssignedIdentityProperties, self).__init__(**kwargs) + self.user_assigned_identity = user_assigned_identity diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/operations/__init__.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/operations/__init__.py new file mode 100644 index 000000000000..11daeaa7c220 --- /dev/null +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/operations/__init__.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._clusters_operations import ClustersOperations +from ._configuration_operations import ConfigurationOperations +from ._namespaces_operations import NamespacesOperations +from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._private_link_resources_operations import PrivateLinkResourcesOperations +from ._operations import Operations +from ._event_hubs_operations import EventHubsOperations +from ._disaster_recovery_configs_operations import DisasterRecoveryConfigsOperations +from ._consumer_groups_operations import ConsumerGroupsOperations + +__all__ = [ + 'ClustersOperations', + 'ConfigurationOperations', + 'NamespacesOperations', + 'PrivateEndpointConnectionsOperations', + 'PrivateLinkResourcesOperations', + 'Operations', + 'EventHubsOperations', + 'DisasterRecoveryConfigsOperations', + 'ConsumerGroupsOperations', +] diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/operations/_clusters_operations.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/operations/_clusters_operations.py new file mode 100644 index 000000000000..b05ead0fc9bf --- /dev/null +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/operations/_clusters_operations.py @@ -0,0 +1,735 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ClustersOperations(object): + """ClustersOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.eventhub.v2021_06_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_available_cluster_region( + self, + **kwargs # type: Any + ): + # type: (...) -> "_models.AvailableClustersList" + """List the quantity of available pre-provisioned Event Hubs Clusters, indexed by Azure region. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AvailableClustersList, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2021_06_01_preview.models.AvailableClustersList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AvailableClustersList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.list_available_cluster_region.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AvailableClustersList', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_available_cluster_region.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EventHub/availableClusterRegions'} # type: ignore + + def list_by_subscription( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ClusterListResult"] + """Lists the available Event Hubs Clusters within an ARM resource group. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ClusterListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.eventhub.v2021_06_01_preview.models.ClusterListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ClusterListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ClusterListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EventHub/clusters'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ClusterListResult"] + """Lists the available Event Hubs Clusters within an ARM resource group. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ClusterListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.eventhub.v2021_06_01_preview.models.ClusterListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ClusterListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ClusterListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters'} # type: ignore + + def get( + self, + resource_group_name, # type: str + cluster_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Cluster" + """Gets the resource description of the specified Event Hubs Cluster. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param cluster_name: The name of the Event Hubs Cluster. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Cluster, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2021_06_01_preview.models.Cluster + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Cluster"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=50, min_length=6), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Cluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters/{clusterName}'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + cluster_name, # type: str + parameters, # type: "_models.Cluster" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.Cluster"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Cluster"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=50, min_length=6), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'Cluster') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Cluster', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Cluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters/{clusterName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + cluster_name, # type: str + parameters, # type: "_models.Cluster" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.Cluster"] + """Creates or updates an instance of an Event Hubs Cluster. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param cluster_name: The name of the Event Hubs Cluster. + :type cluster_name: str + :param parameters: Parameters for creating a eventhub cluster resource. + :type parameters: ~azure.mgmt.eventhub.v2021_06_01_preview.models.Cluster + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either Cluster or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.eventhub.v2021_06_01_preview.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Cluster"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Cluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=50, min_length=6), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters/{clusterName}'} # type: ignore + + def _update_initial( + self, + resource_group_name, # type: str + cluster_name, # type: str + parameters, # type: "_models.Cluster" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.Cluster"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Cluster"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=50, min_length=6), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'Cluster') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Cluster', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Cluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters/{clusterName}'} # type: ignore + + def begin_update( + self, + resource_group_name, # type: str + cluster_name, # type: str + parameters, # type: "_models.Cluster" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.Cluster"] + """Modifies mutable properties on the Event Hubs Cluster. This operation is idempotent. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param cluster_name: The name of the Event Hubs Cluster. + :type cluster_name: str + :param parameters: The properties of the Event Hubs Cluster which should be updated. + :type parameters: ~azure.mgmt.eventhub.v2021_06_01_preview.models.Cluster + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either Cluster or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.eventhub.v2021_06_01_preview.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Cluster"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Cluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=50, min_length=6), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters/{clusterName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + cluster_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=50, min_length=6), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters/{clusterName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + cluster_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes an existing Event Hubs Cluster. This operation is idempotent. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param cluster_name: The name of the Event Hubs Cluster. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=50, min_length=6), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters/{clusterName}'} # type: ignore + + def list_namespaces( + self, + resource_group_name, # type: str + cluster_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.EHNamespaceIdListResult" + """List all Event Hubs Namespace IDs in an Event Hubs Dedicated Cluster. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param cluster_name: The name of the Event Hubs Cluster. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: EHNamespaceIdListResult, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2021_06_01_preview.models.EHNamespaceIdListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.EHNamespaceIdListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.list_namespaces.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=50, min_length=6), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('EHNamespaceIdListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_namespaces.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters/{clusterName}/namespaces'} # type: ignore diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/operations/_configuration_operations.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/operations/_configuration_operations.py new file mode 100644 index 000000000000..19938d2c679f --- /dev/null +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/operations/_configuration_operations.py @@ -0,0 +1,180 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ConfigurationOperations(object): + """ConfigurationOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.eventhub.v2021_06_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def patch( + self, + resource_group_name, # type: str + cluster_name, # type: str + parameters, # type: "_models.ClusterQuotaConfigurationProperties" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.ClusterQuotaConfigurationProperties"] + """Replace all specified Event Hubs Cluster settings with those contained in the request body. + Leaves the settings not specified in the request body unmodified. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param cluster_name: The name of the Event Hubs Cluster. + :type cluster_name: str + :param parameters: Parameters for creating an Event Hubs Cluster resource. + :type parameters: ~azure.mgmt.eventhub.v2021_06_01_preview.models.ClusterQuotaConfigurationProperties + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ClusterQuotaConfigurationProperties, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2021_06_01_preview.models.ClusterQuotaConfigurationProperties or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ClusterQuotaConfigurationProperties"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.patch.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=50, min_length=6), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ClusterQuotaConfigurationProperties') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ClusterQuotaConfigurationProperties', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ClusterQuotaConfigurationProperties', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + patch.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters/{clusterName}/quotaConfiguration/default'} # type: ignore + + def get( + self, + resource_group_name, # type: str + cluster_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ClusterQuotaConfigurationProperties" + """Get all Event Hubs Cluster settings - a collection of key/value pairs which represent the + quotas and settings imposed on the cluster. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param cluster_name: The name of the Event Hubs Cluster. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ClusterQuotaConfigurationProperties, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2021_06_01_preview.models.ClusterQuotaConfigurationProperties + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ClusterQuotaConfigurationProperties"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=50, min_length=6), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ClusterQuotaConfigurationProperties', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters/{clusterName}/quotaConfiguration/default'} # type: ignore diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/operations/_consumer_groups_operations.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/operations/_consumer_groups_operations.py new file mode 100644 index 000000000000..d853441eb212 --- /dev/null +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/operations/_consumer_groups_operations.py @@ -0,0 +1,348 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ConsumerGroupsOperations(object): + """ConsumerGroupsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.eventhub.v2021_06_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def create_or_update( + self, + resource_group_name, # type: str + namespace_name, # type: str + event_hub_name, # type: str + consumer_group_name, # type: str + parameters, # type: "_models.ConsumerGroup" + **kwargs # type: Any + ): + # type: (...) -> "_models.ConsumerGroup" + """Creates or updates an Event Hubs consumer group as a nested resource within a Namespace. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param event_hub_name: The Event Hub name. + :type event_hub_name: str + :param consumer_group_name: The consumer group name. + :type consumer_group_name: str + :param parameters: Parameters supplied to create or update a consumer group resource. + :type parameters: ~azure.mgmt.eventhub.v2021_06_01_preview.models.ConsumerGroup + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ConsumerGroup, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2021_06_01_preview.models.ConsumerGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConsumerGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), + 'consumerGroupName': self._serialize.url("consumer_group_name", consumer_group_name, 'str', max_length=50, min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ConsumerGroup') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ConsumerGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/consumergroups/{consumerGroupName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + namespace_name, # type: str + event_hub_name, # type: str + consumer_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a consumer group from the specified Event Hub and resource group. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param event_hub_name: The Event Hub name. + :type event_hub_name: str + :param consumer_group_name: The consumer group name. + :type consumer_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), + 'consumerGroupName': self._serialize.url("consumer_group_name", consumer_group_name, 'str', max_length=50, min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/consumergroups/{consumerGroupName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + namespace_name, # type: str + event_hub_name, # type: str + consumer_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ConsumerGroup" + """Gets a description for the specified consumer group. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param event_hub_name: The Event Hub name. + :type event_hub_name: str + :param consumer_group_name: The consumer group name. + :type consumer_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ConsumerGroup, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2021_06_01_preview.models.ConsumerGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConsumerGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), + 'consumerGroupName': self._serialize.url("consumer_group_name", consumer_group_name, 'str', max_length=50, min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ConsumerGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/consumergroups/{consumerGroupName}'} # type: ignore + + def list_by_event_hub( + self, + resource_group_name, # type: str + namespace_name, # type: str + event_hub_name, # type: str + skip=None, # type: Optional[int] + top=None, # type: Optional[int] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ConsumerGroupListResult"] + """Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group + exists in the Namespace. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param event_hub_name: The Event Hub name. + :type event_hub_name: str + :param skip: Skip is only used if a previous operation returned a partial result. If a previous + response contains a nextLink element, the value of the nextLink element will include a skip + parameter that specifies a starting point to use for subsequent calls. + :type skip: int + :param top: May be used to limit the number of results to the most recent N usageDetails. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ConsumerGroupListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.eventhub.v2021_06_01_preview.models.ConsumerGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConsumerGroupListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_event_hub.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', maximum=1000, minimum=0) + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ConsumerGroupListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_event_hub.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/consumergroups'} # type: ignore diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/operations/_disaster_recovery_configs_operations.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/operations/_disaster_recovery_configs_operations.py new file mode 100644 index 000000000000..58b5f03c8cb7 --- /dev/null +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/operations/_disaster_recovery_configs_operations.py @@ -0,0 +1,728 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class DisasterRecoveryConfigsOperations(object): + """DisasterRecoveryConfigsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.eventhub.v2021_06_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def check_name_availability( + self, + resource_group_name, # type: str + namespace_name, # type: str + parameters, # type: "_models.CheckNameAvailabilityParameter" + **kwargs # type: Any + ): + # type: (...) -> "_models.CheckNameAvailabilityResult" + """Check the give Namespace name availability. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param parameters: Parameters to check availability of the given Alias name. + :type parameters: ~azure.mgmt.eventhub.v2021_06_01_preview.models.CheckNameAvailabilityParameter + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CheckNameAvailabilityResult, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2021_06_01_preview.models.CheckNameAvailabilityResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameAvailabilityResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.check_name_availability.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'CheckNameAvailabilityParameter') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CheckNameAvailabilityResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/checkNameAvailability'} # type: ignore + + def list( + self, + resource_group_name, # type: str + namespace_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ArmDisasterRecoveryListResult"] + """Gets all Alias(Disaster Recovery configurations). + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ArmDisasterRecoveryListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.eventhub.v2021_06_01_preview.models.ArmDisasterRecoveryListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArmDisasterRecoveryListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ArmDisasterRecoveryListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs'} # type: ignore + + def create_or_update( + self, + resource_group_name, # type: str + namespace_name, # type: str + alias, # type: str + parameters, # type: "_models.ArmDisasterRecovery" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.ArmDisasterRecovery"] + """Creates or updates a new Alias(Disaster Recovery configuration). + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param alias: The Disaster Recovery configuration name. + :type alias: str + :param parameters: Parameters required to create an Alias(Disaster Recovery configuration). + :type parameters: ~azure.mgmt.eventhub.v2021_06_01_preview.models.ArmDisasterRecovery + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ArmDisasterRecovery, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2021_06_01_preview.models.ArmDisasterRecovery or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ArmDisasterRecovery"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'alias': self._serialize.url("alias", alias, 'str', max_length=50, min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ArmDisasterRecovery') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ArmDisasterRecovery', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + namespace_name, # type: str + alias, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes an Alias(Disaster Recovery configuration). + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param alias: The Disaster Recovery configuration name. + :type alias: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'alias': self._serialize.url("alias", alias, 'str', max_length=50, min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + namespace_name, # type: str + alias, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ArmDisasterRecovery" + """Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param alias: The Disaster Recovery configuration name. + :type alias: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ArmDisasterRecovery, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2021_06_01_preview.models.ArmDisasterRecovery + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArmDisasterRecovery"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'alias': self._serialize.url("alias", alias, 'str', max_length=50, min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ArmDisasterRecovery', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}'} # type: ignore + + def break_pairing( + self, + resource_group_name, # type: str + namespace_name, # type: str + alias, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """This operation disables the Disaster Recovery and stops replicating changes from primary to + secondary namespaces. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param alias: The Disaster Recovery configuration name. + :type alias: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.break_pairing.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'alias': self._serialize.url("alias", alias, 'str', max_length=50, min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + break_pairing.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/breakPairing'} # type: ignore + + def fail_over( + self, + resource_group_name, # type: str + namespace_name, # type: str + alias, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param alias: The Disaster Recovery configuration name. + :type alias: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.fail_over.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'alias': self._serialize.url("alias", alias, 'str', max_length=50, min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + fail_over.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/failover'} # type: ignore + + def list_authorization_rules( + self, + resource_group_name, # type: str + namespace_name, # type: str + alias, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.AuthorizationRuleListResult"] + """Gets a list of authorization rules for a Namespace. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param alias: The Disaster Recovery configuration name. + :type alias: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AuthorizationRuleListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.eventhub.v2021_06_01_preview.models.AuthorizationRuleListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationRuleListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_authorization_rules.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'alias': self._serialize.url("alias", alias, 'str', max_length=50, min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AuthorizationRuleListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_authorization_rules.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/authorizationRules'} # type: ignore + + def get_authorization_rule( + self, + resource_group_name, # type: str + namespace_name, # type: str + alias, # type: str + authorization_rule_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.AuthorizationRule" + """Gets an AuthorizationRule for a Namespace by rule name. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param alias: The Disaster Recovery configuration name. + :type alias: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AuthorizationRule, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2021_06_01_preview.models.AuthorizationRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.get_authorization_rule.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'alias': self._serialize.url("alias", alias, 'str', max_length=50, min_length=1), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AuthorizationRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/authorizationRules/{authorizationRuleName}'} # type: ignore + + def list_keys( + self, + resource_group_name, # type: str + namespace_name, # type: str + alias, # type: str + authorization_rule_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.AccessKeys" + """Gets the primary and secondary connection strings for the Namespace. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param alias: The Disaster Recovery configuration name. + :type alias: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AccessKeys, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2021_06_01_preview.models.AccessKeys + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessKeys"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.list_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'alias': self._serialize.url("alias", alias, 'str', max_length=50, min_length=1), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AccessKeys', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/authorizationRules/{authorizationRuleName}/listKeys'} # type: ignore diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/operations/_event_hubs_operations.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/operations/_event_hubs_operations.py new file mode 100644 index 000000000000..11347bae096b --- /dev/null +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/operations/_event_hubs_operations.py @@ -0,0 +1,766 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class EventHubsOperations(object): + """EventHubsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.eventhub.v2021_06_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_namespace( + self, + resource_group_name, # type: str + namespace_name, # type: str + skip=None, # type: Optional[int] + top=None, # type: Optional[int] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.EventHubListResult"] + """Gets all the Event Hubs in a Namespace. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param skip: Skip is only used if a previous operation returned a partial result. If a previous + response contains a nextLink element, the value of the nextLink element will include a skip + parameter that specifies a starting point to use for subsequent calls. + :type skip: int + :param top: May be used to limit the number of results to the most recent N usageDetails. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either EventHubListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.eventhub.v2021_06_01_preview.models.EventHubListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.EventHubListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_namespace.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', maximum=1000, minimum=0) + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', maximum=1000, minimum=1) + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('EventHubListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_namespace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs'} # type: ignore + + def create_or_update( + self, + resource_group_name, # type: str + namespace_name, # type: str + event_hub_name, # type: str + parameters, # type: "_models.Eventhub" + **kwargs # type: Any + ): + # type: (...) -> "_models.Eventhub" + """Creates or updates a new Event Hub as a nested resource within a Namespace. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param event_hub_name: The Event Hub name. + :type event_hub_name: str + :param parameters: Parameters supplied to create an Event Hub resource. + :type parameters: ~azure.mgmt.eventhub.v2021_06_01_preview.models.Eventhub + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Eventhub, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2021_06_01_preview.models.Eventhub + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Eventhub"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'Eventhub') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Eventhub', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + namespace_name, # type: str + event_hub_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes an Event Hub from the specified Namespace and resource group. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param event_hub_name: The Event Hub name. + :type event_hub_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + namespace_name, # type: str + event_hub_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Eventhub" + """Gets an Event Hubs description for the specified Event Hub. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param event_hub_name: The Event Hub name. + :type event_hub_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Eventhub, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2021_06_01_preview.models.Eventhub + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Eventhub"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Eventhub', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}'} # type: ignore + + def list_authorization_rules( + self, + resource_group_name, # type: str + namespace_name, # type: str + event_hub_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.AuthorizationRuleListResult"] + """Gets the authorization rules for an Event Hub. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param event_hub_name: The Event Hub name. + :type event_hub_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AuthorizationRuleListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.eventhub.v2021_06_01_preview.models.AuthorizationRuleListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationRuleListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_authorization_rules.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AuthorizationRuleListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_authorization_rules.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules'} # type: ignore + + def create_or_update_authorization_rule( + self, + resource_group_name, # type: str + namespace_name, # type: str + event_hub_name, # type: str + authorization_rule_name, # type: str + parameters, # type: "_models.AuthorizationRule" + **kwargs # type: Any + ): + # type: (...) -> "_models.AuthorizationRule" + """Creates or updates an AuthorizationRule for the specified Event Hub. Creation/update of the + AuthorizationRule will take a few seconds to take effect. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param event_hub_name: The Event Hub name. + :type event_hub_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :param parameters: The shared access AuthorizationRule. + :type parameters: ~azure.mgmt.eventhub.v2021_06_01_preview.models.AuthorizationRule + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AuthorizationRule, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2021_06_01_preview.models.AuthorizationRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_authorization_rule.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'AuthorizationRule') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AuthorizationRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}'} # type: ignore + + def get_authorization_rule( + self, + resource_group_name, # type: str + namespace_name, # type: str + event_hub_name, # type: str + authorization_rule_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.AuthorizationRule" + """Gets an AuthorizationRule for an Event Hub by rule name. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param event_hub_name: The Event Hub name. + :type event_hub_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AuthorizationRule, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2021_06_01_preview.models.AuthorizationRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.get_authorization_rule.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AuthorizationRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}'} # type: ignore + + def delete_authorization_rule( + self, + resource_group_name, # type: str + namespace_name, # type: str + event_hub_name, # type: str + authorization_rule_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes an Event Hub AuthorizationRule. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param event_hub_name: The Event Hub name. + :type event_hub_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete_authorization_rule.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}'} # type: ignore + + def list_keys( + self, + resource_group_name, # type: str + namespace_name, # type: str + event_hub_name, # type: str + authorization_rule_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.AccessKeys" + """Gets the ACS and SAS connection strings for the Event Hub. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param event_hub_name: The Event Hub name. + :type event_hub_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AccessKeys, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2021_06_01_preview.models.AccessKeys + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessKeys"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.list_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AccessKeys', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}/listKeys'} # type: ignore + + def regenerate_keys( + self, + resource_group_name, # type: str + namespace_name, # type: str + event_hub_name, # type: str + authorization_rule_name, # type: str + parameters, # type: "_models.RegenerateAccessKeyParameters" + **kwargs # type: Any + ): + # type: (...) -> "_models.AccessKeys" + """Regenerates the ACS and SAS connection strings for the Event Hub. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param event_hub_name: The Event Hub name. + :type event_hub_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :param parameters: Parameters supplied to regenerate the AuthorizationRule Keys + (PrimaryKey/SecondaryKey). + :type parameters: ~azure.mgmt.eventhub.v2021_06_01_preview.models.RegenerateAccessKeyParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AccessKeys, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2021_06_01_preview.models.AccessKeys + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessKeys"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.regenerate_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'eventHubName': self._serialize.url("event_hub_name", event_hub_name, 'str', max_length=256, min_length=1), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'RegenerateAccessKeyParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AccessKeys', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + regenerate_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}/regenerateKeys'} # type: ignore diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/operations/_namespaces_operations.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/operations/_namespaces_operations.py new file mode 100644 index 000000000000..25caecd61014 --- /dev/null +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/operations/_namespaces_operations.py @@ -0,0 +1,1164 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class NamespacesOperations(object): + """NamespacesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.eventhub.v2021_06_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.EHNamespaceListResult"] + """Lists all the available Namespaces within a subscription, irrespective of the resource groups. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either EHNamespaceListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.eventhub.v2021_06_01_preview.models.EHNamespaceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.EHNamespaceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('EHNamespaceListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EventHub/namespaces'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.EHNamespaceListResult"] + """Lists the available Namespaces within a resource group. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either EHNamespaceListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.eventhub.v2021_06_01_preview.models.EHNamespaceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.EHNamespaceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('EHNamespaceListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + namespace_name, # type: str + parameters, # type: "_models.EHNamespace" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.EHNamespace"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EHNamespace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'EHNamespace') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('EHNamespace', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('EHNamespace', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + namespace_name, # type: str + parameters, # type: "_models.EHNamespace" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.EHNamespace"] + """Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. + This operation is idempotent. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param parameters: Parameters for creating a namespace resource. + :type parameters: ~azure.mgmt.eventhub.v2021_06_01_preview.models.EHNamespace + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either EHNamespace or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.eventhub.v2021_06_01_preview.models.EHNamespace] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.EHNamespace"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('EHNamespace', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + namespace_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + namespace_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes an existing namespace. This operation also removes all associated resources under the + namespace. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + namespace_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.EHNamespace" + """Gets the description of the specified namespace. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: EHNamespace, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2021_06_01_preview.models.EHNamespace + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.EHNamespace"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('EHNamespace', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + namespace_name, # type: str + parameters, # type: "_models.EHNamespace" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.EHNamespace"] + """Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. + This operation is idempotent. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param parameters: Parameters for updating a namespace resource. + :type parameters: ~azure.mgmt.eventhub.v2021_06_01_preview.models.EHNamespace + :keyword callable cls: A custom type or function that will be passed the direct response + :return: EHNamespace, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2021_06_01_preview.models.EHNamespace or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EHNamespace"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'EHNamespace') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('EHNamespace', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('EHNamespace', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}'} # type: ignore + + def create_or_update_network_rule_set( + self, + resource_group_name, # type: str + namespace_name, # type: str + parameters, # type: "_models.NetworkRuleSet" + **kwargs # type: Any + ): + # type: (...) -> "_models.NetworkRuleSet" + """Create or update NetworkRuleSet for a Namespace. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param parameters: The Namespace IpFilterRule. + :type parameters: ~azure.mgmt.eventhub.v2021_06_01_preview.models.NetworkRuleSet + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkRuleSet, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2021_06_01_preview.models.NetworkRuleSet + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkRuleSet"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_network_rule_set.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'NetworkRuleSet') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkRuleSet', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_network_rule_set.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/networkRuleSets/default'} # type: ignore + + def get_network_rule_set( + self, + resource_group_name, # type: str + namespace_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.NetworkRuleSet" + """Gets NetworkRuleSet for a Namespace. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkRuleSet, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2021_06_01_preview.models.NetworkRuleSet + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkRuleSet"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.get_network_rule_set.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkRuleSet', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_network_rule_set.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/networkRuleSets/default'} # type: ignore + + def list_authorization_rules( + self, + resource_group_name, # type: str + namespace_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.AuthorizationRuleListResult"] + """Gets a list of authorization rules for a Namespace. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AuthorizationRuleListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.eventhub.v2021_06_01_preview.models.AuthorizationRuleListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationRuleListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_authorization_rules.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AuthorizationRuleListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_authorization_rules.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules'} # type: ignore + + def create_or_update_authorization_rule( + self, + resource_group_name, # type: str + namespace_name, # type: str + authorization_rule_name, # type: str + parameters, # type: "_models.AuthorizationRule" + **kwargs # type: Any + ): + # type: (...) -> "_models.AuthorizationRule" + """Creates or updates an AuthorizationRule for a Namespace. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :param parameters: The shared access AuthorizationRule. + :type parameters: ~azure.mgmt.eventhub.v2021_06_01_preview.models.AuthorizationRule + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AuthorizationRule, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2021_06_01_preview.models.AuthorizationRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update_authorization_rule.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'AuthorizationRule') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AuthorizationRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}'} # type: ignore + + def delete_authorization_rule( + self, + resource_group_name, # type: str + namespace_name, # type: str + authorization_rule_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes an AuthorizationRule for a Namespace. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete_authorization_rule.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}'} # type: ignore + + def get_authorization_rule( + self, + resource_group_name, # type: str + namespace_name, # type: str + authorization_rule_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.AuthorizationRule" + """Gets an AuthorizationRule for a Namespace by rule name. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AuthorizationRule, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2021_06_01_preview.models.AuthorizationRule + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationRule"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.get_authorization_rule.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AuthorizationRule', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_authorization_rule.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}'} # type: ignore + + def list_keys( + self, + resource_group_name, # type: str + namespace_name, # type: str + authorization_rule_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.AccessKeys" + """Gets the primary and secondary connection strings for the Namespace. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AccessKeys, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2021_06_01_preview.models.AccessKeys + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessKeys"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.list_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AccessKeys', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}/listKeys'} # type: ignore + + def regenerate_keys( + self, + resource_group_name, # type: str + namespace_name, # type: str + authorization_rule_name, # type: str + parameters, # type: "_models.RegenerateAccessKeyParameters" + **kwargs # type: Any + ): + # type: (...) -> "_models.AccessKeys" + """Regenerates the primary or secondary connection strings for the specified Namespace. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param authorization_rule_name: The authorization rule name. + :type authorization_rule_name: str + :param parameters: Parameters required to regenerate the connection string. + :type parameters: ~azure.mgmt.eventhub.v2021_06_01_preview.models.RegenerateAccessKeyParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AccessKeys, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2021_06_01_preview.models.AccessKeys + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessKeys"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.regenerate_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'authorizationRuleName': self._serialize.url("authorization_rule_name", authorization_rule_name, 'str', min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'RegenerateAccessKeyParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AccessKeys', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + regenerate_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}/regenerateKeys'} # type: ignore + + def check_name_availability( + self, + parameters, # type: "_models.CheckNameAvailabilityParameter" + **kwargs # type: Any + ): + # type: (...) -> "_models.CheckNameAvailabilityResult" + """Check the give Namespace name availability. + + :param parameters: Parameters to check availability of the given Namespace name. + :type parameters: ~azure.mgmt.eventhub.v2021_06_01_preview.models.CheckNameAvailabilityParameter + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CheckNameAvailabilityResult, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2021_06_01_preview.models.CheckNameAvailabilityResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckNameAvailabilityResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.check_name_availability.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'CheckNameAvailabilityParameter') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CheckNameAvailabilityResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EventHub/checkNameAvailability'} # type: ignore diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/operations/_operations.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/operations/_operations.py new file mode 100644 index 000000000000..ec879cb07bc7 --- /dev/null +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/operations/_operations.py @@ -0,0 +1,110 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class Operations(object): + """Operations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.eventhub.v2021_06_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.OperationListResult"] + """Lists all of the available Event Hub REST API operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.eventhub.v2021_06_01_preview.models.OperationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('OperationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.EventHub/operations'} # type: ignore diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/operations/_private_endpoint_connections_operations.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/operations/_private_endpoint_connections_operations.py new file mode 100644 index 000000000000..bf8467f022c6 --- /dev/null +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/operations/_private_endpoint_connections_operations.py @@ -0,0 +1,384 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class PrivateEndpointConnectionsOperations(object): + """PrivateEndpointConnectionsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.eventhub.v2021_06_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + namespace_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.PrivateEndpointConnectionListResult"] + """Gets the available PrivateEndpointConnections within a namespace. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PrivateEndpointConnectionListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.eventhub.v2021_06_01_preview.models.PrivateEndpointConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('PrivateEndpointConnectionListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/privateEndpointConnections'} # type: ignore + + def create_or_update( + self, + resource_group_name, # type: str + namespace_name, # type: str + private_endpoint_connection_name, # type: str + parameters, # type: "_models.PrivateEndpointConnection" + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateEndpointConnection" + """Creates or updates PrivateEndpointConnections of service namespace. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param private_endpoint_connection_name: The PrivateEndpointConnection name. + :type private_endpoint_connection_name: str + :param parameters: Parameters supplied to update Status of PrivateEndPoint Connection to + namespace resource. + :type parameters: ~azure.mgmt.eventhub.v2021_06_01_preview.models.PrivateEndpointConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2021_06_01_preview.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'PrivateEndpointConnection') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + namespace_name, # type: str + private_endpoint_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + namespace_name, # type: str + private_endpoint_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes an existing namespace. This operation also removes all associated resources under the + namespace. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param private_endpoint_connection_name: The PrivateEndpointConnection name. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + private_endpoint_connection_name=private_endpoint_connection_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + namespace_name, # type: str + private_endpoint_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateEndpointConnection" + """Gets a description for the specified Private Endpoint Connection name. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :param private_endpoint_connection_name: The PrivateEndpointConnection name. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2021_06_01_preview.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/operations/_private_link_resources_operations.py b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/operations/_private_link_resources_operations.py new file mode 100644 index 000000000000..64875ade3b98 --- /dev/null +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/operations/_private_link_resources_operations.py @@ -0,0 +1,105 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class PrivateLinkResourcesOperations(object): + """PrivateLinkResourcesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.eventhub.v2021_06_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + resource_group_name, # type: str + namespace_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateLinkResourcesListResult" + """Gets lists of resources that supports Privatelinks. + + :param resource_group_name: Name of the resource group within the azure subscription. + :type resource_group_name: str + :param namespace_name: The Namespace name. + :type namespace_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkResourcesListResult, or the result of cls(response) + :rtype: ~azure.mgmt.eventhub.v2021_06_01_preview.models.PrivateLinkResourcesListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourcesListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'namespaceName': self._serialize.url("namespace_name", namespace_name, 'str', max_length=50, min_length=6), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateLinkResourcesListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/privateLinkResources'} # type: ignore diff --git a/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/py.typed b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2021_06_01_preview/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file From 6d84c3a663f2c8f135dee62aaa117558ff88af30 Mon Sep 17 00:00:00 2001 From: Scott Beddall <45376673+scbedd@users.noreply.github.com> Date: Mon, 20 Sep 2021 09:08:23 -0700 Subject: [PATCH 74/85] =?UTF-8?q?avroserializer=20pins=20its=20dependency,?= =?UTF-8?q?=20which=20makes=20regression=20testing=20a=20=E2=80=A6=20(#207?= =?UTF-8?q?35)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …bit iffy @swathipil This will resolve your nightly failure. Still not understanding the specific repro I'm seeing when I run this thing locally though. --- scripts/devops_tasks/git_helper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/devops_tasks/git_helper.py b/scripts/devops_tasks/git_helper.py index 3b40dbbc3534..e3d2a66a51e1 100644 --- a/scripts/devops_tasks/git_helper.py +++ b/scripts/devops_tasks/git_helper.py @@ -23,7 +23,7 @@ 'azure-cosmos': '3.2.0', 'azure-servicebus': '0.50.3', 'azure-eventgrid': '1.3.0', - 'azure-schemaregistry-avroserializer': '1.0.0b1', + 'azure-schemaregistry-avroserializer': '1.0.0b2', 'azure-storage-blob-changefeed' : '12.0.0b2', 'azure-storage-file-datalake': '12.2.0b1', 'azure-communication-identity': '1.0.0', From ee9d553f3d1a044959e15ae965a9f4736d19b9b2 Mon Sep 17 00:00:00 2001 From: "Chidozie Ononiwu (His Righteousness)" <31145988+chidozieononiwu@users.noreply.github.com> Date: Mon, 20 Sep 2021 11:15:59 -0700 Subject: [PATCH 75/85] Fix broken anchor tags (#20751) --- doc/dev/docstring_typehint.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/dev/docstring_typehint.md b/doc/dev/docstring_typehint.md index 0df46f8b3345..6cec472d8b61 100644 --- a/doc/dev/docstring_typehint.md +++ b/doc/dev/docstring_typehint.md @@ -4,7 +4,7 @@ All public methods should have docstrings to document the parameters, keywords, * [Docstrings](#docstrings) * [Method Docstrings](#method_docstrings) - * [Model and Client Docstrings](#model_and_Client_Docstrings) + * [Model and Client Docstrings](#model_and_client_docstrings) * [Type Hints](#type_hints) * [Type Hints for Python 2.7 and 3.5+](#type_hints_for_python_2.7_and_3.5+) * [Type Hints for Python 3.5+](#type_hints_for_python_3.5+) From 856f24703a2f8b833c5f81aa23754ab9b6f3804c Mon Sep 17 00:00:00 2001 From: Scott Addie <10702007+scottaddie@users.noreply.github.com> Date: Mon, 20 Sep 2021 15:10:54 -0500 Subject: [PATCH 76/85] Link to Log Analytics throttling guidance from Monitor Query README (#20759) --- sdk/monitor/azure-monitor-query/README.md | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/sdk/monitor/azure-monitor-query/README.md b/sdk/monitor/azure-monitor-query/README.md index 82ea4e8cfa0d..9729da67de55 100644 --- a/sdk/monitor/azure-monitor-query/README.md +++ b/sdk/monitor/azure-monitor-query/README.md @@ -69,13 +69,7 @@ For examples of Logs and Metrics queries, see the [Examples](#examples) section. ### Logs query rate limits and throttling -Each Azure Active Directory user is able to make up to 200 requests per 30 seconds, with no cap on the total calls per day. If requests are made at a rate higher than this, these requests will receive HTTP status code 429 (Too Many Requests) along with the `Retry-After: ` header. The header indicates the number of seconds until requests to this app are likely to be accepted. - -In addition to call rate limits and daily quota caps, there are limits on queries themselves. Queries cannot: - -- Return more than 500,000 rows. -- Return more than 64,000,000 bytes (~61 MiB total data). -- Run longer than 10 minutes by default. See this for details. +The Log Analytics service applies throttling when the request rate is too high. Limits, such as the maximum number of rows returned, are also applied on the Kusto queries. For more information, see [Rate and query limits](https://dev.loganalytics.io/documentation/Using-the-API/Limits). ### Metrics data structure From e7d334892f2b83d0a565db63440f6086e9590a1e Mon Sep 17 00:00:00 2001 From: Franko Morales <67804607+cochi2@users.noreply.github.com> Date: Mon, 20 Sep 2021 16:51:38 -0700 Subject: [PATCH 77/85] Fixing VCR redirection (#20747) Using the location passed as part of the redirection response if it is an absolute URL. --- tools/vcrpy/vcr/stubs/aiohttp_stubs/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/vcrpy/vcr/stubs/aiohttp_stubs/__init__.py b/tools/vcrpy/vcr/stubs/aiohttp_stubs/__init__.py index 48154aa7102e..6613819ee16a 100644 --- a/tools/vcrpy/vcr/stubs/aiohttp_stubs/__init__.py +++ b/tools/vcrpy/vcr/stubs/aiohttp_stubs/__init__.py @@ -95,7 +95,11 @@ def play_responses(cassette, vcr_request): # If we're following redirects, continue playing until we reach # our final destination. while 300 <= response.status <= 399: - next_url = URL(response.url).with_path(response.headers["location"]) + new_location = response.headers["location"] + potential_next_url = URL(new_location) + next_url = (potential_next_url + if potential_next_url.is_absolute() + else URL(response.url).with_path(new_location)) # Make a stub VCR request that we can then use to look up the recorded # VCR request saved to the cassette. This feels a little hacky and From da36d3091177ca3918c93977296d33372b34aa5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?McCoy=20Pati=C3=B1o?= <39780829+mccoyp@users.noreply.github.com> Date: Mon, 20 Sep 2021 17:21:33 -0700 Subject: [PATCH 78/85] [Key Vault] Add certificate import sample (#20641) --- .../samples/README.md | 4 ++ .../samples/import_certificate.py | 64 +++++++++++++++++ .../samples/import_certificate_async.py | 72 +++++++++++++++++++ 3 files changed, 140 insertions(+) create mode 100644 sdk/keyvault/azure-keyvault-certificates/samples/import_certificate.py create mode 100644 sdk/keyvault/azure-keyvault-certificates/samples/import_certificate_async.py diff --git a/sdk/keyvault/azure-keyvault-certificates/samples/README.md b/sdk/keyvault/azure-keyvault-certificates/samples/README.md index d61368f4b36c..6b8e59c7ead6 100644 --- a/sdk/keyvault/azure-keyvault-certificates/samples/README.md +++ b/sdk/keyvault/azure-keyvault-certificates/samples/README.md @@ -15,6 +15,8 @@ These code snippets highlight this SDK's common use cases. * [hello_world.py][hello_world_sample] and [hello_world_async.py][hello_world_async_sample] - create/get/update/delete certificates * [backup_restore_operations.py][backup_operations_sample] and [backup_restore_operations_async.py][backup_operations_async_sample] - backup and recover certificates +* [import_certificate.py][import_certificate_sample] and [import_certificate_async.py][import_certificate_async_sample] - import PKCS#12 (PFX) +and PEM-formatted certificates into Key Vault * [list_operations.py][list_operations_sample] and [list_operations_async.py][list_operations_async_sample] - list certificates * [recover_purge_operations.py][recover_purge_operations_sample] and [recover_purge_operations_async.py][recover_purge_operations_async_sample] - recover and purge certificates * [issuers.py][issuers_sample] and [issuers_async.py][issuers_async_sample] - manage certificate issuers @@ -25,6 +27,8 @@ recover certificates [backup_operations_async_sample]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/keyvault/azure-keyvault-certificates/samples/backup_restore_operations_async.py [hello_world_sample]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/keyvault/azure-keyvault-certificates/samples/hello_world.py [hello_world_async_sample]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/keyvault/azure-keyvault-certificates/samples/hello_world_async.py +[import_certificate_sample]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/keyvault/azure-keyvault-certificates/samples/import_certificate.py +[import_certificate_async_sample]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/keyvault/azure-keyvault-certificates/samples/import_certificate_async.py [keyvault_docs]: https://docs.microsoft.com/azure/key-vault/ [list_operations_sample]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/keyvault/azure-keyvault-certificates/samples/list_operations.py [list_operations_async_sample]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/keyvault/azure-keyvault-certificates/samples/list_operations_async.py diff --git a/sdk/keyvault/azure-keyvault-certificates/samples/import_certificate.py b/sdk/keyvault/azure-keyvault-certificates/samples/import_certificate.py new file mode 100644 index 000000000000..88c5e8df0e75 --- /dev/null +++ b/sdk/keyvault/azure-keyvault-certificates/samples/import_certificate.py @@ -0,0 +1,64 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +import os +from azure.identity import DefaultAzureCredential +from azure.keyvault.certificates import ( + CertificateClient, + CertificateContentType, + CertificatePolicy, + WellKnownIssuerNames, +) + +# ---------------------------------------------------------------------------------------------------------- +# Prerequisites: +# 1. An Azure Key Vault (https://docs.microsoft.com/en-us/azure/key-vault/quick-create-cli) +# +# 2. azure-keyvault-certificates and azure-identity packages (pip install these) +# +# 3. Set up your environment to use azure-identity's DefaultAzureCredential. To authenticate a service principal with +# environment variables, set AZURE_CLIENT_ID, AZURE_CLIENT_SECRET, and AZURE_TENANT_ID +# (See https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/keyvault/azure-keyvault-administration#authenticate-the-client) +# +# 4. A PFX certificate on your machine. Set an environment variable, PFX_CERT_PATH, with the path to this certificate. +# +# 5. A PEM-formatted certificate on your machine. Set an environment variable, PEM_CERT_PATH, with the path to this +# certificate. +# +# ---------------------------------------------------------------------------------------------------------- +# Sample - demonstrates importing a PFX and PEM-formatted certificate into Azure Key Vault +# +# 1. Import an existing PFX certificate (import_certificate) +# +# 2. Import an existing PEM-formatted certificate (import_certificate) +# +# ---------------------------------------------------------------------------------------------------------- + +# Instantiate a certificate client that will be used to call the service. +# Here we use the DefaultAzureCredential, but any azure-identity credential can be used. +VAULT_URL = os.environ["VAULT_URL"] +credential = DefaultAzureCredential() +client = CertificateClient(vault_url=VAULT_URL, credential=credential) + +# Let's import a PFX certificate first. +# Assuming you already have a PFX containing your key pair, you can import it into Key Vault. +# You can do this without setting a policy, but the policy is needed if you want the private key to be exportable +# or to configure actions when a certificate is close to expiration. +pfx_cert_name = "pfxCert" +with open(os.environ["PFX_CERT_PATH"], "rb") as f: + pfx_cert_bytes = f.read() +imported_pfx_cert = client.import_certificate(certificate_name=pfx_cert_name, certificate_bytes=pfx_cert_bytes) +print("PFX certificate '{}' imported successfully.".format(imported_pfx_cert.name)) + +# Now let's import a PEM-formatted certificate. +# To import a PEM-formatted certificate, you must provide a CertificatePolicy that sets the content_type to +# CertificateContentType.pem or the certificate will fail to import (the default content type is PFX). +pem_cert_name = "pemCert" +with open(os.environ["PEM_CERT_PATH"], "rb") as f: + pem_cert_bytes = f.read() +pem_cert_policy = CertificatePolicy(issuer_name=WellKnownIssuerNames.self, content_type=CertificateContentType.pem) +imported_pem_cert = client.import_certificate( + certificate_name=pem_cert_name, certificate_bytes=pem_cert_bytes, policy=pem_cert_policy +) +print("PEM-formatted certificate '{}' imported successfully.".format(imported_pem_cert.name)) diff --git a/sdk/keyvault/azure-keyvault-certificates/samples/import_certificate_async.py b/sdk/keyvault/azure-keyvault-certificates/samples/import_certificate_async.py new file mode 100644 index 000000000000..915c7fc28ac5 --- /dev/null +++ b/sdk/keyvault/azure-keyvault-certificates/samples/import_certificate_async.py @@ -0,0 +1,72 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +import asyncio +import os +from azure.identity.aio import DefaultAzureCredential +from azure.keyvault.certificates import CertificateContentType, CertificatePolicy, WellKnownIssuerNames +from azure.keyvault.certificates.aio import CertificateClient + +# ---------------------------------------------------------------------------------------------------------- +# Prerequisites: +# 1. An Azure Key Vault (https://docs.microsoft.com/en-us/azure/key-vault/quick-create-cli) +# +# 2. azure-keyvault-certificates and azure-identity packages (pip install these) +# +# 3. Set up your environment to use azure-identity's DefaultAzureCredential. To authenticate a service principal with +# environment variables, set AZURE_CLIENT_ID, AZURE_CLIENT_SECRET, and AZURE_TENANT_ID +# (See https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/keyvault/azure-keyvault-administration#authenticate-the-client) +# +# 4. A PFX certificate on your machine. Set an environment variable, PFX_CERT_PATH, with the path to this certificate. +# +# 5. A PEM-formatted certificate on your machine. Set an environment variable, PEM_CERT_PATH, with the path to this +# certificate. +# +# ---------------------------------------------------------------------------------------------------------- +# Sample - demonstrates importing a PFX and PEM-formatted certificate into Azure Key Vault +# +# 1. Import an existing PFX certificate (import_certificate) +# +# 2. Import an existing PEM-formatted certificate (import_certificate) +# +# ---------------------------------------------------------------------------------------------------------- + +async def run_sample(): + # Instantiate a certificate client that will be used to call the service. + # Here we use the DefaultAzureCredential, but any azure-identity credential can be used. + VAULT_URL = os.environ["VAULT_URL"] + credential = DefaultAzureCredential() + client = CertificateClient(vault_url=VAULT_URL, credential=credential) + + # Let's import a PFX certificate first. + # Assuming you already have a PFX containing your key pair, you can import it into Key Vault. + # You can do this without setting a policy, but the policy is needed if you want the private key to be exportable + # or to configure actions when a certificate is close to expiration. + pfx_cert_name = "pfxCert" + with open(os.environ["PFX_CERT_PATH"], "rb") as f: + pfx_cert_bytes = f.read() + imported_pfx_cert = await client.import_certificate( + certificate_name=pfx_cert_name, certificate_bytes=pfx_cert_bytes + ) + print("PFX certificate '{}' imported successfully.".format(imported_pfx_cert.name)) + + # Now let's import a PEM-formatted certificate. + # To import a PEM-formatted certificate, you must provide a CertificatePolicy that sets the content_type to + # CertificateContentType.pem or the certificate will fail to import (the default content type is PFX). + pem_cert_name = "pemCert" + with open(os.environ["PEM_CERT_PATH"], "rb") as f: + pem_cert_bytes = f.read() + pem_cert_policy = CertificatePolicy(issuer_name=WellKnownIssuerNames.self, content_type=CertificateContentType.pem) + imported_pem_cert = await client.import_certificate( + certificate_name=pem_cert_name, certificate_bytes=pem_cert_bytes, policy=pem_cert_policy + ) + print("PEM-formatted certificate '{}' imported successfully.".format(imported_pem_cert.name)) + + await credential.close() + await client.close() + +if __name__ == "__main__": + loop = asyncio.get_event_loop() + loop.run_until_complete(run_sample()) + loop.close() From 0e20469c6ca951c4e36df15a11f394a250714de1 Mon Sep 17 00:00:00 2001 From: Wes Haggard Date: Tue, 21 Sep 2021 08:27:38 -0700 Subject: [PATCH 79/85] Enable release stage selection at queue time (#20767) --- eng/pipelines/templates/stages/archetype-python-release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/pipelines/templates/stages/archetype-python-release.yml b/eng/pipelines/templates/stages/archetype-python-release.yml index 03b312c1fa94..9ad71a143f07 100644 --- a/eng/pipelines/templates/stages/archetype-python-release.yml +++ b/eng/pipelines/templates/stages/archetype-python-release.yml @@ -10,9 +10,9 @@ parameters: TargetDocRepoName: '' stages: - - ${{if and(eq(variables['Build.Reason'], 'Manual'), eq(variables['System.TeamProject'], 'internal'))}}: + - ${{if and(in(variables['Build.Reason'], 'Manual', ''), eq(variables['System.TeamProject'], 'internal'))}}: - ${{ each artifact in parameters.Artifacts }}: - - stage: Release_${{artifact.safeName}} + - stage: displayName: 'Release: ${{artifact.name}}' dependsOn: ${{parameters.DependsOn}} condition: and(succeeded(), ne(variables['SetDevVersion'], 'true'), ne(variables['Skip.Release'], 'true'), ne(variables['Build.Repository.Name'], 'Azure/azure-sdk-for-python-pr')) @@ -262,7 +262,7 @@ stages: $fileCount = (Get-ChildItem $(Pipeline.Workspace)/${{parameters.ArtifactName}}/${{artifact.name}} | ? {$_.Name -match "-[0-9]*.[0-9]*.[0-9]*a[0-9]*" } | Measure-Object).Count if ($fileCount -eq 0) { - Write-Host "No alpha packages for ${{artifact.safeName}} to publish." + Write-Host "No alpha packages for ${{artifact.name}} to publish." exit 0 } From f8ff6862183537eddc542b148794e5e8445f74f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?McCoy=20Pati=C3=B1o?= <39780829+mccoyp@users.noreply.github.com> Date: Tue, 21 Sep 2021 11:08:50 -0700 Subject: [PATCH 80/85] Update add_sanitizer and doc (#20769) --- doc/dev/test_proxy_migration_guide.md | 3 ++- .../devtools_testutils/azure_recorded_testcase.py | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/doc/dev/test_proxy_migration_guide.md b/doc/dev/test_proxy_migration_guide.md index ff31703912b9..7dea06788a81 100644 --- a/doc/dev/test_proxy_migration_guide.md +++ b/doc/dev/test_proxy_migration_guide.md @@ -108,7 +108,8 @@ adding something like the following in the package's `conftest.py` file: ```python from devtools_testutils import add_sanitizer -@pytest.fixture(scope="session") +# autouse=True will trigger this fixture on each pytest run, even if it's not explicitly used by a test method +@pytest.fixture(scope="session", autouse=True) def sanitize_uris(): add_sanitizer(ProxyRecordingSanitizer.URI, value="fakeendpoint") ``` diff --git a/tools/azure-sdk-tools/devtools_testutils/azure_recorded_testcase.py b/tools/azure-sdk-tools/devtools_testutils/azure_recorded_testcase.py index 96452251da3d..969d80fe57fe 100644 --- a/tools/azure-sdk-tools/devtools_testutils/azure_recorded_testcase.py +++ b/tools/azure-sdk-tools/devtools_testutils/azure_recorded_testcase.py @@ -52,7 +52,9 @@ def add_sanitizer(sanitizer, **kwargs): """ request_args = {} request_args["value"] = kwargs.get("value") or "fakevalue" - request_args["regex"] = kwargs.get("regex") or "[a-z]+(?=(?:-secondary)\\.(?:table|blob|queue)\\.core\\.windows\\.net)" + request_args["regex"] = ( + kwargs.get("regex") or "(?<=\\/\\/)[a-z]+(?=(?:|-secondary)\\.(?:table|blob|queue)\\.core\\.windows\\.net)" + ) request_args["group_for_replace"] = kwargs.get("group_for_replace") if sanitizer == ProxyRecordingSanitizer.URI: @@ -62,7 +64,7 @@ def add_sanitizer(sanitizer, **kwargs): json={ "regex": request_args["regex"], "value": request_args["value"], - "groupForReplace": request_args["group_for_replace"] + "groupForReplace": request_args["group_for_replace"], }, ) From f3144dc21c90d9a1a659c6277d472dbab85083f1 Mon Sep 17 00:00:00 2001 From: swathipil <76007337+swathipil@users.noreply.github.com> Date: Tue, 21 Sep 2021 17:13:31 -0700 Subject: [PATCH 81/85] [SchemaRegistry] remove cache from client (#20760) * remove cache from client * changelog --- .../azure-schemaregistry/CHANGELOG.md | 1 + .../schemaregistry/_schema_registry_client.py | 69 +++------- .../aio/_schema_registry_client_async.py | 69 +++------- ...egistry_async.test_schema_basic_async.yaml | 44 ++++-- ....test_schema_negative_no_schema_async.yaml | 12 +- ...ry_async.test_schema_same_twice_async.yaml | 16 +-- ...gistry_async.test_schema_update_async.yaml | 100 +++----------- .../async_tests/test_schema_registry_async.py | 45 +------ ...est_schema_registry.test_schema_basic.yaml | 58 ++++++-- ...gistry.test_schema_negative_no_schema.yaml | 12 +- ...chema_registry.test_schema_same_twice.yaml | 16 +-- ...st_schema_registry.test_schema_update.yaml | 126 +++--------------- .../tests/test_schema_registry.py | 44 ------ 13 files changed, 187 insertions(+), 425 deletions(-) diff --git a/sdk/schemaregistry/azure-schemaregistry/CHANGELOG.md b/sdk/schemaregistry/azure-schemaregistry/CHANGELOG.md index 8a35560abc10..4cffbf0a375f 100644 --- a/sdk/schemaregistry/azure-schemaregistry/CHANGELOG.md +++ b/sdk/schemaregistry/azure-schemaregistry/CHANGELOG.md @@ -19,6 +19,7 @@ ### Other Changes - Updated azure-core dependency to 1.17.1. +- Removed caching support of registered schemas so requests are sent to the service to register schemas, get schema properties, and get schemas. ## 1.0.0b2 (2021-08-17) diff --git a/sdk/schemaregistry/azure-schemaregistry/azure/schemaregistry/_schema_registry_client.py b/sdk/schemaregistry/azure-schemaregistry/azure/schemaregistry/_schema_registry_client.py index 1c28f6b71ed7..f48234650710 100644 --- a/sdk/schemaregistry/azure-schemaregistry/azure/schemaregistry/_schema_registry_client.py +++ b/sdk/schemaregistry/azure-schemaregistry/azure/schemaregistry/_schema_registry_client.py @@ -64,8 +64,6 @@ def __init__(self, endpoint, credential, **kwargs): self._generated_client = AzureSchemaRegistry( credential=credential, endpoint=endpoint, **kwargs ) - self._description_to_properties = {} - self._id_to_schema = {} def __enter__(self): # type: () -> SchemaRegistryClient @@ -128,20 +126,7 @@ def register_schema( response = self._generated_client.send_request(request) response.raise_for_status() - schema_properties = _parse_response_schema_properties(response) - - schema_description = ( - group_name, - name, - content, - serialization_type, - ) - self._id_to_schema[schema_properties.id] = Schema( - content, schema_properties - ) - self._description_to_properties[schema_description] = schema_properties - - return schema_properties + return _parse_response_schema_properties(response) def get_schema(self, id, **kwargs): # pylint:disable=redefined-builtin # type: (str, Any) -> Schema @@ -162,15 +147,10 @@ def get_schema(self, id, **kwargs): # pylint:disable=redefined-builtin :caption: Get schema by id. """ - try: - return self._id_to_schema[id] - except KeyError: - request = schema_rest.build_get_by_id_request(schema_id=id) - response = self._generated_client.send_request(request, **kwargs) - response.raise_for_status() - schema = _parse_response_schema(response) - self._id_to_schema[id] = schema - return schema + request = schema_rest.build_get_by_id_request(schema_id=id) + response = self._generated_client.send_request(request, **kwargs) + response.raise_for_status() + return _parse_response_schema(response) def get_schema_properties( self, group_name, name, content, serialization_type, **kwargs @@ -204,30 +184,15 @@ def get_schema_properties( except AttributeError: pass - try: - properties = self._description_to_properties[ - (group_name, name, content, serialization_type) - ] - return properties - except KeyError: - request = schema_rest.build_query_id_by_content_request( - group_name=group_name, - schema_name=name, - content=content, - serialization_type=serialization_type, - content_type=kwargs.pop("content_type", "application/json"), - **kwargs - ) - - response = self._generated_client.send_request(request, **kwargs) - response.raise_for_status() - schema_properties = _parse_response_schema_properties(response) - - if not self._id_to_schema.get(schema_properties.id): - self._id_to_schema[schema_properties.id] = Schema(content, schema_properties) - else: - schema_properties = self._id_to_schema[schema_properties.id].properties - self._description_to_properties[ - (group_name, name, content, serialization_type) - ] = schema_properties - return schema_properties + request = schema_rest.build_query_id_by_content_request( + group_name=group_name, + schema_name=name, + content=content, + serialization_type=serialization_type, + content_type=kwargs.pop("content_type", "application/json"), + **kwargs + ) + + response = self._generated_client.send_request(request, **kwargs) + response.raise_for_status() + return _parse_response_schema_properties(response) diff --git a/sdk/schemaregistry/azure-schemaregistry/azure/schemaregistry/aio/_schema_registry_client_async.py b/sdk/schemaregistry/azure-schemaregistry/azure/schemaregistry/aio/_schema_registry_client_async.py index aa5531cc7a6a..f9de1bbc2d5f 100644 --- a/sdk/schemaregistry/azure-schemaregistry/azure/schemaregistry/aio/_schema_registry_client_async.py +++ b/sdk/schemaregistry/azure-schemaregistry/azure/schemaregistry/aio/_schema_registry_client_async.py @@ -65,8 +65,6 @@ def __init__( **kwargs: Any ) -> None: self._generated_client = AzureSchemaRegistry(credential, endpoint, **kwargs) - self._description_to_properties = {} - self._id_to_schema = {} async def __aenter__(self): await self._generated_client.__aenter__() @@ -128,20 +126,7 @@ async def register_schema( response = await self._generated_client.send_request(request) response.raise_for_status() - schema_properties = _parse_response_schema_properties(response) - - schema_description = ( - group_name, - name, - content, - serialization_type, - ) - self._id_to_schema[schema_properties.id] = Schema( - content, schema_properties - ) - self._description_to_properties[schema_description] = schema_properties - - return schema_properties + return _parse_response_schema_properties(response) async def get_schema( self, @@ -165,15 +150,10 @@ async def get_schema( :caption: Get schema by id. """ - try: - return self._id_to_schema[id] - except KeyError: - request = schema_rest.build_get_by_id_request(schema_id=id) - response = await self._generated_client.send_request(request, **kwargs) - response.raise_for_status() - schema = _parse_response_schema(response) - self._id_to_schema[id] = schema - return schema + request = schema_rest.build_get_by_id_request(schema_id=id) + response = await self._generated_client.send_request(request, **kwargs) + response.raise_for_status() + return _parse_response_schema(response) async def get_schema_properties( self, @@ -209,30 +189,15 @@ async def get_schema_properties( except AttributeError: pass - try: - properties = self._description_to_properties[ - (group_name, name, content, serialization_type) - ] - return properties - except KeyError: - request = schema_rest.build_query_id_by_content_request( - group_name=group_name, - schema_name=name, - content=content, - serialization_type=serialization_type, - content_type=kwargs.pop("content_type", "application/json"), - **kwargs - ) - - response = await self._generated_client.send_request(request, **kwargs) - response.raise_for_status() - schema_properties = _parse_response_schema_properties(response) - - if not self._id_to_schema.get(schema_properties.id): - self._id_to_schema[schema_properties.id] = Schema(content, schema_properties) - else: - schema_properties = self._id_to_schema[schema_properties.id].properties - self._description_to_properties[ - (group_name, name, content, serialization_type) - ] = schema_properties - return schema_properties + request = schema_rest.build_query_id_by_content_request( + group_name=group_name, + schema_name=name, + content=content, + serialization_type=serialization_type, + content_type=kwargs.pop("content_type", "application/json"), + **kwargs + ) + + response = await self._generated_client.send_request(request, **kwargs) + response.raise_for_status() + return _parse_response_schema_properties(response) diff --git a/sdk/schemaregistry/azure-schemaregistry/tests/async_tests/recordings/test_schema_registry_async.test_schema_basic_async.yaml b/sdk/schemaregistry/azure-schemaregistry/tests/async_tests/recordings/test_schema_registry_async.test_schema_basic_async.yaml index f9cf0fca7608..9b3e501481e5 100644 --- a/sdk/schemaregistry/azure-schemaregistry/tests/async_tests/recordings/test_schema_registry_async.test_schema_basic_async.yaml +++ b/sdk/schemaregistry/azure-schemaregistry/tests/async_tests/recordings/test_schema_registry_async.test_schema_basic_async.yaml @@ -16,13 +16,13 @@ interactions: uri: https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/test-schema-basic-asynce5e1482?api-version=2020-09-01-preview response: body: - string: '{"id":"c87ba6c2c15e4645b3665802159c6b37"}' + string: '{"id":"d919a8923e2446e69614c0220d967dd7"}' headers: content-type: application/json - date: Fri, 03 Sep 2021 21:37:45 GMT + date: Mon, 20 Sep 2021 20:08:28 GMT location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-basic-asynce5e1482/versions/1?api-version=2020-09-01-preview - schema-id: c87ba6c2c15e4645b3665802159c6b37 - schema-id-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/getschemabyid/c87ba6c2c15e4645b3665802159c6b37?api-version=2020-09-01-preview + schema-id: d919a8923e2446e69614c0220d967dd7 + schema-id-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/getschemabyid/d919a8923e2446e69614c0220d967dd7?api-version=2020-09-01-preview schema-version: '1' schema-versions-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/test-schema-basic-asynce5e1482/versions?api-version=2020-09-01-preview serialization-type: Avro @@ -33,6 +33,34 @@ interactions: code: 200 message: OK url: https://swathip-test-eventhubs.servicebus.windows.net/$schemagroups/swathip-test-schema/schemas/test-schema-basic-asynce5e1482?api-version=2020-09-01-preview +- request: + body: null + headers: + Accept: + - text/plain; charset=utf-8 + User-Agent: + - azsdk-python-azureschemaregistry/1.0.0b3 Python/3.9.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_resource.servicebus.windows.net/$schemagroups/getSchemaById/d919a8923e2446e69614c0220d967dd7?api-version=2020-09-01-preview + response: + body: + string: '{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}' + headers: + content-type: application/json + date: Mon, 20 Sep 2021 20:08:29 GMT + location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-basic-asynce5e1482/versions/1?api-version=2020-09-01-preview + schema-id: d919a8923e2446e69614c0220d967dd7 + schema-id-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/getschemabyid/d919a8923e2446e69614c0220d967dd7?api-version=2020-09-01-preview + schema-version: '1' + schema-versions-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/test-schema-basic-asynce5e1482/versions?api-version=2020-09-01-preview + serialization-type: Avro + server: Microsoft-HTTPAPI/2.0 + strict-transport-security: max-age=31536000 + transfer-encoding: chunked + status: + code: 200 + message: OK + url: https://swathip-test-eventhubs.servicebus.windows.net/$schemagroups/getSchemaById/d919a8923e2446e69614c0220d967dd7?api-version=2020-09-01-preview - request: body: '{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}' headers: @@ -50,13 +78,13 @@ interactions: uri: https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/test-schema-basic-asynce5e1482?api-version=2020-09-01-preview response: body: - string: '{"id":"c87ba6c2c15e4645b3665802159c6b37"}' + string: '{"id":"d919a8923e2446e69614c0220d967dd7"}' headers: content-type: application/json - date: Fri, 03 Sep 2021 21:37:45 GMT + date: Mon, 20 Sep 2021 20:08:30 GMT location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-basic-asynce5e1482/versions/1?api-version=2020-09-01-preview - schema-id: c87ba6c2c15e4645b3665802159c6b37 - schema-id-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/getschemabyid/c87ba6c2c15e4645b3665802159c6b37?api-version=2020-09-01-preview + schema-id: d919a8923e2446e69614c0220d967dd7 + schema-id-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/getschemabyid/d919a8923e2446e69614c0220d967dd7?api-version=2020-09-01-preview schema-version: '1' schema-versions-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/test-schema-basic-asynce5e1482/versions?api-version=2020-09-01-preview serialization-type: Avro diff --git a/sdk/schemaregistry/azure-schemaregistry/tests/async_tests/recordings/test_schema_registry_async.test_schema_negative_no_schema_async.yaml b/sdk/schemaregistry/azure-schemaregistry/tests/async_tests/recordings/test_schema_registry_async.test_schema_negative_no_schema_async.yaml index c190d43ab754..82908a211808 100644 --- a/sdk/schemaregistry/azure-schemaregistry/tests/async_tests/recordings/test_schema_registry_async.test_schema_negative_no_schema_async.yaml +++ b/sdk/schemaregistry/azure-schemaregistry/tests/async_tests/recordings/test_schema_registry_async.test_schema_negative_no_schema_async.yaml @@ -11,12 +11,12 @@ interactions: response: body: string: '{"Code":400,"Detail":"SubCode=40000, UnknownType:The request is invalid. - [MGResponseHttpError=BadRequest]. TrackingId:faf1cce9-f0c7-4dfb-bdcc-4410c3f74b30_G29, + [MGResponseHttpError=BadRequest]. TrackingId:4f653bc2-9ef4-4b83-8632-3aa321d9b8e5_G29, SystemTracker:swathip-test-eventhubs.servicebus.windows.net:$schemagroups\/getSchemaById\/a, - Timestamp:2021-09-03T21:37:47"}' + Timestamp:2021-09-20T20:08:31"}' headers: content-type: application/json - date: Fri, 03 Sep 2021 21:37:47 GMT + date: Mon, 20 Sep 2021 20:08:30 GMT server: Microsoft-HTTPAPI/2.0 strict-transport-security: max-age=31536000 transfer-encoding: chunked @@ -36,11 +36,11 @@ interactions: response: body: string: '{"Code":404,"Detail":"Schema id aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa does - not exist. TrackingId:520d7a70-c165-4edd-8855-046ff6be2f72_G29, SystemTracker:swathip-test-eventhubs.servicebus.windows.net:$schemagroups\/getSchemaById\/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, - Timestamp:2021-09-03T21:37:48"}' + not exist. TrackingId:79cdec74-b17a-4334-a0bd-0ceeb9253ca4_G29, SystemTracker:swathip-test-eventhubs.servicebus.windows.net:$schemagroups\/getSchemaById\/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, + Timestamp:2021-09-20T20:08:31"}' headers: content-type: application/json - date: Fri, 03 Sep 2021 21:37:47 GMT + date: Mon, 20 Sep 2021 20:08:31 GMT server: Microsoft-HTTPAPI/2.0 strict-transport-security: max-age=31536000 transfer-encoding: chunked diff --git a/sdk/schemaregistry/azure-schemaregistry/tests/async_tests/recordings/test_schema_registry_async.test_schema_same_twice_async.yaml b/sdk/schemaregistry/azure-schemaregistry/tests/async_tests/recordings/test_schema_registry_async.test_schema_same_twice_async.yaml index 25fe86bf5574..90e06c4f36d3 100644 --- a/sdk/schemaregistry/azure-schemaregistry/tests/async_tests/recordings/test_schema_registry_async.test_schema_same_twice_async.yaml +++ b/sdk/schemaregistry/azure-schemaregistry/tests/async_tests/recordings/test_schema_registry_async.test_schema_same_twice_async.yaml @@ -16,13 +16,13 @@ interactions: uri: https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/test-schema-twice-async7bfd16a1?api-version=2020-09-01-preview response: body: - string: '{"id":"99a89631052e4a22a9fca816cbd2761a"}' + string: '{"id":"d6fb6739c94a45328ee36d163a7ee4de"}' headers: content-type: application/json - date: Fri, 03 Sep 2021 21:37:54 GMT + date: Mon, 20 Sep 2021 20:08:37 GMT location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-twice-async7bfd16a1/versions/1?api-version=2020-09-01-preview - schema-id: 99a89631052e4a22a9fca816cbd2761a - schema-id-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/getschemabyid/99a89631052e4a22a9fca816cbd2761a?api-version=2020-09-01-preview + schema-id: d6fb6739c94a45328ee36d163a7ee4de + schema-id-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/getschemabyid/d6fb6739c94a45328ee36d163a7ee4de?api-version=2020-09-01-preview schema-version: '1' schema-versions-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/test-schema-twice-async7bfd16a1/versions?api-version=2020-09-01-preview serialization-type: Avro @@ -50,13 +50,13 @@ interactions: uri: https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/test-schema-twice-async7bfd16a1?api-version=2020-09-01-preview response: body: - string: '{"id":"99a89631052e4a22a9fca816cbd2761a"}' + string: '{"id":"d6fb6739c94a45328ee36d163a7ee4de"}' headers: content-type: application/json - date: Fri, 03 Sep 2021 21:37:55 GMT + date: Mon, 20 Sep 2021 20:08:38 GMT location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-twice-async7bfd16a1/versions/1?api-version=2020-09-01-preview - schema-id: 99a89631052e4a22a9fca816cbd2761a - schema-id-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/getschemabyid/99a89631052e4a22a9fca816cbd2761a?api-version=2020-09-01-preview + schema-id: d6fb6739c94a45328ee36d163a7ee4de + schema-id-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/getschemabyid/d6fb6739c94a45328ee36d163a7ee4de?api-version=2020-09-01-preview schema-version: '1' schema-versions-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/test-schema-twice-async7bfd16a1/versions?api-version=2020-09-01-preview serialization-type: Avro diff --git a/sdk/schemaregistry/azure-schemaregistry/tests/async_tests/recordings/test_schema_registry_async.test_schema_update_async.yaml b/sdk/schemaregistry/azure-schemaregistry/tests/async_tests/recordings/test_schema_registry_async.test_schema_update_async.yaml index e220c13d7e0b..f8d99055d4cc 100644 --- a/sdk/schemaregistry/azure-schemaregistry/tests/async_tests/recordings/test_schema_registry_async.test_schema_update_async.yaml +++ b/sdk/schemaregistry/azure-schemaregistry/tests/async_tests/recordings/test_schema_registry_async.test_schema_update_async.yaml @@ -16,14 +16,14 @@ interactions: uri: https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/test-schema-update-async24591503?api-version=2020-09-01-preview response: body: - string: '{"id":"ff159041473444f1a972100623c394fd"}' + string: '{"id":"9bc6877fc0a5427c9c1dd672d84ef8e4"}' headers: content-type: application/json - date: Fri, 03 Sep 2021 21:37:56 GMT - location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-update-async24591503/versions/3?api-version=2020-09-01-preview - schema-id: ff159041473444f1a972100623c394fd - schema-id-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/getschemabyid/ff159041473444f1a972100623c394fd?api-version=2020-09-01-preview - schema-version: '3' + date: Mon, 20 Sep 2021 20:08:39 GMT + location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-update-async24591503/versions/1?api-version=2020-09-01-preview + schema-id: 9bc6877fc0a5427c9c1dd672d84ef8e4 + schema-id-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/getschemabyid/9bc6877fc0a5427c9c1dd672d84ef8e4?api-version=2020-09-01-preview + schema-version: '1' schema-versions-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/test-schema-update-async24591503/versions?api-version=2020-09-01-preview serialization-type: Avro server: Microsoft-HTTPAPI/2.0 @@ -50,14 +50,14 @@ interactions: uri: https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/test-schema-update-async24591503?api-version=2020-09-01-preview response: body: - string: '{"id":"680ba41f9439473d9efb9b8c044635cc"}' + string: '{"id":"575bde2d54e74039b6a5166f07b580c2"}' headers: content-type: application/json - date: Fri, 03 Sep 2021 21:37:57 GMT - location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-update-async24591503/versions/4?api-version=2020-09-01-preview - schema-id: 680ba41f9439473d9efb9b8c044635cc - schema-id-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/getschemabyid/680ba41f9439473d9efb9b8c044635cc?api-version=2020-09-01-preview - schema-version: '4' + date: Mon, 20 Sep 2021 20:08:39 GMT + location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-update-async24591503/versions/2?api-version=2020-09-01-preview + schema-id: 575bde2d54e74039b6a5166f07b580c2 + schema-id-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/getschemabyid/575bde2d54e74039b6a5166f07b580c2?api-version=2020-09-01-preview + schema-version: '2' schema-versions-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/test-schema-update-async24591503/versions?api-version=2020-09-01-preview serialization-type: Avro server: Microsoft-HTTPAPI/2.0 @@ -75,17 +75,17 @@ interactions: User-Agent: - azsdk-python-azureschemaregistry/1.0.0b3 Python/3.9.0 (Windows-10-10.0.19041-SP0) method: GET - uri: https://fake_resource.servicebus.windows.net/$schemagroups/getSchemaById/680ba41f9439473d9efb9b8c044635cc?api-version=2020-09-01-preview + uri: https://fake_resource.servicebus.windows.net/$schemagroups/getSchemaById/575bde2d54e74039b6a5166f07b580c2?api-version=2020-09-01-preview response: body: string: '{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_food","type":["string","null"]}]}' headers: content-type: application/json - date: Fri, 03 Sep 2021 21:37:57 GMT - location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-update-async24591503/versions/4?api-version=2020-09-01-preview - schema-id: 680ba41f9439473d9efb9b8c044635cc - schema-id-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/getschemabyid/680ba41f9439473d9efb9b8c044635cc?api-version=2020-09-01-preview - schema-version: '4' + date: Mon, 20 Sep 2021 20:08:40 GMT + location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-update-async24591503/versions/2?api-version=2020-09-01-preview + schema-id: 575bde2d54e74039b6a5166f07b580c2 + schema-id-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/getschemabyid/575bde2d54e74039b6a5166f07b580c2?api-version=2020-09-01-preview + schema-version: '2' schema-versions-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/test-schema-update-async24591503/versions?api-version=2020-09-01-preview serialization-type: Avro server: Microsoft-HTTPAPI/2.0 @@ -94,67 +94,5 @@ interactions: status: code: 200 message: OK - url: https://swathip-test-eventhubs.servicebus.windows.net/$schemagroups/getSchemaById/680ba41f9439473d9efb9b8c044635cc?api-version=2020-09-01-preview -- request: - body: null - headers: - Accept: - - text/plain; charset=utf-8 - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0b3 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://fake_resource.servicebus.windows.net/$schemagroups/getSchemaById/680ba41f9439473d9efb9b8c044635cc?api-version=2020-09-01-preview - response: - body: - string: '{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_food","type":["string","null"]}]}' - headers: - content-type: application/json - date: Fri, 03 Sep 2021 21:37:57 GMT - location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-update-async24591503/versions/4?api-version=2020-09-01-preview - schema-id: 680ba41f9439473d9efb9b8c044635cc - schema-id-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/getschemabyid/680ba41f9439473d9efb9b8c044635cc?api-version=2020-09-01-preview - schema-version: '4' - schema-versions-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/test-schema-update-async24591503/versions?api-version=2020-09-01-preview - serialization-type: Avro - server: Microsoft-HTTPAPI/2.0 - strict-transport-security: max-age=31536000 - transfer-encoding: chunked - status: - code: 200 - message: OK - url: https://swathip-test-eventhubs.servicebus.windows.net/$schemagroups/getSchemaById/680ba41f9439473d9efb9b8c044635cc?api-version=2020-09-01-preview -- request: - body: '{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_food","type":["string","null"]}]}' - headers: - Accept: - - application/json - Content-Length: - - '200' - Content-Type: - - application/json - Serialization-Type: - - Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0b3 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: POST - uri: https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/test-schema-update-async24591503?api-version=2020-09-01-preview - response: - body: - string: '{"id":"680ba41f9439473d9efb9b8c044635cc"}' - headers: - content-type: application/json - date: Fri, 03 Sep 2021 21:37:58 GMT - location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-update-async24591503/versions/4?api-version=2020-09-01-preview - schema-id: 680ba41f9439473d9efb9b8c044635cc - schema-id-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/getschemabyid/680ba41f9439473d9efb9b8c044635cc?api-version=2020-09-01-preview - schema-version: '4' - schema-versions-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/test-schema-update-async24591503/versions?api-version=2020-09-01-preview - serialization-type: Avro - server: Microsoft-HTTPAPI/2.0 - strict-transport-security: max-age=31536000 - transfer-encoding: chunked - status: - code: 200 - message: OK - url: https://swathip-test-eventhubs.servicebus.windows.net/$schemagroups/swathip-test-schema/schemas/test-schema-update-async24591503?api-version=2020-09-01-preview + url: https://swathip-test-eventhubs.servicebus.windows.net/$schemagroups/getSchemaById/575bde2d54e74039b6a5166f07b580c2?api-version=2020-09-01-preview version: 1 diff --git a/sdk/schemaregistry/azure-schemaregistry/tests/async_tests/test_schema_registry_async.py b/sdk/schemaregistry/azure-schemaregistry/tests/async_tests/test_schema_registry_async.py index 093bb43e085e..e9a737ca043a 100644 --- a/sdk/schemaregistry/azure-schemaregistry/tests/async_tests/test_schema_registry_async.py +++ b/sdk/schemaregistry/azure-schemaregistry/tests/async_tests/test_schema_registry_async.py @@ -47,11 +47,7 @@ async def test_schema_basic_async(self, schemaregistry_endpoint, schemaregistry_ schema_name = self.get_resource_name('test-schema-basic-async') schema_str = """{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}""" serialization_type = "Avro" - assert len(client._id_to_schema) == 0 - assert len(client._description_to_properties) == 0 schema_properties = await client.register_schema(schemaregistry_group, schema_name, schema_str, serialization_type) - assert len(client._id_to_schema) == 1 - assert len(client._description_to_properties) == 1 assert schema_properties.id is not None assert schema_properties.location is not None @@ -66,28 +62,13 @@ async def test_schema_basic_async(self, schemaregistry_endpoint, schemaregistry_ assert returned_schema.properties.serialization_type == "Avro" assert returned_schema.content == schema_str - # check that same cached properties object is returned by get_schema_properties - cached_properties = await client.get_schema_properties(schemaregistry_group, schema_name, schema_str, serialization_type) - same_cached_properties = await client.get_schema_properties(schemaregistry_group, schema_name, schema_str, serialization_type) - assert same_cached_properties == cached_properties - - # check if schema is added to cache when it does not exist in the cache - cached_properties = client._description_to_properties[ - (schemaregistry_group, schema_name, schema_str, serialization_type) - ] - properties_cache_length = len(client._description_to_properties) - del client._description_to_properties[ - (schemaregistry_group, schema_name, schema_str, serialization_type) - ] - assert len(client._description_to_properties) == properties_cache_length - 1 - returned_schema_properties = await client.get_schema_properties(schemaregistry_group, schema_name, schema_str, serialization_type) - assert len(client._description_to_properties) == properties_cache_length assert returned_schema_properties.id == schema_properties.id assert returned_schema_properties.location is not None assert returned_schema_properties.version == 1 assert returned_schema_properties.serialization_type == "Avro" + await client._generated_client._config.credential.close() @SchemaRegistryPowerShellPreparer() @@ -112,19 +93,7 @@ async def test_schema_update_async(self, schemaregistry_endpoint, schemaregistry assert new_schema_properties.version == schema_properties.version + 1 assert new_schema_properties.serialization_type == "Avro" - # check that same cached schema object is returned by get_schema - cached_schema = await client.get_schema(id=new_schema_properties.id) - same_cached_schema = await client.get_schema(id=new_schema_properties.id) - assert same_cached_schema == cached_schema - - # check if schema is added to cache when it does not exist in the cache - cached_schema = client._id_to_schema[new_schema_properties.id] - schema_cache_length = len(client._id_to_schema) - del client._id_to_schema[new_schema_properties.id] - assert len(client._id_to_schema) == schema_cache_length - 1 - new_schema = await client.get_schema(id=new_schema_properties.id) - assert len(client._id_to_schema) == schema_cache_length assert new_schema.properties.id != schema_properties.id assert new_schema.properties.id == new_schema_properties.id @@ -133,12 +102,6 @@ async def test_schema_update_async(self, schemaregistry_endpoint, schemaregistry assert new_schema.properties.version == schema_properties.version + 1 assert new_schema.properties.serialization_type == "Avro" - # check that properties object is the same in caches - client._id_to_schema = {} - client._description_to_properties = {} - new_schema = await client.get_schema(id=new_schema_properties.id) - new_schema_properties = await client.get_schema_properties(schemaregistry_group, schema_name, schema_str_new, serialization_type) - assert new_schema.properties == new_schema_properties await client._generated_client._config.credential.close() @SchemaRegistryPowerShellPreparer() @@ -149,14 +112,8 @@ async def test_schema_same_twice_async(self, schemaregistry_endpoint, schemaregi serialization_type = "Avro" async with client: schema_properties = await client.register_schema(schemaregistry_group, schema_name, schema_str, serialization_type) - schema_cache_length = len(client._id_to_schema) - desc_cache_length = len(client._description_to_properties) schema_properties_second = await client.register_schema(schemaregistry_group, schema_name, schema_str, serialization_type) - schema_cache_second_length = len(client._id_to_schema) - desc_cache_second_length = len(client._description_to_properties) assert schema_properties.id == schema_properties_second.id - assert schema_cache_length == schema_cache_second_length - assert desc_cache_length == desc_cache_second_length await client._generated_client._config.credential.close() @SchemaRegistryPowerShellPreparer() diff --git a/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_schema_basic.yaml b/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_schema_basic.yaml index c49c7d65f97b..4c737cf75275 100644 --- a/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_schema_basic.yaml +++ b/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_schema_basic.yaml @@ -20,18 +20,60 @@ interactions: uri: https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/test-schema-basic31c70f88?api-version=2020-09-01-preview response: body: - string: '{"id":"4e0f965608ea4e92b166bc3ef266cada"}' + string: '{"id":"0469b7e356874374a31df6a027213625"}' headers: content-type: - application/json date: - - Fri, 03 Sep 2021 21:37:31 GMT + - Mon, 20 Sep 2021 20:08:15 GMT location: - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-basic31c70f88/versions/1?api-version=2020-09-01-preview schema-id: - - 4e0f965608ea4e92b166bc3ef266cada + - 0469b7e356874374a31df6a027213625 schema-id-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/getschemabyid/4e0f965608ea4e92b166bc3ef266cada?api-version=2020-09-01-preview + - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/getschemabyid/0469b7e356874374a31df6a027213625?api-version=2020-09-01-preview + schema-version: + - '1' + schema-versions-location: + - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/test-schema-basic31c70f88/versions?api-version=2020-09-01-preview + serialization-type: + - Avro + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000 + transfer-encoding: + - chunked + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - text/plain; charset=utf-8 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-azureschemaregistry/1.0.0b3 Python/3.9.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://fake_resource.servicebus.windows.net/$schemagroups/getSchemaById/0469b7e356874374a31df6a027213625?api-version=2020-09-01-preview + response: + body: + string: '{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}' + headers: + content-type: + - application/json + date: + - Mon, 20 Sep 2021 20:08:15 GMT + location: + - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-basic31c70f88/versions/1?api-version=2020-09-01-preview + schema-id: + - 0469b7e356874374a31df6a027213625 + schema-id-location: + - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/getschemabyid/0469b7e356874374a31df6a027213625?api-version=2020-09-01-preview schema-version: - '1' schema-versions-location: @@ -68,18 +110,18 @@ interactions: uri: https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/test-schema-basic31c70f88?api-version=2020-09-01-preview response: body: - string: '{"id":"4e0f965608ea4e92b166bc3ef266cada"}' + string: '{"id":"0469b7e356874374a31df6a027213625"}' headers: content-type: - application/json date: - - Fri, 03 Sep 2021 21:37:31 GMT + - Mon, 20 Sep 2021 20:08:16 GMT location: - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-basic31c70f88/versions/1?api-version=2020-09-01-preview schema-id: - - 4e0f965608ea4e92b166bc3ef266cada + - 0469b7e356874374a31df6a027213625 schema-id-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/getschemabyid/4e0f965608ea4e92b166bc3ef266cada?api-version=2020-09-01-preview + - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/getschemabyid/0469b7e356874374a31df6a027213625?api-version=2020-09-01-preview schema-version: - '1' schema-versions-location: diff --git a/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_schema_negative_no_schema.yaml b/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_schema_negative_no_schema.yaml index 0c94e9dcedfe..7e8724dc8084 100644 --- a/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_schema_negative_no_schema.yaml +++ b/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_schema_negative_no_schema.yaml @@ -15,14 +15,14 @@ interactions: response: body: string: '{"Code":400,"Detail":"SubCode=40000, UnknownType:The request is invalid. - [MGResponseHttpError=BadRequest]. TrackingId:a563e2f1-335c-4828-9b2f-da273d9ccd8c_G28, + [MGResponseHttpError=BadRequest]. TrackingId:0f167d85-f54f-4afe-aae9-949d2b894663_G28, SystemTracker:swathip-test-eventhubs.servicebus.windows.net:$schemagroups\/getSchemaById\/a, - Timestamp:2021-09-03T21:37:33"}' + Timestamp:2021-09-20T20:08:17"}' headers: content-type: - application/json date: - - Fri, 03 Sep 2021 21:37:32 GMT + - Mon, 20 Sep 2021 20:08:17 GMT server: - Microsoft-HTTPAPI/2.0 strict-transport-security: @@ -48,13 +48,13 @@ interactions: response: body: string: '{"Code":404,"Detail":"Schema id aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa does - not exist. TrackingId:68ff2f6e-e922-4c97-9673-4b96c50bd517_G28, SystemTracker:swathip-test-eventhubs.servicebus.windows.net:$schemagroups\/getSchemaById\/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, - Timestamp:2021-09-03T21:37:33"}' + not exist. TrackingId:8c8699e7-a6dc-437f-88fc-f6fddd2d64ef_G28, SystemTracker:swathip-test-eventhubs.servicebus.windows.net:$schemagroups\/getSchemaById\/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, + Timestamp:2021-09-20T20:08:17"}' headers: content-type: - application/json date: - - Fri, 03 Sep 2021 21:37:33 GMT + - Mon, 20 Sep 2021 20:08:17 GMT server: - Microsoft-HTTPAPI/2.0 strict-transport-security: diff --git a/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_schema_same_twice.yaml b/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_schema_same_twice.yaml index 1b38f3f9a0f5..6e445c1c3ea9 100644 --- a/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_schema_same_twice.yaml +++ b/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_schema_same_twice.yaml @@ -20,18 +20,18 @@ interactions: uri: https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/test-schema-twice863b11a7?api-version=2020-09-01-preview response: body: - string: '{"id":"d2fc67eed39142ddb6a93bb1c71a965d"}' + string: '{"id":"286ba485f55e4c06aac7f5c33d762000"}' headers: content-type: - application/json date: - - Fri, 03 Sep 2021 21:37:41 GMT + - Mon, 20 Sep 2021 20:08:24 GMT location: - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-twice863b11a7/versions/1?api-version=2020-09-01-preview schema-id: - - d2fc67eed39142ddb6a93bb1c71a965d + - 286ba485f55e4c06aac7f5c33d762000 schema-id-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/getschemabyid/d2fc67eed39142ddb6a93bb1c71a965d?api-version=2020-09-01-preview + - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/getschemabyid/286ba485f55e4c06aac7f5c33d762000?api-version=2020-09-01-preview schema-version: - '1' schema-versions-location: @@ -68,18 +68,18 @@ interactions: uri: https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/test-schema-twice863b11a7?api-version=2020-09-01-preview response: body: - string: '{"id":"d2fc67eed39142ddb6a93bb1c71a965d"}' + string: '{"id":"286ba485f55e4c06aac7f5c33d762000"}' headers: content-type: - application/json date: - - Fri, 03 Sep 2021 21:37:41 GMT + - Mon, 20 Sep 2021 20:08:25 GMT location: - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-twice863b11a7/versions/1?api-version=2020-09-01-preview schema-id: - - d2fc67eed39142ddb6a93bb1c71a965d + - 286ba485f55e4c06aac7f5c33d762000 schema-id-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/getschemabyid/d2fc67eed39142ddb6a93bb1c71a965d?api-version=2020-09-01-preview + - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/getschemabyid/286ba485f55e4c06aac7f5c33d762000?api-version=2020-09-01-preview schema-version: - '1' schema-versions-location: diff --git a/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_schema_update.yaml b/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_schema_update.yaml index 2d2c8798614a..f74ee88cd64b 100644 --- a/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_schema_update.yaml +++ b/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_schema_update.yaml @@ -20,20 +20,20 @@ interactions: uri: https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/test-schema-update423f1009?api-version=2020-09-01-preview response: body: - string: '{"id":"45dc034a90014105b91fab6d837f57f4"}' + string: '{"id":"320a8369b8454479bce5f9eb26dc3d5a"}' headers: content-type: - application/json date: - - Fri, 03 Sep 2021 21:37:42 GMT + - Mon, 20 Sep 2021 20:08:26 GMT location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-update423f1009/versions/3?api-version=2020-09-01-preview + - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-update423f1009/versions/1?api-version=2020-09-01-preview schema-id: - - 45dc034a90014105b91fab6d837f57f4 + - 320a8369b8454479bce5f9eb26dc3d5a schema-id-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/getschemabyid/45dc034a90014105b91fab6d837f57f4?api-version=2020-09-01-preview + - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/getschemabyid/320a8369b8454479bce5f9eb26dc3d5a?api-version=2020-09-01-preview schema-version: - - '3' + - '1' schema-versions-location: - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/test-schema-update423f1009/versions?api-version=2020-09-01-preview serialization-type: @@ -68,20 +68,20 @@ interactions: uri: https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/test-schema-update423f1009?api-version=2020-09-01-preview response: body: - string: '{"id":"d5f23b7f77434922bb8d503188609973"}' + string: '{"id":"003d87aaf24648aabf4255d7292f73e9"}' headers: content-type: - application/json date: - - Fri, 03 Sep 2021 21:37:43 GMT + - Mon, 20 Sep 2021 20:08:26 GMT location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-update423f1009/versions/4?api-version=2020-09-01-preview + - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-update423f1009/versions/2?api-version=2020-09-01-preview schema-id: - - d5f23b7f77434922bb8d503188609973 + - 003d87aaf24648aabf4255d7292f73e9 schema-id-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/getschemabyid/d5f23b7f77434922bb8d503188609973?api-version=2020-09-01-preview + - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/getschemabyid/003d87aaf24648aabf4255d7292f73e9?api-version=2020-09-01-preview schema-version: - - '4' + - '2' schema-versions-location: - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/test-schema-update423f1009/versions?api-version=2020-09-01-preview serialization-type: @@ -107,7 +107,7 @@ interactions: User-Agent: - azsdk-python-azureschemaregistry/1.0.0b3 Python/3.9.0 (Windows-10-10.0.19041-SP0) method: GET - uri: https://fake_resource.servicebus.windows.net/$schemagroups/getSchemaById/d5f23b7f77434922bb8d503188609973?api-version=2020-09-01-preview + uri: https://fake_resource.servicebus.windows.net/$schemagroups/getSchemaById/003d87aaf24648aabf4255d7292f73e9?api-version=2020-09-01-preview response: body: string: '{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_food","type":["string","null"]}]}' @@ -115,105 +115,15 @@ interactions: content-type: - application/json date: - - Fri, 03 Sep 2021 21:37:43 GMT + - Mon, 20 Sep 2021 20:08:27 GMT location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-update423f1009/versions/4?api-version=2020-09-01-preview + - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-update423f1009/versions/2?api-version=2020-09-01-preview schema-id: - - d5f23b7f77434922bb8d503188609973 + - 003d87aaf24648aabf4255d7292f73e9 schema-id-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/getschemabyid/d5f23b7f77434922bb8d503188609973?api-version=2020-09-01-preview + - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/getschemabyid/003d87aaf24648aabf4255d7292f73e9?api-version=2020-09-01-preview schema-version: - - '4' - schema-versions-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/test-schema-update423f1009/versions?api-version=2020-09-01-preview - serialization-type: - - Avro - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000 - transfer-encoding: - - chunked - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - text/plain; charset=utf-8 - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0b3 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://fake_resource.servicebus.windows.net/$schemagroups/getSchemaById/d5f23b7f77434922bb8d503188609973?api-version=2020-09-01-preview - response: - body: - string: '{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_food","type":["string","null"]}]}' - headers: - content-type: - - application/json - date: - - Fri, 03 Sep 2021 21:37:44 GMT - location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-update423f1009/versions/4?api-version=2020-09-01-preview - schema-id: - - d5f23b7f77434922bb8d503188609973 - schema-id-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/getschemabyid/d5f23b7f77434922bb8d503188609973?api-version=2020-09-01-preview - schema-version: - - '4' - schema-versions-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/test-schema-update423f1009/versions?api-version=2020-09-01-preview - serialization-type: - - Avro - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000 - transfer-encoding: - - chunked - status: - code: 200 - message: OK -- request: - body: '{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_food","type":["string","null"]}]}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '200' - Content-Type: - - application/json - Serialization-Type: - - Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0b3 Python/3.9.0 (Windows-10-10.0.19041-SP0) - method: POST - uri: https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/test-schema-update423f1009?api-version=2020-09-01-preview - response: - body: - string: '{"id":"d5f23b7f77434922bb8d503188609973"}' - headers: - content-type: - - application/json - date: - - Fri, 03 Sep 2021 21:37:44 GMT - location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-update423f1009/versions/4?api-version=2020-09-01-preview - schema-id: - - d5f23b7f77434922bb8d503188609973 - schema-id-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/getschemabyid/d5f23b7f77434922bb8d503188609973?api-version=2020-09-01-preview - schema-version: - - '4' + - '2' schema-versions-location: - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/test-schema-update423f1009/versions?api-version=2020-09-01-preview serialization-type: diff --git a/sdk/schemaregistry/azure-schemaregistry/tests/test_schema_registry.py b/sdk/schemaregistry/azure-schemaregistry/tests/test_schema_registry.py index 4966f5713feb..9e9c4692e97b 100644 --- a/sdk/schemaregistry/azure-schemaregistry/tests/test_schema_registry.py +++ b/sdk/schemaregistry/azure-schemaregistry/tests/test_schema_registry.py @@ -42,11 +42,7 @@ def test_schema_basic(self, schemaregistry_endpoint, schemaregistry_group, **kwa schema_name = self.get_resource_name('test-schema-basic') schema_str = """{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}""" serialization_type = "Avro" - assert len(client._id_to_schema) == 0 - assert len(client._description_to_properties) == 0 schema_properties = client.register_schema(schemaregistry_group, schema_name, schema_str, serialization_type) - assert len(client._id_to_schema) == 1 - assert len(client._description_to_properties) == 1 assert schema_properties.id is not None assert schema_properties.location is not None @@ -61,22 +57,7 @@ def test_schema_basic(self, schemaregistry_endpoint, schemaregistry_group, **kwa assert returned_schema.properties.serialization_type == "Avro" assert returned_schema.content == schema_str - # check that same cached properties object is returned by get_schema_properties - cached_properties = client.get_schema_properties(schemaregistry_group, schema_name, schema_str, serialization_type) - assert client.get_schema_properties(schemaregistry_group, schema_name, schema_str, serialization_type) == cached_properties - - # check if schema is added to cache when it does not exist in the cache - cached_properties = client._description_to_properties[ - (schemaregistry_group, schema_name, schema_str, serialization_type) - ] - properties_cache_length = len(client._description_to_properties) - del client._description_to_properties[ - (schemaregistry_group, schema_name, schema_str, serialization_type) - ] - assert len(client._description_to_properties) == properties_cache_length - 1 - returned_schema_properties = client.get_schema_properties(schemaregistry_group, schema_name, schema_str, serialization_type) - assert len(client._description_to_properties) == properties_cache_length assert returned_schema_properties.id == schema_properties.id assert returned_schema_properties.location is not None @@ -104,19 +85,7 @@ def test_schema_update(self, schemaregistry_endpoint, schemaregistry_group, **kw assert new_schema_properties.version == schema_properties.version + 1 assert new_schema_properties.serialization_type == "Avro" - # check that same cached schema object is returned by get_schema - cached_schema = client.get_schema(id=new_schema_properties.id) - assert client.get_schema(id=new_schema_properties.id) == cached_schema - - # check if schema is added to cache when it does not exist in the cache - cached_schema = client._id_to_schema[new_schema_properties.id] - schema_cache_length = len(client._id_to_schema) - del client._id_to_schema[new_schema_properties.id] - assert len(client._id_to_schema) == schema_cache_length - 1 - new_schema = client.get_schema(id=new_schema_properties.id) - assert len(client._id_to_schema) == schema_cache_length - assert cached_schema != new_schema # assert not same object after deletion from cache assert new_schema.properties.id != schema_properties.id assert new_schema.properties.id == new_schema_properties.id @@ -125,13 +94,6 @@ def test_schema_update(self, schemaregistry_endpoint, schemaregistry_group, **kw assert new_schema.properties.version == schema_properties.version + 1 assert new_schema.properties.serialization_type == "Avro" - # check that properties object is the same in caches - client._id_to_schema = {} - client._description_to_properties = {} - new_schema = client.get_schema(id=new_schema_properties.id) - new_schema_properties = client.get_schema_properties(schemaregistry_group, schema_name, schema_str_new, serialization_type) - assert new_schema.properties == new_schema_properties - @SchemaRegistryPowerShellPreparer() def test_schema_same_twice(self, schemaregistry_endpoint, schemaregistry_group, **kwargs): client = self.create_client(schemaregistry_endpoint) @@ -139,14 +101,8 @@ def test_schema_same_twice(self, schemaregistry_endpoint, schemaregistry_group, schema_str = """{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"age","type":["int","null"]},{"name":"city","type":["string","null"]}]}""" serialization_type = "Avro" schema_properties = client.register_schema(schemaregistry_group, schema_name, schema_str, serialization_type) - schema_cache_length = len(client._id_to_schema) - desc_cache_length = len(client._description_to_properties) schema_properties_second = client.register_schema(schemaregistry_group, schema_name, schema_str, serialization_type) - schema_cache_second_length = len(client._id_to_schema) - desc_cache_second_length = len(client._description_to_properties) assert schema_properties.id == schema_properties_second.id - assert schema_cache_length == schema_cache_second_length - assert desc_cache_length == desc_cache_second_length @SchemaRegistryPowerShellPreparer() def test_schema_negative_wrong_credential(self, schemaregistry_endpoint, schemaregistry_group, **kwargs): From 518af90b2a266d5fcd2cade51c5b8058a820e8d1 Mon Sep 17 00:00:00 2001 From: Azure CLI Bot Date: Wed, 22 Sep 2021 09:31:05 +0800 Subject: [PATCH 82/85] [AutoRelease] t2-containerinstance-2021-09-17-04542 (#20733) * CodeGen from PR 15721 in Azure/azure-rest-api-specs [Hub Generated] Review request for Microsoft.ContainerInstance to add version stable/2021-07-01 (#15721) * Adds base for updating Microsoft.ContainerInstance from version stable/2021-03-01 to version 2021-07-01 * Updates readme * Updates API version in new specs and examples * Adding subnet IDs * Adding fixes from pending 03-01 update * Changing definition name to match convention * Adding network dependencies API * Adding MSI+ACR properties * Removing network profile * Updating example * Fixing JSON error * Removing network profile reference * Adding Integer format where missing * Removing comma * Fixing example * Fixing example * Ran Prettier to resolve check failure * Running prettier again for format * version,CHANGELOG * test Co-authored-by: SDKAuto Co-authored-by: PythonSdkPipelines --- .../azure-mgmt-containerinstance/CHANGELOG.md | 13 + .../azure-mgmt-containerinstance/_meta.json | 2 +- .../mgmt/containerinstance/_configuration.py | 2 +- .../mgmt/containerinstance/_metadata.json | 4 +- .../azure/mgmt/containerinstance/_version.py | 2 +- .../containerinstance/aio/_configuration.py | 2 +- .../_container_groups_operations.py | 81 +- .../aio/operations/_containers_operations.py | 8 +- .../aio/operations/_location_operations.py | 6 +- .../aio/operations/_operations.py | 2 +- .../mgmt/containerinstance/models/__init__.py | 12 +- .../mgmt/containerinstance/models/_models.py | 80 +- .../containerinstance/models/_models_py3.py | 93 +- .../_container_groups_operations.py | 82 +- .../operations/_containers_operations.py | 8 +- .../operations/_location_operations.py | 6 +- .../operations/_operations.py | 2 +- ...tainerinstance.test_containerinstance.yaml | 1320 ----------------- 18 files changed, 284 insertions(+), 1441 deletions(-) delete mode 100644 sdk/containerinstance/azure-mgmt-containerinstance/tests/recordings/test_cli_mgmt_containerinstance.test_containerinstance.yaml diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/CHANGELOG.md b/sdk/containerinstance/azure-mgmt-containerinstance/CHANGELOG.md index 1d1d027c7637..25260ed5793d 100644 --- a/sdk/containerinstance/azure-mgmt-containerinstance/CHANGELOG.md +++ b/sdk/containerinstance/azure-mgmt-containerinstance/CHANGELOG.md @@ -1,5 +1,18 @@ # Release History +## 9.0.0 (2021-09-17) + +**Features** + + - Model ImageRegistryCredential has a new parameter identity_url + - Model ImageRegistryCredential has a new parameter identity + - Model ContainerGroup has a new parameter subnet_ids + - Added operation ContainerGroupsOperations.get_outbound_network_dependencies_endpoints + +**Breaking changes** + + - Model ContainerGroup no longer has parameter network_profile + ## 8.0.0 (2021-07-20) **Features** diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/_meta.json b/sdk/containerinstance/azure-mgmt-containerinstance/_meta.json index 9cc101495ebc..10c77b5f687f 100644 --- a/sdk/containerinstance/azure-mgmt-containerinstance/_meta.json +++ b/sdk/containerinstance/azure-mgmt-containerinstance/_meta.json @@ -4,7 +4,7 @@ "@autorest/python@5.8.4", "@autorest/modelerfour@4.19.2" ], - "commit": "09d35de8dd3318687eee441d7ddc54a33bf1a9fa", + "commit": "6c02b97dd0d7c5fab35a83cc89dbe369bb583b0c", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest_command": "autorest specification/containerinstance/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.4 --use=@autorest/modelerfour@4.19.2 --version=3.4.5", "readme": "specification/containerinstance/resource-manager/readme.md" diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/_configuration.py b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/_configuration.py index c642e925cf62..119f1c01be53 100644 --- a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/_configuration.py +++ b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/_configuration.py @@ -48,7 +48,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.api_version = "2021-03-01" + self.api_version = "2021-07-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-containerinstance/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/_metadata.json b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/_metadata.json index 9cdc3dc38bbd..7e8dd90914de 100644 --- a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/_metadata.json +++ b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/_metadata.json @@ -1,6 +1,6 @@ { - "chosen_version": "2021-03-01", - "total_api_version_list": ["2021-03-01"], + "chosen_version": "2021-07-01", + "total_api_version_list": ["2021-07-01"], "client": { "name": "ContainerInstanceManagementClient", "filename": "_container_instance_management_client", diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/_version.py b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/_version.py index 142a0420b39b..b77ac9246082 100644 --- a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/_version.py +++ b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "8.0.0" +VERSION = "9.0.0" diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/_configuration.py b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/_configuration.py index c7ca7065d7fc..7bfbcf375d98 100644 --- a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/_configuration.py +++ b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/_configuration.py @@ -45,7 +45,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.api_version = "2021-03-01" + self.api_version = "2021-07-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-containerinstance/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_container_groups_operations.py b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_container_groups_operations.py index 7916c2e1c15f..ba41f3486682 100644 --- a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_container_groups_operations.py +++ b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_container_groups_operations.py @@ -5,7 +5,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import Any, AsyncIterable, Callable, Dict, Generic, List, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -63,7 +63,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" accept = "application/json" def prepare_request(next_link=None): @@ -136,7 +136,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" accept = "application/json" def prepare_request(next_link=None): @@ -213,7 +213,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" accept = "application/json" # Construct URL @@ -261,7 +261,7 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -406,7 +406,7 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -458,7 +458,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" accept = "application/json" # Construct URL @@ -577,7 +577,7 @@ async def _restart_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" accept = "application/json" # Construct URL @@ -702,7 +702,7 @@ async def stop( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" accept = "application/json" # Construct URL @@ -746,7 +746,7 @@ async def _start_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" accept = "application/json" # Construct URL @@ -845,3 +845,64 @@ def get_long_running_output(pipeline_response): else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/start'} # type: ignore + + async def get_outbound_network_dependencies_endpoints( + self, + resource_group_name: str, + container_group_name: str, + **kwargs: Any + ) -> List[str]: + """Get all network dependencies for container group. + + Gets all the network dependencies for this container group to allow complete control of network + setting and configuration. For container groups, this will always be an empty list. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param container_group_name: The name of the container group. + :type container_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of str, or the result of cls(response) + :rtype: list[str] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[str]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self.get_outbound_network_dependencies_endpoints.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'containerGroupName': self._serialize.url("container_group_name", container_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[str]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_outbound_network_dependencies_endpoints.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/outboundNetworkDependenciesEndpoints'} # type: ignore diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_containers_operations.py b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_containers_operations.py index ab2659ece42d..a8bb63a815a1 100644 --- a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_containers_operations.py +++ b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_containers_operations.py @@ -76,7 +76,7 @@ async def list_logs( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" accept = "application/json" # Construct URL @@ -148,7 +148,7 @@ async def execute_command( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -218,7 +218,7 @@ async def attach( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" accept = "application/json" # Construct URL @@ -253,4 +253,4 @@ async def attach( return cls(pipeline_response, deserialized, {}) return deserialized - attach.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/attach'} # type: ignore + attach.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/attach'} # type: ignore diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_location_operations.py b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_location_operations.py index 38498aa5991b..cc910a26b4ae 100644 --- a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_location_operations.py +++ b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_location_operations.py @@ -60,7 +60,7 @@ def list_usage( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" accept = "application/json" def prepare_request(next_link=None): @@ -132,7 +132,7 @@ def list_cached_images( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" accept = "application/json" def prepare_request(next_link=None): @@ -204,7 +204,7 @@ def list_capabilities( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_operations.py b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_operations.py index f626eefc3e2b..6d3da620a489 100644 --- a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_operations.py +++ b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/aio/operations/_operations.py @@ -57,7 +57,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/__init__.py b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/__init__.py index 3b15358fd76b..557f8bf362dd 100644 --- a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/__init__.py +++ b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/__init__.py @@ -25,8 +25,8 @@ from ._models_py3 import ContainerGroupDiagnostics from ._models_py3 import ContainerGroupIdentity from ._models_py3 import ContainerGroupListResult - from ._models_py3 import ContainerGroupNetworkProfile from ._models_py3 import ContainerGroupPropertiesInstanceView + from ._models_py3 import ContainerGroupSubnetId from ._models_py3 import ContainerHttpGet from ._models_py3 import ContainerPort from ._models_py3 import ContainerProbe @@ -38,7 +38,7 @@ from ._models_py3 import Event from ._models_py3 import GitRepoVolume from ._models_py3 import GpuResource - from ._models_py3 import HttpHeaders + from ._models_py3 import HttpHeader from ._models_py3 import ImageRegistryCredential from ._models_py3 import InitContainerDefinition from ._models_py3 import InitContainerPropertiesDefinitionInstanceView @@ -77,8 +77,8 @@ from ._models import ContainerGroupDiagnostics # type: ignore from ._models import ContainerGroupIdentity # type: ignore from ._models import ContainerGroupListResult # type: ignore - from ._models import ContainerGroupNetworkProfile # type: ignore from ._models import ContainerGroupPropertiesInstanceView # type: ignore + from ._models import ContainerGroupSubnetId # type: ignore from ._models import ContainerHttpGet # type: ignore from ._models import ContainerPort # type: ignore from ._models import ContainerProbe # type: ignore @@ -90,7 +90,7 @@ from ._models import Event # type: ignore from ._models import GitRepoVolume # type: ignore from ._models import GpuResource # type: ignore - from ._models import HttpHeaders # type: ignore + from ._models import HttpHeader # type: ignore from ._models import ImageRegistryCredential # type: ignore from ._models import InitContainerDefinition # type: ignore from ._models import InitContainerPropertiesDefinitionInstanceView # type: ignore @@ -144,8 +144,8 @@ 'ContainerGroupDiagnostics', 'ContainerGroupIdentity', 'ContainerGroupListResult', - 'ContainerGroupNetworkProfile', 'ContainerGroupPropertiesInstanceView', + 'ContainerGroupSubnetId', 'ContainerHttpGet', 'ContainerPort', 'ContainerProbe', @@ -157,7 +157,7 @@ 'Event', 'GitRepoVolume', 'GpuResource', - 'HttpHeaders', + 'HttpHeader', 'ImageRegistryCredential', 'InitContainerDefinition', 'InitContainerPropertiesDefinitionInstanceView', diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/_models.py b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/_models.py index eea10ab2cfb1..3d7bbab29430 100644 --- a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/_models.py +++ b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/_models.py @@ -542,8 +542,8 @@ class ContainerGroup(Resource): ~azure.mgmt.containerinstance.models.ContainerGroupPropertiesInstanceView :param diagnostics: The diagnostic information for a container group. :type diagnostics: ~azure.mgmt.containerinstance.models.ContainerGroupDiagnostics - :param network_profile: The network profile information for a container group. - :type network_profile: ~azure.mgmt.containerinstance.models.ContainerGroupNetworkProfile + :param subnet_ids: The subnet resource IDs for a container group. + :type subnet_ids: list[~azure.mgmt.containerinstance.models.ContainerGroupSubnetId] :param dns_config: The DNS config information for a container group. :type dns_config: ~azure.mgmt.containerinstance.models.DnsConfiguration :param sku: The SKU for a container group. Possible values include: "Standard", "Dedicated". @@ -580,7 +580,7 @@ class ContainerGroup(Resource): 'volumes': {'key': 'properties.volumes', 'type': '[Volume]'}, 'instance_view': {'key': 'properties.instanceView', 'type': 'ContainerGroupPropertiesInstanceView'}, 'diagnostics': {'key': 'properties.diagnostics', 'type': 'ContainerGroupDiagnostics'}, - 'network_profile': {'key': 'properties.networkProfile', 'type': 'ContainerGroupNetworkProfile'}, + 'subnet_ids': {'key': 'properties.subnetIds', 'type': '[ContainerGroupSubnetId]'}, 'dns_config': {'key': 'properties.dnsConfig', 'type': 'DnsConfiguration'}, 'sku': {'key': 'properties.sku', 'type': 'str'}, 'encryption_properties': {'key': 'properties.encryptionProperties', 'type': 'EncryptionProperties'}, @@ -602,7 +602,7 @@ def __init__( self.volumes = kwargs.get('volumes', None) self.instance_view = None self.diagnostics = kwargs.get('diagnostics', None) - self.network_profile = kwargs.get('network_profile', None) + self.subnet_ids = kwargs.get('subnet_ids', None) self.dns_config = kwargs.get('dns_config', None) self.sku = kwargs.get('sku', None) self.encryption_properties = kwargs.get('encryption_properties', None) @@ -697,59 +697,63 @@ def __init__( self.next_link = kwargs.get('next_link', None) -class ContainerGroupNetworkProfile(msrest.serialization.Model): - """Container group network profile information. +class ContainerGroupPropertiesInstanceView(msrest.serialization.Model): + """The instance view of the container group. Only valid in response. - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when sending a request. - :param id: Required. The identifier for a network profile. - :type id: str + :ivar events: The events of this container group. + :vartype events: list[~azure.mgmt.containerinstance.models.Event] + :ivar state: The state of the container group. Only valid in response. + :vartype state: str """ _validation = { - 'id': {'required': True}, + 'events': {'readonly': True}, + 'state': {'readonly': True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, + 'events': {'key': 'events', 'type': '[Event]'}, + 'state': {'key': 'state', 'type': 'str'}, } def __init__( self, **kwargs ): - super(ContainerGroupNetworkProfile, self).__init__(**kwargs) - self.id = kwargs['id'] + super(ContainerGroupPropertiesInstanceView, self).__init__(**kwargs) + self.events = None + self.state = None -class ContainerGroupPropertiesInstanceView(msrest.serialization.Model): - """The instance view of the container group. Only valid in response. +class ContainerGroupSubnetId(msrest.serialization.Model): + """Container group subnet information. - Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. - :ivar events: The events of this container group. - :vartype events: list[~azure.mgmt.containerinstance.models.Event] - :ivar state: The state of the container group. Only valid in response. - :vartype state: str + :param id: Required. Resource ID of virtual network and subnet. + :type id: str + :param name: Friendly name for the subnet. + :type name: str """ _validation = { - 'events': {'readonly': True}, - 'state': {'readonly': True}, + 'id': {'required': True}, } _attribute_map = { - 'events': {'key': 'events', 'type': '[Event]'}, - 'state': {'key': 'state', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, } def __init__( self, **kwargs ): - super(ContainerGroupPropertiesInstanceView, self).__init__(**kwargs) - self.events = None - self.state = None + super(ContainerGroupSubnetId, self).__init__(**kwargs) + self.id = kwargs['id'] + self.name = kwargs.get('name', None) class ContainerHttpGet(msrest.serialization.Model): @@ -764,7 +768,7 @@ class ContainerHttpGet(msrest.serialization.Model): :param scheme: The scheme. Possible values include: "http", "https". :type scheme: str or ~azure.mgmt.containerinstance.models.Scheme :param http_headers: The HTTP headers. - :type http_headers: ~azure.mgmt.containerinstance.models.HttpHeaders + :type http_headers: list[~azure.mgmt.containerinstance.models.HttpHeader] """ _validation = { @@ -775,7 +779,7 @@ class ContainerHttpGet(msrest.serialization.Model): 'path': {'key': 'path', 'type': 'str'}, 'port': {'key': 'port', 'type': 'int'}, 'scheme': {'key': 'scheme', 'type': 'str'}, - 'http_headers': {'key': 'httpHeaders', 'type': 'HttpHeaders'}, + 'http_headers': {'key': 'httpHeaders', 'type': '[HttpHeader]'}, } def __init__( @@ -1164,8 +1168,8 @@ def __init__( self.sku = kwargs['sku'] -class HttpHeaders(msrest.serialization.Model): - """The HTTP headers. +class HttpHeader(msrest.serialization.Model): + """The HTTP header. :param name: The header name. :type name: str @@ -1182,7 +1186,7 @@ def __init__( self, **kwargs ): - super(HttpHeaders, self).__init__(**kwargs) + super(HttpHeader, self).__init__(**kwargs) self.name = kwargs.get('name', None) self.value = kwargs.get('value', None) @@ -1199,6 +1203,10 @@ class ImageRegistryCredential(msrest.serialization.Model): :type username: str :param password: The password for the private registry. :type password: str + :param identity: The identity for the private registry. + :type identity: str + :param identity_url: The identity URL for the private registry. + :type identity_url: str """ _validation = { @@ -1210,6 +1218,8 @@ class ImageRegistryCredential(msrest.serialization.Model): 'server': {'key': 'server', 'type': 'str'}, 'username': {'key': 'username', 'type': 'str'}, 'password': {'key': 'password', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'str'}, + 'identity_url': {'key': 'identityUrl', 'type': 'str'}, } def __init__( @@ -1220,6 +1230,8 @@ def __init__( self.server = kwargs['server'] self.username = kwargs['username'] self.password = kwargs.get('password', None) + self.identity = kwargs.get('identity', None) + self.identity_url = kwargs.get('identity_url', None) class InitContainerDefinition(msrest.serialization.Model): @@ -1372,7 +1384,7 @@ class LogAnalytics(msrest.serialization.Model): :param metadata: Metadata for log analytics. :type metadata: dict[str, str] :param workspace_resource_id: The workspace resource id for log analytics. - :type workspace_resource_id: dict[str, str] + :type workspace_resource_id: str """ _validation = { @@ -1385,7 +1397,7 @@ class LogAnalytics(msrest.serialization.Model): 'workspace_key': {'key': 'workspaceKey', 'type': 'str'}, 'log_type': {'key': 'logType', 'type': 'str'}, 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'workspace_resource_id': {'key': 'workspaceResourceId', 'type': '{str}'}, + 'workspace_resource_id': {'key': 'workspaceResourceId', 'type': 'str'}, } def __init__( diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/_models_py3.py b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/_models_py3.py index e8d132d5eba6..50b966093726 100644 --- a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/_models_py3.py +++ b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/models/_models_py3.py @@ -592,8 +592,8 @@ class ContainerGroup(Resource): ~azure.mgmt.containerinstance.models.ContainerGroupPropertiesInstanceView :param diagnostics: The diagnostic information for a container group. :type diagnostics: ~azure.mgmt.containerinstance.models.ContainerGroupDiagnostics - :param network_profile: The network profile information for a container group. - :type network_profile: ~azure.mgmt.containerinstance.models.ContainerGroupNetworkProfile + :param subnet_ids: The subnet resource IDs for a container group. + :type subnet_ids: list[~azure.mgmt.containerinstance.models.ContainerGroupSubnetId] :param dns_config: The DNS config information for a container group. :type dns_config: ~azure.mgmt.containerinstance.models.DnsConfiguration :param sku: The SKU for a container group. Possible values include: "Standard", "Dedicated". @@ -630,7 +630,7 @@ class ContainerGroup(Resource): 'volumes': {'key': 'properties.volumes', 'type': '[Volume]'}, 'instance_view': {'key': 'properties.instanceView', 'type': 'ContainerGroupPropertiesInstanceView'}, 'diagnostics': {'key': 'properties.diagnostics', 'type': 'ContainerGroupDiagnostics'}, - 'network_profile': {'key': 'properties.networkProfile', 'type': 'ContainerGroupNetworkProfile'}, + 'subnet_ids': {'key': 'properties.subnetIds', 'type': '[ContainerGroupSubnetId]'}, 'dns_config': {'key': 'properties.dnsConfig', 'type': 'DnsConfiguration'}, 'sku': {'key': 'properties.sku', 'type': 'str'}, 'encryption_properties': {'key': 'properties.encryptionProperties', 'type': 'EncryptionProperties'}, @@ -650,7 +650,7 @@ def __init__( ip_address: Optional["IpAddress"] = None, volumes: Optional[List["Volume"]] = None, diagnostics: Optional["ContainerGroupDiagnostics"] = None, - network_profile: Optional["ContainerGroupNetworkProfile"] = None, + subnet_ids: Optional[List["ContainerGroupSubnetId"]] = None, dns_config: Optional["DnsConfiguration"] = None, sku: Optional[Union[str, "ContainerGroupSku"]] = None, encryption_properties: Optional["EncryptionProperties"] = None, @@ -668,7 +668,7 @@ def __init__( self.volumes = volumes self.instance_view = None self.diagnostics = diagnostics - self.network_profile = network_profile + self.subnet_ids = subnet_ids self.dns_config = dns_config self.sku = sku self.encryption_properties = encryption_properties @@ -771,61 +771,66 @@ def __init__( self.next_link = next_link -class ContainerGroupNetworkProfile(msrest.serialization.Model): - """Container group network profile information. +class ContainerGroupPropertiesInstanceView(msrest.serialization.Model): + """The instance view of the container group. Only valid in response. - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when sending a request. - :param id: Required. The identifier for a network profile. - :type id: str + :ivar events: The events of this container group. + :vartype events: list[~azure.mgmt.containerinstance.models.Event] + :ivar state: The state of the container group. Only valid in response. + :vartype state: str """ _validation = { - 'id': {'required': True}, + 'events': {'readonly': True}, + 'state': {'readonly': True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, + 'events': {'key': 'events', 'type': '[Event]'}, + 'state': {'key': 'state', 'type': 'str'}, } def __init__( self, - *, - id: str, **kwargs ): - super(ContainerGroupNetworkProfile, self).__init__(**kwargs) - self.id = id + super(ContainerGroupPropertiesInstanceView, self).__init__(**kwargs) + self.events = None + self.state = None -class ContainerGroupPropertiesInstanceView(msrest.serialization.Model): - """The instance view of the container group. Only valid in response. +class ContainerGroupSubnetId(msrest.serialization.Model): + """Container group subnet information. - Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. - :ivar events: The events of this container group. - :vartype events: list[~azure.mgmt.containerinstance.models.Event] - :ivar state: The state of the container group. Only valid in response. - :vartype state: str + :param id: Required. Resource ID of virtual network and subnet. + :type id: str + :param name: Friendly name for the subnet. + :type name: str """ _validation = { - 'events': {'readonly': True}, - 'state': {'readonly': True}, + 'id': {'required': True}, } _attribute_map = { - 'events': {'key': 'events', 'type': '[Event]'}, - 'state': {'key': 'state', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, } def __init__( self, + *, + id: str, + name: Optional[str] = None, **kwargs ): - super(ContainerGroupPropertiesInstanceView, self).__init__(**kwargs) - self.events = None - self.state = None + super(ContainerGroupSubnetId, self).__init__(**kwargs) + self.id = id + self.name = name class ContainerHttpGet(msrest.serialization.Model): @@ -840,7 +845,7 @@ class ContainerHttpGet(msrest.serialization.Model): :param scheme: The scheme. Possible values include: "http", "https". :type scheme: str or ~azure.mgmt.containerinstance.models.Scheme :param http_headers: The HTTP headers. - :type http_headers: ~azure.mgmt.containerinstance.models.HttpHeaders + :type http_headers: list[~azure.mgmt.containerinstance.models.HttpHeader] """ _validation = { @@ -851,7 +856,7 @@ class ContainerHttpGet(msrest.serialization.Model): 'path': {'key': 'path', 'type': 'str'}, 'port': {'key': 'port', 'type': 'int'}, 'scheme': {'key': 'scheme', 'type': 'str'}, - 'http_headers': {'key': 'httpHeaders', 'type': 'HttpHeaders'}, + 'http_headers': {'key': 'httpHeaders', 'type': '[HttpHeader]'}, } def __init__( @@ -860,7 +865,7 @@ def __init__( port: int, path: Optional[str] = None, scheme: Optional[Union[str, "Scheme"]] = None, - http_headers: Optional["HttpHeaders"] = None, + http_headers: Optional[List["HttpHeader"]] = None, **kwargs ): super(ContainerHttpGet, self).__init__(**kwargs) @@ -1275,8 +1280,8 @@ def __init__( self.sku = sku -class HttpHeaders(msrest.serialization.Model): - """The HTTP headers. +class HttpHeader(msrest.serialization.Model): + """The HTTP header. :param name: The header name. :type name: str @@ -1296,7 +1301,7 @@ def __init__( value: Optional[str] = None, **kwargs ): - super(HttpHeaders, self).__init__(**kwargs) + super(HttpHeader, self).__init__(**kwargs) self.name = name self.value = value @@ -1313,6 +1318,10 @@ class ImageRegistryCredential(msrest.serialization.Model): :type username: str :param password: The password for the private registry. :type password: str + :param identity: The identity for the private registry. + :type identity: str + :param identity_url: The identity URL for the private registry. + :type identity_url: str """ _validation = { @@ -1324,6 +1333,8 @@ class ImageRegistryCredential(msrest.serialization.Model): 'server': {'key': 'server', 'type': 'str'}, 'username': {'key': 'username', 'type': 'str'}, 'password': {'key': 'password', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'str'}, + 'identity_url': {'key': 'identityUrl', 'type': 'str'}, } def __init__( @@ -1332,12 +1343,16 @@ def __init__( server: str, username: str, password: Optional[str] = None, + identity: Optional[str] = None, + identity_url: Optional[str] = None, **kwargs ): super(ImageRegistryCredential, self).__init__(**kwargs) self.server = server self.username = username self.password = password + self.identity = identity + self.identity_url = identity_url class InitContainerDefinition(msrest.serialization.Model): @@ -1501,7 +1516,7 @@ class LogAnalytics(msrest.serialization.Model): :param metadata: Metadata for log analytics. :type metadata: dict[str, str] :param workspace_resource_id: The workspace resource id for log analytics. - :type workspace_resource_id: dict[str, str] + :type workspace_resource_id: str """ _validation = { @@ -1514,7 +1529,7 @@ class LogAnalytics(msrest.serialization.Model): 'workspace_key': {'key': 'workspaceKey', 'type': 'str'}, 'log_type': {'key': 'logType', 'type': 'str'}, 'metadata': {'key': 'metadata', 'type': '{str}'}, - 'workspace_resource_id': {'key': 'workspaceResourceId', 'type': '{str}'}, + 'workspace_resource_id': {'key': 'workspaceResourceId', 'type': 'str'}, } def __init__( @@ -1524,7 +1539,7 @@ def __init__( workspace_key: str, log_type: Optional[Union[str, "LogAnalyticsLogType"]] = None, metadata: Optional[Dict[str, str]] = None, - workspace_resource_id: Optional[Dict[str, str]] = None, + workspace_resource_id: Optional[str] = None, **kwargs ): super(LogAnalytics, self).__init__(**kwargs) diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_container_groups_operations.py b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_container_groups_operations.py index 182f2be6964d..23746b18d8bd 100644 --- a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_container_groups_operations.py +++ b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_container_groups_operations.py @@ -20,7 +20,7 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Generic, Iterable, List, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +68,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" accept = "application/json" def prepare_request(next_link=None): @@ -142,7 +142,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" accept = "application/json" def prepare_request(next_link=None): @@ -220,7 +220,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" accept = "application/json" # Construct URL @@ -269,7 +269,7 @@ def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -416,7 +416,7 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -469,7 +469,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" accept = "application/json" # Construct URL @@ -590,7 +590,7 @@ def _restart_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" accept = "application/json" # Construct URL @@ -717,7 +717,7 @@ def stop( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" accept = "application/json" # Construct URL @@ -762,7 +762,7 @@ def _start_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" accept = "application/json" # Construct URL @@ -862,3 +862,65 @@ def get_long_running_output(pipeline_response): else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/start'} # type: ignore + + def get_outbound_network_dependencies_endpoints( + self, + resource_group_name, # type: str + container_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> List[str] + """Get all network dependencies for container group. + + Gets all the network dependencies for this container group to allow complete control of network + setting and configuration. For container groups, this will always be an empty list. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param container_group_name: The name of the container group. + :type container_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of str, or the result of cls(response) + :rtype: list[str] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[str]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self.get_outbound_network_dependencies_endpoints.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'containerGroupName': self._serialize.url("container_group_name", container_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('[str]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_outbound_network_dependencies_endpoints.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/outboundNetworkDependenciesEndpoints'} # type: ignore diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_containers_operations.py b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_containers_operations.py index 3384f34790e6..50219a9502dc 100644 --- a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_containers_operations.py +++ b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_containers_operations.py @@ -81,7 +81,7 @@ def list_logs( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" accept = "application/json" # Construct URL @@ -154,7 +154,7 @@ def execute_command( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -225,7 +225,7 @@ def attach( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" accept = "application/json" # Construct URL @@ -260,4 +260,4 @@ def attach( return cls(pipeline_response, deserialized, {}) return deserialized - attach.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/attach'} # type: ignore + attach.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/attach'} # type: ignore diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_location_operations.py b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_location_operations.py index 0bb44178526c..ad7927695246 100644 --- a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_location_operations.py +++ b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_location_operations.py @@ -65,7 +65,7 @@ def list_usage( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" accept = "application/json" def prepare_request(next_link=None): @@ -138,7 +138,7 @@ def list_cached_images( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" accept = "application/json" def prepare_request(next_link=None): @@ -211,7 +211,7 @@ def list_capabilities( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_operations.py b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_operations.py index c7069eeea575..a6956a93125c 100644 --- a/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_operations.py +++ b/sdk/containerinstance/azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/_operations.py @@ -62,7 +62,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-07-01" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/containerinstance/azure-mgmt-containerinstance/tests/recordings/test_cli_mgmt_containerinstance.test_containerinstance.yaml b/sdk/containerinstance/azure-mgmt-containerinstance/tests/recordings/test_cli_mgmt_containerinstance.test_containerinstance.yaml deleted file mode 100644 index bc9ea69f6b7b..000000000000 --- a/sdk/containerinstance/azure-mgmt-containerinstance/tests/recordings/test_cli_mgmt_containerinstance.test_containerinstance.yaml +++ /dev/null @@ -1,1320 +0,0 @@ -interactions: -- request: - body: '{"location": "eastus", "identity": {"type": "SystemAssigned"}, "properties": - {"containers": [{"name": "my-container", "properties": {"image": "nginx", "command": - [], "ports": [{"port": 80}], "environmentVariables": [], "resources": {"requests": - {"memoryInGB": 1.5, "cpu": 1.0, "gpu": {"count": 1, "sku": "K80"}}}, "volumeMounts": - [{"name": "empty-volume", "mountPath": "/mnt/mydir"}]}}], "restartPolicy": "OnFailure", - "osType": "Linux", "volumes": [{"name": "empty-volume", "emptyDir": {}}], "diagnostics": - {"logAnalytics": {"workspaceId": "workspaceid", "workspaceKey": "workspaceKey"}}}}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '589' - Content-Type: - - application/json - User-Agent: - - azsdk-python-mgmt-containerinstance/8.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) - VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 - method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.ContainerInstance/containerGroups/myContainerGroup?api-version=2021-03-01 - response: - body: - string: '{"properties":{"sku":"Standard","provisioningState":"Pending","containers":[{"name":"my-container","properties":{"image":"nginx","command":[],"ports":[{"port":80}],"environmentVariables":[],"resources":{"requests":{"memoryInGB":1.5,"cpu":1.0,"gpu":{"count":1,"sku":"K80"}}},"volumeMounts":[{"name":"empty-volume","mountPath":"/mnt/mydir"}]}}],"initContainers":[],"restartPolicy":"OnFailure","osType":"Linux","volumes":[{"name":"empty-volume","emptyDir":{}}],"instanceView":{"events":[],"state":"Pending"},"diagnostics":{"logAnalytics":{"workspaceId":"workspaceid"}}},"identity":{"principalId":"e5985050-f5a3-41d6-8978-347ee07f158c","tenantId":"00000000-0000-0000-0000-000000000000","type":"SystemAssigned"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.ContainerInstance/containerGroups/myContainerGroup","name":"myContainerGroup","type":"Microsoft.ContainerInstance/containerGroups","location":"eastus"}' - headers: - azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerInstance/locations/eastus/operations/ef33b05b-8c3c-4871-9301-33e83e710217?api-version=2018-06-01 - cache-control: - - no-cache - content-length: - - '1032' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Jul 2021 02:50:11 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-subscription-resource-requests-pt1h: - - '299' - x-ms-ratelimit-remaining-subscription-resource-requests-pt5m: - - '99' - x-ms-ratelimit-remaining-subscription-writes: - - '1199' - status: - code: 201 - message: Created -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-mgmt-containerinstance/8.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) - VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerInstance/locations/eastus/operations/ef33b05b-8c3c-4871-9301-33e83e710217?api-version=2018-06-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.ContainerInstance/containerGroups/myContainerGroup","status":"Pending","startTime":"2021-07-20T02:50:10.5049677Z","properties":{"events":[]}}' - headers: - cache-control: - - no-cache - content-length: - - '316' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Jul 2021 02:50:40 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding,Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-mgmt-containerinstance/8.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) - VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerInstance/locations/eastus/operations/ef33b05b-8c3c-4871-9301-33e83e710217?api-version=2018-06-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.ContainerInstance/containerGroups/myContainerGroup","status":"Pending","startTime":"2021-07-20T02:50:10.5049677Z","properties":{"events":[]}}' - headers: - cache-control: - - no-cache - content-length: - - '316' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Jul 2021 02:51:10 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding,Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-mgmt-containerinstance/8.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) - VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerInstance/locations/eastus/operations/ef33b05b-8c3c-4871-9301-33e83e710217?api-version=2018-06-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.ContainerInstance/containerGroups/myContainerGroup","status":"Pending","startTime":"2021-07-20T02:50:10.5049677Z","properties":{"events":[]}}' - headers: - cache-control: - - no-cache - content-length: - - '316' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Jul 2021 02:51:41 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding,Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-mgmt-containerinstance/8.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) - VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerInstance/locations/eastus/operations/ef33b05b-8c3c-4871-9301-33e83e710217?api-version=2018-06-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.ContainerInstance/containerGroups/myContainerGroup","status":"Pending","startTime":"2021-07-20T02:50:10.5049677Z","properties":{"events":[]}}' - headers: - cache-control: - - no-cache - content-length: - - '316' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Jul 2021 02:52:11 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding,Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-mgmt-containerinstance/8.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) - VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerInstance/locations/eastus/operations/ef33b05b-8c3c-4871-9301-33e83e710217?api-version=2018-06-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.ContainerInstance/containerGroups/myContainerGroup","status":"Pending","startTime":"2021-07-20T02:50:10.5049677Z","properties":{"events":[]}}' - headers: - cache-control: - - no-cache - content-length: - - '316' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Jul 2021 02:52:41 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding,Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-mgmt-containerinstance/8.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) - VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerInstance/locations/eastus/operations/ef33b05b-8c3c-4871-9301-33e83e710217?api-version=2018-06-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.ContainerInstance/containerGroups/myContainerGroup","status":"Pending","startTime":"2021-07-20T02:50:10.5049677Z","properties":{"events":[]}}' - headers: - cache-control: - - no-cache - content-length: - - '316' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Jul 2021 02:53:11 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding,Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-mgmt-containerinstance/8.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) - VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerInstance/locations/eastus/operations/ef33b05b-8c3c-4871-9301-33e83e710217?api-version=2018-06-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.ContainerInstance/containerGroups/myContainerGroup","status":"Pending","startTime":"2021-07-20T02:50:10.5049677Z","properties":{"events":[]}}' - headers: - cache-control: - - no-cache - content-length: - - '316' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Jul 2021 02:53:41 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding,Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-mgmt-containerinstance/8.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) - VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerInstance/locations/eastus/operations/ef33b05b-8c3c-4871-9301-33e83e710217?api-version=2018-06-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.ContainerInstance/containerGroups/myContainerGroup","status":"Pending","startTime":"2021-07-20T02:50:10.5049677Z","properties":{"events":[]}}' - headers: - cache-control: - - no-cache - content-length: - - '316' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Jul 2021 02:54:11 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding,Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-mgmt-containerinstance/8.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) - VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerInstance/locations/eastus/operations/ef33b05b-8c3c-4871-9301-33e83e710217?api-version=2018-06-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.ContainerInstance/containerGroups/myContainerGroup","status":"Pending","startTime":"2021-07-20T02:50:10.5049677Z","properties":{"events":[]}}' - headers: - cache-control: - - no-cache - content-length: - - '316' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Jul 2021 02:54:42 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding,Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-mgmt-containerinstance/8.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) - VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerInstance/locations/eastus/operations/ef33b05b-8c3c-4871-9301-33e83e710217?api-version=2018-06-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.ContainerInstance/containerGroups/myContainerGroup","status":"Pending","startTime":"2021-07-20T02:50:10.5049677Z","properties":{"events":[]}}' - headers: - cache-control: - - no-cache - content-length: - - '316' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Jul 2021 02:55:12 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding,Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-mgmt-containerinstance/8.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) - VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerInstance/locations/eastus/operations/ef33b05b-8c3c-4871-9301-33e83e710217?api-version=2018-06-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.ContainerInstance/containerGroups/myContainerGroup","status":"Pending","startTime":"2021-07-20T02:50:10.5049677Z","properties":{"events":[]}}' - headers: - cache-control: - - no-cache - content-length: - - '316' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Jul 2021 02:55:42 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding,Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-mgmt-containerinstance/8.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) - VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerInstance/locations/eastus/operations/ef33b05b-8c3c-4871-9301-33e83e710217?api-version=2018-06-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.ContainerInstance/containerGroups/myContainerGroup","status":"Pending","startTime":"2021-07-20T02:50:10.5049677Z","properties":{"events":[]}}' - headers: - cache-control: - - no-cache - content-length: - - '316' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Jul 2021 02:56:13 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding,Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-mgmt-containerinstance/8.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) - VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerInstance/locations/eastus/operations/ef33b05b-8c3c-4871-9301-33e83e710217?api-version=2018-06-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.ContainerInstance/containerGroups/myContainerGroup","status":"Pending","startTime":"2021-07-20T02:50:10.5049677Z","properties":{"events":[]}}' - headers: - cache-control: - - no-cache - content-length: - - '316' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Jul 2021 02:56:43 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding,Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-mgmt-containerinstance/8.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) - VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerInstance/locations/eastus/operations/ef33b05b-8c3c-4871-9301-33e83e710217?api-version=2018-06-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.ContainerInstance/containerGroups/myContainerGroup","status":"Pending","startTime":"2021-07-20T02:50:10.5049677Z","properties":{"events":[]}}' - headers: - cache-control: - - no-cache - content-length: - - '316' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Jul 2021 02:57:13 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding,Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-mgmt-containerinstance/8.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) - VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerInstance/locations/eastus/operations/ef33b05b-8c3c-4871-9301-33e83e710217?api-version=2018-06-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.ContainerInstance/containerGroups/myContainerGroup","status":"Creating","startTime":"2021-07-20T02:50:10.5049677Z","properties":{"events":[]}}' - headers: - cache-control: - - no-cache - content-length: - - '317' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Jul 2021 02:57:43 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding,Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-mgmt-containerinstance/8.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) - VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerInstance/locations/eastus/operations/ef33b05b-8c3c-4871-9301-33e83e710217?api-version=2018-06-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.ContainerInstance/containerGroups/myContainerGroup","status":"Creating","startTime":"2021-07-20T02:50:10.5049677Z","properties":{"events":[]}}' - headers: - cache-control: - - no-cache - content-length: - - '317' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Jul 2021 02:58:14 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding,Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-mgmt-containerinstance/8.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) - VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerInstance/locations/eastus/operations/ef33b05b-8c3c-4871-9301-33e83e710217?api-version=2018-06-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.ContainerInstance/containerGroups/myContainerGroup","status":"Creating","startTime":"2021-07-20T02:50:10.5049677Z","properties":{"events":[]}}' - headers: - cache-control: - - no-cache - content-length: - - '317' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Jul 2021 02:58:43 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding,Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-mgmt-containerinstance/8.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) - VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerInstance/locations/eastus/operations/ef33b05b-8c3c-4871-9301-33e83e710217?api-version=2018-06-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.ContainerInstance/containerGroups/myContainerGroup","status":"Creating","startTime":"2021-07-20T02:50:10.5049677Z","properties":{"events":[]}}' - headers: - cache-control: - - no-cache - content-length: - - '317' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Jul 2021 02:59:13 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding,Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-mgmt-containerinstance/8.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) - VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerInstance/locations/eastus/operations/ef33b05b-8c3c-4871-9301-33e83e710217?api-version=2018-06-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.ContainerInstance/containerGroups/myContainerGroup","status":"Creating","startTime":"2021-07-20T02:50:10.5049677Z","properties":{"events":[]}}' - headers: - cache-control: - - no-cache - content-length: - - '317' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Jul 2021 02:59:44 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding,Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-mgmt-containerinstance/8.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) - VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerInstance/locations/eastus/operations/ef33b05b-8c3c-4871-9301-33e83e710217?api-version=2018-06-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.ContainerInstance/containerGroups/myContainerGroup","status":"Creating","startTime":"2021-07-20T02:50:10.5049677Z","properties":{"events":[]}}' - headers: - cache-control: - - no-cache - content-length: - - '317' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Jul 2021 03:00:14 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding,Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-mgmt-containerinstance/8.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) - VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerInstance/locations/eastus/operations/ef33b05b-8c3c-4871-9301-33e83e710217?api-version=2018-06-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.ContainerInstance/containerGroups/myContainerGroup","status":"Creating","startTime":"2021-07-20T02:50:10.5049677Z","properties":{"events":[{"count":1,"firstTimestamp":"2021-07-20T03:00:27Z","lastTimestamp":"2021-07-20T03:00:27Z","name":"Pulling","message":"pulling - image \"nginx\"","type":"Normal"}]}}' - headers: - cache-control: - - no-cache - content-length: - - '476' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Jul 2021 03:00:44 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding,Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-mgmt-containerinstance/8.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) - VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerInstance/locations/eastus/operations/ef33b05b-8c3c-4871-9301-33e83e710217?api-version=2018-06-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.ContainerInstance/containerGroups/myContainerGroup","status":"Succeeded","startTime":"2021-07-20T02:50:10.5049677Z","properties":{"events":[{"count":1,"firstTimestamp":"2021-07-20T03:00:27Z","lastTimestamp":"2021-07-20T03:00:27Z","name":"Pulling","message":"pulling - image \"nginx\"","type":"Normal"},{"count":1,"firstTimestamp":"2021-07-20T03:00:35Z","lastTimestamp":"2021-07-20T03:00:35Z","name":"Pulled","message":"Successfully - pulled image \"nginx\"","type":"Normal"},{"count":1,"firstTimestamp":"2021-07-20T03:00:35Z","lastTimestamp":"2021-07-20T03:00:35Z","name":"Created","message":"Created - container","type":"Normal"},{"count":1,"firstTimestamp":"2021-07-20T03:00:35Z","lastTimestamp":"2021-07-20T03:00:35Z","name":"Started","message":"Started - container","type":"Normal"}]}}' - headers: - cache-control: - - no-cache - content-length: - - '956' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Jul 2021 03:01:14 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding,Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-mgmt-containerinstance/8.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) - VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.ContainerInstance/containerGroups/myContainerGroup?api-version=2021-03-01 - response: - body: - string: '{"properties":{"sku":"Standard","provisioningState":"Succeeded","containers":[{"name":"my-container","properties":{"image":"nginx","command":[],"ports":[{"port":80}],"environmentVariables":[],"instanceView":{"restartCount":0,"currentState":{"state":"Running","startTime":"2021-07-20T03:00:35Z","detailStatus":""},"events":[{"count":1,"firstTimestamp":"2021-07-20T03:00:27Z","lastTimestamp":"2021-07-20T03:00:27Z","name":"Pulling","message":"pulling - image \"nginx\"","type":"Normal"},{"count":1,"firstTimestamp":"2021-07-20T03:00:35Z","lastTimestamp":"2021-07-20T03:00:35Z","name":"Pulled","message":"Successfully - pulled image \"nginx\"","type":"Normal"},{"count":1,"firstTimestamp":"2021-07-20T03:00:35Z","lastTimestamp":"2021-07-20T03:00:35Z","name":"Created","message":"Created - container","type":"Normal"},{"count":1,"firstTimestamp":"2021-07-20T03:00:35Z","lastTimestamp":"2021-07-20T03:00:35Z","name":"Started","message":"Started - container","type":"Normal"}]},"resources":{"requests":{"memoryInGB":1.5,"cpu":1.0,"gpu":{"count":1,"sku":"K80"}}},"volumeMounts":[{"name":"empty-volume","mountPath":"/mnt/mydir"}]}}],"initContainers":[],"restartPolicy":"OnFailure","osType":"Linux","volumes":[{"name":"empty-volume","emptyDir":{}}],"instanceView":{"events":[],"state":"Running"},"diagnostics":{"logAnalytics":{"workspaceId":"workspaceid"}}},"identity":{"principalId":"e5985050-f5a3-41d6-8978-347ee07f158c","tenantId":"00000000-0000-0000-0000-000000000000","type":"SystemAssigned"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.ContainerInstance/containerGroups/myContainerGroup","name":"myContainerGroup","type":"Microsoft.ContainerInstance/containerGroups","location":"eastus"}' - headers: - cache-control: - - no-cache - content-length: - - '1806' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Jul 2021 03:01:15 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding,Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-mgmt-containerinstance/8.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) - VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.ContainerInstance/containerGroups/myContainerGroup/containers/my-container/logs?api-version=2021-03-01&tail=10 - response: - body: - string: '{"content":"2021/07/20 03:00:35 [notice] 1#1: built by gcc 8.3.0 (Debian - 8.3.0-6) \n2021/07/20 03:00:35 [notice] 1#1: OS: Linux 4.15.0-1113-azure\n2021/07/20 - 03:00:35 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576\n2021/07/20 - 03:00:35 [notice] 1#1: start worker processes\n2021/07/20 03:00:35 [notice] - 1#1: start worker process 31\n2021/07/20 03:00:35 [notice] 1#1: start worker - process 32\n2021/07/20 03:00:35 [notice] 1#1: start worker process 33\n2021/07/20 - 03:00:35 [notice] 1#1: start worker process 34\n2021/07/20 03:00:35 [notice] - 1#1: start worker process 35\n2021/07/20 03:00:35 [notice] 1#1: start worker - process 36\n"}' - headers: - cache-control: - - no-cache - content-length: - - '638' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Jul 2021 03:01:15 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding,Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-mgmt-containerinstance/8.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) - VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.ContainerInstance/containerGroups/myContainerGroup?api-version=2021-03-01 - response: - body: - string: '{"properties":{"sku":"Standard","provisioningState":"Succeeded","containers":[{"name":"my-container","properties":{"image":"nginx","command":[],"ports":[{"port":80}],"environmentVariables":[],"instanceView":{"restartCount":0,"currentState":{"state":"Running","startTime":"2021-07-20T03:00:35Z","detailStatus":""},"events":[{"count":1,"firstTimestamp":"2021-07-20T03:00:27Z","lastTimestamp":"2021-07-20T03:00:27Z","name":"Pulling","message":"pulling - image \"nginx\"","type":"Normal"},{"count":1,"firstTimestamp":"2021-07-20T03:00:35Z","lastTimestamp":"2021-07-20T03:00:35Z","name":"Pulled","message":"Successfully - pulled image \"nginx\"","type":"Normal"},{"count":1,"firstTimestamp":"2021-07-20T03:00:35Z","lastTimestamp":"2021-07-20T03:00:35Z","name":"Created","message":"Created - container","type":"Normal"},{"count":1,"firstTimestamp":"2021-07-20T03:00:35Z","lastTimestamp":"2021-07-20T03:00:35Z","name":"Started","message":"Started - container","type":"Normal"}]},"resources":{"requests":{"memoryInGB":1.5,"cpu":1.0,"gpu":{"count":1,"sku":"K80"}}},"volumeMounts":[{"name":"empty-volume","mountPath":"/mnt/mydir"}]}}],"initContainers":[],"restartPolicy":"OnFailure","osType":"Linux","volumes":[{"name":"empty-volume","emptyDir":{}}],"instanceView":{"events":[],"state":"Running"},"diagnostics":{"logAnalytics":{"workspaceId":"workspaceid"}}},"identity":{"principalId":"e5985050-f5a3-41d6-8978-347ee07f158c","tenantId":"00000000-0000-0000-0000-000000000000","type":"SystemAssigned"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.ContainerInstance/containerGroups/myContainerGroup","name":"myContainerGroup","type":"Microsoft.ContainerInstance/containerGroups","location":"eastus"}' - headers: - cache-control: - - no-cache - content-length: - - '1806' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Jul 2021 03:01:15 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding,Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-mgmt-containerinstance/8.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) - VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.ContainerInstance/containerGroups/myContainerGroup?api-version=2021-03-01 - response: - body: - string: '{"properties":{"sku":"Standard","provisioningState":"Succeeded","containers":[{"name":"my-container","properties":{"image":"nginx","command":[],"ports":[{"port":80}],"environmentVariables":[],"instanceView":{"restartCount":0,"currentState":{"state":"Running","startTime":"2021-07-20T03:00:35Z","detailStatus":""},"events":[{"count":1,"firstTimestamp":"2021-07-20T03:00:27Z","lastTimestamp":"2021-07-20T03:00:27Z","name":"Pulling","message":"pulling - image \"nginx\"","type":"Normal"},{"count":1,"firstTimestamp":"2021-07-20T03:00:35Z","lastTimestamp":"2021-07-20T03:00:35Z","name":"Pulled","message":"Successfully - pulled image \"nginx\"","type":"Normal"},{"count":1,"firstTimestamp":"2021-07-20T03:00:35Z","lastTimestamp":"2021-07-20T03:00:35Z","name":"Created","message":"Created - container","type":"Normal"},{"count":1,"firstTimestamp":"2021-07-20T03:00:35Z","lastTimestamp":"2021-07-20T03:00:35Z","name":"Started","message":"Started - container","type":"Normal"}]},"resources":{"requests":{"memoryInGB":1.5,"cpu":1.0,"gpu":{"count":1,"sku":"K80"}}},"volumeMounts":[{"name":"empty-volume","mountPath":"/mnt/mydir"}]}}],"initContainers":[],"restartPolicy":"OnFailure","osType":"Linux","volumes":[{"name":"empty-volume","emptyDir":{}}],"instanceView":{"events":[],"state":"Running"},"diagnostics":{"logAnalytics":{"workspaceId":"workspaceid"}}},"identity":{"principalId":"e5985050-f5a3-41d6-8978-347ee07f158c","tenantId":"00000000-0000-0000-0000-000000000000","type":"SystemAssigned"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.ContainerInstance/containerGroups/myContainerGroup","name":"myContainerGroup","type":"Microsoft.ContainerInstance/containerGroups","location":"eastus"}' - headers: - cache-control: - - no-cache - content-length: - - '1806' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Jul 2021 03:01:15 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding,Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: '{"command": "/bin/bash", "terminalSize": {"rows": 12, "cols": 12}}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '66' - Content-Type: - - application/json - User-Agent: - - azsdk-python-mgmt-containerinstance/8.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) - VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 - method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.ContainerInstance/containerGroups/myContainerGroup/containers/my-container/exec?api-version=2021-03-01 - response: - body: - string: '{"webSocketUri":"wss://bridge-linux-27.eastus.management.azurecontainer.io/exec/caas-31b0841c73f640c0b258d58feca79d6a/bridge-f0db53bdaa6d8bfa?rows=12&cols=12&api-version=2018-02-01-preview","password":"6Ds2d7_LT2uYwiuDvQCIqIpdVJDqRfC3BV0JPzrZF5k[[EOM]]"}' - headers: - cache-control: - - no-cache - content-length: - - '254' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Jul 2021 03:01:15 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding,Accept-Encoding - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-subscription-writes: - - '1199' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '0' - User-Agent: - - azsdk-python-mgmt-containerinstance/8.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) - VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 - method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.ContainerInstance/containerGroups/myContainerGroup/restart?api-version=2021-03-01 - response: - body: - string: '' - headers: - azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerInstance/locations/eastus/operations/c1caea17-d3e3-4cc9-9dae-9acf78838900?api-version=2018-06-01 - cache-control: - - no-cache - date: - - Tue, 20 Jul 2021 03:01:16 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-subscription-writes: - - '1198' - status: - code: 204 - message: No Content -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-mgmt-containerinstance/8.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) - VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerInstance/locations/eastus/operations/c1caea17-d3e3-4cc9-9dae-9acf78838900?api-version=2018-06-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.ContainerInstance/containerGroups/myContainerGroup","status":"Succeeded","startTime":"2021-07-20T03:01:16.4438271Z","properties":{"events":[{"count":1,"firstTimestamp":"2021-07-20T03:00:27Z","lastTimestamp":"2021-07-20T03:00:27Z","name":"Pulling","message":"pulling - image \"nginx\"","type":"Normal"},{"count":1,"firstTimestamp":"2021-07-20T03:00:35Z","lastTimestamp":"2021-07-20T03:00:35Z","name":"Pulled","message":"Successfully - pulled image \"nginx\"","type":"Normal"},{"count":1,"firstTimestamp":"2021-07-20T03:00:35Z","lastTimestamp":"2021-07-20T03:00:35Z","name":"Created","message":"Created - container","type":"Normal"},{"count":1,"firstTimestamp":"2021-07-20T03:00:35Z","lastTimestamp":"2021-07-20T03:00:35Z","name":"Started","message":"Started - container","type":"Normal"},{"count":1,"firstTimestamp":"2021-07-20T03:01:18Z","lastTimestamp":"2021-07-20T03:01:18Z","name":"Pulling","message":"pulling - image \"nginx\"","type":"Normal"},{"count":1,"firstTimestamp":"2021-07-20T03:01:18Z","lastTimestamp":"2021-07-20T03:01:18Z","name":"Pulled","message":"Successfully - pulled image \"nginx\"","type":"Normal"},{"count":1,"firstTimestamp":"2021-07-20T03:01:18Z","lastTimestamp":"2021-07-20T03:01:18Z","name":"Created","message":"Created - container","type":"Normal"},{"count":1,"firstTimestamp":"2021-07-20T03:01:19Z","lastTimestamp":"2021-07-20T03:01:19Z","name":"Started","message":"Started - container","type":"Normal"}]}}' - headers: - cache-control: - - no-cache - content-length: - - '1595' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Jul 2021 03:01:46 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding,Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '0' - User-Agent: - - azsdk-python-mgmt-containerinstance/8.0.0 Python/3.8.11 (Linux-5.8.0-1036-azure-x86_64-with-glibc2.2.5) - VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0 - method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.ContainerInstance/containerGroups/myContainerGroup/start?api-version=2021-03-01 - response: - body: - string: '' - headers: - cache-control: - - no-cache - date: - - Tue, 20 Jul 2021 03:01:46 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-subscription-writes: - - '1197' - status: - code: 204 - message: No Content -version: 1 From eca1c81f53d9cd50134a683b7bd670844f03fe4d Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Tue, 21 Sep 2021 19:58:17 -0700 Subject: [PATCH 83/85] Clean-up changelog scripts (#20779) Co-authored-by: Wes Haggard --- eng/common/scripts/Collect-ChangeLogs.ps1 | 61 ----------------------- eng/common/scripts/Update-ChangeLog.ps1 | 7 +-- eng/common/scripts/Verify-ChangeLog.ps1 | 1 + 3 files changed, 5 insertions(+), 64 deletions(-) delete mode 100644 eng/common/scripts/Collect-ChangeLogs.ps1 diff --git a/eng/common/scripts/Collect-ChangeLogs.ps1 b/eng/common/scripts/Collect-ChangeLogs.ps1 deleted file mode 100644 index b6736b1a1ceb..000000000000 --- a/eng/common/scripts/Collect-ChangeLogs.ps1 +++ /dev/null @@ -1,61 +0,0 @@ -[CmdletBinding()] -param( - [Parameter(Mandatory=$true)] - [DateTime] $FromDate -) - -. (Join-Path $PSScriptRoot common.ps1) - -$releaseHighlights = @{} - -if ($FromDate -as [DateTime]) -{ - $date = ([DateTime]$FromDate).ToString($CHANGELOG_DATE_FORMAT) -} -else { - LogWarning "Invalid date passed. Switch to using the current date" - $date = Get-Date -Format $CHANGELOG_DATE_FORMAT -} - -$allPackageProps = Get-AllPkgProperties - -foreach ($packageProp in $allPackageProps) { - $changeLogLocation = $packageProp.ChangeLogPath - if (!(Test-Path $changeLogLocation)) - { - continue - } - $changeLogEntries = Get-ChangeLogEntries -ChangeLogLocation $changeLogLocation - $packageName = $packageProp.Name - $serviceDirectory = $packageProp.ServiceDirectory - $packageDirectoryname = Split-Path -Path $packageProp.DirectoryPath -Leaf - - foreach ($changeLogEntry in $changeLogEntries.Values) { - if ([System.String]::IsNullOrEmpty($changeLogEntry.ReleaseStatus)) - { - continue; - } - $ReleaseStatus = $changeLogEntry.ReleaseStatus.Trim("(",")") - if (!($ReleaseStatus -as [DateTime]) -or $ReleaseStatus -lt $date) - { - continue; - } - - $releaseVersion = $changeLogEntry.ReleaseVersion - $githubAnchor = $changeLogEntry.ReleaseTitle.Replace("## ", "").Replace(".", "").Replace("(", "").Replace(")", "").Replace(" ", "-") - - $releaseTag = "${packageName}_${releaseVersion}" - $key = "${packageName}:${releaseVersion}" - - $releaseHighlights[$key] = @{} - $releaseHighlights[$key]["PackageProperties"] = $packageProp - $releaseHighlights[$key]["ChangelogUrl"] = "https://github.com/Azure/azure-sdk-for-${LanguageShort}/blob/${releaseTag}/sdk/${serviceDirectory}/${packageDirectoryname}/CHANGELOG.md#${githubAnchor}" - $releaseHighlights[$key]["Content"] = @() - - $changeLogEntry.ReleaseContent | %{ - $releaseHighlights[$key]["Content"] += $_.Replace("###", "####") - } - } -} - -return $releaseHighlights \ No newline at end of file diff --git a/eng/common/scripts/Update-ChangeLog.ps1 b/eng/common/scripts/Update-ChangeLog.ps1 index 6e09f369cec1..250d61ca3d52 100644 --- a/eng/common/scripts/Update-ChangeLog.ps1 +++ b/eng/common/scripts/Update-ChangeLog.ps1 @@ -5,6 +5,7 @@ # Unreleased: Default is true. If it is set to false, then today's date will be set in verion title. If it is True then title will show "Unreleased" # ReplaceLatestEntryTitle: Replaces the latest changelog entry title. +[CmdletBinding()] param ( [Parameter(Mandatory = $true)] [String]$Version, @@ -74,13 +75,13 @@ if ($ChangeLogEntries.Contains($Version)) { if ($ChangeLogEntries[$Version].ReleaseStatus -eq $ReleaseStatus) { - LogWarning "Version [$Version] is already present in change log with specificed ReleaseStatus [$ReleaseStatus]. No Change made." + LogDebug "Version [$Version] is already present in change log with specificed ReleaseStatus [$ReleaseStatus]. No Change made." exit(0) } if ($Unreleased -and ($ChangeLogEntries[$Version].ReleaseStatus -ne $ReleaseStatus)) { - LogWarning "Version [$Version] is already present in change log with a release date. Please review [$ChangelogPath]. No Change made." + LogDebug "Version [$Version] is already present in change log with a release date. Please review [$ChangelogPath]. No Change made." exit(0) } @@ -88,7 +89,7 @@ if ($ChangeLogEntries.Contains($Version)) { if ((Get-Date ($ChangeLogEntries[$Version].ReleaseStatus).Trim("()")) -gt (Get-Date $ReleaseStatus.Trim("()"))) { - LogWarning "New ReleaseDate for version [$Version] is older than existing release date in changelog. Please review [$ChangelogPath]. No Change made." + LogDebug "New ReleaseDate for version [$Version] is older than existing release date in changelog. Please review [$ChangelogPath]. No Change made." exit(0) } } diff --git a/eng/common/scripts/Verify-ChangeLog.ps1 b/eng/common/scripts/Verify-ChangeLog.ps1 index 9be30f09261c..611f4c737541 100644 --- a/eng/common/scripts/Verify-ChangeLog.ps1 +++ b/eng/common/scripts/Verify-ChangeLog.ps1 @@ -1,4 +1,5 @@ # Wrapper Script for ChangeLog Verification +[CmdletBinding()] param ( [String]$ChangeLogLocation, [String]$VersionString, From 4b3397d197e779539abe716d49eb4334565ff77b Mon Sep 17 00:00:00 2001 From: "Adam Ling (MSFT)" Date: Wed, 22 Sep 2021 09:09:32 -0700 Subject: [PATCH 84/85] [EventHubs] Stress test refactor (#20389) * init commit for stress * add dotenv dep * docker, helm, k8s * apply changes * run forever * add chaos * update chaos jos * Apply suggestions from code review Co-authored-by: Ben Broderick Phillips * minor fixes * revert external targets Co-authored-by: Ben Broderick Phillips --- sdk/eventhub/azure-eventhub/stress/Chart.lock | 6 + sdk/eventhub/azure-eventhub/stress/Chart.yaml | 13 ++ sdk/eventhub/azure-eventhub/stress/Dockerfile | 10 ++ .../azure-eventhub/stress/dev_requirement.txt | 8 - .../azure-eventhub/stress/parameters.json | 5 + .../{ => scripts}/app_insights_metric.py | 5 +- .../azure_eventhub_consumer_stress_async.py | 23 ++- .../azure_eventhub_consumer_stress_sync.py | 36 ++-- .../azure_eventhub_producer_stress.py | 14 +- .../stress/{ => scripts}/common_use_scripts | 0 .../stress/scripts/dev_requirement.txt | 9 + .../stress/{ => scripts}/logger.py | 1 - .../stress/{ => scripts}/process_monitor.py | 0 .../stress/{ => scripts}/stress_runner.cfg | 0 .../stress/{ => scripts}/stress_runner.py | 0 .../stress/templates/network_loss.yaml | 31 ++++ .../stress/templates/testjob.yaml | 16 ++ .../stress/test-resources.bicep | 107 +++++++++++ .../azure-eventhub/stress/test-resources.json | 169 ++++++++++++++++++ 19 files changed, 415 insertions(+), 38 deletions(-) create mode 100644 sdk/eventhub/azure-eventhub/stress/Chart.lock create mode 100644 sdk/eventhub/azure-eventhub/stress/Chart.yaml create mode 100644 sdk/eventhub/azure-eventhub/stress/Dockerfile delete mode 100644 sdk/eventhub/azure-eventhub/stress/dev_requirement.txt create mode 100644 sdk/eventhub/azure-eventhub/stress/parameters.json rename sdk/eventhub/azure-eventhub/stress/{ => scripts}/app_insights_metric.py (97%) rename sdk/eventhub/azure-eventhub/stress/{ => scripts}/azure_eventhub_consumer_stress_async.py (93%) rename sdk/eventhub/azure-eventhub/stress/{ => scripts}/azure_eventhub_consumer_stress_sync.py (91%) rename sdk/eventhub/azure-eventhub/stress/{ => scripts}/azure_eventhub_producer_stress.py (97%) rename sdk/eventhub/azure-eventhub/stress/{ => scripts}/common_use_scripts (100%) create mode 100644 sdk/eventhub/azure-eventhub/stress/scripts/dev_requirement.txt rename sdk/eventhub/azure-eventhub/stress/{ => scripts}/logger.py (99%) rename sdk/eventhub/azure-eventhub/stress/{ => scripts}/process_monitor.py (100%) rename sdk/eventhub/azure-eventhub/stress/{ => scripts}/stress_runner.cfg (100%) rename sdk/eventhub/azure-eventhub/stress/{ => scripts}/stress_runner.py (100%) create mode 100644 sdk/eventhub/azure-eventhub/stress/templates/network_loss.yaml create mode 100644 sdk/eventhub/azure-eventhub/stress/templates/testjob.yaml create mode 100644 sdk/eventhub/azure-eventhub/stress/test-resources.bicep create mode 100644 sdk/eventhub/azure-eventhub/stress/test-resources.json diff --git a/sdk/eventhub/azure-eventhub/stress/Chart.lock b/sdk/eventhub/azure-eventhub/stress/Chart.lock new file mode 100644 index 000000000000..c3c0a4b0aa0b --- /dev/null +++ b/sdk/eventhub/azure-eventhub/stress/Chart.lock @@ -0,0 +1,6 @@ +dependencies: +- name: stress-test-addons + repository: https://stresstestcharts.blob.core.windows.net/helm/ + version: 0.1.6 +digest: sha256:b97697ef5f303eec43e9a94fca8e312d20b8aed71318250499344aeca9880d31 +generated: "2021-08-24T11:24:15.375395-07:00" diff --git a/sdk/eventhub/azure-eventhub/stress/Chart.yaml b/sdk/eventhub/azure-eventhub/stress/Chart.yaml new file mode 100644 index 000000000000..0f42b0429a4b --- /dev/null +++ b/sdk/eventhub/azure-eventhub/stress/Chart.yaml @@ -0,0 +1,13 @@ +apiVersion: v2 +name: python-eventhubs-stress-test +description: python event hubs stress test. +version: 0.1.2 +appVersion: v0.2 +annotations: + stressTest: 'true' + namespace: python-eventhubs-stress-test-ns + +dependencies: +- name: stress-test-addons + version: 0.1.6 + repository: https://stresstestcharts.blob.core.windows.net/helm/ \ No newline at end of file diff --git a/sdk/eventhub/azure-eventhub/stress/Dockerfile b/sdk/eventhub/azure-eventhub/stress/Dockerfile new file mode 100644 index 000000000000..05c55e17da28 --- /dev/null +++ b/sdk/eventhub/azure-eventhub/stress/Dockerfile @@ -0,0 +1,10 @@ +# syntax=docker/dockerfile:1 + +FROM python:3.8-slim-buster + +WORKDIR /app + +COPY ./scripts /app/stress/scripts + +WORKDIR /app/stress/scripts +RUN pip3 install -r dev_requirement.txt diff --git a/sdk/eventhub/azure-eventhub/stress/dev_requirement.txt b/sdk/eventhub/azure-eventhub/stress/dev_requirement.txt deleted file mode 100644 index e4817ded436f..000000000000 --- a/sdk/eventhub/azure-eventhub/stress/dev_requirement.txt +++ /dev/null @@ -1,8 +0,0 @@ -psutil -.. -../../azure-eventhub-checkpointstoreblob -../../azure-eventhub-checkpointstoreblob-aio -azure-servicebus==0.50.3 -azure-storage-blob -azure-identity -opencensus-ext-azure diff --git a/sdk/eventhub/azure-eventhub/stress/parameters.json b/sdk/eventhub/azure-eventhub/stress/parameters.json new file mode 100644 index 000000000000..2df20a6d1780 --- /dev/null +++ b/sdk/eventhub/azure-eventhub/stress/parameters.json @@ -0,0 +1,5 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { } +} \ No newline at end of file diff --git a/sdk/eventhub/azure-eventhub/stress/app_insights_metric.py b/sdk/eventhub/azure-eventhub/stress/scripts/app_insights_metric.py similarity index 97% rename from sdk/eventhub/azure-eventhub/stress/app_insights_metric.py rename to sdk/eventhub/azure-eventhub/stress/scripts/app_insights_metric.py index 7b0945eb07a1..9f814fdf2845 100644 --- a/sdk/eventhub/azure-eventhub/stress/app_insights_metric.py +++ b/sdk/eventhub/azure-eventhub/stress/scripts/app_insights_metric.py @@ -2,9 +2,6 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- - -import os - from opencensus.ext.azure import metrics_exporter from opencensus.stats import aggregation as aggregation_module from opencensus.stats import measure as measure_module @@ -26,7 +23,7 @@ def __init__(self, test_name, test_description=None): self.desc = test_description events_measure_name = "The number of events handled by " + self.name - events_measure_desc = "The number of events handled by " + self.desc if self.desc else None + events_measure_desc = "The number of events handled by" + self.desc if self.desc else None memory_measure_name = "memory usage percentage for " + self.name memory_measure_desc = "memory usage percentage for " + self.desc if self.desc else None cpu_measure_name = "cpu usage percentage for " + self.name diff --git a/sdk/eventhub/azure-eventhub/stress/azure_eventhub_consumer_stress_async.py b/sdk/eventhub/azure-eventhub/stress/scripts/azure_eventhub_consumer_stress_async.py similarity index 93% rename from sdk/eventhub/azure-eventhub/stress/azure_eventhub_consumer_stress_async.py rename to sdk/eventhub/azure-eventhub/stress/scripts/azure_eventhub_consumer_stress_async.py index ad99f73455c0..eadf7fe3f7f6 100644 --- a/sdk/eventhub/azure-eventhub/stress/azure_eventhub_consumer_stress_async.py +++ b/sdk/eventhub/azure-eventhub/stress/scripts/azure_eventhub_consumer_stress_async.py @@ -11,6 +11,7 @@ import logging from collections import defaultdict from functools import partial +from dotenv import load_dotenv from azure.identity.aio import ClientSecretCredential from azure.eventhub.aio import EventHubConsumerClient @@ -22,6 +23,9 @@ from process_monitor import ProcessMonitor from app_insights_metric import AzureMonitorMetric +ENV_FILE = os.environ.get('ENV_FILE') +load_dotenv(dotenv_path=ENV_FILE, override=True) + def parse_starting_position(args): starting_position = None @@ -39,25 +43,26 @@ def parse_starting_position(args): parser = argparse.ArgumentParser() -parser.add_argument("--link_credit", default=3000, type=int) -parser.add_argument("--output_interval", type=float, default=1000) -parser.add_argument("--duration", help="Duration in seconds of the test", type=int, default=30) -parser.add_argument("--consumer_group", help="Consumer group name", default="$default") +parser.add_argument("--link_credit", default=int(os.environ.get("LINK_CREDIT", 3000)), type=int) +parser.add_argument("--output_interval", type=float, default=int(os.environ.get("OUTPUT_INTERVAL", 5000))) +parser.add_argument("--duration", help="Duration in seconds of the test", type=int, default=int(os.environ.get("DURATION", 999999999))) +parser.add_argument("--consumer_group", help="Consumer group name", default=os.environ.get("CONSUMER_GROUP", "$default")) parser.add_argument("--auth_timeout", help="Authorization Timeout", type=float, default=60) -parser.add_argument("--starting_offset", help="Starting offset", type=str) +parser.add_argument("--starting_offset", help="Starting offset", type=str, default=os.environ.get("STARTING_OFFSET", "-1")) parser.add_argument("--starting_sequence_number", help="Starting sequence number", type=int) -parser.add_argument("--starting_datetime", help="Starting datetime string, should be format of YYYY-mm-dd HH:mm:ss", type=str) +parser.add_argument("--starting_datetime", help="Starting datetime string, should be format of YYYY-mm-dd HH:mm:ss") parser.add_argument("--partitions", help="Number of partitions. 0 means to get partitions from eventhubs", type=int, default=0) parser.add_argument("--recv_partition_id", help="Receive from a specific partition if this is set", type=int) -parser.add_argument("--max_batch_size", type=int, default=0, +parser.add_argument("--max_batch_size", type=int, default=int(os.environ.get("MAX_BATCH_SIZE", 0)), help="Call EventHubConsumerClient.receive_batch() if not 0, otherwise call receive()") parser.add_argument("--max_wait_time", type=float, default=0, help="max_wait_time of EventHubConsumerClient.receive_batch() or EventHubConsumerClient.receive()") + parser.add_argument("--track_last_enqueued_event_properties", action="store_true") parser.add_argument("--load_balancing_interval", help="time duration in seconds between two load balance", type=float, default=10) parser.add_argument("--conn_str", help="EventHub connection string", - default=os.environ.get('EVENT_HUB_PERF_32_CONN_STR')) -parser.add_argument("--eventhub", help="Name of EventHub") + default=os.environ.get('EVENT_HUB_CONN_STR')) +parser.add_argument("--eventhub", help="Name of EventHub", default=os.environ.get('EVENT_HUB_NAME')) parser.add_argument("--address", help="Address URI to the EventHub entity") parser.add_argument("--sas_policy", help="Name of the shared access policy to authenticate with") parser.add_argument("--sas_key", help="Shared access key") diff --git a/sdk/eventhub/azure-eventhub/stress/azure_eventhub_consumer_stress_sync.py b/sdk/eventhub/azure-eventhub/stress/scripts/azure_eventhub_consumer_stress_sync.py similarity index 91% rename from sdk/eventhub/azure-eventhub/stress/azure_eventhub_consumer_stress_sync.py rename to sdk/eventhub/azure-eventhub/stress/scripts/azure_eventhub_consumer_stress_sync.py index b7c74e765a71..534c4d8996b0 100644 --- a/sdk/eventhub/azure-eventhub/stress/azure_eventhub_consumer_stress_sync.py +++ b/sdk/eventhub/azure-eventhub/stress/scripts/azure_eventhub_consumer_stress_sync.py @@ -11,6 +11,7 @@ import logging from collections import defaultdict from functools import partial +from dotenv import load_dotenv from azure.identity import ClientSecretCredential from azure.eventhub.extensions.checkpointstoreblob import BlobCheckpointStore @@ -20,6 +21,9 @@ from process_monitor import ProcessMonitor from app_insights_metric import AzureMonitorMetric +ENV_FILE = os.environ.get('ENV_FILE') +load_dotenv(dotenv_path=ENV_FILE, override=True) + def parse_starting_position(args): starting_position = None @@ -37,17 +41,17 @@ def parse_starting_position(args): parser = argparse.ArgumentParser() -parser.add_argument("--link_credit", default=3000, type=int) -parser.add_argument("--output_interval", type=float, default=1000) -parser.add_argument("--duration", help="Duration in seconds of the test", type=int, default=30) -parser.add_argument("--consumer_group", help="Consumer group name", default="$default") +parser.add_argument("--link_credit", default=int(os.environ.get("LINK_CREDIT", 3000)), type=int) +parser.add_argument("--output_interval", type=float, default=int(os.environ.get("OUTPUT_INTERVAL", 5000))) +parser.add_argument("--duration", help="Duration in seconds of the test", type=int, default=int(os.environ.get("DURATION", 999999999))) +parser.add_argument("--consumer_group", help="Consumer group name", default=os.environ.get("CONSUMER_GROUP", "$default")) parser.add_argument("--auth_timeout", help="Authorization Timeout", type=float, default=60) -parser.add_argument("--starting_offset", help="Starting offset", type=str) +parser.add_argument("--starting_offset", help="Starting offset", type=str, default=os.environ.get("STARTING_OFFSET", "-1")) parser.add_argument("--starting_sequence_number", help="Starting sequence number", type=int) parser.add_argument("--starting_datetime", help="Starting datetime string, should be format of YYYY-mm-dd HH:mm:ss") parser.add_argument("--partitions", help="Number of partitions. 0 means to get partitions from eventhubs", type=int, default=0) parser.add_argument("--recv_partition_id", help="Receive from a specific partition if this is set", type=int) -parser.add_argument("--max_batch_size", type=int, default=0, +parser.add_argument("--max_batch_size", type=int, default=int(os.environ.get("MAX_BATCH_SIZE", 0)), help="Call EventHubConsumerClient.receive_batch() if not 0, otherwise call receive()") parser.add_argument("--max_wait_time", type=float, default=0, help="max_wait_time of EventHubConsumerClient.receive_batch() or EventHubConsumerClient.receive()") @@ -55,8 +59,8 @@ def parse_starting_position(args): parser.add_argument("--track_last_enqueued_event_properties", action="store_true") parser.add_argument("--load_balancing_interval", help="time duration in seconds between two load balance", type=float, default=10) parser.add_argument("--conn_str", help="EventHub connection string", - default=os.environ.get('EVENT_HUB_PERF_32_CONN_STR')) -parser.add_argument("--eventhub", help="Name of EventHub") + default=os.environ.get('EVENT_HUB_CONN_STR')) +parser.add_argument("--eventhub", help="Name of EventHub", default=os.environ.get('EVENT_HUB_NAME')) parser.add_argument("--address", help="Address URI to the EventHub entity") parser.add_argument("--sas-policy", help="Name of the shared access policy to authenticate with") parser.add_argument("--sas-key", help="Shared access key") @@ -82,7 +86,14 @@ def parse_starting_position(args): args = parser.parse_args() starting_position = parse_starting_position(args) -LOGGER = get_logger(args.log_filename, "stress_receive_sync", level=logging.INFO, print_console=args.print_console) +print_console = args.print_console or (os.environ.get("PRINT_CONSOLE") == "1") + +LOGGER = get_logger( + args.log_filename, + "stress_receive_sync", + level=logging.INFO, + print_console=print_console +) LOG_PER_COUNT = args.output_interval start_time = time.perf_counter() @@ -105,7 +116,6 @@ def on_event_received(process_monitor, partition_context, event): recv_cnt_map[partition_context.partition_id] += 1 if event else 0 if recv_cnt_map[partition_context.partition_id] % LOG_PER_COUNT == 0: total_time_elapsed = time.perf_counter() - start_time - partition_previous_time = recv_time_map.get(partition_context.partition_id) partition_current_time = time.perf_counter() recv_time_map[partition_context.partition_id] = partition_current_time @@ -213,7 +223,11 @@ def create_client(args): def run(args): - with ProcessMonitor("monitor_{}".format(args.log_filename), "consumer_stress_sync", print_console=args.print_console) as process_monitor: + with ProcessMonitor( + "monitor_{}".format(args.log_filename), + "consumer_stress_sync", + print_console=print_console + ) as process_monitor: kwargs_dict = { "prefetch": args.link_credit, "partition_id": str(args.recv_partition_id) if args.recv_partition_id else None, diff --git a/sdk/eventhub/azure-eventhub/stress/azure_eventhub_producer_stress.py b/sdk/eventhub/azure-eventhub/stress/scripts/azure_eventhub_producer_stress.py similarity index 97% rename from sdk/eventhub/azure-eventhub/stress/azure_eventhub_producer_stress.py rename to sdk/eventhub/azure-eventhub/stress/scripts/azure_eventhub_producer_stress.py index bf6812d82d46..acd275a5a2f6 100644 --- a/sdk/eventhub/azure-eventhub/stress/azure_eventhub_producer_stress.py +++ b/sdk/eventhub/azure-eventhub/stress/scripts/azure_eventhub_producer_stress.py @@ -9,6 +9,7 @@ import time import asyncio from argparse import ArgumentParser +from dotenv import load_dotenv from azure.eventhub import EventHubProducerClient, EventData, EventHubSharedKeyCredential, TransportType from azure.eventhub.exceptions import EventHubError @@ -20,6 +21,8 @@ from process_monitor import ProcessMonitor from app_insights_metric import AzureMonitorMetric +ENV_FILE = os.environ.get('ENV_FILE') + def handle_exception(error, ignore_send_failure, stress_logger, azure_monitor_metric): err_msg = "Sync send failed due to error: {}".format(repr(error)) @@ -89,9 +92,9 @@ async def stress_send_list_async(producer: EventHubProducerClientAsync, args, st class StressTestRunner(object): def __init__(self, argument_parser): self.argument_parser = argument_parser - self.argument_parser.add_argument("-m", "--method", required=True) - self.argument_parser.add_argument("--output_interval", type=float, default=1000) - self.argument_parser.add_argument("--duration", help="Duration in seconds of the test", type=int, default=30) + self.argument_parser.add_argument("-m", "--method", default="stress_send_list_sync") + self.argument_parser.add_argument("--output_interval", type=float, default=int(os.environ.get("OUTPUT_INTERVAL", 5000))) + self.argument_parser.add_argument("--duration", help="Duration in seconds of the test", type=int, default=int(os.environ.get("DURATION", 999999999))) self.argument_parser.add_argument( "--partitions", help="Number of partitions. 0 means to get partitions from eventhubs", @@ -109,9 +112,9 @@ def __init__(self, argument_parser): type=str ) self.argument_parser.add_argument("--conn_str", help="EventHub connection string", - default=os.environ.get('EVENT_HUB_PERF_32_CONN_STR')) + default=os.environ.get('EVENT_HUB_CONN_STR')) parser.add_argument("--auth_timeout", help="Authorization Timeout", type=float, default=60) - self.argument_parser.add_argument("--eventhub", help="Name of EventHub") + self.argument_parser.add_argument("--eventhub", help="Name of EventHub", default=os.environ.get('EVENT_HUB_NAME')) self.argument_parser.add_argument( "--transport_type", help="Transport type, 0 means AMQP, 1 means AMQP over WebSocket", @@ -412,6 +415,7 @@ async def run_test_method_parallel_async(self, test_method, worker, logger, proc if __name__ == '__main__': + load_dotenv(dotenv_path=ENV_FILE, override=True) parser = ArgumentParser() runner = StressTestRunner(parser) runner.run() diff --git a/sdk/eventhub/azure-eventhub/stress/common_use_scripts b/sdk/eventhub/azure-eventhub/stress/scripts/common_use_scripts similarity index 100% rename from sdk/eventhub/azure-eventhub/stress/common_use_scripts rename to sdk/eventhub/azure-eventhub/stress/scripts/common_use_scripts diff --git a/sdk/eventhub/azure-eventhub/stress/scripts/dev_requirement.txt b/sdk/eventhub/azure-eventhub/stress/scripts/dev_requirement.txt new file mode 100644 index 000000000000..d3ffc7a78295 --- /dev/null +++ b/sdk/eventhub/azure-eventhub/stress/scripts/dev_requirement.txt @@ -0,0 +1,9 @@ +psutil +azure-eventhub +azure-eventhub-checkpointstoreblob +azure-eventhub-checkpointstoreblob-aio +azure-servicebus==0.50.3 +azure-storage-blob +azure-identity +opencensus-ext-azure +python-dotenv diff --git a/sdk/eventhub/azure-eventhub/stress/logger.py b/sdk/eventhub/azure-eventhub/stress/scripts/logger.py similarity index 99% rename from sdk/eventhub/azure-eventhub/stress/logger.py rename to sdk/eventhub/azure-eventhub/stress/scripts/logger.py index 0875c2e8a7e0..f8014397569e 100644 --- a/sdk/eventhub/azure-eventhub/stress/logger.py +++ b/sdk/eventhub/azure-eventhub/stress/scripts/logger.py @@ -3,7 +3,6 @@ # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- -import os import sys import logging from logging.handlers import RotatingFileHandler diff --git a/sdk/eventhub/azure-eventhub/stress/process_monitor.py b/sdk/eventhub/azure-eventhub/stress/scripts/process_monitor.py similarity index 100% rename from sdk/eventhub/azure-eventhub/stress/process_monitor.py rename to sdk/eventhub/azure-eventhub/stress/scripts/process_monitor.py diff --git a/sdk/eventhub/azure-eventhub/stress/stress_runner.cfg b/sdk/eventhub/azure-eventhub/stress/scripts/stress_runner.cfg similarity index 100% rename from sdk/eventhub/azure-eventhub/stress/stress_runner.cfg rename to sdk/eventhub/azure-eventhub/stress/scripts/stress_runner.cfg diff --git a/sdk/eventhub/azure-eventhub/stress/stress_runner.py b/sdk/eventhub/azure-eventhub/stress/scripts/stress_runner.py similarity index 100% rename from sdk/eventhub/azure-eventhub/stress/stress_runner.py rename to sdk/eventhub/azure-eventhub/stress/scripts/stress_runner.py diff --git a/sdk/eventhub/azure-eventhub/stress/templates/network_loss.yaml b/sdk/eventhub/azure-eventhub/stress/templates/network_loss.yaml new file mode 100644 index 000000000000..4811c7a1b1a3 --- /dev/null +++ b/sdk/eventhub/azure-eventhub/stress/templates/network_loss.yaml @@ -0,0 +1,31 @@ +apiVersion: chaos-mesh.org/v1alpha1 +kind: NetworkChaos +metadata: + name: '{{ .Release.Name }}-{{ .Release.Revision }}' + namespace: {{ .Release.Namespace }} + annotations: + experiment.chaos-mesh.org/pause: 'true' + labels: + scenario: 'stress' + release: '{{ .Release.Name }}' + revision: '{{ .Release.Revision }}' +spec: + scheduler: + cron: '@every 30s' + duration: '10s' + action: loss + direction: to + externalTargets: + - 'eh-stress-{{ .Release.Name }}-{{ .Release.Revision }}.servicebus.windows.net' + mode: one + selector: + labelSelectors: + testInstance: "eventhub-{{ .Release.Name }}-{{ .Release.Revision }}" + chaos: 'true' + namespaces: + - {{ .Release.Namespace }} + podPhaseSelectors: + - 'Running' + loss: + loss: '100' + correlation: '100' diff --git a/sdk/eventhub/azure-eventhub/stress/templates/testjob.yaml b/sdk/eventhub/azure-eventhub/stress/templates/testjob.yaml new file mode 100644 index 000000000000..fde684783937 --- /dev/null +++ b/sdk/eventhub/azure-eventhub/stress/templates/testjob.yaml @@ -0,0 +1,16 @@ +{{- include "stress-test-addons.deploy-job-template.from-pod" (list . "stress.python-eh-stress") -}} +{{- define "stress.python-eh-stress" -}} +metadata: + labels: + testName: "deploy-python-eh-stress" + testInstance: "eventhub-{{ .Release.Name }}-{{ .Release.Revision }}" + chaos: "true" +spec: + containers: + - name: python-eh-stress + image: {{ default "stresstestregistry.azurecr.io/python" .Values.repository }}/stress:{{ default "v2" .Values.tag }} + command: ['bash', '-c', 'python3 azure_eventhub_producer_stress.py & python3 azure_eventhub_consumer_stress_sync.py'] + {{- include "stress-test-addons.container-env" . | nindent 6 }} + # async test command + # command: ['bash', '-c', 'python3 azure_eventhub_producer_stress.py -m stress_send_list_async & python3 azure_eventhub_consumer_stress_async.py'] +{{- end -}} diff --git a/sdk/eventhub/azure-eventhub/stress/test-resources.bicep b/sdk/eventhub/azure-eventhub/stress/test-resources.bicep new file mode 100644 index 000000000000..353192bab4f7 --- /dev/null +++ b/sdk/eventhub/azure-eventhub/stress/test-resources.bicep @@ -0,0 +1,107 @@ +@description('The base resource name.') +param baseName string = resourceGroup().name + +@description('The client OID to grant access to test resources.') +param testApplicationOid string + +@description('The location of the resources. By default, this is the same as the resource group.') +param location string = resourceGroup().location + +@description('The url suffix to use when creating storage connection strings.') +param storageEndpointSuffix string = 'core.windows.net' + +var ehVersion = '2017-04-01' +var contributorRoleId = 'b24988ac-6180-42a0-ab88-20f7382dd24c' +var eventHubsDataOwnerRoleId = 'f526a384-b230-433a-b45c-95f59c4a2dec' +var eventHubsNamespace_var = 'eh-${baseName}' +var eventHubName = 'eh-${baseName}-hub' +var eventHubAuthRuleName = 'eh-${baseName}-hub-auth-rule' +var storageAccount_var = replace('blb${baseName}', '-', '') +var containerName = 'your-blob-container-name' +var defaultSASKeyName = 'RootManageSharedAccessKey' +var eventHubsAuthRuleResourceId = resourceId('Microsoft.EventHub/namespaces/authorizationRules', eventHubsNamespace_var, defaultSASKeyName) +var storageAccountId = storageAccount.id + +resource eventHubsNamespace 'Microsoft.EventHub/Namespaces@[variables(\'ehVersion\')]' = { + name: eventHubsNamespace_var + location: location + sku: { + name: 'Standard' + tier: 'Standard' + } + properties: {} +} + +resource eventHubsNamespace_eventHubName 'Microsoft.EventHub/namespaces/eventhubs@[variables(\'ehVersion\')]' = { + name: '${eventHubsNamespace_var}/${eventHubName}' + location: location + properties: { + messageRetentionInDays: 1 + partitionCount: 32 + } + dependsOn: [ + eventHubsNamespace + ] +} + +resource eventHubsNamespace_eventHubName_eventHubAuthRuleName 'Microsoft.EventHub/namespaces/eventhubs/authorizationRules@[variables(\'ehVersion\')]' = { + name: '${eventHubsNamespace_var}/${eventHubName}/${eventHubAuthRuleName}' + properties: { + Rights: [ + 'Manage' + 'Send' + 'Listen' + ] + } + dependsOn: [ + eventHubsNamespace_eventHubName + ] +} + +resource storageAccount 'Microsoft.Storage/storageAccounts@2019-06-01' = { + name: storageAccount_var + location: location + sku: { + name: 'Standard_LRS' + tier: 'Standard' + } + kind: 'StorageV2' + properties: { + accessTier: 'Hot' + } +} + +resource storageAccount_default_containerName 'Microsoft.Storage/storageAccounts/blobServices/containers@2019-06-01' = { + name: '${storageAccount_var}/default/${containerName}' + dependsOn: [ + storageAccount + ] +} + +resource id_name_baseName_eventHubsDataOwnerRoleId_testApplicationOid 'Microsoft.Authorization/roleAssignments@2019-04-01-preview' = { + name: guid(resourceGroup().id, deployment().name, baseName, eventHubsDataOwnerRoleId, testApplicationOid) + properties: { + roleDefinitionId: resourceId('Microsoft.Authorization/roleDefinitions', eventHubsDataOwnerRoleId) + principalId: testApplicationOid + scope: resourceGroup().id + } +} + +resource id_name_baseName_contributorRoleId_testApplicationOid 'Microsoft.Authorization/roleAssignments@2019-04-01-preview' = { + name: guid(resourceGroup().id, deployment().name, baseName, contributorRoleId, testApplicationOid) + properties: { + roleDefinitionId: resourceId('Microsoft.Authorization/roleDefinitions', contributorRoleId) + principalId: testApplicationOid + scope: resourceGroup().id + } +} + +output EVENT_HUB_NAMESPACE string = eventHubsNamespace_var +output EVENT_HUB_HOSTNAME string = '${eventHubsNamespace_var}.servicebus.windows.net' +output EVENT_HUB_CONN_STR string = listkeys(eventHubAuthRuleName, ehVersion).primaryConnectionString +output EVENT_HUB_NAME string = eventHubName +output EVENT_HUB_SAS_POLICY string = eventHubAuthRuleName +output EVENT_HUB_SAS_KEY string = listkeys(eventHubAuthRuleName, ehVersion).primaryKey +output AZURE_STORAGE_CONN_STR string = 'DefaultEndpointsProtocol=https;AccountName=${storageAccount_var};AccountKey=${listKeys(storageAccountId, providers('Microsoft.Storage', 'storageAccounts').apiVersions[0]).keys[0].value};EndpointSuffix=${storageEndpointSuffix}' +output AZURE_STORAGE_ACCOUNT string = storageAccount_var +output AZURE_STORAGE_ACCESS_KEY string = listKeys(storageAccountId, providers('Microsoft.Storage', 'storageAccounts').apiVersions[0]).keys[0].value \ No newline at end of file diff --git a/sdk/eventhub/azure-eventhub/stress/test-resources.json b/sdk/eventhub/azure-eventhub/stress/test-resources.json new file mode 100644 index 000000000000..3b46c8e656a7 --- /dev/null +++ b/sdk/eventhub/azure-eventhub/stress/test-resources.json @@ -0,0 +1,169 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "baseName": { + "type": "string", + "defaultValue": "[resourceGroup().name]", + "metadata": { + "description": "The base resource name." + } + }, + "testApplicationOid": { + "type": "string", + "metadata": { + "description": "The client OID to grant access to test resources." + } + }, + "location": { + "type": "string", + "defaultValue": "[resourceGroup().location]", + "metadata": { + "description": "The location of the resources. By default, this is the same as the resource group." + } + }, + "storageEndpointSuffix": { + "type": "string", + "defaultValue": "core.windows.net", + "metadata": { + "description": "The url suffix to use when creating storage connection strings." + } + } + }, + "variables": { + "ehVersion": "2017-04-01", + "contributorRoleId": "b24988ac-6180-42a0-ab88-20f7382dd24c", + "eventHubsDataOwnerRoleId": "f526a384-b230-433a-b45c-95f59c4a2dec", + "eventHubsNamespace": "[concat('eh-', parameters('baseName'))]", + "eventHubName": "[concat('eh-', parameters('baseName'), '-hub')]", + "eventHubAuthRuleName": "[concat('eh-', parameters('baseName'), '-hub-auth-rule')]", + "storageAccount": "[replace(concat('blb', parameters('baseName')), '-', '')]", + "containerName": "your-blob-container-name", + "defaultSASKeyName": "RootManageSharedAccessKey", + "eventHubsAuthRuleResourceId": "[resourceId('Microsoft.EventHub/namespaces/authorizationRules', variables('eventHubsNamespace'), variables('defaultSASKeyName'))]", + "storageAccountId": "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccount'))]" + }, + "resources": [ + { + "apiVersion": "[variables('ehVersion')]", + "name": "[variables('eventHubsNamespace')]", + "type": "Microsoft.EventHub/Namespaces", + "location": "[parameters('location')]", + "sku": { + "name": "Standard", + "tier": "Standard" + }, + "resources": [ + { + "type": "Microsoft.EventHub/namespaces/eventhubs", + "apiVersion": "[variables('ehVersion')]", + "name": "[concat(variables('eventHubsNamespace'), '/', variables('eventHubName'))]", + "location": "[parameters('location')]", + "dependsOn": [ + "[resourceId('Microsoft.EventHub/namespaces', variables('eventHubsNamespace'))]" + ], + "properties": { + "messageRetentionInDays": 1, + "partitionCount": 32 + }, + "resources": [ + { + "apiVersion": "[variables('ehVersion')]", + "name": "[variables('eventHubAuthRuleName')]", + "type": "authorizationRules", + "dependsOn": [ + "[variables('eventHubName')]" + ], + "properties": { + "Rights": ["Manage", "Send", "Listen"] + } + } + ] + } + ], + "properties": {} + }, + { + "type": "Microsoft.Storage/storageAccounts", + "apiVersion": "2019-06-01", + "name": "[variables('storageAccount')]", + "location": "[parameters('location')]", + "sku": { + "name": "Standard_LRS", + "tier": "Standard" + }, + "kind": "StorageV2", + "properties": { + "accessTier": "Hot" + }, + "resources": [ + { + "type": "blobServices/containers", + "apiVersion": "2019-06-01", + "name": "[concat('default/', variables('containerName'))]", + "dependsOn": [ + "[variables('storageAccount')]" + ] + } + ] + }, + { + "type": "Microsoft.Authorization/roleAssignments", + "apiVersion": "2019-04-01-preview", + "name": "[guid(resourceGroup().id, deployment().name, parameters('baseName'), variables('eventHubsDataOwnerRoleId'), parameters('testApplicationOid'))]", + "properties": { + "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', variables('eventHubsDataOwnerRoleId'))]", + "principalId": "[parameters('testApplicationOid')]", + "scope": "[resourceGroup().id]" + } + }, + { + "type": "Microsoft.Authorization/roleAssignments", + "apiVersion": "2019-04-01-preview", + "name": "[guid(resourceGroup().id, deployment().name, parameters('baseName'), variables('contributorRoleId'), parameters('testApplicationOid'))]", + "properties": { + "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', variables('contributorRoleId'))]", + "principalId": "[parameters('testApplicationOid')]", + "scope": "[resourceGroup().id]" + } + } + ], + "outputs": { + "EVENT_HUB_NAMESPACE": { + "type": "string", + "value": "[variables('eventHubsNamespace')]" + }, + "EVENT_HUB_HOSTNAME": { + "type": "string", + "value": "[concat(variables('eventHubsNamespace'), '.servicebus.windows.net')]" + }, + "EVENT_HUB_CONN_STR": { + "type": "string", + "value": "[listkeys(variables('eventHubAuthRuleName'), variables('ehVersion')).primaryConnectionString]" + }, + "EVENT_HUB_NAME": { + "type": "string", + "value": "[variables('eventHubName')]" + }, + "EVENT_HUB_SAS_POLICY":{ + "type": "string", + "value": "[variables('eventHubAuthRuleName')]" + }, + "EVENT_HUB_SAS_KEY":{ + "type": "string", + "value": "[listkeys(variables('eventHubAuthRuleName'), variables('ehVersion')).primaryKey]" + }, + "AZURE_STORAGE_CONN_STR": { + "type": "string", + "value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccount'), ';AccountKey=', listKeys(variables('storageAccountId'), providers('Microsoft.Storage', 'storageAccounts').apiVersions[0]).keys[0].value, ';EndpointSuffix=', parameters('storageEndpointSuffix'))]" + }, + "AZURE_STORAGE_ACCOUNT": { + "type": "string", + "value": "[variables('storageAccount')]" + }, + "AZURE_STORAGE_ACCESS_KEY":{ + "type": "string", + "value": "[listKeys(variables('storageAccountId'), providers('Microsoft.Storage', 'storageAccounts').apiVersions[0]).keys[0].value]" + } + } +} From 30b196e4061d4b943008aaec1e32547bae2db883 Mon Sep 17 00:00:00 2001 From: iscai-msft <43154838+iscai-msft@users.noreply.github.com> Date: Wed, 22 Sep 2021 12:32:29 -0400 Subject: [PATCH 85/85] [rest] add backcompat mixin to rest requests (#20599) --- .../azure-core/azure/core/_pipeline_client.py | 15 +- .../azure/core/_pipeline_client_async.py | 5 +- .../azure/core/pipeline/transport/_base.py | 121 +----- .../azure-core/azure/core/rest/_helpers.py | 279 ++++++++---- sdk/core/azure-core/azure/core/rest/_rest.py | 25 +- .../azure-core/azure/core/rest/_rest_py3.py | 28 +- .../utils/_pipeline_transport_rest_shared.py | 204 +++++++++ .../async_tests/test_authentication_async.py | 60 +-- .../async_tests/test_base_polling_async.py | 104 +++-- .../async_tests/test_basic_transport_async.py | 186 ++++---- .../test_http_logging_policy_async.py | 25 +- .../tests/async_tests/test_pipeline_async.py | 37 +- .../tests/async_tests/test_request_asyncio.py | 14 +- .../tests/async_tests/test_request_trio.py | 13 +- .../async_tests/test_retry_policy_async.py | 55 ++- .../test_stream_generator_async.py | 9 +- .../tests/async_tests/test_streaming_async.py | 41 +- .../async_tests/test_testserver_async.py | 8 +- .../test_tracing_decorator_async.py | 37 +- .../async_tests/test_universal_http_async.py | 28 +- .../azure-core/tests/test_authentication.py | 96 +++-- .../azure-core/tests/test_base_polling.py | 106 +++-- .../azure-core/tests/test_basic_transport.py | 230 +++++----- .../tests/test_custom_hook_policy.py | 31 +- sdk/core/azure-core/tests/test_error_map.py | 22 +- .../tests/test_http_logging_policy.py | 24 +- sdk/core/azure-core/tests/test_pipeline.py | 105 +++-- .../tests/test_request_id_policy.py | 15 +- .../tests/test_requests_universal.py | 10 +- .../azure-core/tests/test_rest_backcompat.py | 403 ++++++++++++++++++ .../tests/test_rest_http_request.py | 117 ++++- .../azure-core/tests/test_retry_policy.py | 57 +-- .../azure-core/tests/test_stream_generator.py | 11 +- sdk/core/azure-core/tests/test_streaming.py | 42 +- sdk/core/azure-core/tests/test_testserver.py | 9 +- .../tests/test_tracing_decorator.py | 43 +- .../azure-core/tests/test_tracing_policy.py | 29 +- .../tests/test_universal_pipeline.py | 27 +- .../tests/test_user_agent_policy.py | 13 +- sdk/core/azure-core/tests/utils.py | 43 ++ 40 files changed, 1873 insertions(+), 854 deletions(-) create mode 100644 sdk/core/azure-core/azure/core/utils/_pipeline_transport_rest_shared.py create mode 100644 sdk/core/azure-core/tests/test_rest_backcompat.py create mode 100644 sdk/core/azure-core/tests/utils.py diff --git a/sdk/core/azure-core/azure/core/_pipeline_client.py b/sdk/core/azure-core/azure/core/_pipeline_client.py index 44e5995c5f84..f29f391c4ed2 100644 --- a/sdk/core/azure-core/azure/core/_pipeline_client.py +++ b/sdk/core/azure-core/azure/core/_pipeline_client.py @@ -65,17 +65,6 @@ _LOGGER = logging.getLogger(__name__) -def _prepare_request(request): - # returns the request ready to run through pipelines - # and a bool telling whether we ended up converting it - rest_request = False - try: - request_to_run = request._to_pipeline_transport_request() # pylint: disable=protected-access - rest_request = True - except AttributeError: - request_to_run = request - return rest_request, request_to_run - class PipelineClient(PipelineClientBase): """Service client core methods. @@ -204,9 +193,9 @@ def send_request(self, request, **kwargs): :return: The response of your network call. Does not do error handling on your response. :rtype: ~azure.core.rest.HttpResponse # """ - rest_request, request_to_run = _prepare_request(request) + rest_request = hasattr(request, "content") return_pipeline_response = kwargs.pop("_return_pipeline_response", False) - pipeline_response = self._pipeline.run(request_to_run, **kwargs) # pylint: disable=protected-access + pipeline_response = self._pipeline.run(request, **kwargs) # pylint: disable=protected-access response = pipeline_response.http_response if rest_request: response = _to_rest_response(response) diff --git a/sdk/core/azure-core/azure/core/_pipeline_client_async.py b/sdk/core/azure-core/azure/core/_pipeline_client_async.py index 357b3d9b917d..ad8b758d07af 100644 --- a/sdk/core/azure-core/azure/core/_pipeline_client_async.py +++ b/sdk/core/azure-core/azure/core/_pipeline_client_async.py @@ -37,7 +37,6 @@ RequestIdPolicy, AsyncRetryPolicy, ) -from ._pipeline_client import _prepare_request from .pipeline._tools_async import to_rest_response as _to_rest_response try: @@ -175,10 +174,10 @@ def _build_pipeline(self, config, **kwargs): # pylint: disable=no-self-use return AsyncPipeline(transport, policies) async def _make_pipeline_call(self, request, **kwargs): - rest_request, request_to_run = _prepare_request(request) + rest_request = hasattr(request, "content") return_pipeline_response = kwargs.pop("_return_pipeline_response", False) pipeline_response = await self._pipeline.run( - request_to_run, **kwargs # pylint: disable=protected-access + request, **kwargs # pylint: disable=protected-access ) response = pipeline_response.http_response if rest_request: diff --git a/sdk/core/azure-core/azure/core/pipeline/transport/_base.py b/sdk/core/azure-core/azure/core/pipeline/transport/_base.py index 761c61caa9ae..7c420a392059 100644 --- a/sdk/core/azure-core/azure/core/pipeline/transport/_base.py +++ b/sdk/core/azure-core/azure/core/pipeline/transport/_base.py @@ -34,7 +34,6 @@ from io import BytesIO import json import logging -import os import time import copy @@ -50,7 +49,6 @@ TYPE_CHECKING, Generic, TypeVar, - cast, IO, List, Union, @@ -63,7 +61,7 @@ Type ) -from six.moves.http_client import HTTPConnection, HTTPResponse as _HTTPResponse +from six.moves.http_client import HTTPResponse as _HTTPResponse from azure.core.exceptions import HttpResponseError from azure.core.pipeline import ( @@ -75,6 +73,12 @@ ) from .._tools import await_result as _await_result from ...utils._utils import _case_insensitive_dict +from ...utils._pipeline_transport_rest_shared import ( + _format_parameters_helper, + _prepare_multipart_body_helper, + _serialize_request, + _format_data_helper, +) if TYPE_CHECKING: @@ -127,36 +131,6 @@ def _urljoin(base_url, stub_url): parsed = parsed._replace(path=parsed.path.rstrip("/") + "/" + stub_url) return parsed.geturl() - -class _HTTPSerializer(HTTPConnection, object): - """Hacking the stdlib HTTPConnection to serialize HTTP request as strings. - """ - - def __init__(self, *args, **kwargs): - self.buffer = b"" - kwargs.setdefault("host", "fakehost") - super(_HTTPSerializer, self).__init__(*args, **kwargs) - - def putheader(self, header, *values): - if header in ["Host", "Accept-Encoding"]: - return - super(_HTTPSerializer, self).putheader(header, *values) - - def send(self, data): - self.buffer += data - - -def _serialize_request(http_request): - serializer = _HTTPSerializer() - serializer.request( - method=http_request.method, - url=http_request.url, - body=http_request.body, - headers=http_request.headers, - ) - return serializer.buffer - - class HttpTransport( AbstractContextManager, ABC, Generic[HTTPRequestType, HTTPResponseType] ): # type: ignore @@ -253,16 +227,7 @@ def _format_data(data): :param data: The request field data. :type data: str or file-like object. """ - if hasattr(data, "read"): - data = cast(IO, data) - data_name = None - try: - if data.name[0] != "<" and data.name[-1] != ">": - data_name = os.path.basename(data.name) - except (AttributeError, TypeError): - pass - return (data_name, data, "application/octet-stream") - return (None, cast(str, data)) + return _format_data_helper(data) def format_parameters(self, params): # type: (Dict[str, str]) -> None @@ -272,26 +237,7 @@ def format_parameters(self, params): :param dict params: A dictionary of parameters. """ - query = urlparse(self.url).query - if query: - self.url = self.url.partition("?")[0] - existing_params = { - p[0]: p[-1] for p in [p.partition("=") for p in query.split("&")] - } - params.update(existing_params) - query_params = [] - for k, v in params.items(): - if isinstance(v, list): - for w in v: - if w is None: - raise ValueError("Query parameter {} cannot be None".format(k)) - query_params.append("{}={}".format(k, w)) - else: - if v is None: - raise ValueError("Query parameter {} cannot be None".format(k)) - query_params.append("{}={}".format(k, v)) - query = "?" + "&".join(query_params) - self.url = self.url + query + return _format_parameters_helper(self, params) def set_streamed_data_body(self, data): """Set a streamable data body. @@ -416,54 +362,7 @@ def prepare_multipart_body(self, content_index=0): :returns: The updated index after all parts in this request have been added. :rtype: int """ - if not self.multipart_mixed_info: - return 0 - - requests = self.multipart_mixed_info[0] # type: List[HttpRequest] - boundary = self.multipart_mixed_info[2] # type: Optional[str] - - # Update the main request with the body - main_message = Message() - main_message.add_header("Content-Type", "multipart/mixed") - if boundary: - main_message.set_boundary(boundary) - - for req in requests: - part_message = Message() - if req.multipart_mixed_info: - content_index = req.prepare_multipart_body(content_index=content_index) - part_message.add_header("Content-Type", req.headers['Content-Type']) - payload = req.serialize() - # We need to remove the ~HTTP/1.1 prefix along with the added content-length - payload = payload[payload.index(b'--'):] - else: - part_message.add_header("Content-Type", "application/http") - part_message.add_header("Content-Transfer-Encoding", "binary") - part_message.add_header("Content-ID", str(content_index)) - payload = req.serialize() - content_index += 1 - part_message.set_payload(payload) - main_message.attach(part_message) - - try: - from email.policy import HTTP - - full_message = main_message.as_bytes(policy=HTTP) - eol = b"\r\n" - except ImportError: # Python 2.7 - # Right now we decide to not support Python 2.7 on serialization, since - # it doesn't serialize a valid HTTP request (and our main scenario Storage refuses it) - raise NotImplementedError( - "Multipart request are not supported on Python 2.7" - ) - # full_message = main_message.as_string() - # eol = b'\n' - _, _, body = full_message.split(eol, 2) - self.set_bytes_body(body) - self.headers["Content-Type"] = ( - "multipart/mixed; boundary=" + main_message.get_boundary() - ) - return content_index + return _prepare_multipart_body_helper(self, content_index) def serialize(self): # type: () -> bytes diff --git a/sdk/core/azure-core/azure/core/rest/_helpers.py b/sdk/core/azure-core/azure/core/rest/_helpers.py index 072d9f70992d..3aba4c5a8fda 100644 --- a/sdk/core/azure-core/azure/core/rest/_helpers.py +++ b/sdk/core/azure-core/azure/core/rest/_helpers.py @@ -23,12 +23,13 @@ # IN THE SOFTWARE. # # -------------------------------------------------------------------------- -import os import codecs import cgi -from enum import Enum from json import dumps -import collections +try: + import collections.abc as collections +except ImportError: + import collections # type: ignore from typing import ( Optional, Union, @@ -40,17 +41,23 @@ Any, Dict, Iterable, - Iterator, - cast, - Callable, ) import xml.etree.ElementTree as ET import six try: + binary_type = str from urlparse import urlparse # type: ignore except ImportError: + binary_type = bytes # type: ignore from urllib.parse import urlparse from azure.core.serialization import AzureJSONEncoder +from ..utils._pipeline_transport_rest_shared import ( + _format_parameters_helper, + _pad_attr_name, + _prepare_multipart_body_helper, + _serialize_request, + _format_data_helper, +) ################################### TYPES SECTION ######################### @@ -73,19 +80,6 @@ ContentTypeBase = Union[str, bytes, Iterable[bytes]] -class HttpVerbs(str, Enum): - GET = "GET" - PUT = "PUT" - POST = "POST" - HEAD = "HEAD" - PATCH = "PATCH" - DELETE = "DELETE" - MERGE = "MERGE" - -########################### ERRORS SECTION ################################# - - - ########################### HELPER SECTION ################################# def _verify_data_object(name, value): @@ -102,25 +96,6 @@ def _verify_data_object(name, value): ) ) -def _format_data(data): - # type: (Union[str, IO]) -> Union[Tuple[None, str], Tuple[Optional[str], IO, str]] - """Format field data according to whether it is a stream or - a string for a form-data request. - - :param data: The request field data. - :type data: str or file-like object. - """ - if hasattr(data, "read"): - data = cast(IO, data) - data_name = None - try: - if data.name[0] != "<" and data.name[-1] != ">": - data_name = os.path.basename(data.name) - except (AttributeError, TypeError): - pass - return (data_name, data, "application/octet-stream") - return (None, cast(str, data)) - def set_urlencoded_body(data, has_files): body = {} default_headers = {} @@ -141,7 +116,7 @@ def set_urlencoded_body(data, has_files): def set_multipart_body(files): formatted_files = { - f: _format_data(d) for f, d in files.items() if d is not None + f: _format_data_helper(d) for f, d in files.items() if d is not None } return {}, formatted_files @@ -189,35 +164,6 @@ def set_json_body(json): "Content-Length": str(len(body)) }, body -def format_parameters(url, params): - """Format parameters into a valid query string. - It's assumed all parameters have already been quoted as - valid URL strings. - - :param dict params: A dictionary of parameters. - """ - query = urlparse(url).query - if query: - url = url.partition("?")[0] - existing_params = { - p[0]: p[-1] for p in [p.partition("=") for p in query.split("&")] - } - params.update(existing_params) - query_params = [] - for k, v in params.items(): - if isinstance(v, list): - for w in v: - if w is None: - raise ValueError("Query parameter {} cannot be None".format(k)) - query_params.append("{}={}".format(k, w)) - else: - if v is None: - raise ValueError("Query parameter {} cannot be None".format(k)) - query_params.append("{}={}".format(k, v)) - query = "?" + "&".join(query_params) - url += query - return url - def lookup_encoding(encoding): # type: (str) -> bool # including check for whether encoding is known taken from httpx @@ -227,25 +173,6 @@ def lookup_encoding(encoding): except LookupError: return False -def to_pipeline_transport_request_helper(rest_request): - from ..pipeline.transport import HttpRequest as PipelineTransportHttpRequest - return PipelineTransportHttpRequest( - method=rest_request.method, - url=rest_request.url, - headers=rest_request.headers, - files=rest_request._files, # pylint: disable=protected-access - data=rest_request._data # pylint: disable=protected-access - ) - -def from_pipeline_transport_request_helper(request_class, pipeline_transport_request): - return request_class( - method=pipeline_transport_request.method, - url=pipeline_transport_request.url, - headers=pipeline_transport_request.headers, - files=pipeline_transport_request.files, - data=pipeline_transport_request.data - ) - def get_charset_encoding(response): # type: (...) -> Optional[str] content_type = response.headers.get("Content-Type") @@ -267,3 +194,181 @@ def decode_to_text(encoding, content): if encoding: return content.decode(encoding) return codecs.getincrementaldecoder("utf-8-sig")(errors="replace").decode(content) + +class HttpRequestBackcompatMixin(object): + + def __getattr__(self, attr): + backcompat_attrs = [ + "files", + "data", + "multipart_mixed_info", + "query", + "body", + "format_parameters", + "set_streamed_data_body", + "set_text_body", + "set_xml_body", + "set_json_body", + "set_formdata_body", + "set_bytes_body", + "set_multipart_mixed", + "prepare_multipart_body", + "serialize", + ] + attr = _pad_attr_name(attr, backcompat_attrs) + return self.__getattribute__(attr) + + def __setattr__(self, attr, value): + backcompat_attrs = [ + "multipart_mixed_info", + "files", + "data", + "body", + ] + attr = _pad_attr_name(attr, backcompat_attrs) + super(HttpRequestBackcompatMixin, self).__setattr__(attr, value) + + @property + def _multipart_mixed_info(self): + """DEPRECATED: Information used to make multipart mixed requests. + This is deprecated and will be removed in a later release. + """ + try: + return self._multipart_mixed_info_val + except AttributeError: + return None + + @_multipart_mixed_info.setter + def _multipart_mixed_info(self, val): + """DEPRECATED: Set information to make multipart mixed requests. + This is deprecated and will be removed in a later release. + """ + self._multipart_mixed_info_val = val + + @property + def _query(self): + """DEPRECATED: Query parameters passed in by user + This is deprecated and will be removed in a later release. + """ + query = urlparse(self.url).query + if query: + return {p[0]: p[-1] for p in [p.partition("=") for p in query.split("&")]} + return {} + + @property + def _body(self): + """DEPRECATED: Body of the request. You should use the `content` property instead + This is deprecated and will be removed in a later release. + """ + return self._data + + @_body.setter + def _body(self, val): + """DEPRECATED: Set the body of the request + This is deprecated and will be removed in a later release. + """ + self._data = val + + def _format_parameters(self, params): + """DEPRECATED: Format the query parameters + This is deprecated and will be removed in a later release. + You should pass the query parameters through the kwarg `params` + instead. + """ + return _format_parameters_helper(self, params) + + def _set_streamed_data_body(self, data): + """DEPRECATED: Set the streamed request body. + This is deprecated and will be removed in a later release. + You should pass your stream content through the `content` kwarg instead + """ + if not isinstance(data, binary_type) and not any( + hasattr(data, attr) for attr in ["read", "__iter__", "__aiter__"] + ): + raise TypeError( + "A streamable data source must be an open file-like object or iterable." + ) + headers = self._set_body(content=data) + self._files = None + self.headers.update(headers) + + def _set_text_body(self, data): + """DEPRECATED: Set the text body + This is deprecated and will be removed in a later release. + You should pass your text content through the `content` kwarg instead + """ + headers = self._set_body(content=data) + self.headers.update(headers) + self._files = None + + def _set_xml_body(self, data): + """DEPRECATED: Set the xml body. + This is deprecated and will be removed in a later release. + You should pass your xml content through the `content` kwarg instead + """ + headers = self._set_body(content=data) + self.headers.update(headers) + self._files = None + + def _set_json_body(self, data): + """DEPRECATED: Set the json request body. + This is deprecated and will be removed in a later release. + You should pass your json content through the `json` kwarg instead + """ + headers = self._set_body(json=data) + self.headers.update(headers) + self._files = None + + def _set_formdata_body(self, data=None): + """DEPRECATED: Set the formrequest body. + This is deprecated and will be removed in a later release. + You should pass your stream content through the `files` kwarg instead + """ + if data is None: + data = {} + content_type = self.headers.pop("Content-Type", None) if self.headers else None + + if content_type and content_type.lower() == "application/x-www-form-urlencoded": + headers = self._set_body(data=data) + self._files = None + else: # Assume "multipart/form-data" + headers = self._set_body(files=data) + self._data = None + self.headers.update(headers) + + def _set_bytes_body(self, data): + """DEPRECATED: Set the bytes request body. + This is deprecated and will be removed in a later release. + You should pass your bytes content through the `content` kwarg instead + """ + headers = self._set_body(content=data) + # we don't want default Content-Type + # in 2.7, byte strings are still strings, so they get set with text/plain content type + + headers.pop("Content-Type", None) + self.headers.update(headers) + self._files = None + + def _set_multipart_mixed(self, *requests, **kwargs): + """DEPRECATED: Set the multipart mixed info. + This is deprecated and will be removed in a later release. + """ + self.multipart_mixed_info = ( + requests, + kwargs.pop("policies", []), + kwargs.pop("boundary", None), + kwargs + ) + + def _prepare_multipart_body(self, content_index=0): + """DEPRECATED: Prepare your request body for multipart requests. + This is deprecated and will be removed in a later release. + """ + return _prepare_multipart_body_helper(self, content_index) + + def _serialize(self): + """DEPRECATED: Serialize this request using application/http spec. + This is deprecated and will be removed in a later release. + :rtype: bytes + """ + return _serialize_request(self) diff --git a/sdk/core/azure-core/azure/core/rest/_rest.py b/sdk/core/azure-core/azure/core/rest/_rest.py index 88c7835b1df6..d021c26b569e 100644 --- a/sdk/core/azure-core/azure/core/rest/_rest.py +++ b/sdk/core/azure-core/azure/core/rest/_rest.py @@ -32,16 +32,14 @@ from ..utils._utils import _case_insensitive_dict from ._helpers import ( - FilesType, set_content_body, set_json_body, set_multipart_body, set_urlencoded_body, - format_parameters, - to_pipeline_transport_request_helper, - from_pipeline_transport_request_helper, + _format_parameters_helper, get_charset_encoding, decode_to_text, + HttpRequestBackcompatMixin, ) from ..exceptions import ResponseNotReadError if TYPE_CHECKING: @@ -63,7 +61,7 @@ ################################## CLASSES ###################################### -class HttpRequest(object): +class HttpRequest(HttpRequestBackcompatMixin): """Provisional object that represents an HTTP request. **This object is provisional**, meaning it may be changed in a future release. @@ -107,7 +105,7 @@ def __init__(self, method, url, **kwargs): params = kwargs.pop("params", None) if params: - self.url = format_parameters(self.url, params) + _format_parameters_helper(self, params) self._files = None self._data = None @@ -127,10 +125,14 @@ def __init__(self, method, url, **kwargs): ) ) - def _set_body(self, content, data, files, json): - # type: (Optional[ContentType], Optional[dict], Optional[FilesType], Any) -> HeadersType + def _set_body(self, **kwargs): + # type: (Any) -> HeadersType """Sets the body of the request, and returns the default headers """ + content = kwargs.pop("content", None) + data = kwargs.pop("data", None) + files = kwargs.pop("files", None) + json = kwargs.pop("json", None) default_headers = {} if data is not None and not isinstance(data, dict): # should we warn? @@ -183,13 +185,6 @@ def __deepcopy__(self, memo=None): except (ValueError, TypeError): return copy.copy(self) - def _to_pipeline_transport_request(self): - return to_pipeline_transport_request_helper(self) - - @classmethod - def _from_pipeline_transport_request(cls, pipeline_transport_request): - return from_pipeline_transport_request_helper(cls, pipeline_transport_request) - class _HttpResponseBase(object): # pylint: disable=too-many-instance-attributes def __init__(self, **kwargs): diff --git a/sdk/core/azure-core/azure/core/rest/_rest_py3.py b/sdk/core/azure-core/azure/core/rest/_rest_py3.py index a69199815f81..e66cad7d34ee 100644 --- a/sdk/core/azure-core/azure/core/rest/_rest_py3.py +++ b/sdk/core/azure-core/azure/core/rest/_rest_py3.py @@ -31,11 +31,10 @@ Any, AsyncIterable, AsyncIterator, - Dict, Iterable, Iterator, Optional, - Type, Union, + cast, ) @@ -47,15 +46,13 @@ ParamsType, FilesType, HeadersType, - cast, set_json_body, set_multipart_body, set_urlencoded_body, - format_parameters, - to_pipeline_transport_request_helper, - from_pipeline_transport_request_helper, + _format_parameters_helper, get_charset_encoding, decode_to_text, + HttpRequestBackcompatMixin, ) from ._helpers_py3 import set_content_body from ..exceptions import ResponseNotReadError @@ -84,7 +81,7 @@ async def close(self): ################################## CLASSES ###################################### -class HttpRequest: +class HttpRequest(HttpRequestBackcompatMixin): """**Provisional** object that represents an HTTP request. **This object is provisional**, meaning it may be changed in a future release. @@ -137,7 +134,7 @@ def __init__( self.method = method if params: - self.url = format_parameters(self.url, params) + _format_parameters_helper(self, params) self._files = None self._data = None # type: Any @@ -159,10 +156,10 @@ def __init__( def _set_body( self, - content: Optional[ContentType], - data: Optional[dict], - files: Optional[FilesType], - json: Any, + content: Optional[ContentType] = None, + data: Optional[dict] = None, + files: Optional[FilesType] = None, + json: Any = None, ) -> HeadersType: """Sets the body of the request, and returns the default headers """ @@ -209,13 +206,6 @@ def __deepcopy__(self, memo=None) -> "HttpRequest": except (ValueError, TypeError): return copy.copy(self) - def _to_pipeline_transport_request(self): - return to_pipeline_transport_request_helper(self) - - @classmethod - def _from_pipeline_transport_request(cls, pipeline_transport_request): - return from_pipeline_transport_request_helper(cls, pipeline_transport_request) - class _HttpResponseBase: # pylint: disable=too-many-instance-attributes def __init__( diff --git a/sdk/core/azure-core/azure/core/utils/_pipeline_transport_rest_shared.py b/sdk/core/azure-core/azure/core/utils/_pipeline_transport_rest_shared.py new file mode 100644 index 000000000000..8a66e238090e --- /dev/null +++ b/sdk/core/azure-core/azure/core/utils/_pipeline_transport_rest_shared.py @@ -0,0 +1,204 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# -------------------------------------------------------------------------- +from __future__ import absolute_import +import os +from typing import TYPE_CHECKING, cast, IO + +from email.message import Message +from six.moves.http_client import HTTPConnection + +try: + binary_type = str + from urlparse import urlparse # type: ignore +except ImportError: + binary_type = bytes # type: ignore + from urllib.parse import urlparse + +if TYPE_CHECKING: + from typing import ( # pylint: disable=ungrouped-imports + Dict, + List, + Union, + Tuple, + Optional, + ) + # importing both the py3 RestHttpRequest and the fallback RestHttpRequest + from azure.core.rest._rest_py3 import HttpRequest as RestHttpRequestPy3 + from azure.core.rest._rest import HttpRequest as RestHttpRequestPy2 + from azure.core.pipeline.transport import ( + HttpRequest as PipelineTransportHttpRequest + ) + HTTPRequestType = Union[ + RestHttpRequestPy3, RestHttpRequestPy2, PipelineTransportHttpRequest + ] + +def _format_parameters_helper(http_request, params): + """Helper for format_parameters. + + Format parameters into a valid query string. + It's assumed all parameters have already been quoted as + valid URL strings. + + :param http_request: The http request whose parameters + we are trying to format + :param dict params: A dictionary of parameters. + """ + query = urlparse(http_request.url).query + if query: + http_request.url = http_request.url.partition("?")[0] + existing_params = { + p[0]: p[-1] for p in [p.partition("=") for p in query.split("&")] + } + params.update(existing_params) + query_params = [] + for k, v in params.items(): + if isinstance(v, list): + for w in v: + if w is None: + raise ValueError("Query parameter {} cannot be None".format(k)) + query_params.append("{}={}".format(k, w)) + else: + if v is None: + raise ValueError("Query parameter {} cannot be None".format(k)) + query_params.append("{}={}".format(k, v)) + query = "?" + "&".join(query_params) + http_request.url = http_request.url + query + +def _pad_attr_name(attr, backcompat_attrs): + # type: (str, List[str]) -> str + """Pad hidden attributes so users can access them. + + Currently, for our backcompat attributes, we define them + as private, so they're hidden from intellisense and sphinx, + but still allow users to access them as public attributes + for backcompat purposes. This function is called so if + users access publicly call a private backcompat attribute, + we can return them the private variable in getattr + """ + return "_{}".format(attr) if attr in backcompat_attrs else attr + +def _prepare_multipart_body_helper(http_request, content_index=0): + # type: (HTTPRequestType, int) -> int + """Helper for prepare_multipart_body. + + Will prepare the body of this request according to the multipart information. + + This call assumes the on_request policies have been applied already in their + correct context (sync/async) + + Does nothing if "set_multipart_mixed" was never called. + :param http_request: The http request whose multipart body we are trying + to prepare + :param int content_index: The current index of parts within the batch message. + :returns: The updated index after all parts in this request have been added. + :rtype: int + """ + if not http_request.multipart_mixed_info: + return 0 + + requests = http_request.multipart_mixed_info[0] # type: List[HTTPRequestType] + boundary = http_request.multipart_mixed_info[2] # type: Optional[str] + + # Update the main request with the body + main_message = Message() + main_message.add_header("Content-Type", "multipart/mixed") + if boundary: + main_message.set_boundary(boundary) + + for req in requests: + part_message = Message() + if req.multipart_mixed_info: + content_index = req.prepare_multipart_body(content_index=content_index) + part_message.add_header("Content-Type", req.headers['Content-Type']) + payload = req.serialize() + # We need to remove the ~HTTP/1.1 prefix along with the added content-length + payload = payload[payload.index(b'--'):] + else: + part_message.add_header("Content-Type", "application/http") + part_message.add_header("Content-Transfer-Encoding", "binary") + part_message.add_header("Content-ID", str(content_index)) + payload = req.serialize() + content_index += 1 + part_message.set_payload(payload) + main_message.attach(part_message) + + try: + from email.policy import HTTP + + full_message = main_message.as_bytes(policy=HTTP) + eol = b"\r\n" + except ImportError: # Python 2.7 + # Right now we decide to not support Python 2.7 on serialization, since + # it doesn't serialize a valid HTTP request (and our main scenario Storage refuses it) + raise NotImplementedError( + "Multipart request are not supported on Python 2.7" + ) + # full_message = main_message.as_string() + # eol = b'\n' + _, _, body = full_message.split(eol, 2) + http_request.set_bytes_body(body) + http_request.headers["Content-Type"] = ( + "multipart/mixed; boundary=" + main_message.get_boundary() + ) + return content_index + +class _HTTPSerializer(HTTPConnection, object): + """Hacking the stdlib HTTPConnection to serialize HTTP request as strings. + """ + + def __init__(self, *args, **kwargs): + self.buffer = b"" + kwargs.setdefault("host", "fakehost") + super(_HTTPSerializer, self).__init__(*args, **kwargs) + + def putheader(self, header, *values): + if header in ["Host", "Accept-Encoding"]: + return + super(_HTTPSerializer, self).putheader(header, *values) + + def send(self, data): + self.buffer += data + +def _serialize_request(http_request): + # type: (HTTPRequestType) -> bytes + """Helper for serialize. + + Serialize a request using the application/http spec/ + + :param http_request: The http request which we are trying + to serialize. + :rtype: bytes + """ + serializer = _HTTPSerializer() + serializer.request( + method=http_request.method, + url=http_request.url, + body=http_request.body, + headers=http_request.headers, + ) + return serializer.buffer + +def _format_data_helper(data): + # type: (Union[str, IO]) -> Union[Tuple[None, str], Tuple[Optional[str], IO, str]] + """Helper for _format_data. + + Format field data according to whether it is a stream or + a string for a form-data request. + + :param data: The request field data. + :type data: str or file-like object. + """ + if hasattr(data, "read"): + data = cast(IO, data) + data_name = None + try: + if data.name[0] != "<" and data.name[-1] != ">": + data_name = os.path.basename(data.name) + except (AttributeError, TypeError): + pass + return (data_name, data, "application/octet-stream") + return (None, cast(str, data)) diff --git a/sdk/core/azure-core/tests/async_tests/test_authentication_async.py b/sdk/core/azure-core/tests/async_tests/test_authentication_async.py index 7230018aa37f..0c1362f93594 100644 --- a/sdk/core/azure-core/tests/async_tests/test_authentication_async.py +++ b/sdk/core/azure-core/tests/async_tests/test_authentication_async.py @@ -4,6 +4,7 @@ # license information. # ------------------------------------------------------------------------- import asyncio +from email.policy import HTTP import time from unittest.mock import Mock @@ -15,9 +16,10 @@ import pytest pytestmark = pytest.mark.asyncio +from utils import HTTP_REQUESTS - -async def test_bearer_policy_adds_header(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +async def test_bearer_policy_adds_header(http_request): """The bearer token policy should add a header containing a token from its credential""" # 2524608000 == 01/01/2050 @ 12:00am (UTC) expected_token = AccessToken("expected_token", 2524608000) @@ -37,17 +39,18 @@ async def get_token(_): policies = [AsyncBearerTokenCredentialPolicy(fake_credential, "scope"), Mock(send=verify_authorization_header)] pipeline = AsyncPipeline(transport=Mock(), policies=policies) - await pipeline.run(HttpRequest("GET", "https://spam.eggs"), context=None) + await pipeline.run(http_request("GET", "https://spam.eggs"), context=None) assert get_token_calls == 1 - await pipeline.run(HttpRequest("GET", "https://spam.eggs"), context=None) + await pipeline.run(http_request("GET", "https://spam.eggs"), context=None) # Didn't need a new token assert get_token_calls == 1 -async def test_bearer_policy_send(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +async def test_bearer_policy_send(http_request): """The bearer token policy should invoke the next policy's send method and return the result""" - expected_request = HttpRequest("GET", "https://spam.eggs") + expected_request = http_request("GET", "https://spam.eggs") expected_response = Mock() async def verify_request(request): @@ -61,7 +64,8 @@ async def verify_request(request): assert response is expected_response -async def test_bearer_policy_token_caching(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +async def test_bearer_policy_token_caching(http_request): good_for_one_hour = AccessToken("token", time.time() + 3600) expected_token = good_for_one_hour get_token_calls = 0 @@ -78,10 +82,10 @@ async def get_token(_): ] pipeline = AsyncPipeline(transport=Mock, policies=policies) - await pipeline.run(HttpRequest("GET", "https://spam.eggs")) + await pipeline.run(http_request("GET", "https://spam.eggs")) assert get_token_calls == 1 # policy has no token at first request -> it should call get_token - await pipeline.run(HttpRequest("GET", "https://spam.eggs")) + await pipeline.run(http_request("GET", "https://spam.eggs")) assert get_token_calls == 1 # token is good for an hour -> policy should return it from cache expired_token = AccessToken("token", time.time()) @@ -93,14 +97,15 @@ async def get_token(_): ] pipeline = AsyncPipeline(transport=Mock(), policies=policies) - await pipeline.run(HttpRequest("GET", "https://spam.eggs")) + await pipeline.run(http_request("GET", "https://spam.eggs")) assert get_token_calls == 1 - await pipeline.run(HttpRequest("GET", "https://spam.eggs")) + await pipeline.run(http_request("GET", "https://spam.eggs")) assert get_token_calls == 2 # token expired -> policy should call get_token -async def test_bearer_policy_optionally_enforces_https(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +async def test_bearer_policy_optionally_enforces_https(http_request): """HTTPS enforcement should be controlled by a keyword argument, and enabled by default""" async def assert_option_popped(request, **kwargs): @@ -114,20 +119,21 @@ async def assert_option_popped(request, **kwargs): # by default and when enforce_https=True, the policy should raise when given an insecure request with pytest.raises(ServiceRequestError): - await pipeline.run(HttpRequest("GET", "http://not.secure")) + await pipeline.run(http_request("GET", "http://not.secure")) with pytest.raises(ServiceRequestError): - await pipeline.run(HttpRequest("GET", "http://not.secure"), enforce_https=True) + await pipeline.run(http_request("GET", "http://not.secure"), enforce_https=True) # when enforce_https=False, an insecure request should pass - await pipeline.run(HttpRequest("GET", "http://not.secure"), enforce_https=False) + await pipeline.run(http_request("GET", "http://not.secure"), enforce_https=False) # https requests should always pass - await pipeline.run(HttpRequest("GET", "https://secure"), enforce_https=False) - await pipeline.run(HttpRequest("GET", "https://secure"), enforce_https=True) - await pipeline.run(HttpRequest("GET", "https://secure")) + await pipeline.run(http_request("GET", "https://secure"), enforce_https=False) + await pipeline.run(http_request("GET", "https://secure"), enforce_https=True) + await pipeline.run(http_request("GET", "https://secure")) -async def test_bearer_policy_preserves_enforce_https_opt_out(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +async def test_bearer_policy_preserves_enforce_https_opt_out(http_request): """The policy should use request context to preserve an opt out from https enforcement""" class ContextValidator(SansIOHTTPPolicy): @@ -140,10 +146,11 @@ def on_request(self, request): policies = [AsyncBearerTokenCredentialPolicy(credential, "scope"), ContextValidator()] pipeline = AsyncPipeline(transport=Mock(send=lambda *_, **__: get_completed_future(Mock())), policies=policies) - await pipeline.run(HttpRequest("GET", "http://not.secure"), enforce_https=False) + await pipeline.run(http_request("GET", "http://not.secure"), enforce_https=False) -async def test_bearer_policy_context_unmodified_by_default(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +async def test_bearer_policy_context_unmodified_by_default(http_request): """When no options for the policy accompany a request, the policy shouldn't add anything to the request context""" class ContextValidator(SansIOHTTPPolicy): @@ -156,10 +163,11 @@ def on_request(self, request): policies = [AsyncBearerTokenCredentialPolicy(credential, "scope"), ContextValidator()] pipeline = AsyncPipeline(transport=Mock(send=lambda *_, **__: get_completed_future(Mock())), policies=policies) - await pipeline.run(HttpRequest("GET", "https://secure")) + await pipeline.run(http_request("GET", "https://secure")) -async def test_bearer_policy_calls_sansio_methods(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +async def test_bearer_policy_calls_sansio_methods(http_request): """AsyncBearerTokenCredentialPolicy should call SansIOHttpPolicy methods as does _SansIOAsyncHTTPPolicyRunner""" class TestPolicy(AsyncBearerTokenCredentialPolicy): @@ -179,7 +187,7 @@ async def send(self, request): transport = Mock(send=Mock(return_value=get_completed_future(Mock(status_code=200)))) pipeline = AsyncPipeline(transport=transport, policies=[policy]) - await pipeline.run(HttpRequest("GET", "https://localhost")) + await pipeline.run(http_request("GET", "https://localhost")) policy.on_request.assert_called_once_with(policy.request) policy.on_response.assert_called_once_with(policy.request, policy.response) @@ -193,7 +201,7 @@ class TestException(Exception): policy = TestPolicy(credential, "scope") pipeline = AsyncPipeline(transport=transport, policies=[policy]) with pytest.raises(TestException): - await pipeline.run(HttpRequest("GET", "https://localhost")) + await pipeline.run(http_request("GET", "https://localhost")) policy.on_exception.assert_called_once_with(policy.request) # ...or the second @@ -209,7 +217,7 @@ async def fake_send(*args, **kwargs): transport = Mock(send=Mock(wraps=fake_send)) pipeline = AsyncPipeline(transport=transport, policies=[policy]) with pytest.raises(TestException): - await pipeline.run(HttpRequest("GET", "https://localhost")) + await pipeline.run(http_request("GET", "https://localhost")) assert transport.send.call_count == 2 policy.on_challenge.assert_called_once() policy.on_exception.assert_called_once_with(policy.request) diff --git a/sdk/core/azure-core/tests/async_tests/test_base_polling_async.py b/sdk/core/azure-core/tests/async_tests/test_base_polling_async.py index f010abaaddf4..5165c523913d 100644 --- a/sdk/core/azure-core/tests/async_tests/test_base_polling_async.py +++ b/sdk/core/azure-core/tests/async_tests/test_base_polling_async.py @@ -27,6 +27,7 @@ import json import pickle import re +from utils import HTTP_REQUESTS, is_rest import types import unittest try: @@ -83,8 +84,9 @@ class BadEndpointError(Exception): POLLING_STATUS = 200 CLIENT = AsyncPipelineClient("http://example.org") +CLIENT.http_request_type = None async def mock_run(client_self, request, **kwargs): - return TestBasePolling.mock_update(request.url) + return TestBasePolling.mock_update(client_self.http_request_type, request.url) CLIENT._pipeline.run = types.MethodType(mock_run, CLIENT) @@ -162,12 +164,14 @@ def test_base_polling_continuation_token(client, polling_response): @pytest.mark.asyncio -async def test_post(async_pipeline_client_builder, deserialization_cb): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +async def test_post(async_pipeline_client_builder, deserialization_cb, http_request): # Test POST LRO with both Location and Operation-Location # The initial response contains both Location and Operation-Location, a 202 and no Body initial_response = TestBasePolling.mock_send( + http_request, 'POST', 202, { @@ -182,12 +186,14 @@ async def send(request, **kwargs): if request.url == 'http://example.org/location': return TestBasePolling.mock_send( + http_request, 'GET', 200, body={'location_result': True} ).http_response elif request.url == 'http://example.org/async_monitor': return TestBasePolling.mock_send( + http_request, 'GET', 200, body={'status': 'Succeeded'} @@ -213,12 +219,14 @@ async def send(request, **kwargs): if request.url == 'http://example.org/location': return TestBasePolling.mock_send( + http_request, 'GET', 200, body=None ).http_response elif request.url == 'http://example.org/async_monitor': return TestBasePolling.mock_send( + http_request, 'GET', 200, body={'status': 'Succeeded'} @@ -238,12 +246,14 @@ async def send(request, **kwargs): @pytest.mark.asyncio -async def test_post_resource_location(async_pipeline_client_builder, deserialization_cb): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +async def test_post_resource_location(async_pipeline_client_builder, deserialization_cb, http_request): # ResourceLocation # The initial response contains both Location and Operation-Location, a 202 and no Body initial_response = TestBasePolling.mock_send( + http_request, 'POST', 202, { @@ -257,12 +267,14 @@ async def send(request, **kwargs): if request.url == 'http://example.org/resource_location': return TestBasePolling.mock_send( + http_request, 'GET', 200, body={'location_result': True} ).http_response elif request.url == 'http://example.org/async_monitor': return TestBasePolling.mock_send( + http_request, 'GET', 200, body={'status': 'Succeeded', 'resourceLocation': 'http://example.org/resource_location'} @@ -285,7 +297,7 @@ class TestBasePolling(object): convert = re.compile('([a-z0-9])([A-Z])') @staticmethod - def mock_send(method, status, headers=None, body=RESPONSE_BODY): + def mock_send(http_request, method, status, headers=None, body=RESPONSE_BODY): if headers is None: headers = {} response = Response() @@ -302,15 +314,23 @@ def mock_send(method, status, headers=None, body=RESPONSE_BODY): response.headers.update({"content-type": "application/json; charset=utf8"}) response.reason = "OK" - request = CLIENT._request( - response.request.method, - response.request.url, - None, # params - response.request.headers, - body, - None, # form_content - None # stream_content - ) + if is_rest(http_request): + request = http_request( + response.request.method, + response.request.url, + headers=response.request.headers, + content=body, + ) + else: + request = CLIENT._request( + response.request.method, + response.request.url, + None, # params + response.request.headers, + body, + None, # form_content + None # stream_content + ) return PipelineResponse( request, @@ -322,7 +342,7 @@ def mock_send(method, status, headers=None, body=RESPONSE_BODY): ) @staticmethod - def mock_update(url, headers=None): + def mock_update(http_request, url, headers=None): response = Response() response._content_consumed = True response.request = mock.create_autospec(Request) @@ -354,14 +374,9 @@ def mock_update(url, headers=None): else: raise Exception('URL does not match') - request = CLIENT._request( + request = http_request( response.request.method, response.request.url, - None, # params - {}, # request has no headers - None, # Request has no body - None, # form_content - None # stream_content ) return PipelineResponse( @@ -404,11 +419,14 @@ def mock_deserialization_no_body(pipeline_response): return None @pytest.mark.asyncio -async def test_long_running_put(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +async def test_long_running_put(http_request): #TODO: Test custom header field - + CLIENT.http_request_type = http_request # Test throw on non LRO related status code - response = TestBasePolling.mock_send('PUT', 1000, {}) + response = TestBasePolling.mock_send( + http_request, 'PUT', 1000, {} + ) with pytest.raises(HttpResponseError): await async_poller(CLIENT, response, TestBasePolling.mock_outputs, @@ -420,6 +438,7 @@ async def test_long_running_put(): 'name': TEST_NAME } response = TestBasePolling.mock_send( + http_request, 'PUT', 201, {}, response_body ) @@ -435,6 +454,7 @@ def no_update_allowed(url, headers=None): # Test polling from operation-location header response = TestBasePolling.mock_send( + http_request, 'PUT', 201, {'operation-location': ASYNC_URL}) polling_method = AsyncLROBasePolling(0) @@ -446,6 +466,7 @@ def no_update_allowed(url, headers=None): # Test polling location header response = TestBasePolling.mock_send( + http_request, 'PUT', 201, {'location': LOCATION_URL}) polling_method = AsyncLROBasePolling(0) @@ -458,6 +479,7 @@ def no_update_allowed(url, headers=None): # Test polling initial payload invalid (SQLDb) response_body = {} # Empty will raise response = TestBasePolling.mock_send( + http_request, 'PUT', 201, {'location': LOCATION_URL}, response_body) polling_method = AsyncLROBasePolling(0) @@ -469,6 +491,7 @@ def no_update_allowed(url, headers=None): # Test fail to poll from operation-location header response = TestBasePolling.mock_send( + http_request, 'PUT', 201, {'operation-location': ERROR}) with pytest.raises(BadEndpointError): @@ -478,6 +501,7 @@ def no_update_allowed(url, headers=None): # Test fail to poll from location header response = TestBasePolling.mock_send( + http_request, 'PUT', 201, {'location': ERROR}) with pytest.raises(BadEndpointError): @@ -486,10 +510,12 @@ def no_update_allowed(url, headers=None): AsyncLROBasePolling(0)) @pytest.mark.asyncio -async def test_long_running_patch(): - +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +async def test_long_running_patch(http_request): + CLIENT.http_request_type = http_request # Test polling from location header response = TestBasePolling.mock_send( + http_request, 'PATCH', 202, {'location': LOCATION_URL}, body={'properties':{'provisioningState': 'Succeeded'}}) @@ -502,6 +528,7 @@ async def test_long_running_patch(): # Test polling from operation-location header response = TestBasePolling.mock_send( + http_request, 'PATCH', 202, {'operation-location': ASYNC_URL}, body={'properties':{'provisioningState': 'Succeeded'}}) @@ -514,6 +541,7 @@ async def test_long_running_patch(): # Test polling from location header response = TestBasePolling.mock_send( + http_request, 'PATCH', 200, {'location': LOCATION_URL}, body={'properties':{'provisioningState': 'Succeeded'}}) @@ -526,6 +554,7 @@ async def test_long_running_patch(): # Test polling from operation-location header response = TestBasePolling.mock_send( + http_request, 'PATCH', 200, {'operation-location': ASYNC_URL}, body={'properties':{'provisioningState': 'Succeeded'}}) @@ -538,6 +567,7 @@ async def test_long_running_patch(): # Test fail to poll from operation-location header response = TestBasePolling.mock_send( + http_request, 'PATCH', 202, {'operation-location': ERROR}) with pytest.raises(BadEndpointError): @@ -547,6 +577,7 @@ async def test_long_running_patch(): # Test fail to poll from location header response = TestBasePolling.mock_send( + http_request, 'PATCH', 202, {'location': ERROR}) with pytest.raises(BadEndpointError): @@ -555,9 +586,12 @@ async def test_long_running_patch(): AsyncLROBasePolling(0)) @pytest.mark.asyncio -async def test_long_running_delete(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +async def test_long_running_delete(http_request): # Test polling from operation-location header + CLIENT.http_request_type = http_request response = TestBasePolling.mock_send( + http_request, 'DELETE', 202, {'operation-location': ASYNC_URL}, body="" @@ -570,10 +604,12 @@ async def test_long_running_delete(): assert polling_method._pipeline_response.http_response.internal_response.randomFieldFromPollAsyncOpHeader is None @pytest.mark.asyncio -async def test_long_running_post(): - +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +async def test_long_running_post(http_request): + CLIENT.http_request_type = http_request # Test polling from operation-location header response = TestBasePolling.mock_send( + http_request, 'POST', 201, {'operation-location': ASYNC_URL}, body={'properties':{'provisioningState': 'Succeeded'}}) @@ -585,6 +621,7 @@ async def test_long_running_post(): # Test polling from operation-location header response = TestBasePolling.mock_send( + http_request, 'POST', 202, {'operation-location': ASYNC_URL}, body={'properties':{'provisioningState': 'Succeeded'}}) @@ -596,6 +633,7 @@ async def test_long_running_post(): # Test polling from location header response = TestBasePolling.mock_send( + http_request, 'POST', 202, {'location': LOCATION_URL}, body={'properties':{'provisioningState': 'Succeeded'}}) @@ -608,6 +646,7 @@ async def test_long_running_post(): # Test fail to poll from operation-location header response = TestBasePolling.mock_send( + http_request, 'POST', 202, {'operation-location': ERROR}) with pytest.raises(BadEndpointError): @@ -617,6 +656,7 @@ async def test_long_running_post(): # Test fail to poll from location header response = TestBasePolling.mock_send( + http_request, 'POST', 202, {'location': ERROR}) with pytest.raises(BadEndpointError): @@ -625,13 +665,15 @@ async def test_long_running_post(): AsyncLROBasePolling(0)) @pytest.mark.asyncio -async def test_long_running_negative(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +async def test_long_running_negative(http_request): global LOCATION_BODY global POLLING_STATUS - + CLIENT.http_request_type = http_request # Test LRO PUT throws for invalid json LOCATION_BODY = '{' response = TestBasePolling.mock_send( + http_request, 'POST', 202, {'location': LOCATION_URL}) poll = async_poller( @@ -645,6 +687,7 @@ async def test_long_running_negative(): LOCATION_BODY = '{\'"}' response = TestBasePolling.mock_send( + http_request, 'POST', 202, {'location': LOCATION_URL}) poll = async_poller(CLIENT, response, @@ -656,6 +699,7 @@ async def test_long_running_negative(): LOCATION_BODY = '{' POLLING_STATUS = 203 response = TestBasePolling.mock_send( + http_request, 'POST', 202, {'location': LOCATION_URL}) poll = async_poller(CLIENT, response, diff --git a/sdk/core/azure-core/tests/async_tests/test_basic_transport_async.py b/sdk/core/azure-core/tests/async_tests/test_basic_transport_async.py index 1ae80db6f60c..5632a2097131 100644 --- a/sdk/core/azure-core/tests/async_tests/test_basic_transport_async.py +++ b/sdk/core/azure-core/tests/async_tests/test_basic_transport_async.py @@ -3,11 +3,11 @@ # Licensed under the MIT License. See LICENSE.txt in the project root for # license information. # ------------------------------------------------------------------------- -from azure.core.pipeline.transport import HttpRequest, AsyncHttpResponse, AsyncHttpTransport, AioHttpTransport +from azure.core.pipeline.transport import AsyncHttpResponse, AsyncHttpTransport, AioHttpTransport from azure.core.pipeline.policies import HeadersPolicy from azure.core.pipeline import AsyncPipeline from azure.core.exceptions import HttpResponseError - +from utils import HTTP_REQUESTS import pytest @@ -34,9 +34,10 @@ def body(self): @pytest.mark.asyncio -async def test_basic_options_aiohttp(port): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +async def test_basic_options_aiohttp(port, http_request): - request = HttpRequest("OPTIONS", "http://localhost:{}/basic/string".format(port)) + request = http_request("OPTIONS", "http://localhost:{}/basic/string".format(port)) async with AsyncPipeline(AioHttpTransport(), policies=[]) as pipeline: response = await pipeline.run(request) @@ -45,7 +46,8 @@ async def test_basic_options_aiohttp(port): @pytest.mark.asyncio -async def test_multipart_send(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +async def test_multipart_send(http_request): transport = MockAsyncHttpTransport() class RequestPolicy(object): @@ -53,10 +55,10 @@ async def on_request(self, request): # type: (PipelineRequest) -> None request.http_request.headers['x-ms-date'] = 'Thu, 14 Jun 2018 16:46:54 GMT' - req0 = HttpRequest("DELETE", "/container0/blob0") - req1 = HttpRequest("DELETE", "/container1/blob1") + req0 = http_request("DELETE", "/container0/blob0") + req1 = http_request("DELETE", "/container1/blob1") - request = HttpRequest("POST", "http://account.blob.core.windows.net/?comp=batch") + request = http_request("POST", "http://account.blob.core.windows.net/?comp=batch") request.set_multipart_mixed( req0, req1, @@ -91,7 +93,8 @@ async def on_request(self, request): @pytest.mark.asyncio -async def test_multipart_send_with_context(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +async def test_multipart_send_with_context(http_request): transport = MockAsyncHttpTransport() header_policy = HeadersPolicy() @@ -101,10 +104,10 @@ async def on_request(self, request): # type: (PipelineRequest) -> None request.http_request.headers['x-ms-date'] = 'Thu, 14 Jun 2018 16:46:54 GMT' - req0 = HttpRequest("DELETE", "/container0/blob0") - req1 = HttpRequest("DELETE", "/container1/blob1") + req0 = http_request("DELETE", "/container0/blob0") + req1 = http_request("DELETE", "/container1/blob1") - request = HttpRequest("POST", "http://account.blob.core.windows.net/?comp=batch") + request = http_request("POST", "http://account.blob.core.windows.net/?comp=batch") request.set_multipart_mixed( req0, req1, @@ -142,19 +145,20 @@ async def on_request(self, request): @pytest.mark.asyncio -async def test_multipart_send_with_one_changeset(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +async def test_multipart_send_with_one_changeset(http_request): transport = MockAsyncHttpTransport() requests = [ - HttpRequest("DELETE", "/container0/blob0"), - HttpRequest("DELETE", "/container1/blob1") + http_request("DELETE", "/container0/blob0"), + http_request("DELETE", "/container1/blob1") ] - changeset = HttpRequest("", "") + changeset = http_request("", "") changeset.set_multipart_mixed( *requests, boundary="changeset_357de4f7-6d0b-4e02-8cd2-6361411a9525" ) - request = HttpRequest("POST", "http://account.blob.core.windows.net/?comp=batch") + request = http_request("POST", "http://account.blob.core.windows.net/?comp=batch") request.set_multipart_mixed( changeset, boundary="batch_357de4f7-6d0b-4e02-8cd2-6361411a9525" @@ -190,22 +194,23 @@ async def test_multipart_send_with_one_changeset(): @pytest.mark.asyncio -async def test_multipart_send_with_multiple_changesets(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +async def test_multipart_send_with_multiple_changesets(http_request): transport = MockAsyncHttpTransport() - changeset1 = HttpRequest("", "") + changeset1 = http_request("", "") changeset1.set_multipart_mixed( - HttpRequest("DELETE", "/container0/blob0"), - HttpRequest("DELETE", "/container1/blob1"), + http_request("DELETE", "/container0/blob0"), + http_request("DELETE", "/container1/blob1"), boundary="changeset_357de4f7-6d0b-4e02-8cd2-6361411a9525" ) - changeset2 = HttpRequest("", "") + changeset2 = http_request("", "") changeset2.set_multipart_mixed( - HttpRequest("DELETE", "/container2/blob2"), - HttpRequest("DELETE", "/container3/blob3"), + http_request("DELETE", "/container2/blob2"), + http_request("DELETE", "/container3/blob3"), boundary="changeset_8b9e487e-a353-4dcb-a6f4-0688191e0314" ) - request = HttpRequest("POST", "http://account.blob.core.windows.net/?comp=batch") + request = http_request("POST", "http://account.blob.core.windows.net/?comp=batch") request.set_multipart_mixed( changeset1, changeset2, @@ -263,19 +268,20 @@ async def test_multipart_send_with_multiple_changesets(): @pytest.mark.asyncio -async def test_multipart_send_with_combination_changeset_first(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +async def test_multipart_send_with_combination_changeset_first(http_request): transport = MockAsyncHttpTransport() - changeset = HttpRequest("", "") + changeset = http_request("", "") changeset.set_multipart_mixed( - HttpRequest("DELETE", "/container0/blob0"), - HttpRequest("DELETE", "/container1/blob1"), + http_request("DELETE", "/container0/blob0"), + http_request("DELETE", "/container1/blob1"), boundary="changeset_357de4f7-6d0b-4e02-8cd2-6361411a9525" ) - request = HttpRequest("POST", "http://account.blob.core.windows.net/?comp=batch") + request = http_request("POST", "http://account.blob.core.windows.net/?comp=batch") request.set_multipart_mixed( changeset, - HttpRequest("DELETE", "/container2/blob2"), + http_request("DELETE", "/container2/blob2"), boundary="batch_357de4f7-6d0b-4e02-8cd2-6361411a9525" ) @@ -317,17 +323,18 @@ async def test_multipart_send_with_combination_changeset_first(): @pytest.mark.asyncio -async def test_multipart_send_with_combination_changeset_last(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +async def test_multipart_send_with_combination_changeset_last(http_request): transport = MockAsyncHttpTransport() - changeset = HttpRequest("", "") + changeset = http_request("", "") changeset.set_multipart_mixed( - HttpRequest("DELETE", "/container1/blob1"), - HttpRequest("DELETE", "/container2/blob2"), + http_request("DELETE", "/container1/blob1"), + http_request("DELETE", "/container2/blob2"), boundary="changeset_357de4f7-6d0b-4e02-8cd2-6361411a9525" ) - request = HttpRequest("POST", "http://account.blob.core.windows.net/?comp=batch") + request = http_request("POST", "http://account.blob.core.windows.net/?comp=batch") request.set_multipart_mixed( - HttpRequest("DELETE", "/container0/blob0"), + http_request("DELETE", "/container0/blob0"), changeset, boundary="batch_357de4f7-6d0b-4e02-8cd2-6361411a9525" ) @@ -370,18 +377,19 @@ async def test_multipart_send_with_combination_changeset_last(): @pytest.mark.asyncio -async def test_multipart_send_with_combination_changeset_middle(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +async def test_multipart_send_with_combination_changeset_middle(http_request): transport = MockAsyncHttpTransport() - changeset = HttpRequest("", "") + changeset = http_request("", "") changeset.set_multipart_mixed( - HttpRequest("DELETE", "/container1/blob1"), + http_request("DELETE", "/container1/blob1"), boundary="changeset_357de4f7-6d0b-4e02-8cd2-6361411a9525" ) - request = HttpRequest("POST", "http://account.blob.core.windows.net/?comp=batch") + request = http_request("POST", "http://account.blob.core.windows.net/?comp=batch") request.set_multipart_mixed( - HttpRequest("DELETE", "/container0/blob0"), + http_request("DELETE", "/container0/blob0"), changeset, - HttpRequest("DELETE", "/container2/blob2"), + http_request("DELETE", "/container2/blob2"), boundary="batch_357de4f7-6d0b-4e02-8cd2-6361411a9525" ) @@ -423,7 +431,8 @@ async def test_multipart_send_with_combination_changeset_middle(): @pytest.mark.asyncio -async def test_multipart_receive(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +async def test_multipart_receive(http_request): class ResponsePolicy(object): def on_response(self, request, response): @@ -435,10 +444,10 @@ async def on_response(self, request, response): # type: (PipelineRequest, PipelineResponse) -> None response.http_response.headers['x-ms-async-fun'] = 'true' - req0 = HttpRequest("DELETE", "/container0/blob0") - req1 = HttpRequest("DELETE", "/container1/blob1") + req0 = http_request("DELETE", "/container0/blob0") + req1 = http_request("DELETE", "/container1/blob1") - request = HttpRequest("POST", "http://account.blob.core.windows.net/?comp=batch") + request = http_request("POST", "http://account.blob.core.windows.net/?comp=batch") request.set_multipart_mixed( req0, req1, @@ -496,14 +505,15 @@ async def on_response(self, request, response): @pytest.mark.asyncio -async def test_multipart_receive_with_one_changeset(): - changeset = HttpRequest("", "") +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +async def test_multipart_receive_with_one_changeset(http_request): + changeset = http_request("", "") changeset.set_multipart_mixed( - HttpRequest("DELETE", "/container0/blob0"), - HttpRequest("DELETE", "/container1/blob1") + http_request("DELETE", "/container0/blob0"), + http_request("DELETE", "/container1/blob1") ) - request = HttpRequest("POST", "http://account.blob.core.windows.net/?comp=batch") + request = http_request("POST", "http://account.blob.core.windows.net/?comp=batch") request.set_multipart_mixed(changeset) body_as_bytes = ( b'--batchresponse_66925647-d0cb-4109-b6d3-28efe3e1e5ed\r\n' @@ -550,20 +560,21 @@ async def test_multipart_receive_with_one_changeset(): @pytest.mark.asyncio -async def test_multipart_receive_with_multiple_changesets(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +async def test_multipart_receive_with_multiple_changesets(http_request): - changeset1 = HttpRequest("", "") + changeset1 = http_request("", "") changeset1.set_multipart_mixed( - HttpRequest("DELETE", "/container0/blob0"), - HttpRequest("DELETE", "/container1/blob1") + http_request("DELETE", "/container0/blob0"), + http_request("DELETE", "/container1/blob1") ) - changeset2 = HttpRequest("", "") + changeset2 = http_request("", "") changeset2.set_multipart_mixed( - HttpRequest("DELETE", "/container2/blob2"), - HttpRequest("DELETE", "/container3/blob3") + http_request("DELETE", "/container2/blob2"), + http_request("DELETE", "/container3/blob3") ) - request = HttpRequest("POST", "http://account.blob.core.windows.net/?comp=batch") + request = http_request("POST", "http://account.blob.core.windows.net/?comp=batch") request.set_multipart_mixed(changeset1, changeset2) body_as_bytes = ( b'--batchresponse_66925647-d0cb-4109-b6d3-28efe3e1e5ed\r\n' @@ -636,16 +647,17 @@ async def test_multipart_receive_with_multiple_changesets(): @pytest.mark.asyncio -async def test_multipart_receive_with_combination_changeset_first(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +async def test_multipart_receive_with_combination_changeset_first(http_request): - changeset = HttpRequest("", "") + changeset = http_request("", "") changeset.set_multipart_mixed( - HttpRequest("DELETE", "/container0/blob0"), - HttpRequest("DELETE", "/container1/blob1") + http_request("DELETE", "/container0/blob0"), + http_request("DELETE", "/container1/blob1") ) - request = HttpRequest("POST", "http://account.blob.core.windows.net/?comp=batch") - request.set_multipart_mixed(changeset, HttpRequest("DELETE", "/container2/blob2")) + request = http_request("POST", "http://account.blob.core.windows.net/?comp=batch") + request.set_multipart_mixed(changeset, http_request("DELETE", "/container2/blob2")) body_as_bytes = ( b'--batchresponse_66925647-d0cb-4109-b6d3-28efe3e1e5ed\r\n' b'Content-Type: multipart/mixed; boundary="changeset_357de4f7-6d0b-4e02-8cd2-6361411a9525"\r\n' @@ -712,16 +724,17 @@ def test_raise_for_status_good_response(): @pytest.mark.asyncio -async def test_multipart_receive_with_combination_changeset_middle(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +async def test_multipart_receive_with_combination_changeset_middle(http_request): - changeset = HttpRequest("", "") - changeset.set_multipart_mixed(HttpRequest("DELETE", "/container1/blob1")) + changeset = http_request("", "") + changeset.set_multipart_mixed(http_request("DELETE", "/container1/blob1")) - request = HttpRequest("POST", "http://account.blob.core.windows.net/?comp=batch") + request = http_request("POST", "http://account.blob.core.windows.net/?comp=batch") request.set_multipart_mixed( - HttpRequest("DELETE", "/container0/blob0"), + http_request("DELETE", "/container0/blob0"), changeset, - HttpRequest("DELETE", "/container2/blob2") + http_request("DELETE", "/container2/blob2") ) body_as_bytes = ( b'--batchresponse_66925647-d0cb-4109-b6d3-28efe3e1e5ed\r\n' @@ -778,16 +791,17 @@ async def test_multipart_receive_with_combination_changeset_middle(): @pytest.mark.asyncio -async def test_multipart_receive_with_combination_changeset_last(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +async def test_multipart_receive_with_combination_changeset_last(http_request): - changeset = HttpRequest("", "") + changeset = http_request("", "") changeset.set_multipart_mixed( - HttpRequest("DELETE", "/container1/blob1"), - HttpRequest("DELETE", "/container2/blob2") + http_request("DELETE", "/container1/blob1"), + http_request("DELETE", "/container2/blob2") ) - request = HttpRequest("POST", "http://account.blob.core.windows.net/?comp=batch") - request.set_multipart_mixed(HttpRequest("DELETE", "/container0/blob0"), changeset) + request = http_request("POST", "http://account.blob.core.windows.net/?comp=batch") + request.set_multipart_mixed(http_request("DELETE", "/container0/blob0"), changeset) body_as_bytes = ( b'--batchresponse_66925647-d0cb-4109-b6d3-28efe3e1e5ed\r\n' @@ -844,11 +858,12 @@ async def test_multipart_receive_with_combination_changeset_last(): @pytest.mark.asyncio -async def test_multipart_receive_with_bom(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +async def test_multipart_receive_with_bom(http_request): - req0 = HttpRequest("DELETE", "/container0/blob0") + req0 = http_request("DELETE", "/container0/blob0") - request = HttpRequest("POST", "http://account.blob.core.windows.net/?comp=batch") + request = http_request("POST", "http://account.blob.core.windows.net/?comp=batch") request.set_multipart_mixed(req0) body_as_bytes = ( b"--batchresponse_66925647-d0cb-4109-b6d3-28efe3e1e5ed\n" @@ -883,12 +898,13 @@ async def test_multipart_receive_with_bom(): @pytest.mark.asyncio -async def test_recursive_multipart_receive(): - req0 = HttpRequest("DELETE", "/container0/blob0") - internal_req0 = HttpRequest("DELETE", "/container0/blob0") +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +async def test_recursive_multipart_receive(http_request): + req0 = http_request("DELETE", "/container0/blob0") + internal_req0 = http_request("DELETE", "/container0/blob0") req0.set_multipart_mixed(internal_req0) - request = HttpRequest("POST", "http://account.blob.core.windows.net/?comp=batch") + request = http_request("POST", "http://account.blob.core.windows.net/?comp=batch") request.set_multipart_mixed(req0) internal_body_as_str = ( "--batchresponse_66925647-d0cb-4109-b6d3-28efe3e1e5ed\r\n" diff --git a/sdk/core/azure-core/tests/async_tests/test_http_logging_policy_async.py b/sdk/core/azure-core/tests/async_tests/test_http_logging_policy_async.py index 0c4e931bc4e2..640d085103aa 100644 --- a/sdk/core/azure-core/tests/async_tests/test_http_logging_policy_async.py +++ b/sdk/core/azure-core/tests/async_tests/test_http_logging_policy_async.py @@ -15,15 +15,15 @@ PipelineContext ) from azure.core.pipeline.transport import ( - HttpRequest, HttpResponse, ) from azure.core.pipeline.policies import ( HttpLoggingPolicy, ) +from utils import HTTP_REQUESTS - -def test_http_logger(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_http_logger(http_request): class MockHandler(logging.Handler): def __init__(self): @@ -41,7 +41,7 @@ def emit(self, record): policy = HttpLoggingPolicy(logger=logger) - universal_request = HttpRequest('GET', 'http://localhost/') + universal_request = http_request('GET', 'http://localhost/') http_response = HttpResponse(universal_request, None) http_response.status_code = 202 request = PipelineRequest(universal_request, PipelineContext(None)) @@ -136,8 +136,8 @@ def emit(self, record): mock_handler.reset() - -def test_http_logger_operation_level(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_http_logger_operation_level(http_request): class MockHandler(logging.Handler): def __init__(self): @@ -156,7 +156,7 @@ def emit(self, record): policy = HttpLoggingPolicy() kwargs={'logger': logger} - universal_request = HttpRequest('GET', 'http://localhost/') + universal_request = http_request('GET', 'http://localhost/') http_response = HttpResponse(universal_request, None) http_response.status_code = 202 request = PipelineRequest(universal_request, PipelineContext(None, **kwargs)) @@ -207,8 +207,8 @@ def emit(self, record): mock_handler.reset() - -def test_http_logger_with_body(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_http_logger_with_body(http_request): class MockHandler(logging.Handler): def __init__(self): @@ -226,7 +226,7 @@ def emit(self, record): policy = HttpLoggingPolicy(logger=logger) - universal_request = HttpRequest('GET', 'http://localhost/') + universal_request = http_request('GET', 'http://localhost/') universal_request.body = "testbody" http_response = HttpResponse(universal_request, None) http_response.status_code = 202 @@ -248,8 +248,9 @@ def emit(self, record): mock_handler.reset() +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) @pytest.mark.skipif(sys.version_info < (3, 6), reason="types.AsyncGeneratorType does not exist in 3.5") -def test_http_logger_with_generator_body(): +def test_http_logger_with_generator_body(http_request): class MockHandler(logging.Handler): def __init__(self): @@ -267,7 +268,7 @@ def emit(self, record): policy = HttpLoggingPolicy(logger=logger) - universal_request = HttpRequest('GET', 'http://localhost/') + universal_request = http_request('GET', 'http://localhost/') mock = Mock() mock.__class__ = types.AsyncGeneratorType universal_request.body = mock diff --git a/sdk/core/azure-core/tests/async_tests/test_pipeline_async.py b/sdk/core/azure-core/tests/async_tests/test_pipeline_async.py index a84d53093ca3..7117d5c50bf6 100644 --- a/sdk/core/azure-core/tests/async_tests/test_pipeline_async.py +++ b/sdk/core/azure-core/tests/async_tests/test_pipeline_async.py @@ -38,7 +38,6 @@ ) from azure.core.pipeline.transport import ( AsyncHttpTransport, - HttpRequest, AsyncioRequestsTransport, TrioRequestsTransport, AioHttpTransport @@ -55,10 +54,12 @@ import trio import pytest +from utils import HTTP_REQUESTS @pytest.mark.asyncio -async def test_sans_io_exception(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +async def test_sans_io_exception(http_request): class BrokenSender(AsyncHttpTransport): async def send(self, request, **config): raise ValueError("Broken") @@ -75,7 +76,7 @@ async def __aexit__(self, exc_type, exc_value, traceback): pipeline = AsyncPipeline(BrokenSender(), [SansIOHTTPPolicy()]) - req = HttpRequest('GET', '/') + req = http_request('GET', '/') with pytest.raises(ValueError): await pipeline.run(req) @@ -89,9 +90,10 @@ def on_exception(self, requests, **kwargs): await pipeline.run(req) @pytest.mark.asyncio -async def test_basic_aiohttp(port): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +async def test_basic_aiohttp(port, http_request): - request = HttpRequest("GET", "http://localhost:{}/basic/string".format(port)) + request = http_request("GET", "http://localhost:{}/basic/string".format(port)) policies = [ UserAgentPolicy("myusergant"), AsyncRedirectPolicy() @@ -104,10 +106,11 @@ async def test_basic_aiohttp(port): assert isinstance(response.http_response.status_code, int) @pytest.mark.asyncio -async def test_basic_aiohttp_separate_session(port): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +async def test_basic_aiohttp_separate_session(port, http_request): session = aiohttp.ClientSession() - request = HttpRequest("GET", "http://localhost:{}/basic/string".format(port)) + request = http_request("GET", "http://localhost:{}/basic/string".format(port)) policies = [ UserAgentPolicy("myusergant"), AsyncRedirectPolicy() @@ -123,9 +126,10 @@ async def test_basic_aiohttp_separate_session(port): await transport.session.close() @pytest.mark.asyncio -async def test_basic_async_requests(port): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +async def test_basic_async_requests(port, http_request): - request = HttpRequest("GET", "http://localhost:{}/basic/string".format(port)) + request = http_request("GET", "http://localhost:{}/basic/string".format(port)) policies = [ UserAgentPolicy("myusergant"), AsyncRedirectPolicy() @@ -185,9 +189,10 @@ def test_pass_in_http_logging_policy(): assert http_logging_policy.allowed_header_names == HttpLoggingPolicy.DEFAULT_HEADERS_WHITELIST.union({"x-ms-added-header"}) @pytest.mark.asyncio -async def test_conf_async_requests(port): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +async def test_conf_async_requests(port, http_request): - request = HttpRequest("GET", "http://localhost:{}/basic/string".format(port)) + request = http_request("GET", "http://localhost:{}/basic/string".format(port)) policies = [ UserAgentPolicy("myusergant"), AsyncRedirectPolicy() @@ -197,10 +202,11 @@ async def test_conf_async_requests(port): assert isinstance(response.http_response.status_code, int) -def test_conf_async_trio_requests(port): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_conf_async_trio_requests(port, http_request): async def do(): - request = HttpRequest("GET", "http://localhost:{}/basic/string".format(port)) + request = http_request("GET", "http://localhost:{}/basic/string".format(port)) policies = [ UserAgentPolicy("myusergant"), AsyncRedirectPolicy() @@ -212,7 +218,8 @@ async def do(): assert isinstance(response.http_response.status_code, int) @pytest.mark.asyncio -async def test_retry_without_http_response(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +async def test_retry_without_http_response(http_request): class NaughtyPolicy(AsyncHTTPPolicy): def send(*args): raise AzureError('boo') @@ -220,7 +227,7 @@ def send(*args): policies = [AsyncRetryPolicy(), NaughtyPolicy()] pipeline = AsyncPipeline(policies=policies, transport=None) with pytest.raises(AzureError): - await pipeline.run(HttpRequest('GET', url='https://foo.bar')) + await pipeline.run(http_request('GET', url='https://foo.bar')) @pytest.mark.asyncio async def test_add_custom_policy(): diff --git a/sdk/core/azure-core/tests/async_tests/test_request_asyncio.py b/sdk/core/azure-core/tests/async_tests/test_request_asyncio.py index 55856ae6ca94..8a8199e65429 100644 --- a/sdk/core/azure-core/tests/async_tests/test_request_asyncio.py +++ b/sdk/core/azure-core/tests/async_tests/test_request_asyncio.py @@ -5,13 +5,14 @@ # ------------------------------------------------------------------------- import json -from azure.core.pipeline.transport import AsyncioRequestsTransport, HttpRequest - +from azure.core.pipeline.transport import AsyncioRequestsTransport +from utils import HTTP_REQUESTS import pytest @pytest.mark.asyncio -async def test_async_gen_data(port): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +async def test_async_gen_data(port, http_request): class AsyncGen: def __init__(self): self._range = iter([b"azerty"]) @@ -26,13 +27,14 @@ async def __anext__(self): raise StopAsyncIteration async with AsyncioRequestsTransport() as transport: - req = HttpRequest('GET', 'http://localhost:{}/basic/anything'.format(port), data=AsyncGen()) + req = http_request('GET', 'http://localhost:{}/basic/anything'.format(port), data=AsyncGen()) response = await transport.send(req) assert json.loads(response.text())['data'] == "azerty" @pytest.mark.asyncio -async def test_send_data(port): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +async def test_send_data(port, http_request): async with AsyncioRequestsTransport() as transport: - req = HttpRequest('PUT', 'http://localhost:{}/basic/anything'.format(port), data=b"azerty") + req = http_request('PUT', 'http://localhost:{}/basic/anything'.format(port), data=b"azerty") response = await transport.send(req) assert json.loads(response.text())['data'] == "azerty" diff --git a/sdk/core/azure-core/tests/async_tests/test_request_trio.py b/sdk/core/azure-core/tests/async_tests/test_request_trio.py index 11a0058404f5..7fafa0d41c28 100644 --- a/sdk/core/azure-core/tests/async_tests/test_request_trio.py +++ b/sdk/core/azure-core/tests/async_tests/test_request_trio.py @@ -5,13 +5,15 @@ # ------------------------------------------------------------------------- import json -from azure.core.pipeline.transport import TrioRequestsTransport, HttpRequest +from azure.core.pipeline.transport import TrioRequestsTransport +from utils import HTTP_REQUESTS import pytest @pytest.mark.trio -async def test_async_gen_data(port): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +async def test_async_gen_data(port, http_request): class AsyncGen: def __init__(self): self._range = iter([b"azerty"]) @@ -26,14 +28,15 @@ async def __anext__(self): raise StopAsyncIteration async with TrioRequestsTransport() as transport: - req = HttpRequest('GET', 'http://localhost:{}/basic/anything'.format(port), data=AsyncGen()) + req = http_request('GET', 'http://localhost:{}/basic/anything'.format(port), data=AsyncGen()) response = await transport.send(req) assert json.loads(response.text())['data'] == "azerty" @pytest.mark.trio -async def test_send_data(port): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +async def test_send_data(port, http_request): async with TrioRequestsTransport() as transport: - req = HttpRequest('PUT', 'http://localhost:{}/basic/anything'.format(port), data=b"azerty") + req = http_request('PUT', 'http://localhost:{}/basic/anything'.format(port), data=b"azerty") response = await transport.send(req) assert json.loads(response.text())['data'] == "azerty" \ No newline at end of file diff --git a/sdk/core/azure-core/tests/async_tests/test_retry_policy_async.py b/sdk/core/azure-core/tests/async_tests/test_retry_policy_async.py index faa0944e6399..270cc5c5684d 100644 --- a/sdk/core/azure-core/tests/async_tests/test_retry_policy_async.py +++ b/sdk/core/azure-core/tests/async_tests/test_retry_policy_async.py @@ -24,7 +24,6 @@ ) from azure.core.pipeline import AsyncPipeline, PipelineResponse from azure.core.pipeline.transport import ( - HttpRequest, HttpResponse, AsyncHttpTransport, ) @@ -32,6 +31,8 @@ import os import time import asyncio +from itertools import product +from utils import HTTP_REQUESTS def test_retry_code_class_variables(): retry_policy = AsyncRetryPolicy() @@ -59,10 +60,10 @@ def test_retry_types(): backoff_time = retry_policy.get_backoff_time(settings) assert backoff_time == 4 -@pytest.mark.parametrize("retry_after_input", [('0'), ('800'), ('1000'), ('1200')]) -def test_retry_after(retry_after_input): +@pytest.mark.parametrize("retry_after_input,http_request", product(['0', '800', '1000', '1200'], HTTP_REQUESTS)) +def test_retry_after(retry_after_input, http_request): retry_policy = AsyncRetryPolicy() - request = HttpRequest("GET", "http://localhost") + request = http_request("GET", "http://localhost") response = HttpResponse(request, None) response.headers["retry-after-ms"] = retry_after_input pipeline_response = PipelineResponse(request, response, None) @@ -77,10 +78,10 @@ def test_retry_after(retry_after_input): retry_after = retry_policy.get_retry_after(pipeline_response) assert retry_after == float(retry_after_input) -@pytest.mark.parametrize("retry_after_input", [('0'), ('800'), ('1000'), ('1200')]) -def test_x_ms_retry_after(retry_after_input): +@pytest.mark.parametrize("retry_after_input,http_request", product(['0', '800', '1000', '1200'], HTTP_REQUESTS)) +def test_x_ms_retry_after(retry_after_input, http_request): retry_policy = AsyncRetryPolicy() - request = HttpRequest("GET", "http://localhost") + request = http_request("GET", "http://localhost") response = HttpResponse(request, None) response.headers["x-ms-retry-after-ms"] = retry_after_input pipeline_response = PipelineResponse(request, response, None) @@ -96,7 +97,8 @@ def test_x_ms_retry_after(retry_after_input): assert retry_after == float(retry_after_input) @pytest.mark.asyncio -async def test_retry_on_429(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +async def test_retry_on_429(http_request): class MockTransport(AsyncHttpTransport): def __init__(self): self._count = 0 @@ -113,7 +115,7 @@ async def send(self, request, **kwargs): # type: (PipelineRequest, Any) -> Pipe response.status_code = 429 return response - http_request = HttpRequest('GET', 'http://localhost/') + http_request = http_request('GET', 'http://localhost/') http_retry = AsyncRetryPolicy(retry_total = 1) transport = MockTransport() pipeline = AsyncPipeline(transport, [http_retry]) @@ -121,7 +123,8 @@ async def send(self, request, **kwargs): # type: (PipelineRequest, Any) -> Pipe assert transport._count == 2 @pytest.mark.asyncio -async def test_no_retry_on_201(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +async def test_no_retry_on_201(http_request): class MockTransport(AsyncHttpTransport): def __init__(self): self._count = 0 @@ -140,7 +143,7 @@ async def send(self, request, **kwargs): # type: (PipelineRequest, Any) -> Pipe response.headers = headers return response - http_request = HttpRequest('GET', 'http://localhost/') + http_request = http_request('GET', 'http://localhost/') http_retry = AsyncRetryPolicy(retry_total = 1) transport = MockTransport() pipeline = AsyncPipeline(transport, [http_retry]) @@ -148,7 +151,8 @@ async def send(self, request, **kwargs): # type: (PipelineRequest, Any) -> Pipe assert transport._count == 1 @pytest.mark.asyncio -async def test_retry_seekable_stream(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +async def test_retry_seekable_stream(http_request): class MockTransport(AsyncHttpTransport): def __init__(self): self._first = True @@ -171,14 +175,15 @@ async def send(self, request, **kwargs): # type: (PipelineRequest, Any) -> Pipe return response data = BytesIO(b"Lots of dataaaa") - http_request = HttpRequest('GET', 'http://localhost/') + http_request = http_request('GET', 'http://localhost/') http_request.set_streamed_data_body(data) http_retry = AsyncRetryPolicy(retry_total = 1) pipeline = AsyncPipeline(MockTransport(), [http_retry]) await pipeline.run(http_request) @pytest.mark.asyncio -async def test_retry_seekable_file(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +async def test_retry_seekable_file(http_request): class MockTransport(AsyncHttpTransport): def __init__(self): self._first = True @@ -209,7 +214,7 @@ async def send(self, request, **kwargs): # type: (PipelineRequest, Any) -> Pipe file = tempfile.NamedTemporaryFile(delete=False) file.write(b'Lots of dataaaa') file.close() - http_request = HttpRequest('GET', 'http://localhost/') + http_request = http_request('GET', 'http://localhost/') headers = {'Content-Type': "multipart/form-data"} http_request.headers = headers with open(file.name, 'rb') as f: @@ -225,7 +230,8 @@ async def send(self, request, **kwargs): # type: (PipelineRequest, Any) -> Pipe @pytest.mark.asyncio -async def test_retry_timeout(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +async def test_retry_timeout(http_request): timeout = 1 def send(request, **kwargs): @@ -241,11 +247,12 @@ def send(request, **kwargs): pipeline = AsyncPipeline(transport, [AsyncRetryPolicy(timeout=timeout)]) with pytest.raises(ServiceResponseTimeoutError): - await pipeline.run(HttpRequest("GET", "http://localhost/")) + await pipeline.run(http_request("GET", "http://localhost/")) @pytest.mark.asyncio -async def test_timeout_defaults(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +async def test_timeout_defaults(http_request): """When "timeout" is not set, the policy should not override the transport's timeout configuration""" async def send(request, **kwargs): @@ -262,18 +269,20 @@ async def send(request, **kwargs): ) pipeline = AsyncPipeline(transport, [AsyncRetryPolicy()]) - await pipeline.run(HttpRequest("GET", "http://localhost/")) + await pipeline.run(http_request("GET", "http://localhost/")) assert transport.send.call_count == 1, "policy should not retry: its first send succeeded" +combinations = [(ServiceRequestError, ServiceRequestTimeoutError), (ServiceResponseError, ServiceResponseTimeoutError)] @pytest.mark.asyncio @pytest.mark.parametrize( - "transport_error,expected_timeout_error", - ((ServiceRequestError, ServiceRequestTimeoutError), (ServiceResponseError, ServiceResponseTimeoutError)), + "combinations,http_request", + product(combinations, HTTP_REQUESTS), ) -async def test_does_not_sleep_after_timeout(transport_error, expected_timeout_error): +async def test_does_not_sleep_after_timeout(combinations, http_request): # With default settings policy will sleep twice before exhausting its retries: 1.6s, 3.2s. # It should not sleep the second time when given timeout=1 + transport_error, expected_timeout_error = combinations timeout = 1 transport = Mock( @@ -284,6 +293,6 @@ async def test_does_not_sleep_after_timeout(transport_error, expected_timeout_er pipeline = AsyncPipeline(transport, [AsyncRetryPolicy(timeout=timeout)]) with pytest.raises(expected_timeout_error): - await pipeline.run(HttpRequest("GET", "http://localhost/")) + await pipeline.run(http_request("GET", "http://localhost/")) assert transport.sleep.call_count == 1 diff --git a/sdk/core/azure-core/tests/async_tests/test_stream_generator_async.py b/sdk/core/azure-core/tests/async_tests/test_stream_generator_async.py index d90b5b15b4c9..f213b92dbbf7 100644 --- a/sdk/core/azure-core/tests/async_tests/test_stream_generator_async.py +++ b/sdk/core/azure-core/tests/async_tests/test_stream_generator_async.py @@ -4,7 +4,6 @@ # ------------------------------------ import requests from azure.core.pipeline.transport import ( - HttpRequest, AsyncHttpResponse, AsyncHttpTransport, AsyncioRequestsTransportResponse, @@ -14,9 +13,11 @@ from azure.core.pipeline.transport._aiohttp import AioHttpStreamDownloadGenerator from unittest import mock import pytest +from utils import HTTP_REQUESTS @pytest.mark.asyncio -async def test_connection_error_response(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +async def test_connection_error_response(http_request): class MockSession(object): def __init__(self): self.auto_decompress = True @@ -38,7 +39,7 @@ async def open(self): pass async def send(self, request, **kwargs): - request = HttpRequest('GET', 'http://localhost/') + request = http_request('GET', 'http://localhost/') response = AsyncHttpResponse(request, None) response.status_code = 200 return response @@ -65,7 +66,7 @@ class AsyncMock(mock.MagicMock): async def __call__(self, *args, **kwargs): return super(AsyncMock, self).__call__(*args, **kwargs) - http_request = HttpRequest('GET', 'http://localhost/') + http_request = http_request('GET', 'http://localhost/') pipeline = AsyncPipeline(MockTransport()) http_response = AsyncHttpResponse(http_request, None) http_response.internal_response = MockInternalResponse() diff --git a/sdk/core/azure-core/tests/async_tests/test_streaming_async.py b/sdk/core/azure-core/tests/async_tests/test_streaming_async.py index 6b4c9ac3b912..8ca4413be936 100644 --- a/sdk/core/azure-core/tests/async_tests/test_streaming_async.py +++ b/sdk/core/azure-core/tests/async_tests/test_streaming_async.py @@ -27,16 +27,18 @@ import pytest from azure.core import AsyncPipelineClient from azure.core.exceptions import DecodeError +from utils import HTTP_REQUESTS @pytest.mark.asyncio -async def test_decompress_plain_no_header(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +async def test_decompress_plain_no_header(http_request): # expect plain text account_name = "coretests" account_url = "https://{}.blob.core.windows.net".format(account_name) url = "https://{}.blob.core.windows.net/tests/test.txt".format(account_name) client = AsyncPipelineClient(account_url) async with client: - request = client.get(url) + request = http_request("GET", url) pipeline_response = await client._pipeline.run(request, stream=True) response = pipeline_response.http_response data = response.stream_download(client._pipeline, decompress=True) @@ -47,14 +49,15 @@ async def test_decompress_plain_no_header(): assert decoded == "test" @pytest.mark.asyncio -async def test_compress_plain_no_header(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +async def test_compress_plain_no_header(http_request): # expect plain text account_name = "coretests" account_url = "https://{}.blob.core.windows.net".format(account_name) url = "https://{}.blob.core.windows.net/tests/test.txt".format(account_name) client = AsyncPipelineClient(account_url) async with client: - request = client.get(url) + request = http_request("GET", url) pipeline_response = await client._pipeline.run(request, stream=True) response = pipeline_response.http_response data = response.stream_download(client._pipeline, decompress=False) @@ -65,14 +68,15 @@ async def test_compress_plain_no_header(): assert decoded == "test" @pytest.mark.asyncio -async def test_decompress_compressed_no_header(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +async def test_decompress_compressed_no_header(http_request): # expect compressed text account_name = "coretests" account_url = "https://{}.blob.core.windows.net".format(account_name) url = "https://{}.blob.core.windows.net/tests/test.tar.gz".format(account_name) client = AsyncPipelineClient(account_url) async with client: - request = client.get(url) + request = http_request("GET", url) pipeline_response = await client._pipeline.run(request, stream=True) response = pipeline_response.http_response data = response.stream_download(client._pipeline, decompress=True) @@ -86,14 +90,15 @@ async def test_decompress_compressed_no_header(): pass @pytest.mark.asyncio -async def test_compress_compressed_no_header(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +async def test_compress_compressed_no_header(http_request): # expect compressed text account_name = "coretests" account_url = "https://{}.blob.core.windows.net".format(account_name) url = "https://{}.blob.core.windows.net/tests/test.tar.gz".format(account_name) client = AsyncPipelineClient(account_url) async with client: - request = client.get(url) + request = http_request("GET", url) pipeline_response = await client._pipeline.run(request, stream=True) response = pipeline_response.http_response data = response.stream_download(client._pipeline, decompress=False) @@ -107,7 +112,8 @@ async def test_compress_compressed_no_header(): pass @pytest.mark.asyncio -async def test_decompress_plain_header(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +async def test_decompress_plain_header(http_request): # expect error import zlib account_name = "coretests" @@ -115,7 +121,7 @@ async def test_decompress_plain_header(): url = "https://{}.blob.core.windows.net/tests/test_with_header.txt".format(account_name) client = AsyncPipelineClient(account_url) async with client: - request = client.get(url) + request = http_request("GET", url) pipeline_response = await client._pipeline.run(request, stream=True) response = pipeline_response.http_response data = response.stream_download(client._pipeline, decompress=True) @@ -128,14 +134,15 @@ async def test_decompress_plain_header(): pass @pytest.mark.asyncio -async def test_compress_plain_header(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +async def test_compress_plain_header(http_request): # expect plain text account_name = "coretests" account_url = "https://{}.blob.core.windows.net".format(account_name) url = "https://{}.blob.core.windows.net/tests/test_with_header.txt".format(account_name) client = AsyncPipelineClient(account_url) async with client: - request = client.get(url) + request = http_request("GET", url) pipeline_response = await client._pipeline.run(request, stream=True) response = pipeline_response.http_response data = response.stream_download(client._pipeline, decompress=False) @@ -146,14 +153,15 @@ async def test_compress_plain_header(): assert decoded == "test" @pytest.mark.asyncio -async def test_decompress_compressed_header(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +async def test_decompress_compressed_header(http_request): # expect plain text account_name = "coretests" account_url = "https://{}.blob.core.windows.net".format(account_name) url = "https://{}.blob.core.windows.net/tests/test_with_header.tar.gz".format(account_name) client = AsyncPipelineClient(account_url) async with client: - request = client.get(url) + request = http_request("GET", url) pipeline_response = await client._pipeline.run(request, stream=True) response = pipeline_response.http_response data = response.stream_download(client._pipeline, decompress=True) @@ -164,14 +172,15 @@ async def test_decompress_compressed_header(): assert decoded == "test" @pytest.mark.asyncio -async def test_compress_compressed_header(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +async def test_compress_compressed_header(http_request): # expect compressed text account_name = "coretests" account_url = "https://{}.blob.core.windows.net".format(account_name) url = "https://{}.blob.core.windows.net/tests/test_with_header.tar.gz".format(account_name) client = AsyncPipelineClient(account_url) async with client: - request = client.get(url) + request = http_request("GET", url) pipeline_response = await client._pipeline.run(request, stream=True) response = pipeline_response.http_response data = response.stream_download(client._pipeline, decompress=False) diff --git a/sdk/core/azure-core/tests/async_tests/test_testserver_async.py b/sdk/core/azure-core/tests/async_tests/test_testserver_async.py index 4501e2dc3887..d6557b2b3e7c 100644 --- a/sdk/core/azure-core/tests/async_tests/test_testserver_async.py +++ b/sdk/core/azure-core/tests/async_tests/test_testserver_async.py @@ -24,12 +24,14 @@ # # -------------------------------------------------------------------------- import pytest -from azure.core.pipeline.transport import HttpRequest, AioHttpTransport +from azure.core.pipeline.transport import AioHttpTransport +from utils import HTTP_REQUESTS """This file does a simple call to the testserver to make sure we can use the testserver""" @pytest.mark.asyncio -async def test_smoke(port): - request = HttpRequest(method="GET", url="http://localhost:{}/basic/string".format(port)) +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +async def test_smoke(port, http_request): + request = http_request(method="GET", url="http://localhost:{}/basic/string".format(port)) async with AioHttpTransport() as sender: response = await sender.send(request) response.raise_for_status() diff --git a/sdk/core/azure-core/tests/async_tests/test_tracing_decorator_async.py b/sdk/core/azure-core/tests/async_tests/test_tracing_decorator_async.py index 62b606218a0e..1b813ba53cde 100644 --- a/sdk/core/azure-core/tests/async_tests/test_tracing_decorator_async.py +++ b/sdk/core/azure-core/tests/async_tests/test_tracing_decorator_async.py @@ -15,11 +15,12 @@ import pytest from azure.core.pipeline import Pipeline, PipelineResponse from azure.core.pipeline.policies import HTTPPolicy -from azure.core.pipeline.transport import HttpTransport, HttpRequest +from azure.core.pipeline.transport import HttpTransport from azure.core.settings import settings from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async from tracing_common import FakeSpan +from utils import HTTP_REQUESTS @pytest.fixture(scope="module") @@ -29,9 +30,9 @@ def fake_span(): class MockClient: @distributed_trace - def __init__(self, policies=None, assert_current_span=False): + def __init__(self, http_request, policies=None, assert_current_span=False): time.sleep(0.001) - self.request = HttpRequest("GET", "http://localhost") + self.request = http_request("GET", "http://localhost") if policies is None: policies = [] policies.append(mock.Mock(spec=HTTPPolicy, send=self.verify_request)) @@ -88,9 +89,10 @@ async def raising_exception(self): class TestAsyncDecorator(object): @pytest.mark.asyncio - async def test_decorator_tracing_attr(self): + @pytest.mark.parametrize("http_request", HTTP_REQUESTS) + async def test_decorator_tracing_attr(self, http_request): with FakeSpan(name="parent") as parent: - client = MockClient() + client = MockClient(http_request) await client.tracing_attr() assert len(parent.children) == 2 @@ -100,9 +102,10 @@ async def test_decorator_tracing_attr(self): @pytest.mark.asyncio - async def test_decorator_has_different_name(self): + @pytest.mark.parametrize("http_request", HTTP_REQUESTS) + async def test_decorator_has_different_name(self, http_request): with FakeSpan(name="parent") as parent: - client = MockClient() + client = MockClient(http_request) await client.check_name_is_different() assert len(parent.children) == 2 assert parent.children[0].name == "MockClient.__init__" @@ -110,9 +113,10 @@ async def test_decorator_has_different_name(self): @pytest.mark.asyncio - async def test_used(self): + @pytest.mark.parametrize("http_request", HTTP_REQUESTS) + async def test_used(self, http_request): with FakeSpan(name="parent") as parent: - client = MockClient(policies=[]) + client = MockClient(http_request, policies=[]) await client.get_foo(parent_span=parent) await client.get_foo() @@ -126,9 +130,10 @@ async def test_used(self): @pytest.mark.asyncio - async def test_span_merge_span(self): + @pytest.mark.parametrize("http_request", HTTP_REQUESTS) + async def test_span_merge_span(self, http_request): with FakeSpan(name="parent") as parent: - client = MockClient() + client = MockClient(http_request) await client.merge_span_method() await client.no_merge_span_method() @@ -142,9 +147,10 @@ async def test_span_merge_span(self): @pytest.mark.asyncio - async def test_span_complicated(self): + @pytest.mark.parametrize("http_request", HTTP_REQUESTS) + async def test_span_complicated(self, http_request): with FakeSpan(name="parent") as parent: - client = MockClient() + client = MockClient(http_request) await client.make_request(2) with parent.span("child") as child: time.sleep(0.001) @@ -163,11 +169,12 @@ async def test_span_complicated(self): assert not parent.children[3].children @pytest.mark.asyncio - async def test_span_with_exception(self): + @pytest.mark.parametrize("http_request", HTTP_REQUESTS) + async def test_span_with_exception(self, http_request): """Assert that if an exception is raised, the next sibling method is actually a sibling span. """ with FakeSpan(name="parent") as parent: - client = MockClient() + client = MockClient(http_request) try: await client.raising_exception() except: diff --git a/sdk/core/azure-core/tests/async_tests/test_universal_http_async.py b/sdk/core/azure-core/tests/async_tests/test_universal_http_async.py index fa65fc3353c5..b9229c209fa2 100644 --- a/sdk/core/azure-core/tests/async_tests/test_universal_http_async.py +++ b/sdk/core/azure-core/tests/async_tests/test_universal_http_async.py @@ -24,7 +24,6 @@ # #-------------------------------------------------------------------------- from azure.core.pipeline.transport import ( - HttpRequest, AioHttpTransport, AioHttpTransportResponse, AsyncioRequestsTransport, @@ -34,12 +33,13 @@ import trio import pytest - +from utils import HTTP_REQUESTS, create_http_request @pytest.mark.asyncio -async def test_basic_aiohttp(port): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +async def test_basic_aiohttp(port, http_request): - request = HttpRequest("GET", "http://localhost:{}/basic/string".format(port)) + request = http_request("GET", "http://localhost:{}/basic/string".format(port)) async with AioHttpTransport() as sender: response = await sender.send(request) assert response.body() is not None @@ -48,18 +48,20 @@ async def test_basic_aiohttp(port): assert isinstance(response.status_code, int) @pytest.mark.asyncio -async def test_aiohttp_auto_headers(port): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +async def test_aiohttp_auto_headers(port, http_request): - request = HttpRequest("POST", "http://localhost:{}/basic/string".format(port)) + request = http_request("POST", "http://localhost:{}/basic/string".format(port)) async with AioHttpTransport() as sender: response = await sender.send(request) auto_headers = response.internal_response.request_info.headers assert 'Content-Type' not in auto_headers @pytest.mark.asyncio -async def test_basic_async_requests(port): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +async def test_basic_async_requests(port, http_request): - request = HttpRequest("GET", "http://localhost:{}/basic/string".format(port)) + request = http_request("GET", "http://localhost:{}/basic/string".format(port)) async with AsyncioRequestsTransport() as sender: response = await sender.send(request) assert response.body() is not None @@ -67,19 +69,21 @@ async def test_basic_async_requests(port): assert isinstance(response.status_code, int) @pytest.mark.asyncio -async def test_conf_async_requests(port): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +async def test_conf_async_requests(port, http_request): - request = HttpRequest("GET", "http://localhost:{}/basic/string".format(port)) + request = http_request("GET", "http://localhost:{}/basic/string".format(port)) async with AsyncioRequestsTransport() as sender: response = await sender.send(request) assert response.body() is not None assert isinstance(response.status_code, int) -def test_conf_async_trio_requests(port): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_conf_async_trio_requests(port, http_request): async def do(): - request = HttpRequest("GET", "http://localhost:{}/basic/string".format(port)) + request = http_request("GET", "http://localhost:{}/basic/string".format(port)) async with TrioRequestsTransport() as sender: return await sender.send(request) assert response.body() is not None diff --git a/sdk/core/azure-core/tests/test_authentication.py b/sdk/core/azure-core/tests/test_authentication.py index de029e8ea352..1be8b8e12cf3 100644 --- a/sdk/core/azure-core/tests/test_authentication.py +++ b/sdk/core/azure-core/tests/test_authentication.py @@ -4,7 +4,7 @@ # license information. # ------------------------------------------------------------------------- import time - +from itertools import product import azure.core from azure.core.credentials import AccessToken, AzureKeyCredential, AzureSasCredential, AzureNamedKeyCredential from azure.core.exceptions import ServiceRequestError @@ -15,7 +15,7 @@ AzureKeyCredentialPolicy, AzureSasCredentialPolicy, ) -from azure.core.pipeline.transport import HttpRequest +from utils import HTTP_REQUESTS import pytest @@ -26,7 +26,8 @@ from mock import Mock -def test_bearer_policy_adds_header(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_bearer_policy_adds_header(http_request): """The bearer token policy should add a header containing a token from its credential""" # 2524608000 == 01/01/2050 @ 12:00am (UTC) expected_token = AccessToken("expected_token", 2524608000) @@ -39,19 +40,20 @@ def verify_authorization_header(request): policies = [BearerTokenCredentialPolicy(fake_credential, "scope"), Mock(send=verify_authorization_header)] pipeline = Pipeline(transport=Mock(), policies=policies) - pipeline.run(HttpRequest("GET", "https://spam.eggs")) + pipeline.run(http_request("GET", "https://spam.eggs")) assert fake_credential.get_token.call_count == 1 - pipeline.run(HttpRequest("GET", "https://spam.eggs")) + pipeline.run(http_request("GET", "https://spam.eggs")) # Didn't need a new token assert fake_credential.get_token.call_count == 1 -def test_bearer_policy_send(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_bearer_policy_send(http_request): """The bearer token policy should invoke the next policy's send method and return the result""" - expected_request = HttpRequest("GET", "https://spam.eggs") + expected_request = http_request("GET", "https://spam.eggs") expected_response = Mock() def verify_request(request): @@ -65,15 +67,16 @@ def verify_request(request): assert response is expected_response -def test_bearer_policy_token_caching(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_bearer_policy_token_caching(http_request): good_for_one_hour = AccessToken("token", time.time() + 3600) credential = Mock(get_token=Mock(return_value=good_for_one_hour)) pipeline = Pipeline(transport=Mock(), policies=[BearerTokenCredentialPolicy(credential, "scope")]) - pipeline.run(HttpRequest("GET", "https://spam.eggs")) + pipeline.run(http_request("GET", "https://spam.eggs")) assert credential.get_token.call_count == 1 # policy has no token at first request -> it should call get_token - pipeline.run(HttpRequest("GET", "https://spam.eggs")) + pipeline.run(http_request("GET", "https://spam.eggs")) assert credential.get_token.call_count == 1 # token is good for an hour -> policy should return it from cache expired_token = AccessToken("token", time.time()) @@ -81,14 +84,15 @@ def test_bearer_policy_token_caching(): credential.get_token.return_value = expired_token pipeline = Pipeline(transport=Mock(), policies=[BearerTokenCredentialPolicy(credential, "scope")]) - pipeline.run(HttpRequest("GET", "https://spam.eggs")) + pipeline.run(http_request("GET", "https://spam.eggs")) assert credential.get_token.call_count == 1 - pipeline.run(HttpRequest("GET", "https://spam.eggs")) + pipeline.run(http_request("GET", "https://spam.eggs")) assert credential.get_token.call_count == 2 # token expired -> policy should call get_token -def test_bearer_policy_optionally_enforces_https(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_bearer_policy_optionally_enforces_https(http_request): """HTTPS enforcement should be controlled by a keyword argument, and enabled by default""" def assert_option_popped(request, **kwargs): @@ -102,20 +106,21 @@ def assert_option_popped(request, **kwargs): # by default and when enforce_https=True, the policy should raise when given an insecure request with pytest.raises(ServiceRequestError): - pipeline.run(HttpRequest("GET", "http://not.secure")) + pipeline.run(http_request("GET", "http://not.secure")) with pytest.raises(ServiceRequestError): - pipeline.run(HttpRequest("GET", "http://not.secure"), enforce_https=True) + pipeline.run(http_request("GET", "http://not.secure"), enforce_https=True) # when enforce_https=False, an insecure request should pass - pipeline.run(HttpRequest("GET", "http://not.secure"), enforce_https=False) + pipeline.run(http_request("GET", "http://not.secure"), enforce_https=False) # https requests should always pass - pipeline.run(HttpRequest("GET", "https://secure"), enforce_https=False) - pipeline.run(HttpRequest("GET", "https://secure"), enforce_https=True) - pipeline.run(HttpRequest("GET", "https://secure")) + pipeline.run(http_request("GET", "https://secure"), enforce_https=False) + pipeline.run(http_request("GET", "https://secure"), enforce_https=True) + pipeline.run(http_request("GET", "https://secure")) -def test_bearer_policy_preserves_enforce_https_opt_out(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_bearer_policy_preserves_enforce_https_opt_out(http_request): """The policy should use request context to preserve an opt out from https enforcement""" class ContextValidator(SansIOHTTPPolicy): @@ -127,10 +132,11 @@ def on_request(self, request): policies = [BearerTokenCredentialPolicy(credential, "scope"), ContextValidator()] pipeline = Pipeline(transport=Mock(), policies=policies) - pipeline.run(HttpRequest("GET", "http://not.secure"), enforce_https=False) + pipeline.run(http_request("GET", "http://not.secure"), enforce_https=False) -def test_bearer_policy_default_context(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_bearer_policy_default_context(http_request): """The policy should call get_token with the scopes given at construction, and no keyword arguments, by default""" expected_scope = "scope" token = AccessToken("", 0) @@ -138,12 +144,13 @@ def test_bearer_policy_default_context(): policy = BearerTokenCredentialPolicy(credential, expected_scope) pipeline = Pipeline(transport=Mock(), policies=[policy]) - pipeline.run(HttpRequest("GET", "https://localhost")) + pipeline.run(http_request("GET", "https://localhost")) credential.get_token.assert_called_once_with(expected_scope) -def test_bearer_policy_context_unmodified_by_default(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_bearer_policy_context_unmodified_by_default(http_request): """When no options for the policy accompany a request, the policy shouldn't add anything to the request context""" class ContextValidator(SansIOHTTPPolicy): @@ -154,10 +161,11 @@ def on_request(self, request): policies = [BearerTokenCredentialPolicy(credential, "scope"), ContextValidator()] pipeline = Pipeline(transport=Mock(), policies=policies) - pipeline.run(HttpRequest("GET", "https://secure")) + pipeline.run(http_request("GET", "https://secure")) -def test_bearer_policy_calls_on_challenge(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_bearer_policy_calls_on_challenge(http_request): """BearerTokenCredentialPolicy should call its on_challenge method when it receives an authentication challenge""" class TestPolicy(BearerTokenCredentialPolicy): @@ -173,12 +181,13 @@ def on_challenge(self, request, challenge): transport = Mock(send=Mock(return_value=response)) pipeline = Pipeline(transport=transport, policies=policies) - pipeline.run(HttpRequest("GET", "https://localhost")) + pipeline.run(http_request("GET", "https://localhost")) assert TestPolicy.called -def test_bearer_policy_cannot_complete_challenge(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_bearer_policy_cannot_complete_challenge(http_request): """BearerTokenCredentialPolicy should return the 401 response when it can't complete its challenge""" expected_scope = "scope" @@ -189,14 +198,15 @@ def test_bearer_policy_cannot_complete_challenge(): policies = [BearerTokenCredentialPolicy(credential, expected_scope)] pipeline = Pipeline(transport=transport, policies=policies) - response = pipeline.run(HttpRequest("GET", "https://localhost")) + response = pipeline.run(http_request("GET", "https://localhost")) assert response.http_response is expected_response assert transport.send.call_count == 1 credential.get_token.assert_called_once_with(expected_scope) -def test_bearer_policy_calls_sansio_methods(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_bearer_policy_calls_sansio_methods(http_request): """BearerTokenCredentialPolicy should call SansIOHttpPolicy methods as does _SansIOHTTPPolicyRunner""" class TestPolicy(BearerTokenCredentialPolicy): @@ -216,7 +226,7 @@ def send(self, request): transport = Mock(send=Mock(return_value=Mock(status_code=200))) pipeline = Pipeline(transport=transport, policies=[policy]) - pipeline.run(HttpRequest("GET", "https://localhost")) + pipeline.run(http_request("GET", "https://localhost")) policy.on_request.assert_called_once_with(policy.request) policy.on_response.assert_called_once_with(policy.request, policy.response) @@ -230,7 +240,7 @@ class TestException(Exception): policy = TestPolicy(credential, "scope") pipeline = Pipeline(transport=transport, policies=[policy]) with pytest.raises(TestException): - pipeline.run(HttpRequest("GET", "https://localhost")) + pipeline.run(http_request("GET", "https://localhost")) policy.on_exception.assert_called_once_with(policy.request) # ...or the second @@ -246,14 +256,15 @@ def raise_the_second_time(*args, **kwargs): transport = Mock(send=Mock(wraps=raise_the_second_time)) pipeline = Pipeline(transport=transport, policies=[policy]) with pytest.raises(TestException): - pipeline.run(HttpRequest("GET", "https://localhost")) + pipeline.run(http_request("GET", "https://localhost")) assert transport.send.call_count == 2 policy.on_challenge.assert_called_once() policy.on_exception.assert_called_once_with(policy.request) @pytest.mark.skipif(azure.core.__version__ >= "2", reason="this test applies only to azure-core 1.x") -def test_key_vault_regression(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_key_vault_regression(http_request): """Test for regression affecting azure-keyvault-* 4.0.0. This test must pass, unmodified, for all 1.x versions.""" from azure.core.pipeline.policies._authentication import _BearerTokenCredentialPolicyBase @@ -273,7 +284,8 @@ def test_key_vault_regression(): assert policy._token.token == token -def test_azure_key_credential_policy(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_azure_key_credential_policy(http_request): """Tests to see if we can create an AzureKeyCredentialPolicy""" key_header = "api_key" @@ -287,7 +299,7 @@ def verify_authorization_header(request): credential_policy = AzureKeyCredentialPolicy(credential=credential, name=key_header) pipeline = Pipeline(transport=transport, policies=[credential_policy]) - pipeline.run(HttpRequest("GET", "https://test_key_credential")) + pipeline.run(http_request("GET", "https://test_key_credential")) def test_azure_key_credential_policy_raises(): @@ -313,7 +325,7 @@ def test_azure_key_credential_updates(): credential.update(api_key) assert credential.key == api_key -@pytest.mark.parametrize("sas,url,expected_url", [ +combinations = [ ("sig=test_signature", "https://test_sas_credential", "https://test_sas_credential?sig=test_signature"), ("?sig=test_signature", "https://test_sas_credential", "https://test_sas_credential?sig=test_signature"), ("sig=test_signature", "https://test_sas_credential?sig=test_signature", "https://test_sas_credential?sig=test_signature"), @@ -322,10 +334,12 @@ def test_azure_key_credential_updates(): ("?sig=test_signature", "https://test_sas_credential?", "https://test_sas_credential?sig=test_signature"), ("sig=test_signature", "https://test_sas_credential?foo=bar", "https://test_sas_credential?foo=bar&sig=test_signature"), ("?sig=test_signature", "https://test_sas_credential?foo=bar", "https://test_sas_credential?foo=bar&sig=test_signature"), -]) -def test_azure_sas_credential_policy(sas, url, expected_url): - """Tests to see if we can create an AzureSasCredentialPolicy""" +] +@pytest.mark.parametrize("combinations,http_request", product(combinations, HTTP_REQUESTS)) +def test_azure_sas_credential_policy(combinations, http_request): + """Tests to see if we can create an AzureSasCredentialPolicy""" + sas, url, expected_url = combinations def verify_authorization(request): assert request.url == expected_url @@ -334,7 +348,7 @@ def verify_authorization(request): credential_policy = AzureSasCredentialPolicy(credential=credential) pipeline = Pipeline(transport=transport, policies=[credential_policy]) - pipeline.run(HttpRequest("GET", url)) + pipeline.run(http_request("GET", url)) def test_azure_sas_credential_updates(): """Tests AzureSasCredential updates""" diff --git a/sdk/core/azure-core/tests/test_base_polling.py b/sdk/core/azure-core/tests/test_base_polling.py index f5c1db343302..c75b401df01d 100644 --- a/sdk/core/azure-core/tests/test_base_polling.py +++ b/sdk/core/azure-core/tests/test_base_polling.py @@ -48,7 +48,7 @@ from azure.core.polling.base_polling import LROBasePolling from azure.core.pipeline.policies._utils import _FixedOffset - +from utils import HTTP_REQUESTS, is_rest class SimpleResource: """An implementation of Python 3 SimpleNamespace. @@ -82,8 +82,9 @@ class BadEndpointError(Exception): POLLING_STATUS = 200 CLIENT = PipelineClient("http://example.org") +CLIENT.http_request_type = None def mock_run(client_self, request, **kwargs): - return TestBasePolling.mock_update(request.url, request.headers) + return TestBasePolling.mock_update(client_self.http_request_type, request.url, request.headers) CLIENT._pipeline.run = types.MethodType(mock_run, CLIENT) @@ -183,13 +184,14 @@ def test_delay_extraction_httpdate(polling_response): assert polling._extract_delay() == 60*60 # one hour in seconds assert str(mock_datetime.now.call_args[0][0]) == "" - -def test_post(pipeline_client_builder, deserialization_cb): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_post(pipeline_client_builder, deserialization_cb, http_request): # Test POST LRO with both Location and Operation-Location # The initial response contains both Location and Operation-Location, a 202 and no Body initial_response = TestBasePolling.mock_send( + http_request, 'POST', 202, { @@ -204,12 +206,14 @@ def send(request, **kwargs): if request.url == 'http://example.org/location': return TestBasePolling.mock_send( + http_request, 'GET', 200, body={'location_result': True} ).http_response elif request.url == 'http://example.org/async_monitor': return TestBasePolling.mock_send( + http_request, 'GET', 200, body={'status': 'Succeeded'} @@ -235,12 +239,14 @@ def send(request, **kwargs): if request.url == 'http://example.org/location': return TestBasePolling.mock_send( + http_request, 'GET', 200, body=None ).http_response elif request.url == 'http://example.org/async_monitor': return TestBasePolling.mock_send( + http_request, 'GET', 200, body={'status': 'Succeeded'} @@ -258,13 +264,14 @@ def send(request, **kwargs): result = poll.result() assert result is None - -def test_post_resource_location(pipeline_client_builder, deserialization_cb): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_post_resource_location(pipeline_client_builder, deserialization_cb, http_request): # ResourceLocation # The initial response contains both Location and Operation-Location, a 202 and no Body initial_response = TestBasePolling.mock_send( + http_request, 'POST', 202, { @@ -278,12 +285,14 @@ def send(request, **kwargs): if request.url == 'http://example.org/resource_location': return TestBasePolling.mock_send( + http_request, 'GET', 200, body={'location_result': True} ).http_response elif request.url == 'http://example.org/async_monitor': return TestBasePolling.mock_send( + http_request, 'GET', 200, body={'status': 'Succeeded', 'resourceLocation': 'http://example.org/resource_location'} @@ -307,7 +316,7 @@ class TestBasePolling(object): convert = re.compile('([a-z0-9])([A-Z])') @staticmethod - def mock_send(method, status, headers=None, body=RESPONSE_BODY): + def mock_send(http_request, method, status, headers=None, body=RESPONSE_BODY): if headers is None: headers = {} response = Response() @@ -324,15 +333,23 @@ def mock_send(method, status, headers=None, body=RESPONSE_BODY): response.headers.update({"content-type": "application/json; charset=utf8"}) response.reason = "OK" - request = CLIENT._request( - response.request.method, - response.request.url, - None, # params - response.request.headers, - body, - None, # form_content - None # stream_content - ) + if is_rest(http_request): + request = http_request( + response.request.method, + response.request.url, + headers=response.request.headers, + content=body, + ) + else: + request = CLIENT._request( + response.request.method, + response.request.url, + None, # params + response.request.headers, + body, + None, # form_content + None # stream_content + ) return PipelineResponse( request, @@ -344,7 +361,7 @@ def mock_send(method, status, headers=None, body=RESPONSE_BODY): ) @staticmethod - def mock_update(url, headers=None): + def mock_update(http_request, url, headers=None): response = Response() response._content_consumed = True response.request = mock.create_autospec(Request) @@ -375,15 +392,9 @@ def mock_update(url, headers=None): else: raise Exception('URL does not match') - - request = CLIENT._request( + request = http_request( response.request.method, response.request.url, - None, # params - {}, # request has no headers - None, # Request has no body - None, # form_content - None # stream_content ) return PipelineResponse( @@ -425,11 +436,14 @@ def mock_deserialization_no_body(pipeline_response): """ return None - def test_long_running_put(self): + @pytest.mark.parametrize("http_request", HTTP_REQUESTS) + def test_long_running_put(self, http_request): #TODO: Test custom header field # Test throw on non LRO related status code - response = TestBasePolling.mock_send('PUT', 1000, {}) + response = TestBasePolling.mock_send( + http_request, 'PUT', 1000, {}) + CLIENT.http_request_type = http_request with pytest.raises(HttpResponseError): LROPoller(CLIENT, response, TestBasePolling.mock_outputs, @@ -441,6 +455,7 @@ def test_long_running_put(self): 'name': TEST_NAME } response = TestBasePolling.mock_send( + http_request, 'PUT', 201, {}, response_body ) @@ -455,6 +470,7 @@ def no_update_allowed(url, headers=None): # Test polling from operation-location header response = TestBasePolling.mock_send( + http_request, 'PUT', 201, {'operation-location': ASYNC_URL}) poll = LROPoller(CLIENT, response, @@ -465,6 +481,7 @@ def no_update_allowed(url, headers=None): # Test polling location header response = TestBasePolling.mock_send( + http_request, 'PUT', 201, {'location': LOCATION_URL}) poll = LROPoller(CLIENT, response, @@ -476,6 +493,7 @@ def no_update_allowed(url, headers=None): # Test polling initial payload invalid (SQLDb) response_body = {} # Empty will raise response = TestBasePolling.mock_send( + http_request, 'PUT', 201, {'location': LOCATION_URL}, response_body) poll = LROPoller(CLIENT, response, @@ -486,6 +504,7 @@ def no_update_allowed(url, headers=None): # Test fail to poll from operation-location header response = TestBasePolling.mock_send( + http_request, 'PUT', 201, {'operation-location': ERROR}) with pytest.raises(BadEndpointError): @@ -495,6 +514,7 @@ def no_update_allowed(url, headers=None): # Test fail to poll from location header response = TestBasePolling.mock_send( + http_request, 'PUT', 201, {'location': ERROR}) with pytest.raises(BadEndpointError): @@ -502,10 +522,12 @@ def no_update_allowed(url, headers=None): TestBasePolling.mock_outputs, LROBasePolling(0)).result() - def test_long_running_patch(self): - + @pytest.mark.parametrize("http_request", HTTP_REQUESTS) + def test_long_running_patch(self, http_request): + CLIENT.http_request_type = http_request # Test polling from location header response = TestBasePolling.mock_send( + http_request, 'PATCH', 202, {'location': LOCATION_URL}, body={'properties':{'provisioningState': 'Succeeded'}}) @@ -517,6 +539,7 @@ def test_long_running_patch(self): # Test polling from operation-location header response = TestBasePolling.mock_send( + http_request, 'PATCH', 202, {'operation-location': ASYNC_URL}, body={'properties':{'provisioningState': 'Succeeded'}}) @@ -528,6 +551,7 @@ def test_long_running_patch(self): # Test polling from location header response = TestBasePolling.mock_send( + http_request, 'PATCH', 200, {'location': LOCATION_URL}, body={'properties':{'provisioningState': 'Succeeded'}}) @@ -539,6 +563,7 @@ def test_long_running_patch(self): # Test polling from operation-location header response = TestBasePolling.mock_send( + http_request, 'PATCH', 200, {'operation-location': ASYNC_URL}, body={'properties':{'provisioningState': 'Succeeded'}}) @@ -550,6 +575,7 @@ def test_long_running_patch(self): # Test fail to poll from operation-location header response = TestBasePolling.mock_send( + http_request, 'PATCH', 202, {'operation-location': ERROR}) with pytest.raises(BadEndpointError): @@ -559,6 +585,7 @@ def test_long_running_patch(self): # Test fail to poll from location header response = TestBasePolling.mock_send( + http_request, 'PATCH', 202, {'location': ERROR}) with pytest.raises(BadEndpointError): @@ -566,27 +593,33 @@ def test_long_running_patch(self): TestBasePolling.mock_outputs, LROBasePolling(0)).result() - def test_long_running_delete(self): + @pytest.mark.parametrize("http_request", HTTP_REQUESTS) + def test_long_running_delete(self, http_request): # Test polling from operation-location header response = TestBasePolling.mock_send( + http_request, 'DELETE', 202, {'operation-location': ASYNC_URL}, body="" ) + CLIENT.http_request_type = http_request poll = LROPoller(CLIENT, response, TestBasePolling.mock_deserialization_no_body, LROBasePolling(0)) poll.wait() assert poll._polling_method._pipeline_response.http_response.internal_response.randomFieldFromPollAsyncOpHeader is None - def test_long_running_post_legacy(self): + @pytest.mark.parametrize("http_request", HTTP_REQUESTS) + def test_long_running_post_legacy(self, http_request): # Former oooooold tests to refactor one day to something more readble # Test polling from operation-location header response = TestBasePolling.mock_send( + http_request, 'POST', 201, {'operation-location': ASYNC_URL}, body={'properties':{'provisioningState': 'Succeeded'}}) + CLIENT.http_request_type = http_request poll = LROPoller(CLIENT, response, TestBasePolling.mock_deserialization_no_body, LROBasePolling(0)) @@ -595,6 +628,7 @@ def test_long_running_post_legacy(self): # Test polling from operation-location header response = TestBasePolling.mock_send( + http_request, 'POST', 202, {'operation-location': ASYNC_URL}, body={'properties':{'provisioningState': 'Succeeded'}}) @@ -606,6 +640,7 @@ def test_long_running_post_legacy(self): # Test polling from location header response = TestBasePolling.mock_send( + http_request, 'POST', 202, {'location': LOCATION_URL}, body={'properties':{'provisioningState': 'Succeeded'}}) @@ -617,6 +652,7 @@ def test_long_running_post_legacy(self): # Test fail to poll from operation-location header response = TestBasePolling.mock_send( + http_request, 'POST', 202, {'operation-location': ERROR}) with pytest.raises(BadEndpointError): @@ -626,6 +662,7 @@ def test_long_running_post_legacy(self): # Test fail to poll from location header response = TestBasePolling.mock_send( + http_request, 'POST', 202, {'location': ERROR}) with pytest.raises(BadEndpointError): @@ -633,13 +670,15 @@ def test_long_running_post_legacy(self): TestBasePolling.mock_outputs, LROBasePolling(0)).result() - def test_long_running_negative(self): + @pytest.mark.parametrize("http_request", HTTP_REQUESTS) + def test_long_running_negative(self, http_request): global LOCATION_BODY global POLLING_STATUS - + CLIENT.http_request_type = http_request # Test LRO PUT throws for invalid json LOCATION_BODY = '{' response = TestBasePolling.mock_send( + http_request, 'POST', 202, {'location': LOCATION_URL}) poll = LROPoller( @@ -653,6 +692,7 @@ def test_long_running_negative(self): LOCATION_BODY = '{\'"}' response = TestBasePolling.mock_send( + http_request, 'POST', 202, {'location': LOCATION_URL}) poll = LROPoller(CLIENT, response, @@ -664,6 +704,7 @@ def test_long_running_negative(self): LOCATION_BODY = '{' POLLING_STATUS = 203 response = TestBasePolling.mock_send( + http_request, 'POST', 202, {'location': LOCATION_URL}) poll = LROPoller(CLIENT, response, @@ -675,4 +716,3 @@ def test_long_running_negative(self): LOCATION_BODY = json.dumps({ 'name': TEST_NAME }) POLLING_STATUS = 200 - diff --git a/sdk/core/azure-core/tests/test_basic_transport.py b/sdk/core/azure-core/tests/test_basic_transport.py index 7c57f53dfeee..4b4fd280dc0c 100644 --- a/sdk/core/azure-core/tests/test_basic_transport.py +++ b/sdk/core/azure-core/tests/test_basic_transport.py @@ -12,13 +12,14 @@ except ImportError: import mock -from azure.core.pipeline.transport import HttpRequest, HttpResponse, RequestsTransport +from azure.core.pipeline.transport import HttpResponse, RequestsTransport from azure.core.pipeline.transport._base import HttpClientTransportResponse, HttpTransport, _deserialize_response, _urljoin from azure.core.pipeline.policies import HeadersPolicy from azure.core.pipeline import Pipeline from azure.core.exceptions import HttpResponseError import logging import pytest +from utils import HTTP_REQUESTS class MockResponse(HttpResponse): @@ -31,9 +32,10 @@ def body(self): return self._body @pytest.mark.skipif(sys.version_info < (3, 6), reason="Multipart serialization not supported on 2.7 + dict order not deterministic on 3.5") -def test_http_request_serialization(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_http_request_serialization(http_request): # Method + Url - request = HttpRequest("DELETE", "/container0/blob0") + request = http_request("DELETE", "/container0/blob0") serialized = request.serialize() expected = ( @@ -44,7 +46,7 @@ def test_http_request_serialization(): assert serialized == expected # Method + Url + Headers - request = HttpRequest( + request = http_request( "DELETE", "/container0/blob0", # Use OrderedDict to get consistent test result on 3.5 where order is not guaranteed @@ -67,7 +69,7 @@ def test_http_request_serialization(): # Method + Url + Headers + Body - request = HttpRequest( + request = http_request( "DELETE", "/container0/blob0", headers={ @@ -87,16 +89,18 @@ def test_http_request_serialization(): assert serialized == expected -def test_url_join(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_url_join(http_request): assert _urljoin('devstoreaccount1', '') == 'devstoreaccount1/' assert _urljoin('devstoreaccount1', 'testdir/') == 'devstoreaccount1/testdir/' assert _urljoin('devstoreaccount1/', '') == 'devstoreaccount1/' assert _urljoin('devstoreaccount1/', 'testdir/') == 'devstoreaccount1/testdir/' -def test_http_client_response(port): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_http_client_response(port, http_request): # Create a core request - request = HttpRequest("GET", "http://localhost:{}".format(port)) + request = http_request("GET", "http://localhost:{}".format(port)) # Fake a transport based on http.client conn = HTTPConnection("localhost", port) @@ -115,10 +119,11 @@ def test_http_client_response(port): assert "Content-Type" in response.headers -def test_response_deserialization(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_response_deserialization(http_request): # Method + Url - request = HttpRequest("DELETE", "/container0/blob0") + request = http_request("DELETE", "/container0/blob0") body = ( b'HTTP/1.1 202 Accepted\r\n' b'x-ms-request-id: 778fdc83-801e-0000-62ff-0334671e284f\r\n' @@ -135,7 +140,7 @@ def test_response_deserialization(): } # Method + Url + Headers + Body - request = HttpRequest( + request = http_request( "DELETE", "/container0/blob0", headers={ @@ -161,9 +166,10 @@ def test_response_deserialization(): } assert response.text() == "I am groot" -def test_response_deserialization_utf8_bom(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_response_deserialization_utf8_bom(http_request): - request = HttpRequest("DELETE", "/container0/blob0") + request = http_request("DELETE", "/container0/blob0") body = ( b'HTTP/1.1 400 One of the request inputs is not valid.\r\n' b'x-ms-error-code: InvalidInput\r\n' @@ -181,7 +187,8 @@ def test_response_deserialization_utf8_bom(): @pytest.mark.skipif(sys.version_info < (3, 0), reason="Multipart serialization not supported on 2.7") -def test_multipart_send(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_multipart_send(http_request): transport = mock.MagicMock(spec=HttpTransport) @@ -189,10 +196,10 @@ def test_multipart_send(): 'x-ms-date': 'Thu, 14 Jun 2018 16:46:54 GMT' }) - req0 = HttpRequest("DELETE", "/container0/blob0") - req1 = HttpRequest("DELETE", "/container1/blob1") + req0 = http_request("DELETE", "/container0/blob0") + req1 = http_request("DELETE", "/container1/blob1") - request = HttpRequest("POST", "http://account.blob.core.windows.net/?comp=batch") + request = http_request("POST", "http://account.blob.core.windows.net/?comp=batch") request.set_multipart_mixed( req0, req1, @@ -227,17 +234,18 @@ def test_multipart_send(): @pytest.mark.skipif(sys.version_info < (3, 0), reason="Multipart serialization not supported on 2.7") -def test_multipart_send_with_context(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_multipart_send_with_context(http_request): transport = mock.MagicMock(spec=HttpTransport) header_policy = HeadersPolicy({ 'x-ms-date': 'Thu, 14 Jun 2018 16:46:54 GMT' }) - req0 = HttpRequest("DELETE", "/container0/blob0") - req1 = HttpRequest("DELETE", "/container1/blob1") + req0 = http_request("DELETE", "/container0/blob0") + req1 = http_request("DELETE", "/container1/blob1") - request = HttpRequest("POST", "http://account.blob.core.windows.net/?comp=batch") + request = http_request("POST", "http://account.blob.core.windows.net/?comp=batch") request.set_multipart_mixed( req0, req1, @@ -275,7 +283,8 @@ def test_multipart_send_with_context(): @pytest.mark.skipif(sys.version_info < (3, 0), reason="Multipart serialization not supported on 2.7") -def test_multipart_send_with_one_changeset(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_multipart_send_with_one_changeset(http_request): transport = mock.MagicMock(spec=HttpTransport) @@ -284,18 +293,18 @@ def test_multipart_send_with_one_changeset(): }) requests = [ - HttpRequest("DELETE", "/container0/blob0"), - HttpRequest("DELETE", "/container1/blob1") + http_request("DELETE", "/container0/blob0"), + http_request("DELETE", "/container1/blob1") ] - changeset = HttpRequest("", "") + changeset = http_request("", "") changeset.set_multipart_mixed( *requests, policies=[header_policy], boundary="changeset_357de4f7-6d0b-4e02-8cd2-6361411a9525" ) - request = HttpRequest("POST", "http://account.blob.core.windows.net/?comp=batch") + request = http_request("POST", "http://account.blob.core.windows.net/?comp=batch") request.set_multipart_mixed( changeset, boundary="batch_357de4f7-6d0b-4e02-8cd2-6361411a9525", @@ -333,7 +342,8 @@ def test_multipart_send_with_one_changeset(): @pytest.mark.skipif(sys.version_info < (3, 0), reason="Multipart serialization not supported on 2.7") -def test_multipart_send_with_multiple_changesets(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_multipart_send_with_multiple_changesets(http_request): transport = mock.MagicMock(spec=HttpTransport) @@ -341,22 +351,22 @@ def test_multipart_send_with_multiple_changesets(): 'x-ms-date': 'Thu, 14 Jun 2018 16:46:54 GMT' }) - changeset1 = HttpRequest("", "") + changeset1 = http_request("", "") changeset1.set_multipart_mixed( - HttpRequest("DELETE", "/container0/blob0"), - HttpRequest("DELETE", "/container1/blob1"), + http_request("DELETE", "/container0/blob0"), + http_request("DELETE", "/container1/blob1"), policies=[header_policy], boundary="changeset_357de4f7-6d0b-4e02-8cd2-6361411a9525" ) - changeset2 = HttpRequest("", "") + changeset2 = http_request("", "") changeset2.set_multipart_mixed( - HttpRequest("DELETE", "/container2/blob2"), - HttpRequest("DELETE", "/container3/blob3"), + http_request("DELETE", "/container2/blob2"), + http_request("DELETE", "/container3/blob3"), policies=[header_policy], boundary="changeset_8b9e487e-a353-4dcb-a6f4-0688191e0314" ) - request = HttpRequest("POST", "http://account.blob.core.windows.net/?comp=batch") + request = http_request("POST", "http://account.blob.core.windows.net/?comp=batch") request.set_multipart_mixed( changeset1, changeset2, @@ -419,7 +429,8 @@ def test_multipart_send_with_multiple_changesets(): @pytest.mark.skipif(sys.version_info < (3, 0), reason="Multipart serialization not supported on 2.7") -def test_multipart_send_with_combination_changeset_first(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_multipart_send_with_combination_changeset_first(http_request): transport = mock.MagicMock(spec=HttpTransport) @@ -427,17 +438,17 @@ def test_multipart_send_with_combination_changeset_first(): 'x-ms-date': 'Thu, 14 Jun 2018 16:46:54 GMT' }) - changeset = HttpRequest("", "") + changeset = http_request("", "") changeset.set_multipart_mixed( - HttpRequest("DELETE", "/container0/blob0"), - HttpRequest("DELETE", "/container1/blob1"), + http_request("DELETE", "/container0/blob0"), + http_request("DELETE", "/container1/blob1"), policies=[header_policy], boundary="changeset_357de4f7-6d0b-4e02-8cd2-6361411a9525" ) - request = HttpRequest("POST", "http://account.blob.core.windows.net/?comp=batch") + request = http_request("POST", "http://account.blob.core.windows.net/?comp=batch") request.set_multipart_mixed( changeset, - HttpRequest("DELETE", "/container2/blob2"), + http_request("DELETE", "/container2/blob2"), policies=[header_policy], boundary="batch_357de4f7-6d0b-4e02-8cd2-6361411a9525" ) @@ -482,7 +493,8 @@ def test_multipart_send_with_combination_changeset_first(): ) @pytest.mark.skipif(sys.version_info < (3, 0), reason="Multipart serialization not supported on 2.7") -def test_multipart_send_with_combination_changeset_last(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_multipart_send_with_combination_changeset_last(http_request): transport = mock.MagicMock(spec=HttpTransport) @@ -490,16 +502,16 @@ def test_multipart_send_with_combination_changeset_last(): 'x-ms-date': 'Thu, 14 Jun 2018 16:46:54 GMT' }) - changeset = HttpRequest("", "") + changeset = http_request("", "") changeset.set_multipart_mixed( - HttpRequest("DELETE", "/container1/blob1"), - HttpRequest("DELETE", "/container2/blob2"), + http_request("DELETE", "/container1/blob1"), + http_request("DELETE", "/container2/blob2"), policies=[header_policy], boundary="changeset_357de4f7-6d0b-4e02-8cd2-6361411a9525" ) - request = HttpRequest("POST", "http://account.blob.core.windows.net/?comp=batch") + request = http_request("POST", "http://account.blob.core.windows.net/?comp=batch") request.set_multipart_mixed( - HttpRequest("DELETE", "/container0/blob0"), + http_request("DELETE", "/container0/blob0"), changeset, policies=[header_policy], boundary="batch_357de4f7-6d0b-4e02-8cd2-6361411a9525" @@ -545,7 +557,8 @@ def test_multipart_send_with_combination_changeset_last(): ) @pytest.mark.skipif(sys.version_info < (3, 0), reason="Multipart serialization not supported on 2.7") -def test_multipart_send_with_combination_changeset_middle(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_multipart_send_with_combination_changeset_middle(http_request): transport = mock.MagicMock(spec=HttpTransport) @@ -553,17 +566,17 @@ def test_multipart_send_with_combination_changeset_middle(): 'x-ms-date': 'Thu, 14 Jun 2018 16:46:54 GMT' }) - changeset = HttpRequest("", "") + changeset = http_request("", "") changeset.set_multipart_mixed( - HttpRequest("DELETE", "/container1/blob1"), + http_request("DELETE", "/container1/blob1"), policies=[header_policy], boundary="changeset_357de4f7-6d0b-4e02-8cd2-6361411a9525" ) - request = HttpRequest("POST", "http://account.blob.core.windows.net/?comp=batch") + request = http_request("POST", "http://account.blob.core.windows.net/?comp=batch") request.set_multipart_mixed( - HttpRequest("DELETE", "/container0/blob0"), + http_request("DELETE", "/container0/blob0"), changeset, - HttpRequest("DELETE", "/container2/blob2"), + http_request("DELETE", "/container2/blob2"), policies=[header_policy], boundary="batch_357de4f7-6d0b-4e02-8cd2-6361411a9525" ) @@ -608,17 +621,18 @@ def test_multipart_send_with_combination_changeset_middle(): ) -def test_multipart_receive(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_multipart_receive(http_request): class ResponsePolicy(object): def on_response(self, request, response): # type: (PipelineRequest, PipelineResponse) -> None response.http_response.headers['x-ms-fun'] = 'true' - req0 = HttpRequest("DELETE", "/container0/blob0") - req1 = HttpRequest("DELETE", "/container1/blob1") + req0 = http_request("DELETE", "/container0/blob0") + req1 = http_request("DELETE", "/container1/blob1") - request = HttpRequest("POST", "http://account.blob.core.windows.net/?comp=batch") + request = http_request("POST", "http://account.blob.core.windows.net/?comp=batch") request.set_multipart_mixed( req0, req1, @@ -670,27 +684,30 @@ def on_response(self, request, response): assert res1.status_code == 404 assert res1.headers['x-ms-fun'] == 'true' -def test_raise_for_status_bad_response(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_raise_for_status_bad_response(http_request): response = MockResponse(request=None, body=None, content_type=None) response.status_code = 400 with pytest.raises(HttpResponseError): response.raise_for_status() -def test_raise_for_status_good_response(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_raise_for_status_good_response(http_request): response = MockResponse(request=None, body=None, content_type=None) response.status_code = 200 response.raise_for_status() -def test_multipart_receive_with_one_changeset(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_multipart_receive_with_one_changeset(http_request): - changeset = HttpRequest(None, None) + changeset = http_request(None, None) changeset.set_multipart_mixed( - HttpRequest("DELETE", "/container0/blob0"), - HttpRequest("DELETE", "/container1/blob1") + http_request("DELETE", "/container0/blob0"), + http_request("DELETE", "/container1/blob1") ) - request = HttpRequest("POST", "http://account.blob.core.windows.net/?comp=batch") + request = http_request("POST", "http://account.blob.core.windows.net/?comp=batch") request.set_multipart_mixed(changeset) body_as_bytes = ( @@ -737,20 +754,21 @@ def test_multipart_receive_with_one_changeset(): assert res0.status_code == 202 -def test_multipart_receive_with_multiple_changesets(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_multipart_receive_with_multiple_changesets(http_request): - changeset1 = HttpRequest(None, None) + changeset1 = http_request(None, None) changeset1.set_multipart_mixed( - HttpRequest("DELETE", "/container0/blob0"), - HttpRequest("DELETE", "/container1/blob1") + http_request("DELETE", "/container0/blob0"), + http_request("DELETE", "/container1/blob1") ) - changeset2 = HttpRequest(None, None) + changeset2 = http_request(None, None) changeset2.set_multipart_mixed( - HttpRequest("DELETE", "/container2/blob2"), - HttpRequest("DELETE", "/container3/blob3") + http_request("DELETE", "/container2/blob2"), + http_request("DELETE", "/container3/blob3") ) - request = HttpRequest("POST", "http://account.blob.core.windows.net/?comp=batch") + request = http_request("POST", "http://account.blob.core.windows.net/?comp=batch") request.set_multipart_mixed(changeset1, changeset2) body_as_bytes = ( b'--batchresponse_66925647-d0cb-4109-b6d3-28efe3e1e5ed\r\n' @@ -822,16 +840,17 @@ def test_multipart_receive_with_multiple_changesets(): assert parts[3].status_code == 409 -def test_multipart_receive_with_combination_changeset_first(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_multipart_receive_with_combination_changeset_first(http_request): - changeset = HttpRequest(None, None) + changeset = http_request(None, None) changeset.set_multipart_mixed( - HttpRequest("DELETE", "/container0/blob0"), - HttpRequest("DELETE", "/container1/blob1") + http_request("DELETE", "/container0/blob0"), + http_request("DELETE", "/container1/blob1") ) - request = HttpRequest("POST", "http://account.blob.core.windows.net/?comp=batch") - request.set_multipart_mixed(changeset, HttpRequest("DELETE", "/container2/blob2")) + request = http_request("POST", "http://account.blob.core.windows.net/?comp=batch") + request.set_multipart_mixed(changeset, http_request("DELETE", "/container2/blob2")) body_as_bytes = ( b'--batchresponse_66925647-d0cb-4109-b6d3-28efe3e1e5ed\r\n' b'Content-Type: multipart/mixed; boundary="changeset_357de4f7-6d0b-4e02-8cd2-6361411a9525"\r\n' @@ -886,16 +905,17 @@ def test_multipart_receive_with_combination_changeset_first(): assert parts[2].status_code == 404 -def test_multipart_receive_with_combination_changeset_middle(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_multipart_receive_with_combination_changeset_middle(http_request): - changeset = HttpRequest(None, None) - changeset.set_multipart_mixed(HttpRequest("DELETE", "/container1/blob1")) + changeset = http_request(None, None) + changeset.set_multipart_mixed(http_request("DELETE", "/container1/blob1")) - request = HttpRequest("POST", "http://account.blob.core.windows.net/?comp=batch") + request = http_request("POST", "http://account.blob.core.windows.net/?comp=batch") request.set_multipart_mixed( - HttpRequest("DELETE", "/container0/blob0"), + http_request("DELETE", "/container0/blob0"), changeset, - HttpRequest("DELETE", "/container2/blob2") + http_request("DELETE", "/container2/blob2") ) body_as_bytes = ( b'--batchresponse_66925647-d0cb-4109-b6d3-28efe3e1e5ed\r\n' @@ -951,16 +971,17 @@ def test_multipart_receive_with_combination_changeset_middle(): assert parts[2].status_code == 404 -def test_multipart_receive_with_combination_changeset_last(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_multipart_receive_with_combination_changeset_last(http_request): - changeset = HttpRequest(None, None) + changeset = http_request(None, None) changeset.set_multipart_mixed( - HttpRequest("DELETE", "/container1/blob1"), - HttpRequest("DELETE", "/container2/blob2") + http_request("DELETE", "/container1/blob1"), + http_request("DELETE", "/container2/blob2") ) - request = HttpRequest("POST", "http://account.blob.core.windows.net/?comp=batch") - request.set_multipart_mixed(HttpRequest("DELETE", "/container0/blob0"), changeset) + request = http_request("POST", "http://account.blob.core.windows.net/?comp=batch") + request.set_multipart_mixed(http_request("DELETE", "/container0/blob0"), changeset) body_as_bytes = ( b'--batchresponse_66925647-d0cb-4109-b6d3-28efe3e1e5ed\r\n' @@ -1016,11 +1037,12 @@ def test_multipart_receive_with_combination_changeset_last(): assert parts[2].status_code == 404 -def test_multipart_receive_with_bom(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_multipart_receive_with_bom(http_request): - req0 = HttpRequest("DELETE", "/container0/blob0") + req0 = http_request("DELETE", "/container0/blob0") - request = HttpRequest("POST", "http://account.blob.core.windows.net/?comp=batch") + request = http_request("POST", "http://account.blob.core.windows.net/?comp=batch") request.set_multipart_mixed(req0) body_as_bytes = ( b"--batchresponse_66925647-d0cb-4109-b6d3-28efe3e1e5ed\n" @@ -1052,12 +1074,13 @@ def test_multipart_receive_with_bom(): assert res0.body().startswith(b'\xef\xbb\xbf') -def test_recursive_multipart_receive(): - req0 = HttpRequest("DELETE", "/container0/blob0") - internal_req0 = HttpRequest("DELETE", "/container0/blob0") +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_recursive_multipart_receive(http_request): + req0 = http_request("DELETE", "/container0/blob0") + internal_req0 = http_request("DELETE", "/container0/blob0") req0.set_multipart_mixed(internal_req0) - request = HttpRequest("POST", "http://account.blob.core.windows.net/?comp=batch") + request = http_request("POST", "http://account.blob.core.windows.net/?comp=batch") request.set_multipart_mixed(req0) internal_body_as_str = ( "--batchresponse_66925647-d0cb-4109-b6d3-28efe3e1e5ed\r\n" @@ -1107,10 +1130,11 @@ def test_close_unopened_transport(): transport.close() -def test_timeout(caplog, port): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_timeout(caplog, port, http_request): transport = RequestsTransport() - request = HttpRequest("GET", "http://localhost:{}/basic/string".format(port)) + request = http_request("GET", "http://localhost:{}/basic/string".format(port)) with caplog.at_level(logging.WARNING, logger="azure.core.pipeline.transport"): with Pipeline(transport) as pipeline: @@ -1119,10 +1143,11 @@ def test_timeout(caplog, port): assert "Tuple timeout setting is deprecated" not in caplog.text -def test_tuple_timeout(caplog, port): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_tuple_timeout(caplog, port, http_request): transport = RequestsTransport() - request = HttpRequest("GET", "http://localhost:{}/basic/string".format(port)) + request = http_request("GET", "http://localhost:{}/basic/string".format(port)) with caplog.at_level(logging.WARNING, logger="azure.core.pipeline.transport"): with Pipeline(transport) as pipeline: @@ -1131,10 +1156,11 @@ def test_tuple_timeout(caplog, port): assert "Tuple timeout setting is deprecated" in caplog.text -def test_conflict_timeout(caplog, port): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_conflict_timeout(caplog, port, http_request): transport = RequestsTransport() - request = HttpRequest("GET", "http://localhost:{}/basic/string".format(port)) + request = http_request("GET", "http://localhost:{}/basic/string".format(port)) with pytest.raises(ValueError): with Pipeline(transport) as pipeline: diff --git a/sdk/core/azure-core/tests/test_custom_hook_policy.py b/sdk/core/azure-core/tests/test_custom_hook_policy.py index e553ca5a9811..8ff38e0c203f 100644 --- a/sdk/core/azure-core/tests/test_custom_hook_policy.py +++ b/sdk/core/azure-core/tests/test_custom_hook_policy.py @@ -11,8 +11,10 @@ from azure.core.pipeline.policies import CustomHookPolicy, UserAgentPolicy from azure.core.pipeline.transport import HttpTransport import pytest +from utils import HTTP_REQUESTS -def test_response_hook_policy_in_init(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_response_hook_policy_in_init(http_request): def test_callback(response): raise ValueError() @@ -24,11 +26,12 @@ def test_callback(response): custom_hook_policy ] client = PipelineClient(base_url=url, policies=policies, transport=transport) - request = client.get(url) + request = http_request("GET", url) with pytest.raises(ValueError): client._pipeline.run(request) -def test_response_hook_policy_in_request(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_response_hook_policy_in_request(http_request): def test_callback(response): raise ValueError() @@ -40,11 +43,12 @@ def test_callback(response): custom_hook_policy ] client = PipelineClient(base_url=url, policies=policies, transport=transport) - request = client.get(url) + request = http_request("GET", url) with pytest.raises(ValueError): client._pipeline.run(request, raw_response_hook=test_callback) -def test_response_hook_policy_in_both(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_response_hook_policy_in_both(http_request): def test_callback(response): raise ValueError() @@ -59,11 +63,12 @@ def test_callback_request(response): custom_hook_policy ] client = PipelineClient(base_url=url, policies=policies, transport=transport) - request = client.get(url) + request = http_request("GET", url) with pytest.raises(TypeError): client._pipeline.run(request, raw_response_hook=test_callback_request) -def test_request_hook_policy_in_init(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_request_hook_policy_in_init(http_request): def test_callback(response): raise ValueError() @@ -75,11 +80,12 @@ def test_callback(response): custom_hook_policy ] client = PipelineClient(base_url=url, policies=policies, transport=transport) - request = client.get(url) + request = http_request("GET", url) with pytest.raises(ValueError): client._pipeline.run(request) -def test_request_hook_policy_in_request(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_request_hook_policy_in_request(http_request): def test_callback(response): raise ValueError() @@ -91,11 +97,12 @@ def test_callback(response): custom_hook_policy ] client = PipelineClient(base_url=url, policies=policies, transport=transport) - request = client.get(url) + request = http_request("GET", url) with pytest.raises(ValueError): client._pipeline.run(request, raw_request_hook=test_callback) -def test_request_hook_policy_in_both(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_request_hook_policy_in_both(http_request): def test_callback(response): raise ValueError() @@ -110,6 +117,6 @@ def test_callback_request(response): custom_hook_policy ] client = PipelineClient(base_url=url, policies=policies, transport=transport) - request = client.get(url) + request = http_request("GET", url) with pytest.raises(TypeError): client._pipeline.run(request, raw_request_hook=test_callback_request) diff --git a/sdk/core/azure-core/tests/test_error_map.py b/sdk/core/azure-core/tests/test_error_map.py index 6fa355b490ab..f3f4e4c848ae 100644 --- a/sdk/core/azure-core/tests/test_error_map.py +++ b/sdk/core/azure-core/tests/test_error_map.py @@ -31,12 +31,13 @@ ErrorMap, ) from azure.core.pipeline.transport import ( - HttpRequest, HttpResponse, ) +from utils import HTTP_REQUESTS -def test_error_map(): - request = HttpRequest("GET", "") +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_error_map(http_request): + request = http_request("GET", "") response = HttpResponse(request, None) error_map = { 404: ResourceNotFoundError @@ -44,8 +45,9 @@ def test_error_map(): with pytest.raises(ResourceNotFoundError): map_error(404, response, error_map) -def test_error_map_no_default(): - request = HttpRequest("GET", "") +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_error_map_no_default(http_request): + request = http_request("GET", "") response = HttpResponse(request, None) error_map = ErrorMap({ 404: ResourceNotFoundError @@ -53,8 +55,9 @@ def test_error_map_no_default(): with pytest.raises(ResourceNotFoundError): map_error(404, response, error_map) -def test_error_map_with_default(): - request = HttpRequest("GET", "") +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_error_map_with_default(http_request): + request = http_request("GET", "") response = HttpResponse(request, None) error_map = ErrorMap({ 404: ResourceNotFoundError @@ -62,8 +65,9 @@ def test_error_map_with_default(): with pytest.raises(ResourceExistsError): map_error(401, response, error_map) -def test_only_default(): - request = HttpRequest("GET", "") +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_only_default(http_request): + request = http_request("GET", "") response = HttpResponse(request, None) error_map = ErrorMap(default_error=ResourceExistsError) with pytest.raises(ResourceExistsError): diff --git a/sdk/core/azure-core/tests/test_http_logging_policy.py b/sdk/core/azure-core/tests/test_http_logging_policy.py index c69b8b5f0e7c..a745946d4c3e 100644 --- a/sdk/core/azure-core/tests/test_http_logging_policy.py +++ b/sdk/core/azure-core/tests/test_http_logging_policy.py @@ -3,7 +3,7 @@ # Licensed under the MIT License. # ------------------------------------ """Tests for the HttpLoggingPolicy.""" - +import pytest import logging import types try: @@ -16,15 +16,16 @@ PipelineContext ) from azure.core.pipeline.transport import ( - HttpRequest, HttpResponse, ) from azure.core.pipeline.policies import ( HttpLoggingPolicy, ) +from utils import HTTP_REQUESTS -def test_http_logger(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_http_logger(http_request): class MockHandler(logging.Handler): def __init__(self): @@ -42,7 +43,7 @@ def emit(self, record): policy = HttpLoggingPolicy(logger=logger) - universal_request = HttpRequest('GET', 'http://localhost/') + universal_request = http_request('GET', 'http://localhost/') http_response = HttpResponse(universal_request, None) http_response.status_code = 202 request = PipelineRequest(universal_request, PipelineContext(None)) @@ -138,7 +139,8 @@ def emit(self, record): -def test_http_logger_operation_level(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_http_logger_operation_level(http_request): class MockHandler(logging.Handler): def __init__(self): @@ -157,7 +159,7 @@ def emit(self, record): policy = HttpLoggingPolicy() kwargs={'logger': logger} - universal_request = HttpRequest('GET', 'http://localhost/') + universal_request = http_request('GET', 'http://localhost/') http_response = HttpResponse(universal_request, None) http_response.status_code = 202 request = PipelineRequest(universal_request, PipelineContext(None, **kwargs)) @@ -209,7 +211,8 @@ def emit(self, record): mock_handler.reset() -def test_http_logger_with_body(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_http_logger_with_body(http_request): class MockHandler(logging.Handler): def __init__(self): @@ -227,7 +230,7 @@ def emit(self, record): policy = HttpLoggingPolicy(logger=logger) - universal_request = HttpRequest('GET', 'http://localhost/') + universal_request = http_request('GET', 'http://localhost/') universal_request.body = "testbody" http_response = HttpResponse(universal_request, None) http_response.status_code = 202 @@ -249,7 +252,8 @@ def emit(self, record): mock_handler.reset() -def test_http_logger_with_generator_body(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_http_logger_with_generator_body(http_request): class MockHandler(logging.Handler): def __init__(self): @@ -267,7 +271,7 @@ def emit(self, record): policy = HttpLoggingPolicy(logger=logger) - universal_request = HttpRequest('GET', 'http://localhost/') + universal_request = http_request('GET', 'http://localhost/') mock = Mock() mock.__class__ = types.GeneratorType universal_request.body = mock diff --git a/sdk/core/azure-core/tests/test_pipeline.py b/sdk/core/azure-core/tests/test_pipeline.py index 6d260c07e9fe..fb5a063e4f7b 100644 --- a/sdk/core/azure-core/tests/test_pipeline.py +++ b/sdk/core/azure-core/tests/test_pipeline.py @@ -50,21 +50,23 @@ ) from azure.core.pipeline.transport._base import PipelineClientBase from azure.core.pipeline.transport import ( - HttpRequest, HttpTransport, RequestsTransport, ) +from utils import HTTP_REQUESTS, is_rest from azure.core.exceptions import AzureError -def test_default_http_logging_policy(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_default_http_logging_policy(http_request): config = Configuration() pipeline_client = PipelineClient(base_url="test") pipeline = pipeline_client._build_pipeline(config) http_logging_policy = pipeline._impl_policies[-1]._policy assert http_logging_policy.allowed_header_names == HttpLoggingPolicy.DEFAULT_HEADERS_WHITELIST -def test_pass_in_http_logging_policy(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_pass_in_http_logging_policy(http_request): config = Configuration() http_logging_policy = HttpLoggingPolicy() http_logging_policy.allowed_header_names.update( @@ -78,7 +80,8 @@ def test_pass_in_http_logging_policy(): assert http_logging_policy.allowed_header_names == HttpLoggingPolicy.DEFAULT_HEADERS_WHITELIST.union({"x-ms-added-header"}) -def test_sans_io_exception(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_sans_io_exception(http_request): class BrokenSender(HttpTransport): def send(self, request, **config): raise ValueError("Broken") @@ -95,7 +98,7 @@ def __exit__(self, exc_type, exc_value, traceback): pipeline = Pipeline(BrokenSender(), [SansIOHTTPPolicy()]) - req = HttpRequest("GET", "/") + req = http_request("GET", "/") with pytest.raises(ValueError): pipeline.run(req) @@ -108,9 +111,10 @@ def on_exception(self, requests, **kwargs): with pytest.raises(NotImplementedError): pipeline.run(req) -def test_requests_socket_timeout(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_requests_socket_timeout(http_request): conf = Configuration() - request = HttpRequest("GET", "https://bing.com") + request = http_request("GET", "https://bing.com") policies = [ UserAgentPolicy("myusergant"), RedirectPolicy() @@ -179,26 +183,29 @@ def test_format_incorrect_endpoint(): client.format_url("foo/bar") assert str(exp.value) == "The value provided for the url part Endpoint was incorrect, and resulted in an invalid url" -def test_request_json(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_request_json(http_request): - request = HttpRequest("GET", "/") + request = http_request("GET", "/") data = "Lots of dataaaa" request.set_json_body(data) assert request.data == json.dumps(data) assert request.headers.get("Content-Length") == "17" -def test_request_data(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_request_data(http_request): - request = HttpRequest("GET", "/") + request = http_request("GET", "/") data = "Lots of dataaaa" request.set_bytes_body(data) assert request.data == data assert request.headers.get("Content-Length") == "15" -def test_request_stream(): - request = HttpRequest("GET", "/") +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_request_stream(http_request): + request = http_request("GET", "/") data = b"Lots of dataaaa" request.set_streamed_data_body(data) @@ -216,45 +223,51 @@ def data_gen(): assert request.data == data -def test_request_xml(): - request = HttpRequest("GET", "/") +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_request_xml(http_request): + request = http_request("GET", "/") data = ET.Element("root") request.set_xml_body(data) assert request.data == b"\n" -def test_request_url_with_params(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_request_url_with_params(http_request): - request = HttpRequest("GET", "/") + request = http_request("GET", "/") request.url = "a/b/c?t=y" request.format_parameters({"g": "h"}) assert request.url in ["a/b/c?g=h&t=y", "a/b/c?t=y&g=h"] -def test_request_url_with_params_as_list(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_request_url_with_params_as_list(http_request): - request = HttpRequest("GET", "/") + request = http_request("GET", "/") request.url = "a/b/c?t=y" request.format_parameters({"g": ["h","i"]}) assert request.url in ["a/b/c?g=h&g=i&t=y", "a/b/c?t=y&g=h&g=i"] -def test_request_url_with_params_with_none_in_list(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_request_url_with_params_with_none_in_list(http_request): - request = HttpRequest("GET", "/") + request = http_request("GET", "/") request.url = "a/b/c?t=y" with pytest.raises(ValueError): request.format_parameters({"g": ["h",None]}) -def test_request_url_with_params_with_none(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_request_url_with_params_with_none(http_request): - request = HttpRequest("GET", "/") + request = http_request("GET", "/") request.url = "a/b/c?t=y" with pytest.raises(ValueError): request.format_parameters({"g": None}) -def test_repr(): - request = HttpRequest("GET", "hello.com") +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_repr(http_request): + request = http_request("GET", "hello.com") assert repr(request) == "" def test_add_custom_policy(): @@ -355,10 +368,11 @@ def send(*args): with pytest.raises(ValueError): client = PipelineClient(base_url="test", policies=policies, per_retry_policies=[foo_policy]) -def test_basic_requests(port): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_basic_requests(port, http_request): conf = Configuration() - request = HttpRequest("GET", "http://localhost:{}/basic/string".format(port)) + request = http_request("GET", "http://localhost:{}/basic/string".format(port)) policies = [ UserAgentPolicy("myusergant"), RedirectPolicy() @@ -369,9 +383,10 @@ def test_basic_requests(port): assert pipeline._transport.session is None assert isinstance(response.http_response.status_code, int) -def test_basic_options_requests(port): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_basic_options_requests(port, http_request): - request = HttpRequest("OPTIONS", "http://localhost:{}/basic/string".format(port)) + request = http_request("OPTIONS", "http://localhost:{}/basic/string".format(port)) policies = [ UserAgentPolicy("myusergant"), RedirectPolicy() @@ -382,10 +397,11 @@ def test_basic_options_requests(port): assert pipeline._transport.session is None assert isinstance(response.http_response.status_code, int) -def test_basic_requests_separate_session(port): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_basic_requests_separate_session(port, http_request): session = requests.Session() - request = HttpRequest("GET", "http://localhost:{}/basic/string".format(port)) + request = http_request("GET", "http://localhost:{}/basic/string".format(port)) policies = [ UserAgentPolicy("myusergant"), RedirectPolicy() @@ -400,21 +416,28 @@ def test_basic_requests_separate_session(port): assert transport.session transport.session.close() -def test_request_text(port): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_request_text(port, http_request): client = PipelineClientBase("http://localhost:{}".format(port)) - request = client.get( - "/", - content="foo" - ) + if is_rest(http_request): + request = http_request("GET", "/", json="foo") + else: + request = client.get( + "/", + content="foo" + ) # In absence of information, everything is JSON (double quote added) assert request.data == json.dumps("foo") - request = client.post( - "/", - headers={'content-type': 'text/whatever'}, - content="foo" - ) + if is_rest(http_request): + request = http_request("POST", "/", headers={'content-type': 'text/whatever'}, content="foo") + else: + request = client.post( + "/", + headers={'content-type': 'text/whatever'}, + content="foo" + ) # We want a direct string assert request.data == "foo" diff --git a/sdk/core/azure-core/tests/test_request_id_policy.py b/sdk/core/azure-core/tests/test_request_id_policy.py index 7da467b467c2..44c8647982cb 100644 --- a/sdk/core/azure-core/tests/test_request_id_policy.py +++ b/sdk/core/azure-core/tests/test_request_id_policy.py @@ -4,7 +4,6 @@ # ------------------------------------ """Tests for the request id policy.""" from azure.core.pipeline.policies import RequestIdPolicy -from azure.core.pipeline.transport import HttpRequest from azure.core.pipeline import PipelineRequest, PipelineContext try: from unittest import mock @@ -12,15 +11,16 @@ import mock from itertools import product import pytest +from utils import HTTP_REQUESTS auto_request_id_values = (True, False, None) request_id_init_values = ("foo", None, "_unset") request_id_set_values = ("bar", None, "_unset") request_id_req_values = ("baz", None, "_unset") -full_combination = list(product(auto_request_id_values, request_id_init_values, request_id_set_values, request_id_req_values)) +full_combination = list(product(auto_request_id_values, request_id_init_values, request_id_set_values, request_id_req_values, HTTP_REQUESTS)) -@pytest.mark.parametrize("auto_request_id, request_id_init, request_id_set, request_id_req", full_combination) -def test_request_id_policy(auto_request_id, request_id_init, request_id_set, request_id_req): +@pytest.mark.parametrize("auto_request_id, request_id_init, request_id_set, request_id_req, http_request", full_combination) +def test_request_id_policy(auto_request_id, request_id_init, request_id_set, request_id_req, http_request): """Test policy with no other policy and happy path""" kwargs = {} if auto_request_id is not None: @@ -30,7 +30,7 @@ def test_request_id_policy(auto_request_id, request_id_init, request_id_set, req request_id_policy = RequestIdPolicy(**kwargs) if request_id_set != "_unset": request_id_policy.set_request_id(request_id_set) - request = HttpRequest('GET', 'http://localhost/') + request = http_request('GET', 'http://localhost/') pipeline_request = PipelineRequest(request, PipelineContext(None)) if request_id_req != "_unset": pipeline_request.context.options['request_id'] = request_id_req @@ -55,10 +55,11 @@ def test_request_id_policy(auto_request_id, request_id_init, request_id_set, req else: assert not "x-ms-client-request-id" in request.headers -def test_request_id_already_exists(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_request_id_already_exists(http_request): """Test policy with no other policy and happy path""" request_id_policy = RequestIdPolicy() - request = HttpRequest('GET', 'http://localhost/') + request = http_request('GET', 'http://localhost/') request.headers["x-ms-client-request-id"] = "VALUE" pipeline_request = PipelineRequest(request, PipelineContext(None)) request_id_policy.on_request(pipeline_request) diff --git a/sdk/core/azure-core/tests/test_requests_universal.py b/sdk/core/azure-core/tests/test_requests_universal.py index b965d4fd3d69..891a364cfd61 100644 --- a/sdk/core/azure-core/tests/test_requests_universal.py +++ b/sdk/core/azure-core/tests/test_requests_universal.py @@ -25,8 +25,9 @@ # -------------------------------------------------------------------------- import concurrent.futures import requests.utils - -from azure.core.pipeline.transport import HttpRequest, RequestsTransport, RequestsTransportResponse +import pytest +from azure.core.pipeline.transport import RequestsTransport, RequestsTransportResponse +from utils import HTTP_REQUESTS def test_threading_basic_requests(): @@ -44,8 +45,9 @@ def thread_body(local_sender): future = executor.submit(thread_body, sender) assert future.result() -def test_requests_auto_headers(port): - request = HttpRequest("POST", "http://localhost:{}/basic/string".format(port)) +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_requests_auto_headers(port, http_request): + request = http_request("POST", "http://localhost:{}/basic/string".format(port)) with RequestsTransport() as sender: response = sender.send(request) auto_headers = response.internal_response.request.headers diff --git a/sdk/core/azure-core/tests/test_rest_backcompat.py b/sdk/core/azure-core/tests/test_rest_backcompat.py new file mode 100644 index 000000000000..56998caec3e5 --- /dev/null +++ b/sdk/core/azure-core/tests/test_rest_backcompat.py @@ -0,0 +1,403 @@ +# -*- coding: utf-8 -*- +# ------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See LICENSE.txt in the project root for +# license information. +# ------------------------------------------------------------------------- +import sys +import pytest +import json +import xml.etree.ElementTree as ET +from azure.core.pipeline.transport import HttpRequest as PipelineTransportHttpRequest +from azure.core.rest import HttpRequest as RestHttpRequest +try: + import collections.abc as collections +except ImportError: + import collections + +@pytest.fixture +def old_request(): + return PipelineTransportHttpRequest("GET", "/") + +@pytest.fixture +def new_request(): + return RestHttpRequest("GET", "/") + +def test_request_attr_parity(old_request, new_request): + for attr in dir(old_request): + if not attr[0] == "_": + # if not a private attr, we want parity + assert hasattr(new_request, attr) + +def test_request_set_attrs(old_request, new_request): + for attr in dir(old_request): + if attr[0] == "_": + continue + try: + # if we can set it on the old request, we want to + # be able to set it on the new + setattr(old_request, attr, "foo") + except: + pass + else: + setattr(new_request, attr, "foo") + assert getattr(old_request, attr) == getattr(new_request, attr) == "foo" + +def test_request_multipart_mixed_info(old_request, new_request): + old_request.multipart_mixed_info = "foo" + new_request.multipart_mixed_info = "foo" + assert old_request.multipart_mixed_info == new_request.multipart_mixed_info == "foo" + +def test_request_files_attr(old_request, new_request): + assert old_request.files == new_request.files == None + old_request.files = {"hello": "world"} + new_request.files = {"hello": "world"} + assert old_request.files == new_request.files == {"hello": "world"} + +def test_request_data_attr(old_request, new_request): + assert old_request.data == new_request.data == None + old_request.data = {"hello": "world"} + new_request.data = {"hello": "world"} + assert old_request.data == new_request.data == {"hello": "world"} + +def test_request_query(old_request, new_request): + assert old_request.query == new_request.query == {} + old_request.url = "http://localhost:5000?a=b&c=d" + new_request.url = "http://localhost:5000?a=b&c=d" + assert old_request.query == new_request.query == {'a': 'b', 'c': 'd'} + +def test_request_query_and_params_kwarg(old_request): + # should be same behavior if we pass in query params through the params kwarg in the new requests + old_request.url = "http://localhost:5000?a=b&c=d" + new_request = RestHttpRequest("GET", "http://localhost:5000", params={'a': 'b', 'c': 'd'}) + assert old_request.query == new_request.query == {'a': 'b', 'c': 'd'} + +def test_request_body(old_request, new_request): + assert old_request.body == new_request.body == None + old_request.data = {"hello": "world"} + new_request.data = {"hello": "world"} + assert ( + old_request.body == + new_request.body == + new_request.content == + {"hello": "world"} + ) + # files will not override data + old_request.files = {"foo": "bar"} + new_request.files = {"foo": "bar"} + assert ( + old_request.body == + new_request.body == + new_request.content == + {"hello": "world"} + ) + + # nullify data + old_request.data = None + new_request.data = None + assert ( + old_request.data == + new_request.data == + old_request.body == + new_request.body == + None + ) + +def test_format_parameters(old_request, new_request): + old_request.url = "a/b/c?t=y" + new_request.url = "a/b/c?t=y" + assert old_request.url == new_request.url == "a/b/c?t=y" + old_request.format_parameters({"g": "h"}) + new_request.format_parameters({"g": "h"}) + + # ordering can vary, so not sticking on order + assert old_request.url in ["a/b/c?g=h&t=y", "a/b/c?t=y&g=h"] + assert new_request.url in ["a/b/c?g=h&t=y", "a/b/c?t=y&g=h"] + +def test_request_format_parameters_and_params_kwarg(old_request): + # calling format_parameters on an old request should be the same + # behavior as passing in params to new request + old_request.url = "a/b/c?t=y" + old_request.format_parameters({"g": "h"}) + new_request = RestHttpRequest( + "GET", "a/b/c?t=y", params={"g": "h"} + ) + assert old_request.url in ["a/b/c?g=h&t=y", "a/b/c?t=y&g=h"] + assert new_request.url in ["a/b/c?g=h&t=y", "a/b/c?t=y&g=h"] + + # additionally, calling format_parameters on a new request + # should be the same as passing the params to a new request + assert new_request.url in ["a/b/c?g=h&t=y", "a/b/c?t=y&g=h"] + assert new_request.url in ["a/b/c?g=h&t=y", "a/b/c?t=y&g=h"] + +def test_request_streamed_data_body(old_request, new_request): + assert old_request.files == new_request.files == None + assert old_request.data == new_request.data == None + old_request.files = new_request.files = "foo" + # passing in iterable + def streaming_body(data): + yield data # pragma: nocover + old_request.set_streamed_data_body(streaming_body("i will be streamed")) + new_request.set_streamed_data_body(streaming_body("i will be streamed")) + + assert old_request.files == new_request.files == None + assert isinstance(old_request.data, collections.Iterable) + assert isinstance(new_request.data, collections.Iterable) + assert isinstance(old_request.body, collections.Iterable) + assert isinstance(new_request.body, collections.Iterable) + assert isinstance(new_request.content, collections.Iterable) + assert old_request.headers == new_request.headers == {} + +def test_request_streamed_data_body_non_iterable(old_request, new_request): + # should fail before nullifying the files property + old_request.files = new_request.files = "foo" + # passing in non iterable + with pytest.raises(TypeError) as ex: + old_request.set_streamed_data_body(1) + assert "A streamable data source must be an open file-like object or iterable" in str(ex.value) + assert old_request.data is None + assert old_request.files == "foo" + + with pytest.raises(TypeError) as ex: + new_request.set_streamed_data_body(1) + assert "A streamable data source must be an open file-like object or iterable" in str(ex.value) + assert old_request.data is None + assert old_request.files == "foo" + assert old_request.headers == new_request.headers == {} + +def test_request_streamed_data_body_and_content_kwarg(old_request): + # passing stream bodies to set_streamed_data_body + # and passing a stream body to the content kwarg of the new request should be the same + def streaming_body(data): + yield data # pragma: nocover + old_request.set_streamed_data_body(streaming_body("stream")) + new_request = RestHttpRequest("GET", "/", content=streaming_body("stream")) + assert old_request.files == new_request.files == None + assert isinstance(old_request.data, collections.Iterable) + assert isinstance(new_request.data, collections.Iterable) + assert isinstance(old_request.body, collections.Iterable) + assert isinstance(new_request.body, collections.Iterable) + assert isinstance(new_request.content, collections.Iterable) + assert old_request.headers == new_request.headers == {} + +def test_request_text_body(old_request, new_request): + assert old_request.files == new_request.files == None + assert old_request.data == new_request.data == None + old_request.files = new_request.files = "foo" + old_request.set_text_body("i am text") + new_request.set_text_body("i am text") + + assert old_request.files == new_request.files == None + assert ( + old_request.data == + new_request.data == + old_request.body == + new_request.body == + new_request.content == + "i am text" + ) + assert old_request.headers['Content-Length'] == new_request.headers['Content-Length'] == '9' + assert not old_request.headers.get("Content-Type") + assert new_request.headers["Content-Type"] == "text/plain" + +def test_request_text_body_and_content_kwarg(old_request): + old_request.set_text_body("i am text") + new_request = RestHttpRequest("GET", "/", content="i am text") + assert ( + old_request.data == + new_request.data == + old_request.body == + new_request.body == + new_request.content == + "i am text" + ) + assert old_request.headers["Content-Length"] == new_request.headers["Content-Length"] == "9" + assert old_request.files == new_request.files == None + +def test_request_xml_body(old_request, new_request): + assert old_request.files == new_request.files == None + assert old_request.data == new_request.data == None + old_request.files = new_request.files = "foo" + xml_input = ET.Element("root") + old_request.set_xml_body(xml_input) + new_request.set_xml_body(xml_input) + + assert old_request.files == new_request.files == None + assert ( + old_request.data == + new_request.data == + old_request.body == + new_request.body == + new_request.content == + b"\n" + ) + assert old_request.headers == new_request.headers == {'Content-Length': '47'} + +def test_request_xml_body_and_content_kwarg(old_request): + old_request.set_text_body("i am text") + new_request = RestHttpRequest("GET", "/", content="i am text") + assert ( + old_request.data == + new_request.data == + old_request.body == + new_request.body == + new_request.content == + "i am text" + ) + assert old_request.headers["Content-Length"] == new_request.headers["Content-Length"] == "9" + assert old_request.files == new_request.files == None + +def test_request_json_body(old_request, new_request): + assert old_request.files == new_request.files == None + assert old_request.data == new_request.data == None + old_request.files = new_request.files = "foo" + json_input = {"hello": "world"} + old_request.set_json_body(json_input) + new_request.set_json_body(json_input) + + assert old_request.files == new_request.files == None + assert ( + old_request.data == + new_request.data == + old_request.body == + new_request.body == + new_request.content == + json.dumps(json_input) + ) + assert old_request.headers["Content-Length"] == new_request.headers['Content-Length'] == '18' + assert not old_request.headers.get("Content-Type") + assert new_request.headers["Content-Type"] == "application/json" + +def test_request_json_body_and_json_kwarg(old_request): + json_input = {"hello": "world"} + old_request.set_json_body(json_input) + new_request = RestHttpRequest("GET", "/", json=json_input) + assert ( + old_request.data == + new_request.data == + old_request.body == + new_request.body == + new_request.content == + json.dumps(json_input) + ) + assert old_request.headers["Content-Length"] == new_request.headers['Content-Length'] == '18' + assert not old_request.headers.get("Content-Type") + assert new_request.headers["Content-Type"] == "application/json" + assert old_request.files == new_request.files == None + +def test_request_formdata_body_files(old_request, new_request): + assert old_request.files == new_request.files == None + assert old_request.data == new_request.data == None + old_request.data = new_request.data = "foo" + old_request.files = new_request.files = "bar" + + # without the urlencoded content type, set_formdata_body + # will set it as files + old_request.set_formdata_body({"fileName": "hello.jpg"}) + new_request.set_formdata_body({"fileName": "hello.jpg"}) + + assert old_request.data == new_request.data == None + assert ( + old_request.files == + new_request.files == + new_request.content == + {'fileName': (None, 'hello.jpg')} + ) + + # we don't set any multipart headers with boundaries + # we rely on the transport to boundary calculating + assert old_request.headers == new_request.headers == {} + +def test_request_formdata_body_data(old_request, new_request): + assert old_request.files == new_request.files == None + assert old_request.data == new_request.data == None + old_request.data = new_request.data = "foo" + old_request.files = new_request.files = "bar" + + # with the urlencoded content type, set_formdata_body + # will set it as data + old_request.headers["Content-Type"] = "application/x-www-form-urlencoded" + new_request.headers["Content-Type"] = "application/x-www-form-urlencoded" + old_request.set_formdata_body({"fileName": "hello.jpg"}) + new_request.set_formdata_body({"fileName": "hello.jpg"}) + + assert old_request.files == new_request.files == None + assert ( + old_request.data == + new_request.data == + old_request.body == + new_request.body == + new_request.content == + {"fileName": "hello.jpg"} + ) + # old behavior would pop out the Content-Type header + # new behavior doesn't do that + assert old_request.headers == {} + assert new_request.headers == {'Content-Type': "application/x-www-form-urlencoded"} + +def test_request_formdata_body_and_files_kwarg(old_request): + files = {"fileName": "hello.jpg"} + old_request.set_formdata_body(files) + new_request = RestHttpRequest("GET", "/", files=files) + assert old_request.data == new_request.data == None + assert old_request.body == new_request.body == None + assert old_request.headers == new_request.headers == {} + assert old_request.files == new_request.files == {'fileName': (None, 'hello.jpg')} + +def test_request_formdata_body_and_data_kwarg(old_request): + data = {"fileName": "hello.jpg"} + # with the urlencoded content type, set_formdata_body + # will set it as data + old_request.headers["Content-Type"] = "application/x-www-form-urlencoded" + old_request.set_formdata_body(data) + new_request = RestHttpRequest("GET", "/", data=data) + assert ( + old_request.data == + new_request.data == + old_request.body == + new_request.body == + new_request.content == + {"fileName": "hello.jpg"} + ) + assert old_request.headers == {} + assert new_request.headers == {"Content-Type": "application/x-www-form-urlencoded"} + assert old_request.files == new_request.files == None + +def test_request_bytes_body(old_request, new_request): + assert old_request.files == new_request.files == None + assert old_request.data == new_request.data == None + old_request.files = new_request.files = "foo" + bytes_input = b"hello, world!" + old_request.set_bytes_body(bytes_input) + new_request.set_bytes_body(bytes_input) + + assert old_request.files == new_request.files == None + assert ( + old_request.data == + new_request.data == + old_request.body == + new_request.body == + new_request.content == + bytes_input + ) + assert old_request.headers == new_request.headers == {'Content-Length': '13'} + +def test_request_bytes_body_and_content_kwarg(old_request): + bytes_input = b"hello, world!" + old_request.set_bytes_body(bytes_input) + new_request = RestHttpRequest("GET", "/", content=bytes_input) + assert ( + old_request.data == + new_request.data == + old_request.body == + new_request.body == + new_request.content == + bytes_input + ) + if sys.version_info < (3, 0): + # in 2.7, b'' is a string, so we're setting content-type headers + assert old_request.headers["Content-Length"] == new_request.headers['Content-Length'] == '13' + assert new_request.headers["Content-Type"] == "text/plain" + else: + assert old_request.headers == new_request.headers == {'Content-Length': '13'} + assert old_request.files == new_request.files diff --git a/sdk/core/azure-core/tests/test_rest_http_request.py b/sdk/core/azure-core/tests/test_rest_http_request.py index 2c43f2b9b0bf..a773b99b61ba 100644 --- a/sdk/core/azure-core/tests/test_rest_http_request.py +++ b/sdk/core/azure-core/tests/test_rest_http_request.py @@ -11,7 +11,15 @@ import pytest import sys import collections + +from azure.core.configuration import Configuration from azure.core.rest import HttpRequest +from azure.core.pipeline.policies import ( + CustomHookPolicy, UserAgentPolicy, SansIOHTTPPolicy, RetryPolicy +) +from utils import is_rest +from rest_client import TestRestClient +from azure.core import PipelineClient @pytest.fixture def assert_iterator_body(): @@ -284,6 +292,113 @@ def test_use_custom_json_encoder(): request = HttpRequest("GET", "/headers", json=bytearray("mybytes", "utf-8")) assert request.content == '"bXlieXRlcw=="' +def test_request_policies_raw_request_hook(port): + # test that the request all the way through the pipeline is a new request + request = HttpRequest("GET", "/headers") + def callback(request): + assert is_rest(request.http_request) + raise ValueError("I entered the callback!") + custom_hook_policy = CustomHookPolicy(raw_request_hook=callback) + policies = [ + UserAgentPolicy("myuseragent"), + custom_hook_policy + ] + client = TestRestClient(port=port, policies=policies) + + with pytest.raises(ValueError) as ex: + client.send_request(request) + assert "I entered the callback!" in str(ex.value) + +@pytest.mark.skipif(sys.version_info < (3, 0), reason="Multipart serialization not supported on 2.7") +def test_request_policies_chain(port): + class OldPolicyModifyBody(SansIOHTTPPolicy): + def on_request(self, request): + assert is_rest(request.http_request) # first make sure this is a new request + # deals with request like an old request + request.http_request.set_json_body({"hello": "world"}) + + class NewPolicyModifyHeaders(SansIOHTTPPolicy): + def on_request(self, request): + assert is_rest(request.http_request) + assert request.http_request.content == '{"hello": "world"}' + + # modify header to know we entered this callback + request.http_request.headers = { + "x-ms-date": "Thu, 14 Jun 2018 16:46:54 GMT", + "Authorization": "SharedKey account:G4jjBXA7LI/RnWKIOQ8i9xH4p76pAQ+4Fs4R1VxasaE=", + "Content-Length": "0", + } + + class OldPolicySerializeRequest(SansIOHTTPPolicy): + def on_request(self, request): + assert is_rest(request.http_request) + # don't want to deal with content in serialize, so let's first just remove it + request.http_request.data = None + expected = ( + b'DELETE http://localhost:5000/container0/blob0 HTTP/1.1\r\n' + b'x-ms-date: Thu, 14 Jun 2018 16:46:54 GMT\r\n' + b'Authorization: SharedKey account:G4jjBXA7LI/RnWKIOQ8i9xH4p76pAQ+4Fs4R1VxasaE=\r\n' + b'Content-Length: 0\r\n' + b'\r\n' + ) + assert request.http_request.serialize() == expected + raise ValueError("Passed through the policies!") + + policies = [ + OldPolicyModifyBody(), + NewPolicyModifyHeaders(), + OldPolicySerializeRequest(), + ] + request = HttpRequest("DELETE", "/container0/blob0") + client = TestRestClient(port="5000", policies=policies) + with pytest.raises(ValueError) as ex: + client.send_request( + request, + content="I should be overriden", + ) + assert "Passed through the policies!" in str(ex.value) + + +def test_per_call_policies_old_then_new(port): + config = Configuration() + retry_policy = RetryPolicy() + config.retry_policy = retry_policy + + class OldPolicy(SansIOHTTPPolicy): + """A policy that deals with a rest request thinking that it's an old request""" + + def on_request(self, pipeline_request): + request = pipeline_request.http_request + assert is_rest(request) + assert request.body == '{"hello": "world"}' # old request has property body + request.set_text_body("change to me!") + return pipeline_request + + class NewPolicy(SansIOHTTPPolicy): + + def on_request(self, pipeline_request): + request = pipeline_request.http_request + assert is_rest(request) + assert request.content == 'change to me!' # new request has property content + raise ValueError("I entered the policies!") + + pipeline_client = PipelineClient( + base_url="http://localhost:{}".format(port), + config=config, + per_call_policies=[OldPolicy(), NewPolicy()] + ) + client = TestRestClient(port=port) + client._client = pipeline_client + + with pytest.raises(ValueError) as ex: + client.send_request(HttpRequest("POST", "/basic/anything", json={"hello": "world"})) + + # since we don't have all policies set up, the call ends up failing + # but that's ok with us, we want to make sure that chaining the requests + # work + assert "I entered the policies!" in str(ex.value) + + # NOTE: For files, we don't allow list of tuples yet, just dict. Will uncomment when we add this capability # def test_multipart_multiple_files_single_input_content(): # files = [ @@ -309,4 +424,4 @@ def test_use_custom_json_encoder(): # b"\r\n", # b"--+++--\r\n", # ] -# ) \ No newline at end of file +# ) diff --git a/sdk/core/azure-core/tests/test_retry_policy.py b/sdk/core/azure-core/tests/test_retry_policy.py index ce1a590fba26..8e989aed487c 100644 --- a/sdk/core/azure-core/tests/test_retry_policy.py +++ b/sdk/core/azure-core/tests/test_retry_policy.py @@ -8,6 +8,7 @@ except ImportError: from cStringIO import StringIO as BytesIO import pytest +from itertools import product from azure.core.configuration import ConnectionConfiguration from azure.core.exceptions import ( AzureError, @@ -22,7 +23,6 @@ ) from azure.core.pipeline import Pipeline, PipelineResponse from azure.core.pipeline.transport import ( - HttpRequest, HttpResponse, HttpTransport, ) @@ -34,6 +34,7 @@ from unittest.mock import Mock except ImportError: from mock import Mock +from utils import HTTP_REQUESTS def test_retry_code_class_variables(): @@ -62,10 +63,10 @@ def test_retry_types(): backoff_time = retry_policy.get_backoff_time(settings) assert backoff_time == 4 -@pytest.mark.parametrize("retry_after_input", [('0'), ('800'), ('1000'), ('1200')]) -def test_retry_after(retry_after_input): +@pytest.mark.parametrize("retry_after_input,http_request", product(['0', '800', '1000', '1200'], HTTP_REQUESTS)) +def test_retry_after(retry_after_input, http_request): retry_policy = RetryPolicy() - request = HttpRequest("GET", "http://localhost") + request = http_request("GET", "http://localhost") response = HttpResponse(request, None) response.headers["retry-after-ms"] = retry_after_input pipeline_response = PipelineResponse(request, response, None) @@ -80,10 +81,10 @@ def test_retry_after(retry_after_input): retry_after = retry_policy.get_retry_after(pipeline_response) assert retry_after == float(retry_after_input) -@pytest.mark.parametrize("retry_after_input", [('0'), ('800'), ('1000'), ('1200')]) -def test_x_ms_retry_after(retry_after_input): +@pytest.mark.parametrize("retry_after_input,http_request", product(['0', '800', '1000', '1200'], HTTP_REQUESTS)) +def test_x_ms_retry_after(retry_after_input, http_request): retry_policy = RetryPolicy() - request = HttpRequest("GET", "http://localhost") + request = http_request("GET", "http://localhost") response = HttpResponse(request, None) response.headers["x-ms-retry-after-ms"] = retry_after_input pipeline_response = PipelineResponse(request, response, None) @@ -98,7 +99,8 @@ def test_x_ms_retry_after(retry_after_input): retry_after = retry_policy.get_retry_after(pipeline_response) assert retry_after == float(retry_after_input) -def test_retry_on_429(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_retry_on_429(http_request): class MockTransport(HttpTransport): def __init__(self): self._count = 0 @@ -115,14 +117,15 @@ def send(self, request, **kwargs): # type: (PipelineRequest, Any) -> PipelineRe response.status_code = 429 return response - http_request = HttpRequest('GET', 'http://localhost/') + http_request = http_request('GET', 'http://localhost/') http_retry = RetryPolicy(retry_total = 1) transport = MockTransport() pipeline = Pipeline(transport, [http_retry]) pipeline.run(http_request) assert transport._count == 2 -def test_no_retry_on_201(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_no_retry_on_201(http_request): class MockTransport(HttpTransport): def __init__(self): self._count = 0 @@ -141,14 +144,15 @@ def send(self, request, **kwargs): # type: (PipelineRequest, Any) -> PipelineRe response.headers = headers return response - http_request = HttpRequest('GET', 'http://localhost/') + http_request = http_request('GET', 'http://localhost/') http_retry = RetryPolicy(retry_total = 1) transport = MockTransport() pipeline = Pipeline(transport, [http_retry]) pipeline.run(http_request) assert transport._count == 1 -def test_retry_seekable_stream(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_retry_seekable_stream(http_request): class MockTransport(HttpTransport): def __init__(self): self._first = True @@ -171,13 +175,14 @@ def send(self, request, **kwargs): # type: (PipelineRequest, Any) -> PipelineRe return response data = BytesIO(b"Lots of dataaaa") - http_request = HttpRequest('GET', 'http://localhost/') + http_request = http_request('GET', 'http://localhost/') http_request.set_streamed_data_body(data) http_retry = RetryPolicy(retry_total = 1) pipeline = Pipeline(MockTransport(), [http_retry]) pipeline.run(http_request) -def test_retry_seekable_file(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_retry_seekable_file(http_request): class MockTransport(HttpTransport): def __init__(self): self._first = True @@ -208,7 +213,7 @@ def send(self, request, **kwargs): # type: (PipelineRequest, Any) -> PipelineRe file = tempfile.NamedTemporaryFile(delete=False) file.write(b'Lots of dataaaa') file.close() - http_request = HttpRequest('GET', 'http://localhost/') + http_request = http_request('GET', 'http://localhost/') headers = {'Content-Type': "multipart/form-data"} http_request.headers = headers with open(file.name, 'rb') as f: @@ -222,8 +227,8 @@ def send(self, request, **kwargs): # type: (PipelineRequest, Any) -> PipelineRe pipeline.run(http_request) os.unlink(f.name) - -def test_retry_timeout(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_retry_timeout(http_request): timeout = 1 def send(request, **kwargs): @@ -239,10 +244,10 @@ def send(request, **kwargs): pipeline = Pipeline(transport, [RetryPolicy(timeout=timeout)]) with pytest.raises(ServiceResponseTimeoutError): - response = pipeline.run(HttpRequest("GET", "http://localhost/")) - + response = pipeline.run(http_request("GET", "http://localhost/")) -def test_timeout_defaults(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_timeout_defaults(http_request): """When "timeout" is not set, the policy should not override the transport's timeout configuration""" def send(request, **kwargs): @@ -259,17 +264,19 @@ def send(request, **kwargs): ) pipeline = Pipeline(transport, [RetryPolicy()]) - pipeline.run(HttpRequest("GET", "http://localhost/")) + pipeline.run(http_request("GET", "http://localhost/")) assert transport.send.call_count == 1, "policy should not retry: its first send succeeded" +combinations = [(ServiceRequestError, ServiceRequestTimeoutError), (ServiceResponseError, ServiceResponseTimeoutError)] @pytest.mark.parametrize( - "transport_error,expected_timeout_error", - ((ServiceRequestError, ServiceRequestTimeoutError), (ServiceResponseError, ServiceResponseTimeoutError)), + "combinations,http_request", + product(combinations, HTTP_REQUESTS), ) -def test_does_not_sleep_after_timeout(transport_error, expected_timeout_error): +def test_does_not_sleep_after_timeout(combinations, http_request): # With default settings policy will sleep twice before exhausting its retries: 1.6s, 3.2s. # It should not sleep the second time when given timeout=1 + transport_error,expected_timeout_error = combinations timeout = 1 transport = Mock( @@ -280,6 +287,6 @@ def test_does_not_sleep_after_timeout(transport_error, expected_timeout_error): pipeline = Pipeline(transport, [RetryPolicy(timeout=timeout)]) with pytest.raises(expected_timeout_error): - pipeline.run(HttpRequest("GET", "http://localhost/")) + pipeline.run(http_request("GET", "http://localhost/")) assert transport.sleep.call_count == 1 diff --git a/sdk/core/azure-core/tests/test_stream_generator.py b/sdk/core/azure-core/tests/test_stream_generator.py index 1d8b3c7172c4..4c9f5190e9c6 100644 --- a/sdk/core/azure-core/tests/test_stream_generator.py +++ b/sdk/core/azure-core/tests/test_stream_generator.py @@ -4,7 +4,6 @@ # ------------------------------------ import requests from azure.core.pipeline.transport import ( - HttpRequest, HttpResponse, HttpTransport, RequestsTransport, @@ -17,8 +16,10 @@ except ImportError: import mock import pytest +from utils import HTTP_REQUESTS -def test_connection_error_response(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_connection_error_response(http_request): class MockTransport(HttpTransport): def __init__(self): self._count = 0 @@ -31,7 +32,7 @@ def open(self): pass def send(self, request, **kwargs): - request = HttpRequest('GET', 'http://localhost/') + request = http_request('GET', 'http://localhost/') response = HttpResponse(request, None) response.status_code = 200 return response @@ -43,7 +44,7 @@ def __next__(self): if self._count == 0: self._count += 1 raise requests.exceptions.ConnectionError - + def stream(self, chunk_size, decode_content=False): if self._count == 0: self._count += 1 @@ -58,7 +59,7 @@ def __init__(self): def close(self): pass - http_request = HttpRequest('GET', 'http://localhost/') + http_request = http_request('GET', 'http://localhost/') pipeline = Pipeline(MockTransport()) http_response = HttpResponse(http_request, None) http_response.internal_response = MockInternalResponse() diff --git a/sdk/core/azure-core/tests/test_streaming.py b/sdk/core/azure-core/tests/test_streaming.py index 2a5e6a4d0bb8..87e51851722f 100644 --- a/sdk/core/azure-core/tests/test_streaming.py +++ b/sdk/core/azure-core/tests/test_streaming.py @@ -23,16 +23,19 @@ # THE SOFTWARE. # # -------------------------------------------------------------------------- +import pytest from azure.core import PipelineClient from azure.core.exceptions import DecodeError +from utils import HTTP_REQUESTS -def test_decompress_plain_no_header(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_decompress_plain_no_header(http_request): # expect plain text account_name = "coretests" account_url = "https://{}.blob.core.windows.net".format(account_name) url = "https://{}.blob.core.windows.net/tests/test.txt".format(account_name) client = PipelineClient(account_url) - request = client.get(url) + request = http_request("GET", url) pipeline_response = client._pipeline.run(request, stream=True) response = pipeline_response.http_response data = response.stream_download(client._pipeline, decompress=True) @@ -40,13 +43,14 @@ def test_decompress_plain_no_header(): decoded = content.decode('utf-8') assert decoded == "test" -def test_compress_plain_no_header(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_compress_plain_no_header(http_request): # expect plain text account_name = "coretests" account_url = "https://{}.blob.core.windows.net".format(account_name) url = "https://{}.blob.core.windows.net/tests/test.txt".format(account_name) client = PipelineClient(account_url) - request = client.get(url) + request = http_request("GET", url) pipeline_response = client._pipeline.run(request, stream=True) response = pipeline_response.http_response data = response.stream_download(client._pipeline, decompress=False) @@ -54,13 +58,14 @@ def test_compress_plain_no_header(): decoded = content.decode('utf-8') assert decoded == "test" -def test_decompress_compressed_no_header(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_decompress_compressed_no_header(http_request): # expect compressed text account_name = "coretests" account_url = "https://{}.blob.core.windows.net".format(account_name) url = "https://{}.blob.core.windows.net/tests/test.tar.gz".format(account_name) client = PipelineClient(account_url) - request = client.get(url) + request = http_request("GET", url) pipeline_response = client._pipeline.run(request, stream=True) response = pipeline_response.http_response data = response.stream_download(client._pipeline, decompress=True) @@ -71,13 +76,14 @@ def test_decompress_compressed_no_header(): except UnicodeDecodeError: pass -def test_compress_compressed_no_header(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_compress_compressed_no_header(http_request): # expect compressed text account_name = "coretests" account_url = "https://{}.blob.core.windows.net".format(account_name) url = "https://{}.blob.core.windows.net/tests/test.tar.gz".format(account_name) client = PipelineClient(account_url) - request = client.get(url) + request = http_request("GET", url) pipeline_response = client._pipeline.run(request, stream=True) response = pipeline_response.http_response data = response.stream_download(client._pipeline, decompress=False) @@ -88,14 +94,15 @@ def test_compress_compressed_no_header(): except UnicodeDecodeError: pass -def test_decompress_plain_header(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_decompress_plain_header(http_request): # expect error import requests account_name = "coretests" account_url = "https://{}.blob.core.windows.net".format(account_name) url = "https://{}.blob.core.windows.net/tests/test_with_header.txt".format(account_name) client = PipelineClient(account_url) - request = client.get(url) + request = http_request("GET", url) pipeline_response = client._pipeline.run(request, stream=True) response = pipeline_response.http_response data = response.stream_download(client._pipeline, decompress=True) @@ -105,13 +112,14 @@ def test_decompress_plain_header(): except (requests.exceptions.ContentDecodingError, DecodeError): pass -def test_compress_plain_header(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_compress_plain_header(http_request): # expect plain text account_name = "coretests" account_url = "https://{}.blob.core.windows.net".format(account_name) url = "https://{}.blob.core.windows.net/tests/test_with_header.txt".format(account_name) client = PipelineClient(account_url) - request = client.get(url) + request = http_request("GET", url) pipeline_response = client._pipeline.run(request, stream=True) response = pipeline_response.http_response data = response.stream_download(client._pipeline, decompress=False) @@ -119,13 +127,14 @@ def test_compress_plain_header(): decoded = content.decode('utf-8') assert decoded == "test" -def test_decompress_compressed_header(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_decompress_compressed_header(http_request): # expect plain text account_name = "coretests" account_url = "https://{}.blob.core.windows.net".format(account_name) url = "https://{}.blob.core.windows.net/tests/test_with_header.tar.gz".format(account_name) client = PipelineClient(account_url) - request = client.get(url) + request = http_request("GET", url) pipeline_response = client._pipeline.run(request, stream=True) response = pipeline_response.http_response data = response.stream_download(client._pipeline, decompress=True) @@ -133,13 +142,14 @@ def test_decompress_compressed_header(): decoded = content.decode('utf-8') assert decoded == "test" -def test_compress_compressed_header(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_compress_compressed_header(http_request): # expect compressed text account_name = "coretests" account_url = "https://{}.blob.core.windows.net".format(account_name) url = "https://{}.blob.core.windows.net/tests/test_with_header.tar.gz".format(account_name) client = PipelineClient(account_url) - request = client.get(url) + request = http_request("GET", url) pipeline_response = client._pipeline.run(request, stream=True) response = pipeline_response.http_response data = response.stream_download(client._pipeline, decompress=False) diff --git a/sdk/core/azure-core/tests/test_testserver.py b/sdk/core/azure-core/tests/test_testserver.py index 0cf5e4ffc26e..544778e32a79 100644 --- a/sdk/core/azure-core/tests/test_testserver.py +++ b/sdk/core/azure-core/tests/test_testserver.py @@ -23,11 +23,14 @@ # THE SOFTWARE. # # -------------------------------------------------------------------------- -from azure.core.pipeline.transport import HttpRequest, RequestsTransport +from azure.core.pipeline.transport import RequestsTransport +from utils import HTTP_REQUESTS +import pytest """This file does a simple call to the testserver to make sure we can use the testserver""" -def test_smoke(port): - request = HttpRequest(method="GET", url="http://localhost:{}/basic/string".format(port)) +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_smoke(port, http_request): + request = http_request(method="GET", url="http://localhost:{}/basic/string".format(port)) with RequestsTransport() as sender: response = sender.send(request) response.raise_for_status() diff --git a/sdk/core/azure-core/tests/test_tracing_decorator.py b/sdk/core/azure-core/tests/test_tracing_decorator.py index be9a820747e3..4c4b91d81420 100644 --- a/sdk/core/azure-core/tests/test_tracing_decorator.py +++ b/sdk/core/azure-core/tests/test_tracing_decorator.py @@ -14,12 +14,12 @@ import pytest from azure.core.pipeline import Pipeline, PipelineResponse from azure.core.pipeline.policies import HTTPPolicy -from azure.core.pipeline.transport import HttpTransport, HttpRequest +from azure.core.pipeline.transport import HttpTransport from azure.core.settings import settings from azure.core.tracing import common from azure.core.tracing.decorator import distributed_trace from tracing_common import FakeSpan - +from utils import HTTP_REQUESTS @pytest.fixture(scope="module") def fake_span(): @@ -28,9 +28,9 @@ def fake_span(): class MockClient: @distributed_trace - def __init__(self, policies=None, assert_current_span=False): + def __init__(self, http_request, policies=None, assert_current_span=False): time.sleep(0.001) - self.request = HttpRequest("GET", "http://localhost") + self.request = http_request("GET", "http://localhost") if policies is None: policies = [] policies.append(mock.Mock(spec=HTTPPolicy, send=self.verify_request)) @@ -87,8 +87,9 @@ def random_function(): pass -def test_get_function_and_class_name(): - client = MockClient() +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_get_function_and_class_name(http_request): + client = MockClient(http_request) assert common.get_function_and_class_name(client.get_foo, client) == "MockClient.get_foo" assert common.get_function_and_class_name(random_function) == "random_function" @@ -96,9 +97,10 @@ def test_get_function_and_class_name(): @pytest.mark.usefixtures("fake_span") class TestDecorator(object): - def test_decorator_tracing_attr(self): + @pytest.mark.parametrize("http_request", HTTP_REQUESTS) + def test_decorator_tracing_attr(self, http_request): with FakeSpan(name="parent") as parent: - client = MockClient() + client = MockClient(http_request) client.tracing_attr() assert len(parent.children) == 2 @@ -106,18 +108,20 @@ def test_decorator_tracing_attr(self): assert parent.children[1].name == "MockClient.tracing_attr" assert parent.children[1].attributes == {'foo': 'bar'} - def test_decorator_has_different_name(self): + @pytest.mark.parametrize("http_request", HTTP_REQUESTS) + def test_decorator_has_different_name(self, http_request): with FakeSpan(name="parent") as parent: - client = MockClient() + client = MockClient(http_request) client.check_name_is_different() assert len(parent.children) == 2 assert parent.children[0].name == "MockClient.__init__" assert parent.children[1].name == "different name" - def test_used(self): + @pytest.mark.parametrize("http_request", HTTP_REQUESTS) + def test_used(self, http_request): with FakeSpan(name="parent") as parent: - client = MockClient(policies=[]) + client = MockClient(http_request, policies=[]) client.get_foo(parent_span=parent) client.get_foo() @@ -129,9 +133,10 @@ def test_used(self): assert parent.children[2].name == "MockClient.get_foo" assert not parent.children[2].children - def test_span_merge_span(self): + @pytest.mark.parametrize("http_request", HTTP_REQUESTS) + def test_span_merge_span(self, http_request): with FakeSpan(name="parent") as parent: - client = MockClient() + client = MockClient(http_request) client.merge_span_method() client.no_merge_span_method() @@ -143,9 +148,10 @@ def test_span_merge_span(self): assert parent.children[2].name == "MockClient.no_merge_span_method" assert parent.children[2].children[0].name == "MockClient.get_foo" - def test_span_complicated(self): + @pytest.mark.parametrize("http_request", HTTP_REQUESTS) + def test_span_complicated(self, http_request): with FakeSpan(name="parent") as parent: - client = MockClient() + client = MockClient(http_request) client.make_request(2) with parent.span("child") as child: time.sleep(0.001) @@ -163,11 +169,12 @@ def test_span_complicated(self): assert parent.children[3].name == "MockClient.make_request" assert not parent.children[3].children - def test_span_with_exception(self): + @pytest.mark.parametrize("http_request", HTTP_REQUESTS) + def test_span_with_exception(self, http_request): """Assert that if an exception is raised, the next sibling method is actually a sibling span. """ with FakeSpan(name="parent") as parent: - client = MockClient() + client = MockClient(http_request) try: client.raising_exception() except: diff --git a/sdk/core/azure-core/tests/test_tracing_policy.py b/sdk/core/azure-core/tests/test_tracing_policy.py index 2a0fc03a78e7..ef46a53197e3 100644 --- a/sdk/core/azure-core/tests/test_tracing_policy.py +++ b/sdk/core/azure-core/tests/test_tracing_policy.py @@ -7,10 +7,12 @@ from azure.core.pipeline import PipelineResponse, PipelineRequest, PipelineContext from azure.core.pipeline.policies import DistributedTracingPolicy, UserAgentPolicy -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse from azure.core.settings import settings from tracing_common import FakeSpan import time +import pytest +from utils import HTTP_REQUESTS try: from unittest import mock @@ -18,13 +20,14 @@ import mock -def test_distributed_tracing_policy_solo(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_distributed_tracing_policy_solo(http_request): """Test policy with no other policy and happy path""" settings.tracing_implementation.set_value(FakeSpan) with FakeSpan(name="parent") as root_span: policy = DistributedTracingPolicy() - request = HttpRequest("GET", "http://localhost/temp?query=query") + request = http_request("GET", "http://localhost/temp?query=query") request.headers["x-ms-client-request-id"] = "some client request id" pipeline_request = PipelineRequest(request, PipelineContext(None)) @@ -68,7 +71,8 @@ def test_distributed_tracing_policy_solo(): assert network_span.attributes.get("http.status_code") == 504 -def test_distributed_tracing_policy_attributes(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_distributed_tracing_policy_attributes(http_request): """Test policy with no other policy and happy path""" settings.tracing_implementation.set_value(FakeSpan) with FakeSpan(name="parent") as root_span: @@ -76,7 +80,7 @@ def test_distributed_tracing_policy_attributes(): 'myattr': 'myvalue' }) - request = HttpRequest("GET", "http://localhost/temp?query=query") + request = http_request("GET", "http://localhost/temp?query=query") pipeline_request = PipelineRequest(request, PipelineContext(None)) policy.on_request(pipeline_request) @@ -92,13 +96,14 @@ def test_distributed_tracing_policy_attributes(): assert network_span.attributes.get("myattr") == "myvalue" -def test_distributed_tracing_policy_badurl(caplog): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_distributed_tracing_policy_badurl(caplog, http_request): """Test policy with a bad url that will throw, and be sure policy ignores it""" settings.tracing_implementation.set_value(FakeSpan) with FakeSpan(name="parent") as root_span: policy = DistributedTracingPolicy() - request = HttpRequest("GET", "http://[[[") + request = http_request("GET", "http://[[[") request.headers["x-ms-client-request-id"] = "some client request id" pipeline_request = PipelineRequest(request, PipelineContext(None)) @@ -125,14 +130,15 @@ def test_distributed_tracing_policy_badurl(caplog): assert len(root_span.children) == 0 -def test_distributed_tracing_policy_with_user_agent(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_distributed_tracing_policy_with_user_agent(http_request): """Test policy working with user agent.""" settings.tracing_implementation.set_value(FakeSpan) with mock.patch.dict('os.environ', {"AZURE_HTTP_USER_AGENT": "mytools"}): with FakeSpan(name="parent") as root_span: policy = DistributedTracingPolicy() - request = HttpRequest("GET", "http://localhost") + request = http_request("GET", "http://localhost") request.headers["x-ms-client-request-id"] = "some client request id" pipeline_request = PipelineRequest(request, PipelineContext(None)) @@ -183,11 +189,12 @@ def test_distributed_tracing_policy_with_user_agent(): assert network_span.status == 'Transport trouble' -def test_span_namer(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_span_namer(http_request): settings.tracing_implementation.set_value(FakeSpan) with FakeSpan(name="parent") as root_span: - request = HttpRequest("GET", "http://localhost/temp?query=query") + request = http_request("GET", "http://localhost/temp?query=query") pipeline_request = PipelineRequest(request, PipelineContext(None)) def fixed_namer(http_request): diff --git a/sdk/core/azure-core/tests/test_universal_pipeline.py b/sdk/core/azure-core/tests/test_universal_pipeline.py index ea5676374458..9d532608228b 100644 --- a/sdk/core/azure-core/tests/test_universal_pipeline.py +++ b/sdk/core/azure-core/tests/test_universal_pipeline.py @@ -42,7 +42,6 @@ PipelineContext ) from azure.core.pipeline.transport import ( - HttpRequest, HttpResponse, RequestsTransportResponse, ) @@ -54,6 +53,7 @@ RetryPolicy, HTTPPolicy, ) +from utils import HTTP_REQUESTS, create_http_request def test_pipeline_context(): kwargs={ @@ -86,26 +86,28 @@ def test_pipeline_context(): assert len(revived_context) == 1 -def test_request_history(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_request_history(http_request): class Non_deep_copiable(object): def __deepcopy__(self, memodict={}): raise ValueError() body = Non_deep_copiable() - request = HttpRequest('GET', 'http://localhost/', {'user-agent': 'test_request_history'}) + request = create_http_request(http_request, 'GET', 'http://localhost/', {'user-agent': 'test_request_history'}) request.body = body request_history = RequestHistory(request) assert request_history.http_request.headers == request.headers assert request_history.http_request.url == request.url assert request_history.http_request.method == request.method -def test_request_history_type_error(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_request_history_type_error(http_request): class Non_deep_copiable(object): def __deepcopy__(self, memodict={}): raise TypeError() body = Non_deep_copiable() - request = HttpRequest('GET', 'http://localhost/', {'user-agent': 'test_request_history'}) + request = create_http_request(http_request, 'GET', 'http://localhost/', {'user-agent': 'test_request_history'}) request.body = body request_history = RequestHistory(request) assert request_history.http_request.headers == request.headers @@ -113,8 +115,9 @@ def __deepcopy__(self, memodict={}): assert request_history.http_request.method == request.method @mock.patch('azure.core.pipeline.policies._universal._LOGGER') -def test_no_log(mock_http_logger): - universal_request = HttpRequest('GET', 'http://localhost/') +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_no_log(mock_http_logger, http_request): + universal_request = http_request('GET', 'http://localhost/') request = PipelineRequest(universal_request, PipelineContext(None)) http_logger = NetworkTraceLoggingPolicy() response = PipelineResponse(request, HttpResponse(universal_request, None), request.context) @@ -178,7 +181,8 @@ def test_no_log(mock_http_logger): second_count = mock_http_logger.debug.call_count assert second_count == first_count * 2 -def test_retry_without_http_response(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_retry_without_http_response(http_request): class NaughtyPolicy(HTTPPolicy): def send(*args): raise AzureError('boo') @@ -186,12 +190,13 @@ def send(*args): policies = [RetryPolicy(), NaughtyPolicy()] pipeline = Pipeline(policies=policies, transport=None) with pytest.raises(AzureError): - pipeline.run(HttpRequest('GET', url='https://foo.bar')) + pipeline.run(http_request('GET', url='https://foo.bar')) -def test_raw_deserializer(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_raw_deserializer(http_request): raw_deserializer = ContentDecodePolicy() context = PipelineContext(None, stream=False) - universal_request = HttpRequest('GET', 'http://localhost/') + universal_request = http_request('GET', 'http://localhost/') request = PipelineRequest(universal_request, context) def build_response(body, content_type=None): diff --git a/sdk/core/azure-core/tests/test_user_agent_policy.py b/sdk/core/azure-core/tests/test_user_agent_policy.py index 4f8b01c93b7e..afed968f149f 100644 --- a/sdk/core/azure-core/tests/test_user_agent_policy.py +++ b/sdk/core/azure-core/tests/test_user_agent_policy.py @@ -4,14 +4,16 @@ # ------------------------------------ """Tests for the user agent policy.""" from azure.core.pipeline.policies import UserAgentPolicy -from azure.core.pipeline.transport import HttpRequest from azure.core.pipeline import PipelineRequest, PipelineContext try: from unittest import mock except ImportError: import mock +import pytest +from utils import HTTP_REQUESTS -def test_user_agent_policy(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_user_agent_policy(http_request): user_agent = UserAgentPolicy(base_user_agent='foo') assert user_agent._user_agent == 'foo' @@ -21,7 +23,7 @@ def test_user_agent_policy(): user_agent = UserAgentPolicy(base_user_agent='foo', user_agent='bar', user_agent_use_env=False) assert user_agent._user_agent == 'bar foo' - request = HttpRequest('GET', 'http://localhost/') + request = http_request('GET', 'http://localhost/') pipeline_request = PipelineRequest(request, PipelineContext(None)) pipeline_request.context.options['user_agent'] = 'xyz' @@ -29,12 +31,13 @@ def test_user_agent_policy(): assert request.headers['User-Agent'] == 'xyz bar foo' -def test_user_agent_environ(): +@pytest.mark.parametrize("http_request", HTTP_REQUESTS) +def test_user_agent_environ(http_request): with mock.patch.dict('os.environ', {'AZURE_HTTP_USER_AGENT': "mytools"}): policy = UserAgentPolicy(None) assert policy.user_agent.endswith("mytools") - request = HttpRequest('GET', 'http://localhost/') + request = http_request('GET', 'http://localhost/') policy.on_request(PipelineRequest(request, PipelineContext(None))) assert request.headers["user-agent"].endswith("mytools") diff --git a/sdk/core/azure-core/tests/utils.py b/sdk/core/azure-core/tests/utils.py new file mode 100644 index 000000000000..ab3be4d12d1d --- /dev/null +++ b/sdk/core/azure-core/tests/utils.py @@ -0,0 +1,43 @@ +# ------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See LICENSE.txt in the project root for +# license information. +# ------------------------------------------------------------------------- +import pytest +############################## LISTS USED TO PARAMETERIZE TESTS ############################## +from azure.core.rest import HttpRequest as RestHttpRequest +from azure.core.pipeline.transport import HttpRequest as PipelineTransportHttpRequest + +HTTP_REQUESTS = [PipelineTransportHttpRequest, RestHttpRequest] + + +############################## HELPER FUNCTIONS ############################## + +def is_rest(http_request): + return hasattr(http_request, "content") + +def create_http_request(http_request, *args, **kwargs): + if hasattr(http_request, "content"): + method = args[0] + url = args[1] + try: + headers = args[2] + except IndexError: + headers = None + try: + files = args[3] + except IndexError: + files = None + try: + data = args[4] + except IndexError: + data = None + return http_request( + method=method, + url=url, + headers=headers, + files=files, + data=data, + **kwargs + ) + return http_request(*args, **kwargs)